@aidotnet/server-linux-x64 0.9.6 → 0.9.8

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.
Files changed (40) hide show
  1. package/bin/astra-server +2 -2
  2. package/bin/wwwroot/assets/{ClientsPage-DEetiYfc.js → ClientsPage-CMvzWWAq.js} +2 -2
  3. package/bin/wwwroot/assets/{KeyPage-cq7HprCR.js → KeyPage-C8QfP545.js} +1 -1
  4. package/bin/wwwroot/assets/{ModelDetailPage-Uj6p-r8V.js → ModelDetailPage-Dj3Fuga6.js} +1 -1
  5. package/bin/wwwroot/assets/{ModelsPage-B-l5oEGF.js → ModelsPage-DIYCYGb2.js} +1 -1
  6. package/bin/wwwroot/assets/{PluginsPage-BH9KjyfC.js → PluginsPage-B2nac94b.js} +1 -1
  7. package/bin/wwwroot/assets/{PrivacyPage-C5XhVKZd.js → PrivacyPage-CeRqlQGU.js} +1 -1
  8. package/bin/wwwroot/assets/{ProviderDetailPage-uLPHWm2i.js → ProviderDetailPage-DWy8CIbx.js} +1 -1
  9. package/bin/wwwroot/assets/{ProvidersPage-CNU_ji4e.js → ProvidersPage-CeisTEUC.js} +1 -1
  10. package/bin/wwwroot/assets/{SettingsPage-B3tbYdLW.js → SettingsPage-Bcv3aAmF.js} +2 -2
  11. package/bin/wwwroot/assets/{TokenDetailPage-BVyb_-ev.js → TokenDetailPage-B9WJQ1HP.js} +1 -1
  12. package/bin/wwwroot/assets/{TokenPoolEditor-7LX143SO.js → TokenPoolEditor-D8mQHyNt.js} +1 -1
  13. package/bin/wwwroot/assets/TokensPage-Cx1hPs0r.js +1 -0
  14. package/bin/wwwroot/assets/{TracesPage-C9mYB_7E.js → TracesPage-Ckw0m9u0.js} +1 -1
  15. package/bin/wwwroot/assets/{TrayPanelPage-NIkRrLCt.js → TrayPanelPage-BfD_xXkg.js} +1 -1
  16. package/bin/wwwroot/assets/{TrayPanelView-BpQQa0qi.js → TrayPanelView-daUwEIRH.js} +1 -1
  17. package/bin/wwwroot/assets/{alert-CN1yWco4.js → alert-BzjF81CS.js} +3 -3
  18. package/bin/wwwroot/assets/{arrow-down-DP0xP3tk.js → arrow-down-BjT6LDhw.js} +1 -1
  19. package/bin/wwwroot/assets/{arrow-left-UUQiUGQ1.js → arrow-left-Bv8IR_At.js} +1 -1
  20. package/bin/wwwroot/assets/{checkbox-BEWRhO5r.js → checkbox-DQpzihMp.js} +1 -1
  21. package/bin/wwwroot/assets/{cloud-download-DebyBXx2.js → cloud-download-B7vzhwxM.js} +1 -1
  22. package/bin/wwwroot/assets/{confirm-morph-DwiVsert.js → confirm-morph-BOdW6fKN.js} +1 -1
  23. package/bin/wwwroot/assets/{download-C4--ZCHf.js → download-CI3oqkmw.js} +1 -1
  24. package/bin/wwwroot/assets/{ellipsis-D250KISp.js → ellipsis-Br3iFNj9.js} +1 -1
  25. package/bin/wwwroot/assets/{external-link-Bnshhxip.js → external-link-LUcufY2s.js} +1 -1
  26. package/bin/wwwroot/assets/{folder-open-BzVuhS53.js → folder-open-rO9o554n.js} +1 -1
  27. package/bin/wwwroot/assets/{index-CBrXkG99.js → index-D7HIE1TG.js} +3 -3
  28. package/bin/wwwroot/assets/{log-out-DEZofPIg.js → log-out-Ggrqw-Tp.js} +1 -1
  29. package/bin/wwwroot/assets/minus-2zK3DUtq.js +1 -0
  30. package/bin/wwwroot/assets/overlays-8ByMRpma.js +41 -0
  31. package/bin/wwwroot/assets/{pencil-DuD1bQje.js → pencil-o6T1_skE.js} +1 -1
  32. package/bin/wwwroot/assets/{power-LE8gLJKc.js → power-BJvJ4uzr.js} +1 -1
  33. package/bin/wwwroot/assets/{radio-cards-D1yOuSfh.js → radio-cards-CWiI0xhT.js} +1 -1
  34. package/bin/wwwroot/assets/{rotate-ccw-Cx9vNOkF.js → rotate-ccw-CqwU1cME.js} +1 -1
  35. package/bin/wwwroot/assets/{sortable.esm-B0eMzUNN.js → sortable.esm-BhxNcP2n.js} +1 -1
  36. package/bin/wwwroot/index.html +3 -3
  37. package/package.json +1 -1
  38. package/bin/wwwroot/assets/TokensPage-vRrXvqkK.js +0 -1
  39. package/bin/wwwroot/assets/minus-BAoIEc33.js +0 -1
  40. package/bin/wwwroot/assets/overlays-D2pWmtov.js +0 -41
