@aidotnet/server-darwin-arm64 0.14.1 → 0.14.3100

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 (50) hide show
  1. package/bin/astra-server +2 -2
  2. package/bin/wwwroot/assets/{ClientsPage-Bbx4JQCh.js → ClientsPage-GKLy8gVJ.js} +5 -5
  3. package/bin/wwwroot/assets/{KeyPage-EhvcnnPs.js → KeyPage-BbUpGlKO.js} +1 -1
  4. package/bin/wwwroot/assets/{ModelDetailPage-Bi6HMYd9.js → ModelDetailPage-BlmQDuE3.js} +1 -1
  5. package/bin/wwwroot/assets/{ModelsPage-BXY68Eiv.js → ModelsPage-Ckhg7YdH.js} +1 -1
  6. package/bin/wwwroot/assets/{PluginsPage-CGYvvJ4L.js → PluginsPage-Dwqhs5tw.js} +1 -1
  7. package/bin/wwwroot/assets/{PrivacyPage-DsoFM60K.js → PrivacyPage-CJ5wbjXl.js} +1 -1
  8. package/bin/wwwroot/assets/ProviderDetailPage-Dxu9JADF.js +3 -0
  9. package/bin/wwwroot/assets/ProvidersPage-B7az1p0j.js +3 -0
  10. package/bin/wwwroot/assets/ProvidersPage-DgrV1SvU.css +1 -0
  11. package/bin/wwwroot/assets/SettingsPage-Dm7rhdEx.js +2 -0
  12. package/bin/wwwroot/assets/{SmartRoutingPage-7EE9Wv4s.js → SmartRoutingPage-Dww5ODy8.js} +1 -1
  13. package/bin/wwwroot/assets/TokenDetailPage-bcWwe6SL.js +1 -0
  14. package/bin/wwwroot/assets/{TokenPoolEditor-P5q4QPdp.js → TokenPoolEditor-DBLRdef1.js} +1 -1
  15. package/bin/wwwroot/assets/TokensPage-DCaUOp7X.js +1 -0
  16. package/bin/wwwroot/assets/{TracesPage-Cjalyj5v.js → TracesPage-CM7kpC2L.js} +1 -1
  17. package/bin/wwwroot/assets/{TrayPanelPage-DpXBU7l9.js → TrayPanelPage-Dxk8NHwD.js} +1 -1
  18. package/bin/wwwroot/assets/{TrayPanelView-B2Bc2IHk.js → TrayPanelView-BZQT4C-p.js} +1 -1
  19. package/bin/wwwroot/assets/{alert-Clz2DftU.js → alert-0ugPccg1.js} +2 -2
  20. package/bin/wwwroot/assets/{arrow-down-D4v2aNc0.js → arrow-down-BzJcdsh0.js} +1 -1
  21. package/bin/wwwroot/assets/{arrow-left-B41OJQ5k.js → arrow-left-CvdkAxjP.js} +1 -1
  22. package/bin/wwwroot/assets/{arrow-up-right-Bl1glSI-.js → arrow-up-right-DEmTMRN5.js} +1 -1
  23. package/bin/wwwroot/assets/chart-column-4_Hcd7LI.js +1 -0
  24. package/bin/wwwroot/assets/{checkbox-B4uUeJZd.js → checkbox-DAvFpCMa.js} +1 -1
  25. package/bin/wwwroot/assets/{cloud-download-BZA23qWN.js → cloud-download-D0cpRWOi.js} +1 -1
  26. package/bin/wwwroot/assets/{confirm-morph-BHc1Rk5D.js → confirm-morph-Df4YMElg.js} +1 -1
  27. package/bin/wwwroot/assets/{download-1kPyvAIz.js → download-DZCHLDt2.js} +1 -1
  28. package/bin/wwwroot/assets/{ellipsis-Dzh8eeEb.js → ellipsis-CdooFypb.js} +1 -1
  29. package/bin/wwwroot/assets/{external-link-CP_HY9s9.js → external-link-CS7Gd3Z_.js} +1 -1
  30. package/bin/wwwroot/assets/{folder-open-gI3OxPvC.js → folder-open-BZjDCbYy.js} +1 -1
  31. package/bin/wwwroot/assets/{index-LdSd2gU7.js → index-COgqKK9s.js} +8 -8
  32. package/bin/wwwroot/assets/{index-DUNJByVq.css → index-CpGX4nAj.css} +1 -1
  33. package/bin/wwwroot/assets/{log-out-CLSeCkdA.js → log-out-DVIVn0JF.js} +1 -1
  34. package/bin/wwwroot/assets/minus-P2gia-qN.js +1 -0
  35. package/bin/wwwroot/assets/overlays-Dd-xCJQp.js +41 -0
  36. package/bin/wwwroot/assets/{pencil-C4YX2See.js → pencil-BbgAhLbU.js} +1 -1
  37. package/bin/wwwroot/assets/{power-CmBUImgB.js → power-CYbRvApU.js} +1 -1
  38. package/bin/wwwroot/assets/{radio-cards-B0VL-JIL.js → radio-cards-C2kL9-Ki.js} +1 -1
  39. package/bin/wwwroot/assets/{rotate-ccw-ClcBYxmg.js → rotate-ccw-CIB2qh-N.js} +1 -1
  40. package/bin/wwwroot/assets/{sortable.esm-DLqkwcx8.js → sortable.esm-BXvWgOQ9.js} +1 -1
  41. package/bin/wwwroot/index.html +4 -4
  42. package/package.json +1 -1
  43. package/bin/wwwroot/assets/ProviderDetailPage-DggKqw4-.js +0 -3
  44. package/bin/wwwroot/assets/ProvidersPage-B19CIw-g.css +0 -1
  45. package/bin/wwwroot/assets/ProvidersPage-BiX8gU3n.js +0 -2
  46. package/bin/wwwroot/assets/SettingsPage-Cg3fYnlZ.js +0 -2
  47. package/bin/wwwroot/assets/TokenDetailPage-BGBhv8pL.js +0 -1
  48. package/bin/wwwroot/assets/TokensPage-C85gZule.js +0 -1
  49. package/bin/wwwroot/assets/minus-CXBFbKrB.js +0 -1
  50. package/bin/wwwroot/assets/overlays-UV1fYmtB.js +0 -41
