@aidotnet/server-darwin-arm64 0.11.1 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/astra-server +2 -2
- package/bin/libe_sqlite3.dylib +0 -0
- package/bin/wwwroot/assets/ClientsPage-DUe3cdEu.js +9 -0
- package/bin/wwwroot/assets/KeyPage-D2ItNgUp.js +1 -0
- package/bin/wwwroot/assets/ModelDetailPage-HlmdOI1u.js +1 -0
- package/bin/wwwroot/assets/ModelsPage-jTdzziih.js +1 -0
- package/bin/wwwroot/assets/PluginsPage-CrRbTNkX.js +2 -0
- package/bin/wwwroot/assets/PrivacyPage-C24xx5h0.js +1 -0
- package/bin/wwwroot/assets/ProviderDetailPage-C8oS6Rpp.js +3 -0
- package/bin/wwwroot/assets/ProvidersPage-CtzKM5FI.js +2 -0
- package/bin/wwwroot/assets/SettingsPage-CuaktA37.js +2 -0
- package/bin/wwwroot/assets/SmartRoutingPage-DRExfwox.js +2 -0
- package/bin/wwwroot/assets/TokenDetailPage-BecIf_R9.js +1 -0
- package/bin/wwwroot/assets/{TokenPoolEditor-BITgITLH.js → TokenPoolEditor-B3t0QNlg.js} +1 -1
- package/bin/wwwroot/assets/TokensPage-DnMBcutS.js +1 -0
- package/bin/wwwroot/assets/TracesPage-AYH3RZE9.js +7 -0
- package/bin/wwwroot/assets/{TrayPanelPage-BwaSGRbR.js → TrayPanelPage-OyBx1HTr.js} +1 -1
- package/bin/wwwroot/assets/{TrayPanelView-CAF6qwfK.js → TrayPanelView-B4sGBvxd.js} +1 -1
- package/bin/wwwroot/assets/alert-qNPoglGp.js +15 -0
- package/bin/wwwroot/assets/{arrow-down-CHVkKqVB.js → arrow-down-BtJQJK1L.js} +1 -1
- package/bin/wwwroot/assets/{arrow-left-ByzgpjKh.js → arrow-left-D6dVbOnl.js} +1 -1
- package/bin/wwwroot/assets/{checkbox-B_oHm90b.js → checkbox-B47xSnbl.js} +1 -1
- package/bin/wwwroot/assets/{cloud-download-DEv0Zu87.js → cloud-download-D2BBix7a.js} +1 -1
- package/bin/wwwroot/assets/confirm-morph-CgGgkVSl.js +1 -0
- package/bin/wwwroot/assets/{download-DXwZa8b6.js → download-COSgQOSF.js} +1 -1
- package/bin/wwwroot/assets/{ellipsis-DhvUvMq3.js → ellipsis-DU9LNejQ.js} +1 -1
- package/bin/wwwroot/assets/{external-link-D9cY56rt.js → external-link--dZT5Rkw.js} +1 -1
- package/bin/wwwroot/assets/{folder-open-Dt-7Rdbw.js → folder-open-ClaryP3F.js} +1 -1
- package/bin/wwwroot/assets/{index-Dt3DJ3Cx.css → index-BUzE8kPN.css} +1 -1
- package/bin/wwwroot/assets/index-DDjZdUEf.js +17 -0
- package/bin/wwwroot/assets/{log-out-wpGBd0OK.js → log-out-Tl6vCHvW.js} +1 -1
- package/bin/wwwroot/assets/minus-Bs-msHR3.js +1 -0
- package/bin/wwwroot/assets/overlays-ORpFxiz4.js +41 -0
- package/bin/wwwroot/assets/{pencil-BjMGSY_u.js → pencil-jnrNOWQy.js} +1 -1
- package/bin/wwwroot/assets/{power-zBXM8vYz.js → power-BYCH_AFm.js} +1 -1
- package/bin/wwwroot/assets/radio-cards-CyXEQMJG.js +1 -0
- package/bin/wwwroot/assets/{rotate-ccw-Omdd6cJU.js → rotate-ccw-D-Km3lpa.js} +1 -1
- package/bin/wwwroot/assets/{sortable.esm-CTCQ-9IR.js → sortable.esm-Br0EL6LB.js} +1 -1
- package/bin/wwwroot/assets/tkcode-COOcwqQh.png +0 -0
- package/bin/wwwroot/index.html +4 -4
- package/package.json +1 -1
- package/bin/wwwroot/assets/ClientsPage-C-x5kPpG.js +0 -9
- package/bin/wwwroot/assets/KeyPage-CxvUUC6Z.js +0 -1
- package/bin/wwwroot/assets/ModelDetailPage-CQol60ci.js +0 -1
- package/bin/wwwroot/assets/ModelsPage-Bp1-Rhad.js +0 -1
- package/bin/wwwroot/assets/PluginsPage-YPDqytJ6.js +0 -2
- package/bin/wwwroot/assets/PrivacyPage-Co1ffmVU.js +0 -1
- package/bin/wwwroot/assets/ProviderDetailPage-CacRreeZ.js +0 -3
- package/bin/wwwroot/assets/ProvidersPage-DSwvae35.js +0 -2
- package/bin/wwwroot/assets/SettingsPage-CvIE8pBq.js +0 -2
- package/bin/wwwroot/assets/TokenDetailPage-w1XONN5-.js +0 -1
- package/bin/wwwroot/assets/TokensPage-CiL0dLkj.js +0 -1
- package/bin/wwwroot/assets/TracesPage-zcvvDcj3.js +0 -7
- package/bin/wwwroot/assets/alert-BhYHbQ5M.js +0 -15
- package/bin/wwwroot/assets/confirm-morph-RDk31i1j.js +0 -1
- package/bin/wwwroot/assets/index-XVK9epgF.js +0 -17
- package/bin/wwwroot/assets/minus-3JX68qL9.js +0 -1
- package/bin/wwwroot/assets/overlays-CF55BHOs.js +0 -41
- package/bin/wwwroot/assets/radio-cards-BVdDbnT-.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{xt as e}from"./alert-qNPoglGp.js";var t={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{xt as e}from"./alert-qNPoglGp.js";var t={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{A as e,Bi as t,C as n,D as r,E as i,Ea as a,Ei as o,Et as s,F as c,Gi as l,Hi as u,I as d,Ia as f,M as p,Ma as m,Mi as h,N as g,Na as _,O as v,Oa as y,Oi as b,P as x,Q as S,R as C,Ri as w,S as T,Vi as E,Wi as D,Y as O,aa as k,bt as A,ca as j,ct as M,da as N,dt as ee,ga as P,ia as F,j as I,ja as L,k as R,ki as z,la as te,lt as B,na as ne,oa as re,ot as ie,pa as ae,pt as oe,r as se,ra as ce,sa as le,t as ue,ua as de,va as fe,vn as pe,wa as me,xt as he,yt as ge,z as _e,zi as V}from"./alert-qNPoglGp.js";function ve(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var ye=class extends fe{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,P.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!y(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(ve(e,n).forEach(e=>{e.destroy()}),ve(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=a(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new ae(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&P.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},H=f(_(),1);function be({queries:e,...t},n){let r=L(n),i=N(),a=de(),o=t.subscribed!==!1,s=H.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{F(e);let t=r.getQueryCache().get(e.queryHash);le(e,a,t)}),te(a);let[c]=H.useState(()=>new ye(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;H.useSyncExternalStore(H.useCallback(e=>f?c.subscribe(P.batchCalls(e)):me,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),H.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>re(s[t],e))?l.flatMap((e,t)=>{let n=s[t];if(n&&re(n,e)){let e=new ae(r,n);return k(n,e,a)}return[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&j({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}var xe={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};xe.node;var Se=he(xe),Ce={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Ce.node;var we=he(Ce),Te={canOpenPaths:!!h(),async openPath(e){let t=h();return t?t.openPath(e):!1},async revealLogs(){return await h()?.revealLogs()??!1},async copy(e){if(window.isSecureContext&&navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}return De(e)},async contextMenu(e){let t=h();if(t)return t.showContextMenu(e)},async startService(){let e=h();return e?e.startService():null},async restartService(){let e=h();return e?e.restartService():null}};function Ee(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t>0?e.slice(0,t):e}function De(e){let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.cssText=`position:fixed;top:0;left:0;opacity:0;pointer-events:none`;let n=document.activeElement;document.body.appendChild(t);try{return t.focus(),t.select(),t.setSelectionRange(0,e.length),document.execCommand(`copy`)}catch{return!1}finally{document.body.removeChild(t),n?.focus?.()}}var Oe={config:`providers.quota.error.config`,no_key:`providers.quota.error.no_key`,unauthorized:`providers.quota.error.unauthorized`,no_endpoint:`providers.quota.error.no_endpoint`,rate_limited:`providers.quota.error.rate_limited`,upstream:`providers.quota.error.upstream`,timeout:`providers.quota.error.timeout`,network:`providers.quota.error.network`,not_json:`providers.quota.error.not_json`,too_large:`providers.quota.error.too_large`,empty:`providers.quota.error.empty`},ke=/^[A-Z]{3}$/;function Ae(e,t,n){let r=n===`zh`?`zh-CN`:`en-US`;if(t&&ke.test(t))try{let n=e!==0&&Math.abs(e)<1;return new Intl.NumberFormat(r,{style:`currency`,currency:t,minimumFractionDigits:2,maximumFractionDigits:n?4:2}).format(e)}catch{}let i=new Intl.NumberFormat(r,{maximumFractionDigits:2}).format(e);return t?`${i} ${t}`:i}var je=e=>e.windowMinutes!=null&&e.usedPercent!=null;function Me(e){return e.usedPercent!=null&&Number.isFinite(e.usedPercent)?Math.min(100,Math.max(0,e.usedPercent)):e.used!=null&&e.total!=null&&e.total>0?Math.min(100,Math.max(0,e.used/e.total*100)):null}function Ne(e){return!e?.error||e.fetchedAtUtc&&e.errorAtUtc&&new Date(e.errorAtUtc).getTime()<new Date(e.fetchedAtUtc).getTime()?null:{code:e.errorCode??null,message:e.error}}function Pe(e,t){return e.code?t(Oe[e.code]):e.message}function Fe(e,t,n){let r=Me(e);if(je(e))return t(`providers.quota.window`,{window:pt(e.windowMinutes,n),percent:Math.round(r??0)});if(e.remaining!=null){let i=t(`providers.quota.balance`,{amount:Ae(e.remaining,e.unit,n)});return r==null?i:`${i} · ${t(`providers.quota.usedPercent`,{percent:Math.round(r)})}`}return r==null?e.used!=null&&e.total!=null?t(`providers.quota.totalUsed`,{used:Ae(e.used,e.unit,n),total:Ae(e.total,e.unit,n)}):null:t(`providers.quota.usedPercent`,{percent:Math.round(r)})}function Ie(e,t,n){let r=mt(e.resetsAtUtc??null,n);return r?t(`providers.quota.resets`,{time:r}):null}function Le(e,t,n){let r=(e?.plans??[]).map(e=>Fe(e,t,n)).filter(e=>!!e);return e?.isValid===!1&&r.unshift(t(`providers.quota.invalid`)),r.length?r.join(` · `):null}var Re=e=>e.authScheme!==`oauth-subscription`&&!!e.quotaConfig?.enabled;function ze(e,t){let n=new Map;for(let r of e)n.set(r.bucket,(n.get(r.bucket)??0)+r[t]);return[...n.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({bucket:e,value:t}))}var Be=e=>String(e).padStart(2,`0`),Ve=e=>`${e.getFullYear()}-${Be(e.getMonth()+1)}-${Be(e.getDate())}`,He={"7d":7,"30d":30,"90d":90};function Ue(e,t=new Date){if(e===`today`)return new Date(t.getFullYear(),t.getMonth(),t.getDate());let n=He[e];return n?new Date(t.getFullYear(),t.getMonth(),t.getDate()-(n-1)):null}function We(e=365,t=new Date){let n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=new Date(n.getFullYear(),n.getMonth(),n.getDate()-(e-1)),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()-(r.getDay()+6)%7),a=new Date(n.getFullYear(),n.getMonth(),n.getDate()+(6-(n.getDay()+6)%7)),o=[];for(let e=i;e<=a;e=new Date(e.getFullYear(),e.getMonth(),e.getDate()+1))o.push(Ve(e));let s=[],c=[];for(let e=0;e<o.length;e+=7)s.push(Array.from({length:7},(t,n)=>e+n)),c.push({index:s.length-1,month:Number(o[e].slice(5,7)),year:Number(o[e].slice(0,4))});return{days:o,weeks:s,months:s.flatMap((e,t)=>{let n=e.find(e=>o[e].slice(8)===`01`);return n===void 0?[]:[{index:t,label:Number(o[n].slice(5,7))}]}),monthLabels:c}}function Ge(e,t){return e<=0?0:t<=0?1:Math.min(4,Math.max(1,Math.ceil(e/t*4)))}function Ke(e,t=new Date){if(e===`today`){let e=Ve(t);return Array.from({length:24},(t,n)=>`${e}T${Be(n)}:00`)}let n=Ue(e,t),r=He[e]??0;return n?Array.from({length:r},(e,t)=>Ve(new Date(n.getFullYear(),n.getMonth(),n.getDate()+t))):[]}function qe(e,t){if(t.length===0)return e;let n=new Map(e.map(e=>[e.bucket,e.value]));return t.map(e=>({bucket:e,value:n.get(e)??0}))}var Je=e=>`${e.slice(5,7)}/${e.slice(8,10)}`,Ye=e=>e.includes(`T`)?e.slice(11,16):Je(e),Xe=e=>e.includes(`T`)?`${Je(e)} ${e.slice(11,16)}`:Je(e);function Ze(e){let t=new Map;for(let n of e){let e=t.get(n.key)??{key:n.key,requests:0,tokens:0,costUsd:0};e.requests+=n.requests,e.tokens+=n.tokens,e.costUsd+=n.costUsd,t.set(n.key,e)}let n=[...t.values()],r=n.reduce((e,t)=>e+t.costUsd,0),i=n.reduce((e,t)=>e+t.requests,0);return n.map(e=>({...e,share:r>0?e.costUsd/r:i>0?e.requests/i:0}))}function Qe(e){return Math.max(0,Math.round(e.requests*(1-e.successRate)))}function $e(e){return!Number.isFinite(e)||e<=0?`$0`:e<.01?`$<0.01`:e<1e3?`$${e.toFixed(2)}`:S(e,{compact:!0})}function et(e,t=new Date){return qe(ze(e,`requests`),Ke(`today`,t))}var tt=e=>String(e).padStart(2,`0`);function nt(e,t=new Date){let n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1),r=`${n.getFullYear()}-${tt(n.getMonth()+1)}-${tt(n.getDate())}`;return e.filter(e=>e.bucket===r).reduce((e,t)=>e+t.tokens,0)}function rt(e,t){return t<=0?null:(e-t)/t}function it(e,t){let n=[...e].sort((e,t)=>t.tokens-e.tokens)[0];return!n||n.tokens<=0?null:{model:n.model,share:t>0?Math.min(1,n.tokens/t):1}}var at={session:300,weekly:10080};function ot(e){return e==null||!Number.isFinite(e)?null:Math.min(100,Math.max(0,100-e))}function st(e,t){let n=ot(t?.usedPercent);return n===null?null:{kind:e,windowMinutes:t?.windowMinutes??at[e],remaining:n,resetsAt:t?.resetsAtUtc??null}}function ct(e){let t=[];for(let{provider:n,account:r}of e){if(r.status!==`active`||!r.quota)continue;let e=r.quota,i=[st(`session`,e.session),st(`weekly`,e.weekly)].filter(e=>e!==null),a=ot(e.credits?.usedPercent);a!==null&&i.push({kind:`credits`,windowMinutes:null,remaining:a,resetsAt:null}),i.length!==0&&t.push({accountId:r.id,providerId:n.id,providerName:e.planLabel||n.name,providerIcon:n.icon??null,accountName:r.displayName||r.accountEmail||r.id,rows:i})}return t}function lt(e){let t=[];for(let n of e){if(!n.enabled||!Re(n)||n.quota?.isValid===!1)continue;let e=[];for(let t of n.quota?.plans??[]){let n=Me(t);je(t)?e.push({kind:`window`,windowMinutes:t.windowMinutes??null,remaining:100-(n??0),resetsAt:t.resetsAtUtc??null}):(t.remaining!=null||n!=null)&&e.push({kind:`balance`,windowMinutes:null,remaining:n==null?null:100-n,resetsAt:t.resetsAtUtc??null,amount:t.remaining==null?null:{value:t.remaining,unit:t.unit??null},label:t.name??null})}e.length!==0&&t.push({accountId:`provider:${n.id}`,providerId:n.id,providerName:n.name,providerIcon:n.icon??null,accountName:``,rows:e})}return t}function ut(e){let t=null;for(let n of e)for(let e of n.rows)e.remaining!==null&&(!t||e.remaining<t.row.remaining)&&(t={plan:n,row:{...e,remaining:e.remaining}});return t}function dt(e,t){let n=[];for(let t of e)for(let e of t.rows)e.remaining!==null&&n.push({plan:t,row:{...e,remaining:e.remaining}});return n.sort((e,t)=>e.row.remaining-t.row.remaining).slice(0,t)}function ft(e){return e<10?`red`:e<30?`orange`:`green`}function pt(e,t){let n=(e,n)=>new Intl.NumberFormat(t===`zh`?`zh-CN`:`en-US`,{style:`unit`,unit:n,unitDisplay:t===`zh`?`long`:`narrow`}).format(e);return e>=1440&&e%1440==0?n(e/1440,`day`):e>=60?n(Math.round(e/60),`hour`):n(e,`minute`)}function mt(e,t,n=Date.now()){if(!e)return null;let r=new Date(e).getTime()-n;if(!Number.isFinite(r)||r<=0)return null;let i=new Intl.RelativeTimeFormat(t===`zh`?`zh-CN`:`en-US`,{numeric:`auto`}),a=r/36e5;return a>=48?i.format(Math.round(a/24),`day`):a>=1?i.format(Math.round(a),`hour`):i.format(Math.max(1,Math.round(r/6e4)),`minute`)}function ht(e,t,n,r=Date.now()){if(!e)return null;let i=Math.max(0,(r-e)/1e3),a=new Intl.RelativeTimeFormat(t===`zh`?`zh-CN`:`en-US`,{numeric:`auto`});return i<60?n:i<3600?a.format(-Math.round(i/60),`minute`):a.format(-Math.round(i/3600),`hour`)}function gt(e,t,n){let r={title:``,detail:``};if(e===`none`)return r;if(e===`alerts`){if(!t.running)return{title:`!`,detail:n.stopped};let e=t.summary?Qe(t.summary):0;if(e>0)return{title:`⚠ ${e}`,detail:n.failures(e)};let i=ut(t.plans);if(i&&i.row.remaining<10){let e=`${Math.round(i.row.remaining)}%`;return{title:`⚠ ${e}`,detail:n.quota(i.plan.providerName,n.windowName(i.row),e)}}return r}if(e===`quota`){let e=ut(t.plans);if(!e)return r;let i=`${Math.round(e.row.remaining)}%`;return{title:i,detail:n.quota(e.plan.providerName,n.windowName(e.row),i)}}let i=t.summary;if(!i||!t.running)return r;switch(e){case`requests`:{let e=O(i.requests,!0);return{title:e,detail:n.requests(e)}}case`tokens`:{let e=O(i.inputTokens+i.outputTokens,!0);return{title:e,detail:n.tokens(e)}}case`cost`:{let e=$e(i.costUsd);return{title:e,detail:n.cost(e)}}}}var _t={title:`requests`,sections:{overview:!0,cost:!0,chart:!0,topModel:!0,compareYesterday:!1,cacheHitRate:!1,quota:!0,clients:!1}},vt=()=>!!h()?.tray;function yt(){let[e,t]=(0,H.useState)(_t),[n,r]=(0,H.useState)(!h()?.tray);return(0,H.useEffect)(()=>{let e=h()?.tray;if(!e)return;let n=!0;e.getPrefs().then(e=>{n&&(t(e),r(!0))});let i=e.onPrefsChanged(t);return()=>{n=!1,i()}},[]),[e,(0,H.useCallback)(e=>{t(e);let n=h()?.tray;n&&n.setPrefs(e).then(t)},[]),n]}function bt(){let e=pe(),[t,n]=(0,H.useState)(null);return(0,H.useEffect)(()=>{let e=h()?.tray;if(!e)return;let t=!0;e.getState().then(e=>{t&&n(e)});let r=e.onStateChanged(n);return()=>{t=!1,r()}},[]),t??{running:e.isSuccess,port:null,activity:null,apiVersionMismatch:!1,updateAvailable:null}}function xt(e,t,n){return{...e,sections:{...e.sections,[t]:n}}}var St=3e5,Ct=new Map,wt=()=>-new Date().getTimezoneOffset(),Tt=Object.fromEntries(z.map(e=>[e,!1]));function Et(e,t){let n=L(),{enabled:r,background:i}=t,a=t.titleOnly?Tt:e.sections,c=e.title!==`none`&&e.title!==`quota`,l=e.title===`quota`||e.title===`alerts`,u={refetchInterval:15e3,refetchIntervalInBackground:!1},d=a.quota||l,f=ce({queryKey:s.settings,queryFn:()=>o(`GET`,`/api/settings`),enabled:r}),p=ce({queryKey:s.stats(`summary`,`today`,``,``),queryFn:()=>o(`GET`,`/api/stats/summary?range=today`),enabled:r,...u,refetchIntervalInBackground:i&&c}),m=ce({queryKey:s.stats(`timeseries`,`today`,`hour`,`provider`,``,``,wt()),queryFn:()=>o(`GET`,`/api/stats/timeseries?range=today&groupBy=hour&by=provider&tzOffset=${wt()}`),enabled:r&&a.chart,...u,refetchInterval:3e4}),h=ce({queryKey:s.stats(`timeseries`,`7d`,`day`,`provider`,``,``,wt()),queryFn:()=>o(`GET`,`/api/stats/timeseries?range=7d&groupBy=day&by=provider&tzOffset=${wt()}`),enabled:r&&a.compareYesterday,...u,refetchInterval:6e4}),g=ce({queryKey:s.stats(`top`,`today`,``,3,``),queryFn:()=>o(`GET`,`/api/stats/top-models?range=today&limit=3`),enabled:r&&a.topModel,...u,refetchInterval:3e4}),_=ce({queryKey:s.providers,queryFn:()=>o(`GET`,`/api/providers`),enabled:r&&(d||a.clients),...u,refetchInterval:6e4,refetchIntervalInBackground:i&&l}),v=ce({queryKey:s.clients,queryFn:()=>o(`GET`,`/api/clients`),enabled:r&&a.clients,...u,refetchInterval:3e4}),y=(0,H.useMemo)(()=>(_.data??[]).filter(e=>e.enabled&&e.authScheme===`oauth-subscription`),[_.data]),x=be({queries:y.map(e=>({queryKey:s.providerAccounts(e.id),queryFn:()=>o(`GET`,`/api/providers/${b(e.id)}/accounts`),enabled:r&&d,...u,refetchInterval:6e4,refetchIntervalInBackground:i&&l}))}),S=y.flatMap((e,t)=>(x[t]?.data??[]).map(t=>({provider:e,account:t}))),C=S.map(e=>`${e.account.id}:${e.account.status}:${e.account.quota?.fetchedAtUtc??``}`).join(`|`),w=ne({mutationFn:e=>o(`POST`,`/api/provider-accounts/${b(e)}/quota`),onSettled:e=>{e&&n.invalidateQueries({queryKey:s.providerAccounts(e.providerId)})}}),T=r&&d&&(t.live||e.title===`quota`||e.title===`alerts`);(0,H.useEffect)(()=>{if(!T)return;let e=Date.now();for(let{account:t}of S){if(t.status!==`active`)continue;let n=t.quota?.fetchedAtUtc?new Date(t.quota.fetchedAtUtc).getTime():0;Number.isFinite(n)&&e-n<St||e-(Ct.get(t.id)??0)<St||(Ct.set(t.id,e),w.mutate(t.id,{onError:()=>{}}))}},[T,C]);let E=[...ct(S),...lt(_.data??[])];return{settings:f.data,summary:p.data,hourly:m.data??[],daily:h.data??[],top:g.data??[],plans:E,hasSubscriptions:S.some(e=>e.account.status===`active`),clients:v.data??[],providers:_.data??[],updatedAt:p.dataUpdatedAt,loading:p.isLoading,error:p.isError}}function Dt(e,t,n,r){let{t:i,locale:a}=M(),o=h(),s=(0,H.useMemo)(()=>({requests:e=>i(`tray.title.requests`,{count:e}),tokens:e=>i(`tray.title.tokens`,{count:e}),cost:e=>i(`tray.title.cost`,{amount:e}),quota:(e,t,n)=>i(`tray.title.quota`,{plan:e,window:t,remaining:n}),failures:e=>i(`tray.title.failures`,{count:e}),stopped:i(`tray.status.stopped`),windowName:e=>e.kind===`balance`?e.label??i(`tray.quotaBalance`):e.kind===`credits`||e.windowMinutes==null?i(`tray.quotaCredits`):pt(e.windowMinutes,a)}),[i,a]),c=gt(e.title,{running:t.running,summary:n,plans:r},s);(0,H.useEffect)(()=>{o?.tray.setTitle(c.title,c.detail)},[o,c.title,c.detail])}function Ot(){let[e]=yt(),t=bt(),n=Et(e,{enabled:t.running,background:!0,live:!1,titleOnly:!0});return Dt(e,t,n.summary,n.plans),null}var U={field:`_field_6szcl_1`,control:`_control_6szcl_3`,disabled:`_disabled_6szcl_4`,open:`_open_6szcl_6`,searchIcon:`_searchIcon_6szcl_8`,chevron:`_chevron_6szcl_12`,clear:`_clear_6szcl_14`,hint:`_hint_6szcl_17`,popover:`_popover_6szcl_18`,autoHeight:`_autoHeight_6szcl_19`,listbox:`_listbox_6szcl_20`,option:`_option_6szcl_22`,check:`_check_6szcl_26`,empty:`_empty_6szcl_27`},W=m();function kt({children:e,reduceMotion:t}){let n=(0,H.useRef)(null),[r,a]=(0,H.useState)(`auto`);return(0,H.useEffect)(()=>{let e=n.current;if(!e)return;let t=new ResizeObserver(()=>a(e.offsetHeight));return t.observe(e),()=>t.disconnect()},[]),(0,W.jsx)(V.div,{className:U.autoHeight,initial:!1,animate:{height:r},transition:t?{duration:0}:i.spring.smooth,children:(0,W.jsx)(`div`,{ref:n,children:e})})}var At=(0,H.forwardRef)(function({label:e,options:n,value:r,defaultValue:a=``,onValueChange:o,description:s,placeholder:c=`Search or select…`,emptyMessage:l=`No matches found`,id:u,className:d,disabled:f,onFocus:p,...m},h){let g=(0,H.useId)(),_=u??g,v=`${_}-listbox`,y=s?`${_}-description`:void 0,b=(0,H.useRef)(null),x=(0,H.useRef)(null),S=(0,H.useRef)({}),C=E(),[w,T]=(0,H.useState)(a),[O,k]=(0,H.useState)(!1),[j,M]=(0,H.useState)(``),[N,P]=(0,H.useState)(-1),F=r??w,I=n.find(e=>e.value===F);(0,H.useImperativeHandle)(h,()=>x.current);let L=(0,H.useRef)(F);(0,H.useEffect)(()=>{if(L.current===F)return;L.current=F;let e=x.current;if(!e||C||F&&O)return;let n=F?t(e,{opacity:[0,1],y:[`0.35em`,`0em`],filter:[`blur(${i.blur.soft}px)`,`blur(0px)`]},{duration:i.duration.standard,ease:[...i.ease.enter]}):t(e,{opacity:[0,1]},{duration:i.duration.fast,ease:[...i.ease.enter]});return()=>n.complete()},[F,C,O]);let R=(0,H.useMemo)(()=>{let e=j.trim().toLocaleLowerCase();return e?n.filter(t=>[t.label,...t.keywords??[]].some(t=>t.toLocaleLowerCase().includes(e))):n},[n,j]),z=R.reduce((e,t,n)=>(t.disabled||e.push(n),e),[]);(0,H.useEffect)(()=>{if(!O)return;let e=N>=0?R[N]:void 0,t=e?S.current[e.value]:null,n=t?.parentElement;if(t&&n){let e=t.offsetTop,r=e+t.offsetHeight;e<n.scrollTop?n.scrollTop=e:r>n.scrollTop+n.clientHeight&&(n.scrollTop=r-n.clientHeight)}},[N,R,O]),(0,H.useEffect)(()=>{let e=e=>{b.current&&!b.current.contains(e.target)&&(k(!1),M(``))};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[]);let te=e=>{e.disabled||(T(e.value),o?.(e.value),M(``),k(!1),x.current?.focus())},B=e=>{e.preventDefault(),T(``),o?.(``),M(``),k(!0),x.current?.focus()},ne=()=>{f||(k(!0),M(``),P(-1))},re=e=>{if(!f){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),!O){ne();return}if(!z.length)return;let t=z.indexOf(N),n=e.key===`ArrowDown`?(t+1)%z.length:(t-1+z.length)%z.length;P(z[n]);return}if(e.key===`Enter`&&O&&N>=0){e.preventDefault();let t=R[N];t&&te(t);return}if(e.key===`Escape`&&O){e.preventDefault(),k(!1),M(``);return}}},ie=O?j:I?.label??``,ae=N>=0?R[N]:void 0;return(0,W.jsxs)(`div`,{ref:b,className:U.field,children:[(0,W.jsx)(`label`,{htmlFor:_,children:e}),(0,W.jsxs)(`div`,{className:[U.control,O?U.open:``,f?U.disabled:``,d??``].filter(Boolean).join(` `),children:[(0,W.jsx)(oe,{className:U.searchIcon,size:16,strokeWidth:1.75,"aria-hidden":`true`}),(0,W.jsx)(`input`,{...m,ref:x,id:_,type:`text`,role:`combobox`,value:ie,placeholder:I?.label??c,disabled:f,"aria-describedby":y,"aria-expanded":O,"aria-controls":O?v:void 0,"aria-autocomplete":`list`,"aria-activedescendant":O&&ae?`${_}-option-${ae.value}`:void 0,onFocus:e=>{p?.(e),ne()},onClick:ne,onChange:e=>{M(e.target.value),k(!0),P(-1)},onKeyDown:re}),(0,W.jsx)(D,{initial:!1,children:I&&!f&&(0,W.jsx)(V.button,{type:`button`,className:U.clear,"aria-label":`Clear selection`,onMouseDown:e=>e.preventDefault(),onClick:B,initial:C?{opacity:0}:{opacity:0,scale:.6,filter:`blur(${i.blur.subtle}px)`},animate:{opacity:1,scale:1,filter:`blur(0px)`,transition:C?{duration:i.duration.instant}:{...i.spring.snappy,opacity:{duration:i.duration.fast}}},exit:{opacity:0,...C?{}:{scale:.6,filter:`blur(${i.blur.subtle}px)`},transition:{duration:i.duration.instant,ease:[...i.ease.standard]}},whileTap:{scale:C?1:.96,transition:{duration:i.duration.instant,ease:[...i.ease.standard]}},children:(0,W.jsx)(ee,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})}),(0,W.jsx)(ge,{className:U.chevron,size:16,strokeWidth:1.75,"aria-hidden":`true`})]}),s&&(0,W.jsx)(`span`,{id:y,className:U.hint,children:s}),(0,W.jsx)(D,{initial:!1,children:O&&(0,W.jsx)(V.div,{className:U.popover,initial:C?{opacity:0}:{opacity:0,y:-6,scale:.97},animate:{opacity:1,y:0,scale:1,transition:C?{duration:i.duration.instant}:{...i.spring.snappy,opacity:{duration:i.duration.fast,ease:[...i.ease.enter]}}},exit:{opacity:0,...C?{}:{y:-4,scale:.98},transition:{duration:i.duration.instant,ease:[...i.ease.standard]}},role:`presentation`,children:(0,W.jsx)(kt,{reduceMotion:C,children:(0,W.jsx)(`div`,{id:v,className:U.listbox,role:`listbox`,"aria-label":`${e} options`,children:R.length?R.map((e,t)=>(0,W.jsxs)(`div`,{ref:t=>{S.current[e.value]=t},id:`${_}-option-${e.value}`,className:U.option,"data-active":t===N?`true`:void 0,"data-disabled":e.disabled?`true`:void 0,role:`option`,"aria-selected":e.value===F,"aria-disabled":e.disabled||void 0,onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>!e.disabled&&P(t),onClick:()=>te(e),children:[(0,W.jsx)(`span`,{children:e.label}),e.value===F&&(0,W.jsx)(A,{className:U.check,size:16,strokeWidth:1.75,"aria-hidden":`true`})]},e.value)):(0,W.jsx)(V.div,{className:U.empty,role:`status`,initial:!C&&{opacity:0,y:4,filter:`blur(${i.blur.soft}px)`},animate:{opacity:1,y:0,filter:`blur(0px)`},transition:{duration:i.duration.standard,ease:[...i.ease.enter]},children:l})})})})})]})});At.displayName=`Combobox`;var jt=Object.defineProperty,Mt=(e,t)=>jt(e,`name`,{value:t,configurable:!0});function G(e){let t=H.useRef(e);return H.useEffect(()=>{t.current=e}),H.useMemo(()=>((...e)=>t.current?.(...e)),[])}Mt(G,`useCallbackRef`);var Nt=Object.defineProperty,K=(e,t)=>Nt(e,`name`,{value:t,configurable:!0}),Pt=`dismissableLayer.update`,Ft=`dismissableLayer.pointerDownOutside`,It=`dismissableLayer.focusOutside`,Lt,Rt=H.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),zt=H.forwardRef(K(function(t,n){let{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=t,d=H.useContext(Rt),[f,p]=H.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=H.useState({}),g=C(n,p),_=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=f?_.indexOf(f):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,w=b>=y,T=H.useRef(!1),E=Ht(e=>{o?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:H.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return w&&!t},[d.branches,w])}),D=Ut(e=>{if(i&&T.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},m),O=f?b===_.length-1:!1,k=G(e=>{e.key===`Escape`&&(a?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return H.useEffect(()=>{if(O)return m.addEventListener(`keydown`,k,{capture:!0}),()=>m.removeEventListener(`keydown`,k,{capture:!0})},[m,O,k]),H.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Lt=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Wt(),()=>{r&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Lt))}},[f,m,r,d]),H.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Wt())},[f,d]),H.useEffect(()=>{let e=K(()=>h({}),`handleUpdate`);return document.addEventListener(Pt,e),()=>document.removeEventListener(Pt,e)},[]),(0,W.jsx)(e.div,{...u,ref:g,style:{pointerEvents:S?w?`auto`:`none`:void 0,...t.style},onFocusCapture:x(t.onFocusCapture,D.onFocusCapture),onBlurCapture:x(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:x(t.onPointerDownCapture,E.onPointerDownCapture)})},`DismissableLayer`));function Bt(){let e=H.useContext(Rt),[t,n]=H.useState(null);return H.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}K(Bt,`useDismissableLayerSurface`);var Vt=K(()=>!0,`IS_TRUE`);function Ht(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Vt}=t,s=G(e),c=H.useRef(!1),l=H.useRef(!1),u=H.useRef(new Map),d=H.useRef(()=>{});return H.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}K(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}K(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}K(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}K(p,`handleInteractionBubble`);let m=K(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Gt(Ft,s,p,{discrete:!0})};if(K(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:K(()=>c.current=!0,`onPointerDownCapture`)}}K(Ht,`usePointerDownOutside`);function Ut(e,t=globalThis?.document){let n=G(e),r=H.useRef(!1);return H.useEffect(()=>{let e=K(e=>{e.target&&!r.current&&Gt(It,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:K(()=>r.current=!0,`onFocusCapture`),onBlurCapture:K(()=>r.current=!1,`onBlurCapture`)}}K(Ut,`useFocusOutside`);function Wt(){let e=new CustomEvent(Pt);document.dispatchEvent(e)}K(Wt,`dispatchUpdate`);function Gt(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?I(i,a):i.dispatchEvent(a)}K(Gt,`handleAndDispatchCustomEvent`);var Kt=Object.defineProperty,q=(e,t)=>Kt(e,`name`,{value:t,configurable:!0}),qt=`focusScope.autoFocusOnMount`,Jt=`focusScope.autoFocusOnUnmount`,Yt={bubbles:!1,cancelable:!0},Xt=H.forwardRef(q(function(t,n){let{loop:r=!1,trapped:i=!1,branches:a,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=t,[l,u]=H.useState(null),d=G(o),f=G(s),p=H.useRef(null),m=C(n,u),h=H.useRef(a);H.useEffect(()=>{h.current=a});let g=H.useCallback(e=>e?l?.contains(e)?!0:!!h.current?.some(t=>t.contains(e)):!1,[l]),_=H.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;H.useEffect(()=>{if(i){let e=function(e){if(_.paused||!l)return;let t=e.target;g(t)?p.current=t:cn(p.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(g(t)||cn(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&cn(l)};q(e,`handleFocusIn`),q(t,`handleFocusOut`),q(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[i,l,_.paused,g]),H.useEffect(()=>{if(l){ln.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(qt,Yt);l.addEventListener(qt,d),l.dispatchEvent(t),t.defaultPrevented||(tn(fn(rn(l)),{select:!0}),document.activeElement===e&&cn(l))}return()=>{l.removeEventListener(qt,d),setTimeout(()=>{let t=new CustomEvent(Jt,Yt);l.addEventListener(Jt,f),l.dispatchEvent(t),t.defaultPrevented||cn(e??document.body,{select:!0}),l.removeEventListener(Jt,f),ln.remove(_)},0)}}},[l,d,f,_]);let v=H.useCallback(e=>{if(!r&&!i||_.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){let t=e.currentTarget,[i,a]=nn(t);i&&a?!e.shiftKey&&n===a?(e.preventDefault(),r&&cn(i,{select:!0})):e.shiftKey&&n===i&&(e.preventDefault(),r&&cn(a,{select:!0})):n===t&&e.preventDefault()}},[r,i,_.paused]);return(0,W.jsx)(e.div,{tabIndex:-1,...c,ref:m,onKeyDown:v})},`FocusScope`)),Zt=H.createContext(null);function Qt({registry:e,children:t}){return e?(0,W.jsx)(Zt.Provider,{value:e,children:t}):t}q(Qt,`FocusScopeBranchProvider`);function $t(){let[e,t]=H.useState([]);return{nodes:e,registry:H.useMemo(()=>({add:q(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:q(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}q($t,`useFocusScopeBranchRegistry`);function en(e){let t=H.useContext(Zt);H.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}q(en,`useFocusScopeBranch`);function tn(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(cn(r,{select:t}),document.activeElement!==n)return}q(tn,`focusFirst`);function nn(e){let t=rn(e);return[an(t,e),an(t.reverse(),e)]}q(nn,`getTabbableEdges`);function rn(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:q(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}q(rn,`getTabbableCandidates`);function an(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):on(r,{upTo:t})))return r}q(an,`findVisible`);function on(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}q(on,`isHidden`);function sn(e){return e instanceof HTMLInputElement&&`select`in e}q(sn,`isSelectableInput`);function cn(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&sn(e)&&t&&e.select()}}q(cn,`focus`);var ln=un();function un(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=dn(e,t),e.unshift(t)},remove(t){e=dn(e,t),e[0]?.resume()}}}q(un,`createFocusScopesStack`);function dn(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}q(dn,`arrayRemove`);function fn(e){return e.filter(e=>e.tagName!==`A`)}q(fn,`removeLinks`);var pn=f(w(),1),mn=Object.defineProperty,hn=H.forwardRef(((e,t)=>mn(e,`name`,{value:t,configurable:!0}))(function(t,n){let{container:r,...i}=t,[a,o]=H.useState(!1);g(()=>o(!0),[]);let s=r||a&&globalThis?.document?.body;return s?pn.createPortal((0,W.jsx)(e.div,{...i,ref:n}),s):null},`Portal`)),gn=Object.defineProperty,_n=(e,t)=>gn(e,`name`,{value:t,configurable:!0}),vn=0,yn=null;function bn(e){return xn(),e.children}_n(bn,`FocusGuards`);function xn(){H.useEffect(()=>{yn||={start:Sn(),end:Sn()};let{start:e,end:t}=yn;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),vn++,()=>{vn===1&&(yn?.start.remove(),yn?.end.remove(),yn=null),vn=Math.max(0,vn-1)}},[])}_n(xn,`useFocusGuards`);function Sn(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}_n(Sn,`createFocusGuard`);var Cn=function(){return Cn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Cn.apply(this,arguments)};function wn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Tn(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var En=`right-scroll-bar-position`,Dn=`width-before-scroll-bar`,On=`with-scroll-bars-hidden`,kn=`--removed-body-scroll-bar-size`;function An(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function jn(e,t){var n=(0,H.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Mn=typeof window<`u`?H.useLayoutEffect:H.useEffect,Nn=new WeakMap;function Pn(e,t){var n=jn(t||null,function(t){return e.forEach(function(e){return An(e,t)})});return Mn(function(){var t=Nn.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||An(e,null)}),i.forEach(function(e){r.has(e)||An(e,a)})}Nn.set(n,e)},[e]),n}function Fn(e){return e}function In(e,t){t===void 0&&(t=Fn);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ln(e){e===void 0&&(e={});var t=In(null);return t.options=Cn({async:!0,ssr:!1},e),t}var Rn=function(e){var t=e.sideCar,n=wn(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return H.createElement(r,Cn({},n))};Rn.isSideCarExport=!0;function zn(e,t){return e.useMedium(t),Rn}var Bn=Ln(),Vn=function(){},Hn=H.forwardRef(function(e,t){var n=H.useRef(null),r=H.useState({onScrollCapture:Vn,onWheelCapture:Vn,onTouchMoveCapture:Vn}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=wn(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Pn([n,t]),C=Cn(Cn({},b),i);return H.createElement(H.Fragment,null,u&&H.createElement(x,{sideCar:Bn,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?H.cloneElement(H.Children.only(s),Cn(Cn({},C),{ref:S})):H.createElement(v,Cn({},C,{className:c,ref:S}),s))});Hn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Hn.classNames={fullWidth:Dn,zeroRight:En};var Un=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Wn(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Un();return t&&e.setAttribute(`nonce`,t),e}function Gn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Kn(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var qn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Wn())&&(Gn(t,n),Kn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Jn=function(){var e=qn();return function(t,n){H.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Yn=function(){var e=Jn();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Xn={left:0,top:0,right:0,gap:0},Zn=function(e){return parseInt(e||``,10)||0},Qn=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Zn(n),Zn(r),Zn(i)]},$n=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Xn;var t=Qn(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},er=Yn(),tr=`data-scroll-locked`,nr=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
+
.${On} {
|
|
3
|
+
overflow: hidden ${r};
|
|
4
|
+
padding-right: ${s}px ${r};
|
|
5
|
+
}
|
|
6
|
+
body[${tr}] {
|
|
7
|
+
overflow: hidden ${r};
|
|
8
|
+
overscroll-behavior: contain;
|
|
9
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
+
padding-left: ${i}px;
|
|
11
|
+
padding-top: ${a}px;
|
|
12
|
+
padding-right: ${o}px;
|
|
13
|
+
margin-left:0;
|
|
14
|
+
margin-top:0;
|
|
15
|
+
margin-right: ${s}px ${r};
|
|
16
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.${En} {
|
|
20
|
+
right: ${s}px ${r};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.${Dn} {
|
|
24
|
+
margin-right: ${s}px ${r};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.${En} .${En} {
|
|
28
|
+
right: 0 ${r};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.${Dn} .${Dn} {
|
|
32
|
+
margin-right: 0 ${r};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[${tr}] {
|
|
36
|
+
${kn}: ${s}px;
|
|
37
|
+
}
|
|
38
|
+
`},rr=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ir=function(){H.useEffect(function(){return document.body.setAttribute(tr,(rr()+1).toString()),function(){var e=rr()-1;e<=0?document.body.removeAttribute(tr):document.body.setAttribute(tr,e.toString())}},[])},ar=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ir();var a=H.useMemo(function(){return $n(i)},[i]);return H.createElement(er,{styles:nr(a,!t,i,n?``:`!important`)})},or=!1;if(typeof window<`u`)try{var sr=Object.defineProperty({},"passive",{get:function(){return or=!0,!0}});window.addEventListener(`test`,sr,sr),window.removeEventListener(`test`,sr,sr)}catch{or=!1}var cr=or?{passive:!1}:!1,lr=function(e){return e.tagName===`TEXTAREA`},ur=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!lr(e)&&n[t]===`visible`)},dr=function(e){return ur(e,`overflowY`)},fr=function(e){return ur(e,`overflowX`)},pr=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),gr(e,r)){var i=_r(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},mr=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},hr=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},gr=function(e,t){return e===`v`?dr(t):fr(t)},_r=function(e,t){return e===`v`?mr(t):hr(t)},vr=function(e,t){return e===`h`&&t===`rtl`?-1:1},yr=function(e,t,n,r,i){var a=vr(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=_r(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&gr(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},br=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xr=function(e){return[e.deltaX,e.deltaY]},Sr=function(e){return e&&`current`in e?e.current:e},Cr=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wr=function(e){return`
|
|
39
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
+
`},Tr=0,Er=[];function Dr(e){var t=H.useRef([]),n=H.useRef([0,0]),r=H.useRef(),i=H.useState(Tr++)[0],a=H.useState(Yn)[0],o=H.useRef(e);H.useEffect(function(){o.current=e},[e]),H.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Tn([e.lockRef.current],(e.shards||[]).map(Sr),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=H.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=br(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=pr(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=pr(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return yr(h,t,e,h===`h`?s:c,!0)},[]),c=H.useCallback(function(e){var n=e;if(Er.length&&Er[Er.length-1]===a){var r=`deltaY`in n?xr(n):br(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Cr(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Sr).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=H.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Or(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=H.useCallback(function(e){n.current=br(e),r.current=void 0},[]),d=H.useCallback(function(t){l(t.type,xr(t),t.target,s(t,e.lockRef.current))},[]),f=H.useCallback(function(t){l(t.type,br(t),t.target,s(t,e.lockRef.current))},[]);H.useEffect(function(){return Er.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,cr),document.addEventListener(`touchmove`,c,cr),document.addEventListener(`touchstart`,u,cr),function(){Er=Er.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,cr),document.removeEventListener(`touchmove`,c,cr),document.removeEventListener(`touchstart`,u,cr)}},[]);var p=e.removeScrollBar,m=e.inert;return H.createElement(H.Fragment,null,m?H.createElement(a,{styles:wr(i)}):null,p?H.createElement(ar,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Or(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var kr=zn(Bn,Dr),Ar=H.forwardRef(function(e,t){return H.createElement(Hn,Cn({},e,{ref:t,sideCar:kr}))});Ar.classNames=Hn.classNames;var jr=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Mr=new WeakMap,Nr=new WeakMap,Pr={},Fr=0,Ir=function(e){return e&&(e.host||Ir(e.parentNode))},Lr=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ir(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Rr=function(e,t,n,r){var i=Lr(t,Array.isArray(e)?e:[e]);Pr[n]||(Pr[n]=new WeakMap);var a=Pr[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Mr.get(e)||0)+1,l=(a.get(e)||0)+1;Mr.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Nr.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Fr++,function(){o.forEach(function(e){var t=Mr.get(e)-1,i=a.get(e)-1;Mr.set(e,t),a.set(e,i),t||(Nr.has(e)||e.removeAttribute(r),Nr.delete(e)),i||e.removeAttribute(n)}),Fr--,Fr||(Mr=new WeakMap,Mr=new WeakMap,Nr=new WeakMap,Pr={})}},zr=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||jr(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Rr(r,i,n,`aria-hidden`)):function(){return null}},Br=Object.defineProperty,J=(e,t)=>Br(e,`name`,{value:t,configurable:!0}),Vr=`Dialog`,[Hr,Ur]=_e(Vr),[Wr,Gr]=Hr(Vr),Kr=J(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=H.useRef(null),c=H.useRef(null),{nodes:l,registry:u}=$t(),[d,f]=p({prop:r,defaultProp:i??!1,onChange:a,caller:Vr}),[m,h]=H.useState(0),[g,_]=H.useState(0);return(0,W.jsx)(Wr,{scope:t,triggerRef:s,contentRef:c,contentId:v(),titleId:v(),descriptionId:v(),titlePresent:m>0,descriptionPresent:g>0,setTitleCount:h,setDescriptionCount:_,open:d,onOpenChange:f,onOpenToggle:H.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),qr=`DialogTrigger`,Jr=H.forwardRef(J(function(t,n){let{__scopeDialog:r,...i}=t,a=Gr(qr,r),o=C(n,a.triggerRef);return(0,W.jsx)(e.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":pi(a.open),...i,ref:o,onClick:x(t.onClick,a.onOpenToggle)})},`DialogTrigger`)),Yr=`DialogPortal`,[Xr,Zr]=Hr(Yr,{forceMount:void 0}),Qr=J(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Gr(Yr,t);return(0,W.jsx)(Xr,{scope:t,forceMount:n,children:H.Children.map(r,e=>(0,W.jsx)(R,{present:n||a.open,children:(0,W.jsx)(hn,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),$r=`DialogOverlay`,ei=H.forwardRef(J(function(e,t){let n=Zr($r,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Gr($r,e.__scopeDialog);return a.modal?(0,W.jsx)(R,{present:r||a.open,children:(0,W.jsx)(ni,{...i,ref:t})}):null},`DialogOverlay`)),ti=d(`DialogOverlay.RemoveScroll`),ni=H.forwardRef(J(function(t,n){let{__scopeDialog:r,...i}=t,a=Gr($r,r),o=Bt(),s=C(n,o);return(0,W.jsx)(Ar,{as:ti,allowPinchZoom:!0,shards:H.useMemo(()=>[a.contentRef,...a.branchNodes.map(e=>({current:e}))],[a.contentRef,a.branchNodes]),children:(0,W.jsx)(e.div,{"data-state":pi(a.open),...i,ref:s,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),ri=`DialogContent`,ii=H.forwardRef(J(function(e,t){let n=Zr(ri,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Gr(ri,e.__scopeDialog);return(0,W.jsx)(R,{present:r||a.open,children:a.modal?(0,W.jsx)(ai,{...i,ref:t}):(0,W.jsx)(oi,{...i,ref:t})})},`DialogContent`)),ai=H.forwardRef(J(function(e,t){let n=Gr(ri,e.__scopeDialog),r=H.useRef(null),i=C(t,n.contentRef,r);return H.useEffect(()=>{let e=r.current;if(e)return zr(e)},[]),(0,W.jsx)(si,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:x(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:x(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),oi=H.forwardRef(J(function(e,t){let n=Gr(ri,e.__scopeDialog),r=H.useRef(!1),i=H.useRef(!1);return(0,W.jsx)(si,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),si=H.forwardRef(J(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=Gr(ri,n);return xn(),(0,W.jsx)(Qt,{registry:l.branchRegistry,children:(0,W.jsx)(Xt,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,W.jsx)(zt,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?fi(o,l.descriptionId):o,"data-state":pi(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),ci=H.forwardRef(J(function(t,n){let{__scopeDialog:r,...i}=t,a=Gr(`DialogTitle`,r),{setTitleCount:o}=a;return g(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),(0,W.jsx)(e.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),li=H.forwardRef(J(function(t,n){let{__scopeDialog:r,...i}=t,a=Gr(`DialogDescription`,r),{setDescriptionCount:o}=a;return g(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),(0,W.jsx)(e.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),ui=`DialogClose`,di=H.forwardRef(J(function(t,n){let{__scopeDialog:r,...i}=t,a=Gr(ui,r);return(0,W.jsx)(e.button,{type:`button`,...i,ref:n,onClick:x(t.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function fi(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}J(fi,`concatAriaDescribedby`);function pi(e){return e?`open`:`closed`}J(pi,`getState`);var mi={overlay:`_overlay_1vyy5_1`,content:`_content_1vyy5_5`,keyframes:`_keyframes_1vyy5_9`,"overlay-in":`_overlay-in_1vyy5_1`,"overlay-out":`_overlay-out_1vyy5_1`,"content-fade-in":`_content-fade-in_1vyy5_1`,"content-rise-in":`_content-rise-in_1vyy5_1`,"content-out":`_content-out_1vyy5_1`,header:`_header_1vyy5_16`,title:`_title_1vyy5_17`,description:`_description_1vyy5_18`,swap:`_swap_1vyy5_20`,close:`_close_1vyy5_24`,body:`_body_1vyy5_27`,"content-fade-out":`_content-fade-out_1vyy5_1`},hi=(0,H.createContext)(null);function gi({open:e,defaultOpen:t=!1,onOpenChange:n,...r}){let[i,a]=(0,H.useState)(t),o=e??i,s=(0,H.useCallback)(t=>{e===void 0&&a(t),n?.(t)},[e,n]);return(0,W.jsx)(hi.Provider,{value:o,children:(0,W.jsx)(Kr,{...r,open:o,onOpenChange:s})})}var _i={duration:i.duration.instant},vi={duration:i.duration.fast,ease:[...i.ease.standard]};function yi({text:e}){let t=E();return(0,W.jsx)(D,{mode:`popLayout`,initial:!1,children:(0,W.jsx)(V.span,{className:mi.swap,initial:!t&&{opacity:0,y:`0.3em`,filter:`blur(${i.blur.soft}px)`},animate:{opacity:1,y:0,filter:`blur(0px)`},exit:t?{opacity:0,transition:{duration:0}}:{opacity:0,y:`-0.3em`,filter:`blur(${i.blur.subtle}px)`,transition:{duration:i.duration.fast,ease:[...i.ease.standard]}},transition:{duration:i.duration.standard,ease:[...i.ease.enter]},children:e},e)})}function bi({title:e,description:t,children:n,className:r,onPointerDownOutside:a,...o}){let s=(0,H.useContext)(hi),c=E(),l=(0,H.useRef)({open:s,at:0});(0,H.useLayoutEffect)(()=>{l.current={open:s,at:performance.now()}},[s]);let u=e=>{a?.(e),s!==null&&(!l.current.open||e.detail.originalEvent.timeStamp<l.current.at)&&e.preventDefault()},d=[mi.content,r].filter(Boolean).join(` `),f=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:mi.header,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(ci,{className:mi.title,children:(0,W.jsx)(yi,{text:e})}),t?(0,W.jsx)(li,{className:mi.description,children:(0,W.jsx)(yi,{text:t})}):null]}),(0,W.jsx)(di,{className:mi.close,"aria-label":`Close dialog`,children:(0,W.jsx)(ee,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]}),(0,W.jsx)(`div`,{className:mi.body,children:n})]});return s===null?(0,W.jsxs)(Qr,{children:[(0,W.jsx)(ei,{className:`${mi.overlay} ${mi.keyframes}`}),(0,W.jsx)(ii,{...o,onPointerDownOutside:u,className:`${d} ${mi.keyframes}`,children:f})]}):(0,W.jsx)(D,{children:s&&(0,W.jsxs)(Qr,{forceMount:!0,children:[(0,W.jsx)(ei,{asChild:!0,forceMount:!0,children:(0,W.jsx)(V.div,{className:mi.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:c?_i:vi},transition:c?_i:{duration:i.duration.standard,ease:[...i.ease.enter]}})}),(0,W.jsx)(ii,{...o,onPointerDownOutside:u,asChild:!0,forceMount:!0,children:(0,W.jsx)(V.div,{className:d,initial:c?{opacity:0}:{opacity:0,y:8,scale:.96},animate:{opacity:1,y:0,scale:1},exit:c?{opacity:0,transition:_i}:{opacity:0,y:4,scale:.98,transition:vi},transition:c?_i:{default:i.spring.smooth,opacity:{duration:i.duration.fast,ease:[...i.ease.enter]}},children:f})})]},`dialog`)})}var xi=[`top`,`right`,`bottom`,`left`],Si=Math.min,Ci=Math.max,wi=Math.round,Ti=Math.floor,Ei=e=>({x:e,y:e}),Di={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Oi(e,t,n){return Ci(e,Si(t,n))}function ki(e,t){return typeof e==`function`?e(t):e}function Ai(e){return e.split(`-`)[0]}function ji(e){return e.split(`-`)[1]}function Mi(e){return e===`x`?`y`:`x`}function Ni(e){return e===`y`?`height`:`width`}function Pi(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Fi(e){return Mi(Pi(e))}function Ii(e,t,n){n===void 0&&(n=!1);let r=ji(e),i=Fi(e),a=Ni(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Gi(o)),[o,Gi(o)]}function Li(e){let t=Gi(e);return[Ri(e),t,Ri(t)]}function Ri(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var zi=[`left`,`right`],Bi=[`right`,`left`],Vi=[`top`,`bottom`],Hi=[`bottom`,`top`];function Ui(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Bi:zi:t?zi:Bi;case`left`:case`right`:return t?Vi:Hi;default:return[]}}function Wi(e,t,n,r){let i=ji(e),a=Ui(Ai(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ri)))),a}function Gi(e){let t=Ai(e);return Di[t]+e.slice(t.length)}function Ki(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function qi(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ki(e)}function Ji(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Yi(e,t,n){let{reference:r,floating:i}=e,a=Pi(t),o=Fi(t),s=Ni(o),c=Ai(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=ji(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Xi(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ki(t,e),p=qi(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ji(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Ji(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Zi=50,Qi=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Xi},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Yi(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Zi&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Yi(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},$i=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ki(e,t)||{};if(l==null)return{};let d=qi(u),f={x:n,y:r},p=Fi(i),m=Ni(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Si(d[_],T),D=Si(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Oi(E,k,O),j=!c.arrow&&ji(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),ea=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ki(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ai(r),_=Pi(o),v=Ai(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Gi(o)]:Li(o)),x=p!==`none`;!d&&x&&b.push(...Wi(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ii(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Pi(t)||T.every(e=>Pi(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Pi(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function ta(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function na(e){return xi.some(t=>e[t]>=0)}var ra=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ki(e,t);switch(i){case`referenceHidden`:{let e=ta(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:na(e)}}}case`escaped`:{let e=ta(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:na(e)}}}default:return{}}}}},ia=new Set([`left`,`top`]);async function aa(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ai(n),s=ji(n),c=Pi(n)===`y`,l=ia.has(o)?-1:1,u=a&&c?-1:1,d=ki(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var oa=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await aa(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},sa=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ki(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Pi(i),p=Mi(f),m=u[p],h=u[f],g=(e,t)=>Oi(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},ca=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ki(e,t),u={x:n,y:r},d=Pi(i),f=Mi(d),p=u[f],m=u[d],h=ki(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ia.has(Ai(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},la=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=ki(e,t),c=await i.detectOverflow(t,s),l=Ai(n),u=ji(n),d=Pi(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Si(p-c[m],g),y=Si(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Ci(c.left,c.right):S=p-2*Ci(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function ua(){return typeof window<`u`}function da(e){return pa(e)?(e.nodeName||``).toLowerCase():`#document`}function Y(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fa(e){return((pa(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function pa(e){return ua()?e instanceof Node||e instanceof Y(e).Node:!1}function ma(e){return ua()?e instanceof Element||e instanceof Y(e).Element:!1}function ha(e){return ua()?e instanceof HTMLElement||e instanceof Y(e).HTMLElement:!1}function ga(e){return!ua()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot}function _a(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Oa(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function va(e){return/^(table|td|th)$/.test(da(e))}function ya(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ba=/transform|translate|scale|rotate|perspective|filter/,xa=/paint|layout|strict|content/,Sa=e=>!!e&&e!==`none`,Ca;function wa(e){let t=ma(e)?Oa(e):e;return Sa(t.transform)||Sa(t.translate)||Sa(t.scale)||Sa(t.rotate)||Sa(t.perspective)||!Ea()&&(Sa(t.backdropFilter)||Sa(t.filter))||ba.test(t.willChange||``)||xa.test(t.contain||``)}function Ta(e){let t=Aa(e);for(;ha(t)&&!Da(t);){if(wa(t))return t;if(ya(t))return null;t=Aa(t)}return null}function Ea(){return Ca??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ca}function Da(e){return/^(html|body|#document)$/.test(da(e))}function Oa(e){return Y(e).getComputedStyle(e)}function ka(e){return ma(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Aa(e){if(da(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ga(e)&&e.host||fa(e);return ga(t)?t.host:t}function ja(e){let t=Aa(e);return Da(t)?(e.ownerDocument||e).body:ha(t)&&_a(t)?t:ja(t)}function Ma(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ja(e),i=r===e.ownerDocument?.body,a=Y(r);if(i){let e=Na(a);return t.concat(a,a.visualViewport||[],_a(r)?r:[],e&&n?Ma(e):[])}return t.concat(r,Ma(r,[],n))}function Na(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Pa(e){let t=Oa(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ha(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=wi(n)!==a||wi(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Fa(e){return ma(e)?e:e.contextElement}function Ia(e){let t=Fa(e);if(!ha(t))return Ei(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Pa(t),o=(a?wi(n.width):n.width)/r,s=(a?wi(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var La=Ei(0);function Ra(e){let t=Y(e);return!Ea()||!t.visualViewport?La:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function za(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Y(e)}function Ba(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Fa(e),o=Ei(1);t&&(r?ma(r)&&(o=Ia(r)):o=Ia(e));let s=za(a,n,r)?Ra(a):Ei(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Y(a),t=ma(r)?Y(r):r,n=e,i=Na(n);for(;i&&t!==n;){let e=Ia(i),t=i.getBoundingClientRect(),r=Oa(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Y(i),i=Na(n)}}return Ji({width:u,height:d,x:c,y:l})}function Va(e,t){let n=ka(e).scrollLeft;return t?t.left+n:Ba(fa(e)).left+n}function Ha(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Va(e,n),y:n.top+t.scrollTop}}function Ua(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=fa(r),s=t?ya(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ei(1),u=Ei(0),d=ha(r);if((d||!a)&&((da(r)!==`body`||_a(o))&&(c=ka(r)),d)){let e=Ba(r);l=Ia(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Ha(o,c):Ei(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Wa(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ga(e){let t=ka(e),n=e.ownerDocument.body,r=Ci(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Ci(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Va(e),o=-t.scrollTop;return Oa(n).direction===`rtl`&&(a+=Ci(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ka=25;function qa(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Y(e),a=fa(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ea()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Va(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Ka&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ja(e,t){let n=Ba(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ia(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ya(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=qa(e,n,t);else if(t===`document`)r=Ga(fa(e));else if(ma(t))r=Ja(t,n);else{let n=Ra(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ji(r)}function Xa(e,t){let n=t.get(e);if(n)return n;let r=Ma(e,[],!1).filter(e=>ma(e)&&da(e)!==`body`),i=null,a=Oa(e).position===`fixed`,o=a?Aa(e):e;for(;ma(o)&&!Da(o);){let e=Oa(o),t=wa(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Aa(o)}return t.set(e,r),r}function Za(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ya(t)?[]:Xa(t,this._c):[].concat(n),r],o=Ya(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ya(t,a[e],i);s=Ci(n.top,s),c=Si(n.right,c),l=Si(n.bottom,l),u=Ci(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Qa(e){let{width:t,height:n}=Pa(e);return{width:t,height:n}}function $a(e,t,n){let r=ha(t),i=fa(t),a=n===`fixed`,o=Ba(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ei(0);if((r||!a)&&((da(t)!==`body`||_a(i))&&(s=ka(t)),r)){let e=Ba(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Va(i));let l=i&&!r&&!a?Ha(i,s):Ei(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function eo(e){return Oa(e).position===`static`}function to(e,t){if(!ha(e)||Oa(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return fa(e)===n&&(n=n.ownerDocument.body),n}function no(e,t){let n=Y(e);if(ya(e))return n;if(!ha(e)){let t=Aa(e);for(;t&&!Da(t);){if(ma(t)&&!eo(t))return t;t=Aa(t)}return n}let r=to(e,t);for(;r&&va(r)&&eo(r);)r=to(r,t);return r&&Da(r)&&eo(r)&&!wa(r)?n:r||Ta(e)||n}var ro=async function(e){let t=this.getOffsetParent||no,n=this.getDimensions,r=await n(e.floating);return{reference:$a(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function io(e){return Oa(e).direction===`rtl`}var ao={convertOffsetParentRelativeRectToViewportRelativeRect:Ua,getDocumentElement:fa,getClippingRect:Za,getOffsetParent:no,getElementRects:ro,getClientRects:Wa,getDimensions:Qa,getScale:Ia,isElement:ma,isRTL:io};function oo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function so(e,t,n){let r=null,i,a=fa(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Ti(d),h=Ti(a.clientWidth-(u+f)),g=Ti(a.clientHeight-(d+p)),_=Ti(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ci(0,Si(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!oo(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Y(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function co(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Fa(e),u=i||a?[...l?Ma(l):[],...t?Ma(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?so(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Ba(e):null;c&&g();function g(){let t=Ba(e);h&&!oo(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var lo=oa,uo=sa,fo=ea,po=la,mo=ra,ho=$i,go=ca,_o=(e,t,n)=>{let r=new Map,i=n??{},a={...ao,...i.platform,_c:r};return Qi(e,t,{...i,platform:a})},vo=typeof document<`u`?H.useLayoutEffect:function(){};function yo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yo(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!yo(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function bo(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xo(e,t){let n=bo(e);return Math.round(t*n)/n}function So(e){let t=H.useRef(e);return vo(()=>{t.current=e}),t}function Co(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=H.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=H.useState(r);yo(f,r)||p(r);let[m,h]=H.useState(null),[g,_]=H.useState(null),v=H.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=H.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=H.useRef(null),C=H.useRef(null),w=H.useRef(u),T=c!=null,E=So(c),D=So(i),O=So(l),k=H.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),_o(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!yo(w.current,t)&&(w.current=t,pn.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);vo(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=H.useRef(!1);vo(()=>(A.current=!0,()=>{A.current=!1}),[]),vo(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=H.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=H.useMemo(()=>({reference:b,floating:x}),[b,x]),N=H.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=xo(M.floating,u.x),r=xo(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...bo(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return H.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var wo=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ho({element:r.current,padding:i}).fn(n):r?ho({element:r,padding:i}).fn(n):{}}}},To=(e,t)=>{let n=lo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Eo=(e,t)=>{let n=uo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Do=(e,t)=>({fn:go(e).fn,options:[e,t]}),Oo=(e,t)=>{let n=fo(e);return{name:n.name,fn:n.fn,options:[e,t]}},ko=(e,t)=>{let n=po(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ao=(e,t)=>{let n=mo(e);return{name:n.name,fn:n.fn,options:[e,t]}},jo=(e,t)=>{let n=wo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mo=Object.defineProperty,No=(e,t)=>Mo(e,`name`,{value:t,configurable:!0}),Po={Partial:`partial`,Always:`always`},Fo={Optimized:`optimized`,Always:`always`},Io=`Popper`,[Lo,Ro]=_e(Io),[zo,Bo]=Lo(Io),Vo=No(e=>{let{__scopePopper:t,children:n}=e,[r,i]=H.useState(null),[a,o]=H.useState(void 0);return(0,W.jsx)(zo,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Ho=`PopperAnchor`,Uo=H.forwardRef(No(function(t,n){let{__scopePopper:r,virtualRef:i,...a}=t,o=Bo(Ho,r),s=H.useRef(null),c=o.onAnchorChange,l=H.useCallback(e=>{s.current=e,e&&c(e)},[c]),u=C(n,l),d=H.useRef(null);H.useEffect(()=>{if(!i)return;let e=d.current;d.current=i.current,e!==d.current&&c(d.current)});let f=o.placementState&&Xo(o.placementState),p=f?.[0],m=f?.[1];return i?null:(0,W.jsx)(e.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...a,ref:u})},`PopperAnchor`)),Wo=`PopperContent`,[Go,Ko]=Lo(Wo),qo=H.forwardRef(No(function(t,r){let{__scopePopper:i,side:a=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=Po.Partial,hideWhenDetached:m=!1,updatePositionStrategy:h=Fo.Optimized,onPlaced:_,...v}=t,y=Bo(Wo,i),[b,x]=H.useState(null),S=C(r,x),[w,T]=H.useState(null),E=n(w),D=E?.width??0,O=E?.height??0,k=a+(s===`center`?``:`-`+s),A=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},j=Array.isArray(d)?d:[d],M=j.length>0,N={padding:A,boundary:j.filter(Jo),altBoundary:M},{refs:ee,floatingStyles:P,placement:F,isPositioned:I,middlewareData:L}=Co({strategy:`fixed`,placement:k,whileElementsMounted:No((...e)=>co(...e,{animationFrame:h===Fo.Always}),`whileElementsMounted`),elements:{reference:y.anchor},middleware:[To({mainAxis:o+O,alignmentAxis:c}),u&&Eo({mainAxis:!0,crossAxis:!1,limiter:p===Po.Partial?Do():void 0,...N}),u&&Oo({...N}),ko({...N,apply:No(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),w&&jo({element:w,padding:l}),Yo({arrowWidth:D,arrowHeight:O}),m&&Ao({strategy:`referenceHidden`,...N,boundary:M?N.boundary:void 0})]}),R=y.setPlacementState;g(()=>(R(F),()=>{R(void 0)}),[F,R]);let[z,te]=Xo(F),B=G(_);g(()=>{I&&B?.()},[I,B]);let ne=L.arrow?.x,re=L.arrow?.y,ie=L.arrow?.centerOffset!==0,[ae,oe]=H.useState();return g(()=>{b&&oe(window.getComputedStyle(b).zIndex)},[b]),(0,W.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...P,transform:I?P.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(` `),...L.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:t.dir,children:(0,W.jsx)(Go,{scope:i,placedSide:z,placedAlign:te,onArrowChange:T,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,W.jsx)(e.div,{"data-side":z,"data-align":te,...v,ref:S,style:{...v.style,animation:I?v.style?.animation:`none`}})})})},`PopperContent`));function Jo(e){return e!==null}No(Jo,`isNotNull`);var Yo=No(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Xo(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Xo(e){let[t,n=`center`]=e.split(`-`);return[t,n]}No(Xo,`getSideAndAlignFromPlacement`);var Zo=Object.defineProperty,Qo=(e,t)=>Zo(e,`name`,{value:t,configurable:!0}),$o=!1;function es(){let[e,t]=H.useState($o);return H.useEffect(()=>{$o||($o=!0,t(!0))},[]),e}Qo(es,`useIsHydrated`);var ts=H.useSyncExternalStore;function ns(){return()=>{}}Qo(ns,`subscribe`);function rs(){return ts(ns,()=>!0,()=>!1)}Qo(rs,`useIsHydratedModern`);var is=typeof ts==`function`?rs:es,as=Object.defineProperty,os=(e,t)=>as(e,`name`,{value:t,configurable:!0}),ss=`rovingFocusGroup.onEntryFocus`,cs={bubbles:!1,cancelable:!0},ls=`RovingFocusGroup`,[us,ds,fs]=c(ls),[ps,ms]=_e(ls,[fs]),hs={Vertical:`vertical`,Horizontal:`horizontal`},gs={LTR:`ltr`,RTL:`rtl`},[_s,vs]=ps(ls),ys=H.forwardRef(os(function(e,t){return(0,W.jsx)(us.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)(us.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)(bs,{...e,ref:t})})})},`RovingFocusGroup`)),bs=H.forwardRef(os(function(t,n){let{__scopeRovingFocusGroup:i,orientation:a,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...m}=t,h=H.useRef(null),g=C(n,h),_=r(s),[v,y]=p({prop:c,defaultProp:l??null,onChange:u,caller:ls}),[b,S]=H.useState(!1),w=G(d),T=ds(i),E=H.useRef(!1),[D,O]=H.useState(0);return H.useEffect(()=>{let e=h.current;if(e)return e.addEventListener(ss,w),()=>e.removeEventListener(ss,w)},[w]),(0,W.jsx)(_s,{scope:i,orientation:a,dir:_,loop:o,currentTabStopId:v,onItemFocus:H.useCallback(e=>y(e),[y]),onItemShiftTab:H.useCallback(()=>S(!0),[]),onFocusableItemAdd:H.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:H.useCallback(()=>O(e=>e-1),[]),children:(0,W.jsx)(e.div,{tabIndex:b||D===0?-1:0,"data-orientation":a,...m,ref:g,style:{outline:`none`,...t.style},onMouseDown:x(t.onMouseDown,()=>{E.current=!0}),onFocus:x(t.onFocus,e=>{let t=!E.current;if(e.target===e.currentTarget&&t&&!b){let t=new CustomEvent(ss,cs);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=T().filter(e=>e.focusable);Es([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),f)}}E.current=!1}),onBlur:x(t.onBlur,()=>S(!1))})})},`RovingFocusGroupImpl`)),xs=`RovingFocusGroupItem`,Ss=H.forwardRef(os(function(t,n){let{__scopeRovingFocusGroup:r,focusable:i=!0,active:a=!1,tabStopId:o,children:s,...c}=t,l=v(),u=o||l,d=vs(xs,r),f=d.currentTabStopId===u,p=ds(r),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:_}=d,y=is();return g(()=>{if(y&&i)return m(),()=>h()},[y,i,m,h]),H.useEffect(()=>{if(!y&&i)return m(),()=>h()},[y,i,m,h]),(0,W.jsx)(us.ItemSlot,{scope:r,id:u,focusable:i,active:a,children:(0,W.jsx)(e.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:n,onMouseDown:x(t.onMouseDown,e=>{i?d.onItemFocus(u):e.preventDefault()}),onFocus:x(t.onFocus,()=>d.onItemFocus(u)),onKeyDown:x(t.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ts(e,d.orientation,d.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=d.loop?Ds(n,r+1):n.slice(r+1)}setTimeout(()=>Es(n))}}),children:typeof s==`function`?s({isCurrentTabStop:f,hasTabStop:_!=null}):s})})},`RovingFocusGroupItem`)),Cs={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function ws(e,t){return t===gs.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}os(ws,`getDirectionAwareKey`);function Ts(e,t,n){let r=ws(e.key,n);if(!(t===hs.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===hs.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Cs[r]}os(Ts,`getFocusIntent`);function Es(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}os(Es,`focusFirst`);function Ds(e,t){return e.map((n,r)=>e[(t+r)%e.length])}os(Ds,`wrapArray`);var Os=Object.defineProperty,X=(e,t)=>Os(e,`name`,{value:t,configurable:!0}),ks=[`Enter`,` `],As=[`ArrowDown`,`PageUp`,`Home`],js=[`ArrowUp`,`PageDown`,`End`],Ms=[...As,...js];[...ks],[...ks];var Ns=`Menu`,[Ps,Fs,Is]=c(Ns),[Ls,Rs]=_e(Ns,[Is,Ro,ms]),zs=Ro(),Bs=ms(),[Vs,Hs]=Ls(Ns),[Us,Ws]=Ls(Ns),Gs=X(e=>{let{__scopeMenu:t,open:n=!1,children:i,dir:a,onOpenChange:o,modal:s=!0}=e,c=zs(t),[l,u]=H.useState(null),d=H.useRef(!1),f=G(o),p=r(a);return H.useEffect(()=>{let e=X(()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=X(()=>d.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),H.useEffect(()=>{if(!n)return;let e=X(()=>f(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,W.jsx)(Vo,{...c,children:(0,W.jsx)(Vs,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,W.jsx)(Us,{scope:t,onClose:H.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:i})})})},`Menu`),Ks=H.forwardRef(X(function(e,t){let{__scopeMenu:n,...r}=e,i=zs(n);return(0,W.jsx)(Uo,{...i,...r,ref:t})},`MenuAnchor`)),qs=`MenuPortal`,[Js,Ys]=Ls(qs,{forceMount:void 0}),Xs=X(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Hs(qs,t);return(0,W.jsx)(Js,{scope:t,forceMount:n,children:(0,W.jsx)(R,{present:n||a.open,children:(0,W.jsx)(hn,{asChild:!0,container:i,children:r})})})},`MenuPortal`),Zs=`MenuContent`,[Qs,$s]=Ls(Zs),ec=H.forwardRef(X(function(e,t){let n=Ys(Zs,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Hs(Zs,e.__scopeMenu),o=Ws(Zs,e.__scopeMenu);return(0,W.jsx)(Ps.Provider,{scope:e.__scopeMenu,children:(0,W.jsx)(R,{present:r||a.open,children:(0,W.jsx)(Ps.Slot,{scope:e.__scopeMenu,children:o.modal?(0,W.jsx)(tc,{...i,ref:t}):(0,W.jsx)(nc,{...i,ref:t})})})})},`MenuContent`)),tc=H.forwardRef(X(function(e,t){let n=Hs(Zs,e.__scopeMenu),r=H.useRef(null),i=C(t,r);return H.useEffect(()=>{let e=r.current;if(e)return zr(e)},[]),(0,W.jsx)(ic,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:x(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),nc=H.forwardRef(X(function(e,t){let n=Hs(Zs,e.__scopeMenu);return(0,W.jsx)(ic,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),rc=d(`MenuContent.ScrollLock`),ic=H.forwardRef(X(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Hs(Zs,n),_=Ws(Zs,n),v=zs(n),y=Bs(n),b=Fs(n),[S,w]=H.useState(null),T=H.useRef(null),[E,D]=H.useState(null);en(E);let{nodes:O,registry:k}=$t(),A=!!(i||m),j=C(t,T,g.onContentChange,D),M=H.useRef(0),N=H.useRef(``),ee=H.useRef(0),P=H.useRef(null),F=H.useRef(`right`),I=H.useRef(0),L=H.useMemo(()=>m?[T,...O.map(e=>({current:e}))]:[],[T,O,m]),R=m?Ar:H.Fragment,z=m?{as:rc,allowPinchZoom:!0,shards:L}:void 0,te=X(e=>{let t=N.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=wc(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;X((function e(t){N.current=t,window.clearTimeout(M.current),t!==``&&(M.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);H.useEffect(()=>()=>window.clearTimeout(M.current),[]),xn();let B=H.useCallback(e=>F.current===P.current?.side&&Ec(e,P.current?.area),[]);return(0,W.jsx)(Qs,{scope:n,searchRef:N,onItemEnter:H.useCallback(e=>{B(e)&&e.preventDefault()},[B]),onItemLeave:H.useCallback(e=>{B(e)||(T.current?.focus(),w(null))},[B]),onTriggerLeave:H.useCallback(e=>{B(e)&&e.preventDefault()},[B]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:H.useCallback(e=>{P.current=e},[]),children:(0,W.jsx)(Qt,{registry:A?k:null,children:(0,W.jsx)(R,{...z,children:(0,W.jsx)(Xt,{asChild:!0,trapped:i,branches:O,onMountAutoFocus:x(a,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,W.jsx)(zt,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,W.jsx)(ys,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:w,onEntryFocus:x(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,W.jsx)(qo,{role:`menu`,"aria-orientation":`vertical`,"data-state":yc(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:j,style:{outline:`none`,...h.style},onKeyDown:x(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&te(e.key));let i=T.current;if(e.target!==i||!Ms.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);js.includes(e.key)&&a.reverse(),Sc(a)}),onBlur:x(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(M.current),N.current=``)}),onPointerMove:x(e.onPointerMove,Dc(e=>{let t=e.target,n=I.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>I.current?`right`:`left`;F.current=t,I.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),ac=`MenuItem`,oc=`menu.itemSelect`,sc=H.forwardRef(X(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=H.useRef(null),o=Ws(ac,e.__scopeMenu),s=$s(ac,e.__scopeMenu),c=C(t,a),l=H.useRef(!1),u=X(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(oc,{bubbles:!0,cancelable:!0});e.addEventListener(oc,e=>r?.(e),{once:!0}),I(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,W.jsx)(cc,{...i,ref:c,disabled:n,onClick:x(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:x(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:x(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&ks.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),cc=H.forwardRef(X(function(t,n){let{__scopeMenu:r,disabled:i=!1,textValue:a,...o}=t,s=$s(ac,r),c=Bs(r),l=H.useRef(null),u=C(n,l),[d,f]=H.useState(!1),[p,m]=H.useState(``);return H.useEffect(()=>{let e=l.current;e&&m((e.textContent??``).trim())},[o.children]),(0,W.jsx)(Ps.ItemSlot,{scope:r,disabled:i,textValue:a??p,children:(0,W.jsx)(Ss,{asChild:!0,...c,focusable:!i,children:(0,W.jsx)(e.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...o,ref:u,onPointerMove:x(t.onPointerMove,Dc(e=>{i?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:x(t.onPointerLeave,Dc(e=>s.onItemLeave(e))),onFocus:x(t.onFocus,()=>f(!0)),onBlur:x(t.onBlur,()=>f(!1))})})})},`MenuItemImpl`)),lc=H.forwardRef(X(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,W.jsx)(pc,{scope:e.__scopeMenu,checked:n,children:(0,W.jsx)(sc,{role:`menuitemcheckbox`,"aria-checked":bc(n)?`mixed`:n,...i,ref:t,"data-state":xc(n),onSelect:x(i.onSelect,()=>r?.(bc(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[uc,dc]=Ls(`MenuRadioGroup`,{value:void 0,onValueChange:X(()=>{},`onValueChange`)}),fc=`MenuItemIndicator`,[pc,mc]=Ls(fc,{checked:!1}),hc=H.forwardRef(X(function(t,n){let{__scopeMenu:r,forceMount:i,...a}=t,o=mc(fc,r);return(0,W.jsx)(R,{present:i||bc(o.checked)||o.checked===!0,children:(0,W.jsx)(e.span,{...a,ref:n,"data-state":xc(o.checked)})})},`MenuItemIndicator`)),gc=H.forwardRef(X(function(t,n){let{__scopeMenu:r,...i}=t;return(0,W.jsx)(e.div,{role:`separator`,"aria-orientation":`horizontal`,...i,ref:n})},`MenuSeparator`)),[_c,vc]=Ls(`MenuSub`);function yc(e){return e?`open`:`closed`}X(yc,`getOpenState`);function bc(e){return e===`indeterminate`}X(bc,`isIndeterminate`);function xc(e){return bc(e)?`indeterminate`:e?`checked`:`unchecked`}X(xc,`getCheckedState`);function Sc(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}X(Sc,`focusFirst`);function Cc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(Cc,`wrapArray`);function wc(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Cc(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}X(wc,`getNextMatch`);function Tc(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}X(Tc,`isPointInPolygon`);function Ec(e,t){return t?Tc({x:e.clientX,y:e.clientY},t):!1}X(Ec,`isPointerInGraceArea`);function Dc(e){return t=>t.pointerType===`mouse`?e(t):void 0}X(Dc,`whenMouse`);var Oc=Object.defineProperty,kc=(e,t)=>Oc(e,`name`,{value:t,configurable:!0}),Ac=`DropdownMenu`,[jc,Mc]=_e(Ac,[Rs]),Nc=Rs(),[Pc,Fc]=jc(Ac),Ic=kc(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Nc(t),l=H.useRef(null),[u,d]=p({prop:i,defaultProp:a??!1,onChange:o,caller:Ac});return(0,W.jsx)(Pc,{scope:t,triggerId:v(),triggerRef:l,contentId:v(),open:u,onOpenChange:d,onOpenToggle:H.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,W.jsx)(Gs,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Lc=`DropdownMenuTrigger`,Rc=H.forwardRef(kc(function(t,n){let{__scopeDropdownMenu:r,disabled:i=!1,...a}=t,o=Fc(Lc,r),s=Nc(r),c=C(n,o.triggerRef);return(0,W.jsx)(Ks,{asChild:!0,...s,children:(0,W.jsx)(e.button,{type:`button`,id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?`open`:`closed`,"data-disabled":i?``:void 0,disabled:i,...a,ref:c,onPointerDown:x(t.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:x(t.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),zc=kc(e=>{let{__scopeDropdownMenu:t,...n}=e,r=Nc(t);return(0,W.jsx)(Xs,{...r,...n})},`DropdownMenuPortal`),Bc=`DropdownMenuContent`,Vc=H.forwardRef(kc(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Fc(Bc,n),a=Nc(n),o=H.useRef(!1);return(0,W.jsx)(ec,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:x(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:x(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Hc=H.forwardRef(kc(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Nc(n);return(0,W.jsx)(sc,{...i,...r,ref:t})},`DropdownMenuItem`)),Uc=H.forwardRef(kc(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Nc(n);return(0,W.jsx)(lc,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),Wc=H.forwardRef(kc(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Nc(n);return(0,W.jsx)(hc,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),Gc=H.forwardRef(kc(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Nc(n);return(0,W.jsx)(gc,{...i,...r,ref:t})},`DropdownMenuSeparator`)),Z={trigger:`_trigger_26wmo_1`,item:`_item_26wmo_7`,triggerIcon:`_triggerIcon_26wmo_8`,triggerIconOnly:`_triggerIconOnly_26wmo_10`,label:`_label_26wmo_11`,labelMeasure:`_labelMeasure_26wmo_12`,labelText:`_labelText_26wmo_13`,chevron:`_chevron_26wmo_14`,menu:`_menu_26wmo_18`,"menu-exit":`_menu-exit_26wmo_1`,highlight:`_highlight_26wmo_28`,icon:`_icon_26wmo_31`,separator:`_separator_26wmo_32`,destructive:`_destructive_26wmo_33`};function Kc({text:e}){let t=E(),n=(0,H.useRef)(null),r=(0,H.useRef)(null),[a,o]=(0,H.useState)({width:`auto`,animate:!1});return(0,H.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let t=new ResizeObserver(([t])=>{let n=e.textContent,i=r.current!==null&&r.current!==n;r.current=n,o({width:Math.ceil(t.borderBoxSize?.[0]?.inlineSize??e.offsetWidth),animate:i})});return t.observe(e),()=>t.disconnect()},[]),(0,W.jsxs)(V.span,{className:Z.label,initial:!1,animate:{width:a.width},transition:a.animate&&!t?i.spring.morph:{duration:0},children:[(0,W.jsx)(`span`,{ref:n,className:Z.labelMeasure,"aria-hidden":`true`,children:e}),(0,W.jsx)(D,{mode:`popLayout`,initial:!1,children:(0,W.jsx)(V.span,{className:Z.labelText,initial:!t&&{opacity:0,y:`0.3em`,filter:`blur(${i.blur.soft}px)`},animate:{opacity:1,y:0,filter:`blur(0px)`},exit:t?{opacity:0,transition:{duration:0}}:{opacity:0,y:`-0.3em`,filter:`blur(${i.blur.subtle}px)`,transition:{duration:i.duration.fast,ease:[...i.ease.standard]}},transition:{duration:i.duration.standard,ease:[...i.ease.enter]},children:e},e)})]})}function qc({label:e,items:t,icon:n,iconOnly:r}){let a=E(),[o,s]=(0,H.useState)(null),c=(0,H.useRef)(!1),l=(0,H.useRef)(0);(0,H.useEffect)(()=>()=>window.clearTimeout(l.current),[]);function u(e){let t=e.target instanceof HTMLElement?e.target.closest(`[role="menuitem"]`):null;if(window.clearTimeout(l.current),!t){l.current=window.setTimeout(()=>s(null),c.current?70:0);return}let n={top:t.offsetTop,height:t.offsetHeight,danger:t.dataset.tone===`danger`},r=c.current;s(e=>({...n,glide:r&&e!==null}))}return(0,W.jsxs)(Ic,{onOpenChange:e=>{e&&(window.clearTimeout(l.current),s(null))},children:[(0,W.jsxs)(Rc,{className:[Z.trigger,r?Z.triggerIconOnly:``].filter(Boolean).join(` `),type:`button`,"aria-label":r?e:void 0,children:[n&&(0,W.jsx)(`span`,{className:Z.triggerIcon,"aria-hidden":`true`,children:n}),!r&&(0,W.jsx)(Kc,{text:e}),!r&&(0,W.jsx)(ge,{className:Z.chevron,size:15,strokeWidth:1.8,"aria-hidden":`true`})]}),(0,W.jsx)(zc,{children:(0,W.jsxs)(Vc,{className:Z.menu,sideOffset:6,align:`end`,collisionPadding:12,loop:!0,onFocus:u,onPointerMoveCapture:()=>{c.current=!0},onKeyDownCapture:()=>{c.current=!1},children:[(0,W.jsx)(V.span,{className:Z.highlight,"data-tone":o?.danger?`danger`:void 0,"aria-hidden":`true`,initial:!1,animate:o?{y:o.top,height:o.height,opacity:1}:{opacity:0},transition:{default:o?.glide&&!a?i.spring.snappy:{duration:0},opacity:{duration:a?0:.08}}}),t.map((e,t)=>(0,W.jsxs)(H.Fragment,{children:[e.separatorBefore&&(0,W.jsx)(Gc,{className:Z.separator}),(0,W.jsxs)(Hc,{className:[Z.item,e.destructive?Z.destructive:``].filter(Boolean).join(` `),"data-tone":e.destructive?`danger`:void 0,style:{"--i":t},disabled:e.disabled,onSelect:e.onSelect,children:[e.icon&&(0,W.jsx)(`span`,{className:Z.icon,"aria-hidden":`true`,children:e.icon}),e.label]})]},e.label))]})})]})}var Jc=Object.defineProperty,Yc=(e,t)=>Jc(e,`name`,{value:t,configurable:!0});function Xc(e,[t,n]){return Math.min(n,Math.max(t,e))}Yc(Xc,`clamp`);var Zc=Object.defineProperty,Qc=(e,t)=>Zc(e,`name`,{value:t,configurable:!0});function $c(e){let t=H.useRef({value:e,previous:e});return H.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Qc($c,`usePrevious`);var el=Object.defineProperty,tl=(e,t)=>el(e,`name`,{value:t,configurable:!0}),nl=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),rl=H.forwardRef(tl(function(t,n){return(0,W.jsx)(e.span,{...t,ref:n,style:{...nl,...t.style}})},`VisuallyHidden`)),il=Object.defineProperty,Q=(e,t)=>il(e,`name`,{value:t,configurable:!0}),al={ItemAligned:`item-aligned`,Popper:`popper`},ol={LTR:`ltr`,RTL:`rtl`},sl=[` `,`Enter`,`ArrowUp`,`ArrowDown`],cl=[` `,`Enter`],ll=`Select`,[ul,dl,fl]=c(ll),[pl,ml]=_e(ll,[fl,Ro]),hl=Ro(),[gl,_l]=pl(ll),[vl,yl]=pl(ll);function bl(e){let{__scopeSelect:t,children:n,open:i,defaultOpen:a,onOpenChange:o,value:s,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:m,required:h,form:g,internal_do_not_use_render:_}=e,y=hl(t),[b,x]=H.useState(null),[S,C]=H.useState(null),[w,T]=H.useState(!1),E=r(u),[D,O]=p({prop:i,defaultProp:a??!1,onChange:o,caller:ll}),[k,A]=p({prop:s,defaultProp:c,onChange:l,caller:ll}),j=H.useRef(null),M=H.useRef(k);H.useEffect(()=>{let e=g?b?.ownerDocument.getElementById(g):b?.form;if(e instanceof HTMLFormElement){let t=Q(()=>A(M.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[g,b,A]);let N=!b||!!g||!!b.closest(`form`),[ee,P]=H.useState(new Set),F=v(),I=Array.from(ee).map(e=>e.props.value).join(`;`),L=H.useCallback(e=>{P(t=>new Set(t).add(e))},[]),R=H.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),z={required:h,trigger:b,onTriggerChange:x,valueNode:S,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:F,value:k,onValueChange:A,open:D,onOpenChange:O,dir:E,triggerPointerDownPosRef:j,disabled:m,name:d,autoComplete:f,form:g,nativeOptions:ee,nativeSelectKey:I,isFormControl:N};return(0,W.jsx)(Vo,{...y,children:(0,W.jsx)(gl,{scope:t,...z,children:(0,W.jsx)(ul.Provider,{scope:t,children:(0,W.jsx)(vl,{scope:t,onNativeOptionAdd:L,onNativeOptionRemove:R,children:su(_)?_(z):n})})})})}Q(bl,`SelectProvider`);var xl=Q(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,W.jsx)(bl,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,W.jsxs)(W.Fragment,{children:[n,e?(0,W.jsx)(ou,{__scopeSelect:t}):null]})})},`Select`),Sl=`SelectTrigger`,Cl=H.forwardRef(Q(function(t,n){let{__scopeSelect:r,disabled:i=!1,...a}=t,o=hl(r),s=_l(Sl,r),c=s.disabled||i,l=C(n,s.onTriggerChange),u=dl(r),d=H.useRef(`touch`),[f,p,m]=lu(e=>{let t=u().filter(e=>!e.disabled),n=uu(t,e,t.find(e=>e.value===s.value));n!==void 0&&s.onValueChange(n.value)}),h=Q(e=>{c||(s.onOpenChange(!0),m()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,W.jsx)(Uo,{asChild:!0,...o,children:(0,W.jsx)(e.button,{type:`button`,role:`combobox`,"aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":`none`,dir:s.dir,"data-state":s.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":cu(s.value)?``:void 0,...a,ref:l,onClick:x(a.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&h(e)}),onPointerDown:x(a.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(h(e),e.preventDefault())}),onKeyDown:x(a.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&sl.includes(e.key)&&(h(),e.preventDefault())})})})},`SelectTrigger`)),wl=`SelectValue`,Tl=H.forwardRef(Q(function(t,n){let{__scopeSelect:r,className:i,style:a,children:o,placeholder:s=``,...c}=t,l=_l(wl,r),{onValueNodeHasChildrenChange:u}=l,d=o!==void 0,f=C(n,l.onValueNodeChange);g(()=>{u(d)},[u,d]);let p=cu(l.value);return(0,W.jsx)(e.span,{...c,asChild:!p&&c.asChild,ref:f,style:{pointerEvents:`none`},children:(0,W.jsx)(H.Fragment,{children:p?s:o},p?`placeholder`:`value`)})},`SelectValue`)),El=H.forwardRef(Q(function(t,n){let{__scopeSelect:r,children:i,...a}=t;return(0,W.jsx)(e.span,{"aria-hidden":!0,...a,ref:n,children:i||`▼`})},`SelectIcon`)),[Dl,Ol]=pl(`SelectPortal`,{forceMount:void 0}),kl=Q(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,W.jsx)(Dl,{scope:e.__scopeSelect,forceMount:n,children:(0,W.jsx)(hn,{asChild:!0,...r})})},`SelectPortal`),Al=`SelectContent`,jl=H.forwardRef(Q(function(e,t){let n=Ol(Al,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=_l(Al,e.__scopeSelect),[o,s]=H.useState();return g(()=>{s(new DocumentFragment)},[]),(0,W.jsx)(R,{present:r||a.open,children:({present:e})=>e?(0,W.jsx)(Ll,{...i,ref:t}):(0,W.jsx)(Ml,{...i,fragment:o})})},`SelectContent`)),Ml=H.forwardRef(Q(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?pn.createPortal((0,W.jsx)(Pl,{scope:n,children:(0,W.jsx)(ul.Slot,{scope:n,children:(0,W.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Nl=10,[Pl,Fl]=pl(Al),Il=d(`SelectContent.RemoveScroll`),Ll=H.forwardRef(Q(function(e,t){let{__scopeSelect:n}=e,{position:r=al.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=_l(Al,n),[y,b]=H.useState(null),[S,w]=H.useState(null),T=C(t,b),[E,D]=H.useState(null),[O,k]=H.useState(null),A=dl(n),[j,M]=H.useState(!1),N=H.useRef(!1);H.useEffect(()=>{if(y)return zr(y)},[y]),xn();let ee=H.useCallback(e=>{let[t,...n]=A().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[A,S]),P=H.useCallback(()=>ee([E,y]),[ee,E,y]);H.useEffect(()=>{j&&P()},[j,P]);let{onOpenChange:F,triggerPointerDownPosRef:I}=v;H.useEffect(()=>{if(y){let e={x:0,y:0},t=Q(t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},`handlePointerMove`),n=Q(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||F(!1),document.removeEventListener(`pointermove`,t),I.current=null},`handlePointerUp`);return I.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,F,I]),H.useEffect(()=>{let e=Q(()=>F(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[F]);let[L,R]=lu(e=>{let t=A().filter(e=>!e.disabled),n=uu(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),z=H.useCallback((e,t,n)=>{let r=!N.current&&!n;(v.value!==void 0&&v.value===t||r)&&(D(e),r&&(N.current=!0))},[v.value]),te=H.useCallback(()=>y?.focus(),[y]),B=H.useCallback((e,t,n)=>{let r=!N.current&&!n;(v.value!==void 0&&v.value===t||r)&&k(e)},[v.value]),ne=r===al.Popper?zl:Rl,re=ne===zl?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,W.jsx)(Pl,{scope:n,content:y,viewport:S,onViewportChange:w,itemRefCallback:z,selectedItem:E,onItemLeave:te,itemTextRefCallback:B,focusSelectedItem:P,selectedItemText:O,position:r,isPositioned:j,searchRef:L,children:(0,W.jsx)(Ar,{as:Il,allowPinchZoom:!0,children:(0,W.jsx)(Xt,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:x(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,W.jsx)(zt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,W.jsx)(ne,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...re,onPlaced:()=>M(!0),ref:T,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:x(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&R(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=A().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>ee(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Rl=H.forwardRef(Q(function(t,n){let{__scopeSelect:r,onPlaced:i,...a}=t,o=_l(Al,r),s=Fl(Al,r),[c,l]=H.useState(null),[u,d]=H.useState(null),f=C(n,d),p=dl(r),m=H.useRef(!1),h=H.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=s,x=H.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&u&&_&&v&&y){let e=o.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),r=y.getBoundingClientRect();if(o.dir!==ol.RTL){let i=r.left-t.left,a=n.left-i,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Nl,d=Xc(a,[Nl,Math.max(Nl,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let i=t.right-r.right,a=window.innerWidth-n.right-i,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Nl,d=Xc(a,[Nl,Math.max(Nl,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let a=p(),s=window.innerHeight-Nl*2,l=_.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+h+l+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Nl,D=s-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+h+k,j=x-A;if(A<=E){let e=a.length>0&&v===a[a.length-1].ref.current;c.style.bottom=`0px`;let t=u.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);c.style.height=n+`px`}else{let e=a.length>0&&v===a[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}c.style.margin=`${Nl}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,i?.(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,c,u,_,v,y,o.dir,i]);g(()=>x(),[x]);let[S,w]=H.useState();g(()=>{u&&w(window.getComputedStyle(u).zIndex)},[u]);let T=H.useCallback(e=>{e&&h.current===!0&&(x(),b?.(),h.current=!1)},[x,b]);return(0,W.jsx)(Bl,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:T,children:(0,W.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,W.jsx)(e.div,{...a,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})},`SelectItemAlignedPosition`)),zl=H.forwardRef(Q(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Nl,...a}=e,o=hl(n);return(0,W.jsx)(qo,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Bl,Vl]=pl(Al,{}),Hl=`SelectViewport`,Ul=H.forwardRef(Q(function(t,n){let{__scopeSelect:r,nonce:i,...a}=t,o=Fl(Hl,r),s=Vl(Hl,r),c=C(n,o.onViewportChange),l=H.useRef(0);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,W.jsx)(ul.Slot,{scope:r,children:(0,W.jsx)(e.div,{"data-radix-select-viewport":``,role:`presentation`,...a,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...a.style},onScroll:x(a.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-Nl*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})},`SelectViewport`)),[Wl,Gl]=pl(`SelectGroup`),Kl=`SelectItem`,[ql,Jl]=pl(Kl),Yl=H.forwardRef(Q(function(t,n){let{__scopeSelect:r,value:i,disabled:a=!1,textValue:o,...s}=t,c=_l(Kl,r),l=Fl(Kl,r),u=c.value===i,[d,f]=H.useState(o??``),[p,m]=H.useState(!1),h=G(e=>l.itemRefCallback?.(e,i,a)),g=C(n,h),_=v(),y=H.useRef(`touch`),b=Q(()=>{c.onValueChange(i),c.onOpenChange(!1)},`handleSelect`);return(0,W.jsx)(ql,{scope:r,value:i,disabled:a,textId:_,isSelected:u,onItemTextChange:H.useCallback(e=>{f(t=>t||(e?.textContent??``).trim())},[]),children:(0,W.jsx)(ul.ItemSlot,{scope:r,value:i,disabled:a,textValue:d,children:(0,W.jsx)(e.div,{role:`option`,"aria-labelledby":_,"data-highlighted":p?``:void 0,"aria-selected":u&&p,"data-state":u?`checked`:`unchecked`,"aria-disabled":a||void 0,"data-disabled":a?``:void 0,tabIndex:a?void 0:-1,...s,ref:g,onFocus:x(s.onFocus,()=>m(!0)),onBlur:x(s.onBlur,()=>m(!1)),onClick:x(s.onClick,()=>{a||y.current!==`mouse`&&b()}),onPointerUp:x(s.onPointerUp,()=>{a||y.current===`mouse`&&b()}),onPointerDown:x(s.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:x(s.onPointerMove,e=>{y.current=e.pointerType,a?l.onItemLeave?.():y.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:x(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:x(s.onKeyDown,e=>{a||e.target!==e.currentTarget||(l.searchRef?.current===``||e.key!==` `)&&(cl.includes(e.key)&&b(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Xl=`SelectItemText`,Zl=H.forwardRef(Q(function(t,n){let{__scopeSelect:r,className:i,style:a,...o}=t,s=_l(Xl,r),c=Fl(Xl,r),l=Jl(Xl,r),u=yl(Xl,r),[d,f]=H.useState(null),p=G(e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),m=C(n,f,l.onItemTextChange,p),h=d?.textContent,_=H.useMemo(()=>(0,W.jsx)(`option`,{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=u;return g(()=>(v(_),()=>y(_)),[v,y,_]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(e.span,{id:l.textId,...o,ref:m}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!cu(s.value)?pn.createPortal(o.children,s.valueNode):null]})},`SelectItemText`)),Ql=`SelectItemIndicator`,$l=H.forwardRef(Q(function(t,n){let{__scopeSelect:r,...i}=t;return Jl(Ql,r).isSelected?(0,W.jsx)(e.span,{"aria-hidden":!0,...i,ref:n}):null},`SelectItemIndicator`)),eu=`SelectScrollUpButton`,tu=H.forwardRef(Q(function(e,t){let n=Fl(eu,e.__scopeSelect),r=Vl(eu,e.__scopeSelect),[i,a]=H.useState(!1),o=C(t,r.onScrollButtonChange);return g(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};Q(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,W.jsx)(iu,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),nu=`SelectScrollDownButton`,ru=H.forwardRef(Q(function(e,t){let n=Fl(nu,e.__scopeSelect),r=Vl(nu,e.__scopeSelect),[i,a]=H.useState(!1),o=C(t,r.onScrollButtonChange);return g(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};Q(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,W.jsx)(iu,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),iu=H.forwardRef(Q(function(t,n){let{__scopeSelect:r,onAutoScroll:i,...a}=t,o=Fl(`SelectScrollButton`,r),s=H.useRef(null),c=dl(r),l=H.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return H.useEffect(()=>()=>l(),[l]),g(()=>{c().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[c]),(0,W.jsx)(e.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:x(a.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(i,50))}),onPointerMove:x(a.onPointerMove,()=>{o.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(i,50))}),onPointerLeave:x(a.onPointerLeave,()=>{l()})})},`SelectScrollButtonImpl`)),au=`SelectBubbleInput`,ou=H.forwardRef(Q(function({__scopeSelect:t,...n},r){let i=_l(au,t),{value:a,onValueChange:o,required:s,disabled:c,name:l,autoComplete:u,form:d}=i,{nativeOptions:f,nativeSelectKey:p}=i,m=H.useRef(null),h=C(r,m),g=a??``,_=$c(g),v=Array.from(f).some(e=>(e.props.value??``)===``);return H.useEffect(()=>{let e=m.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(_!==g&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[_,g]),(0,W.jsxs)(e.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:l,autoComplete:u,disabled:c,form:d,onChange:e=>o(e.target.value),...n,style:{...nl,...n.style},ref:h,defaultValue:g,children:[cu(a)&&!v?(0,W.jsx)(`option`,{value:``}):null,Array.from(f)]},p)},`SelectBubbleInput`));function su(e){return typeof e==`function`}Q(su,`isFunction`);function cu(e){return e===``||e===void 0}Q(cu,`shouldShowPlaceholder`);function lu(e){let t=G(e),n=H.useRef(``),r=H.useRef(0),i=H.useCallback(e=>{let i=n.current+e;t(i),Q((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=H.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return H.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}Q(lu,`useTypeaheadSearch`);function uu(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=du(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Q(uu,`findNextItem`);function du(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Q(du,`wrapArray`);var $={field:`_field_1a9q6_1`,trigger:`_trigger_1a9q6_4`,valueText:`_valueText_1a9q6_9`,srOnly:`_srOnly_1a9q6_12`,chevron:`_chevron_1a9q6_13`,hint:`_hint_1a9q6_15`,content:`_content_1a9q6_18`,"select-in":`_select-in_1a9q6_1`,"select-out":`_select-out_1a9q6_1`,viewport:`_viewport_1a9q6_23`,item:`_item_1a9q6_24`,indicator:`_indicator_1a9q6_27`,"indicator-in":`_indicator-in_1a9q6_1`,scrollButton:`_scrollButton_1a9q6_28`,"select-fade":`_select-fade_1a9q6_1`,"select-fade-out":`_select-fade-out_1a9q6_1`},fu={enter:e=>({opacity:0,y:`${e*.35}em`,filter:`blur(${i.blur.soft}px)`}),center:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:i.duration.standard,ease:[...i.ease.enter]}},exit:e=>({opacity:0,y:`${e*-.3}em`,filter:`blur(${i.blur.subtle}px)`,transition:{duration:i.duration.fast,ease:[...i.ease.standard]}})},pu={enter:{opacity:0},center:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:i.duration.instant}},exit:{opacity:0,transition:{duration:i.duration.instant}}},mu=(0,H.forwardRef)(function({label:e,description:t,placeholder:n=`Select an option`,options:r,id:i,className:a,disabled:o,onValueChange:s,...c},l){let u=(0,H.useId)(),d=i??u,f=t?`${d}-description`:void 0,p=E(),[m,h]=(0,H.useState)(c.defaultValue??``),g=c.value??m,_=r.findIndex(e=>e.value===g),v=g?r[_]?.label??``:n,[y,b]=(0,H.useState)(_),[x,S]=(0,H.useState)(1);return y!==_&&(b(_),S(_>y?1:-1)),(0,W.jsxs)(`div`,{className:$.field,children:[(0,W.jsx)(`label`,{htmlFor:d,children:e}),(0,W.jsxs)(xl,{...c,disabled:o,onValueChange:e=>{h(e),s?.(e)},children:[(0,W.jsxs)(Cl,{ref:l,id:d,"aria-describedby":f,className:[$.trigger,a].filter(Boolean).join(` `),children:[(0,W.jsx)(`span`,{className:$.srOnly,children:(0,W.jsx)(Tl,{placeholder:n})}),(0,W.jsx)(`span`,{className:$.valueText,"aria-hidden":`true`,children:(0,W.jsx)(D,{initial:!1,custom:x,children:(0,W.jsx)(V.span,{"data-placeholder":g?void 0:``,custom:x,variants:p?pu:fu,initial:`enter`,animate:`center`,exit:`exit`,children:v},g?`value-${g}`:`placeholder`)})}),(0,W.jsx)(El,{className:$.chevron,children:(0,W.jsx)(ge,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]}),(0,W.jsx)(kl,{children:(0,W.jsxs)(jl,{className:$.content,position:`popper`,sideOffset:4,collisionPadding:12,children:[(0,W.jsx)(tu,{className:$.scrollButton,children:(0,W.jsx)(Se,{size:16,strokeWidth:1.75,"aria-hidden":`true`})}),(0,W.jsx)(Ul,{className:$.viewport,children:r.map(e=>(0,W.jsxs)(Yl,{value:e.value,disabled:e.disabled,className:$.item,children:[(0,W.jsx)(Zl,{children:e.label}),(0,W.jsx)($l,{className:$.indicator,children:(0,W.jsx)(A,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]},e.value))}),(0,W.jsx)(ru,{className:$.scrollButton,children:(0,W.jsx)(ge,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]})})]}),t&&(0,W.jsx)(`span`,{id:f,className:$.hint,children:t})]})}),hu={toast:`_toast_c20vg_1`,icon:`_icon_c20vg_16`,frame:`_frame_c20vg_28`,copy:`_copy_c20vg_34`,title:`_title_c20vg_43`,line:`_line_c20vg_52`,description:`_description_c20vg_59`,close:`_close_c20vg_66`},gu=()=>()=>{},_u={duration:i.duration.fast,ease:[...i.ease.standard]},vu={duration:i.duration.standard,ease:[...i.ease.enter]},yu={opacity:0,y:`0.3em`,filter:`blur(${i.blur.soft}px)`},bu={opacity:0,y:`-0.3em`,filter:`blur(${i.blur.subtle}px)`,transition:_u},xu={opacity:1,y:`0em`,filter:`blur(0px)`},Su={opacity:0,transition:{duration:i.duration.instant}},Cu={distance:80,velocity:480};function wu(e){let t=l();return(0,W.jsx)(V.span,{...e,"aria-hidden":!t||e[`aria-hidden`]})}function Tu({reduce:e,morphKey:n,children:r}){let a=(0,H.useRef)(null),o=(0,H.useRef)(null),s=u(`auto`),c=(0,H.useRef)(0);return(0,H.useLayoutEffect)(()=>{c.current=performance.now()},[n]),(0,H.useEffect)(()=>{let n=o.current;if(!n||typeof ResizeObserver>`u`)return;let r,l,u=()=>{s.jump(`auto`),a.current&&Object.assign(a.current.style,{overflow:``,height:`auto`})},d=new ResizeObserver(([o])=>{let d=o.borderBoxSize?.[0]?.blockSize??n.offsetHeight,f=s.get(),p=typeof f==`number`?f:r;if(r=d,l?.stop(),e||p===void 0||p===d||performance.now()-c.current>120)return u();a.current&&Object.assign(a.current.style,{overflow:`hidden`,height:`${p}px`}),l=t(s,[p,d],{...i.spring.smooth,onComplete:u})});return d.observe(n),()=>{d.disconnect(),l?.stop()}},[s,e]),(0,W.jsx)(V.div,{ref:a,className:hu.frame,style:{height:s},children:(0,W.jsx)(`div`,{ref:o,className:hu.copy,children:r})})}function Eu({title:e,description:n,open:r=!0,onOpenChange:a,duration:o=4500}){let s=E(),c=(0,H.useSyncExternalStore)(gu,()=>!0,()=>!1),[l]=(0,H.useState)(c),[d,f]=(0,H.useState)(!1),[p,m]=(0,H.useState)(0),[h,g]=(0,H.useState)(r);r!==h&&(g(r),r&&(f(!1),m(0)));let _=r&&!d,v=(0,H.useRef)(null),y=u(0),b=(0,H.useRef)(0);function x(e){m(e),f(!0),a?.(!1)}(0,H.useEffect)(()=>{if(!_||!a||o<=0)return;let e=window.setTimeout(()=>{m(0),f(!0),a(!1)},o);return()=>window.clearTimeout(e)},[_,a,o]);function S(e,n){let r=Math.sign(n.offset.x||n.velocity.x);if(Math.abs(n.offset.x)<Cu.distance&&Math.abs(n.velocity.x)<Cu.velocity){t(y,0,{...i.spring.snappy,velocity:n.velocity.x});return}b.current=n.velocity.x,x(r*((v.current?.offsetWidth??320)+48))}let C=s?{hidden:{opacity:0},shown:{opacity:1,transition:{duration:i.duration.instant}},exit:Su}:{hidden:{opacity:0,x:0,y:16,scale:.96},shown:{opacity:1,x:0,y:0,scale:1,transition:{...i.spring.morph,opacity:vu}},exit:e=>e?{x:e,opacity:0,transition:{x:{type:`spring`,visualDuration:.3,bounce:0,velocity:b.current,restDelta:2,restSpeed:40},opacity:{duration:i.duration.exit}}}:{opacity:0,y:8,scale:.97,transition:{duration:i.duration.exit,ease:[...i.ease.standard]}}},w={initial:s?{opacity:0}:yu,animate:xu,exit:s?Su:bu,transition:s?{duration:i.duration.instant}:vu};return(0,W.jsx)(D,{initial:l,custom:p,children:_&&(0,W.jsxs)(V.div,{ref:v,className:hu.toast,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,custom:p,variants:C,initial:`hidden`,animate:`shown`,exit:`exit`,style:{x:y},drag:s&&c?!1:`x`,dragMomentum:!1,onDragEnd:S,children:[(0,W.jsx)(`span`,{className:hu.icon,"aria-hidden":`true`,children:(0,W.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.25,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,W.jsx)(V.path,{d:`M4 12.5l5 5L20 6.5`,initial:!s&&{pathLength:0},animate:{pathLength:1},transition:{duration:i.duration.standard,ease:[...i.ease.enter],delay:.12}})})}),(0,W.jsxs)(Tu,{reduce:s,morphKey:`${e}\n${n??``}`,children:[(0,W.jsx)(`strong`,{className:hu.title,children:(0,W.jsx)(D,{mode:`popLayout`,initial:!1,children:(0,W.jsx)(wu,{className:hu.line,...w,children:e},e)})}),(0,W.jsx)(D,{mode:`popLayout`,initial:!1,children:n?(0,W.jsx)(wu,{className:hu.description,...w,children:n},n):null})]}),(0,W.jsx)(`button`,{className:hu.close,type:`button`,"aria-label":`Dismiss notification`,onClick:()=>x(0),children:(0,W.jsx)(ee,{width:16,height:16,strokeWidth:2,"aria-hidden":`true`})})]},`toast`)})}function Du({open:e,onOpenChange:t,title:n,description:r,children:i,footer:a,width:o=460}){return(0,W.jsx)(gi,{open:e,onOpenChange:t,children:(0,W.jsxs)(bi,{title:n,description:r,style:{width:`min(calc(100vw - 2rem), ${o}px)`},children:[i,a&&(0,W.jsx)(`div`,{className:ie(`flex flex-wrap items-center justify-end gap-2`,i!==void 0&&`mt-6`),children:a})]})})}function Ou({label:e,icon:t,items:n,iconOnly:r}){return(0,W.jsx)(qc,{label:e,icon:t,iconOnly:r,items:n.map(e=>({label:e.label,icon:e.icon,destructive:e.destructive,disabled:e.disabled,separatorBefore:e.separatorBefore,onSelect:e.onSelect}))})}var ku=`__astra_empty__`,Au=e=>e===``?ku:e,ju=e=>e===ku?``:e,Mu=12;function Nu({value:e,onChange:t,options:n,placeholder:r,className:i,disabled:a,label:o,ariaLabel:s}){let c=B(),l=n.find(t=>t.value===e),u=T(o,s??r??l?.label),d=ie(`min-w-0`,u.hidden&&`astra-label-hidden`,i);return n.length>Mu?(0,W.jsx)(`div`,{className:d,children:(0,W.jsx)(At,{label:u.label,description:u.field?.description,placeholder:r??c(`common.search`),emptyMessage:c(`common.noResults`),value:e==null?``:Au(e),onValueChange:e=>t(ju(e)),options:n.map(e=>({value:Au(e.value),label:e.detail&&e.detail!==e.label?`${e.label} · ${e.detail}`:e.label,disabled:e.disabled,keywords:e.detail?[e.detail]:void 0}))})}):(0,W.jsx)(`div`,{className:d,children:(0,W.jsx)(mu,{label:u.label,description:u.field?.description,placeholder:r??c(`common.select`),disabled:a,value:e==null||e===``&&!l?``:Au(e),onValueChange:e=>t(ju(e)),options:n.map(e=>({value:Au(e.value),label:e.label,disabled:e.disabled}))})})}var Pu=(0,H.createContext)(null);function Fu({children:e}){let t=B(),[n,r]=(0,H.useState)([]),[i,a]=(0,H.useState)(null),o=(0,H.useRef)(0),s=(0,H.useCallback)(e=>r(t=>t.filter(t=>t.id!==e)),[]),c=(0,H.useCallback)((e,t=`info`)=>{let n=++o.current;r(r=>[...r.slice(-2),{id:n,tone:t,text:e}]),t===`error`&&setTimeout(()=>s(n),8e3)},[s]),l=(0,H.useCallback)(e=>new Promise(t=>a({...e,resolve:t})),[]),u=e=>{i?.resolve(e),a(null)};return(0,W.jsxs)(Pu.Provider,{value:{toast:c,confirm:l},children:[e,(0,W.jsx)(`div`,{className:`pointer-events-none fixed inset-x-0 bottom-5 z-[95] flex flex-col items-center gap-2 px-4`,children:n.map(e=>e.tone===`error`?(0,W.jsx)(`div`,{className:`pointer-events-auto w-[min(100%,26rem)] selectable`,children:(0,W.jsx)(ue,{tone:`danger`,title:t(`common.error`),onDismiss:()=>s(e.id),children:e.text})},e.id):(0,W.jsx)(`div`,{className:`pointer-events-auto flex w-full justify-center`,children:(0,W.jsx)(Eu,{title:e.text,open:!0,onOpenChange:t=>!t&&s(e.id)})},e.id))}),(0,W.jsx)(Du,{open:i!==null,onOpenChange:e=>!e&&u(!1),title:i?.title??``,description:i?.detail,width:420,footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(se,{onClick:()=>u(!1),children:t(`common.cancel`)}),(0,W.jsx)(se,{variant:i?.destructive?`destructive`:`primary`,onClick:()=>u(!0),autoFocus:!0,children:i?.confirmLabel??t(`common.confirm`)})]})})]})}function Iu(){let e=(0,H.useContext)(Pu);if(!e)throw Error(`useFeedback outside FeedbackProvider`);return e}function Lu(e){return e instanceof Error?e.message:String(e)}export{We as $,Jr as A,xt as B,Kr as C,ei as D,li as E,Et as F,ft as G,Qe as H,_t as I,dt as J,mt as K,vt as L,zt as M,Ot as N,Qr as O,Dt as P,nt as Q,yt as R,Ro as S,ii as T,$e as U,rt as V,et as W,ht as X,it as Y,pt as Z,Ss as _,we as _t,Lu as a,qe as at,Uo as b,Ic as c,Pe as ct,Hc as d,Ie as dt,Ge as et,Wc as f,Re as ft,ys as g,Te as gt,Rc as h,Ee as ht,Du as i,ze as it,hn as j,ci as k,Uc as l,Ae as lt,Gc as m,Le as mt,Ou as n,Ye as nt,Iu as o,Ke as ot,zc as p,Ne as pt,ut as q,Nu as r,Xe as rt,rl as s,Ue as st,Fu as t,Ze as tt,Vc as u,Fe as ut,ms as v,be as vt,di as w,qo as x,Vo as y,bt as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{xt as e}from"./alert-qNPoglGp.js";var t={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{xt as e}from"./alert-qNPoglGp.js";var t={name:`power`,size:24,node:[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Bi as e,E as t,Hi as n,Ia as r,Ma as i,Na as a,Vi as o,xt as s,zi as c}from"./alert-qNPoglGp.js";var l={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]};l.node;var u=s(l),d=r(a(),1),f={root:`_root_1ha3b_1`,ring:`_ring_1ha3b_16`,card:`_card_1ha3b_26`,label:`_label_1ha3b_46`,meta:`_meta_1ha3b_46`,indicator:`_indicator_1ha3b_48`,indicatorDot:`_indicatorDot_1ha3b_61`,body:`_body_1ha3b_64`,labelText:`_labelText_1ha3b_66`,icon:`_icon_1ha3b_67`,description:`_description_1ha3b_70`},p=i(),m=[...t.ease.standard],h=((e,t)=>{let n=2*Math.PI/(e*1.2);return{type:`spring`,stiffness:n*n,damping:2*(1-t)*n,mass:1}})(.42,.14),g=()=>()=>{};function _(){let e=(0,d.useSyncExternalStore)(g,()=>!0,()=>!1);return!!o()&&e}var v=(0,d.forwardRef)(function({options:r,value:i,defaultValue:a=null,onValueChange:o,layout:s=`grid`,density:l=`default`,minColumnWidth:u=180,name:g,required:v,disabled:y=!1,className:b,style:x,...S},C){let w=l===`compact`,T=_(),E=(0,d.useId)().replace(/[^a-zA-Z0-9_-]/g,``),D=(0,d.useRef)(null);(0,d.useImperativeHandle)(C,()=>D.current);let[O,k]=(0,d.useState)(a),A=i===void 0?O:i,j=r.findIndex(e=>e.value===A),M=e=>!y&&!e.disabled,N=j>=0&&M(r[j])?j:r.findIndex(M),P=e=>{e!==A&&(i===void 0&&k(e),o?.(e))},F=n(0),I=n(0),L=n(0),R=n(0),z=n(0),B=(0,d.useRef)(!1),V=(0,d.useCallback)(n=>{let r=j<0?null:D.current?.querySelector(`[data-card="${j}"]`);if(!r){z.set(0),B.current=!1;return}let i=[r.offsetLeft,r.offsetTop,r.offsetWidth,r.offsetHeight];if(!n||!B.current||T){F.jump(i[0]),I.jump(i[1]),L.jump(i[2]),R.jump(i[3]),!B.current&&!T&&n?(z.jump(0),e(z,1,{duration:t.duration.fast,ease:m})):z.jump(1),B.current=!0;return}e(F,i[0],h),e(I,i[1],h),e(L,i[2],h),e(R,i[3],h),z.set(1)},[R,z,T,j,L,F,I]),H=(0,d.useRef)(V);(0,d.useLayoutEffect)(()=>{H.current=V,V(!0)},[V]),(0,d.useLayoutEffect)(()=>{let e=D.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>H.current(!1));return t.observe(e),()=>t.disconnect()},[]);let U=()=>Array.from(D.current?.querySelectorAll(`[data-card]`)??[]),W=(e,t)=>{let n=e.key===`ArrowRight`||e.key===`ArrowDown`?1:e.key===`ArrowLeft`||e.key===`ArrowUp`?-1:0;if(e.key===` `||e.key===`Enter`){e.preventDefault(),M(r[t])&&P(r[t].value);return}if(!n&&e.key!==`Home`&&e.key!==`End`)return;e.preventDefault();let i=r.length,a=n&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&getComputedStyle(e.currentTarget).direction===`rtl`?-1:1,o=e.key===`Home`?-1:e.key===`End`?i:t,s=e.key===`Home`?1:e.key===`End`?-1:n*a;for(let e=0;e<i;e++)if(o=(o+s+i)%i,M(r[o])){U()[o]?.focus(),P(r[o].value);return}};return(0,p.jsxs)(`div`,{ref:D,role:`radiogroup`,"aria-disabled":y||void 0,"aria-required":v||void 0,className:[f.root,b].filter(Boolean).join(` `),"data-layout":s,"data-density":l,style:{"--min-column":`${u}px`,...x},...S,children:[(0,p.jsx)(c.span,{className:f.ring,style:{x:F,y:I,width:L,height:R,opacity:z},"aria-hidden":`true`}),r.map((e,n)=>{let r=n===j,i=!M(e),a=`${E}-${n}-label`,o=`${E}-${n}-description`,s=i&&e.disabledReason?e.disabledReason:e.description,l=e.icon&&(0,p.jsx)(`span`,{className:f.icon,children:e.icon});return(0,p.jsxs)(`div`,{role:`radio`,"data-card":n,className:f.card,"aria-checked":r,"aria-disabled":i||void 0,"aria-labelledby":a,"aria-describedby":s?o:void 0,tabIndex:n===N?0:-1,"data-checked":r||void 0,onClick:()=>{i||P(e.value)},onKeyDown:e=>W(e,n),children:[w?l:(0,p.jsx)(`span`,{className:f.indicator,"aria-hidden":`true`,children:(0,p.jsx)(c.span,{className:f.indicatorDot,initial:!1,animate:{scale:+!!r},transition:T?{duration:0}:t.spring.snappy})}),(0,p.jsxs)(`span`,{className:f.body,children:[(0,p.jsxs)(`span`,{id:a,className:f.label,children:[!w&&l,(0,p.jsx)(`span`,{className:f.labelText,children:e.label})]}),s&&(0,p.jsx)(`span`,{id:o,className:f.description,children:s})]}),e.meta&&(0,p.jsx)(`span`,{className:f.meta,children:e.meta})]},e.value)}),g&&(0,p.jsx)(`input`,{type:`hidden`,name:g,value:A??``,required:v})]})});export{u as n,v as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{xt as e}from"./alert-qNPoglGp.js";var t={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ia as e,Na as t,Ri as n,xt as r}from"./alert-qNPoglGp.js";var i={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};i.node;var a=r(i),o=e(n()),s=e(t());function c(){var e=[...arguments];return(0,s.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var l=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function u(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function d(e){return`nodeType`in e}function f(e){return e?u(e)?e:d(e)?e.ownerDocument?.defaultView??window:window:window}function p(e){let{Document:t}=f(e);return e instanceof t}function m(e){return!u(e)&&e instanceof f(e).HTMLElement}function h(e){return e instanceof f(e).SVGElement}function g(e){return e?u(e)?e.document:d(e)?p(e)?e:m(e)||h(e)?e.ownerDocument:document:document:document}var _=l?s.useLayoutEffect:s.useEffect;function v(e){let t=(0,s.useRef)(e);return _(()=>{t.current=e}),(0,s.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function y(){let e=(0,s.useRef)(null);return[(0,s.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,s.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function b(e,t){t===void 0&&(t=[e]);let n=(0,s.useRef)(e);return _(()=>{n.current!==e&&(n.current=e)},t),n}function x(e,t){let n=(0,s.useRef)();return(0,s.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function S(e){let t=v(e),n=(0,s.useRef)(null);return[n,(0,s.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function C(e){let t=(0,s.useRef)();return(0,s.useEffect)(()=>{t.current=e},[e]),t.current}var w={};function T(e,t){return(0,s.useMemo)(()=>{if(t)return t;let n=w[e]==null?0:w[e]+1;return w[e]=n,e+`-`+n},[e,t])}function E(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var D=E(1),O=E(-1);function k(e){return`clientX`in e&&`clientY`in e}function A(e){if(!e)return!1;let{KeyboardEvent:t}=f(e.target);return t&&e instanceof t}function j(e){if(!e)return!1;let{TouchEvent:t}=f(e.target);return t&&e instanceof t}function ee(e){if(j(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return k(e)?{x:e.clientX,y:e.clientY}:null}var te=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[te.Translate.toString(e),te.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),ne=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function M(e){return e.matches(ne)?e:e.querySelector(ne)}var re={display:`none`};function N(e){let{id:t,value:n}=e;return s.createElement(`div`,{id:t,style:re},n)}function ie(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return s.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function ae(){let[e,t]=(0,s.useState)(``);return{announce:(0,s.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var oe=(0,s.createContext)(null);function P(e){let t=(0,s.useContext)(oe);(0,s.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function F(){let[e]=(0,s.useState)(()=>new Set),t=(0,s.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,s.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var I={draggable:`
|
|
2
2
|
To pick up a draggable item, press the space bar.
|
|
3
3
|
While dragging, use the arrow keys to move the item.
|
|
4
4
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
Binary file
|
package/bin/wwwroot/index.html
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
<link rel="icon" type="image/png" href="/favicon.png" />
|
|
8
8
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
9
9
|
<title>Astra</title>
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/alert-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/overlays-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-DDjZdUEf.js"></script>
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/alert-qNPoglGp.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/overlays-ORpFxiz4.js">
|
|
13
13
|
<link rel="stylesheet" crossorigin href="/assets/alert-DwSJjne8.css">
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/overlays-BJrN5PWt.css">
|
|
15
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
15
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BUzE8kPN.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{Bt as e,Dr as t,Ea as n,G as r,Gt as i,H as a,K as o,Kt as s,Mr as c,Or as l,Ta as u,Ut as d,Vt as f,Wt as p,Y as m,_ as h,at as g,c as _,d as v,er as y,fn as b,fr as x,hn as S,ka as C,lt as w,m as T,mt as ee,n as E,qn as D,qr as te,qt as O,r as k,rr as ne,s as re,st as A,t as j,u as M,un as ie,v as N,vt as ae,wa as P,wr as oe,wt as se,xr as ce,y as le,yt as F,zt as I}from"./alert-BhYHbQ5M.js";import{a as L,gt as R,ht as ue,i as de,o as z,r as B}from"./overlays-CF55BHOs.js";import{n as V}from"./ProvidersPage-DSwvae35.js";import{t as fe}from"./download-DXwZa8b6.js";import{t as pe}from"./external-link-D9cY56rt.js";import{t as me}from"./folder-open-Dt-7Rdbw.js";import{a as he,c as H,d as U,f as ge,i as W,l as G,n as _e,o as ve,p as K,r as ye,s as be,t as xe,u as Se}from"./sortable.esm-CTCQ-9IR.js";import{t as Ce}from"./rotate-ccw-Omdd6cJU.js";import{B as we,I as Te,L as Ee,Q as q,R as De,S as J,Y as Oe,Z as ke,b as Ae,h as je,v as Me,x as Y,z as Ne}from"./index-XVK9epgF.js";var Pe={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};Pe.node;var Fe=F(Pe),Ie={name:`circle-arrow-up`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]],aliases:[`arrow-up-circle`]};Ie.node;var Le=F(Ie),Re={name:`shield-alert`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]};Re.node;var ze=F(Re),X=C(n(),1),Z=u(),Be=`astra claude`;function Ve(e){return e.reduce((e,t)=>({requests:e.requests+1,inputTokens:e.inputTokens+t.inputTokens,totalInputTokens:e.totalInputTokens+t.inputTokens+t.cacheReadTokens+t.cacheCreationTokens,outputTokens:e.outputTokens+t.outputTokens,failed:e.failed+ +(t.status===`error`),estimatedCostNanoUsd:e.estimatedCostNanoUsd+(t.estimatedCostNanoUsd??0)}),{requests:0,inputTokens:0,totalInputTokens:0,outputTokens:0,failed:0,estimatedCostNanoUsd:0})}var He=e=>e.status===`active`&&e.enabled;function Ue(e,t){let n=[e.name||e.id,e.email?`· ${e.email}`:null,e.plan?`· ${e.plan}`:null].filter(Boolean).join(` `);return He(e)?n:`${n} · ${t}`}function We({enabled:e,gatewayEnabled:t}){let{t:n}=A(),{toast:r}=z(),i=ke(),a=d(e),o=oe(),[s,c]=(0,X.useState)(null),l=a.data?.mode??`gateway`,u=a.data?.accounts??[],f=a.data?.accountId??null??u.find(He)?.id??null,m=u.find(e=>e.id===f),g=l===`direct`,v=t&&(g||a.data!=null),y=g&&m?.telemetryEnabled===!0,b=p(y?m?.id:null,y),x=o.isPending,S=e=>o.mutate(e,{onError:e=>r(L(e),`error`)});return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(M,{title:n(`clients.claudeDirect.modeTitle`),footer:n(`clients.claudeDirect.modeFooter`),children:[(0,Z.jsx)(T,{label:n(`clients.claudeDirect.mode`),detail:n(g?`clients.claudeDirect.directDetail`:`clients.claudeDirect.gatewayDetail`),children:(0,Z.jsx)(h,{ariaLabel:n(`clients.claudeDirect.mode`),value:l,onChange:e=>{if(e===l||x||!a.data)return;let t=f??u.find(He)?.id??null;if(e===`direct`&&!t){r(n(`clients.claudeDirect.needAccountToast`),`error`);return}S({mode:e,accountId:t})},items:[{value:`gateway`,label:n(`clients.claudeDirect.gateway`)},{value:`direct`,label:n(`clients.claudeDirect.direct`)}]})}),(0,Z.jsx)(`p`,{className:`px-4 pb-2 text-[11px] text-[var(--text-muted)]`,children:n(`clients.claudeDirect.modeNote`)})]}),a.isLoading&&(0,Z.jsx)(N,{lines:3}),a.isError&&(0,Z.jsx)(`div`,{className:`mb-5`,children:(0,Z.jsx)(j,{tone:`danger`,title:n(`clients.claudeDirect.loadFailed`),children:L(a.error)})}),v&&(0,Z.jsx)(`div`,{className:`mb-5`,children:(0,Z.jsx)(j,{tone:`warning`,title:n(`clients.claudeDirect.gatewayOnTitle`),children:n(`clients.claudeDirect.gatewayOnDetail`)})}),a.data&&(0,Z.jsx)(M,{title:n(`clients.claudeDirect.accountsTitle`),footer:n(`clients.claudeDirect.accountsFooter`),children:u.length===0?(0,Z.jsx)(_,{title:n(`clients.claudeDirect.noAccount`),detail:n(`clients.claudeDirect.noAccountDetail`),action:(0,Z.jsx)(k,{variant:`primary`,onClick:()=>i(`/providers`),children:n(`clients.claudeDirect.goProviders`)})}):(0,Z.jsx)(T,{label:n(`clients.claudeDirect.account`),children:(0,Z.jsx)(B,{className:`max-w-[300px]`,ariaLabel:n(`clients.claudeDirect.account`),value:f,onChange:e=>{x||e===f||S({mode:l,accountId:e})},options:u.map(e=>({value:e.id,label:Ue(e,n(`clients.claudeDirect.accountDisabledSuffix`,{status:n(`providers.subscription.status.${e.status}`)})),disabled:!He(e)}))})})}),a.data&&g&&m&&(0,Z.jsx)(M,{title:n(`clients.claudeDirect.launchTitle`),footer:n(`clients.claudeDirect.launchNote`),children:(0,Z.jsx)(Ge,{command:Be,copied:s,onCopy:async e=>{await R.copy(e)&&(c(e),r(n(`common.copied`)))}})}),a.data&&g&&m&&(0,Z.jsxs)(M,{title:n(`clients.claudeDirect.statsTitle`),footer:n(`clients.claudeDirect.statsFooter`),children:[(0,Z.jsx)(T,{label:n(`clients.claudeDirect.statsConsent`),detail:n(`clients.claudeDirect.statsConsentDetail`),children:(0,Z.jsx)(le,{label:n(`clients.claudeDirect.statsConsent`),checked:m.telemetryEnabled,disabled:x,onChange:e=>{m&&!x&&S({mode:l,accountId:m.id,telemetryEnabled:e})}})}),y&&(0,Z.jsx)(Ke,{requests:b})]})]})}function Ge({command:e,copied:t,onCopy:n}){let{t:r}=A();return(0,Z.jsx)(T,{label:(0,Z.jsx)(`span`,{className:`font-mono text-[12px] break-all selectable`,children:e}),children:(0,Z.jsx)(k,{size:`sm`,icon:(0,Z.jsx)(ee,{className:`size-3`}),variant:t===e?`primary`:`glass`,"aria-label":r(`common.copy`),title:r(`common.copy`),onClick:()=>void n(e),children:r(t===e?`common.copied`:`common.copy`)})})}function Ke({requests:e}){let{t,locale:n}=A(),i=e.data??[],s=Ve(i);return e.isLoading?(0,Z.jsx)(`div`,{className:`p-4`,children:(0,Z.jsx)(N,{lines:3})}):e.isError?(0,Z.jsx)(`div`,{className:`p-4`,children:(0,Z.jsx)(j,{tone:`danger`,title:t(`clients.claudeDirect.statsFailed`),children:L(e.error)})}):i.length===0?(0,Z.jsx)(_,{icon:(0,Z.jsx)(we,{className:`size-6`}),title:t(`clients.claudeDirect.statsEmpty`),detail:t(`clients.claudeDirect.statsEmptyDetail`)}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(T,{label:t(`clients.claudeDirect.statsTotals`,{count:m(s.requests)}),detail:t(`clients.claudeDirect.statsInDetail`,{input:m(s.totalInputTokens),cache:m(i.reduce((e,t)=>e+t.cacheReadTokens,0)),output:m(s.outputTokens)})}),(0,Z.jsx)(T,{label:t(`clients.claudeDirect.statsCost`),detail:t(`clients.claudeDirect.statsCostDetail`),children:(0,Z.jsx)(`span`,{className:`num text-[13px]`,children:o(i.some(e=>e.estimatedCostNanoUsd!=null)?s.estimatedCostNanoUsd:null)})}),s.failed>0&&(0,Z.jsx)(T,{label:t(`clients.claudeDirect.statsFailedCount`,{count:m(s.failed)}),children:(0,Z.jsx)(E,{tone:`red`,children:t(`clients.claudeDirect.statusError`)})}),i.map(e=>(0,Z.jsx)(T,{label:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`truncate`,children:e.model}),e.status===`error`?(0,Z.jsx)(E,{tone:`red`,children:t(`clients.claudeDirect.statusError`)}):(0,Z.jsx)(E,{tone:`green`,children:t(`status.success`)})]}),detail:(0,Z.jsx)(`span`,{className:`num`,children:[a(e.occurredAtUtc,n),t(`clients.claudeDirect.tokensDetail`,{input:m(e.inputTokens),output:m(e.outputTokens)}),e.durationMs==null?null:r(e.durationMs),e.accountUuid??null].filter(Boolean).join(` · `)}),children:(0,Z.jsx)(`span`,{className:`num text-[13px]`,children:o(e.estimatedCostNanoUsd)})},e.id))]})}function qe({descriptors:e,values:t,onChange:n,enabled:r}){let{t:i}=A(),a=(e,r)=>{let i={...t};r===void 0||r===!1||r===0||r==="default"||r===``?delete i[e]:i[e]=r,n(i)};return(0,Z.jsx)(M,{title:i(`clients.options.title`),footer:i(r?`clients.options.footerEnabled`:`clients.options.footer`),children:e.map(e=>{let n=i(`clients.option.${e.key}`),r=i(`clients.option.${e.key}.hint`),o=t[e.key];return(0,Z.jsxs)(T,{label:n,detail:r,children:[e.type===`bool`&&(0,Z.jsx)(le,{label:n,checked:o===!0,onChange:t=>a(e.key,t)}),e.type===`int`&&(0,Z.jsx)(v,{className:`w-36`,mono:!0,inputMode:`numeric`,"aria-label":n,placeholder:i(`clients.options.unset`),value:typeof o==`number`?String(o):``,onChange:t=>{let n=Number.parseInt(t.target.value.replace(/\D/g,``),10);a(e.key,Number.isFinite(n)?n:void 0)}}),e.type===`enum`&&(0,Z.jsx)(B,{ariaLabel:n,value:typeof o==`string`?o:`default`,onChange:t=>a(e.key,t),options:(e.choices??[]).map(e=>({value:e,label:i(`clients.optionChoice.${e}`)})),className:`w-36`})]},e.key)})})}var Je=[`openai-chat`,`openai-responses`,`anthropic`,`gemini`],Ye=e=>typeof e==`string`&&Je.includes(e);function Xe(e){let t=e?.protocolOverrides,n={};if(!t||typeof t!=`object`)return n;for(let[e,r]of Object.entries(t))Ye(r)&&(n[e]=r);return n}function Ze(e){let t=e?.models;if(!t||typeof t!=`object`)return[];let n=[];for(let e of Object.values(t)){if(!e||typeof e!=`object`)continue;let t=e;typeof t.id==`string`&&t.id&&!n.some(e=>e.id===t.id)&&n.push({id:t.id,name:typeof t.name==`string`&&t.name?t.name:t.id,native:Array.isArray(t.protocols)?t.protocols.filter(Ye):[]})}return n}function Qe(e,t){let n=e.native.find(e=>t.includes(e));return n?{protocol:n,translated:!1}:{protocol:t[0],translated:!0}}var $e=e=>Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`
|
|
2
|
-
`),et=`auto`,tt=e=>V.find(t=>t.value===e)?.label??e;function nt({models:e,supported:t,values:n,onChange:r,enabled:i}){let{t:a}=A(),o=(e,t)=>{let i={...n};t===et?delete i[e]:i[e]=t,r(i)};return(0,Z.jsx)(M,{title:a(`clients.protocols.title`),footer:a(i?`clients.protocols.footerEnabled`:`clients.protocols.footer`),children:e.map(e=>{let r=Qe(e,t),i=e.native.filter(e=>t.includes(e));return(0,Z.jsx)(T,{label:e.name,detail:i.length>0?a(`clients.protocols.native`,{protocols:i.map(tt).join(` · `)}):a(`clients.protocols.noNative`),children:(0,Z.jsx)(B,{ariaLabel:e.name,className:`w-60`,value:n[e.id]&&t.includes(n[e.id])?n[e.id]:et,onChange:t=>o(e.id,t),options:[{value:et,label:a(r.translated?`clients.protocols.autoTranslated`:`clients.protocols.auto`,{protocol:tt(r.protocol)})},...t.map(e=>({value:e,label:tt(e)}))]})},e.id)})})}function rt(e,t){let n=e?.options,r={};if(!n||typeof n!=`object`)return r;for(let e of t??[]){let t=n[e.key];e.type===`bool`&&t===!0?r[e.key]=!0:(e.type===`int`&&typeof t==`number`&&t>0||e.type===`enum`&&typeof t==`string`&&t!=="default"&&e.choices?.includes(t))&&(r[e.key]=t)}return r}var it=e=>Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`
|
|
3
|
-
`),at=[`ANTHROPIC_MODEL`,`ANTHROPIC_DEFAULT_OPUS_MODEL`,`ANTHROPIC_DEFAULT_SONNET_MODEL`,`ANTHROPIC_DEFAULT_HAIKU_MODEL`];function ot(e){let t=e?.models,n={};if(!t||typeof t!=`object`)return n;for(let e of at){let r=t[e];typeof r==`string`&&r.trim()&&(n[e]=r.trim())}return n}var st=e=>at.map(t=>e[t]??``).join(`
|
|
4
|
-
`),Q=[`sonnet`,`opus`,`haiku`];function ct(e){let t=e?.roleMap,n={};if(!t||typeof t!=`object`)return n;for(let e of Q){let r=t[e];typeof r==`string`&&r.trim()&&(n[e]=r.trim())}return n}var $=e=>Q.map(t=>e[t]??``).join(`
|
|
5
|
-
`),lt=/(^|[-_.:/\s])(haiku|flash|mini|lite|nano|small|fast|air)($|[-_.:/\s])/i;function ut(e){if(e.length===0)return{};let t=t=>e.find(e=>e.toLowerCase().includes(t)),n=e.find(e=>!lt.test(e))??e[0],r=e.find(e=>lt.test(e))??n;return{sonnet:t(`sonnet`)??n,opus:t(`opus`)??t(`sonnet`)??n,haiku:t(`haiku`)??r}}function dt(){let{t:e}=A(),t=ke(),{toast:n}=z(),r=q(),i=O(),a=f(),o=(0,X.useMemo)(()=>new Map((i.data??[]).map(e=>[e.kind,e])),[i.data]),s=pt(i.data).includes(r.kind)?r.kind:`codex`,c=o.get(s);return(0,X.useEffect)(()=>a.mutate(!1),[]),(0,Z.jsx)(je,{title:e(`nav.clients`),subtitle:e(`clients.subtitle`),actions:(0,Z.jsx)(k,{icon:(0,Z.jsx)(Ee,{className:`size-3.5`}),loading:a.isPending,onClick:()=>a.mutate(!0,{onSuccess:t=>{let r=t.filter(e=>e.install?.updateAvailable&&e.install.blocker!==`shadowed`).length;n(r>0?e(`clients.updatesFound`,{count:r}):e(`clients.allUpToDate`),r>0?void 0:`success`)},onError:e=>n(L(e),`error`)}),children:e(`clients.checkUpdates`)}),children:(0,Z.jsx)(`div`,{className:`@container mx-auto max-w-[1200px]`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 @3xl:flex-row @3xl:items-start @3xl:gap-5`,children:[(0,Z.jsx)(_t,{clients:i.data,loading:i.isLoading,selected:s,onSelect:e=>t(`/clients/${e}`,{replace:!0})}),(0,Z.jsxs)(`div`,{className:`mx-auto w-full max-w-[760px] min-w-0 flex-1`,children:[i.isLoading&&(0,Z.jsx)(N,{lines:4}),i.isError&&(0,Z.jsx)(j,{tone:`danger`,title:e(`common.error`),children:L(i.error)}),c&&(0,Z.jsx)(xt,{client:c})]})]})})})}var ft=new Set([`opencode`,`pi`,`minimax-code`,`copilot-cli`,`vscode-copilot`,`crush`,`qwen-code`,`droid`,`kimi-code`,`zed`,`vscode-insiders`,`vscodium`,`omp`,`mimo-code`,`deepseek-harness`,`workbuddy`,`workbuddy-ai`,`nextcowork`,`paseo`,`zcode`,`muse-code`,`codex`,`grok-build`,`hermes-agent`]);function pt(e){let t=(e??[]).filter(e=>!Me.includes(e.kind)).sort((e,t)=>e.name.localeCompare(t.name));return[...Me,...t.map(e=>e.kind)]}var mt=[`installed`,`notInstalled`,`comingSoon`];function ht(e){return e.availability===`coming_soon`?`comingSoon`:e.detection.installed||e.enabled||e.install?.installed?`installed`:`notInstalled`}function gt(e){return e.install?.version??e.detection.version??null}function _t({clients:e,loading:t,selected:n,onSelect:r}){let{t:i}=A(),a=new Map((e??[]).map(e=>[e.kind,e])),o=mt.map(t=>({group:t,items:pt(e).flatMap(e=>{let n=a.get(e);return n&&ht(n)===t?[n]:[]})})).filter(e=>e.items.length>0);return(0,Z.jsxs)(`nav`,{"aria-label":i(`nav.clients`),className:`card shrink-0 p-1.5 @3xl:sticky @3xl:top-0 @3xl:w-[232px]`,children:[t&&(0,Z.jsx)(N,{lines:6,className:`p-2`}),(0,Z.jsx)(`div`,{className:`flex gap-1 overflow-x-auto @3xl:flex-col @3xl:gap-0 @3xl:overflow-visible`,children:o.map(({group:e,items:t})=>(0,Z.jsxs)(`div`,{className:`contents @3xl:block`,children:[(0,Z.jsxs)(`h3`,{className:`hidden px-2.5 pt-2 pb-1 text-[11px] font-medium text-[var(--text-muted)] @3xl:block`,children:[i(`clients.group.${e}`),` · `,t.length]}),t.map(e=>(0,Z.jsx)(vt,{client:e,active:e.kind===n,onSelect:()=>r(e.kind)},e.kind))]},e))})]})}function vt({client:e,active:t,onSelect:n}){let{t:r}=A(),i=ht(e)!==`installed`,a=gt(e),o=e.install?.blocker===`shadowed`,s=e.install?.updateAvailable&&!o?e.install.latestVersion:null;return(0,Z.jsxs)(`button`,{type:`button`,"aria-label":J(e.kind,e.name),"aria-current":t?`page`:void 0,onClick:n,className:g(`flex shrink-0 items-center gap-2.5 rounded-[var(--radius-control)] px-2.5 py-1.5 text-left transition-colors @3xl:w-full`,t?`bg-[var(--accent-subtle)]`:`hover:bg-[var(--surface-muted)]`),children:[(0,Z.jsx)(`span`,{className:g(`inline-flex`,i&&!t&&`opacity-60`),children:(0,Z.jsx)(Ae,{kind:e.kind,size:24})}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:g(`block truncate text-[13px] whitespace-nowrap`,t&&`font-medium`),children:J(e.kind,e.name)}),a&&(0,Z.jsxs)(`span`,{className:`hidden truncate text-[11px] text-[var(--text-secondary)] @3xl:block`,children:[a,s&&(0,Z.jsxs)(`span`,{className:`text-[var(--warning)]`,children:[` → `,s]})]})]}),e.install?.busy&&(0,Z.jsx)(yt,{}),s&&!e.install?.busy&&(0,Z.jsx)(E,{tone:`orange`,title:r(`clients.updateTo`,{version:s}),children:r(`clients.updateBadge`)}),o&&!e.install?.busy&&(0,Z.jsx)(E,{tone:`orange`,title:r(`clients.shadowed.title`,{version:e.install?.latestVersion??``}),children:r(`clients.shadowedBadge`)}),e.status===`drifted`?(0,Z.jsx)(`span`,{title:r(`clients.drifted`),"aria-label":r(`clients.drifted`),className:`inline-flex`,children:(0,Z.jsx)(re,{tone:`orange`})}):e.enabled?(0,Z.jsx)(ae,{className:`size-3.5 shrink-0 text-[var(--success)]`,strokeWidth:2.5,"aria-label":r(`clients.enabled`)}):null]})}function yt(){return(0,Z.jsx)(Ne,{className:`size-3.5 shrink-0 animate-spin text-[var(--text-secondary)] motion-reduce:animate-none`,"aria-hidden":!0})}function bt(e,t){return e.availability===`coming_soon`?(0,Z.jsx)(E,{children:t(`clients.comingSoon`)}):e.status===`drifted`?(0,Z.jsx)(E,{tone:`orange`,children:t(`clients.drifted`)}):e.enabled?(0,Z.jsx)(E,{tone:`green`,children:t(`clients.enabled`)}):(0,Z.jsx)(E,{children:t(`clients.disabled`)})}function xt({client:e}){let{t:n,locale:r}=A(),i=ke(),{toast:o,confirm:c}=z(),l=ne(),u=t(),f=ie(),p=S(),m=x(),h=te(),g=s(e.kind,!!e.providerId),[_,v]=(0,X.useState)(e.selectedModel??null),[b,C]=(0,X.useState)(e.accountId??``),w=e.tokenId??`default`,[D,O]=(0,X.useState)(w),re=(h.data??[]).filter(e=>e.enabled||e.id===w).map(e=>({value:e.id,label:e.enabled?e.name:n(`clients.tokenDisabled`,{name:e.name}),disabled:!e.enabled})),[ae,P]=(0,X.useState)(!1),[oe,se]=(0,X.useState)(!1),[ce,le]=(0,X.useState)(null),F=e.availability===`coming_soon`,I=J(e.kind,e.name),de=(l.data??[]).filter(e=>e.enabled),V=e.detection.configPaths[0],fe=de.find(t=>t.id===e.providerId),pe=fe?.authScheme===`oauth-subscription`||fe?.authScheme===`plugin`,he=y(fe?.id,pe),H=e.kind===`claude-desktop`,U=e.kind===`claude-code`,ge=d(U),W=U&&ge.data?.mode===`direct`,G=ct(e.extras),[_e,ve]=(0,X.useState)(G),K=Q.some(e=>_e[e]),ye=$(_e)!==$(G),be=ot(e.extras),[xe,Se]=(0,X.useState)(be),Ce=(_??null)!==(e.selectedModel??null)||st(xe)!==st(be),Te=U?at.filter(e=>e!==`ANTHROPIC_MODEL`):[],Ee=U?e.enabled?n(`clients.modelSlotsFooterEnabled`):n(`clients.modelSlotsFooter`):e.enabled?n(`clients.modelFooterEnabled`):n(`clients.modelFooter`),q=e.options??[],De=rt(e.extras,q),[Oe,je]=(0,X.useState)(De),Me=it(Oe)!==it(De),Y=e.protocols??[],Ne=Y.length>1?Ze(e.extras):[],Pe=Xe(e.extras),[Ie,Le]=(0,X.useState)(Pe),Re=$e(Ie)!==$e(Pe),ze=H?{...e.extras,roleMap:_e}:U?{...e.extras,models:xe,options:Oe}:q.length>0||Y.length>1?{...e.extras,...q.length>0?{options:Oe}:{},...Y.length>1?{protocolOverrides:Ie}:{}}:void 0;(0,X.useEffect)(()=>v(e.selectedModel??null),[e.kind,e.selectedModel]),(0,X.useEffect)(()=>C(e.accountId??``),[e.kind,e.providerId,e.accountId]),(0,X.useEffect)(()=>O(w),[e.kind,w]),(0,X.useEffect)(()=>ve(ct(e.extras)),[e.kind,$(G)]);let Be=(0,X.useRef)({});(0,X.useEffect)(()=>{if(!H||e.enabled||Q.some(e=>G[e]))return;let t=Be.current,n=ut(g.data??[]);Be.current=n,ve(e=>(!Q.some(t=>e[t])||$(e)===$(t))&&$(e)!==$(n)?n:e)},[e.kind,e.enabled,$(G),(g.data??[]).join(`
|
|
6
|
-
`)]),(0,X.useEffect)(()=>Se(ot(e.extras)),[e.kind,st(be)]),(0,X.useEffect)(()=>je(rt(e.extras,e.options)),[e.kind,it(De)]),(0,X.useEffect)(()=>Le(Xe(e.extras)),[e.kind,$e(Pe)]);let Ve=()=>{e.providerId&&u.mutate({kind:e.kind,providerId:e.providerId,accountId:b},{onSuccess:()=>o(n(`common.saved`),`success`),onError:e=>o(L(e),`error`)})},He=async()=>{await c({title:n(`clients.disableConfirm`,{name:I}),detail:n(`clients.disableDetail`),confirmLabel:n(`clients.disable`)})&&f.mutate(e.kind,{onSuccess:async t=>{if(t.drifted.length===0){o(n(`clients.disabledToast`,{name:I}),`success`);return}await c({title:n(`clients.driftTitle`),detail:n(`clients.driftDetail`,{keys:t.drifted.join(`, `)}),confirmLabel:n(`clients.forceRestore`),destructive:!0})&&p.mutate(e.kind,{onSuccess:()=>o(n(`clients.disabledToast`,{name:I}),`success`),onError:e=>o(L(e),`error`)})},onError:e=>o(L(e),`error`)})},Ue=async()=>{V&&(R.canOpenPaths?await R.openPath(ue(V)):await R.copy(V)&&o(n(`common.copied`)))};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(M,{children:[(0,Z.jsxs)(T,{icon:(0,Z.jsx)(Ae,{kind:e.kind,size:36}),label:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-[15px] font-medium`,children:I}),W?(0,Z.jsx)(E,{children:n(`clients.claudeDirect.direct`)}):bt(e,n)]}),detail:F?e.availabilityReason??n(`clients.comingSoonDetail`):[ht(e)===`installed`?n(`clients.detected`,{version:gt(e)??``}):n(`clients.notDetected`),W?null:V].filter(Boolean).join(` · `),className:`py-3`,children:[!F&&(0,Z.jsx)(Tt,{client:e,onOpen:le}),W?(0,Z.jsx)(k,{variant:`primary`,onClick:()=>document.getElementById(Dt)?.scrollIntoView({behavior:`smooth`,block:`start`}),children:n(`clients.claudeDirect.configure`)}):e.enabled?(0,Z.jsx)(k,{onClick:()=>void He(),loading:f.isPending,children:n(`clients.disableRestore`)}):(0,Z.jsx)(k,{variant:`primary`,disabled:F||!e.providerId||H&&!K,onClick:()=>P(!0),title:e.providerId?H&&!K?n(`clients.roleMapRequired`):void 0:n(`clients.pickProviderFirst`),children:n(`clients.enable`)})]}),!W&&e.appliedAt&&(0,Z.jsx)(T,{label:(0,Z.jsx)(`span`,{className:`text-[12px] text-[var(--text-secondary)]`,children:n(`clients.appliedAt`,{time:a(e.appliedAt,r)})})})]}),!F&&!e.enabled&&H&&e.providerId&&!K&&(0,Z.jsxs)(`div`,{className:`mb-5 flex flex-col items-start gap-2`,children:[(0,Z.jsx)(j,{tone:`info`,className:`self-stretch`,title:n(`clients.roleMapHint`)}),(0,Z.jsx)(k,{onClick:()=>document.getElementById(Ot)?.scrollIntoView({behavior:`smooth`,block:`start`}),children:n(`clients.roleMapGoto`)})]}),(e.repairs?.length??0)>0&&(0,Z.jsxs)(`div`,{className:`mb-5 flex flex-col items-start gap-2`,children:[(0,Z.jsxs)(j,{tone:`danger`,className:`self-stretch`,title:n(`clients.repair.title`,{name:I}),children:[e.repairs?.map(e=>(0,Z.jsxs)(`span`,{className:`block break-all`,children:[(0,Z.jsx)(`span`,{className:`font-mono`,children:e.file}),` — `,n(`clients.repair.problem.${e.problem}`,{line:e.line})]},e.file)),(0,Z.jsx)(`span`,{className:`block`,children:n(`clients.repair.hint`)})]}),(0,Z.jsx)(k,{variant:`primary`,loading:m.isPending,onClick:()=>m.mutate(e.kind,{onSuccess:()=>o(n(`clients.repair.done`,{name:I}),`success`),onError:e=>o(L(e),`error`)}),children:n(`clients.repair.action`)})]}),!W&&e.warnings.length>0&&(0,Z.jsx)(`div`,{className:`mb-5 flex flex-col gap-2`,children:e.warnings.map((e,t)=>(0,Z.jsx)(j,{tone:`warning`,title:e},t))}),!W&&(0,Z.jsx)(Ct,{client:e,providers:l.data??[],loading:l.isLoading,soon:F}),!W&&pe&&(0,Z.jsx)(M,{title:n(`clients.accountTitle`),footer:n(`clients.accountFooter`),children:he.isLoading?(0,Z.jsx)(`div`,{className:`p-4`,children:(0,Z.jsx)(N,{lines:2})}):(0,Z.jsxs)(T,{label:n(`clients.account`),children:[(0,Z.jsx)(B,{className:`max-w-[300px]`,ariaLabel:n(`clients.account`),value:b,onChange:C,options:[{value:``,label:n(`clients.accountDefault`)},...(he.data??[]).map(e=>({value:e.id,label:(e.displayName||e.id)+(e.status===`active`?``:` · ${n(`providers.subscription.status.${e.status}`)}`)}))]}),b!==(e.accountId??``)&&(0,Z.jsx)(k,{size:`sm`,variant:`primary`,loading:u.isPending,onClick:Ve,children:n(`common.apply`)})]})}),!F&&!W&&(0,Z.jsxs)(M,{title:n(`clients.tokenTitle`),footer:e.enabled?n(`clients.tokenFooterEnabled`):n(`clients.tokenFooter`),children:[(0,Z.jsxs)(T,{label:n(`clients.token`),children:[(0,Z.jsx)(B,{className:`max-w-[300px]`,ariaLabel:n(`clients.token`),value:D,onChange:O,options:re}),e.enabled&&D!==w&&(0,Z.jsx)(k,{size:`sm`,variant:`primary`,onClick:()=>P(!0),children:n(`common.apply`)})]}),(0,Z.jsx)(T,{icon:(0,Z.jsx)(we,{className:`size-4 text-[var(--text-secondary)]`}),label:n(`clients.manageTokens`),onClick:()=>i(`/tokens`)})]}),!F&&!W&&e.providerId&&H&&(0,Z.jsx)(`div`,{id:Ot,children:(0,Z.jsxs)(M,{title:n(`clients.roleMapTitle`),footer:e.enabled?n(`clients.roleMapFooterEnabled`):n(`clients.roleMapFooter`),children:[Q.map(e=>(0,Z.jsx)(T,{label:n(`clients.role.${e}`),children:(0,Z.jsx)(B,{ariaLabel:n(`clients.role.${e}`),value:_e[e]??``,onChange:t=>ve(n=>({...n,[e]:t||void 0})),placeholder:n(`clients.modelPlaceholder`),options:[{value:``,label:n(`clients.modelUnset`)},...(g.data??[]).map(e=>({value:e,label:e}))],className:`max-w-[300px]`})},e)),e.enabled&&ye&&(0,Z.jsx)(T,{label:K?``:(0,Z.jsx)(`span`,{className:`text-[12px] text-[var(--warning)]`,children:n(`clients.roleMapRequired`)}),children:(0,Z.jsx)(k,{size:`sm`,variant:`primary`,disabled:!K,onClick:()=>P(!0),children:n(`common.apply`)})})]})}),!F&&!W&&e.providerId&&!H&&(0,Z.jsxs)(M,{title:n(`clients.modelTitle`),footer:Ee,children:[(0,Z.jsx)(T,{label:n(`clients.defaultModel`),children:(0,Z.jsx)(B,{value:_??``,onChange:e=>v(e||null),placeholder:n(`clients.modelPlaceholder`),options:[{value:``,label:n(`clients.modelUnset`)},...(g.data??[]).map(e=>({value:e,label:e}))],className:`max-w-[300px]`})}),Te.map(e=>(0,Z.jsx)(T,{label:n(`clients.modelSlot.${e}`),children:(0,Z.jsx)(B,{ariaLabel:n(`clients.modelSlot.${e}`),value:xe[e]??``,onChange:t=>Se(n=>({...n,[e]:t||void 0})),placeholder:n(`clients.modelPlaceholder`),options:[{value:``,label:n(`clients.modelUnset`)},...(g.data??[]).map(e=>({value:e,label:e}))],className:`max-w-[300px]`})},e)),e.enabled&&(U?Ce:(_??null)!==(e.selectedModel??null))&&(0,Z.jsx)(T,{label:``,children:(0,Z.jsx)(k,{size:`sm`,variant:`primary`,onClick:()=>P(!0),children:n(`common.apply`)})})]}),!F&&!W&&q.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(qe,{descriptors:q,values:Oe,onChange:je,enabled:e.enabled}),e.enabled&&Me&&(0,Z.jsx)(`div`,{className:`-mt-3 mb-5 flex justify-end`,children:(0,Z.jsx)(k,{size:`sm`,variant:`primary`,onClick:()=>P(!0),children:n(`common.apply`)})})]}),!F&&Ne.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(nt,{models:Ne,supported:Y,values:Ie,onChange:Le,enabled:e.enabled}),e.enabled&&Re&&(0,Z.jsx)(`div`,{className:`-mt-3 mb-5 flex justify-end`,children:(0,Z.jsx)(k,{size:`sm`,variant:`primary`,onClick:()=>P(!0),children:n(`common.apply`)})})]}),!F&&e.install&&(0,Z.jsx)(kt,{client:e,onShowLog:()=>le(`log`)}),U&&(0,Z.jsx)(`div`,{id:Dt,children:(0,Z.jsx)(We,{enabled:U,gatewayEnabled:e.enabled})}),!F&&!W&&(0,Z.jsxs)(M,{title:n(`clients.maintenance`),children:[V&&(0,Z.jsx)(T,{icon:R.canOpenPaths?(0,Z.jsx)(me,{className:`size-4 text-[var(--text-secondary)]`}):(0,Z.jsx)(ee,{className:`size-4 text-[var(--text-secondary)]`}),label:R.canOpenPaths?n(`clients.openConfigDir`):n(`clients.copyConfigPath`),detail:V,onClick:()=>void Ue()}),(0,Z.jsx)(T,{icon:(0,Z.jsx)(Fe,{className:`size-4 text-[var(--text-secondary)]`}),label:n(`clients.backups`),detail:n(`clients.backupsDetail`),onClick:()=>se(!0)})]}),(0,Z.jsx)(jt,{open:ae,onOpenChange:P,client:e,model:_,extras:ze,tokenId:D}),(0,Z.jsx)(Pt,{open:oe,onOpenChange:se,client:e}),(0,Z.jsx)(At,{mode:ce,onClose:()=>le(null),client:e})]})}function St(e,t){return[e.priceKey??e.templateId,t(`providers.modelCount`,{count:e.modelCount}),e.priceMultiplier===1?null:`×${e.priceMultiplier}`].filter(Boolean).join(` · `)}function Ct({client:e,providers:t,loading:n,soon:r}){let{t:i}=A(),{toast:a}=z(),o=l(),s=(0,X.useMemo)(()=>e.bindings??(e.providerId?[{providerId:e.providerId,accountId:e.accountId}]:[]),[e.bindings,e.providerId,e.accountId]),[c,u]=(0,X.useState)(s);(0,X.useEffect)(()=>u(s),[s]);let d=(0,X.useMemo)(()=>new Map(t.map(e=>[e.id,e])),[t]),f=c.flatMap(e=>{let t=d.get(e.providerId);return t?[{binding:e,provider:t}]:[]}),p=t.filter(e=>e.enabled&&!c.some(t=>t.providerId===e.id)),m=U(Se(H,{activationConstraint:{distance:4}}),Se(be,{coordinateGetter:ye})),h=r||o.isPending,g=(t,n)=>{let r=c;u(t),o.mutate({kind:e.kind,bindings:t},{onSuccess:()=>a(ft.has(e.kind)&&e.enabled?i(`clients.providersModelsSynced`,{client:J(e.kind,e.name)}):n),onError:e=>{u(r),a(L(e),`error`)}})},v=({active:e,over:t})=>{if(!t||e.id===t.id)return;let n=c.findIndex(t=>t.providerId===e.id),r=c.findIndex(e=>e.providerId===t.id);n<0||r<0||g(_e(c,n,r),i(`clients.providerOrderSaved`))},y=e=>g([...c,{providerId:e.id}],i(`clients.providerAdded`,{provider:e.name})),b=e=>g(c.filter(t=>t.providerId!==e.id),i(`clients.providerRemoved`,{provider:e.name})),x=p.map(e=>(0,Z.jsx)(T,{icon:(0,Z.jsx)(Y,{name:e.name,icon:e.icon,colorKey:e.templateId,size:24}),label:e.name,detail:St(e,i),onClick:h?void 0:()=>y(e),children:!r&&(0,Z.jsx)(De,{className:`size-4 text-[var(--text-secondary)]`,"aria-label":i(`common.add`)})},e.id));return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(M,{title:i(`clients.providerTitle`),footer:i(`clients.providerFooter`),children:[n&&(0,Z.jsx)(`div`,{className:`p-4`,children:(0,Z.jsx)(N,{lines:2})}),!n&&f.length===0&&p.length===0&&(0,Z.jsx)(_,{title:i(`clients.noProviders`),detail:i(`clients.noProvidersDetail`),action:(0,Z.jsx)(Oe,{to:`/providers?new=1`,children:(0,Z.jsx)(k,{variant:`primary`,icon:(0,Z.jsx)(De,{className:`size-3.5`}),children:i(`providers.add`)})})}),f.length>0&&(0,Z.jsx)(ve,{sensors:m,collisionDetection:G,onDragEnd:v,children:(0,Z.jsx)(xe,{items:f.map(e=>e.provider.id),strategy:he,children:f.map(({provider:e},t)=>(0,Z.jsx)(wt,{provider:e,primary:t===0,disabled:h,onRemove:f.length>1?()=>b(e):void 0},e.id))})}),!n&&f.length===0&&x]}),f.length>0&&p.length>0&&(0,Z.jsx)(M,{title:i(`clients.moreProvidersTitle`),children:x})]})}function wt({provider:e,primary:t,disabled:n,onRemove:r}){let{t:i}=A(),{attributes:a,listeners:o,setNodeRef:s,setActivatorNodeRef:c,transform:l,transition:u,isDragging:d}=W({id:e.id,disabled:n});return(0,Z.jsx)(`div`,{ref:s,style:{transform:ge.Transform.toString(l),transition:u},className:g(d&&`relative z-10 bg-[var(--surface)] shadow-lg`),children:(0,Z.jsx)(T,{icon:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`button`,{ref:c,type:`button`,"aria-label":i(`clients.dragToReorder`,{provider:e.name}),title:i(`clients.dragToReorder`,{provider:e.name}),className:`-ml-1 inline-flex cursor-grab touch-none text-[var(--text-muted)] hover:text-[var(--text-secondary)] active:cursor-grabbing disabled:cursor-default disabled:opacity-50`,...a,...o,children:(0,Z.jsx)(K,{className:`size-4`})}),(0,Z.jsx)(Y,{name:e.name,icon:e.icon,colorKey:e.templateId,size:24})]}),label:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`truncate`,children:e.name}),t&&(0,Z.jsx)(E,{tone:`accent`,children:i(`clients.primaryProvider`)}),!e.enabled&&(0,Z.jsx)(E,{tone:`orange`,children:i(`clients.providerDisabledBadge`)})]}),detail:St(e,i),children:r&&(0,Z.jsx)(k,{size:`sm`,variant:`plain`,icon:(0,Z.jsx)(w,{className:`size-3.5`}),"aria-label":i(`clients.removeProvider`,{provider:e.name}),title:i(`clients.removeProvider`,{provider:e.name}),disabled:n,onClick:r})})})}function Tt({client:e,onOpen:t}){let{t:n}=A(),r=e.install;if(!r)return null;let i=r.needsAdmin?(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[11px] text-[var(--warning)]`,children:[(0,Z.jsx)(ze,{className:`size-3`,"aria-hidden":!0}),n(`clients.admin.badge`)]}):null,a=r.needsAdmin?n(r.adminAvailable?`clients.admin.tip`:`clients.admin.tipManual`):void 0;return r.busy?(0,Z.jsx)(k,{icon:(0,Z.jsx)(yt,{}),onClick:()=>t(`log`),children:n(`clients.installRunning`)}):r.updateAvailable&&r.updateCommand&&r.latestVersion?(0,Z.jsxs)(k,{icon:(0,Z.jsx)(Le,{className:`size-3.5`}),title:a,onClick:()=>t(`update`),children:[n(`clients.updateTo`,{version:r.latestVersion}),i]}):r.updateAvailable&&r.blocker===`shadowed`?(0,Z.jsx)(k,{icon:(0,Z.jsx)(ze,{className:`size-3.5`}),onClick:()=>document.getElementById(Et)?.scrollIntoView({behavior:`smooth`,block:`center`}),children:n(`clients.shadowedBadge`)}):!r.installed&&r.installCommand?(0,Z.jsxs)(k,{icon:(0,Z.jsx)(fe,{className:`size-3.5`}),title:a,onClick:()=>t(`install`),children:[n(`clients.install`),i]}):!r.installed&&r.method===`manual`?(0,Z.jsx)(k,{icon:(0,Z.jsx)(pe,{className:`size-3.5`}),onClick:()=>window.open(r.homepageUrl,`_blank`,`noreferrer`),children:n(`clients.download`)}):null}var Et=`client-shadowed-alert`,Dt=`claude-direct-panel`,Ot=`client-role-map`;function kt({client:e,onShowLog:t}){let{t:n,locale:r}=A(),o=e.install,s=i(e.kind),c=(e,t=!1)=>(0,Z.jsx)(`span`,{className:g(`text-[13px] tabular-nums selectable`,t&&`text-[var(--text-secondary)]`),children:e}),l=o.blocker===`external-install`?n(`clients.blocker.external-install`,{path:o.executable??``}):o.blocker?n(`clients.blocker.${o.blocker}`):void 0,u=o.otherCopies??[],d=u.find(e=>e.newer);return(0,Z.jsxs)(Z.Fragment,{children:[d&&(0,Z.jsx)(`div`,{id:Et,className:`mb-3`,children:(0,Z.jsx)(j,{tone:`warning`,title:n(`clients.shadowed.title`,{version:d.version}),children:n(`clients.shadowed.detail`,{path:o.executable??``,version:o.version??``,other:d.path,dir:ue(d.path)})})}),!d&&o.notOnPath&&o.executable&&(0,Z.jsx)(`div`,{className:`mb-3`,children:(0,Z.jsx)(j,{tone:`warning`,title:n(`clients.notOnPath.title`),children:n(`clients.notOnPath.detail`,{dir:ue(o.executable)})})}),(0,Z.jsxs)(M,{title:n(`clients.versionTitle`),footer:l,children:[(0,Z.jsx)(T,{label:n(`clients.currentVersion`),detail:o.installed?o.executable:void 0,children:o.installed?c(o.version??n(`clients.versionUnknown`),!o.version):c(n(`clients.notInstalled`),!0)}),u.map(e=>(0,Z.jsxs)(T,{label:n(`clients.otherCopy`),detail:e.path,children:[e.newer&&(0,Z.jsx)(E,{tone:`orange`,children:n(`clients.otherCopyNewer`)}),c(e.version,!e.newer)]},e.path)),(o.method===`npm`||o.method===`script`)&&(0,Z.jsxs)(T,{label:n(`clients.latestVersion`),detail:o.latestError??(o.latestCheckedAt?n(`clients.checkedAt`,{time:a(o.latestCheckedAt,r)}):void 0),children:[o.updateAvailable&&(0,Z.jsx)(E,{tone:`orange`,children:n(`clients.updateBadge`)}),c(o.latestVersion??n(`clients.latestUnknown`),!o.latestVersion)]}),(0,Z.jsx)(T,{label:n(`clients.installMethod`),detail:n(`clients.method.${o.method}`,{package:o.package??``}),children:(0,Z.jsx)(k,{size:`sm`,variant:`plain`,icon:(0,Z.jsx)(pe,{className:`size-3`}),onClick:()=>window.open(o.homepageUrl,`_blank`,`noreferrer`),children:n(`clients.homepage`)})}),s.data&&(0,Z.jsx)(T,{icon:(0,Z.jsx)(Te,{className:`size-4 text-[var(--text-secondary)]`}),label:n(`clients.installLog`),detail:`${s.data.command} · ${n(`clients.job.${s.data.state}`)}`,onClick:t})]})]})}function At({mode:t,onClose:n,client:r}){let{t:a}=A(),{toast:o}=z(),s=P(),l=t!==null,u=i(r.kind,l||!!r.install?.busy),d=c(),f=e(),[p,m]=(0,X.useState)(!1),h=(0,X.useRef)(null),v=(0,X.useRef)(void 0),y=J(r.kind,r.name),b=r.install,x=t===`install`||t===`update`?t:null,S=x===`install`?b?.installCommand:x===`update`?b?.updateCommand:null,C=u.data,w=x!==null&&!p&&C?.state!==`running`,T=!!b?.needsAdmin,E=!!b?.adminAvailable,D=C?.state===`failed`&&C.hint===`permission-denied`&&!C.elevated&&E;(0,X.useEffect)(()=>{l&&m(!1)},[l,t]),(0,X.useEffect)(()=>{let e=C?.state;v.current===`running`&&e&&e!==`running`&&(s.invalidateQueries({queryKey:se.clients}),e===`succeeded`&&C.hint?o(a(`clients.notEffectiveToast`,{name:y})):e===`succeeded`&&o(a(C.action===`install`?`clients.installedToast`:`clients.updatedToast`,{name:y}),`success`)),v.current=e},[C?.state,C?.action,C?.hint,y,s,a,o]),(0,X.useEffect)(()=>{let e=h.current;e&&(e.scrollTop=e.scrollHeight)},[C?.log.length]);let te=(e,t)=>d.mutate({kind:r.kind,action:e,elevated:t},{onSuccess:()=>m(!0),onError:e=>o(L(e),`error`)}),O=async e=>{await R.copy(e)&&o(a(`common.copied`))},ne=a((x??C?.action)===`update`?`clients.updateTitle`:`clients.installTitle`,{name:y}),re={running:`info`,succeeded:`success`,failed:`danger`,cancelled:`warning`},M=`rounded-[var(--radius-control)] border border-[var(--border)] bg-[var(--surface-muted)] px-3 py-2 font-mono text-[12px] break-all whitespace-pre-wrap selectable`,ie=b?.adminFixCommand?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`p`,{className:`text-[11px] text-[var(--text-secondary)]`,children:a(`clients.admin.fixTip`)}),(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Z.jsx)(`pre`,{className:g(M,`min-w-0 flex-1`),children:b.adminFixCommand}),(0,Z.jsx)(k,{size:`sm`,icon:(0,Z.jsx)(ee,{className:`size-3`}),"aria-label":a(`common.copy`),onClick:()=>void O(b.adminFixCommand)})]})]}):null;return(0,Z.jsx)(de,{open:l,onOpenChange:e=>!e&&n(),width:620,title:ne,description:w?a(`clients.installRunDetail`):void 0,footer:w?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(k,{onClick:n,children:a(`common.cancel`)}),T&&!E?(0,Z.jsx)(k,{variant:`primary`,icon:(0,Z.jsx)(ee,{className:`size-3.5`}),disabled:!S,onClick:()=>void O(`sudo ${S}`),children:a(`clients.admin.copyCommand`)}):(0,Z.jsx)(k,{variant:`primary`,icon:T?(0,Z.jsx)(ze,{className:`size-3.5`}):void 0,disabled:!S,loading:d.isPending,onClick:()=>x&&te(x,T),children:a(T?`clients.admin.start`:`clients.installStart`)})]}):C?.state===`running`?(0,Z.jsxs)(Z.Fragment,{children:[!C.elevated&&(0,Z.jsx)(k,{variant:`destructive`,loading:f.isPending,onClick:()=>f.mutate(r.kind,{onError:e=>o(L(e),`error`)}),children:a(`clients.installStop`)}),(0,Z.jsx)(k,{onClick:n,children:a(`common.close`)})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(k,{onClick:n,children:a(`common.done`)}),D&&(0,Z.jsx)(k,{variant:`primary`,icon:(0,Z.jsx)(ze,{className:`size-3.5`}),loading:d.isPending,onClick:()=>te(C.action,!0),children:a(`clients.admin.retry`)})]}),children:w?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[T&&(0,Z.jsx)(j,{tone:`warning`,title:a(`clients.admin.title`),children:a(E?`clients.admin.prompt`:`clients.admin.manual`)}),S?(0,Z.jsx)(`pre`,{className:M,children:T?`sudo ${S}`:S}):(0,Z.jsx)(j,{tone:`warning`,title:a(`clients.installUnavailable`)}),b?.method===`npm`&&(0,Z.jsx)(`p`,{className:`text-[11px] text-[var(--text-muted)]`,children:a(`clients.installNpmNote`)}),T&&ie]}):C?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(j,{tone:C.state===`succeeded`&&C.hint?`warning`:re[C.state],title:a(C.state===`succeeded`&&C.hint?`clients.job.notEffective`:`clients.job.${C.state}`),children:C.state===`running`&&C.elevated?a(`clients.admin.running`):C.hint?a(`clients.hint.${C.hint}`)+(D?a(`clients.admin.retryHint`):``):void 0}),(0,Z.jsx)(`pre`,{ref:h,className:`scroll max-h-[340px] min-h-[160px] rounded-[var(--radius-control)] border border-[var(--border)] bg-[var(--surface-muted)] px-3 py-2 font-mono text-[11px] leading-relaxed break-all whitespace-pre-wrap selectable`,children:C.log.join(`
|
|
7
|
-
`)}),C.hint===`permission-denied`&&ie]}):u.isLoading?(0,Z.jsx)(N,{lines:4}):(0,Z.jsx)(_,{icon:(0,Z.jsx)(Te,{className:`size-6`}),title:a(`clients.noInstallLog`)})})}function jt({open:e,onOpenChange:t,client:n,model:r,extras:i,tokenId:a}){let{t:o}=A(),{toast:s}=z(),c=D(),l=b(),u=J(n.kind,n.name),d=i?{providerId:n.providerId,model:r,extras:i,tokenId:a}:{providerId:n.providerId,model:r,tokenId:a};return(0,X.useEffect)(()=>{e&&c.mutate({kind:n.kind,req:d})},[e]),(0,Z.jsxs)(de,{open:e,onOpenChange:t,width:620,title:o(`clients.enableTitle`,{name:u}),description:o(`clients.enableDetail`),footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(k,{onClick:()=>t(!1),children:o(`common.cancel`)}),(0,Z.jsx)(k,{variant:`primary`,disabled:!c.data,loading:l.isPending,onClick:()=>l.mutate({kind:n.kind,req:d},{onSuccess:e=>{t(!1),s(e.requiresRestart?o(`clients.enabledRestart`,{name:u}):o(`clients.enabledToast`,{name:u}),`success`)},onError:e=>s(L(e),`error`)}),children:n.enabled?o(`common.apply`):o(`clients.enable`)})]}),children:[c.isPending&&(0,Z.jsx)(N,{lines:4}),c.isError&&(0,Z.jsx)(j,{tone:`danger`,title:o(`common.error`),children:L(c.error)}),c.data&&(0,Z.jsx)(Mt,{preview:c.data})]})}function Mt({preview:e}){let{t}=A();return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[e.warnings.map((e,t)=>(0,Z.jsx)(j,{tone:`warning`,title:e},t)),e.changes.length===0&&(0,Z.jsx)(j,{tone:`info`,title:t(`clients.noChanges`)}),e.diffs.map(e=>(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`mb-2 font-mono text-[11px] text-[var(--text-secondary)]`,children:e.file}),(0,Z.jsx)(Nt,{diff:e.unifiedDiff})]},e.file))]})}function Nt({diff:e}){return(0,Z.jsx)(`pre`,{className:`scroll max-h-[300px] rounded-[var(--radius-control)] border border-[var(--border)] bg-[var(--surface-muted)] py-2 font-mono text-[11px] leading-relaxed selectable`,children:e.split(`
|
|
8
|
-
`).map((e,t)=>(0,Z.jsx)(`div`,{className:g(`px-3 whitespace-pre-wrap break-all`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-[color-mix(in_oklab,var(--success)_12%,transparent)] text-[var(--success)]`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-[color-mix(in_oklab,var(--danger)_10%,transparent)] text-[var(--danger)]`,e.startsWith(`@@`)&&`text-[var(--text-muted)]`),children:e||` `},t))})}function Pt({open:e,onOpenChange:t,client:n}){let{t:r,locale:i}=A(),{toast:o,confirm:s}=z(),c=I(n.kind,e),l=ce();return(0,Z.jsxs)(de,{open:e,onOpenChange:t,width:520,title:r(`clients.backups`),description:r(`clients.backupsDetail`),footer:(0,Z.jsx)(k,{onClick:()=>t(!1),children:r(`common.done`)}),children:[c.isLoading&&(0,Z.jsx)(N,{lines:3}),c.isError&&(0,Z.jsx)(j,{tone:`danger`,title:r(`common.error`),children:L(c.error)}),c.data?.length===0&&(0,Z.jsx)(_,{icon:(0,Z.jsx)(Fe,{className:`size-6`}),title:r(`clients.noBackups`)}),(0,Z.jsx)(`div`,{className:`card divide-y divide-[var(--border)]`,children:c.data?.map(e=>(0,Z.jsx)(T,{label:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[a(e.createdAt,i),e.firstWrite&&(0,Z.jsx)(E,{tone:`accent`,children:r(`clients.firstWrite`)})]}),detail:e.files.join(`, `),children:(0,Z.jsx)(k,{size:`sm`,icon:(0,Z.jsx)(Ce,{className:`size-3`}),loading:l.isPending&&l.variables?.id===e.id,onClick:async()=>{await s({title:r(`clients.restoreConfirm`),detail:e.files.join(`
|
|
9
|
-
`),destructive:!0,confirmLabel:r(`clients.restore`)})&&l.mutate({kind:n.kind,id:e.id},{onSuccess:()=>o(r(`clients.restored`),`success`),onError:e=>o(L(e),`error`)})},children:r(`clients.restore`)})},e.id))})]})}export{dt as ClientsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ct as e,Ea as t,G as n,H as r,J as i,Q as a,St as o,Ta as s,Y as c,_ as l,bt as u,ka as d,n as f,q as p,r as m,st as h,t as g,xt as _}from"./alert-BhYHbQ5M.js";import{A as v,_ as y,k as b}from"./index-XVK9epgF.js";var x=d(t(),1),S=s(),C=`astra.keyLookup`;function w(){try{return sessionStorage.getItem(C)??``}catch{return``}}function T(e){try{e?sessionStorage.setItem(C,e):sessionStorage.removeItem(C)}catch{}}function E(){let{t:e}=h(),[t,n]=(0,x.useState)(``),[r,i]=(0,x.useState)(null),[a,o]=(0,x.useState)(``),[s,c]=(0,x.useState)(null),[l,d]=(0,x.useState)(!1),f=(0,x.useCallback)(async t=>{let n=t.trim();if(n){d(!0),c(null);try{i(await _(n)),o(n),T(n)}catch(t){i(null),T(null),c(t instanceof u&&t.status===401?e(`key.invalid`):e(`key.error`,{error:t.message}))}finally{d(!1)}}},[e]);return(0,x.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get(`key`);e&&window.history.replaceState(null,``,window.location.pathname);let t=e??w();t&&(n(t),f(t))},[]),(0,S.jsx)(`div`,{className:`wallpaper flex min-h-full justify-center overflow-y-auto p-4 sm:items-start sm:py-12`,children:(0,S.jsxs)(`div`,{className:`flex w-full max-w-[720px] flex-col gap-4`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,S.jsx)(v,{className:`size-10 rounded-[12px]`}),(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`h1`,{className:`text-[17px] font-medium`,children:e(`key.title`)}),(0,S.jsx)(`p`,{className:`text-[13px] text-[var(--text-secondary)]`,children:e(`key.subtitle`)})]})]}),!r&&(0,S.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),f(t)},className:`card flex flex-col gap-4 p-5`,children:[(0,S.jsx)(b,{label:e(`key.title`),placeholder:e(`key.placeholder`),autoFocus:!0,autoComplete:`off`,value:t,"aria-invalid":s?!0:void 0,onChange:e=>n(e.target.value)}),s&&(0,S.jsx)(g,{tone:`danger`,title:s}),(0,S.jsx)(m,{type:`submit`,variant:`primary`,loading:l,disabled:!t.trim(),children:e(`key.submit`)})]}),r&&(0,S.jsx)(D,{info:r,apiKey:a,onForget:()=>{T(null),i(null),n(``)}})]})})}function D({info:e,apiKey:t,onForget:n}){let{t:i,locale:o}=h(),[s,u]=(0,x.useState)(`overview`),d=e.allowedClients==null?i(`key.clientsAny`):e.allowedClients.length===0?i(`key.directOnly`):e.allowedClients.map(e=>y[e]?.name??e).join(`, `),p=[[i(`key.today`),e.usage.today],[i(`key.week`),e.usage.week],[i(`key.month`),e.usage.month],[i(`key.total`),e.usage.total]],g=Math.max(...e.daily.map(e=>e.costUsd),0);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`section`,{className:`card flex flex-col gap-3 p-5`,children:[(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(`h2`,{className:`text-[15px] font-medium`,children:e.name}),(0,S.jsx)(`code`,{className:`font-mono text-[12px] text-[var(--text-secondary)]`,children:e.keyPrefix}),!e.enabled&&(0,S.jsx)(f,{tone:`orange`,children:i(`key.disabled`)}),(0,S.jsx)(m,{size:`sm`,variant:`plain`,className:`ml-auto`,onClick:n,children:i(`key.forget`)})]}),(0,S.jsxs)(`div`,{className:`text-[12px] text-[var(--text-secondary)]`,children:[i(`key.clients`),`: `,d,` · `,i(`key.timeZone`,{zone:e.timeZone})]}),(0,S.jsx)(l,{ariaLabel:i(`key.title`),value:s,onChange:u,items:[{value:`overview`,label:i(`key.tab.overview`)},{value:`stats`,label:i(`key.tab.stats`)},{value:`requests`,label:i(`key.tab.requests`)}]})]}),s===`stats`&&(0,S.jsx)(k,{apiKey:t}),s===`requests`&&(0,S.jsx)(M,{apiKey:t}),s===`overview`&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`section`,{className:`card flex flex-col gap-3 p-5`,children:[(0,S.jsx)(`h3`,{className:`text-[13px] font-medium`,children:i(`key.limits`)}),e.limits.length===0&&e.rpm==null&&(0,S.jsx)(`p`,{className:`text-[12px] text-[var(--text-muted)]`,children:i(`key.unlimited`)}),(0,S.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:e.limits.map(e=>{let t=t=>e.metric===`cost`?a(t):c(t,!0),n=Math.max(0,Math.min(100,Math.round(e.usedPercent))),s=n>=90?`var(--danger)`:n>=70?`var(--warning)`:`var(--accent)`,l=`${i(`tokens.period.${e.period}`)} · ${i(`tokens.metric.${e.metric}`)}`;return(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{className:`mb-1 flex items-baseline justify-between gap-2 text-[12px]`,children:[(0,S.jsx)(`span`,{className:`text-[var(--text-secondary)]`,children:l}),(0,S.jsxs)(`span`,{className:`num`,children:[t(e.used),` / `,t(e.limit)]})]}),(0,S.jsx)(`div`,{role:`progressbar`,"aria-label":l,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,className:`h-1.5 w-full overflow-hidden rounded-full bg-[var(--surface-muted)]`,children:(0,S.jsx)(`div`,{className:`h-full rounded-full`,style:{width:`${n}%`,background:s}})}),(0,S.jsxs)(`div`,{className:`mt-1 text-[11px] text-[var(--text-muted)]`,children:[e.exhausted?i(`key.exhausted`):``,e.exhausted&&e.resetsAt?` · `:``,e.resetsAt?i(`key.resets`,{time:r(e.resetsAt,o)}):``]})]},`${e.metric}:${e.period}`)})}),e.rpm&&(0,S.jsx)(`p`,{className:`num text-[12px] text-[var(--text-secondary)]`,children:i(`key.rpm`,{used:e.rpm.used,limit:e.rpm.limit})})]}),(0,S.jsxs)(`section`,{className:`card flex flex-col gap-3 p-5`,children:[(0,S.jsx)(`h3`,{className:`text-[13px] font-medium`,children:i(`key.usage`)}),(0,S.jsx)(`div`,{className:`overflow-x-auto`,children:(0,S.jsxs)(`table`,{className:`w-full text-[12px]`,children:[(0,S.jsx)(`thead`,{children:(0,S.jsxs)(`tr`,{className:`text-[var(--text-muted)]`,children:[(0,S.jsx)(`th`,{className:`py-1 text-left font-normal`}),(0,S.jsx)(`th`,{className:`py-1 text-right font-normal`,children:i(`key.cost`)}),(0,S.jsx)(`th`,{className:`py-1 text-right font-normal`,children:i(`key.requests`)}),(0,S.jsx)(`th`,{className:`py-1 text-right font-normal`,children:i(`key.tokens`)})]})}),(0,S.jsx)(`tbody`,{children:p.map(([e,t])=>(0,S.jsxs)(`tr`,{children:[(0,S.jsx)(`th`,{scope:`row`,className:`py-1 text-left font-medium text-[var(--text-secondary)]`,children:e}),(0,S.jsx)(`td`,{className:`num py-1 text-right font-semibold`,children:a(t.costUsd)}),(0,S.jsx)(`td`,{className:`num py-1 text-right`,children:c(t.requests)}),(0,S.jsx)(`td`,{className:`num py-1 text-right`,children:c(t.inputTokens+t.outputTokens,!0)})]},e))})]})}),(0,S.jsx)(`h4`,{className:`mt-2 text-[12px] text-[var(--text-muted)]`,children:i(`key.daily`)}),(0,S.jsx)(`div`,{className:`flex h-24 items-end gap-[2px]`,role:`list`,"aria-label":i(`key.daily`),children:e.daily.map(e=>(0,S.jsx)(`div`,{role:`listitem`,title:`${e.day} · ${a(e.costUsd)} · ${c(e.requests)} ${i(`key.requests`)}`,className:`flex-1 rounded-t-[2px] bg-[var(--accent)]`,style:{height:`${g>0?Math.max(2,e.costUsd/g*100):2}%`,opacity:e.costUsd>0?1:.25}},e.day))})]})]})]})}var O=[`today`,`7d`,`30d`,`90d`];function k({apiKey:t}){let{t:r}=h(),[i,o]=(0,x.useState)(`7d`),[s,u]=(0,x.useState)(null),[d,m]=(0,x.useState)(null);(0,x.useEffect)(()=>{let n=!0;return m(null),e(t,i).then(e=>n&&u(e),e=>n&&m(r(`key.error`,{error:e.message}))),()=>{n=!1}},[t,i,r]);let _=s?.summary,v=Math.max(...(s?.series??[]).map(e=>e.requests),0);return(0,S.jsxs)(`section`,{className:`card flex flex-col gap-4 p-5`,children:[(0,S.jsx)(l,{ariaLabel:r(`overview.range`),value:i,onChange:o,items:O.map(e=>({value:e,label:r(`range.${e}`)}))}),d&&(0,S.jsx)(g,{tone:`danger`,title:d}),!s||!_?!d&&(0,S.jsx)(`p`,{className:`text-[12px] text-[var(--text-muted)]`,children:`…`}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[(0,S.jsx)(A,{label:r(`key.stats.requests`),value:c(_.requests)}),(0,S.jsx)(A,{label:r(`key.stats.successRate`),value:_.requests?p(_.successRate):`—`}),(0,S.jsx)(A,{label:r(`key.cost`),value:a(_.costUsd)}),(0,S.jsx)(A,{label:r(`key.stats.avgTtft`),value:n(_.avgTtftMs)})]}),(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`h4`,{className:`mb-2 text-[12px] text-[var(--text-muted)]`,children:r(`key.stats.trend`)}),(0,S.jsx)(`div`,{className:`flex h-20 items-end gap-[2px]`,role:`list`,"aria-label":r(`key.stats.trend`),children:s.series.map(e=>(0,S.jsx)(`div`,{role:`listitem`,title:`${e.bucket} · ${c(e.requests)} ${r(`key.requests`)} · ${a(e.costUsd)}`,className:`flex-1 rounded-t-[2px] bg-[var(--accent)]`,style:{height:`${v>0?Math.max(2,e.requests/v*100):2}%`}},e.bucket))})]}),(0,S.jsx)(j,{title:r(`key.stats.byModel`),rows:s.models.map(e=>({name:e.model??`—`,...e}))}),(0,S.jsx)(j,{title:r(`key.stats.byClient`),rows:s.clients.map(e=>({name:e.client?y[e.client]?.name??e.client:r(`key.stats.direct`),...e}))}),(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`h4`,{className:`mb-2 text-[12px] text-[var(--text-muted)]`,children:r(`key.stats.errors`)}),s.errors.length===0?(0,S.jsx)(`p`,{className:`text-[12px] text-[var(--text-secondary)]`,children:r(`key.stats.noErrors`)}):(0,S.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:s.errors.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsxs)(f,{tone:`orange`,children:[r(`key.category.${e.category}`),` · `,c(e.count)]})},e.category))})]}),s.retentionDays!=null&&(0,S.jsx)(`p`,{className:`text-[11px] text-[var(--text-muted)]`,children:r(`key.stats.retention`,{days:s.retentionDays})})]})]})}function A({label:e,value:t}){return(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`div`,{className:`truncate text-[11px] text-[var(--text-muted)]`,children:e}),(0,S.jsx)(`div`,{className:`num truncate text-[17px] font-semibold`,children:t})]})}function j({title:e,rows:t}){let{t:n}=h();return t.length===0?null:(0,S.jsx)(`div`,{className:`overflow-x-auto`,children:(0,S.jsxs)(`table`,{className:`w-full text-[12px]`,children:[(0,S.jsx)(`caption`,{className:`mb-1 text-left text-[12px] text-[var(--text-muted)]`,children:e}),(0,S.jsx)(`thead`,{children:(0,S.jsxs)(`tr`,{className:`text-[var(--text-muted)]`,children:[(0,S.jsx)(`th`,{className:`py-1 text-left font-normal`}),(0,S.jsx)(`th`,{className:`py-1 text-right font-normal`,children:n(`key.requests`)}),(0,S.jsx)(`th`,{className:`py-1 text-right font-normal`,children:n(`key.stats.successRate`)}),(0,S.jsx)(`th`,{className:`py-1 text-right font-normal`,children:n(`key.tokens`)}),(0,S.jsx)(`th`,{className:`py-1 text-right font-normal`,children:n(`key.cost`)})]})}),(0,S.jsx)(`tbody`,{children:t.map(e=>(0,S.jsxs)(`tr`,{children:[(0,S.jsx)(`th`,{scope:`row`,className:`max-w-[240px] truncate py-1 text-left font-medium text-[var(--text-secondary)]`,children:e.name}),(0,S.jsx)(`td`,{className:`num py-1 text-right`,children:c(e.requests)}),(0,S.jsx)(`td`,{className:`num py-1 text-right`,children:e.requests?p(e.successRequests/e.requests):`—`}),(0,S.jsx)(`td`,{className:`num py-1 text-right`,children:c(e.inputTokens+e.outputTokens,!0)}),(0,S.jsx)(`td`,{className:`num py-1 text-right font-semibold`,children:a(e.costUsd)})]},e.name))})]})})}function M({apiKey:e}){let{t,locale:s}=h(),[u,d]=(0,x.useState)(`all`),[p,_]=(0,x.useState)([]),[v,b]=(0,x.useState)(null),[C,w]=(0,x.useState)(!1),[T,E]=(0,x.useState)(null),D=(0,x.useCallback)(async n=>{w(!0),E(null);try{let t=await o(e,{before:n,status:u===`failed`?N:void 0});_(e=>n?[...e,...t.items]:t.items),b(t.nextBefore??null)}catch(e){E(t(`key.error`,{error:e.message}))}finally{w(!1)}},[e,u,t]);return(0,x.useEffect)(()=>{D(null)},[D]),(0,S.jsxs)(`section`,{className:`card flex flex-col gap-3 p-5`,children:[(0,S.jsx)(l,{ariaLabel:t(`key.requests.status`),value:u,onChange:d,items:[{value:`all`,label:t(`key.requests.all`)},{value:`failed`,label:t(`key.requests.failed`)}]}),T&&(0,S.jsx)(g,{tone:`danger`,title:T}),p.length===0&&!C&&!T&&(0,S.jsx)(`p`,{className:`text-[12px] text-[var(--text-muted)]`,children:t(`key.requests.empty`)}),p.length>0&&(0,S.jsx)(`div`,{className:`overflow-x-auto`,children:(0,S.jsxs)(`table`,{className:`w-full text-[12px]`,children:[(0,S.jsx)(`thead`,{children:(0,S.jsxs)(`tr`,{className:`text-[var(--text-muted)]`,children:[(0,S.jsx)(`th`,{className:`py-1 text-left font-normal`,children:t(`key.requests.time`)}),(0,S.jsx)(`th`,{className:`py-1 text-left font-normal`,children:t(`key.requests.model`)}),(0,S.jsx)(`th`,{className:`py-1 text-left font-normal`,children:t(`key.requests.client`)}),(0,S.jsx)(`th`,{className:`py-1 text-left font-normal`,children:t(`key.requests.status`)}),(0,S.jsx)(`th`,{className:`py-1 text-right font-normal`,children:t(`key.requests.tokens`)}),(0,S.jsx)(`th`,{className:`py-1 text-right font-normal`,children:t(`key.cost`)}),(0,S.jsx)(`th`,{className:`py-1 text-right font-normal`,children:t(`key.requests.latency`)})]})}),(0,S.jsx)(`tbody`,{children:p.map(e=>(0,S.jsxs)(`tr`,{className:`border-t border-[var(--border-subtle)]`,children:[(0,S.jsx)(`td`,{className:`py-1.5 whitespace-nowrap text-[var(--text-secondary)]`,title:r(e.time,s),children:i(e.time,s)}),(0,S.jsx)(`td`,{className:`max-w-[200px] truncate py-1.5 font-mono`,title:e.model??``,children:e.model??`—`}),(0,S.jsx)(`td`,{className:`py-1.5 text-[var(--text-secondary)]`,children:e.client?y[e.client]?.name??e.client:t(`key.stats.direct`)}),(0,S.jsx)(`td`,{className:`py-1.5`,children:e.errorCategory?(0,S.jsx)(f,{tone:`orange`,title:e.httpStatus?`HTTP ${e.httpStatus}`:void 0,children:t(`key.category.${e.errorCategory}`)}):(0,S.jsx)(f,{tone:`green`,children:t(`key.requests.success`)})}),(0,S.jsxs)(`td`,{className:`num py-1.5 text-right`,children:[c(e.inputTokens,!0),` / `,c(e.outputTokens,!0)]}),(0,S.jsx)(`td`,{className:`num py-1.5 text-right font-semibold`,children:a(e.costUsd)}),(0,S.jsxs)(`td`,{className:`num py-1.5 text-right text-[var(--text-secondary)]`,children:[n(e.ttftMs),` / `,n(e.totalMs)]})]},e.id))})]})}),v&&(0,S.jsx)(`div`,{children:(0,S.jsx)(m,{size:`sm`,loading:C,onClick:()=>void D(v),children:t(`key.requests.more`)})})]})}var N=`upstream_error,gateway_error,client_cancelled,blocked`;export{E as KeyPage};
|