@@ -1 +1 @@
1
- import{vt as e}from"./alert-CN1yWco4.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};
1
+ import{vt as e}from"./alert-BzjF81CS.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{vt as e}from"./alert-BzjF81CS.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{$i as e,A as t,Ai as n,C as r,Ca as i,Ct as a,D as o,E as s,Ea as c,F as l,Fi as u,I as d,J as f,Ji as p,Ki as m,M as h,Mi as g,N as _,O as v,Oi as y,P as b,Pi as x,Qi as S,R as C,S as w,Sa as T,Si as E,Xi as D,Yi as O,Z as k,Zi as A,_i as j,_t as M,ca as N,ct as ee,ea as P,ga as F,gt as I,hn as L,it as R,j as z,ji as te,k as B,ki as V,ma as ne,oa as re,ot as ie,qi as ae,r as oe,ra as se,st as ce,t as le,ta as ue,ut as de,va as fe,vt as pe,xa as me,yi as he,z as ge}from"./alert-BzjF81CS.js";function _e(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var ve=class extends N{#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,re.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||!fe(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(_e(e,n).forEach(e=>{e.destroy()}),_e(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=F(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 se(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)&&re.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},H=c(i(),1);function ye({queries:t,...n},r){let i=me(r),a=ue(),o=P(),s=n.subscribed!==!1,c=H.useMemo(()=>t.map(e=>{let t=i.defaultQueryOptions(e);return t._optimisticResults=a?`isRestoring`:s?`optimistic`:void 0,t}),[t,i,a,s]);c.forEach(e=>{p(e);let t=i.getQueryCache().get(e.queryHash);A(e,o,t)}),e(o);let[l]=H.useState(()=>new ve(i,c,n)),[u,d,f]=l.getOptimisticResult(c,n.combine),m=!a&&s;H.useSyncExternalStore(H.useCallback(e=>m?l.subscribe(re.batchCalls(e)):ne,[l,m]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),H.useEffect(()=>{l.setQueries(c,n)},[c,n,l]);let h=u.some((e,t)=>D(c[t],e))?u.flatMap((e,t)=>{let n=c[t];if(n&&D(n,e)){let e=new se(i,n);return O(n,e,o)}return[]}):[];if(h.length>0)throw Promise.all(h);let g=u.find((e,t)=>{let n=c[t];return n&&S({result:e,errorResetBoundary:o,throwOnError:n.throwOnError,query:i.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(g)throw g.error;return d(f())}var be={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};be.node;var xe=pe(be),Se={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`}]]};Se.node;var Ce=pe(Se),we={canOpenPaths:!!E(),async openPath(e){let t=E();return t?t.openPath(e):!1},async revealLogs(){return await E()?.revealLogs()??!1},async copy(e){if(window.isSecureContext&&navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}return Ee(e)},async contextMenu(e){let t=E();if(t)return t.showContextMenu(e)},async startService(){let e=E();return e?e.startService():null},async restartService(){let e=E();return e?e.restartService():null}};function Te(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t>0?e.slice(0,t):e}function Ee(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 De={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`},Oe=/^[A-Z]{3}$/;function ke(e,t,n){let r=n===`zh`?`zh-CN`:`en-US`;if(t&&Oe.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 Ae=e=>e.windowMinutes!=null&&e.usedPercent!=null;function je(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 Me(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 Ne(e,t){return e.code?t(De[e.code]):e.message}function Pe(e,t,n){let r=je(e);if(Ae(e))return t(`providers.quota.window`,{window:ft(e.windowMinutes,n),percent:Math.round(r??0)});if(e.remaining!=null){let i=t(`providers.quota.balance`,{amount:ke(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:ke(e.used,e.unit,n),total:ke(e.total,e.unit,n)}):null:t(`providers.quota.usedPercent`,{percent:Math.round(r)})}function Fe(e,t,n){let r=pt(e.resetsAtUtc??null,n);return r?t(`providers.quota.resets`,{time:r}):null}function Ie(e,t,n){let r=(e?.plans??[]).map(e=>Pe(e,t,n)).filter(e=>!!e);return e?.isValid===!1&&r.unshift(t(`providers.quota.invalid`)),r.length?r.join(` · `):null}var Le=e=>e.authScheme!==`oauth-subscription`&&!!e.quotaConfig?.enabled;function Re(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 ze=e=>String(e).padStart(2,`0`),Be=e=>`${e.getFullYear()}-${ze(e.getMonth()+1)}-${ze(e.getDate())}`,Ve={"7d":7,"30d":30,"90d":90};function He(e,t=new Date){if(e===`today`)return new Date(t.getFullYear(),t.getMonth(),t.getDate());let n=Ve[e];return n?new Date(t.getFullYear(),t.getMonth(),t.getDate()-(n-1)):null}function Ue(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(Be(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 We(e,t){return e<=0?0:t<=0?1:Math.min(4,Math.max(1,Math.ceil(e/t*4)))}function Ge(e,t=new Date){if(e===`today`){let e=Be(t);return Array.from({length:24},(t,n)=>`${e}T${ze(n)}:00`)}let n=He(e,t),r=Ve[e]??0;return n?Array.from({length:r},(e,t)=>Be(new Date(n.getFullYear(),n.getMonth(),n.getDate()+t))):[]}function Ke(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 qe=e=>`${e.slice(5,7)}/${e.slice(8,10)}`,Je=e=>e.includes(`T`)?e.slice(11,16):qe(e),Ye=e=>e.includes(`T`)?`${qe(e)} ${e.slice(11,16)}`:qe(e);function Xe(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 Ze(e){return Math.max(0,Math.round(e.requests*(1-e.successRate)))}function Qe(e){return!Number.isFinite(e)||e<=0?`$0`:e<.01?`$<0.01`:e<1e3?`$${e.toFixed(2)}`:k(e,{compact:!0})}function $e(e,t=new Date){return Ke(Re(e,`requests`),Ge(`today`,t))}var et=e=>String(e).padStart(2,`0`);function tt(e,t=new Date){let n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1),r=`${n.getFullYear()}-${et(n.getMonth()+1)}-${et(n.getDate())}`;return e.filter(e=>e.bucket===r).reduce((e,t)=>e+t.tokens,0)}function nt(e,t){return t<=0?null:(e-t)/t}function rt(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 it={session:300,weekly:10080};function at(e){return e==null||!Number.isFinite(e)?null:Math.min(100,Math.max(0,100-e))}function ot(e,t){let n=at(t?.usedPercent);return n===null?null:{kind:e,windowMinutes:t?.windowMinutes??it[e],remaining:n,resetsAt:t?.resetsAtUtc??null}}function st(e){let t=[];for(let{provider:n,account:r}of e){if(r.status!==`active`||!r.quota)continue;let e=r.quota,i=[ot(`session`,e.session),ot(`weekly`,e.weekly)].filter(e=>e!==null),a=at(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 ct(e){let t=[];for(let n of e){if(!n.enabled||!Le(n)||n.quota?.isValid===!1)continue;let e=[];for(let t of n.quota?.plans??[]){let n=je(t);Ae(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 lt(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 ut(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 dt(e){return e<10?`red`:e<30?`orange`:`green`}function ft(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 pt(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 mt(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 ht(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?Ze(t.summary):0;if(e>0)return{title:`⚠ ${e}`,detail:n.failures(e)};let i=lt(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=lt(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=f(i.requests,!0);return{title:e,detail:n.requests(e)}}case`tokens`:{let e=f(i.inputTokens+i.outputTokens,!0);return{title:e,detail:n.tokens(e)}}case`cost`:{let e=Qe(i.costUsd);return{title:e,detail:n.cost(e)}}}}var gt={title:`requests`,sections:{overview:!0,cost:!0,chart:!0,topModel:!0,compareYesterday:!1,cacheHitRate:!1,quota:!0,clients:!1}},_t=()=>!!E()?.tray;function vt(){let[e,t]=(0,H.useState)(gt),[n,r]=(0,H.useState)(!E()?.tray);return(0,H.useEffect)(()=>{let e=E()?.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=E()?.tray;n&&n.setPrefs(e).then(t)},[]),n]}function yt(){let e=L(),[t,n]=(0,H.useState)(null);return(0,H.useEffect)(()=>{let e=E()?.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 bt(e,t,n){return{...e,sections:{...e.sections,[t]:n}}}var xt=3e5,St=new Map,Ct=()=>-new Date().getTimezoneOffset();function wt(e,t){let n=me(),{enabled:r,background:i}=t,o={refetchInterval:15e3,refetchIntervalInBackground:i},s=e.sections.quota||e.title===`quota`||e.title===`alerts`,c=ae({queryKey:a.settings,queryFn:()=>j(`GET`,`/api/settings`),enabled:r}),l=ae({queryKey:a.stats(`summary`,`today`,``,``),queryFn:()=>j(`GET`,`/api/stats/summary?range=today`),enabled:r,...o}),u=ae({queryKey:a.stats(`timeseries`,`today`,`hour`,`provider`,``,``,Ct()),queryFn:()=>j(`GET`,`/api/stats/timeseries?range=today&groupBy=hour&by=provider&tzOffset=${Ct()}`),enabled:r&&e.sections.chart,...o,refetchInterval:3e4}),d=ae({queryKey:a.stats(`timeseries`,`7d`,`day`,`provider`,``,``,Ct()),queryFn:()=>j(`GET`,`/api/stats/timeseries?range=7d&groupBy=day&by=provider&tzOffset=${Ct()}`),enabled:r&&e.sections.compareYesterday,...o,refetchInterval:6e4}),f=ae({queryKey:a.stats(`top`,`today`,``,3,``),queryFn:()=>j(`GET`,`/api/stats/top-models?range=today&limit=3`),enabled:r&&e.sections.topModel,...o,refetchInterval:3e4}),p=ae({queryKey:a.providers,queryFn:()=>j(`GET`,`/api/providers`),enabled:r&&(s||e.sections.clients),...o,refetchInterval:6e4}),h=ae({queryKey:a.clients,queryFn:()=>j(`GET`,`/api/clients`),enabled:r&&e.sections.clients,...o,refetchInterval:3e4}),g=(0,H.useMemo)(()=>(p.data??[]).filter(e=>e.enabled&&e.authScheme===`oauth-subscription`),[p.data]),_=ye({queries:g.map(e=>({queryKey:a.providerAccounts(e.id),queryFn:()=>j(`GET`,`/api/providers/${he(e.id)}/accounts`),enabled:r&&s,...o,refetchInterval:6e4}))}),v=g.flatMap((e,t)=>(_[t]?.data??[]).map(t=>({provider:e,account:t}))),y=v.map(e=>`${e.account.id}:${e.account.status}:${e.account.quota?.fetchedAtUtc??``}`).join(`|`),b=m({mutationFn:e=>j(`POST`,`/api/provider-accounts/${he(e)}/quota`),onSettled:e=>{e&&n.invalidateQueries({queryKey:a.providerAccounts(e.providerId)})}}),x=r&&s&&(t.live||e.title===`quota`||e.title===`alerts`);(0,H.useEffect)(()=>{if(!x)return;let e=Date.now();for(let{account:t}of v){if(t.status!==`active`)continue;let n=t.quota?.fetchedAtUtc?new Date(t.quota.fetchedAtUtc).getTime():0;Number.isFinite(n)&&e-n<xt||e-(St.get(t.id)??0)<xt||(St.set(t.id,e),b.mutate(t.id,{onError:()=>{}}))}},[x,y]);let S=[...st(v),...ct(p.data??[])];return{settings:c.data,summary:l.data,hourly:u.data??[],daily:d.data??[],top:f.data??[],plans:S,hasSubscriptions:v.some(e=>e.account.status===`active`),clients:h.data??[],providers:p.data??[],updatedAt:l.dataUpdatedAt,loading:l.isLoading,error:l.isError}}function Tt(e,t,n,r){let{t:i,locale:a}=ie(),o=E(),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`):ft(e.windowMinutes,a)}),[i,a]),c=ht(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 Et(){let[e]=vt(),t=yt(),n=wt(e,{enabled:t.running,background:!0,live:!1});return Tt(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=T();function Dt({children:e,reduceMotion:t}){let n=(0,H.useRef)(null),[r,i]=(0,H.useState)(`auto`);return(0,H.useEffect)(()=>{let e=n.current;if(!e)return;let t=new ResizeObserver(()=>i(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}:s.spring.smooth,children:(0,W.jsx)(`div`,{ref:n,children:e})})}var Ot=(0,H.forwardRef)(function({label:e,options:t,value:r,defaultValue:i=``,onValueChange:a,description:o,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=o?`${_}-description`:void 0,b=(0,H.useRef)(null),S=(0,H.useRef)(null),C=(0,H.useRef)({}),w=te(),[T,E]=(0,H.useState)(i),[D,O]=(0,H.useState)(!1),[k,A]=(0,H.useState)(``),[j,N]=(0,H.useState)(-1),P=r??T,F=t.find(e=>e.value===P);(0,H.useImperativeHandle)(h,()=>S.current);let L=(0,H.useRef)(P);(0,H.useEffect)(()=>{if(L.current===P)return;L.current=P;let e=S.current;if(!e||w||P&&D)return;let t=P?n(e,{opacity:[0,1],y:[`0.35em`,`0em`],filter:[`blur(${s.blur.soft}px)`,`blur(0px)`]},{duration:s.duration.standard,ease:[...s.ease.enter]}):n(e,{opacity:[0,1]},{duration:s.duration.fast,ease:[...s.ease.enter]});return()=>t.complete()},[P,w,D]);let R=(0,H.useMemo)(()=>{let e=k.trim().toLocaleLowerCase();return e?t.filter(t=>[t.label,...t.keywords??[]].some(t=>t.toLocaleLowerCase().includes(e))):t},[t,k]),z=R.reduce((e,t,n)=>(t.disabled||e.push(n),e),[]);(0,H.useEffect)(()=>{if(!D)return;let e=j>=0?R[j]:void 0,t=e?C.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)}},[j,R,D]),(0,H.useEffect)(()=>{let e=e=>{b.current&&!b.current.contains(e.target)&&(O(!1),A(``))};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[]);let B=e=>{e.disabled||(E(e.value),a?.(e.value),A(``),O(!1),S.current?.focus())},ne=e=>{e.preventDefault(),E(``),a?.(``),A(``),O(!0),S.current?.focus()},re=()=>{f||(O(!0),A(``),N(-1))},ie=e=>{if(!f){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),!D){re();return}if(!z.length)return;let t=z.indexOf(j),n=e.key===`ArrowDown`?(t+1)%z.length:(t-1+z.length)%z.length;N(z[n]);return}if(e.key===`Enter`&&D&&j>=0){e.preventDefault();let t=R[j];t&&B(t);return}if(e.key===`Escape`&&D){e.preventDefault(),O(!1),A(``);return}}},ae=D?k:F?.label??``,oe=j>=0?R[j]: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,D?U.open:``,f?U.disabled:``,d??``].filter(Boolean).join(` `),children:[(0,W.jsx)(de,{className:U.searchIcon,size:16,strokeWidth:1.75,"aria-hidden":`true`}),(0,W.jsx)(`input`,{...m,ref:S,id:_,type:`text`,role:`combobox`,value:ae,placeholder:F?.label??c,disabled:f,"aria-describedby":y,"aria-expanded":D,"aria-controls":D?v:void 0,"aria-autocomplete":`list`,"aria-activedescendant":D&&oe?`${_}-option-${oe.value}`:void 0,onFocus:e=>{p?.(e),re()},onClick:re,onChange:e=>{A(e.target.value),O(!0),N(-1)},onKeyDown:ie}),(0,W.jsx)(x,{initial:!1,children:F&&!f&&(0,W.jsx)(V.button,{type:`button`,className:U.clear,"aria-label":`Clear selection`,onMouseDown:e=>e.preventDefault(),onClick:ne,initial:w?{opacity:0}:{opacity:0,scale:.6,filter:`blur(${s.blur.subtle}px)`},animate:{opacity:1,scale:1,filter:`blur(0px)`,transition:w?{duration:s.duration.instant}:{...s.spring.snappy,opacity:{duration:s.duration.fast}}},exit:{opacity:0,...w?{}:{scale:.6,filter:`blur(${s.blur.subtle}px)`},transition:{duration:s.duration.instant,ease:[...s.ease.standard]}},whileTap:{scale:w?1:.96,transition:{duration:s.duration.instant,ease:[...s.ease.standard]}},children:(0,W.jsx)(ee,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})}),(0,W.jsx)(I,{className:U.chevron,size:16,strokeWidth:1.75,"aria-hidden":`true`})]}),o&&(0,W.jsx)(`span`,{id:y,className:U.hint,children:o}),(0,W.jsx)(x,{initial:!1,children:D&&(0,W.jsx)(V.div,{className:U.popover,initial:w?{opacity:0}:{opacity:0,y:-6,scale:.97},animate:{opacity:1,y:0,scale:1,transition:w?{duration:s.duration.instant}:{...s.spring.snappy,opacity:{duration:s.duration.fast,ease:[...s.ease.enter]}}},exit:{opacity:0,...w?{}:{y:-4,scale:.98},transition:{duration:s.duration.instant,ease:[...s.ease.standard]}},role:`presentation`,children:(0,W.jsx)(Dt,{reduceMotion:w,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=>{C.current[e.value]=t},id:`${_}-option-${e.value}`,className:U.option,"data-active":t===j?`true`:void 0,"data-disabled":e.disabled?`true`:void 0,role:`option`,"aria-selected":e.value===P,"aria-disabled":e.disabled||void 0,onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>!e.disabled&&N(t),onClick:()=>B(e),children:[(0,W.jsx)(`span`,{children:e.label}),e.value===P&&(0,W.jsx)(M,{className:U.check,size:16,strokeWidth:1.75,"aria-hidden":`true`})]},e.value)):(0,W.jsx)(V.div,{className:U.empty,role:`status`,initial:!w&&{opacity:0,y:4,filter:`blur(${s.blur.soft}px)`},animate:{opacity:1,y:0,filter:`blur(0px)`},transition:{duration:s.duration.standard,ease:[...s.ease.enter]},children:l})})})})})]})});Ot.displayName=`Combobox`;var kt=Object.defineProperty,At=(e,t)=>kt(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)),[])}At(G,`useCallbackRef`);var jt=Object.defineProperty,K=(e,t)=>jt(e,`name`,{value:t,configurable:!0}),Mt=`dismissableLayer.update`,Nt=`dismissableLayer.pointerDownOutside`,Pt=`dismissableLayer.focusOutside`,Ft,It=H.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Lt=H.forwardRef(K(function(e,n){let{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=e,d=H.useContext(It),[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,x=f?_.indexOf(f):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,w=x>=y,T=H.useRef(!1),E=Bt(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=Vt(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?x===_.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&&(Ft=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Ht(),()=>{r&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Ft))}},[f,m,r,d]),H.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Ht())},[f,d]),H.useEffect(()=>{let e=K(()=>h({}),`handleUpdate`);return document.addEventListener(Mt,e),()=>document.removeEventListener(Mt,e)},[]),(0,W.jsx)(t.div,{...u,ref:g,style:{pointerEvents:S?w?`auto`:`none`:void 0,...e.style},onFocusCapture:b(e.onFocusCapture,D.onFocusCapture),onBlurCapture:b(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:b(e.onPointerDownCapture,E.onPointerDownCapture)})},`DismissableLayer`));function Rt(){let e=H.useContext(It),[t,n]=H.useState(null);return H.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}K(Rt,`useDismissableLayerSurface`);var zt=K(()=>!0,`IS_TRUE`);function Bt(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=zt}=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||Ut(Nt,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(Bt,`usePointerDownOutside`);function Vt(e,t=globalThis?.document){let n=G(e),r=H.useRef(!1);return H.useEffect(()=>{let e=K(e=>{e.target&&!r.current&&Ut(Pt,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(Vt,`useFocusOutside`);function Ht(){let e=new CustomEvent(Mt);document.dispatchEvent(e)}K(Ht,`dispatchUpdate`);function Ut(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?z(i,a):i.dispatchEvent(a)}K(Ut,`handleAndDispatchCustomEvent`);var Wt=Object.defineProperty,q=(e,t)=>Wt(e,`name`,{value:t,configurable:!0}),Gt=`focusScope.autoFocusOnMount`,Kt=`focusScope.autoFocusOnUnmount`,qt={bubbles:!1,cancelable:!0},Jt=H.forwardRef(q(function(e,n){let{loop:r=!1,trapped:i=!1,branches:a,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=e,[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:on(p.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(g(t)||on(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&on(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){sn.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(Gt,qt);l.addEventListener(Gt,d),l.dispatchEvent(t),t.defaultPrevented||($t(un(tn(l)),{select:!0}),document.activeElement===e&&on(l))}return()=>{l.removeEventListener(Gt,d),setTimeout(()=>{let t=new CustomEvent(Kt,qt);l.addEventListener(Kt,f),l.dispatchEvent(t),t.defaultPrevented||on(e??document.body,{select:!0}),l.removeEventListener(Kt,f),sn.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]=en(t);i&&a?!e.shiftKey&&n===a?(e.preventDefault(),r&&on(i,{select:!0})):e.shiftKey&&n===i&&(e.preventDefault(),r&&on(a,{select:!0})):n===t&&e.preventDefault()}},[r,i,_.paused]);return(0,W.jsx)(t.div,{tabIndex:-1,...c,ref:m,onKeyDown:v})},`FocusScope`)),Yt=H.createContext(null);function Xt({registry:e,children:t}){return e?(0,W.jsx)(Yt.Provider,{value:e,children:t}):t}q(Xt,`FocusScopeBranchProvider`);function Zt(){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(Zt,`useFocusScopeBranchRegistry`);function Qt(e){let t=H.useContext(Yt);H.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}q(Qt,`useFocusScopeBranch`);function $t(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(on(r,{select:t}),document.activeElement!==n)return}q($t,`focusFirst`);function en(e){let t=tn(e);return[nn(t,e),nn(t.reverse(),e)]}q(en,`getTabbableEdges`);function tn(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(tn,`getTabbableCandidates`);function nn(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):rn(r,{upTo:t})))return r}q(nn,`findVisible`);function rn(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(rn,`isHidden`);function an(e){return e instanceof HTMLInputElement&&`select`in e}q(an,`isSelectableInput`);function on(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&an(e)&&t&&e.select()}}q(on,`focus`);var sn=cn();function cn(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ln(e,t),e.unshift(t)},remove(t){e=ln(e,t),e[0]?.resume()}}}q(cn,`createFocusScopesStack`);function ln(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}q(ln,`arrayRemove`);function un(e){return e.filter(e=>e.tagName!==`A`)}q(un,`removeLinks`);var dn=c(y(),1),fn=Object.defineProperty,pn=H.forwardRef(((e,t)=>fn(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[a,o]=H.useState(!1);_(()=>o(!0),[]);let s=r||a&&globalThis?.document?.body;return s?dn.createPortal((0,W.jsx)(t.div,{...i,ref:n}),s):null},`Portal`)),mn=Object.defineProperty,hn=(e,t)=>mn(e,`name`,{value:t,configurable:!0}),gn=0,_n=null;function vn(e){return yn(),e.children}hn(vn,`FocusGuards`);function yn(){H.useEffect(()=>{_n||={start:bn(),end:bn()};let{start:e,end:t}=_n;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),gn++,()=>{gn===1&&(_n?.start.remove(),_n?.end.remove(),_n=null),gn=Math.max(0,gn-1)}},[])}hn(yn,`useFocusGuards`);function bn(){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}hn(bn,`createFocusGuard`);var xn=function(){return xn=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},xn.apply(this,arguments)};function Sn(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 Cn(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 wn=`right-scroll-bar-position`,Tn=`width-before-scroll-bar`,En=`with-scroll-bars-hidden`,Dn=`--removed-body-scroll-bar-size`;function On(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function kn(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 An=typeof window<`u`?H.useLayoutEffect:H.useEffect,jn=new WeakMap;function Mn(e,t){var n=kn(t||null,function(t){return e.forEach(function(e){return On(e,t)})});return An(function(){var t=jn.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||On(e,null)}),i.forEach(function(e){r.has(e)||On(e,a)})}jn.set(n,e)},[e]),n}function Nn(e){return e}function Pn(e,t){t===void 0&&(t=Nn);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 Fn(e){e===void 0&&(e={});var t=Pn(null);return t.options=xn({async:!0,ssr:!1},e),t}var In=function(e){var t=e.sideCar,n=Sn(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,xn({},n))};In.isSideCarExport=!0;function Ln(e,t){return e.useMedium(t),In}var Rn=Fn(),zn=function(){},Bn=H.forwardRef(function(e,t){var n=H.useRef(null),r=H.useState({onScrollCapture:zn,onWheelCapture:zn,onTouchMoveCapture:zn}),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=Sn(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Mn([n,t]),C=xn(xn({},b),i);return H.createElement(H.Fragment,null,u&&H.createElement(x,{sideCar:Rn,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),xn(xn({},C),{ref:S})):H.createElement(v,xn({},C,{className:c,ref:S}),s))});Bn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Bn.classNames={fullWidth:Tn,zeroRight:wn};var Vn=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Hn(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Vn();return t&&e.setAttribute(`nonce`,t),e}function Un(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Wn(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Gn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Hn())&&(Un(t,n),Wn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kn=function(){var e=Gn();return function(t,n){H.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},qn=function(){var e=Kn();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Jn={left:0,top:0,right:0,gap:0},Yn=function(e){return parseInt(e||``,10)||0},Xn=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[Yn(n),Yn(r),Yn(i)]},Zn=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Jn;var t=Xn(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])}},Qn=qn(),$n=`data-scroll-locked`,er=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
+ .${En} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${$n}] {
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
+ .${wn} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${Tn} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${wn} .${wn} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${Tn} .${Tn} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${$n}] {
36
+ ${Dn}: ${s}px;
37
+ }
38
+ `},tr=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},nr=function(){H.useEffect(function(){return document.body.setAttribute($n,(tr()+1).toString()),function(){var e=tr()-1;e<=0?document.body.removeAttribute($n):document.body.setAttribute($n,e.toString())}},[])},rr=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;nr();var a=H.useMemo(function(){return Zn(i)},[i]);return H.createElement(Qn,{styles:er(a,!t,i,n?``:`!important`)})},ir=!1;if(typeof window<`u`)try{var ar=Object.defineProperty({},"passive",{get:function(){return ir=!0,!0}});window.addEventListener(`test`,ar,ar),window.removeEventListener(`test`,ar,ar)}catch{ir=!1}var or=ir?{passive:!1}:!1,sr=function(e){return e.tagName===`TEXTAREA`},cr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!sr(e)&&n[t]===`visible`)},lr=function(e){return cr(e,`overflowY`)},ur=function(e){return cr(e,`overflowX`)},dr=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),mr(e,r)){var i=hr(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fr=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},pr=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},mr=function(e,t){return e===`v`?lr(t):ur(t)},hr=function(e,t){return e===`v`?fr(t):pr(t)},gr=function(e,t){return e===`h`&&t===`rtl`?-1:1},_r=function(e,t,n,r,i){var a=gr(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=hr(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&mr(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},vr=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},yr=function(e){return[e.deltaX,e.deltaY]},br=function(e){return e&&`current`in e?e.current:e},xr=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Sr=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},Cr=0,wr=[];function Tr(e){var t=H.useRef([]),n=H.useRef([0,0]),r=H.useRef(),i=H.useState(Cr++)[0],a=H.useState(qn)[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=Cn([e.lockRef.current],(e.shards||[]).map(br),!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=vr(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=dr(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=dr(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 _r(h,t,e,h===`h`?s:c,!0)},[]),c=H.useCallback(function(e){var n=e;if(wr.length&&wr[wr.length-1]===a){var r=`deltaY`in n?yr(n):vr(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&xr(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(br).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:Er(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=vr(e),r.current=void 0},[]),d=H.useCallback(function(t){l(t.type,yr(t),t.target,s(t,e.lockRef.current))},[]),f=H.useCallback(function(t){l(t.type,vr(t),t.target,s(t,e.lockRef.current))},[]);H.useEffect(function(){return wr.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,or),document.addEventListener(`touchmove`,c,or),document.addEventListener(`touchstart`,u,or),function(){wr=wr.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,or),document.removeEventListener(`touchmove`,c,or),document.removeEventListener(`touchstart`,u,or)}},[]);var p=e.removeScrollBar,m=e.inert;return H.createElement(H.Fragment,null,m?H.createElement(a,{styles:Sr(i)}):null,p?H.createElement(rr,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Er(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Dr=Ln(Rn,Tr),Or=H.forwardRef(function(e,t){return H.createElement(Bn,xn({},e,{ref:t,sideCar:Dr}))});Or.classNames=Bn.classNames;var kr=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ar=new WeakMap,jr=new WeakMap,Mr={},Nr=0,Pr=function(e){return e&&(e.host||Pr(e.parentNode))},Fr=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Pr(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})},Ir=function(e,t,n,r){var i=Fr(t,Array.isArray(e)?e:[e]);Mr[n]||(Mr[n]=new WeakMap);var a=Mr[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=(Ar.get(e)||0)+1,l=(a.get(e)||0)+1;Ar.set(e,c),a.set(e,l),o.push(e),c===1&&i&&jr.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(),Nr++,function(){o.forEach(function(e){var t=Ar.get(e)-1,i=a.get(e)-1;Ar.set(e,t),a.set(e,i),t||(jr.has(e)||e.removeAttribute(r),jr.delete(e)),i||e.removeAttribute(n)}),Nr--,Nr||(Ar=new WeakMap,Ar=new WeakMap,jr=new WeakMap,Mr={})}},Lr=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||kr(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ir(r,i,n,`aria-hidden`)):function(){return null}},Rr=Object.defineProperty,J=(e,t)=>Rr(e,`name`,{value:t,configurable:!0}),zr=`Dialog`,[Br,Vr]=ge(zr),[Hr,Ur]=Br(zr),Wr=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}=Zt(),[d,f]=h({prop:r,defaultProp:i??!1,onChange:a,caller:zr}),[p,m]=H.useState(0),[g,_]=H.useState(0);return(0,W.jsx)(Hr,{scope:t,triggerRef:s,contentRef:c,contentId:v(),titleId:v(),descriptionId:v(),titlePresent:p>0,descriptionPresent:g>0,setTitleCount:m,setDescriptionCount:_,open:d,onOpenChange:f,onOpenToggle:H.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Gr=`DialogTrigger`,Kr=H.forwardRef(J(function(e,n){let{__scopeDialog:r,...i}=e,a=Ur(Gr,r),o=C(n,a.triggerRef);return(0,W.jsx)(t.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":di(a.open),...i,ref:o,onClick:b(e.onClick,a.onOpenToggle)})},`DialogTrigger`)),qr=`DialogPortal`,[Jr,Yr]=Br(qr,{forceMount:void 0}),Xr=J(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ur(qr,t);return(0,W.jsx)(Jr,{scope:t,forceMount:n,children:H.Children.map(r,e=>(0,W.jsx)(B,{present:n||a.open,children:(0,W.jsx)(pn,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Zr=`DialogOverlay`,Qr=H.forwardRef(J(function(e,t){let n=Yr(Zr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ur(Zr,e.__scopeDialog);return a.modal?(0,W.jsx)(B,{present:r||a.open,children:(0,W.jsx)(ei,{...i,ref:t})}):null},`DialogOverlay`)),$r=d(`DialogOverlay.RemoveScroll`),ei=H.forwardRef(J(function(e,n){let{__scopeDialog:r,...i}=e,a=Ur(Zr,r),o=Rt(),s=C(n,o);return(0,W.jsx)(Or,{as:$r,allowPinchZoom:!0,shards:H.useMemo(()=>[a.contentRef,...a.branchNodes.map(e=>({current:e}))],[a.contentRef,a.branchNodes]),children:(0,W.jsx)(t.div,{"data-state":di(a.open),...i,ref:s,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),ti=`DialogContent`,ni=H.forwardRef(J(function(e,t){let n=Yr(ti,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ur(ti,e.__scopeDialog);return(0,W.jsx)(B,{present:r||a.open,children:a.modal?(0,W.jsx)(ri,{...i,ref:t}):(0,W.jsx)(ii,{...i,ref:t})})},`DialogContent`)),ri=H.forwardRef(J(function(e,t){let n=Ur(ti,e.__scopeDialog),r=H.useRef(null),i=C(t,n.contentRef,r);return H.useEffect(()=>{let e=r.current;if(e)return Lr(e)},[]),(0,W.jsx)(ai,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:b(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:b(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:b(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),ii=H.forwardRef(J(function(e,t){let n=Ur(ti,e.__scopeDialog),r=H.useRef(!1),i=H.useRef(!1);return(0,W.jsx)(ai,{...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`)),ai=H.forwardRef(J(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=Ur(ti,n);return yn(),(0,W.jsx)(Xt,{registry:l.branchRegistry,children:(0,W.jsx)(Jt,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,W.jsx)(Lt,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?ui(o,l.descriptionId):o,"data-state":di(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),oi=H.forwardRef(J(function(e,n){let{__scopeDialog:r,...i}=e,a=Ur(`DialogTitle`,r),{setTitleCount:o}=a;return _(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),(0,W.jsx)(t.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),si=H.forwardRef(J(function(e,n){let{__scopeDialog:r,...i}=e,a=Ur(`DialogDescription`,r),{setDescriptionCount:o}=a;return _(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),(0,W.jsx)(t.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),ci=`DialogClose`,li=H.forwardRef(J(function(e,n){let{__scopeDialog:r,...i}=e,a=Ur(ci,r);return(0,W.jsx)(t.button,{type:`button`,...i,ref:n,onClick:b(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function ui(...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(ui,`concatAriaDescribedby`);function di(e){return e?`open`:`closed`}J(di,`getState`);var fi={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`},pi=(0,H.createContext)(null);function mi({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)(pi.Provider,{value:o,children:(0,W.jsx)(Wr,{...r,open:o,onOpenChange:s})})}var hi={duration:s.duration.instant},gi={duration:s.duration.fast,ease:[...s.ease.standard]};function _i({text:e}){let t=te();return(0,W.jsx)(x,{mode:`popLayout`,initial:!1,children:(0,W.jsx)(V.span,{className:fi.swap,initial:!t&&{opacity:0,y:`0.3em`,filter:`blur(${s.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(${s.blur.subtle}px)`,transition:{duration:s.duration.fast,ease:[...s.ease.standard]}},transition:{duration:s.duration.standard,ease:[...s.ease.enter]},children:e},e)})}function vi({title:e,description:t,children:n,className:r,onPointerDownOutside:i,...a}){let o=(0,H.useContext)(pi),c=te(),l=(0,H.useRef)({open:o,at:0});(0,H.useLayoutEffect)(()=>{l.current={open:o,at:performance.now()}},[o]);let u=e=>{i?.(e),o!==null&&(!l.current.open||e.detail.originalEvent.timeStamp<l.current.at)&&e.preventDefault()},d=[fi.content,r].filter(Boolean).join(` `),f=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:fi.header,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(oi,{className:fi.title,children:(0,W.jsx)(_i,{text:e})}),t?(0,W.jsx)(si,{className:fi.description,children:(0,W.jsx)(_i,{text:t})}):null]}),(0,W.jsx)(li,{className:fi.close,"aria-label":`Close dialog`,children:(0,W.jsx)(ee,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]}),(0,W.jsx)(`div`,{className:fi.body,children:n})]});return o===null?(0,W.jsxs)(Xr,{children:[(0,W.jsx)(Qr,{className:`${fi.overlay} ${fi.keyframes}`}),(0,W.jsx)(ni,{...a,onPointerDownOutside:u,className:`${d} ${fi.keyframes}`,children:f})]}):(0,W.jsx)(x,{children:o&&(0,W.jsxs)(Xr,{forceMount:!0,children:[(0,W.jsx)(Qr,{asChild:!0,forceMount:!0,children:(0,W.jsx)(V.div,{className:fi.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:c?hi:gi},transition:c?hi:{duration:s.duration.standard,ease:[...s.ease.enter]}})}),(0,W.jsx)(ni,{...a,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:hi}:{opacity:0,y:4,scale:.98,transition:gi},transition:c?hi:{default:s.spring.smooth,opacity:{duration:s.duration.fast,ease:[...s.ease.enter]}},children:f})})]},`dialog`)})}var yi=[`top`,`right`,`bottom`,`left`],bi=Math.min,xi=Math.max,Si=Math.round,Ci=Math.floor,wi=e=>({x:e,y:e}),Ti={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ei(e,t,n){return xi(e,bi(t,n))}function Di(e,t){return typeof e==`function`?e(t):e}function Oi(e){return e.split(`-`)[0]}function ki(e){return e.split(`-`)[1]}function Ai(e){return e===`x`?`y`:`x`}function ji(e){return e===`y`?`height`:`width`}function Mi(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ni(e){return Ai(Mi(e))}function Pi(e,t,n){n===void 0&&(n=!1);let r=ki(e),i=Ni(e),a=ji(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ui(o)),[o,Ui(o)]}function Fi(e){let t=Ui(e);return[Ii(e),t,Ii(t)]}function Ii(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Li=[`left`,`right`],Ri=[`right`,`left`],zi=[`top`,`bottom`],Bi=[`bottom`,`top`];function Vi(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ri:Li:t?Li:Ri;case`left`:case`right`:return t?zi:Bi;default:return[]}}function Hi(e,t,n,r){let i=ki(e),a=Vi(Oi(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ii)))),a}function Ui(e){let t=Oi(e);return Ti[t]+e.slice(t.length)}function Wi(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Gi(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Wi(e)}function Ki(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 qi(e,t,n){let{reference:r,floating:i}=e,a=Mi(t),o=Ni(t),s=ji(o),c=Oi(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=ki(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Ji(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}=Di(t,e),p=Gi(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ki(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=Ki(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 Yi=50,Xi=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ji},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=qi(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<Yi&&(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}=qi(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Zi=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}=Di(e,t)||{};if(l==null)return{};let d=Gi(u),f={x:n,y:r},p=Ni(i),m=ji(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=bi(d[_],T),D=bi(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Ei(E,k,O),j=!c.arrow&&ki(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}}}),Qi=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}=Di(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Oi(r),_=Mi(o),v=Oi(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ui(o)]:Fi(o)),x=p!==`none`;!d&&x&&b.push(...Hi(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=Pi(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`||_===Mi(t)||T.every(e=>Mi(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=Mi(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 $i(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ea(e){return yi.some(t=>e[t]>=0)}var ta=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Di(e,t);switch(i){case`referenceHidden`:{let e=$i(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ea(e)}}}case`escaped`:{let e=$i(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ea(e)}}}default:return{}}}}},na=new Set([`left`,`top`]);async function ra(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Oi(n),s=ki(n),c=Mi(n)===`y`,l=na.has(o)?-1:1,u=a&&c?-1:1,d=Di(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 ia=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 ra(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}}}}},aa=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}=Di(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Mi(i),p=Ai(f),m=u[p],h=u[f],g=(e,t)=>Ei(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}}}}}},oa=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}=Di(e,t),u={x:n,y:r},d=Mi(i),f=Ai(d),p=u[f],m=u[d],h=Di(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=na.has(Oi(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}}}},sa=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}=Di(e,t),c=await i.detectOverflow(t,s),l=Oi(n),u=ki(n),d=Mi(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=bi(p-c[m],g),y=bi(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*xi(c.left,c.right):S=p-2*xi(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 ca(){return typeof window<`u`}function la(e){return da(e)?(e.nodeName||``).toLowerCase():`#document`}function Y(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ua(e){return((da(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function da(e){return ca()?e instanceof Node||e instanceof Y(e).Node:!1}function fa(e){return ca()?e instanceof Element||e instanceof Y(e).Element:!1}function pa(e){return ca()?e instanceof HTMLElement||e instanceof Y(e).HTMLElement:!1}function ma(e){return!ca()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot}function ha(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ea(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ga(e){return/^(table|td|th)$/.test(la(e))}function _a(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var va=/transform|translate|scale|rotate|perspective|filter/,ya=/paint|layout|strict|content/,ba=e=>!!e&&e!==`none`,xa;function Sa(e){let t=fa(e)?Ea(e):e;return ba(t.transform)||ba(t.translate)||ba(t.scale)||ba(t.rotate)||ba(t.perspective)||!wa()&&(ba(t.backdropFilter)||ba(t.filter))||va.test(t.willChange||``)||ya.test(t.contain||``)}function Ca(e){let t=Oa(e);for(;pa(t)&&!Ta(t);){if(Sa(t))return t;if(_a(t))return null;t=Oa(t)}return null}function wa(){return xa??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),xa}function Ta(e){return/^(html|body|#document)$/.test(la(e))}function Ea(e){return Y(e).getComputedStyle(e)}function Da(e){return fa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Oa(e){if(la(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ma(e)&&e.host||ua(e);return ma(t)?t.host:t}function ka(e){let t=Oa(e);return Ta(t)?(e.ownerDocument||e).body:pa(t)&&ha(t)?t:ka(t)}function Aa(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ka(e),i=r===e.ownerDocument?.body,a=Y(r);if(i){let e=ja(a);return t.concat(a,a.visualViewport||[],ha(r)?r:[],e&&n?Aa(e):[])}return t.concat(r,Aa(r,[],n))}function ja(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ma(e){let t=Ea(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=pa(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Si(n)!==a||Si(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Na(e){return fa(e)?e:e.contextElement}function Pa(e){let t=Na(e);if(!pa(t))return wi(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ma(t),o=(a?Si(n.width):n.width)/r,s=(a?Si(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Fa=wi(0);function Ia(e){let t=Y(e);return!wa()||!t.visualViewport?Fa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function La(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Y(e)}function Ra(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Na(e),o=wi(1);t&&(r?fa(r)&&(o=Pa(r)):o=Pa(e));let s=La(a,n,r)?Ia(a):wi(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=fa(r)?Y(r):r,n=e,i=ja(n);for(;i&&t!==n;){let e=Pa(i),t=i.getBoundingClientRect(),r=Ea(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=ja(n)}}return Ki({width:u,height:d,x:c,y:l})}function za(e,t){let n=Da(e).scrollLeft;return t?t.left+n:Ra(ua(e)).left+n}function Ba(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-za(e,n),y:n.top+t.scrollTop}}function Va(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ua(r),s=t?_a(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=wi(1),u=wi(0),d=pa(r);if((d||!a)&&((la(r)!==`body`||ha(o))&&(c=Da(r)),d)){let e=Ra(r);l=Pa(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Ba(o,c):wi(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 Ha(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ua(e){let t=Da(e),n=e.ownerDocument.body,r=xi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=xi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+za(e),o=-t.scrollTop;return Ea(n).direction===`rtl`&&(a+=xi(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Wa=25;function Ga(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Y(e),a=ua(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!wa()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(za(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<=Wa&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ka(e,t){let n=Ra(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Pa(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function qa(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ga(e,n,t);else if(t===`document`)r=Ua(ua(e));else if(fa(t))r=Ka(t,n);else{let n=Ia(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ki(r)}function Ja(e,t){let n=t.get(e);if(n)return n;let r=Aa(e,[],!1).filter(e=>fa(e)&&la(e)!==`body`),i=null,a=Ea(e).position===`fixed`,o=a?Oa(e):e;for(;fa(o)&&!Ta(o);){let e=Ea(o),t=Sa(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Oa(o)}return t.set(e,r),r}function Ya(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?_a(t)?[]:Ja(t,this._c):[].concat(n),r],o=qa(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=qa(t,a[e],i);s=xi(n.top,s),c=bi(n.right,c),l=bi(n.bottom,l),u=xi(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Xa(e){let{width:t,height:n}=Ma(e);return{width:t,height:n}}function Za(e,t,n){let r=pa(t),i=ua(t),a=n===`fixed`,o=Ra(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=wi(0);if((r||!a)&&((la(t)!==`body`||ha(i))&&(s=Da(t)),r)){let e=Ra(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=za(i));let l=i&&!r&&!a?Ba(i,s):wi(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 Qa(e){return Ea(e).position===`static`}function $a(e,t){if(!pa(e)||Ea(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ua(e)===n&&(n=n.ownerDocument.body),n}function eo(e,t){let n=Y(e);if(_a(e))return n;if(!pa(e)){let t=Oa(e);for(;t&&!Ta(t);){if(fa(t)&&!Qa(t))return t;t=Oa(t)}return n}let r=$a(e,t);for(;r&&ga(r)&&Qa(r);)r=$a(r,t);return r&&Ta(r)&&Qa(r)&&!Sa(r)?n:r||Ca(e)||n}var to=async function(e){let t=this.getOffsetParent||eo,n=this.getDimensions,r=await n(e.floating);return{reference:Za(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function no(e){return Ea(e).direction===`rtl`}var ro={convertOffsetParentRelativeRectToViewportRelativeRect:Va,getDocumentElement:ua,getClippingRect:Ya,getOffsetParent:eo,getElementRects:to,getClientRects:Ha,getDimensions:Xa,getScale:Pa,isElement:fa,isRTL:no};function io(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ao(e,t,n){let r=null,i,a=ua(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=Ci(d),h=Ci(a.clientWidth-(u+f)),g=Ci(a.clientHeight-(d+p)),_=Ci(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:xi(0,bi(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!io(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 oo(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=Na(e),u=i||a?[...l?Aa(l):[],...t?Aa(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?ao(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?Ra(e):null;c&&g();function g(){let t=Ra(e);h&&!io(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 so=ia,co=aa,lo=Qi,uo=sa,fo=ta,po=Zi,mo=oa,ho=(e,t,n)=>{let r=new Map,i=n??{},a={...ro,...i.platform,_c:r};return Xi(e,t,{...i,platform:a})},go=typeof document<`u`?H.useLayoutEffect:function(){};function _o(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(!_o(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)&&!_o(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function vo(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yo(e,t){let n=vo(e);return Math.round(t*n)/n}function bo(e){let t=H.useRef(e);return go(()=>{t.current=e}),t}function xo(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);_o(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=bo(c),D=bo(i),O=bo(l),k=H.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),ho(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!_o(w.current,t)&&(w.current=t,dn.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);go(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=H.useRef(!1);go(()=>(A.current=!0,()=>{A.current=!1}),[]),go(()=>{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=yo(M.floating,u.x),r=yo(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...vo(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 So=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?{}:po({element:r.current,padding:i}).fn(n):r?po({element:r,padding:i}).fn(n):{}}}},Co=(e,t)=>{let n=so(e);return{name:n.name,fn:n.fn,options:[e,t]}},wo=(e,t)=>{let n=co(e);return{name:n.name,fn:n.fn,options:[e,t]}},To=(e,t)=>({fn:mo(e).fn,options:[e,t]}),Eo=(e,t)=>{let n=lo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Do=(e,t)=>{let n=uo(e);return{name:n.name,fn:n.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=So(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ao=Object.defineProperty,jo=(e,t)=>Ao(e,`name`,{value:t,configurable:!0}),Mo={Partial:`partial`,Always:`always`},No={Optimized:`optimized`,Always:`always`},Po=`Popper`,[Fo,Io]=ge(Po),[Lo,Ro]=Fo(Po),zo=jo(e=>{let{__scopePopper:t,children:n}=e,[r,i]=H.useState(null),[a,o]=H.useState(void 0);return(0,W.jsx)(Lo,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Bo=`PopperAnchor`,Vo=H.forwardRef(jo(function(e,n){let{__scopePopper:r,virtualRef:i,...a}=e,o=Ro(Bo,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&&Jo(o.placementState),p=f?.[0],m=f?.[1];return i?null:(0,W.jsx)(t.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...a,ref:u})},`PopperAnchor`)),Ho=`PopperContent`,[Uo,Wo]=Fo(Ho),Go=H.forwardRef(jo(function(e,n){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=Mo.Partial,hideWhenDetached:m=!1,updatePositionStrategy:h=No.Optimized,onPlaced:g,...v}=e,y=Ro(Ho,i),[b,x]=H.useState(null),S=C(n,x),[w,T]=H.useState(null),E=r(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(Ko),altBoundary:M},{refs:ee,floatingStyles:P,placement:F,isPositioned:I,middlewareData:L}=xo({strategy:`fixed`,placement:k,whileElementsMounted:jo((...e)=>oo(...e,{animationFrame:h===No.Always}),`whileElementsMounted`),elements:{reference:y.anchor},middleware:[Co({mainAxis:o+O,alignmentAxis:c}),u&&wo({mainAxis:!0,crossAxis:!1,limiter:p===Mo.Partial?To():void 0,...N}),u&&Eo({...N}),Do({...N,apply:jo(({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&&ko({element:w,padding:l}),qo({arrowWidth:D,arrowHeight:O}),m&&Oo({strategy:`referenceHidden`,...N,boundary:M?N.boundary:void 0})]}),R=y.setPlacementState;_(()=>(R(F),()=>{R(void 0)}),[F,R]);let[z,te]=Jo(F),B=G(g);_(()=>{I&&B?.()},[I,B]);let V=L.arrow?.x,ne=L.arrow?.y,re=L.arrow?.centerOffset!==0,[ie,ae]=H.useState();return _(()=>{b&&ae(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:ie,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(` `),...L.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,W.jsx)(Uo,{scope:i,placedSide:z,placedAlign:te,onArrowChange:T,arrowX:V,arrowY:ne,shouldHideArrow:re,children:(0,W.jsx)(t.div,{"data-side":z,"data-align":te,...v,ref:S,style:{...v.style,animation:I?v.style?.animation:`none`}})})})},`PopperContent`));function Ko(e){return e!==null}jo(Ko,`isNotNull`);var qo=jo(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]=Jo(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 Jo(e){let[t,n=`center`]=e.split(`-`);return[t,n]}jo(Jo,`getSideAndAlignFromPlacement`);var Yo=Object.defineProperty,Xo=(e,t)=>Yo(e,`name`,{value:t,configurable:!0}),Zo=!1;function Qo(){let[e,t]=H.useState(Zo);return H.useEffect(()=>{Zo||(Zo=!0,t(!0))},[]),e}Xo(Qo,`useIsHydrated`);var $o=H.useSyncExternalStore;function es(){return()=>{}}Xo(es,`subscribe`);function ts(){return $o(es,()=>!0,()=>!1)}Xo(ts,`useIsHydratedModern`);var ns=typeof $o==`function`?ts:Qo,rs=Object.defineProperty,is=(e,t)=>rs(e,`name`,{value:t,configurable:!0}),as=`rovingFocusGroup.onEntryFocus`,os={bubbles:!1,cancelable:!0},ss=`RovingFocusGroup`,[cs,ls,us]=l(ss),[ds,fs]=ge(ss,[us]),ps={Vertical:`vertical`,Horizontal:`horizontal`},ms={LTR:`ltr`,RTL:`rtl`},[hs,gs]=ds(ss),_s=H.forwardRef(is(function(e,t){return(0,W.jsx)(cs.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)(cs.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)(vs,{...e,ref:t})})})},`RovingFocusGroup`)),vs=H.forwardRef(is(function(e,n){let{__scopeRovingFocusGroup:r,orientation:i,loop:a=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=H.useRef(null),g=C(n,m),_=o(s),[v,y]=h({prop:c,defaultProp:l??null,onChange:u,caller:ss}),[x,S]=H.useState(!1),w=G(d),T=ls(r),E=H.useRef(!1),[D,O]=H.useState(0);return H.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(as,w),()=>e.removeEventListener(as,w)},[w]),(0,W.jsx)(hs,{scope:r,orientation:i,dir:_,loop:a,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)(t.div,{tabIndex:x||D===0?-1:0,"data-orientation":i,...p,ref:g,style:{outline:`none`,...e.style},onMouseDown:b(e.onMouseDown,()=>{E.current=!0}),onFocus:b(e.onFocus,e=>{let t=!E.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(as,os);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=T().filter(e=>e.focusable);ws([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),f)}}E.current=!1}),onBlur:b(e.onBlur,()=>S(!1))})})},`RovingFocusGroupImpl`)),ys=`RovingFocusGroupItem`,bs=H.forwardRef(is(function(e,n){let{__scopeRovingFocusGroup:r,focusable:i=!0,active:a=!1,tabStopId:o,children:s,...c}=e,l=v(),u=o||l,d=gs(ys,r),f=d.currentTabStopId===u,p=ls(r),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=d,y=ns();return _(()=>{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)(cs.ItemSlot,{scope:r,id:u,focusable:i,active:a,children:(0,W.jsx)(t.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:n,onMouseDown:b(e.onMouseDown,e=>{i?d.onItemFocus(u):e.preventDefault()}),onFocus:b(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:b(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Cs(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?Ts(n,r+1):n.slice(r+1)}setTimeout(()=>ws(n))}}),children:typeof s==`function`?s({isCurrentTabStop:f,hasTabStop:g!=null}):s})})},`RovingFocusGroupItem`)),xs={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Ss(e,t){return t===ms.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}is(Ss,`getDirectionAwareKey`);function Cs(e,t,n){let r=Ss(e.key,n);if(!(t===ps.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===ps.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return xs[r]}is(Cs,`getFocusIntent`);function ws(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}is(ws,`focusFirst`);function Ts(e,t){return e.map((n,r)=>e[(t+r)%e.length])}is(Ts,`wrapArray`);var Es=Object.defineProperty,X=(e,t)=>Es(e,`name`,{value:t,configurable:!0}),Ds=[`Enter`,` `],Os=[`ArrowDown`,`PageUp`,`Home`],ks=[`ArrowUp`,`PageDown`,`End`],As=[...Os,...ks];[...Ds],[...Ds];var js=`Menu`,[Ms,Ns,Ps]=l(js),[Fs,Is]=ge(js,[Ps,Io,fs]),Ls=Io(),Rs=fs(),[zs,Bs]=Fs(js),[Vs,Hs]=Fs(js),Us=X(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:s=!0}=e,c=Ls(t),[l,u]=H.useState(null),d=H.useRef(!1),f=G(a),p=o(i);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)(zo,{...c,children:(0,W.jsx)(zs,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,W.jsx)(Vs,{scope:t,onClose:H.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:r})})})},`Menu`),Ws=H.forwardRef(X(function(e,t){let{__scopeMenu:n,...r}=e,i=Ls(n);return(0,W.jsx)(Vo,{...i,...r,ref:t})},`MenuAnchor`)),Gs=`MenuPortal`,[Ks,qs]=Fs(Gs,{forceMount:void 0}),Js=X(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Bs(Gs,t);return(0,W.jsx)(Ks,{scope:t,forceMount:n,children:(0,W.jsx)(B,{present:n||a.open,children:(0,W.jsx)(pn,{asChild:!0,container:i,children:r})})})},`MenuPortal`),Ys=`MenuContent`,[Xs,Zs]=Fs(Ys),Qs=H.forwardRef(X(function(e,t){let n=qs(Ys,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Bs(Ys,e.__scopeMenu),o=Hs(Ys,e.__scopeMenu);return(0,W.jsx)(Ms.Provider,{scope:e.__scopeMenu,children:(0,W.jsx)(B,{present:r||a.open,children:(0,W.jsx)(Ms.Slot,{scope:e.__scopeMenu,children:o.modal?(0,W.jsx)($s,{...i,ref:t}):(0,W.jsx)(ec,{...i,ref:t})})})})},`MenuContent`)),$s=H.forwardRef(X(function(e,t){let n=Bs(Ys,e.__scopeMenu),r=H.useRef(null),i=C(t,r);return H.useEffect(()=>{let e=r.current;if(e)return Lr(e)},[]),(0,W.jsx)(nc,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:b(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),ec=H.forwardRef(X(function(e,t){let n=Bs(Ys,e.__scopeMenu);return(0,W.jsx)(nc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),tc=d(`MenuContent.ScrollLock`),nc=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=Bs(Ys,n),_=Hs(Ys,n),v=Ls(n),y=Rs(n),x=Ns(n),[S,w]=H.useState(null),T=H.useRef(null),[E,D]=H.useState(null);Qt(E);let{nodes:O,registry:k}=Zt(),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?Or:H.Fragment,z=m?{as:tc,allowPinchZoom:!0,shards:L}:void 0,te=X(e=>{let t=N.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Sc(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),[]),yn();let B=H.useCallback(e=>F.current===P.current?.side&&wc(e,P.current?.area),[]);return(0,W.jsx)(Xs,{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)(Xt,{registry:A?k:null,children:(0,W.jsx)(R,{...z,children:(0,W.jsx)(Jt,{asChild:!0,trapped:i,branches:O,onMountAutoFocus:b(a,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,W.jsx)(Lt,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,W.jsx)(_s,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:w,onEntryFocus:b(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,W.jsx)(Go,{role:`menu`,"aria-orientation":`vertical`,"data-state":_c(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:j,style:{outline:`none`,...h.style},onKeyDown:b(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||!As.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);ks.includes(e.key)&&a.reverse(),bc(a)}),onBlur:b(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(M.current),N.current=``)}),onPointerMove:b(e.onPointerMove,Tc(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`)),rc=`MenuItem`,ic=`menu.itemSelect`,ac=H.forwardRef(X(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=H.useRef(null),o=Hs(rc,e.__scopeMenu),s=Zs(rc,e.__scopeMenu),c=C(t,a),l=H.useRef(!1),u=X(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(ic,{bubbles:!0,cancelable:!0});e.addEventListener(ic,e=>r?.(e),{once:!0}),z(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,W.jsx)(oc,{...i,ref:c,disabled:n,onClick:b(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:b(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:b(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Ds.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),oc=H.forwardRef(X(function(e,n){let{__scopeMenu:r,disabled:i=!1,textValue:a,...o}=e,s=Zs(rc,r),c=Rs(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)(Ms.ItemSlot,{scope:r,disabled:i,textValue:a??p,children:(0,W.jsx)(bs,{asChild:!0,...c,focusable:!i,children:(0,W.jsx)(t.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...o,ref:u,onPointerMove:b(e.onPointerMove,Tc(e=>{i?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:b(e.onPointerLeave,Tc(e=>s.onItemLeave(e))),onFocus:b(e.onFocus,()=>f(!0)),onBlur:b(e.onBlur,()=>f(!1))})})})},`MenuItemImpl`)),sc=H.forwardRef(X(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,W.jsx)(dc,{scope:e.__scopeMenu,checked:n,children:(0,W.jsx)(ac,{role:`menuitemcheckbox`,"aria-checked":vc(n)?`mixed`:n,...i,ref:t,"data-state":yc(n),onSelect:b(i.onSelect,()=>r?.(vc(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[cc,lc]=Fs(`MenuRadioGroup`,{value:void 0,onValueChange:X(()=>{},`onValueChange`)}),uc=`MenuItemIndicator`,[dc,fc]=Fs(uc,{checked:!1}),pc=H.forwardRef(X(function(e,n){let{__scopeMenu:r,forceMount:i,...a}=e,o=fc(uc,r);return(0,W.jsx)(B,{present:i||vc(o.checked)||o.checked===!0,children:(0,W.jsx)(t.span,{...a,ref:n,"data-state":yc(o.checked)})})},`MenuItemIndicator`)),mc=H.forwardRef(X(function(e,n){let{__scopeMenu:r,...i}=e;return(0,W.jsx)(t.div,{role:`separator`,"aria-orientation":`horizontal`,...i,ref:n})},`MenuSeparator`)),[hc,gc]=Fs(`MenuSub`);function _c(e){return e?`open`:`closed`}X(_c,`getOpenState`);function vc(e){return e===`indeterminate`}X(vc,`isIndeterminate`);function yc(e){return vc(e)?`indeterminate`:e?`checked`:`unchecked`}X(yc,`getCheckedState`);function bc(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}X(bc,`focusFirst`);function xc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(xc,`wrapArray`);function Sc(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=xc(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(Sc,`getNextMatch`);function Cc(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(Cc,`isPointInPolygon`);function wc(e,t){return t?Cc({x:e.clientX,y:e.clientY},t):!1}X(wc,`isPointerInGraceArea`);function Tc(e){return t=>t.pointerType===`mouse`?e(t):void 0}X(Tc,`whenMouse`);var Ec=Object.defineProperty,Dc=(e,t)=>Ec(e,`name`,{value:t,configurable:!0}),Oc=`DropdownMenu`,[kc,Ac]=ge(Oc,[Is]),jc=Is(),[Mc,Nc]=kc(Oc),Pc=Dc(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=jc(t),l=H.useRef(null),[u,d]=h({prop:i,defaultProp:a??!1,onChange:o,caller:Oc});return(0,W.jsx)(Mc,{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)(Us,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Fc=`DropdownMenuTrigger`,Ic=H.forwardRef(Dc(function(e,n){let{__scopeDropdownMenu:r,disabled:i=!1,...a}=e,o=Nc(Fc,r),s=jc(r),c=C(n,o.triggerRef);return(0,W.jsx)(Ws,{asChild:!0,...s,children:(0,W.jsx)(t.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:b(e.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:b(e.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Lc=Dc(e=>{let{__scopeDropdownMenu:t,...n}=e,r=jc(t);return(0,W.jsx)(Js,{...r,...n})},`DropdownMenuPortal`),Rc=`DropdownMenuContent`,zc=H.forwardRef(Dc(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Nc(Rc,n),a=jc(n),o=H.useRef(!1);return(0,W.jsx)(Qs,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:b(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:b(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`)),Bc=H.forwardRef(Dc(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=jc(n);return(0,W.jsx)(ac,{...i,...r,ref:t})},`DropdownMenuItem`)),Vc=H.forwardRef(Dc(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=jc(n);return(0,W.jsx)(sc,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),Hc=H.forwardRef(Dc(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=jc(n);return(0,W.jsx)(pc,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),Uc=H.forwardRef(Dc(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=jc(n);return(0,W.jsx)(mc,{...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 Wc({text:e}){let t=te(),n=(0,H.useRef)(null),r=(0,H.useRef)(null),[i,a]=(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,a({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:i.width},transition:i.animate&&!t?s.spring.morph:{duration:0},children:[(0,W.jsx)(`span`,{ref:n,className:Z.labelMeasure,"aria-hidden":`true`,children:e}),(0,W.jsx)(x,{mode:`popLayout`,initial:!1,children:(0,W.jsx)(V.span,{className:Z.labelText,initial:!t&&{opacity:0,y:`0.3em`,filter:`blur(${s.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(${s.blur.subtle}px)`,transition:{duration:s.duration.fast,ease:[...s.ease.standard]}},transition:{duration:s.duration.standard,ease:[...s.ease.enter]},children:e},e)})]})}function Gc({label:e,items:t,icon:n,iconOnly:r}){let i=te(),[a,o]=(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(()=>o(null),c.current?70:0);return}let n={top:t.offsetTop,height:t.offsetHeight,danger:t.dataset.tone===`danger`},r=c.current;o(e=>({...n,glide:r&&e!==null}))}return(0,W.jsxs)(Pc,{onOpenChange:e=>{e&&(window.clearTimeout(l.current),o(null))},children:[(0,W.jsxs)(Ic,{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)(Wc,{text:e}),!r&&(0,W.jsx)(I,{className:Z.chevron,size:15,strokeWidth:1.8,"aria-hidden":`true`})]}),(0,W.jsx)(Lc,{children:(0,W.jsxs)(zc,{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":a?.danger?`danger`:void 0,"aria-hidden":`true`,initial:!1,animate:a?{y:a.top,height:a.height,opacity:1}:{opacity:0},transition:{default:a?.glide&&!i?s.spring.snappy:{duration:0},opacity:{duration:i?0:.08}}}),t.map((e,t)=>(0,W.jsxs)(H.Fragment,{children:[e.separatorBefore&&(0,W.jsx)(Uc,{className:Z.separator}),(0,W.jsxs)(Bc,{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 Kc=Object.defineProperty,qc=(e,t)=>Kc(e,`name`,{value:t,configurable:!0});function Jc(e,[t,n]){return Math.min(n,Math.max(t,e))}qc(Jc,`clamp`);var Yc=Object.defineProperty,Xc=(e,t)=>Yc(e,`name`,{value:t,configurable:!0});function Zc(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])}Xc(Zc,`usePrevious`);var Qc=Object.defineProperty,$c=(e,t)=>Qc(e,`name`,{value:t,configurable:!0}),el=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`}),tl=H.forwardRef($c(function(e,n){return(0,W.jsx)(t.span,{...e,ref:n,style:{...el,...e.style}})},`VisuallyHidden`)),nl=Object.defineProperty,Q=(e,t)=>nl(e,`name`,{value:t,configurable:!0}),rl={ItemAligned:`item-aligned`,Popper:`popper`},il={LTR:`ltr`,RTL:`rtl`},al=[` `,`Enter`,`ArrowUp`,`ArrowDown`],ol=[` `,`Enter`],sl=`Select`,[cl,ll,ul]=l(sl),[dl,fl]=ge(sl,[ul,Io]),pl=Io(),[ml,hl]=dl(sl),[gl,_l]=dl(sl);function vl(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:s,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:m,form:g,internal_do_not_use_render:_}=e,y=pl(t),[b,x]=H.useState(null),[S,C]=H.useState(null),[w,T]=H.useState(!1),E=o(u),[D,O]=h({prop:r,defaultProp:i??!1,onChange:a,caller:sl}),[k,A]=h({prop:s,defaultProp:c,onChange:l,caller:sl}),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:m,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:p,name:d,autoComplete:f,form:g,nativeOptions:ee,nativeSelectKey:I,isFormControl:N};return(0,W.jsx)(zo,{...y,children:(0,W.jsx)(ml,{scope:t,...z,children:(0,W.jsx)(cl.Provider,{scope:t,children:(0,W.jsx)(gl,{scope:t,onNativeOptionAdd:L,onNativeOptionRemove:R,children:au(_)?_(z):n})})})})}Q(vl,`SelectProvider`);var yl=Q(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,W.jsx)(vl,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,W.jsxs)(W.Fragment,{children:[n,e?(0,W.jsx)(iu,{__scopeSelect:t}):null]})})},`Select`),bl=`SelectTrigger`,xl=H.forwardRef(Q(function(e,n){let{__scopeSelect:r,disabled:i=!1,...a}=e,o=pl(r),s=hl(bl,r),c=s.disabled||i,l=C(n,s.onTriggerChange),u=ll(r),d=H.useRef(`touch`),[f,p,m]=su(e=>{let t=u().filter(e=>!e.disabled),n=cu(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)(Vo,{asChild:!0,...o,children:(0,W.jsx)(t.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":ou(s.value)?``:void 0,...a,ref:l,onClick:b(a.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&h(e)}),onPointerDown:b(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:b(a.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&al.includes(e.key)&&(h(),e.preventDefault())})})})},`SelectTrigger`)),Sl=`SelectValue`,Cl=H.forwardRef(Q(function(e,n){let{__scopeSelect:r,className:i,style:a,children:o,placeholder:s=``,...c}=e,l=hl(Sl,r),{onValueNodeHasChildrenChange:u}=l,d=o!==void 0,f=C(n,l.onValueNodeChange);_(()=>{u(d)},[u,d]);let p=ou(l.value);return(0,W.jsx)(t.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`)),wl=H.forwardRef(Q(function(e,n){let{__scopeSelect:r,children:i,...a}=e;return(0,W.jsx)(t.span,{"aria-hidden":!0,...a,ref:n,children:i||`▼`})},`SelectIcon`)),[Tl,El]=dl(`SelectPortal`,{forceMount:void 0}),Dl=Q(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,W.jsx)(Tl,{scope:e.__scopeSelect,forceMount:n,children:(0,W.jsx)(pn,{asChild:!0,...r})})},`SelectPortal`),Ol=`SelectContent`,kl=H.forwardRef(Q(function(e,t){let n=El(Ol,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=hl(Ol,e.__scopeSelect),[o,s]=H.useState();return _(()=>{s(new DocumentFragment)},[]),(0,W.jsx)(B,{present:r||a.open,children:({present:e})=>e?(0,W.jsx)(Fl,{...i,ref:t}):(0,W.jsx)(Al,{...i,fragment:o})})},`SelectContent`)),Al=H.forwardRef(Q(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?dn.createPortal((0,W.jsx)(Ml,{scope:n,children:(0,W.jsx)(cl.Slot,{scope:n,children:(0,W.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),jl=10,[Ml,Nl]=dl(Ol),Pl=d(`SelectContent.RemoveScroll`),Fl=H.forwardRef(Q(function(e,t){let{__scopeSelect:n}=e,{position:r=rl.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=hl(Ol,n),[y,x]=H.useState(null),[S,w]=H.useState(null),T=C(t,x),[E,D]=H.useState(null),[O,k]=H.useState(null),A=ll(n),[j,M]=H.useState(!1),N=H.useRef(!1);H.useEffect(()=>{if(y)return Lr(y)},[y]),yn();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]=su(e=>{let t=A().filter(e=>!e.disabled),n=cu(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]),V=r===rl.Popper?Ll:Il,ne=V===Ll?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,W.jsx)(Ml,{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)(Or,{as:Pl,allowPinchZoom:!0,children:(0,W.jsx)(Jt,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:b(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,W.jsx)(Lt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,W.jsx)(V,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...ne,onPlaced:()=>M(!0),ref:T,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:b(_.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`)),Il=H.forwardRef(Q(function(e,n){let{__scopeSelect:r,onPlaced:i,...a}=e,o=hl(Ol,r),s=Nl(Ol,r),[c,l]=H.useState(null),[u,d]=H.useState(null),f=C(n,d),p=ll(r),m=H.useRef(!1),h=H.useRef(!0),{viewport:g,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=s,x=H.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&u&&g&&v&&y){let e=o.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),r=y.getBoundingClientRect();if(o.dir!==il.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-jl,d=Jc(a,[jl,Math.max(jl,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-jl,d=Jc(a,[jl,Math.max(jl,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let a=p(),s=window.innerHeight-jl*2,l=g.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),_=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+h+l+b+_,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(g),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-jl,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-g.offsetTop-g.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+_);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+g.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,g.scrollTop=A-E+g.offsetTop}c.style.margin=`${jl}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,i?.(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,c,u,g,v,y,o.dir,i]);_(()=>x(),[x]);let[S,w]=H.useState();_(()=>{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)(Rl,{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)(t.div,{...a,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})},`SelectItemAlignedPosition`)),Ll=H.forwardRef(Q(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=jl,...a}=e,o=pl(n);return(0,W.jsx)(Go,{...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`)),[Rl,zl]=dl(Ol,{}),Bl=`SelectViewport`,Vl=H.forwardRef(Q(function(e,n){let{__scopeSelect:r,nonce:i,...a}=e,o=Nl(Bl,r),s=zl(Bl,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)(cl.Slot,{scope:r,children:(0,W.jsx)(t.div,{"data-radix-select-viewport":``,role:`presentation`,...a,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...a.style},onScroll:b(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-jl*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`)),[Hl,Ul]=dl(`SelectGroup`),Wl=`SelectItem`,[Gl,Kl]=dl(Wl),ql=H.forwardRef(Q(function(e,n){let{__scopeSelect:r,value:i,disabled:a=!1,textValue:o,...s}=e,c=hl(Wl,r),l=Nl(Wl,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`),x=Q(()=>{c.onValueChange(i),c.onOpenChange(!1)},`handleSelect`);return(0,W.jsx)(Gl,{scope:r,value:i,disabled:a,textId:_,isSelected:u,onItemTextChange:H.useCallback(e=>{f(t=>t||(e?.textContent??``).trim())},[]),children:(0,W.jsx)(cl.ItemSlot,{scope:r,value:i,disabled:a,textValue:d,children:(0,W.jsx)(t.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:b(s.onFocus,()=>m(!0)),onBlur:b(s.onBlur,()=>m(!1)),onClick:b(s.onClick,()=>{a||y.current!==`mouse`&&x()}),onPointerUp:b(s.onPointerUp,()=>{a||y.current===`mouse`&&x()}),onPointerDown:b(s.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:b(s.onPointerMove,e=>{y.current=e.pointerType,a?l.onItemLeave?.():y.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:b(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:b(s.onKeyDown,e=>{a||e.target!==e.currentTarget||(l.searchRef?.current===``||e.key!==` `)&&(ol.includes(e.key)&&x(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Jl=`SelectItemText`,Yl=H.forwardRef(Q(function(e,n){let{__scopeSelect:r,className:i,style:a,...o}=e,s=hl(Jl,r),c=Nl(Jl,r),l=Kl(Jl,r),u=_l(Jl,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,g=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 _(()=>(v(g),()=>y(g)),[v,y,g]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(t.span,{id:l.textId,...o,ref:m}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!ou(s.value)?dn.createPortal(o.children,s.valueNode):null]})},`SelectItemText`)),Xl=`SelectItemIndicator`,Zl=H.forwardRef(Q(function(e,n){let{__scopeSelect:r,...i}=e;return Kl(Xl,r).isSelected?(0,W.jsx)(t.span,{"aria-hidden":!0,...i,ref:n}):null},`SelectItemIndicator`)),Ql=`SelectScrollUpButton`,$l=H.forwardRef(Q(function(e,t){let n=Nl(Ql,e.__scopeSelect),r=zl(Ql,e.__scopeSelect),[i,a]=H.useState(!1),o=C(t,r.onScrollButtonChange);return _(()=>{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)(nu,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),eu=`SelectScrollDownButton`,tu=H.forwardRef(Q(function(e,t){let n=Nl(eu,e.__scopeSelect),r=zl(eu,e.__scopeSelect),[i,a]=H.useState(!1),o=C(t,r.onScrollButtonChange);return _(()=>{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)(nu,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),nu=H.forwardRef(Q(function(e,n){let{__scopeSelect:r,onAutoScroll:i,...a}=e,o=Nl(`SelectScrollButton`,r),s=H.useRef(null),c=ll(r),l=H.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return H.useEffect(()=>()=>l(),[l]),_(()=>{c().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[c]),(0,W.jsx)(t.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:b(a.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(i,50))}),onPointerMove:b(a.onPointerMove,()=>{o.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(i,50))}),onPointerLeave:b(a.onPointerLeave,()=>{l()})})},`SelectScrollButtonImpl`)),ru=`SelectBubbleInput`,iu=H.forwardRef(Q(function({__scopeSelect:e,...n},r){let i=hl(ru,e),{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??``,_=Zc(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)(t.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:l,autoComplete:u,disabled:c,form:d,onChange:e=>o(e.target.value),...n,style:{...el,...n.style},ref:h,defaultValue:g,children:[ou(a)&&!v?(0,W.jsx)(`option`,{value:``}):null,Array.from(f)]},p)},`SelectBubbleInput`));function au(e){return typeof e==`function`}Q(au,`isFunction`);function ou(e){return e===``||e===void 0}Q(ou,`shouldShowPlaceholder`);function su(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(su,`useTypeaheadSearch`);function cu(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=lu(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(cu,`findNextItem`);function lu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Q(lu,`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`},uu={enter:e=>({opacity:0,y:`${e*.35}em`,filter:`blur(${s.blur.soft}px)`}),center:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:s.duration.standard,ease:[...s.ease.enter]}},exit:e=>({opacity:0,y:`${e*-.3}em`,filter:`blur(${s.blur.subtle}px)`,transition:{duration:s.duration.fast,ease:[...s.ease.standard]}})},du={enter:{opacity:0},center:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:s.duration.instant}},exit:{opacity:0,transition:{duration:s.duration.instant}}},fu=(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=te(),[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)(_),[S,C]=(0,H.useState)(1);return y!==_&&(b(_),C(_>y?1:-1)),(0,W.jsxs)(`div`,{className:$.field,children:[(0,W.jsx)(`label`,{htmlFor:d,children:e}),(0,W.jsxs)(yl,{...c,disabled:o,onValueChange:e=>{h(e),s?.(e)},children:[(0,W.jsxs)(xl,{ref:l,id:d,"aria-describedby":f,className:[$.trigger,a].filter(Boolean).join(` `),children:[(0,W.jsx)(`span`,{className:$.srOnly,children:(0,W.jsx)(Cl,{placeholder:n})}),(0,W.jsx)(`span`,{className:$.valueText,"aria-hidden":`true`,children:(0,W.jsx)(x,{initial:!1,custom:S,children:(0,W.jsx)(V.span,{"data-placeholder":g?void 0:``,custom:S,variants:p?du:uu,initial:`enter`,animate:`center`,exit:`exit`,children:v},g?`value-${g}`:`placeholder`)})}),(0,W.jsx)(wl,{className:$.chevron,children:(0,W.jsx)(I,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]}),(0,W.jsx)(Dl,{children:(0,W.jsxs)(kl,{className:$.content,position:`popper`,sideOffset:4,collisionPadding:12,children:[(0,W.jsx)($l,{className:$.scrollButton,children:(0,W.jsx)(xe,{size:16,strokeWidth:1.75,"aria-hidden":`true`})}),(0,W.jsx)(Vl,{className:$.viewport,children:r.map(e=>(0,W.jsxs)(ql,{value:e.value,disabled:e.disabled,className:$.item,children:[(0,W.jsx)(Yl,{children:e.label}),(0,W.jsx)(Zl,{className:$.indicator,children:(0,W.jsx)(M,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]},e.value))}),(0,W.jsx)(tu,{className:$.scrollButton,children:(0,W.jsx)(I,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]})})]}),t&&(0,W.jsx)(`span`,{id:f,className:$.hint,children:t})]})}),pu={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`},mu=()=>()=>{},hu={duration:s.duration.fast,ease:[...s.ease.standard]},gu={duration:s.duration.standard,ease:[...s.ease.enter]},_u={opacity:0,y:`0.3em`,filter:`blur(${s.blur.soft}px)`},vu={opacity:0,y:`-0.3em`,filter:`blur(${s.blur.subtle}px)`,transition:hu},yu={opacity:1,y:`0em`,filter:`blur(0px)`},bu={opacity:0,transition:{duration:s.duration.instant}},xu={distance:80,velocity:480};function Su(e){let t=u();return(0,W.jsx)(V.span,{...e,"aria-hidden":!t||e[`aria-hidden`]})}function Cu({reduce:e,morphKey:t,children:r}){let i=(0,H.useRef)(null),a=(0,H.useRef)(null),o=g(`auto`),c=(0,H.useRef)(0);return(0,H.useLayoutEffect)(()=>{c.current=performance.now()},[t]),(0,H.useEffect)(()=>{let t=a.current;if(!t||typeof ResizeObserver>`u`)return;let r,l,u=()=>{o.jump(`auto`),i.current&&Object.assign(i.current.style,{overflow:``,height:`auto`})},d=new ResizeObserver(([a])=>{let d=a.borderBoxSize?.[0]?.blockSize??t.offsetHeight,f=o.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();i.current&&Object.assign(i.current.style,{overflow:`hidden`,height:`${p}px`}),l=n(o,[p,d],{...s.spring.smooth,onComplete:u})});return d.observe(t),()=>{d.disconnect(),l?.stop()}},[o,e]),(0,W.jsx)(V.div,{ref:i,className:pu.frame,style:{height:o},children:(0,W.jsx)(`div`,{ref:a,className:pu.copy,children:r})})}function wu({title:e,description:t,open:r=!0,onOpenChange:i,duration:a=4500}){let o=te(),c=(0,H.useSyncExternalStore)(mu,()=>!0,()=>!1),[l]=(0,H.useState)(c),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(0),[m,h]=(0,H.useState)(r);r!==m&&(h(r),r&&(d(!1),p(0)));let _=r&&!u,v=(0,H.useRef)(null),y=g(0),b=(0,H.useRef)(0);function S(e){p(e),d(!0),i?.(!1)}(0,H.useEffect)(()=>{if(!_||!i||a<=0)return;let e=window.setTimeout(()=>{p(0),d(!0),i(!1)},a);return()=>window.clearTimeout(e)},[_,i,a]);function C(e,t){let r=Math.sign(t.offset.x||t.velocity.x);if(Math.abs(t.offset.x)<xu.distance&&Math.abs(t.velocity.x)<xu.velocity){n(y,0,{...s.spring.snappy,velocity:t.velocity.x});return}b.current=t.velocity.x,S(r*((v.current?.offsetWidth??320)+48))}let w=o?{hidden:{opacity:0},shown:{opacity:1,transition:{duration:s.duration.instant}},exit:bu}:{hidden:{opacity:0,x:0,y:16,scale:.96},shown:{opacity:1,x:0,y:0,scale:1,transition:{...s.spring.morph,opacity:gu}},exit:e=>e?{x:e,opacity:0,transition:{x:{type:`spring`,visualDuration:.3,bounce:0,velocity:b.current,restDelta:2,restSpeed:40},opacity:{duration:s.duration.exit}}}:{opacity:0,y:8,scale:.97,transition:{duration:s.duration.exit,ease:[...s.ease.standard]}}},T={initial:o?{opacity:0}:_u,animate:yu,exit:o?bu:vu,transition:o?{duration:s.duration.instant}:gu};return(0,W.jsx)(x,{initial:l,custom:f,children:_&&(0,W.jsxs)(V.div,{ref:v,className:pu.toast,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,custom:f,variants:w,initial:`hidden`,animate:`shown`,exit:`exit`,style:{x:y},drag:o&&c?!1:`x`,dragMomentum:!1,onDragEnd:C,children:[(0,W.jsx)(`span`,{className:pu.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:!o&&{pathLength:0},animate:{pathLength:1},transition:{duration:s.duration.standard,ease:[...s.ease.enter],delay:.12}})})}),(0,W.jsxs)(Cu,{reduce:o,morphKey:`${e}\n${t??``}`,children:[(0,W.jsx)(`strong`,{className:pu.title,children:(0,W.jsx)(x,{mode:`popLayout`,initial:!1,children:(0,W.jsx)(Su,{className:pu.line,...T,children:e},e)})}),(0,W.jsx)(x,{mode:`popLayout`,initial:!1,children:t?(0,W.jsx)(Su,{className:pu.description,...T,children:t},t):null})]}),(0,W.jsx)(`button`,{className:pu.close,type:`button`,"aria-label":`Dismiss notification`,onClick:()=>S(0),children:(0,W.jsx)(ee,{width:16,height:16,strokeWidth:2,"aria-hidden":`true`})})]},`toast`)})}function Tu({open:e,onOpenChange:t,title:n,description:r,children:i,footer:a,width:o=460}){return(0,W.jsx)(mi,{open:e,onOpenChange:t,children:(0,W.jsxs)(vi,{title:n,description:r,style:{width:`min(calc(100vw - 2rem), ${o}px)`},children:[i,a&&(0,W.jsx)(`div`,{className:R(`flex flex-wrap items-center justify-end gap-2`,i!==void 0&&`mt-6`),children:a})]})})}function Eu({label:e,icon:t,items:n,iconOnly:r}){return(0,W.jsx)(Gc,{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 Du=`__astra_empty__`,Ou=e=>e===``?Du:e,ku=e=>e===Du?``:e,Au=12;function ju({value:e,onChange:t,options:n,placeholder:r,className:i,disabled:a,label:o,ariaLabel:s}){let c=ce(),l=n.find(t=>t.value===e),u=w(o,s??r??l?.label),d=R(`min-w-0`,u.hidden&&`astra-label-hidden`,i);return n.length>Au?(0,W.jsx)(`div`,{className:d,children:(0,W.jsx)(Ot,{label:u.label,description:u.field?.description,placeholder:r??c(`common.search`),emptyMessage:c(`common.noResults`),value:e==null?``:Ou(e),onValueChange:e=>t(ku(e)),options:n.map(e=>({value:Ou(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)(fu,{label:u.label,description:u.field?.description,placeholder:r??c(`common.select`),disabled:a,value:e==null||e===``&&!l?``:Ou(e),onValueChange:e=>t(ku(e)),options:n.map(e=>({value:Ou(e.value),label:e.label,disabled:e.disabled}))})})}var Mu=(0,H.createContext)(null);function Nu({children:e}){let t=ce(),[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)(Mu.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)(le,{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)(wu,{title:e.text,open:!0,onOpenChange:t=>!t&&s(e.id)})},e.id))}),(0,W.jsx)(Tu,{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)(oe,{onClick:()=>u(!1),children:t(`common.cancel`)}),(0,W.jsx)(oe,{variant:i?.destructive?`destructive`:`primary`,onClick:()=>u(!0),autoFocus:!0,children:i?.confirmLabel??t(`common.confirm`)})]})})]})}function Pu(){let e=(0,H.useContext)(Mu);if(!e)throw Error(`useFeedback outside FeedbackProvider`);return e}function Fu(e){return e instanceof Error?e.message:String(e)}export{Ue as $,Kr as A,bt as B,Wr as C,Qr as D,si as E,wt as F,dt as G,Ze as H,gt as I,ut as J,pt as K,_t as L,Lt as M,Et as N,Xr as O,Tt as P,tt as Q,vt as R,Io as S,ni as T,Qe as U,nt as V,$e as W,mt as X,rt as Y,ft as Z,bs as _,Ce as _t,Fu as a,Ke as at,Vo as b,Pc as c,Ne as ct,Bc as d,Fe as dt,We as et,Hc as f,Le as ft,_s as g,we as gt,Ic as h,Te as ht,Tu as i,Re as it,pn as j,oi as k,Vc as l,ke as lt,Uc as m,Ie as mt,Eu as n,Je as nt,Pu as o,Ge as ot,Lc as p,Me as pt,lt as q,ju as r,Ye as rt,tl as s,He as st,Nu as t,Xe as tt,zc as u,Pe as ut,fs as v,ye as vt,li as w,Go as x,zo as y,yt as z};
@@ -1 +1 @@
1
- import{vt as e}from"./alert-CN1yWco4.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
+ import{vt as e}from"./alert-BzjF81CS.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{vt as e}from"./alert-CN1yWco4.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};
1
+ import{vt as e}from"./alert-BzjF81CS.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};
@@ -1 +1 @@
1
- import{Ai as e,Ca as t,E as n,Ea as r,Mi as i,Sa as a,ji as o,ki as s,vt as c}from"./alert-CN1yWco4.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=c(l),d=r(t(),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=a(),m=[...n.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:t,value:r,defaultValue:a=null,onValueChange:o,layout:c=`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=r===void 0?O:r,j=t.findIndex(e=>e.value===A),M=e=>!y&&!e.disabled,N=j>=0&&M(t[j])?j:t.findIndex(M),P=e=>{e!==A&&(r===void 0&&k(e),o?.(e))},F=i(0),I=i(0),L=i(0),R=i(0),z=i(0),B=(0,d.useRef)(!1),V=(0,d.useCallback)(t=>{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(!t||!B.current||T){F.jump(i[0]),I.jump(i[1]),L.jump(i[2]),R.jump(i[3]),!B.current&&!T&&t?(z.jump(0),e(z,1,{duration:n.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,n)=>{let r=e.key===`ArrowRight`||e.key===`ArrowDown`?1:e.key===`ArrowLeft`||e.key===`ArrowUp`?-1:0;if(e.key===` `||e.key===`Enter`){e.preventDefault(),M(t[n])&&P(t[n].value);return}if(!r&&e.key!==`Home`&&e.key!==`End`)return;e.preventDefault();let i=t.length,a=r&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&getComputedStyle(e.currentTarget).direction===`rtl`?-1:1,o=e.key===`Home`?-1:e.key===`End`?i:n,s=e.key===`Home`?1:e.key===`End`?-1:r*a;for(let e=0;e<i;e++)if(o=(o+s+i)%i,M(t[o])){U()[o]?.focus(),P(t[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":c,"data-density":l,style:{"--min-column":`${u}px`,...x},...S,children:[(0,p.jsx)(s.span,{className:f.ring,style:{x:F,y:I,width:L,height:R,opacity:z},"aria-hidden":`true`}),t.map((e,t)=>{let r=t===j,i=!M(e),a=`${E}-${t}-label`,o=`${E}-${t}-description`,c=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":t,className:f.card,"aria-checked":r,"aria-disabled":i||void 0,"aria-labelledby":a,"aria-describedby":c?o:void 0,tabIndex:t===N?0:-1,"data-checked":r||void 0,onClick:()=>{i||P(e.value)},onKeyDown:e=>W(e,t),children:[w?l:(0,p.jsx)(`span`,{className:f.indicator,"aria-hidden":`true`,children:(0,p.jsx)(s.span,{className:f.indicatorDot,initial:!1,animate:{scale:+!!r},transition:T?{duration:0}:n.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})]}),c&&(0,p.jsx)(`span`,{id:o,className:f.description,children:c})]}),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
+ import{Ai as e,Ca as t,E as n,Ea as r,Mi as i,Sa as a,ji as o,ki as s,vt as c}from"./alert-BzjF81CS.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=c(l),d=r(t(),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=a(),m=[...n.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:t,value:r,defaultValue:a=null,onValueChange:o,layout:c=`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=r===void 0?O:r,j=t.findIndex(e=>e.value===A),M=e=>!y&&!e.disabled,N=j>=0&&M(t[j])?j:t.findIndex(M),P=e=>{e!==A&&(r===void 0&&k(e),o?.(e))},F=i(0),I=i(0),L=i(0),R=i(0),z=i(0),B=(0,d.useRef)(!1),V=(0,d.useCallback)(t=>{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(!t||!B.current||T){F.jump(i[0]),I.jump(i[1]),L.jump(i[2]),R.jump(i[3]),!B.current&&!T&&t?(z.jump(0),e(z,1,{duration:n.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,n)=>{let r=e.key===`ArrowRight`||e.key===`ArrowDown`?1:e.key===`ArrowLeft`||e.key===`ArrowUp`?-1:0;if(e.key===` `||e.key===`Enter`){e.preventDefault(),M(t[n])&&P(t[n].value);return}if(!r&&e.key!==`Home`&&e.key!==`End`)return;e.preventDefault();let i=t.length,a=r&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&getComputedStyle(e.currentTarget).direction===`rtl`?-1:1,o=e.key===`Home`?-1:e.key===`End`?i:n,s=e.key===`Home`?1:e.key===`End`?-1:r*a;for(let e=0;e<i;e++)if(o=(o+s+i)%i,M(t[o])){U()[o]?.focus(),P(t[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":c,"data-density":l,style:{"--min-column":`${u}px`,...x},...S,children:[(0,p.jsx)(s.span,{className:f.ring,style:{x:F,y:I,width:L,height:R,opacity:z},"aria-hidden":`true`}),t.map((e,t)=>{let r=t===j,i=!M(e),a=`${E}-${t}-label`,o=`${E}-${t}-description`,c=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":t,className:f.card,"aria-checked":r,"aria-disabled":i||void 0,"aria-labelledby":a,"aria-describedby":c?o:void 0,tabIndex:t===N?0:-1,"data-checked":r||void 0,onClick:()=>{i||P(e.value)},onKeyDown:e=>W(e,t),children:[w?l:(0,p.jsx)(`span`,{className:f.indicator,"aria-hidden":`true`,children:(0,p.jsx)(s.span,{className:f.indicatorDot,initial:!1,animate:{scale:+!!r},transition:T?{duration:0}:n.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})]}),c&&(0,p.jsx)(`span`,{id:o,className:f.description,children:c})]}),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{vt as e}from"./alert-CN1yWco4.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
+ import{vt as e}from"./alert-BzjF81CS.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{Ca as e,Ea as t,Oi as n,vt as r}from"./alert-CN1yWco4.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=t(n()),s=t(e());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:`
1
+ import{Ca as e,Ea as t,Oi as n,vt as r}from"./alert-BzjF81CS.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=t(n()),s=t(e());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.
@@ -7,9 +7,9 @@
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-CBrXkG99.js"></script>
11
- <link rel="modulepreload" crossorigin href="/assets/alert-CN1yWco4.js">
12
- <link rel="modulepreload" crossorigin href="/assets/overlays-D2pWmtov.js">
10
+ <script type="module" crossorigin src="/assets/index-D7HIE1TG.js"></script>
11
+ <link rel="modulepreload" crossorigin href="/assets/alert-BzjF81CS.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/overlays-8ByMRpma.js">
13
13
  <link rel="stylesheet" crossorigin href="/assets/alert-DwSJjne8.css">
14
14
  <link rel="stylesheet" crossorigin href="/assets/overlays-BJrN5PWt.css">
15
15
  <link rel="stylesheet" crossorigin href="/assets/index-DE_l9Wt4.css">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aidotnet/server-linux-x64",
3
- "version": "0.9.6",
3
+ "version": "0.9.8",
4
4
  "description": "Astra self-contained server binary for Linux (x64).",
5
5
  "license": "MIT",
6
6
  "os": [
@@ -1 +0,0 @@
1
- import{Ca as e,Ea as t,Gr as n,J as r,K as i,Or as a,Qt as o,Sa as s,V as c,Y as l,Z as u,Zr as d,_ as f,_r as p,br as m,c as h,d as g,l as _,li as v,n as y,nr as b,on as x,ot as S,p as C,pt as w,q as T,r as E,s as D,t as O,v as k,vt as A}from"./alert-CN1yWco4.js";import{a as j,gt as ee,i as M,n as te,o as N,r as P}from"./overlays-D2pWmtov.js";import{t as ne}from"./ellipsis-D250KISp.js";import{t as re}from"./pencil-DuD1bQje.js";import{t as F}from"./power-LE8gLJKc.js";import{t as ie}from"./rotate-ccw-Cx9vNOkF.js";import{B as I,I as L,N as R,R as z,V as ae,Y as B,_ as V,h as H,s as U,y as W}from"./index-CBrXkG99.js";import{a as oe,i as G,n as K,r as q,t as se}from"./TokenPoolEditor-7LX143SO.js";var J={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};J.node;var ce=A(J),Y=t(e(),1),X=s();function le(){let{t:e}=S(),t=n(),r=a(),i=d(),o=i.data?.state===`connected`?i.data.publicUrl:null,[s,c]=(0,Y.useState)(!1),[l,u]=(0,Y.useState)(null);return(0,X.jsxs)(H,{title:e(`nav.tokens`),subtitle:e(`tokens.subtitle`),actions:(0,X.jsx)(E,{variant:`primary`,icon:(0,X.jsx)(z,{className:`size-3.5`}),onClick:()=>c(!0),children:e(`tokens.add`)}),children:[(0,X.jsxs)(`div`,{className:`mx-auto flex max-w-[1100px] flex-col gap-4`,children:[r.data&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-1 px-1 text-[12px] text-[var(--text-secondary)]`,children:[(0,X.jsx)(`p`,{children:e(`tokens.directHint`,{url:`${r.data.gatewayBaseUrl}/v1`})}),(0,X.jsx)(`p`,{className:`selectable`,children:e(`tokens.selfServiceHint`,{url:r.data.gatewayBaseUrl})}),o&&(0,X.jsx)(`p`,{className:`selectable text-[var(--accent)]`,children:e(`tokens.remoteHint`,{url:`${o}/v1`,key:`${o}/key`})})]}),t.isLoading&&(0,X.jsx)(k,{lines:4}),t.isError&&(0,X.jsx)(O,{tone:`danger`,title:e(`common.error`),children:j(t.error)}),t.data?.length===0&&(0,X.jsx)(`div`,{className:`card`,children:(0,X.jsx)(h,{icon:(0,X.jsx)(I,{className:`size-6`}),title:e(`tokens.empty`)})}),t.data&&t.data.length>0&&(0,X.jsx)(`div`,{className:`card divide-y divide-[var(--border-subtle)] overflow-hidden p-0`,children:t.data.map(e=>(0,X.jsx)(ue,{token:e,defaultOpen:t.data.length===1,onEdit:()=>u(e)},e.id))})]}),(0,X.jsx)(he,{open:s,onOpenChange:c}),(0,X.jsx)(ge,{token:l,onClose:()=>u(null)})]})}function ue({token:e,defaultOpen:t,onEdit:n}){let{t:i,locale:a}=S(),{toast:o,confirm:s}=N(),l=b(),d=m(),f=v(),h=p(),g=x(),[_,C]=(0,Y.useState)(t),O=(l.data??[]).find(t=>t.id===e.providerId),k=oe(),A=`token-detail-${e.id}`,M=(e,t)=>{o(t,`success`),e.skipped.length>0&&o(i(`tokens.skipped`,{clients:e.skipped.map(e=>V[e]?.name??e).join(`, `)}),`error`)},P=()=>d.mutate(e.id,{onSuccess:async({token:e})=>{await ee.copy(e)&&o(i(`tokens.copied`))},onError:e=>o(j(e),`error`)}),I=async()=>{(!e.enabled||await s({title:i(`tokens.disableConfirm`,{name:e.name}),detail:i(`tokens.disableDetail`),confirmLabel:i(`tokens.disable`),destructive:!0}))&&f.mutate({id:e.id,enabled:!e.enabled},{onError:e=>o(j(e),`error`)})},z=async()=>{await s({title:i(`tokens.resetConfirm`,{name:e.name}),detail:i(`tokens.resetDetail`),confirmLabel:i(`tokens.reset`),destructive:!0})&&h.mutate(e.id,{onSuccess:e=>M(e,i(`tokens.resetDone`,{count:e.rewritten.length})),onError:e=>o(j(e),`error`)})},H=async()=>{await s({title:i(`tokens.deleteConfirm`,{name:e.name}),detail:i(`tokens.deleteDetail`),confirmLabel:i(`common.delete`),destructive:!0})&&g.mutate(e.id,{onSuccess:t=>M(t,i(`tokens.deleted`,{name:e.name})),onError:e=>o(j(e),`error`)})},U=e.lastUsedAt?c(e.lastUsedAt,a):i(`tokens.neverUsed`);return(0,X.jsxs)(`article`,{children:[(0,X.jsxs)(`div`,{className:`flex cursor-pointer flex-wrap items-center gap-x-5 gap-y-2 px-4 py-3 hover:bg-[var(--surface-muted)]`,onClick:()=>C(e=>!e),children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 basis-56 items-start gap-2`,children:[(0,X.jsx)(`button`,{type:`button`,className:`mt-0.5 rounded text-[var(--text-muted)]`,"aria-expanded":_,"aria-controls":A,"aria-label":i(`tokens.details`),onClick:e=>{e.stopPropagation(),C(e=>!e)},children:(0,X.jsx)(ae,{className:`size-4 transition-transform ${_?`rotate-90`:``}`})}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(`h2`,{className:`truncate text-[14px] font-medium ${e.enabled?``:`text-[var(--text-muted)]`}`,children:e.name}),e.isDefault&&(0,X.jsx)(y,{tone:`accent`,children:i(`tokens.default`)}),!e.enabled&&(0,X.jsx)(y,{tone:`orange`,children:i(`tokens.disabledBadge`)}),e.limitUsage.some(e=>e.exhausted)&&(0,X.jsx)(y,{tone:`orange`,children:i(`tokens.limitExhausted`)}),e.pool&&(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:e.pool.members.map(e=>e.providerId).join(`, `),children:[(0,X.jsx)(y,{children:i(`tokens.pool.summary`,{count:e.pool.members.length,strategy:i(`tokens.strategy.${e.pool.strategy}`)})}),e.pool.members.map(e=>(0,X.jsx)(D,{tone:K(e.health.state)},e.providerId))]})]}),(0,X.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1`,onClick:e=>e.stopPropagation(),children:[(0,X.jsx)(`code`,{className:`font-mono text-[12px] text-[var(--text-secondary)] selectable`,children:e.keyMasked}),(0,X.jsx)(E,{size:`sm`,variant:`plain`,icon:(0,X.jsx)(w,{className:`size-3.5`}),"aria-label":i(`tokens.copy`),title:i(`tokens.copy`),loading:d.isPending,onClick:P})]})]})]}),(0,X.jsx)(`div`,{className:`hidden w-16 items-center gap-1.5 md:flex`,title:e.clients.map(e=>V[e]?.name??e).join(`, `)||i(`tokens.noClients`),children:e.clients.length===0?(0,X.jsx)(`span`,{className:`text-[12px] text-[var(--text-muted)]`,children:`—`}):e.clients.map(e=>(0,X.jsx)(W,{kind:e,size:16},e))}),(0,X.jsx)(Z,{label:i(`tokens.today`),value:u(e.today.costUsd),context:i(`tokens.requestsContext`,{count:r(e.today.requests)})}),(0,X.jsx)(Z,{label:i(`tokens.total`),value:u(e.total.costUsd),context:`${r(e.total.totalTokens,!0)} Token`}),(0,X.jsx)(Z,{label:i(`tokens.lastUsedTitle`),value:e.lastUsedAt?T(e.lastUsedAt,a):`—`,context:e.lastUsedAt?``:i(`tokens.neverUsed`),title:U}),(0,X.jsx)(`div`,{onClick:e=>e.stopPropagation(),children:(0,X.jsx)(te,{label:i(`common.more`),icon:(0,X.jsx)(ne,{className:`size-4`}),items:[{id:`settings`,label:i(`tokens.settings`),icon:(0,X.jsx)(re,{className:`size-3.5`}),onSelect:n},{id:`toggle`,label:e.enabled?i(`tokens.disable`):i(`tokens.enable`),icon:(0,X.jsx)(F,{className:`size-3.5`}),onSelect:()=>void I()},{id:`reset`,label:i(`tokens.reset`),icon:(0,X.jsx)(ie,{className:`size-3.5`}),onSelect:()=>void z()},...e.isDefault?[]:[{id:`delete`,label:i(`tokens.delete`),icon:(0,X.jsx)(R,{className:`size-3.5`}),destructive:!0,separatorBefore:!0,onSelect:()=>void H()}]]})})]}),_&&(0,X.jsxs)(`div`,{id:A,className:`border-t border-[var(--border-subtle)] bg-[var(--surface-muted)] px-4 py-3 md:pl-10`,children:[(0,X.jsxs)(`dl`,{className:`flex flex-wrap gap-x-8 gap-y-2 text-[12px]`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`dt`,{className:`text-[var(--text-muted)]`,children:i(`tokens.clients`)}),(0,X.jsx)(`dd`,{className:`mt-0.5 flex min-h-5 flex-wrap items-center gap-x-3 gap-y-1 text-[var(--text-secondary)]`,children:e.clients.length===0?i(`tokens.noClients`):e.clients.map(e=>(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,X.jsx)(W,{kind:e,size:14}),V[e]?.name??e]},e))})]}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`dt`,{className:`text-[var(--text-muted)]`,children:e.pool?i(`tokens.pool.title`):i(`tokens.directProvider`)}),e.pool?(0,X.jsx)(`dd`,{className:`mt-0.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[var(--text-secondary)]`,children:e.pool.members.map(e=>(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:k(e.health),children:[(0,X.jsx)(D,{tone:K(e.health.state)}),(l.data??[]).find(t=>t.id===e.providerId)?.name??e.providerId]},e.providerId))}):(0,X.jsx)(`dd`,{className:`mt-0.5 truncate text-[var(--text-secondary)]`,children:O?.name??(e.providerId?e.providerId:i(`tokens.directNone`))})]}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`dt`,{className:`text-[var(--text-muted)]`,children:i(`tokens.allowedClients`)}),(0,X.jsx)(`dd`,{className:`mt-0.5 truncate text-[var(--text-secondary)]`,children:e.allowedClients==null?i(`tokens.allowedClientsAny`):e.allowedClients.length===0?i(`tokens.directOnly`):e.allowedClients.map(e=>V[e]?.name??e).join(`, `)})]}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`dt`,{className:`text-[var(--text-muted)]`,children:i(`tokens.lastUsedTitle`)}),(0,X.jsx)(`dd`,{className:`mt-0.5 truncate text-[var(--text-secondary)]`,children:U})]})]}),(0,X.jsx)(de,{token:e}),(0,X.jsx)(pe,{today:e.today,total:e.total}),(0,X.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,X.jsx)(B,{to:`/tokens/${encodeURIComponent(e.id)}`,children:(0,X.jsx)(E,{size:`sm`,icon:(0,X.jsx)(ce,{className:`size-3.5`}),children:i(`tokens.detail.open`)})}),(0,X.jsx)(B,{to:`/requests?token=${encodeURIComponent(e.id)}`,children:(0,X.jsx)(E,{size:`sm`,icon:(0,X.jsx)(L,{className:`size-3.5`}),children:i(`tokens.detail.viewLogs`)})})]})]})]})}function de({token:e}){let{t}=S(),n=e.limits?.rpm;return(0,X.jsxs)(`div`,{className:`mt-3`,children:[(0,X.jsx)(`div`,{className:`text-[12px] text-[var(--text-muted)]`,children:t(`tokens.limits`)}),e.limitUsage.length===0&&n==null?(0,X.jsx)(`div`,{className:`mt-0.5 text-[12px] text-[var(--text-secondary)]`,children:t(`tokens.unlimited`)}):(0,X.jsxs)(`div`,{className:`mt-1.5 grid gap-3 sm:grid-cols-2`,children:[e.limitUsage.map(e=>(0,X.jsx)(fe,{usage:e},`${e.metric}:${e.period}`)),n!=null&&(0,X.jsxs)(`div`,{className:`text-[11.5px] text-[var(--text-secondary)]`,children:[t(`tokens.rpm`),` · `,(0,X.jsx)(`span`,{className:`num`,children:t(`tokens.rpmUsage`,{used:e.recentRequests,limit:n})})]})]})]})}function fe({usage:e}){let{t,locale:n}=S(),i=`${t(`tokens.period.${e.period}`)} · ${t(`tokens.metric.${e.metric}`)}`,a=t=>e.metric===`cost`?u(t):r(t,!0),o=Math.max(0,Math.min(100,Math.round(e.usedPercent))),s=o>=90?`var(--danger)`:o>=70?`var(--warning)`:`var(--accent)`;return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{className:`mb-1 flex items-baseline justify-between gap-2 text-[11.5px]`,children:[(0,X.jsx)(`span`,{className:`text-[var(--text-secondary)]`,children:i}),(0,X.jsx)(`span`,{className:`num`,children:t(`tokens.limitUsed`,{used:a(e.used),limit:a(e.limit)})})]}),(0,X.jsx)(`div`,{role:`progressbar`,"aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i,className:`h-1.5 w-full overflow-hidden rounded-full bg-[var(--surface)]`,children:(0,X.jsx)(`div`,{className:`h-full rounded-full`,style:{width:`${o}%`,background:s}})}),e.resetsAt&&(0,X.jsx)(`div`,{className:`mt-1 text-[10.5px] text-[var(--text-muted)]`,children:t(`tokens.limitResets`,{time:c(e.resetsAt,n)})})]})}function Z({label:e,value:t,context:n,title:r}){return(0,X.jsxs)(`div`,{className:`w-24 min-w-0`,title:r,children:[(0,X.jsx)(`div`,{className:`truncate text-[11px] text-[var(--text-muted)]`,children:e}),(0,X.jsx)(`div`,{className:`num truncate text-[14px] leading-tight font-semibold`,children:t}),(0,X.jsx)(`div`,{className:`truncate text-[11px] text-[var(--text-muted)]`,children:n||`\xA0`})]})}function pe({today:e,total:t}){let{t:n}=S(),a=[[n(`tokens.today`),e],[n(`tokens.total`),t]],o=`px-3 py-1.5 text-right font-normal whitespace-nowrap text-[var(--text-muted)]`,s=`num px-3 py-1.5 text-right whitespace-nowrap`;return(0,X.jsx)(`div`,{className:`mt-3 overflow-x-auto rounded-[var(--radius-control)] bg-[var(--surface)]`,children:(0,X.jsxs)(`table`,{className:`w-full text-[12px]`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{className:`border-b border-[var(--border-subtle)]`,children:[(0,X.jsx)(`th`,{className:`${o} text-left`}),(0,X.jsx)(`th`,{className:o,children:n(`tokens.cost`)}),(0,X.jsx)(`th`,{className:o,children:n(`tokens.requests`)}),(0,X.jsx)(`th`,{className:o,children:n(`tokens.tokens`)}),(0,X.jsx)(`th`,{className:o,children:n(`tokens.inOut`)}),(0,X.jsx)(`th`,{className:o,children:n(`tokens.cacheHit`)}),(0,X.jsx)(`th`,{className:o,title:n(`tokens.tpsContext`),children:n(`tokens.tps`)})]})}),(0,X.jsx)(`tbody`,{children:a.map(([e,t])=>(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{scope:`row`,className:`px-3 py-1.5 text-left font-medium whitespace-nowrap text-[var(--text-secondary)]`,children:e}),(0,X.jsx)(`td`,{className:`${s} font-semibold selectable`,children:u(t.costUsd)}),(0,X.jsx)(`td`,{className:s,children:r(t.requests)}),(0,X.jsx)(`td`,{className:s,children:r(t.totalTokens,!0)}),(0,X.jsxs)(`td`,{className:`${s} text-[var(--text-secondary)]`,children:[r(t.inputTokens,!0),` / `,r(t.outputTokens,!0)]}),(0,X.jsx)(`td`,{className:s,title:n(`usage.cacheAmounts`,{read:r(t.cacheReadTokens,!0),write:r(t.cacheWriteTokens,!0)}),children:t.cacheHitRate==null?`—`:i(t.cacheHitRate)}),(0,X.jsx)(`td`,{className:s,children:t.tps==null?`—`:l(t.tps)})]},e))})]})})}function me(){let{t:e}=S(),t=(b().data??[]).filter(e=>e.enabled);return{providers:t,options:[{value:``,label:e(`tokens.directNone`)},...t.map(e=>({value:e.id,label:e.name}))]}}function he({open:e,onOpenChange:t}){let{t:n}=S(),{toast:r}=N(),i=o(),{options:a}=me(),[s,c]=(0,Y.useState)(``),[l,u]=(0,Y.useState)(``);return(0,Y.useEffect)(()=>{e&&(c(``),u(``))},[e]),(0,X.jsx)(M,{open:e,onOpenChange:t,title:n(`tokens.createTitle`),footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(E,{onClick:()=>t(!1),children:n(`common.cancel`)}),(0,X.jsx)(E,{variant:`primary`,disabled:!s.trim(),loading:i.isPending,onClick:()=>i.mutate({name:s.trim(),providerId:l||null},{onSuccess:e=>{t(!1),r(n(`tokens.created`,{name:e.name}),`success`)},onError:e=>r(j(e),`error`)}),children:n(`common.create`)})]}),children:(0,X.jsxs)(`div`,{className:`grid gap-4`,children:[(0,X.jsx)(_,{label:n(`tokens.name`),children:(0,X.jsx)(g,{value:s,maxLength:64,placeholder:n(`tokens.namePlaceholder`),onChange:e=>c(e.target.value)})}),(0,X.jsx)(_,{label:n(`tokens.directProvider`),children:(0,X.jsx)(P,{value:l,onChange:u,options:a})})]})})}function ge({token:e,onClose:t}){let{t:n}=S(),{toast:r}=N(),i=v(),a=b(),[o,s]=(0,Y.useState)(``),[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)([]),[p,m]=(0,Y.useState)(null),[h,y]=(0,Y.useState)(`any`),[x,w]=(0,Y.useState)([]),T=new Set(u.map(e=>`${e.metric}:${e.period}`)).size<u.length,D=new Map((e?.pool?.members??[]).map(e=>[e.providerId,e.health]));return(0,Y.useEffect)(()=>{e&&(s(e.name),l(q(e)),d(e.limits?.budgets.map(e=>({...e}))??[]),m(e.limits?.rpm??null),y(e.allowedClients==null?`any`:`only`),w(e.allowedClients??[]))},[e]),(0,X.jsx)(M,{open:e!==null,onOpenChange:e=>!e&&t(),title:n(`tokens.settingsTitle`,{name:e?.name??``}),footer:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(E,{onClick:t,children:n(`common.cancel`)}),(0,X.jsx)(E,{variant:`primary`,disabled:!o.trim()||T,loading:i.isPending,onClick:()=>{if(!e)return;let s=u.flatMap(e=>e.limit!=null&&e.limit>0?[{...e,limit:e.limit}]:[]),l=s.length>0||p!=null&&p>0?{budgets:s,rpm:p!=null&&p>0?Math.floor(p):null}:null;i.mutate({id:e.id,name:o.trim(),...c?{pool:G(c,a.data??[])}:{},limits:l,allowedClients:h===`any`?null:x},{onSuccess:()=>{t(),r(n(`common.saved`),`success`)},onError:e=>r(j(e),`error`)})},children:n(`common.save`)})]}),children:(0,X.jsxs)(`div`,{className:`grid gap-4`,children:[(0,X.jsx)(_,{label:n(`tokens.name`),children:(0,X.jsx)(g,{value:o,maxLength:64,onChange:e=>s(e.target.value)})}),(0,X.jsx)(_,{label:n(`tokens.pool.title`),hint:n(`tokens.pool.hint`),children:c&&(0,X.jsx)(se,{draft:c,onChange:l,providers:a.data??[],health:D})}),(0,X.jsx)(_,{label:n(`tokens.limits`),hint:n(`tokens.limitsHint`),error:T?n(`tokens.limitDuplicate`):void 0,children:(0,X.jsx)(_e,{budgets:u,onChange:d})}),(0,X.jsx)(_,{label:n(`tokens.rpm`),hint:n(`tokens.rpmHint`),children:(0,X.jsx)(C,{value:p,min:1,step:1,label:n(`tokens.rpm`),placeholder:n(`tokens.unlimited`),onChange:m})}),(0,X.jsx)(_,{label:n(`tokens.allowedClients`),hint:n(`tokens.allowedClientsHint`),children:(0,X.jsxs)(`div`,{className:`grid gap-2`,children:[(0,X.jsx)(f,{ariaLabel:n(`tokens.allowedClients`),value:h,onChange:y,items:[{value:`any`,label:n(`tokens.allowedClientsAny`)},{value:`only`,label:n(`tokens.allowedClientsOnly`)}]}),h===`only`&&(0,X.jsx)(U,{label:n(`tokens.allowedClients`),options:[...new Set([...Object.keys(V),...x])].map(e=>({value:e,label:V[e]?.name??e})),value:x,onValueChange:e=>w(e)})]})})]})})}var Q=[`cost`,`requests`,`tokens`],$=[`day`,`week`,`month`,`total`];function _e({budgets:e,onChange:t}){let{t:n}=S(),r=(n,r)=>t(e.map((e,t)=>t===n?{...e,...r}:e)),i=Q.flatMap(e=>$.map(t=>({metric:e,period:t}))).find(t=>!e.some(e=>e.metric===t.metric&&e.period===t.period));return(0,X.jsxs)(`div`,{className:`grid gap-2`,children:[e.length===0&&(0,X.jsx)(`div`,{className:`text-[12px] text-[var(--text-muted)]`,children:n(`tokens.unlimited`)}),e.map((i,a)=>(0,X.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-2`,children:[(0,X.jsx)(P,{ariaLabel:n(`tokens.limitMetric`),value:i.metric,onChange:e=>r(a,{metric:e}),options:Q.map(e=>({value:e,label:n(`tokens.metric.${e}`)}))}),(0,X.jsx)(P,{ariaLabel:n(`tokens.limitPeriod`),value:i.period,onChange:e=>r(a,{period:e}),options:$.map(e=>({value:e,label:n(`tokens.period.${e}`)}))}),(0,X.jsx)(C,{label:n(`tokens.limitValue`),value:i.limit,min:0,step:i.metric===`cost`?`any`:1,placeholder:n(`tokens.limitValue`),onChange:e=>r(a,{limit:e})}),(0,X.jsx)(E,{size:`sm`,variant:`plain`,icon:(0,X.jsx)(R,{className:`size-3.5`}),"aria-label":n(`tokens.removeLimit`),title:n(`tokens.removeLimit`),onClick:()=>t(e.filter((e,t)=>t!==a))})]},a)),i&&(0,X.jsx)(`div`,{children:(0,X.jsx)(E,{size:`sm`,icon:(0,X.jsx)(z,{className:`size-3.5`}),onClick:()=>t([...e,{...i,limit:null}]),children:n(`tokens.addLimit`)})})]})}export{le as TokensPage};
@@ -1 +0,0 @@
1
- import{vt as e}from"./alert-CN1yWco4.js";var t={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};t.node;var n=e(t);export{n as t};