@@ -1,41 +0,0 @@
1
- import{A as e,Ba as t,C as n,Ca as r,D as i,E as a,Et as o,F as s,Fa as c,Fi as l,Gi as u,I as d,Ii as f,Ji as p,Ki as m,M as h,N as g,Na as _,Ni as v,O as y,P as b,Q as x,Qi as S,R as C,Ra as w,S as T,Ta as E,Ua as D,Y as O,Yi as k,Zi as A,_a as j,ba as M,bt as N,ct as P,da as F,dt as I,fa as L,ga as R,ha as z,j as B,ja as ee,k as V,la as te,lt as ne,ma as re,ot as ie,pa as ae,pt as oe,qi as se,r as ce,t as le,ua as ue,va as de,xn as fe,xt as pe,yt as me,z as he,za as ge,zi as H}from"./alert-Clz2DftU.js";function _e(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var ve=class extends E{#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,r.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||!c(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=_(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 M(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)&&r.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},U=D(t(),1);function ye({queries:e,...t},n){let i=w(n),a=de(),o=j(),s=t.subscribed!==!1,c=U.useMemo(()=>e.map(e=>{let t=i.defaultQueryOptions(e);return t._optimisticResults=a?`isRestoring`:s?`optimistic`:void 0,t}),[e,i,a,s]);c.forEach(e=>{F(e);let t=i.getQueryCache().get(e.queryHash);re(e,o,t)}),R(o);let[l]=U.useState(()=>new ve(i,c,t)),[u,d,f]=l.getOptimisticResult(c,t.combine),p=!a&&s;U.useSyncExternalStore(U.useCallback(e=>p?l.subscribe(r.batchCalls(e)):ee,[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),U.useEffect(()=>{l.setQueries(c,t)},[c,t,l]);let m=u.some((e,t)=>ae(c[t],e))?u.flatMap((e,t)=>{let n=c[t];if(n&&ae(n,e)){let e=new M(i,n);return L(n,e,o)}return[]}):[];if(m.length>0)throw Promise.all(m);let h=u.find((e,t)=>{let n=c[t];return n&&z({result:e,errorResetBoundary:o,throwOnError:n.throwOnError,query:i.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(h)throw h.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:!!H(),async openPath(e){let t=H();return t?t.openPath(e):!1},async revealLogs(){return await H()?.revealLogs()??!1},async copy(e){if(window.isSecureContext&&navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}return Ee(e)},async contextMenu(e){let t=H();if(t)return t.showContextMenu(e)},async startService(){let e=H();return e?e.startService():null},async restartService(){let e=H();return e?e.restartService():null}};function 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)}`:x(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=O(i.requests,!0);return{title:e,detail:n.requests(e)}}case`tokens`:{let e=O(i.inputTokens+i.outputTokens,!0);return{title:e,detail:n.tokens(e)}}case`cost`:{let e=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=()=>!!H()?.tray;function vt(){let[e,t]=(0,U.useState)(gt),[n,r]=(0,U.useState)(!H()?.tray);return(0,U.useEffect)(()=>{let e=H()?.tray;if(!e)return;let n=!0;e.getPrefs().then(e=>{n&&(t(e),r(!0))});let i=e.onPrefsChanged(t);return()=>{n=!1,i()}},[]),[e,(0,U.useCallback)(e=>{t(e);let n=H()?.tray;n&&n.setPrefs(e).then(t)},[]),n]}function yt(){let e=fe(),[t,n]=(0,U.useState)(null);return(0,U.useEffect)(()=>{let e=H()?.tray;if(!e)return;let t=!0;e.getState().then(e=>{t&&n(e)});let r=e.onStateChanged(n);return()=>{t=!1,r()}},[]),t??{running:e.isSuccess,port:null,activity:null,apiVersionMismatch:!1,updateAvailable:null}}function bt(e,t,n){return{...e,sections:{...e.sections,[t]:n}}}var xt=3e5,St=new Map,Ct=()=>-new Date().getTimezoneOffset(),wt=Object.fromEntries(f.map(e=>[e,!1]));function Tt(e,t){let n=w(),{enabled:r,background:i}=t,a=t.titleOnly?wt:e.sections,s=e.title!==`none`&&e.title!==`quota`,c=e.title===`quota`||e.title===`alerts`,u={refetchInterval:15e3,refetchIntervalInBackground:!1},d=a.quota||c,f=ue({queryKey:o.settings,queryFn:()=>v(`GET`,`/api/settings`),enabled:r}),p=ue({queryKey:o.stats(`summary`,`today`,``,``),queryFn:()=>v(`GET`,`/api/stats/summary?range=today`),enabled:r,...u,refetchIntervalInBackground:i&&s}),m=ue({queryKey:o.stats(`timeseries`,`today`,`hour`,`provider`,``,``,Ct()),queryFn:()=>v(`GET`,`/api/stats/timeseries?range=today&groupBy=hour&by=provider&tzOffset=${Ct()}`),enabled:r&&a.chart,...u,refetchInterval:3e4}),h=ue({queryKey:o.stats(`timeseries`,`7d`,`day`,`provider`,``,``,Ct()),queryFn:()=>v(`GET`,`/api/stats/timeseries?range=7d&groupBy=day&by=provider&tzOffset=${Ct()}`),enabled:r&&a.compareYesterday,...u,refetchInterval:6e4}),g=ue({queryKey:o.stats(`top`,`today`,``,3,``),queryFn:()=>v(`GET`,`/api/stats/top-models?range=today&limit=3`),enabled:r&&a.topModel,...u,refetchInterval:3e4}),_=ue({queryKey:o.providers,queryFn:()=>v(`GET`,`/api/providers`),enabled:r&&(d||a.clients),...u,refetchInterval:6e4,refetchIntervalInBackground:i&&c}),y=ue({queryKey:o.clients,queryFn:()=>v(`GET`,`/api/clients`),enabled:r&&a.clients,...u,refetchInterval:3e4}),b=(0,U.useMemo)(()=>(_.data??[]).filter(e=>e.enabled&&e.authScheme===`oauth-subscription`),[_.data]),x=ye({queries:b.map(e=>({queryKey:o.providerAccounts(e.id),queryFn:()=>v(`GET`,`/api/providers/${l(e.id)}/accounts`),enabled:r&&d,...u,refetchInterval:6e4,refetchIntervalInBackground:i&&c}))}),S=b.flatMap((e,t)=>(x[t]?.data??[]).map(t=>({provider:e,account:t}))),C=S.map(e=>`${e.account.id}:${e.account.status}:${e.account.quota?.fetchedAtUtc??``}`).join(`|`),T=te({mutationFn:e=>v(`POST`,`/api/provider-accounts/${l(e)}/quota`),onSettled:e=>{e&&n.invalidateQueries({queryKey:o.providerAccounts(e.providerId)})}}),E=r&&d&&(t.live||e.title===`quota`||e.title===`alerts`);(0,U.useEffect)(()=>{if(!E)return;let e=Date.now();for(let{account:t}of S){if(t.status!==`active`)continue;let n=t.quota?.fetchedAtUtc?new Date(t.quota.fetchedAtUtc).getTime():0;Number.isFinite(n)&&e-n<xt||e-(St.get(t.id)??0)<xt||(St.set(t.id,e),T.mutate(t.id,{onError:()=>{}}))}},[E,C]);let D=[...st(S),...ct(_.data??[])];return{settings:f.data,summary:p.data,hourly:m.data??[],daily:h.data??[],top:g.data??[],plans:D,hasSubscriptions:S.some(e=>e.account.status===`active`),clients:y.data??[],providers:_.data??[],updatedAt:p.dataUpdatedAt,loading:p.isLoading,error:p.isError}}function Et(e,t,n,r){let{t:i,locale:a}=P(),o=H(),s=(0,U.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,U.useEffect)(()=>{o?.tray.setTitle(c.title,c.detail)},[o,c.title,c.detail])}function Dt(){let[e]=vt(),t=yt(),n=Tt(e,{enabled:t.running,background:!0,live:!1,titleOnly:!0});return Et(e,t,n.summary,n.plans),null}var W={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`},G=ge();function Ot({children:e,reduceMotion:t}){let n=(0,U.useRef)(null),[r,i]=(0,U.useState)(`auto`);return(0,U.useEffect)(()=>{let e=n.current;if(!e)return;let t=new ResizeObserver(()=>i(e.offsetHeight));return t.observe(e),()=>t.disconnect()},[]),(0,G.jsx)(m.div,{className:W.autoHeight,initial:!1,animate:{height:r},transition:t?{duration:0}:a.spring.smooth,children:(0,G.jsx)(`div`,{ref:n,children:e})})}var kt=(0,U.forwardRef)(function({label:e,options:t,value:n,defaultValue:r=``,onValueChange:i,description:o,placeholder:s=`Search or select…`,emptyMessage:c=`No matches found`,id:l,className:u,disabled:d,onFocus:f,...h},g){let _=(0,U.useId)(),v=l??_,y=`${v}-listbox`,b=o?`${v}-description`:void 0,x=(0,U.useRef)(null),S=(0,U.useRef)(null),C=(0,U.useRef)({}),w=p(),[T,E]=(0,U.useState)(r),[D,O]=(0,U.useState)(!1),[k,j]=(0,U.useState)(``),[M,P]=(0,U.useState)(-1),F=n??T,L=t.find(e=>e.value===F);(0,U.useImperativeHandle)(g,()=>S.current);let R=(0,U.useRef)(F);(0,U.useEffect)(()=>{if(R.current===F)return;R.current=F;let e=S.current;if(!e||w||F&&D)return;let t=F?se(e,{opacity:[0,1],y:[`0.35em`,`0em`],filter:[`blur(${a.blur.soft}px)`,`blur(0px)`]},{duration:a.duration.standard,ease:[...a.ease.enter]}):se(e,{opacity:[0,1]},{duration:a.duration.fast,ease:[...a.ease.enter]});return()=>t.complete()},[F,w,D]);let z=(0,U.useMemo)(()=>{let e=k.trim().toLocaleLowerCase();return e?t.filter(t=>[t.label,...t.keywords??[]].some(t=>t.toLocaleLowerCase().includes(e))):t},[t,k]),B=z.reduce((e,t,n)=>(t.disabled||e.push(n),e),[]);(0,U.useEffect)(()=>{if(!D)return;let e=M>=0?z[M]: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)}},[M,z,D]),(0,U.useEffect)(()=>{let e=e=>{x.current&&!x.current.contains(e.target)&&(O(!1),j(``))};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[]);let ee=e=>{e.disabled||(E(e.value),i?.(e.value),j(``),O(!1),S.current?.focus())},V=e=>{e.preventDefault(),E(``),i?.(``),j(``),O(!0),S.current?.focus()},te=()=>{d||(O(!0),j(``),P(-1))},ne=e=>{if(!d){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),!D){te();return}if(!B.length)return;let t=B.indexOf(M),n=e.key===`ArrowDown`?(t+1)%B.length:(t-1+B.length)%B.length;P(B[n]);return}if(e.key===`Enter`&&D&&M>=0){e.preventDefault();let t=z[M];t&&ee(t);return}if(e.key===`Escape`&&D){e.preventDefault(),O(!1),j(``);return}}},re=D?k:L?.label??``,ie=M>=0?z[M]:void 0;return(0,G.jsxs)(`div`,{ref:x,className:W.field,children:[(0,G.jsx)(`label`,{htmlFor:v,children:e}),(0,G.jsxs)(`div`,{className:[W.control,D?W.open:``,d?W.disabled:``,u??``].filter(Boolean).join(` `),children:[(0,G.jsx)(oe,{className:W.searchIcon,size:16,strokeWidth:1.75,"aria-hidden":`true`}),(0,G.jsx)(`input`,{...h,ref:S,id:v,type:`text`,role:`combobox`,value:re,placeholder:L?.label??s,disabled:d,"aria-describedby":b,"aria-expanded":D,"aria-controls":D?y:void 0,"aria-autocomplete":`list`,"aria-activedescendant":D&&ie?`${v}-option-${ie.value}`:void 0,onFocus:e=>{f?.(e),te()},onClick:te,onChange:e=>{j(e.target.value),O(!0),P(-1)},onKeyDown:ne}),(0,G.jsx)(A,{initial:!1,children:L&&!d&&(0,G.jsx)(m.button,{type:`button`,className:W.clear,"aria-label":`Clear selection`,onMouseDown:e=>e.preventDefault(),onClick:V,initial:w?{opacity:0}:{opacity:0,scale:.6,filter:`blur(${a.blur.subtle}px)`},animate:{opacity:1,scale:1,filter:`blur(0px)`,transition:w?{duration:a.duration.instant}:{...a.spring.snappy,opacity:{duration:a.duration.fast}}},exit:{opacity:0,...w?{}:{scale:.6,filter:`blur(${a.blur.subtle}px)`},transition:{duration:a.duration.instant,ease:[...a.ease.standard]}},whileTap:{scale:w?1:.96,transition:{duration:a.duration.instant,ease:[...a.ease.standard]}},children:(0,G.jsx)(I,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})}),(0,G.jsx)(me,{className:W.chevron,size:16,strokeWidth:1.75,"aria-hidden":`true`})]}),o&&(0,G.jsx)(`span`,{id:b,className:W.hint,children:o}),(0,G.jsx)(A,{initial:!1,children:D&&(0,G.jsx)(m.div,{className:W.popover,initial:w?{opacity:0}:{opacity:0,y:-6,scale:.97},animate:{opacity:1,y:0,scale:1,transition:w?{duration:a.duration.instant}:{...a.spring.snappy,opacity:{duration:a.duration.fast,ease:[...a.ease.enter]}}},exit:{opacity:0,...w?{}:{y:-4,scale:.98},transition:{duration:a.duration.instant,ease:[...a.ease.standard]}},role:`presentation`,children:(0,G.jsx)(Ot,{reduceMotion:w,children:(0,G.jsx)(`div`,{id:y,className:W.listbox,role:`listbox`,"aria-label":`${e} options`,children:z.length?z.map((e,t)=>(0,G.jsxs)(`div`,{ref:t=>{C.current[e.value]=t},id:`${v}-option-${e.value}`,className:W.option,"data-active":t===M?`true`:void 0,"data-disabled":e.disabled?`true`:void 0,role:`option`,"aria-selected":e.value===F,"aria-disabled":e.disabled||void 0,onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>!e.disabled&&P(t),onClick:()=>ee(e),children:[(0,G.jsx)(`span`,{children:e.label}),e.value===F&&(0,G.jsx)(N,{className:W.check,size:16,strokeWidth:1.75,"aria-hidden":`true`})]},e.value)):(0,G.jsx)(m.div,{className:W.empty,role:`status`,initial:!w&&{opacity:0,y:4,filter:`blur(${a.blur.soft}px)`},animate:{opacity:1,y:0,filter:`blur(0px)`},transition:{duration:a.duration.standard,ease:[...a.ease.enter]},children:c})})})})})]})});kt.displayName=`Combobox`;var At=Object.defineProperty,jt=(e,t)=>At(e,`name`,{value:t,configurable:!0});function K(e){let t=U.useRef(e);return U.useEffect(()=>{t.current=e}),U.useMemo(()=>((...e)=>t.current?.(...e)),[])}jt(K,`useCallbackRef`);var Mt=Object.defineProperty,q=(e,t)=>Mt(e,`name`,{value:t,configurable:!0}),Nt=`dismissableLayer.update`,Pt=`dismissableLayer.pointerDownOutside`,Ft=`dismissableLayer.focusOutside`,It,Lt=U.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Rt=U.forwardRef(q(function(t,n){let{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=t,d=U.useContext(Lt),[f,p]=U.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=U.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=U.useRef(!1),E=Vt(e=>{o?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:U.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return w&&!t},[d.branches,w])}),D=Ht(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=K(e=>{e.key===`Escape`&&(a?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return U.useEffect(()=>{if(O)return m.addEventListener(`keydown`,k,{capture:!0}),()=>m.removeEventListener(`keydown`,k,{capture:!0})},[m,O,k]),U.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(It=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Ut(),()=>{r&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=It))}},[f,m,r,d]),U.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Ut())},[f,d]),U.useEffect(()=>{let e=q(()=>h({}),`handleUpdate`);return document.addEventListener(Nt,e),()=>document.removeEventListener(Nt,e)},[]),(0,G.jsx)(e.div,{...u,ref:g,style:{pointerEvents:S?w?`auto`:`none`:void 0,...t.style},onFocusCapture:b(t.onFocusCapture,D.onFocusCapture),onBlurCapture:b(t.onBlurCapture,D.onBlurCapture),onPointerDownCapture:b(t.onPointerDownCapture,E.onPointerDownCapture)})},`DismissableLayer`));function zt(){let e=U.useContext(Lt),[t,n]=U.useState(null);return U.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}q(zt,`useDismissableLayerSurface`);var Bt=q(()=>!0,`IS_TRUE`);function Vt(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Bt}=t,s=K(e),c=U.useRef(!1),l=U.useRef(!1),u=U.useRef(new Map),d=U.useRef(()=>{});return U.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}q(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}q(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)}q(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}q(p,`handleInteractionBubble`);let m=q(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Wt(Pt,s,p,{discrete:!0})};if(q(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:q(()=>c.current=!0,`onPointerDownCapture`)}}q(Vt,`usePointerDownOutside`);function Ht(e,t=globalThis?.document){let n=K(e),r=U.useRef(!1);return U.useEffect(()=>{let e=q(e=>{e.target&&!r.current&&Wt(Ft,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:q(()=>r.current=!0,`onFocusCapture`),onBlurCapture:q(()=>r.current=!1,`onBlurCapture`)}}q(Ht,`useFocusOutside`);function Ut(){let e=new CustomEvent(Nt);document.dispatchEvent(e)}q(Ut,`dispatchUpdate`);function Wt(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?B(i,a):i.dispatchEvent(a)}q(Wt,`handleAndDispatchCustomEvent`);var Gt=Object.defineProperty,J=(e,t)=>Gt(e,`name`,{value:t,configurable:!0}),Kt=`focusScope.autoFocusOnMount`,qt=`focusScope.autoFocusOnUnmount`,Jt={bubbles:!1,cancelable:!0},Yt=U.forwardRef(J(function(t,n){let{loop:r=!1,trapped:i=!1,branches:a,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=t,[l,u]=U.useState(null),d=K(o),f=K(s),p=U.useRef(null),m=C(n,u),h=U.useRef(a);U.useEffect(()=>{h.current=a});let g=U.useCallback(e=>e?l?.contains(e)?!0:!!h.current?.some(t=>t.contains(e)):!1,[l]),_=U.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;U.useEffect(()=>{if(i){let e=function(e){if(_.paused||!l)return;let t=e.target;g(t)?p.current=t:sn(p.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(g(t)||sn(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&sn(l)};J(e,`handleFocusIn`),J(t,`handleFocusOut`),J(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]),U.useEffect(()=>{if(l){cn.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(Kt,Jt);l.addEventListener(Kt,d),l.dispatchEvent(t),t.defaultPrevented||(en(dn(nn(l)),{select:!0}),document.activeElement===e&&sn(l))}return()=>{l.removeEventListener(Kt,d),setTimeout(()=>{let t=new CustomEvent(qt,Jt);l.addEventListener(qt,f),l.dispatchEvent(t),t.defaultPrevented||sn(e??document.body,{select:!0}),l.removeEventListener(qt,f),cn.remove(_)},0)}}},[l,d,f,_]);let v=U.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]=tn(t);i&&a?!e.shiftKey&&n===a?(e.preventDefault(),r&&sn(i,{select:!0})):e.shiftKey&&n===i&&(e.preventDefault(),r&&sn(a,{select:!0})):n===t&&e.preventDefault()}},[r,i,_.paused]);return(0,G.jsx)(e.div,{tabIndex:-1,...c,ref:m,onKeyDown:v})},`FocusScope`)),Xt=U.createContext(null);function Zt({registry:e,children:t}){return e?(0,G.jsx)(Xt.Provider,{value:e,children:t}):t}J(Zt,`FocusScopeBranchProvider`);function Qt(){let[e,t]=U.useState([]);return{nodes:e,registry:U.useMemo(()=>({add:J(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:J(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}J(Qt,`useFocusScopeBranchRegistry`);function $t(e){let t=U.useContext(Xt);U.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}J($t,`useFocusScopeBranch`);function en(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(sn(r,{select:t}),document.activeElement!==n)return}J(en,`focusFirst`);function tn(e){let t=nn(e);return[rn(t,e),rn(t.reverse(),e)]}J(tn,`getTabbableEdges`);function nn(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:J(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}J(nn,`getTabbableCandidates`);function rn(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):an(r,{upTo:t})))return r}J(rn,`findVisible`);function an(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}J(an,`isHidden`);function on(e){return e instanceof HTMLInputElement&&`select`in e}J(on,`isSelectableInput`);function sn(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&on(e)&&t&&e.select()}}J(sn,`focus`);var cn=ln();function ln(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=un(e,t),e.unshift(t)},remove(t){e=un(e,t),e[0]?.resume()}}}J(ln,`createFocusScopesStack`);function un(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}J(un,`arrayRemove`);function dn(e){return e.filter(e=>e.tagName!==`A`)}J(dn,`removeLinks`);var fn=D(u(),1),pn=Object.defineProperty,mn=U.forwardRef(((e,t)=>pn(e,`name`,{value:t,configurable:!0}))(function(t,n){let{container:r,...i}=t,[a,o]=U.useState(!1);g(()=>o(!0),[]);let s=r||a&&globalThis?.document?.body;return s?fn.createPortal((0,G.jsx)(e.div,{...i,ref:n}),s):null},`Portal`)),hn=Object.defineProperty,gn=(e,t)=>hn(e,`name`,{value:t,configurable:!0}),_n=0,vn=null;function yn(e){return bn(),e.children}gn(yn,`FocusGuards`);function bn(){U.useEffect(()=>{vn||={start:xn(),end:xn()};let{start:e,end:t}=vn;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),_n++,()=>{_n===1&&(vn?.start.remove(),vn?.end.remove(),vn=null),_n=Math.max(0,_n-1)}},[])}gn(bn,`useFocusGuards`);function xn(){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}gn(xn,`createFocusGuard`);var Sn=function(){return Sn=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},Sn.apply(this,arguments)};function Cn(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 wn(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 Tn=`right-scroll-bar-position`,En=`width-before-scroll-bar`,Dn=`with-scroll-bars-hidden`,On=`--removed-body-scroll-bar-size`;function kn(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function An(e,t){var n=(0,U.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 jn=typeof window<`u`?U.useLayoutEffect:U.useEffect,Mn=new WeakMap;function Nn(e,t){var n=An(t||null,function(t){return e.forEach(function(e){return kn(e,t)})});return jn(function(){var t=Mn.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||kn(e,null)}),i.forEach(function(e){r.has(e)||kn(e,a)})}Mn.set(n,e)},[e]),n}function Pn(e){return e}function Fn(e,t){t===void 0&&(t=Pn);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 In(e){e===void 0&&(e={});var t=Fn(null);return t.options=Sn({async:!0,ssr:!1},e),t}var Ln=function(e){var t=e.sideCar,n=Cn(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 U.createElement(r,Sn({},n))};Ln.isSideCarExport=!0;function Rn(e,t){return e.useMedium(t),Ln}var zn=In(),Bn=function(){},Vn=U.forwardRef(function(e,t){var n=U.useRef(null),r=U.useState({onScrollCapture:Bn,onWheelCapture:Bn,onTouchMoveCapture:Bn}),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=Cn(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Nn([n,t]),C=Sn(Sn({},b),i);return U.createElement(U.Fragment,null,u&&U.createElement(x,{sideCar:zn,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?U.cloneElement(U.Children.only(s),Sn(Sn({},C),{ref:S})):U.createElement(v,Sn({},C,{className:c,ref:S}),s))});Vn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Vn.classNames={fullWidth:En,zeroRight:Tn};var Hn=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Un(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Hn();return t&&e.setAttribute(`nonce`,t),e}function Wn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Gn(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Kn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Un())&&(Wn(t,n),Gn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},qn=function(){var e=Kn();return function(t,n){U.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Jn=function(){var e=qn();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Yn={left:0,top:0,right:0,gap:0},Xn=function(e){return parseInt(e||``,10)||0},Zn=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[Xn(n),Xn(r),Xn(i)]},Qn=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Yn;var t=Zn(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])}},$n=Jn(),er=`data-scroll-locked`,tr=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
- .${Dn} {
3
- overflow: hidden ${r};
4
- padding-right: ${s}px ${r};
5
- }
6
- body[${er}] {
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
- .${Tn} {
20
- right: ${s}px ${r};
21
- }
22
-
23
- .${En} {
24
- margin-right: ${s}px ${r};
25
- }
26
-
27
- .${Tn} .${Tn} {
28
- right: 0 ${r};
29
- }
30
-
31
- .${En} .${En} {
32
- margin-right: 0 ${r};
33
- }
34
-
35
- body[${er}] {
36
- ${On}: ${s}px;
37
- }
38
- `},nr=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},rr=function(){U.useEffect(function(){return document.body.setAttribute(er,(nr()+1).toString()),function(){var e=nr()-1;e<=0?document.body.removeAttribute(er):document.body.setAttribute(er,e.toString())}},[])},ir=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;rr();var a=U.useMemo(function(){return Qn(i)},[i]);return U.createElement($n,{styles:tr(a,!t,i,n?``:`!important`)})},ar=!1;if(typeof window<`u`)try{var or=Object.defineProperty({},"passive",{get:function(){return ar=!0,!0}});window.addEventListener(`test`,or,or),window.removeEventListener(`test`,or,or)}catch{ar=!1}var sr=ar?{passive:!1}:!1,cr=function(e){return e.tagName===`TEXTAREA`},lr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!cr(e)&&n[t]===`visible`)},ur=function(e){return lr(e,`overflowY`)},dr=function(e){return lr(e,`overflowX`)},fr=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),hr(e,r)){var i=gr(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pr=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},mr=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},hr=function(e,t){return e===`v`?ur(t):dr(t)},gr=function(e,t){return e===`v`?pr(t):mr(t)},_r=function(e,t){return e===`h`&&t===`rtl`?-1:1},vr=function(e,t,n,r,i){var a=_r(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=gr(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&hr(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},yr=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},br=function(e){return[e.deltaX,e.deltaY]},xr=function(e){return e&&`current`in e?e.current:e},Sr=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Cr=function(e){return`
39
- .block-interactivity-${e} {pointer-events: none;}
40
- .allow-interactivity-${e} {pointer-events: all;}
41
- `},wr=0,Tr=[];function Er(e){var t=U.useRef([]),n=U.useRef([0,0]),r=U.useRef(),i=U.useState(wr++)[0],a=U.useState(Jn)[0],o=U.useRef(e);U.useEffect(function(){o.current=e},[e]),U.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=wn([e.lockRef.current],(e.shards||[]).map(xr),!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=U.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=yr(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=fr(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=fr(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 vr(h,t,e,h===`h`?s:c,!0)},[]),c=U.useCallback(function(e){var n=e;if(Tr.length&&Tr[Tr.length-1]===a){var r=`deltaY`in n?br(n):yr(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Sr(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(xr).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=U.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Dr(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=U.useCallback(function(e){n.current=yr(e),r.current=void 0},[]),d=U.useCallback(function(t){l(t.type,br(t),t.target,s(t,e.lockRef.current))},[]),f=U.useCallback(function(t){l(t.type,yr(t),t.target,s(t,e.lockRef.current))},[]);U.useEffect(function(){return Tr.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,sr),document.addEventListener(`touchmove`,c,sr),document.addEventListener(`touchstart`,u,sr),function(){Tr=Tr.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,sr),document.removeEventListener(`touchmove`,c,sr),document.removeEventListener(`touchstart`,u,sr)}},[]);var p=e.removeScrollBar,m=e.inert;return U.createElement(U.Fragment,null,m?U.createElement(a,{styles:Cr(i)}):null,p?U.createElement(ir,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Dr(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Or=Rn(zn,Er),kr=U.forwardRef(function(e,t){return U.createElement(Vn,Sn({},e,{ref:t,sideCar:Or}))});kr.classNames=Vn.classNames;var Ar=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},jr=new WeakMap,Mr=new WeakMap,Nr={},Pr=0,Fr=function(e){return e&&(e.host||Fr(e.parentNode))},Ir=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Fr(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})},Lr=function(e,t,n,r){var i=Ir(t,Array.isArray(e)?e:[e]);Nr[n]||(Nr[n]=new WeakMap);var a=Nr[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=(jr.get(e)||0)+1,l=(a.get(e)||0)+1;jr.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Mr.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(),Pr++,function(){o.forEach(function(e){var t=jr.get(e)-1,i=a.get(e)-1;jr.set(e,t),a.set(e,i),t||(Mr.has(e)||e.removeAttribute(r),Mr.delete(e)),i||e.removeAttribute(n)}),Pr--,Pr||(jr=new WeakMap,jr=new WeakMap,Mr=new WeakMap,Nr={})}},Rr=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ar(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Lr(r,i,n,`aria-hidden`)):function(){return null}},zr=Object.defineProperty,Y=(e,t)=>zr(e,`name`,{value:t,configurable:!0}),Br=`Dialog`,[Vr,Hr]=he(Br),[Ur,Wr]=Vr(Br),Gr=Y(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=U.useRef(null),c=U.useRef(null),{nodes:l,registry:u}=Qt(),[d,f]=h({prop:r,defaultProp:i??!1,onChange:a,caller:Br}),[p,m]=U.useState(0),[g,_]=U.useState(0);return(0,G.jsx)(Ur,{scope:t,triggerRef:s,contentRef:c,contentId:y(),titleId:y(),descriptionId:y(),titlePresent:p>0,descriptionPresent:g>0,setTitleCount:m,setDescriptionCount:_,open:d,onOpenChange:f,onOpenToggle:U.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Kr=`DialogTrigger`,qr=U.forwardRef(Y(function(t,n){let{__scopeDialog:r,...i}=t,a=Wr(Kr,r),o=C(n,a.triggerRef);return(0,G.jsx)(e.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":fi(a.open),...i,ref:o,onClick:b(t.onClick,a.onOpenToggle)})},`DialogTrigger`)),Jr=`DialogPortal`,[Yr,Xr]=Vr(Jr,{forceMount:void 0}),Zr=Y(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Wr(Jr,t);return(0,G.jsx)(Yr,{scope:t,forceMount:n,children:U.Children.map(r,e=>(0,G.jsx)(V,{present:n||a.open,children:(0,G.jsx)(mn,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Qr=`DialogOverlay`,$r=U.forwardRef(Y(function(e,t){let n=Xr(Qr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wr(Qr,e.__scopeDialog);return a.modal?(0,G.jsx)(V,{present:r||a.open,children:(0,G.jsx)(ti,{...i,ref:t})}):null},`DialogOverlay`)),ei=d(`DialogOverlay.RemoveScroll`),ti=U.forwardRef(Y(function(t,n){let{__scopeDialog:r,...i}=t,a=Wr(Qr,r),o=zt(),s=C(n,o);return(0,G.jsx)(kr,{as:ei,allowPinchZoom:!0,shards:U.useMemo(()=>[a.contentRef,...a.branchNodes.map(e=>({current:e}))],[a.contentRef,a.branchNodes]),children:(0,G.jsx)(e.div,{"data-state":fi(a.open),...i,ref:s,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),ni=`DialogContent`,ri=U.forwardRef(Y(function(e,t){let n=Xr(ni,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wr(ni,e.__scopeDialog);return(0,G.jsx)(V,{present:r||a.open,children:a.modal?(0,G.jsx)(ii,{...i,ref:t}):(0,G.jsx)(ai,{...i,ref:t})})},`DialogContent`)),ii=U.forwardRef(Y(function(e,t){let n=Wr(ni,e.__scopeDialog),r=U.useRef(null),i=C(t,n.contentRef,r);return U.useEffect(()=>{let e=r.current;if(e)return Rr(e)},[]),(0,G.jsx)(oi,{...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`)),ai=U.forwardRef(Y(function(e,t){let n=Wr(ni,e.__scopeDialog),r=U.useRef(!1),i=U.useRef(!1);return(0,G.jsx)(oi,{...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`)),oi=U.forwardRef(Y(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=Wr(ni,n);return bn(),(0,G.jsx)(Zt,{registry:l.branchRegistry,children:(0,G.jsx)(Yt,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,G.jsx)(Rt,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?di(o,l.descriptionId):o,"data-state":fi(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),si=U.forwardRef(Y(function(t,n){let{__scopeDialog:r,...i}=t,a=Wr(`DialogTitle`,r),{setTitleCount:o}=a;return g(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),(0,G.jsx)(e.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),ci=U.forwardRef(Y(function(t,n){let{__scopeDialog:r,...i}=t,a=Wr(`DialogDescription`,r),{setDescriptionCount:o}=a;return g(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),(0,G.jsx)(e.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),li=`DialogClose`,ui=U.forwardRef(Y(function(t,n){let{__scopeDialog:r,...i}=t,a=Wr(li,r);return(0,G.jsx)(e.button,{type:`button`,...i,ref:n,onClick:b(t.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function di(...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}Y(di,`concatAriaDescribedby`);function fi(e){return e?`open`:`closed`}Y(fi,`getState`);var pi={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`},mi=(0,U.createContext)(null);function hi({open:e,defaultOpen:t=!1,onOpenChange:n,...r}){let[i,a]=(0,U.useState)(t),o=e??i,s=(0,U.useCallback)(t=>{e===void 0&&a(t),n?.(t)},[e,n]);return(0,G.jsx)(mi.Provider,{value:o,children:(0,G.jsx)(Gr,{...r,open:o,onOpenChange:s})})}var gi={duration:a.duration.instant},_i={duration:a.duration.fast,ease:[...a.ease.standard]};function vi({text:e}){let t=p();return(0,G.jsx)(A,{mode:`popLayout`,initial:!1,children:(0,G.jsx)(m.span,{className:pi.swap,initial:!t&&{opacity:0,y:`0.3em`,filter:`blur(${a.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(${a.blur.subtle}px)`,transition:{duration:a.duration.fast,ease:[...a.ease.standard]}},transition:{duration:a.duration.standard,ease:[...a.ease.enter]},children:e},e)})}function yi({title:e,description:t,children:n,className:r,onPointerDownOutside:i,...o}){let s=(0,U.useContext)(mi),c=p(),l=(0,U.useRef)({open:s,at:0});(0,U.useLayoutEffect)(()=>{l.current={open:s,at:performance.now()}},[s]);let u=e=>{i?.(e),s!==null&&(!l.current.open||e.detail.originalEvent.timeStamp<l.current.at)&&e.preventDefault()},d=[pi.content,r].filter(Boolean).join(` `),f=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:pi.header,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(si,{className:pi.title,children:(0,G.jsx)(vi,{text:e})}),t?(0,G.jsx)(ci,{className:pi.description,children:(0,G.jsx)(vi,{text:t})}):null]}),(0,G.jsx)(ui,{className:pi.close,"aria-label":`Close dialog`,children:(0,G.jsx)(I,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]}),(0,G.jsx)(`div`,{className:pi.body,children:n})]});return s===null?(0,G.jsxs)(Zr,{children:[(0,G.jsx)($r,{className:`${pi.overlay} ${pi.keyframes}`}),(0,G.jsx)(ri,{...o,onPointerDownOutside:u,className:`${d} ${pi.keyframes}`,children:f})]}):(0,G.jsx)(A,{children:s&&(0,G.jsxs)(Zr,{forceMount:!0,children:[(0,G.jsx)($r,{asChild:!0,forceMount:!0,children:(0,G.jsx)(m.div,{className:pi.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:c?gi:_i},transition:c?gi:{duration:a.duration.standard,ease:[...a.ease.enter]}})}),(0,G.jsx)(ri,{...o,onPointerDownOutside:u,asChild:!0,forceMount:!0,children:(0,G.jsx)(m.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:gi}:{opacity:0,y:4,scale:.98,transition:_i},transition:c?gi:{default:a.spring.smooth,opacity:{duration:a.duration.fast,ease:[...a.ease.enter]}},children:f})})]},`dialog`)})}var bi=[`top`,`right`,`bottom`,`left`],xi=Math.min,Si=Math.max,Ci=Math.round,wi=Math.floor,Ti=e=>({x:e,y:e}),Ei={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Di(e,t,n){return Si(e,xi(t,n))}function Oi(e,t){return typeof e==`function`?e(t):e}function ki(e){return e.split(`-`)[0]}function Ai(e){return e.split(`-`)[1]}function ji(e){return e===`x`?`y`:`x`}function Mi(e){return e===`y`?`height`:`width`}function Ni(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Pi(e){return ji(Ni(e))}function Fi(e,t,n){n===void 0&&(n=!1);let r=Ai(e),i=Pi(e),a=Mi(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Wi(o)),[o,Wi(o)]}function Ii(e){let t=Wi(e);return[Li(e),t,Li(t)]}function Li(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ri=[`left`,`right`],zi=[`right`,`left`],Bi=[`top`,`bottom`],Vi=[`bottom`,`top`];function Hi(e,t,n){switch(e){case`top`:case`bottom`:return n?t?zi:Ri:t?Ri:zi;case`left`:case`right`:return t?Bi:Vi;default:return[]}}function Ui(e,t,n,r){let i=Ai(e),a=Hi(ki(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Li)))),a}function Wi(e){let t=ki(e);return Ei[t]+e.slice(t.length)}function Gi(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Ki(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Gi(e)}function qi(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 Ji(e,t,n){let{reference:r,floating:i}=e,a=Ni(t),o=Pi(t),s=Mi(o),c=ki(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=Ai(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Yi(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}=Oi(t,e),p=Ki(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=qi(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=qi(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 Xi=50,Zi=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Yi},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ji(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<Xi&&(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}=Ji(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Qi=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}=Oi(e,t)||{};if(l==null)return{};let d=Ki(u),f={x:n,y:r},p=Pi(i),m=Mi(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=xi(d[_],T),D=xi(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Di(E,k,O),j=!c.arrow&&Ai(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}}}),$i=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}=Oi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ki(r),_=Ni(o),v=ki(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Wi(o)]:Ii(o)),x=p!==`none`;!d&&x&&b.push(...Ui(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=Fi(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`||_===Ni(t)||T.every(e=>Ni(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=Ni(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 ea(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ta(e){return bi.some(t=>e[t]>=0)}var na=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Oi(e,t);switch(i){case`referenceHidden`:{let e=ea(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ta(e)}}}case`escaped`:{let e=ea(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ta(e)}}}default:return{}}}}},ra=new Set([`left`,`top`]);async function ia(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ki(n),s=Ai(n),c=Ni(n)===`y`,l=ra.has(o)?-1:1,u=a&&c?-1:1,d=Oi(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 aa=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 ia(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}}}}},oa=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}=Oi(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ni(i),p=ji(f),m=u[p],h=u[f],g=(e,t)=>Di(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}}}}}},sa=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}=Oi(e,t),u={x:n,y:r},d=Ni(i),f=ji(d),p=u[f],m=u[d],h=Oi(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=ra.has(ki(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}}}},ca=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}=Oi(e,t),c=await i.detectOverflow(t,s),l=ki(n),u=Ai(n),d=Ni(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=xi(p-c[m],g),y=xi(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*Si(c.left,c.right):S=p-2*Si(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 la(){return typeof window<`u`}function ua(e){return fa(e)?(e.nodeName||``).toLowerCase():`#document`}function X(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function da(e){return((fa(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function fa(e){return la()?e instanceof Node||e instanceof X(e).Node:!1}function pa(e){return la()?e instanceof Element||e instanceof X(e).Element:!1}function ma(e){return la()?e instanceof HTMLElement||e instanceof X(e).HTMLElement:!1}function ha(e){return!la()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof X(e).ShadowRoot}function ga(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Da(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function _a(e){return/^(table|td|th)$/.test(ua(e))}function va(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ya=/transform|translate|scale|rotate|perspective|filter/,ba=/paint|layout|strict|content/,xa=e=>!!e&&e!==`none`,Sa;function Ca(e){let t=pa(e)?Da(e):e;return xa(t.transform)||xa(t.translate)||xa(t.scale)||xa(t.rotate)||xa(t.perspective)||!Ta()&&(xa(t.backdropFilter)||xa(t.filter))||ya.test(t.willChange||``)||ba.test(t.contain||``)}function wa(e){let t=ka(e);for(;ma(t)&&!Ea(t);){if(Ca(t))return t;if(va(t))return null;t=ka(t)}return null}function Ta(){return Sa??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Sa}function Ea(e){return/^(html|body|#document)$/.test(ua(e))}function Da(e){return X(e).getComputedStyle(e)}function Oa(e){return pa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ka(e){if(ua(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ha(e)&&e.host||da(e);return ha(t)?t.host:t}function Aa(e){let t=ka(e);return Ea(t)?(e.ownerDocument||e).body:ma(t)&&ga(t)?t:Aa(t)}function ja(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Aa(e),i=r===e.ownerDocument?.body,a=X(r);if(i){let e=Ma(a);return t.concat(a,a.visualViewport||[],ga(r)?r:[],e&&n?ja(e):[])}return t.concat(r,ja(r,[],n))}function Ma(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Na(e){let t=Da(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ma(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ci(n)!==a||Ci(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Pa(e){return pa(e)?e:e.contextElement}function Fa(e){let t=Pa(e);if(!ma(t))return Ti(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Na(t),o=(a?Ci(n.width):n.width)/r,s=(a?Ci(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ia=Ti(0);function La(e){let t=X(e);return!Ta()||!t.visualViewport?Ia:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ra(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===X(e)}function za(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Pa(e),o=Ti(1);t&&(r?pa(r)&&(o=Fa(r)):o=Fa(e));let s=Ra(a,n,r)?La(a):Ti(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=X(a),t=pa(r)?X(r):r,n=e,i=Ma(n);for(;i&&t!==n;){let e=Fa(i),t=i.getBoundingClientRect(),r=Da(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=X(i),i=Ma(n)}}return qi({width:u,height:d,x:c,y:l})}function Ba(e,t){let n=Oa(e).scrollLeft;return t?t.left+n:za(da(e)).left+n}function Va(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ba(e,n),y:n.top+t.scrollTop}}function Ha(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=da(r),s=t?va(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ti(1),u=Ti(0),d=ma(r);if((d||!a)&&((ua(r)!==`body`||ga(o))&&(c=Oa(r)),d)){let e=za(r);l=Fa(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Va(o,c):Ti(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 Ua(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Wa(e){let t=Oa(e),n=e.ownerDocument.body,r=Si(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Si(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ba(e),o=-t.scrollTop;return Da(n).direction===`rtl`&&(a+=Si(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ga=25;function Ka(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=X(e),a=da(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ta()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ba(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<=Ga&&(s-=o)}return{width:s,height:c,x:l,y:u}}function qa(e,t){let n=za(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Fa(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ja(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ka(e,n,t);else if(t===`document`)r=Wa(da(e));else if(pa(t))r=qa(t,n);else{let n=La(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return qi(r)}function Ya(e,t){let n=t.get(e);if(n)return n;let r=ja(e,[],!1).filter(e=>pa(e)&&ua(e)!==`body`),i=null,a=Da(e).position===`fixed`,o=a?ka(e):e;for(;pa(o)&&!Ea(o);){let e=Da(o),t=Ca(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ka(o)}return t.set(e,r),r}function Xa(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?va(t)?[]:Ya(t,this._c):[].concat(n),r],o=Ja(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=Ja(t,a[e],i);s=Si(n.top,s),c=xi(n.right,c),l=xi(n.bottom,l),u=Si(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Za(e){let{width:t,height:n}=Na(e);return{width:t,height:n}}function Qa(e,t,n){let r=ma(t),i=da(t),a=n===`fixed`,o=za(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ti(0);if((r||!a)&&((ua(t)!==`body`||ga(i))&&(s=Oa(t)),r)){let e=za(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ba(i));let l=i&&!r&&!a?Va(i,s):Ti(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 $a(e){return Da(e).position===`static`}function eo(e,t){if(!ma(e)||Da(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return da(e)===n&&(n=n.ownerDocument.body),n}function to(e,t){let n=X(e);if(va(e))return n;if(!ma(e)){let t=ka(e);for(;t&&!Ea(t);){if(pa(t)&&!$a(t))return t;t=ka(t)}return n}let r=eo(e,t);for(;r&&_a(r)&&$a(r);)r=eo(r,t);return r&&Ea(r)&&$a(r)&&!Ca(r)?n:r||wa(e)||n}var no=async function(e){let t=this.getOffsetParent||to,n=this.getDimensions,r=await n(e.floating);return{reference:Qa(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ro(e){return Da(e).direction===`rtl`}var io={convertOffsetParentRelativeRectToViewportRelativeRect:Ha,getDocumentElement:da,getClippingRect:Xa,getOffsetParent:to,getElementRects:no,getClientRects:Ua,getDimensions:Za,getScale:Fa,isElement:pa,isRTL:ro};function ao(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oo(e,t,n){let r=null,i,a=da(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=wi(d),h=wi(a.clientWidth-(u+f)),g=wi(a.clientHeight-(d+p)),_=wi(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Si(0,xi(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!ao(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=X(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function so(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=Pa(e),u=i||a?[...l?ja(l):[],...t?ja(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?oo(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?za(e):null;c&&g();function g(){let t=za(e);h&&!ao(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 co=aa,lo=oa,uo=$i,fo=ca,po=na,mo=Qi,ho=sa,go=(e,t,n)=>{let r=new Map,i=n??{},a={...io,...i.platform,_c:r};return Zi(e,t,{...i,platform:a})},_o=typeof document<`u`?U.useLayoutEffect:function(){};function vo(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(!vo(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)&&!vo(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function yo(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bo(e,t){let n=yo(e);return Math.round(t*n)/n}function xo(e){let t=U.useRef(e);return _o(()=>{t.current=e}),t}function So(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]=U.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=U.useState(r);vo(f,r)||p(r);let[m,h]=U.useState(null),[g,_]=U.useState(null),v=U.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=U.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=U.useRef(null),C=U.useRef(null),w=U.useRef(u),T=c!=null,E=xo(c),D=xo(i),O=xo(l),k=U.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),go(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!vo(w.current,t)&&(w.current=t,fn.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);_o(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=U.useRef(!1);_o(()=>(A.current=!0,()=>{A.current=!1}),[]),_o(()=>{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=U.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=U.useMemo(()=>({reference:b,floating:x}),[b,x]),N=U.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=bo(M.floating,u.x),r=bo(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...yo(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return U.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Co=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?{}:mo({element:r.current,padding:i}).fn(n):r?mo({element:r,padding:i}).fn(n):{}}}},wo=(e,t)=>{let n=co(e);return{name:n.name,fn:n.fn,options:[e,t]}},To=(e,t)=>{let n=lo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Eo=(e,t)=>({fn:ho(e).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=po(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ao=(e,t)=>{let n=Co(e);return{name:n.name,fn:n.fn,options:[e,t]}},jo=Object.defineProperty,Mo=(e,t)=>jo(e,`name`,{value:t,configurable:!0}),No={Partial:`partial`,Always:`always`},Po={Optimized:`optimized`,Always:`always`},Fo=`Popper`,[Io,Lo]=he(Fo),[Ro,zo]=Io(Fo),Bo=Mo(e=>{let{__scopePopper:t,children:n}=e,[r,i]=U.useState(null),[a,o]=U.useState(void 0);return(0,G.jsx)(Ro,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Vo=`PopperAnchor`,Ho=U.forwardRef(Mo(function(t,n){let{__scopePopper:r,virtualRef:i,...a}=t,o=zo(Vo,r),s=U.useRef(null),c=o.onAnchorChange,l=U.useCallback(e=>{s.current=e,e&&c(e)},[c]),u=C(n,l),d=U.useRef(null);U.useEffect(()=>{if(!i)return;let e=d.current;d.current=i.current,e!==d.current&&c(d.current)});let f=o.placementState&&Yo(o.placementState),p=f?.[0],m=f?.[1];return i?null:(0,G.jsx)(e.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...a,ref:u})},`PopperAnchor`)),Uo=`PopperContent`,[Wo,Go]=Io(Uo),Ko=U.forwardRef(Mo(function(t,r){let{__scopePopper:i,side:a=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=No.Partial,hideWhenDetached:m=!1,updatePositionStrategy:h=Po.Optimized,onPlaced:_,...v}=t,y=zo(Uo,i),[b,x]=U.useState(null),S=C(r,x),[w,T]=U.useState(null),E=n(w),D=E?.width??0,O=E?.height??0,k=a+(s===`center`?``:`-`+s),A=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},j=Array.isArray(d)?d:[d],M=j.length>0,N={padding:A,boundary:j.filter(qo),altBoundary:M},{refs:P,floatingStyles:F,placement:I,isPositioned:L,middlewareData:R}=So({strategy:`fixed`,placement:k,whileElementsMounted:Mo((...e)=>so(...e,{animationFrame:h===Po.Always}),`whileElementsMounted`),elements:{reference:y.anchor},middleware:[wo({mainAxis:o+O,alignmentAxis:c}),u&&To({mainAxis:!0,crossAxis:!1,limiter:p===No.Partial?Eo():void 0,...N}),u&&Do({...N}),Oo({...N,apply:Mo(({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&&Ao({element:w,padding:l}),Jo({arrowWidth:D,arrowHeight:O}),m&&ko({strategy:`referenceHidden`,...N,boundary:M?N.boundary:void 0})]}),z=y.setPlacementState;g(()=>(z(I),()=>{z(void 0)}),[I,z]);let[B,ee]=Yo(I),V=K(_);g(()=>{L&&V?.()},[L,V]);let te=R.arrow?.x,ne=R.arrow?.y,re=R.arrow?.centerOffset!==0,[ie,ae]=U.useState();return g(()=>{b&&ae(window.getComputedStyle(b).zIndex)},[b]),(0,G.jsx)(`div`,{ref:P.setFloating,"data-radix-popper-content-wrapper":``,style:{...F,transform:L?F.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ie,"--radix-popper-transform-origin":[R.transformOrigin?.x,R.transformOrigin?.y].join(` `),...R.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:t.dir,children:(0,G.jsx)(Wo,{scope:i,placedSide:B,placedAlign:ee,onArrowChange:T,arrowX:te,arrowY:ne,shouldHideArrow:re,children:(0,G.jsx)(e.div,{"data-side":B,"data-align":ee,...v,ref:S,style:{...v.style,animation:L?v.style?.animation:`none`}})})})},`PopperContent`));function qo(e){return e!==null}Mo(qo,`isNotNull`);var Jo=Mo(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]=Yo(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 Yo(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Mo(Yo,`getSideAndAlignFromPlacement`);var Xo=Object.defineProperty,Zo=(e,t)=>Xo(e,`name`,{value:t,configurable:!0}),Qo=!1;function $o(){let[e,t]=U.useState(Qo);return U.useEffect(()=>{Qo||(Qo=!0,t(!0))},[]),e}Zo($o,`useIsHydrated`);var es=U.useSyncExternalStore;function ts(){return()=>{}}Zo(ts,`subscribe`);function ns(){return es(ts,()=>!0,()=>!1)}Zo(ns,`useIsHydratedModern`);var rs=typeof es==`function`?ns:$o,is=Object.defineProperty,as=(e,t)=>is(e,`name`,{value:t,configurable:!0}),os=`rovingFocusGroup.onEntryFocus`,ss={bubbles:!1,cancelable:!0},cs=`RovingFocusGroup`,[ls,us,ds]=s(cs),[fs,ps]=he(cs,[ds]),ms={Vertical:`vertical`,Horizontal:`horizontal`},hs={LTR:`ltr`,RTL:`rtl`},[gs,_s]=fs(cs),vs=U.forwardRef(as(function(e,t){return(0,G.jsx)(ls.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,G.jsx)(ls.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,G.jsx)(ys,{...e,ref:t})})})},`RovingFocusGroup`)),ys=U.forwardRef(as(function(t,n){let{__scopeRovingFocusGroup:r,orientation:a,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=t,m=U.useRef(null),g=C(n,m),_=i(s),[v,y]=h({prop:c,defaultProp:l??null,onChange:u,caller:cs}),[x,S]=U.useState(!1),w=K(d),T=us(r),E=U.useRef(!1),[D,O]=U.useState(0);return U.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(os,w),()=>e.removeEventListener(os,w)},[w]),(0,G.jsx)(gs,{scope:r,orientation:a,dir:_,loop:o,currentTabStopId:v,onItemFocus:U.useCallback(e=>y(e),[y]),onItemShiftTab:U.useCallback(()=>S(!0),[]),onFocusableItemAdd:U.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:U.useCallback(()=>O(e=>e-1),[]),children:(0,G.jsx)(e.div,{tabIndex:x||D===0?-1:0,"data-orientation":a,...p,ref:g,style:{outline:`none`,...t.style},onMouseDown:b(t.onMouseDown,()=>{E.current=!0}),onFocus:b(t.onFocus,e=>{let t=!E.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(os,ss);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=T().filter(e=>e.focusable);Ts([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(t.onBlur,()=>S(!1))})})},`RovingFocusGroupImpl`)),bs=`RovingFocusGroupItem`,xs=U.forwardRef(as(function(t,n){let{__scopeRovingFocusGroup:r,focusable:i=!0,active:a=!1,tabStopId:o,children:s,...c}=t,l=y(),u=o||l,d=_s(bs,r),f=d.currentTabStopId===u,p=us(r),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:_}=d,v=rs();return g(()=>{if(v&&i)return m(),()=>h()},[v,i,m,h]),U.useEffect(()=>{if(!v&&i)return m(),()=>h()},[v,i,m,h]),(0,G.jsx)(ls.ItemSlot,{scope:r,id:u,focusable:i,active:a,children:(0,G.jsx)(e.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:n,onMouseDown:b(t.onMouseDown,e=>{i?d.onItemFocus(u):e.preventDefault()}),onFocus:b(t.onFocus,()=>d.onItemFocus(u)),onKeyDown:b(t.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ws(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?Es(n,r+1):n.slice(r+1)}setTimeout(()=>Ts(n))}}),children:typeof s==`function`?s({isCurrentTabStop:f,hasTabStop:_!=null}):s})})},`RovingFocusGroupItem`)),Ss={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Cs(e,t){return t===hs.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}as(Cs,`getDirectionAwareKey`);function ws(e,t,n){let r=Cs(e.key,n);if(!(t===ms.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===ms.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Ss[r]}as(ws,`getFocusIntent`);function Ts(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}as(Ts,`focusFirst`);function Es(e,t){return e.map((n,r)=>e[(t+r)%e.length])}as(Es,`wrapArray`);var Ds=Object.defineProperty,Z=(e,t)=>Ds(e,`name`,{value:t,configurable:!0}),Os=[`Enter`,` `],ks=[`ArrowDown`,`PageUp`,`Home`],As=[`ArrowUp`,`PageDown`,`End`],js=[...ks,...As];[...Os],[...Os];var Ms=`Menu`,[Ns,Ps,Fs]=s(Ms),[Is,Ls]=he(Ms,[Fs,Lo,ps]),Rs=Lo(),zs=ps(),[Bs,Vs]=Is(Ms),[Hs,Us]=Is(Ms),Ws=Z(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:o,modal:s=!0}=e,c=Rs(t),[l,u]=U.useState(null),d=U.useRef(!1),f=K(o),p=i(a);return U.useEffect(()=>{let e=Z(()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=Z(()=>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})}},[]),U.useEffect(()=>{if(!n)return;let e=Z(()=>f(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,G.jsx)(Bo,{...c,children:(0,G.jsx)(Bs,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,G.jsx)(Hs,{scope:t,onClose:U.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:r})})})},`Menu`),Gs=U.forwardRef(Z(function(e,t){let{__scopeMenu:n,...r}=e,i=Rs(n);return(0,G.jsx)(Ho,{...i,...r,ref:t})},`MenuAnchor`)),Ks=`MenuPortal`,[qs,Js]=Is(Ks,{forceMount:void 0}),Ys=Z(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Vs(Ks,t);return(0,G.jsx)(qs,{scope:t,forceMount:n,children:(0,G.jsx)(V,{present:n||a.open,children:(0,G.jsx)(mn,{asChild:!0,container:i,children:r})})})},`MenuPortal`),Xs=`MenuContent`,[Zs,Qs]=Is(Xs),$s=U.forwardRef(Z(function(e,t){let n=Js(Xs,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Vs(Xs,e.__scopeMenu),o=Us(Xs,e.__scopeMenu);return(0,G.jsx)(Ns.Provider,{scope:e.__scopeMenu,children:(0,G.jsx)(V,{present:r||a.open,children:(0,G.jsx)(Ns.Slot,{scope:e.__scopeMenu,children:o.modal?(0,G.jsx)(ec,{...i,ref:t}):(0,G.jsx)(tc,{...i,ref:t})})})})},`MenuContent`)),ec=U.forwardRef(Z(function(e,t){let n=Vs(Xs,e.__scopeMenu),r=U.useRef(null),i=C(t,r);return U.useEffect(()=>{let e=r.current;if(e)return Rr(e)},[]),(0,G.jsx)(rc,{...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`)),tc=U.forwardRef(Z(function(e,t){let n=Vs(Xs,e.__scopeMenu);return(0,G.jsx)(rc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),nc=d(`MenuContent.ScrollLock`),rc=U.forwardRef(Z(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=Vs(Xs,n),_=Us(Xs,n),v=Rs(n),y=zs(n),x=Ps(n),[S,w]=U.useState(null),T=U.useRef(null),[E,D]=U.useState(null);$t(E);let{nodes:O,registry:k}=Qt(),A=!!(i||m),j=C(t,T,g.onContentChange,D),M=U.useRef(0),N=U.useRef(``),P=U.useRef(0),F=U.useRef(null),I=U.useRef(`right`),L=U.useRef(0),R=U.useMemo(()=>m?[T,...O.map(e=>({current:e}))]:[],[T,O,m]),z=m?kr:U.Fragment,B=m?{as:nc,allowPinchZoom:!0,shards:R}:void 0,ee=Z(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=Cc(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;Z((function e(t){N.current=t,window.clearTimeout(M.current),t!==``&&(M.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);U.useEffect(()=>()=>window.clearTimeout(M.current),[]),bn();let V=U.useCallback(e=>I.current===F.current?.side&&Tc(e,F.current?.area),[]);return(0,G.jsx)(Zs,{scope:n,searchRef:N,onItemEnter:U.useCallback(e=>{V(e)&&e.preventDefault()},[V]),onItemLeave:U.useCallback(e=>{V(e)||(T.current?.focus(),w(null))},[V]),onTriggerLeave:U.useCallback(e=>{V(e)&&e.preventDefault()},[V]),pointerGraceTimerRef:P,onPointerGraceIntentChange:U.useCallback(e=>{F.current=e},[]),children:(0,G.jsx)(Zt,{registry:A?k:null,children:(0,G.jsx)(z,{...B,children:(0,G.jsx)(Yt,{asChild:!0,trapped:i,branches:O,onMountAutoFocus:b(a,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,G.jsx)(Rt,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,G.jsx)(vs,{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,G.jsx)(Ko,{role:`menu`,"aria-orientation":`vertical`,"data-state":vc(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&&ee(e.key));let i=T.current;if(e.target!==i||!js.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);As.includes(e.key)&&a.reverse(),xc(a)}),onBlur:b(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(M.current),N.current=``)}),onPointerMove:b(e.onPointerMove,Ec(e=>{let t=e.target,n=L.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>L.current?`right`:`left`;I.current=t,L.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),ic=`MenuItem`,ac=`menu.itemSelect`,oc=U.forwardRef(Z(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=U.useRef(null),o=Us(ic,e.__scopeMenu),s=Qs(ic,e.__scopeMenu),c=C(t,a),l=U.useRef(!1),u=Z(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(ac,{bubbles:!0,cancelable:!0});e.addEventListener(ac,e=>r?.(e),{once:!0}),B(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,G.jsx)(sc,{...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!==` `)&&Os.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),sc=U.forwardRef(Z(function(t,n){let{__scopeMenu:r,disabled:i=!1,textValue:a,...o}=t,s=Qs(ic,r),c=zs(r),l=U.useRef(null),u=C(n,l),[d,f]=U.useState(!1),[p,m]=U.useState(``);return U.useEffect(()=>{let e=l.current;e&&m((e.textContent??``).trim())},[o.children]),(0,G.jsx)(Ns.ItemSlot,{scope:r,disabled:i,textValue:a??p,children:(0,G.jsx)(xs,{asChild:!0,...c,focusable:!i,children:(0,G.jsx)(e.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...o,ref:u,onPointerMove:b(t.onPointerMove,Ec(e=>{i?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:b(t.onPointerLeave,Ec(e=>s.onItemLeave(e))),onFocus:b(t.onFocus,()=>f(!0)),onBlur:b(t.onBlur,()=>f(!1))})})})},`MenuItemImpl`)),cc=U.forwardRef(Z(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,G.jsx)(fc,{scope:e.__scopeMenu,checked:n,children:(0,G.jsx)(oc,{role:`menuitemcheckbox`,"aria-checked":yc(n)?`mixed`:n,...i,ref:t,"data-state":bc(n),onSelect:b(i.onSelect,()=>r?.(yc(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[lc,uc]=Is(`MenuRadioGroup`,{value:void 0,onValueChange:Z(()=>{},`onValueChange`)}),dc=`MenuItemIndicator`,[fc,pc]=Is(dc,{checked:!1}),mc=U.forwardRef(Z(function(t,n){let{__scopeMenu:r,forceMount:i,...a}=t,o=pc(dc,r);return(0,G.jsx)(V,{present:i||yc(o.checked)||o.checked===!0,children:(0,G.jsx)(e.span,{...a,ref:n,"data-state":bc(o.checked)})})},`MenuItemIndicator`)),hc=U.forwardRef(Z(function(t,n){let{__scopeMenu:r,...i}=t;return(0,G.jsx)(e.div,{role:`separator`,"aria-orientation":`horizontal`,...i,ref:n})},`MenuSeparator`)),[gc,_c]=Is(`MenuSub`);function vc(e){return e?`open`:`closed`}Z(vc,`getOpenState`);function yc(e){return e===`indeterminate`}Z(yc,`isIndeterminate`);function bc(e){return yc(e)?`indeterminate`:e?`checked`:`unchecked`}Z(bc,`getCheckedState`);function xc(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Z(xc,`focusFirst`);function Sc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Z(Sc,`wrapArray`);function Cc(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=Sc(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}Z(Cc,`getNextMatch`);function wc(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}Z(wc,`isPointInPolygon`);function Tc(e,t){return t?wc({x:e.clientX,y:e.clientY},t):!1}Z(Tc,`isPointerInGraceArea`);function Ec(e){return t=>t.pointerType===`mouse`?e(t):void 0}Z(Ec,`whenMouse`);var Dc=Object.defineProperty,Oc=(e,t)=>Dc(e,`name`,{value:t,configurable:!0}),kc=`DropdownMenu`,[Ac,jc]=he(kc,[Ls]),Mc=Ls(),[Nc,Pc]=Ac(kc),Fc=Oc(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Mc(t),l=U.useRef(null),[u,d]=h({prop:i,defaultProp:a??!1,onChange:o,caller:kc});return(0,G.jsx)(Nc,{scope:t,triggerId:y(),triggerRef:l,contentId:y(),open:u,onOpenChange:d,onOpenToggle:U.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,G.jsx)(Ws,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Ic=`DropdownMenuTrigger`,Lc=U.forwardRef(Oc(function(t,n){let{__scopeDropdownMenu:r,disabled:i=!1,...a}=t,o=Pc(Ic,r),s=Mc(r),c=C(n,o.triggerRef);return(0,G.jsx)(Gs,{asChild:!0,...s,children:(0,G.jsx)(e.button,{type:`button`,id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?`open`:`closed`,"data-disabled":i?``:void 0,disabled:i,...a,ref:c,onPointerDown:b(t.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:b(t.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Rc=Oc(e=>{let{__scopeDropdownMenu:t,...n}=e,r=Mc(t);return(0,G.jsx)(Ys,{...r,...n})},`DropdownMenuPortal`),zc=`DropdownMenuContent`,Bc=U.forwardRef(Oc(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Pc(zc,n),a=Mc(n),o=U.useRef(!1);return(0,G.jsx)($s,{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`)),Vc=U.forwardRef(Oc(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Mc(n);return(0,G.jsx)(oc,{...i,...r,ref:t})},`DropdownMenuItem`)),Hc=U.forwardRef(Oc(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Mc(n);return(0,G.jsx)(cc,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),Uc=U.forwardRef(Oc(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Mc(n);return(0,G.jsx)(mc,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),Wc=U.forwardRef(Oc(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Mc(n);return(0,G.jsx)(hc,{...i,...r,ref:t})},`DropdownMenuSeparator`)),Q={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 Gc({text:e}){let t=p(),n=(0,U.useRef)(null),r=(0,U.useRef)(null),[i,o]=(0,U.useState)({width:`auto`,animate:!1});return(0,U.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let t=new ResizeObserver(([t])=>{let n=e.textContent,i=r.current!==null&&r.current!==n;r.current=n,o({width:Math.ceil(t.borderBoxSize?.[0]?.inlineSize??e.offsetWidth),animate:i})});return t.observe(e),()=>t.disconnect()},[]),(0,G.jsxs)(m.span,{className:Q.label,initial:!1,animate:{width:i.width},transition:i.animate&&!t?a.spring.morph:{duration:0},children:[(0,G.jsx)(`span`,{ref:n,className:Q.labelMeasure,"aria-hidden":`true`,children:e}),(0,G.jsx)(A,{mode:`popLayout`,initial:!1,children:(0,G.jsx)(m.span,{className:Q.labelText,initial:!t&&{opacity:0,y:`0.3em`,filter:`blur(${a.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(${a.blur.subtle}px)`,transition:{duration:a.duration.fast,ease:[...a.ease.standard]}},transition:{duration:a.duration.standard,ease:[...a.ease.enter]},children:e},e)})]})}function Kc({label:e,items:t,icon:n,iconOnly:r}){let i=p(),[o,s]=(0,U.useState)(null),c=(0,U.useRef)(!1),l=(0,U.useRef)(0);(0,U.useEffect)(()=>()=>window.clearTimeout(l.current),[]);function u(e){let t=e.target instanceof HTMLElement?e.target.closest(`[role="menuitem"]`):null;if(window.clearTimeout(l.current),!t){l.current=window.setTimeout(()=>s(null),c.current?70:0);return}let n={top:t.offsetTop,height:t.offsetHeight,danger:t.dataset.tone===`danger`},r=c.current;s(e=>({...n,glide:r&&e!==null}))}return(0,G.jsxs)(Fc,{onOpenChange:e=>{e&&(window.clearTimeout(l.current),s(null))},children:[(0,G.jsxs)(Lc,{className:[Q.trigger,r?Q.triggerIconOnly:``].filter(Boolean).join(` `),type:`button`,"aria-label":r?e:void 0,children:[n&&(0,G.jsx)(`span`,{className:Q.triggerIcon,"aria-hidden":`true`,children:n}),!r&&(0,G.jsx)(Gc,{text:e}),!r&&(0,G.jsx)(me,{className:Q.chevron,size:15,strokeWidth:1.8,"aria-hidden":`true`})]}),(0,G.jsx)(Rc,{children:(0,G.jsxs)(Bc,{className:Q.menu,sideOffset:6,align:`end`,collisionPadding:12,loop:!0,onFocus:u,onPointerMoveCapture:()=>{c.current=!0},onKeyDownCapture:()=>{c.current=!1},children:[(0,G.jsx)(m.span,{className:Q.highlight,"data-tone":o?.danger?`danger`:void 0,"aria-hidden":`true`,initial:!1,animate:o?{y:o.top,height:o.height,opacity:1}:{opacity:0},transition:{default:o?.glide&&!i?a.spring.snappy:{duration:0},opacity:{duration:i?0:.08}}}),t.map((e,t)=>(0,G.jsxs)(U.Fragment,{children:[e.separatorBefore&&(0,G.jsx)(Wc,{className:Q.separator}),(0,G.jsxs)(Vc,{className:[Q.item,e.destructive?Q.destructive:``].filter(Boolean).join(` `),"data-tone":e.destructive?`danger`:void 0,style:{"--i":t},disabled:e.disabled,onSelect:e.onSelect,children:[e.icon&&(0,G.jsx)(`span`,{className:Q.icon,"aria-hidden":`true`,children:e.icon}),e.label]})]},e.label))]})})]})}var qc=Object.defineProperty,Jc=(e,t)=>qc(e,`name`,{value:t,configurable:!0});function Yc(e,[t,n]){return Math.min(n,Math.max(t,e))}Jc(Yc,`clamp`);var Xc=Object.defineProperty,Zc=(e,t)=>Xc(e,`name`,{value:t,configurable:!0});function Qc(e){let t=U.useRef({value:e,previous:e});return U.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Zc(Qc,`usePrevious`);var $c=Object.defineProperty,el=(e,t)=>$c(e,`name`,{value:t,configurable:!0}),tl=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`}),nl=U.forwardRef(el(function(t,n){return(0,G.jsx)(e.span,{...t,ref:n,style:{...tl,...t.style}})},`VisuallyHidden`)),rl=Object.defineProperty,$=(e,t)=>rl(e,`name`,{value:t,configurable:!0}),il={ItemAligned:`item-aligned`,Popper:`popper`},al={LTR:`ltr`,RTL:`rtl`},ol=[` `,`Enter`,`ArrowUp`,`ArrowDown`],sl=[` `,`Enter`],cl=`Select`,[ll,ul,dl]=s(cl),[fl,pl]=he(cl,[dl,Lo]),ml=Lo(),[hl,gl]=fl(cl),[_l,vl]=fl(cl);function yl(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:s,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:m,form:g,internal_do_not_use_render:_}=e,v=ml(t),[b,x]=U.useState(null),[S,C]=U.useState(null),[w,T]=U.useState(!1),E=i(u),[D,O]=h({prop:r,defaultProp:a??!1,onChange:o,caller:cl}),[k,A]=h({prop:s,defaultProp:c,onChange:l,caller:cl}),j=U.useRef(null),M=U.useRef(k);U.useEffect(()=>{let e=g?b?.ownerDocument.getElementById(g):b?.form;if(e instanceof HTMLFormElement){let t=$(()=>A(M.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[g,b,A]);let N=!b||!!g||!!b.closest(`form`),[P,F]=U.useState(new Set),I=y(),L=Array.from(P).map(e=>e.props.value).join(`;`),R=U.useCallback(e=>{F(t=>new Set(t).add(e))},[]),z=U.useCallback(e=>{F(t=>{let n=new Set(t);return n.delete(e),n})},[]),B={required:m,trigger:b,onTriggerChange:x,valueNode:S,onValueNodeChange:C,valueNodeHasChildren:w,onValueNodeHasChildrenChange:T,contentId:I,value:k,onValueChange:A,open:D,onOpenChange:O,dir:E,triggerPointerDownPosRef:j,disabled:p,name:d,autoComplete:f,form:g,nativeOptions:P,nativeSelectKey:L,isFormControl:N};return(0,G.jsx)(Bo,{...v,children:(0,G.jsx)(hl,{scope:t,...B,children:(0,G.jsx)(ll.Provider,{scope:t,children:(0,G.jsx)(_l,{scope:t,onNativeOptionAdd:R,onNativeOptionRemove:z,children:ou(_)?_(B):n})})})})}$(yl,`SelectProvider`);var bl=$(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,G.jsx)(yl,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,G.jsxs)(G.Fragment,{children:[n,e?(0,G.jsx)(au,{__scopeSelect:t}):null]})})},`Select`),xl=`SelectTrigger`,Sl=U.forwardRef($(function(t,n){let{__scopeSelect:r,disabled:i=!1,...a}=t,o=ml(r),s=gl(xl,r),c=s.disabled||i,l=C(n,s.onTriggerChange),u=ul(r),d=U.useRef(`touch`),[f,p,m]=cu(e=>{let t=u().filter(e=>!e.disabled),n=lu(t,e,t.find(e=>e.value===s.value));n!==void 0&&s.onValueChange(n.value)}),h=$(e=>{c||(s.onOpenChange(!0),m()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,G.jsx)(Ho,{asChild:!0,...o,children:(0,G.jsx)(e.button,{type:`button`,role:`combobox`,"aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":`none`,dir:s.dir,"data-state":s.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":su(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===` `)&&ol.includes(e.key)&&(h(),e.preventDefault())})})})},`SelectTrigger`)),Cl=`SelectValue`,wl=U.forwardRef($(function(t,n){let{__scopeSelect:r,className:i,style:a,children:o,placeholder:s=``,...c}=t,l=gl(Cl,r),{onValueNodeHasChildrenChange:u}=l,d=o!==void 0,f=C(n,l.onValueNodeChange);g(()=>{u(d)},[u,d]);let p=su(l.value);return(0,G.jsx)(e.span,{...c,asChild:!p&&c.asChild,ref:f,style:{pointerEvents:`none`},children:(0,G.jsx)(U.Fragment,{children:p?s:o},p?`placeholder`:`value`)})},`SelectValue`)),Tl=U.forwardRef($(function(t,n){let{__scopeSelect:r,children:i,...a}=t;return(0,G.jsx)(e.span,{"aria-hidden":!0,...a,ref:n,children:i||`▼`})},`SelectIcon`)),[El,Dl]=fl(`SelectPortal`,{forceMount:void 0}),Ol=$(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,G.jsx)(El,{scope:e.__scopeSelect,forceMount:n,children:(0,G.jsx)(mn,{asChild:!0,...r})})},`SelectPortal`),kl=`SelectContent`,Al=U.forwardRef($(function(e,t){let n=Dl(kl,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=gl(kl,e.__scopeSelect),[o,s]=U.useState();return g(()=>{s(new DocumentFragment)},[]),(0,G.jsx)(V,{present:r||a.open,children:({present:e})=>e?(0,G.jsx)(Il,{...i,ref:t}):(0,G.jsx)(jl,{...i,fragment:o})})},`SelectContent`)),jl=U.forwardRef($(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?fn.createPortal((0,G.jsx)(Nl,{scope:n,children:(0,G.jsx)(ll.Slot,{scope:n,children:(0,G.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Ml=10,[Nl,Pl]=fl(kl),Fl=d(`SelectContent.RemoveScroll`),Il=U.forwardRef($(function(e,t){let{__scopeSelect:n}=e,{position:r=il.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=gl(kl,n),[y,x]=U.useState(null),[S,w]=U.useState(null),T=C(t,x),[E,D]=U.useState(null),[O,k]=U.useState(null),A=ul(n),[j,M]=U.useState(!1),N=U.useRef(!1);U.useEffect(()=>{if(y)return Rr(y)},[y]),bn();let P=U.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]),F=U.useCallback(()=>P([E,y]),[P,E,y]);U.useEffect(()=>{j&&F()},[j,F]);let{onOpenChange:I,triggerPointerDownPosRef:L}=v;U.useEffect(()=>{if(y){let e={x:0,y:0},t=$(t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},`handlePointerMove`),n=$(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||I(!1),document.removeEventListener(`pointermove`,t),L.current=null},`handlePointerUp`);return L.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,I,L]),U.useEffect(()=>{let e=$(()=>I(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[I]);let[R,z]=cu(e=>{let t=A().filter(e=>!e.disabled),n=lu(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),B=U.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]),ee=U.useCallback(()=>y?.focus(),[y]),V=U.useCallback((e,t,n)=>{let r=!N.current&&!n;(v.value!==void 0&&v.value===t||r)&&k(e)},[v.value]),te=r===il.Popper?Rl:Ll,ne=te===Rl?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,G.jsx)(Nl,{scope:n,content:y,viewport:S,onViewportChange:w,itemRefCallback:B,selectedItem:E,onItemLeave:ee,itemTextRefCallback:V,focusSelectedItem:F,selectedItemText:O,position:r,isPositioned:j,searchRef:R,children:(0,G.jsx)(kr,{as:Fl,allowPinchZoom:!0,children:(0,G.jsx)(Yt,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:b(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,G.jsx)(Rt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,G.jsx)(te,{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&&z(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(()=>P(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Ll=U.forwardRef($(function(t,n){let{__scopeSelect:r,onPlaced:i,...a}=t,o=gl(kl,r),s=Pl(kl,r),[c,l]=U.useState(null),[u,d]=U.useState(null),f=C(n,d),p=ul(r),m=U.useRef(!1),h=U.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=s,x=U.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&u&&_&&v&&y){let e=o.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),r=y.getBoundingClientRect();if(o.dir!==al.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-Ml,d=Yc(a,[Ml,Math.max(Ml,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-Ml,d=Yc(a,[Ml,Math.max(Ml,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let a=p(),s=window.innerHeight-Ml*2,l=_.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+h+l+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Ml,D=s-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+h+k,j=x-A;if(A<=E){let e=a.length>0&&v===a[a.length-1].ref.current;c.style.bottom=`0px`;let t=u.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);c.style.height=n+`px`}else{let e=a.length>0&&v===a[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}c.style.margin=`${Ml}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,i?.(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,c,u,_,v,y,o.dir,i]);g(()=>x(),[x]);let[S,w]=U.useState();g(()=>{u&&w(window.getComputedStyle(u).zIndex)},[u]);let T=U.useCallback(e=>{e&&h.current===!0&&(x(),b?.(),h.current=!1)},[x,b]);return(0,G.jsx)(zl,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:T,children:(0,G.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,G.jsx)(e.div,{...a,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...a.style}})})})},`SelectItemAlignedPosition`)),Rl=U.forwardRef($(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Ml,...a}=e,o=ml(n);return(0,G.jsx)(Ko,{...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`)),[zl,Bl]=fl(kl,{}),Vl=`SelectViewport`,Hl=U.forwardRef($(function(t,n){let{__scopeSelect:r,nonce:i,...a}=t,o=Pl(Vl,r),s=Bl(Vl,r),c=C(n,o.onViewportChange),l=U.useRef(0);return(0,G.jsxs)(G.Fragment,{children:[(0,G.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,G.jsx)(ll.Slot,{scope:r,children:(0,G.jsx)(e.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-Ml*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`)),[Ul,Wl]=fl(`SelectGroup`),Gl=`SelectItem`,[Kl,ql]=fl(Gl),Jl=U.forwardRef($(function(t,n){let{__scopeSelect:r,value:i,disabled:a=!1,textValue:o,...s}=t,c=gl(Gl,r),l=Pl(Gl,r),u=c.value===i,[d,f]=U.useState(o??``),[p,m]=U.useState(!1),h=K(e=>l.itemRefCallback?.(e,i,a)),g=C(n,h),_=y(),v=U.useRef(`touch`),x=$(()=>{c.onValueChange(i),c.onOpenChange(!1)},`handleSelect`);return(0,G.jsx)(Kl,{scope:r,value:i,disabled:a,textId:_,isSelected:u,onItemTextChange:U.useCallback(e=>{f(t=>t||(e?.textContent??``).trim())},[]),children:(0,G.jsx)(ll.ItemSlot,{scope:r,value:i,disabled:a,textValue:d,children:(0,G.jsx)(e.div,{role:`option`,"aria-labelledby":_,"data-highlighted":p?``:void 0,"aria-selected":u&&p,"data-state":u?`checked`:`unchecked`,"aria-disabled":a||void 0,"data-disabled":a?``:void 0,tabIndex:a?void 0:-1,...s,ref:g,onFocus:b(s.onFocus,()=>m(!0)),onBlur:b(s.onBlur,()=>m(!1)),onClick:b(s.onClick,()=>{a||v.current!==`mouse`&&x()}),onPointerUp:b(s.onPointerUp,()=>{a||v.current===`mouse`&&x()}),onPointerDown:b(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:b(s.onPointerMove,e=>{v.current=e.pointerType,a?l.onItemLeave?.():v.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!==` `)&&(sl.includes(e.key)&&x(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Yl=`SelectItemText`,Xl=U.forwardRef($(function(t,n){let{__scopeSelect:r,className:i,style:a,...o}=t,s=gl(Yl,r),c=Pl(Yl,r),l=ql(Yl,r),u=vl(Yl,r),[d,f]=U.useState(null),p=K(e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),m=C(n,f,l.onItemTextChange,p),h=d?.textContent,_=U.useMemo(()=>(0,G.jsx)(`option`,{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=u;return g(()=>(v(_),()=>y(_)),[v,y,_]),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(e.span,{id:l.textId,...o,ref:m}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren&&!su(s.value)?fn.createPortal(o.children,s.valueNode):null]})},`SelectItemText`)),Zl=`SelectItemIndicator`,Ql=U.forwardRef($(function(t,n){let{__scopeSelect:r,...i}=t;return ql(Zl,r).isSelected?(0,G.jsx)(e.span,{"aria-hidden":!0,...i,ref:n}):null},`SelectItemIndicator`)),$l=`SelectScrollUpButton`,eu=U.forwardRef($(function(e,t){let n=Pl($l,e.__scopeSelect),r=Bl($l,e.__scopeSelect),[i,a]=U.useState(!1),o=C(t,r.onScrollButtonChange);return g(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};$(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,G.jsx)(ru,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),tu=`SelectScrollDownButton`,nu=U.forwardRef($(function(e,t){let n=Pl(tu,e.__scopeSelect),r=Bl(tu,e.__scopeSelect),[i,a]=U.useState(!1),o=C(t,r.onScrollButtonChange);return g(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};$(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,G.jsx)(ru,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),ru=U.forwardRef($(function(t,n){let{__scopeSelect:r,onAutoScroll:i,...a}=t,o=Pl(`SelectScrollButton`,r),s=U.useRef(null),c=ul(r),l=U.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return U.useEffect(()=>()=>l(),[l]),g(()=>{c().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[c]),(0,G.jsx)(e.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`)),iu=`SelectBubbleInput`,au=U.forwardRef($(function({__scopeSelect:t,...n},r){let i=gl(iu,t),{value:a,onValueChange:o,required:s,disabled:c,name:l,autoComplete:u,form:d}=i,{nativeOptions:f,nativeSelectKey:p}=i,m=U.useRef(null),h=C(r,m),g=a??``,_=Qc(g),v=Array.from(f).some(e=>(e.props.value??``)===``);return U.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,G.jsxs)(e.select,{"aria-hidden":!0,required:s,tabIndex:-1,name:l,autoComplete:u,disabled:c,form:d,onChange:e=>o(e.target.value),...n,style:{...tl,...n.style},ref:h,defaultValue:g,children:[su(a)&&!v?(0,G.jsx)(`option`,{value:``}):null,Array.from(f)]},p)},`SelectBubbleInput`));function ou(e){return typeof e==`function`}$(ou,`isFunction`);function su(e){return e===``||e===void 0}$(su,`shouldShowPlaceholder`);function cu(e){let t=K(e),n=U.useRef(``),r=U.useRef(0),i=U.useCallback(e=>{let i=n.current+e;t(i),$((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=U.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return U.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}$(cu,`useTypeaheadSearch`);function lu(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=uu(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}$(lu,`findNextItem`);function uu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}$(uu,`wrapArray`);var du={field:`_field_1a9q6_1`,trigger:`_trigger_1a9q6_4`,valueText:`_valueText_1a9q6_9`,srOnly:`_srOnly_1a9q6_12`,chevron:`_chevron_1a9q6_13`,hint:`_hint_1a9q6_15`,content:`_content_1a9q6_18`,"select-in":`_select-in_1a9q6_1`,"select-out":`_select-out_1a9q6_1`,viewport:`_viewport_1a9q6_23`,item:`_item_1a9q6_24`,indicator:`_indicator_1a9q6_27`,"indicator-in":`_indicator-in_1a9q6_1`,scrollButton:`_scrollButton_1a9q6_28`,"select-fade":`_select-fade_1a9q6_1`,"select-fade-out":`_select-fade-out_1a9q6_1`},fu={enter:e=>({opacity:0,y:`${e*.35}em`,filter:`blur(${a.blur.soft}px)`}),center:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:a.duration.standard,ease:[...a.ease.enter]}},exit:e=>({opacity:0,y:`${e*-.3}em`,filter:`blur(${a.blur.subtle}px)`,transition:{duration:a.duration.fast,ease:[...a.ease.standard]}})},pu={enter:{opacity:0},center:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:a.duration.instant}},exit:{opacity:0,transition:{duration:a.duration.instant}}},mu=(0,U.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,U.useId)(),d=i??u,f=t?`${d}-description`:void 0,h=p(),[g,_]=(0,U.useState)(c.defaultValue??``),v=c.value??g,y=r.findIndex(e=>e.value===v),b=v?r[y]?.label??``:n,[x,S]=(0,U.useState)(y),[C,w]=(0,U.useState)(1);return x!==y&&(S(y),w(y>x?1:-1)),(0,G.jsxs)(`div`,{className:du.field,children:[(0,G.jsx)(`label`,{htmlFor:d,children:e}),(0,G.jsxs)(bl,{...c,disabled:o,onValueChange:e=>{_(e),s?.(e)},children:[(0,G.jsxs)(Sl,{ref:l,id:d,"aria-describedby":f,className:[du.trigger,a].filter(Boolean).join(` `),children:[(0,G.jsx)(`span`,{className:du.srOnly,children:(0,G.jsx)(wl,{placeholder:n})}),(0,G.jsx)(`span`,{className:du.valueText,"aria-hidden":`true`,children:(0,G.jsx)(A,{initial:!1,custom:C,children:(0,G.jsx)(m.span,{"data-placeholder":v?void 0:``,custom:C,variants:h?pu:fu,initial:`enter`,animate:`center`,exit:`exit`,children:b},v?`value-${v}`:`placeholder`)})}),(0,G.jsx)(Tl,{className:du.chevron,children:(0,G.jsx)(me,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]}),(0,G.jsx)(Ol,{children:(0,G.jsxs)(Al,{className:du.content,position:`popper`,sideOffset:4,collisionPadding:12,children:[(0,G.jsx)(eu,{className:du.scrollButton,children:(0,G.jsx)(xe,{size:16,strokeWidth:1.75,"aria-hidden":`true`})}),(0,G.jsx)(Hl,{className:du.viewport,children:r.map(e=>(0,G.jsxs)(Jl,{value:e.value,disabled:e.disabled,className:du.item,children:[(0,G.jsx)(Xl,{children:e.label}),(0,G.jsx)(Ql,{className:du.indicator,children:(0,G.jsx)(N,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]},e.value))}),(0,G.jsx)(nu,{className:du.scrollButton,children:(0,G.jsx)(me,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]})})]}),t&&(0,G.jsx)(`span`,{id:f,className:du.hint,children:t})]})}),hu={toast:`_toast_c20vg_1`,icon:`_icon_c20vg_16`,frame:`_frame_c20vg_28`,copy:`_copy_c20vg_34`,title:`_title_c20vg_43`,line:`_line_c20vg_52`,description:`_description_c20vg_59`,close:`_close_c20vg_66`},gu=()=>()=>{},_u={duration:a.duration.fast,ease:[...a.ease.standard]},vu={duration:a.duration.standard,ease:[...a.ease.enter]},yu={opacity:0,y:`0.3em`,filter:`blur(${a.blur.soft}px)`},bu={opacity:0,y:`-0.3em`,filter:`blur(${a.blur.subtle}px)`,transition:_u},xu={opacity:1,y:`0em`,filter:`blur(0px)`},Su={opacity:0,transition:{duration:a.duration.instant}},Cu={distance:80,velocity:480};function wu(e){let t=S();return(0,G.jsx)(m.span,{...e,"aria-hidden":!t||e[`aria-hidden`]})}function Tu({reduce:e,morphKey:t,children:n}){let r=(0,U.useRef)(null),i=(0,U.useRef)(null),o=k(`auto`),s=(0,U.useRef)(0);return(0,U.useLayoutEffect)(()=>{s.current=performance.now()},[t]),(0,U.useEffect)(()=>{let t=i.current;if(!t||typeof ResizeObserver>`u`)return;let n,c,l=()=>{o.jump(`auto`),r.current&&Object.assign(r.current.style,{overflow:``,height:`auto`})},u=new ResizeObserver(([i])=>{let u=i.borderBoxSize?.[0]?.blockSize??t.offsetHeight,d=o.get(),f=typeof d==`number`?d:n;if(n=u,c?.stop(),e||f===void 0||f===u||performance.now()-s.current>120)return l();r.current&&Object.assign(r.current.style,{overflow:`hidden`,height:`${f}px`}),c=se(o,[f,u],{...a.spring.smooth,onComplete:l})});return u.observe(t),()=>{u.disconnect(),c?.stop()}},[o,e]),(0,G.jsx)(m.div,{ref:r,className:hu.frame,style:{height:o},children:(0,G.jsx)(`div`,{ref:i,className:hu.copy,children:n})})}function Eu({title:e,description:t,open:n=!0,onOpenChange:r,duration:i=4500}){let o=p(),s=(0,U.useSyncExternalStore)(gu,()=>!0,()=>!1),[c]=(0,U.useState)(s),[l,u]=(0,U.useState)(!1),[d,f]=(0,U.useState)(0),[h,g]=(0,U.useState)(n);n!==h&&(g(n),n&&(u(!1),f(0)));let _=n&&!l,v=(0,U.useRef)(null),y=k(0),b=(0,U.useRef)(0);function x(e){f(e),u(!0),r?.(!1)}(0,U.useEffect)(()=>{if(!_||!r||i<=0)return;let e=window.setTimeout(()=>{f(0),u(!0),r(!1)},i);return()=>window.clearTimeout(e)},[_,r,i]);function S(e,t){let n=Math.sign(t.offset.x||t.velocity.x);if(Math.abs(t.offset.x)<Cu.distance&&Math.abs(t.velocity.x)<Cu.velocity){se(y,0,{...a.spring.snappy,velocity:t.velocity.x});return}b.current=t.velocity.x,x(n*((v.current?.offsetWidth??320)+48))}let C=o?{hidden:{opacity:0},shown:{opacity:1,transition:{duration:a.duration.instant}},exit:Su}:{hidden:{opacity:0,x:0,y:16,scale:.96},shown:{opacity:1,x:0,y:0,scale:1,transition:{...a.spring.morph,opacity:vu}},exit:e=>e?{x:e,opacity:0,transition:{x:{type:`spring`,visualDuration:.3,bounce:0,velocity:b.current,restDelta:2,restSpeed:40},opacity:{duration:a.duration.exit}}}:{opacity:0,y:8,scale:.97,transition:{duration:a.duration.exit,ease:[...a.ease.standard]}}},w={initial:o?{opacity:0}:yu,animate:xu,exit:o?Su:bu,transition:o?{duration:a.duration.instant}:vu};return(0,G.jsx)(A,{initial:c,custom:d,children:_&&(0,G.jsxs)(m.div,{ref:v,className:hu.toast,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,custom:d,variants:C,initial:`hidden`,animate:`shown`,exit:`exit`,style:{x:y},drag:o&&s?!1:`x`,dragMomentum:!1,onDragEnd:S,children:[(0,G.jsx)(`span`,{className:hu.icon,"aria-hidden":`true`,children:(0,G.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.25,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,G.jsx)(m.path,{d:`M4 12.5l5 5L20 6.5`,initial:!o&&{pathLength:0},animate:{pathLength:1},transition:{duration:a.duration.standard,ease:[...a.ease.enter],delay:.12}})})}),(0,G.jsxs)(Tu,{reduce:o,morphKey:`${e}\n${t??``}`,children:[(0,G.jsx)(`strong`,{className:hu.title,children:(0,G.jsx)(A,{mode:`popLayout`,initial:!1,children:(0,G.jsx)(wu,{className:hu.line,...w,children:e},e)})}),(0,G.jsx)(A,{mode:`popLayout`,initial:!1,children:t?(0,G.jsx)(wu,{className:hu.description,...w,children:t},t):null})]}),(0,G.jsx)(`button`,{className:hu.close,type:`button`,"aria-label":`Dismiss notification`,onClick:()=>x(0),children:(0,G.jsx)(I,{width:16,height:16,strokeWidth:2,"aria-hidden":`true`})})]},`toast`)})}function Du({open:e,onOpenChange:t,title:n,description:r,children:i,footer:a,width:o=460}){return(0,G.jsx)(hi,{open:e,onOpenChange:t,children:(0,G.jsxs)(yi,{title:n,description:r,style:{width:`min(calc(100vw - 2rem), ${o}px)`},children:[i,a&&(0,G.jsx)(`div`,{className:ie(`flex flex-wrap items-center justify-end gap-2`,i!==void 0&&`mt-6`),children:a})]})})}function Ou({label:e,icon:t,items:n,iconOnly:r}){return(0,G.jsx)(Kc,{label:e,icon:t,iconOnly:r,items:n.map(e=>({label:e.label,icon:e.icon,destructive:e.destructive,disabled:e.disabled,separatorBefore:e.separatorBefore,onSelect:e.onSelect}))})}var ku=`__astra_empty__`,Au=e=>e===``?ku:e,ju=e=>e===ku?``:e,Mu=12;function Nu({value:e,onChange:t,options:n,placeholder:r,className:i,disabled:a,label:o,ariaLabel:s}){let c=ne(),l=n.find(t=>t.value===e),u=T(o,s??r??l?.label),d=ie(`min-w-0`,u.hidden&&`astra-label-hidden`,i);return n.length>Mu?(0,G.jsx)(`div`,{className:d,children:(0,G.jsx)(kt,{label:u.label,description:u.field?.description,placeholder:r??c(`common.search`),emptyMessage:c(`common.noResults`),value:e==null?``:Au(e),onValueChange:e=>t(ju(e)),options:n.map(e=>({value:Au(e.value),label:e.detail&&e.detail!==e.label?`${e.label} · ${e.detail}`:e.label,disabled:e.disabled,keywords:e.detail?[e.detail]:void 0}))})}):(0,G.jsx)(`div`,{className:d,children:(0,G.jsx)(mu,{label:u.label,description:u.field?.description,placeholder:r??c(`common.select`),disabled:a,value:e==null||e===``&&!l?``:Au(e),onValueChange:e=>t(ju(e)),options:n.map(e=>({value:Au(e.value),label:e.label,disabled:e.disabled}))})})}var Pu=(0,U.createContext)(null);function Fu({children:e}){let t=ne(),[n,r]=(0,U.useState)([]),[i,a]=(0,U.useState)(null),o=(0,U.useRef)(0),s=(0,U.useCallback)(e=>r(t=>t.filter(t=>t.id!==e)),[]),c=(0,U.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,U.useCallback)(e=>new Promise(t=>a({...e,resolve:t})),[]),u=e=>{i?.resolve(e),a(null)};return(0,G.jsxs)(Pu.Provider,{value:{toast:c,confirm:l},children:[e,(0,G.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,G.jsx)(`div`,{className:`pointer-events-auto w-[min(100%,26rem)] selectable`,children:(0,G.jsx)(le,{tone:`danger`,title:t(`common.error`),onDismiss:()=>s(e.id),children:e.text})},e.id):(0,G.jsx)(`div`,{className:`pointer-events-auto flex w-full justify-center`,children:(0,G.jsx)(Eu,{title:e.text,open:!0,onOpenChange:t=>!t&&s(e.id)})},e.id))}),(0,G.jsx)(Du,{open:i!==null,onOpenChange:e=>!e&&u(!1),title:i?.title??``,description:i?.detail,width:420,footer:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ce,{onClick:()=>u(!1),children:t(`common.cancel`)}),(0,G.jsx)(ce,{variant:i?.destructive?`destructive`:`primary`,onClick:()=>u(!0),autoFocus:!0,children:i?.confirmLabel??t(`common.confirm`)})]})})]})}function Iu(){let e=(0,U.useContext)(Pu);if(!e)throw Error(`useFeedback outside FeedbackProvider`);return e}function Lu(e){return e instanceof Error?e.message:String(e)}export{Ue as $,qr as A,bt as B,Gr as C,$r as D,ci as E,Tt as F,dt as G,Ze as H,gt as I,ut as J,pt as K,_t as L,Rt as M,Dt as N,Zr as O,Et as P,tt as Q,vt as R,Lo as S,ri as T,Qe as U,nt as V,$e as W,mt as X,rt as Y,ft as Z,xs as _,Ce as _t,Lu as a,Ke as at,Ho as b,Fc as c,Ne as ct,Vc as d,Fe as dt,We as et,Uc as f,Le as ft,vs as g,we as gt,Lc as h,Te as ht,Du as i,Re as it,mn as j,si as k,Hc as l,ke as lt,Wc as m,Ie as mt,Ou as n,Je as nt,Iu as o,Ge as ot,Rc as p,Me as pt,lt as q,Nu as r,Ye as rt,nl as s,He as st,Fu as t,Xe as tt,Bc as u,Pe as ut,ps as v,ye as vt,ui as w,Ko as x,Bo as y,yt as z};