tokentracker-cli 0.5.90 → 0.5.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/dist/assets/main-CHSJgtKj.js +5156 -0
- package/dashboard/dist/assets/main-DI4xYfKR.css +1 -0
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +1 -1
- package/dashboard/dist/assets/Card-DmEuggKt.js +0 -1
- package/dashboard/dist/assets/DashboardPage-y-23SkNx.js +0 -1
- package/dashboard/dist/assets/FadeIn-CIKEJ1mC.js +0 -1
- package/dashboard/dist/assets/IpCheckPage-gySQmJPU.js +0 -1
- package/dashboard/dist/assets/LeaderboardPage-NXXlBlrm.js +0 -5
- package/dashboard/dist/assets/LeaderboardProfilePage-DzLc0enb.js +0 -1
- package/dashboard/dist/assets/LimitsPage-DuFEVRFB.js +0 -2
- package/dashboard/dist/assets/PopoverPopup-RgvO6hnU.js +0 -12
- package/dashboard/dist/assets/ProviderIcon-C4FxGWlI.js +0 -1
- package/dashboard/dist/assets/SettingsPage-CmdNVChM.js +0 -1
- package/dashboard/dist/assets/SkillsPage-Dkv9LvM1.js +0 -1
- package/dashboard/dist/assets/WidgetsPage-C8SSZ3VZ.js +0 -1
- package/dashboard/dist/assets/chevron-down-BS4d25ie.js +0 -1
- package/dashboard/dist/assets/download-Cs4or3vN.js +0 -1
- package/dashboard/dist/assets/leaderboard-columns-5fNRo700.js +0 -1
- package/dashboard/dist/assets/main-Dirgz7qK.js +0 -5141
- package/dashboard/dist/assets/main-HVmSQFS6.css +0 -1
- package/dashboard/dist/assets/refresh-cw-oESlYWjZ.js +0 -1
- package/dashboard/dist/assets/use-limits-display-prefs-LMbFljwt.js +0 -1
- package/dashboard/dist/assets/use-native-settings-B9dgqLeX.js +0 -1
- package/dashboard/dist/assets/use-usage-limits-Z6xWV0y7.js +0 -1
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{r as s,R as V,a6 as Ge,D as d,a7 as P,a8 as Jn,a9 as Zn,N as Qn,O as er,aa as tr,h as nr,j as rr,B as C,ab as or,S as ar,a4 as Dt,L as ir,ac as sr,ad as lr,ae as Gt,af as cr}from"./main-Dirgz7qK.js";import{P as dr}from"./ProviderIcon-C4FxGWlI.js";import{L as mn,a as xn,b as ct,l as Et,c as jt,d as ur,e as Vt}from"./leaderboard-columns-5fNRo700.js";import{C as fr}from"./chevron-down-BS4d25ie.js";function gr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const ht=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $e(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function zt(e){return"nodeType"in e}function q(e){var t,n;return e?$e(e)?e:zt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Bt(e){const{Document:t}=q(e);return e instanceof t}function nt(e){return $e(e)?!1:e instanceof q(e).HTMLElement}function vn(e){return e instanceof q(e).SVGElement}function Fe(e){return e?$e(e)?e.document:zt(e)?Bt(e)?e:nt(e)||vn(e)?e.ownerDocument:document:document:document}const pe=ht?s.useLayoutEffect:s.useEffect;function $t(e){const t=s.useRef(e);return pe(()=>{t.current=e}),s.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function hr(){const e=s.useRef(null),t=s.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=s.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ze(e,t){t===void 0&&(t=[e]);const n=s.useRef(e);return pe(()=>{n.current!==e&&(n.current=e)},t),n}function rt(e,t){const n=s.useRef();return s.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function dt(e){const t=$t(e),n=s.useRef(null),r=s.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function At(e){const t=s.useRef();return s.useEffect(()=>{t.current=e},[e]),t.current}let kt={};function ot(e,t){return s.useMemo(()=>{if(t)return t;const n=kt[e]==null?0:kt[e]+1;return kt[e]=n,e+"-"+n},[e,t])}function yn(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((a,i)=>{const l=Object.entries(i);for(const[c,u]of l){const g=a[c];g!=null&&(a[c]=g+e*u)}return a},{...t})}}const ze=yn(1),Qe=yn(-1);function pr(e){return"clientX"in e&&"clientY"in e}function Ft(e){if(!e)return!1;const{KeyboardEvent:t}=q(e.target);return t&&e instanceof t}function br(e){if(!e)return!1;const{TouchEvent:t}=q(e.target);return t&&e instanceof t}function It(e){if(br(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return pr(e)?{x:e.clientX,y:e.clientY}:null}const et=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[et.Translate.toString(e),et.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),qt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function mr(e){return e.matches(qt)?e:e.querySelector(qt)}const xr={display:"none"};function vr(e){let{id:t,value:n}=e;return V.createElement("div",{id:t,style:xr},n)}function yr(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return V.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function wr(){const[e,t]=s.useState("");return{announce:s.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const wn=s.createContext(null);function kr(e){const t=s.useContext(wn);s.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Sr(){const[e]=s.useState(()=>new Set),t=s.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[s.useCallback(r=>{let{type:o,event:a}=r;e.forEach(i=>{var l;return(l=i[o])==null?void 0:l.call(i,a)})},[e]),t]}const Cr={draggable:`
|
|
2
|
-
To pick up a draggable item, press the space bar.
|
|
3
|
-
While dragging, use the arrow keys to move the item.
|
|
4
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
-
`},Nr={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Rr(e){let{announcements:t=Nr,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Cr}=e;const{announce:a,announcement:i}=wr(),l=ot("DndLiveRegion"),[c,u]=s.useState(!1);if(s.useEffect(()=>{u(!0)},[]),kr(s.useMemo(()=>({onDragStart(f){let{active:b}=f;a(t.onDragStart({active:b}))},onDragMove(f){let{active:b,over:p}=f;t.onDragMove&&a(t.onDragMove({active:b,over:p}))},onDragOver(f){let{active:b,over:p}=f;a(t.onDragOver({active:b,over:p}))},onDragEnd(f){let{active:b,over:p}=f;a(t.onDragEnd({active:b,over:p}))},onDragCancel(f){let{active:b,over:p}=f;a(t.onDragCancel({active:b,over:p}))}}),[a,t])),!c)return null;const g=V.createElement(V.Fragment,null,V.createElement(vr,{id:r,value:o.draggable}),V.createElement(yr,{id:l,announcement:i}));return n?Ge.createPortal(g,n):g}var z;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(z||(z={}));function ut(){}function Jt(e,t){return s.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Dr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ue=Object.freeze({x:0,y:0});function kn(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Sn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Er(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Zt(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function Cn(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Qt(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const jr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Qt(t,t.left,t.top),a=[];for(const i of r){const{id:l}=i,c=n.get(l);if(c){const u=kn(Qt(c),o);a.push({id:l,data:{droppableContainer:i,value:u}})}}return a.sort(Sn)},Ar=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Zt(t),a=[];for(const i of r){const{id:l}=i,c=n.get(l);if(c){const u=Zt(c),g=o.reduce((b,p,w)=>b+kn(u[w],p),0),f=Number((g/4).toFixed(4));a.push({id:l,data:{droppableContainer:i,value:f}})}}return a.sort(Sn)};function Ir(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),i=o-r,l=a-n;if(r<o&&n<a){const c=t.width*t.height,u=e.width*e.height,g=i*l,f=g/(c+u-g);return Number(f.toFixed(4))}return 0}const Mr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const a of r){const{id:i}=a,l=n.get(i);if(l){const c=Ir(l,t);c>0&&o.push({id:i,data:{droppableContainer:a,value:c}})}}return o.sort(Er)};function Tr(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Nn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ue}function Lr(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return o.reduce((i,l)=>({...i,top:i.top+e*l.y,bottom:i.bottom+e*l.y,left:i.left+e*l.x,right:i.right+e*l.x}),{...n})}}const Or=Lr(1);function _r(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Pr(e,t,n){const r=_r(t);if(!r)return e;const{scaleX:o,scaleY:a,x:i,y:l}=r,c=e.left-i-(1-o)*parseFloat(n),u=e.top-l-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),g=o?e.width/o:e.width,f=a?e.height/a:e.height;return{width:g,height:f,top:u,right:c+g,bottom:u+f,left:c}}const zr={ignoreTransform:!1};function Ue(e,t){t===void 0&&(t=zr);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:g}=q(e).getComputedStyle(e);u&&(n=Pr(n,u,g))}const{top:r,left:o,width:a,height:i,bottom:l,right:c}=n;return{top:r,left:o,width:a,height:i,bottom:l,right:c}}function en(e){return Ue(e,{ignoreTransform:!0})}function Br(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function $r(e,t){return t===void 0&&(t=q(e).getComputedStyle(e)),t.position==="fixed"}function Fr(e,t){t===void 0&&(t=q(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const a=t[o];return typeof a=="string"?n.test(a):!1})}function pt(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Bt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!nt(o)||vn(o)||n.includes(o))return n;const a=q(e).getComputedStyle(o);return o!==e&&Fr(o,a)&&n.push(o),$r(o,a)?n:r(o.parentNode)}return e?r(e):n}function Rn(e){const[t]=pt(e,1);return t??null}function St(e){return!ht||!e?null:$e(e)?e:zt(e)?Bt(e)||e===Fe(e).scrollingElement?window:nt(e)?e:null:null}function Dn(e){return $e(e)?e.scrollX:e.scrollLeft}function En(e){return $e(e)?e.scrollY:e.scrollTop}function Mt(e){return{x:Dn(e),y:En(e)}}var B;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(B||(B={}));function jn(e){return!ht||!e?!1:e===document.scrollingElement}function An(e){const t={x:0,y:0},n=jn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,i=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:a,isBottom:i,isRight:l,maxScroll:r,minScroll:t}}const Ur={x:.2,y:.2};function Yr(e,t,n,r,o){let{top:a,left:i,right:l,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=Ur);const{isTop:u,isBottom:g,isLeft:f,isRight:b}=An(e),p={x:0,y:0},w={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!u&&a<=t.top+m.height?(p.y=B.Backward,w.y=r*Math.abs((t.top+m.height-a)/m.height)):!g&&c>=t.bottom-m.height&&(p.y=B.Forward,w.y=r*Math.abs((t.bottom-m.height-c)/m.height)),!b&&l>=t.right-m.width?(p.x=B.Forward,w.x=r*Math.abs((t.right-m.width-l)/m.width)):!f&&i<=t.left+m.width&&(p.x=B.Backward,w.x=r*Math.abs((t.left+m.width-i)/m.width)),{direction:p,speed:w}}function Wr(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:i}=window;return{top:0,left:0,right:a,bottom:i,width:a,height:i}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function In(e){return e.reduce((t,n)=>ze(t,Mt(n)),ue)}function Xr(e){return e.reduce((t,n)=>t+Dn(n),0)}function Kr(e){return e.reduce((t,n)=>t+En(n),0)}function Hr(e,t){if(t===void 0&&(t=Ue),!e)return;const{top:n,left:r,bottom:o,right:a}=t(e);Rn(e)&&(o<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Gr=[["x",["left","right"],Xr],["y",["top","bottom"],Kr]];class Ut{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=pt(n),o=In(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,i,l]of Gr)for(const c of i)Object.defineProperty(this,c,{get:()=>{const u=l(r),g=o[a]-u;return this.rect[c]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ve{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Vr(e){const{EventTarget:t}=q(e);return e instanceof t?e:Fe(e)}function Ct(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var se;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(se||(se={}));function tn(e){e.preventDefault()}function qr(e){e.stopPropagation()}var D;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(D||(D={}));const Mn={start:[D.Space,D.Enter],cancel:[D.Esc],end:[D.Space,D.Enter,D.Tab]},Jr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case D.Right:return{...n,x:n.x+25};case D.Left:return{...n,x:n.x-25};case D.Down:return{...n,y:n.y+25};case D.Up:return{...n,y:n.y-25}}};class Yt{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ve(Fe(n)),this.windowListeners=new Ve(q(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(se.Resize,this.handleCancel),this.windowListeners.add(se.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(se.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Hr(r),n(ue)}handleKeyDown(t){if(Ft(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:a=Mn,coordinateGetter:i=Jr,scrollBehavior:l="smooth"}=o,{code:c}=t;if(a.end.includes(c)){this.handleEnd(t);return}if(a.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,g=u?{x:u.left,y:u.top}:ue;this.referenceCoordinates||(this.referenceCoordinates=g);const f=i(t,{active:n,context:r.current,currentCoordinates:g});if(f){const b=Qe(f,g),p={x:0,y:0},{scrollableAncestors:w}=r.current;for(const m of w){const x=t.code,{isTop:k,isRight:N,isLeft:v,isBottom:R,maxScroll:E,minScroll:j}=An(m),S=Wr(m),y={x:Math.min(x===D.Right?S.right-S.width/2:S.right,Math.max(x===D.Right?S.left:S.left+S.width/2,f.x)),y:Math.min(x===D.Down?S.bottom-S.height/2:S.bottom,Math.max(x===D.Down?S.top:S.top+S.height/2,f.y))},I=x===D.Right&&!N||x===D.Left&&!v,O=x===D.Down&&!R||x===D.Up&&!k;if(I&&y.x!==f.x){const M=m.scrollLeft+b.x,J=x===D.Right&&M<=E.x||x===D.Left&&M>=j.x;if(J&&!b.y){m.scrollTo({left:M,behavior:l});return}J?p.x=m.scrollLeft-M:p.x=x===D.Right?m.scrollLeft-E.x:m.scrollLeft-j.x,p.x&&m.scrollBy({left:-p.x,behavior:l});break}else if(O&&y.y!==f.y){const M=m.scrollTop+b.y,J=x===D.Down&&M<=E.y||x===D.Up&&M>=j.y;if(J&&!b.x){m.scrollTo({top:M,behavior:l});return}J?p.y=m.scrollTop-M:p.y=x===D.Down?m.scrollTop-E.y:m.scrollTop-j.y,p.y&&m.scrollBy({top:-p.y,behavior:l});break}}this.handleMove(t,ze(Qe(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Yt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Mn,onActivation:o}=t,{active:a}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const l=a.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function nn(e){return!!(e&&"distance"in e)}function rn(e){return!!(e&&"delay"in e)}class Wt{constructor(t,n,r){var o;r===void 0&&(r=Vr(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:a}=t,{target:i}=a;this.props=t,this.events=n,this.document=Fe(i),this.documentListeners=new Ve(this.document),this.listeners=new Ve(r),this.windowListeners=new Ve(q(i)),this.initialCoordinates=(o=It(a))!=null?o:ue,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(se.Resize,this.handleCancel),this.windowListeners.add(se.DragStart,tn),this.windowListeners.add(se.VisibilityChange,this.handleCancel),this.windowListeners.add(se.ContextMenu,tn),this.documentListeners.add(se.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(rn(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(nn(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(se.Click,qr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(se.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:a}=this,{onMove:i,options:{activationConstraint:l}}=a;if(!o)return;const c=(n=It(t))!=null?n:ue,u=Qe(o,c);if(!r&&l){if(nn(l)){if(l.tolerance!=null&&Ct(u,l.tolerance))return this.handleCancel();if(Ct(u,l.distance))return this.handleStart()}if(rn(l)&&Ct(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),i(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===D.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Zr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Xt extends Wt{constructor(t){const{event:n}=t,r=Fe(n.target);super(t,Zr,r)}}Xt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const Qr={move:{name:"mousemove"},end:{name:"mouseup"}};var Tt;(function(e){e[e.RightClick=2]="RightClick"})(Tt||(Tt={}));class eo extends Wt{constructor(t){super(t,Qr,Fe(t.event.target))}}eo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Tt.RightClick?!1:(r?.({event:n}),!0)}}];const Nt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class to extends Wt{constructor(t){super(t,Nt)}static setup(){return window.addEventListener(Nt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Nt.move.name,t)};function t(){}}}to.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var qe;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(qe||(qe={}));var ft;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ft||(ft={}));function no(e){let{acceleration:t,activator:n=qe.Pointer,canScroll:r,draggingRect:o,enabled:a,interval:i=5,order:l=ft.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:g,delta:f,threshold:b}=e;const p=oo({delta:f,disabled:!a}),[w,m]=hr(),x=s.useRef({x:0,y:0}),k=s.useRef({x:0,y:0}),N=s.useMemo(()=>{switch(n){case qe.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case qe.DraggableRect:return o}},[n,o,c]),v=s.useRef(null),R=s.useCallback(()=>{const j=v.current;if(!j)return;const S=x.current.x*k.current.x,y=x.current.y*k.current.y;j.scrollBy(S,y)},[]),E=s.useMemo(()=>l===ft.TreeOrder?[...u].reverse():u,[l,u]);s.useEffect(()=>{if(!a||!u.length||!N){m();return}for(const j of E){if(r?.(j)===!1)continue;const S=u.indexOf(j),y=g[S];if(!y)continue;const{direction:I,speed:O}=Yr(j,y,N,t,b);for(const M of["x","y"])p[M][I[M]]||(O[M]=0,I[M]=0);if(O.x>0||O.y>0){m(),v.current=j,w(R,i),x.current=O,k.current=I;return}}x.current={x:0,y:0},k.current={x:0,y:0},m()},[t,R,r,m,a,i,JSON.stringify(N),JSON.stringify(p),w,u,E,g,JSON.stringify(b)])}const ro={x:{[B.Backward]:!1,[B.Forward]:!1},y:{[B.Backward]:!1,[B.Forward]:!1}};function oo(e){let{delta:t,disabled:n}=e;const r=At(t);return rt(o=>{if(n||!r||!o)return ro;const a={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[B.Backward]:o.x[B.Backward]||a.x===-1,[B.Forward]:o.x[B.Forward]||a.x===1},y:{[B.Backward]:o.y[B.Backward]||a.y===-1,[B.Forward]:o.y[B.Forward]||a.y===1}}},[n,t,r])}function ao(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return rt(o=>{var a;return t==null?null:(a=r??o)!=null?a:null},[r,t])}function io(e,t){return s.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,a=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,r)}));return[...n,...a]},[]),[e,t])}var tt;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(tt||(tt={}));var Lt;(function(e){e.Optimized="optimized"})(Lt||(Lt={}));const on=new Map;function so(e,t){let{dragging:n,dependencies:r,config:o}=t;const[a,i]=s.useState(null),{frequency:l,measure:c,strategy:u}=o,g=s.useRef(e),f=x(),b=Ze(f),p=s.useCallback(function(k){k===void 0&&(k=[]),!b.current&&i(N=>N===null?k:N.concat(k.filter(v=>!N.includes(v))))},[b]),w=s.useRef(null),m=rt(k=>{if(f&&!n)return on;if(!k||k===on||g.current!==e||a!=null){const N=new Map;for(let v of e){if(!v)continue;if(a&&a.length>0&&!a.includes(v.id)&&v.rect.current){N.set(v.id,v.rect.current);continue}const R=v.node.current,E=R?new Ut(c(R),R):null;v.rect.current=E,E&&N.set(v.id,E)}return N}return k},[e,a,n,f,c]);return s.useEffect(()=>{g.current=e},[e]),s.useEffect(()=>{f||p()},[n,f]),s.useEffect(()=>{a&&a.length>0&&i(null)},[JSON.stringify(a)]),s.useEffect(()=>{f||typeof l!="number"||w.current!==null||(w.current=setTimeout(()=>{p(),w.current=null},l))},[l,f,p,...r]),{droppableRects:m,measureDroppableContainers:p,measuringScheduled:a!=null};function x(){switch(u){case tt.Always:return!1;case tt.BeforeDragging:return n;default:return!n}}}function Tn(e,t){return rt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function lo(e,t){return Tn(e,t)}function co(e){let{callback:t,disabled:n}=e;const r=$t(t),o=s.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(r)},[r,n]);return s.useEffect(()=>()=>o?.disconnect(),[o]),o}function bt(e){let{callback:t,disabled:n}=e;const r=$t(t),o=s.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(r)},[n]);return s.useEffect(()=>()=>o?.disconnect(),[o]),o}function uo(e){return new Ut(Ue(e),e)}function an(e,t,n){t===void 0&&(t=uo);const[r,o]=s.useState(null);function a(){o(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}const g=t(e);return JSON.stringify(c)===JSON.stringify(g)?c:g})}const i=co({callback(c){if(e)for(const u of c){const{type:g,target:f}=u;if(g==="childList"&&f instanceof HTMLElement&&f.contains(e)){a();break}}}}),l=bt({callback:a});return pe(()=>{a(),e?(l?.observe(e),i?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),i?.disconnect())},[e]),r}function fo(e){const t=Tn(e);return Nn(e,t)}const sn=[];function go(e){const t=s.useRef(e),n=rt(r=>e?r&&r!==sn&&e&&t.current&&e.parentNode===t.current.parentNode?r:pt(e):sn,[e]);return s.useEffect(()=>{t.current=e},[e]),n}function ho(e){const[t,n]=s.useState(null),r=s.useRef(e),o=s.useCallback(a=>{const i=St(a.target);i&&n(l=>l?(l.set(i,Mt(i)),new Map(l)):null)},[]);return s.useEffect(()=>{const a=r.current;if(e!==a){i(a);const l=e.map(c=>{const u=St(c);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,Mt(u)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=e}return()=>{i(e),i(a)};function i(l){l.forEach(c=>{const u=St(c);u?.removeEventListener("scroll",o)})}},[o,e]),s.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,i)=>ze(a,i),ue):In(e):ue,[e,t])}function ln(e,t){t===void 0&&(t=[]);const n=s.useRef(null);return s.useEffect(()=>{n.current=null},t),s.useEffect(()=>{const r=e!==ue;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Qe(e,n.current):ue}function po(e){s.useEffect(()=>{if(!ht)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function bo(e,t){return s.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:a}=r;return n[o]=i=>{a(i,t)},n},{}),[e,t])}function Ln(e){return s.useMemo(()=>e?Br(e):null,[e])}const cn=[];function mo(e,t){t===void 0&&(t=Ue);const[n]=e,r=Ln(n?q(n):null),[o,a]=s.useState(cn);function i(){a(()=>e.length?e.map(c=>jn(c)?r:new Ut(t(c),c)):cn)}const l=bt({callback:i});return pe(()=>{l?.disconnect(),i(),e.forEach(c=>l?.observe(c))},[e]),o}function xo(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return nt(t)?t:e}function vo(e){let{measure:t}=e;const[n,r]=s.useState(null),o=s.useCallback(u=>{for(const{target:g}of u)if(nt(g)){r(f=>{const b=t(g);return f?{...f,width:b.width,height:b.height}:b});break}},[t]),a=bt({callback:o}),i=s.useCallback(u=>{const g=xo(u);a?.disconnect(),g&&a?.observe(g),r(g?t(g):null)},[t,a]),[l,c]=dt(i);return s.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const yo=[{sensor:Xt,options:{}},{sensor:Yt,options:{}}],wo={current:{}},lt={draggable:{measure:en},droppable:{measure:en,strategy:tt.WhileDragging,frequency:Lt.Optimized},dragOverlay:{measure:Ue}};class Je extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const ko={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Je,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ut},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:lt,measureDroppableContainers:ut,windowRect:null,measuringScheduled:!1},So={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ut,draggableNodes:new Map,over:null,measureDroppableContainers:ut},mt=s.createContext(So),On=s.createContext(ko);function Co(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Je}}}function No(e,t){switch(t.type){case z.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case z.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case z.DragEnd:case z.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case z.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Je(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case z.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const i=new Je(e.droppable.containers);return i.set(n,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case z.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new Je(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Ro(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=s.useContext(mt),a=At(r),i=At(n?.id);return s.useEffect(()=>{if(!t&&!r&&a&&i!=null){if(!Ft(a)||document.activeElement===a.target)return;const l=o.get(i);if(!l)return;const{activatorNode:c,node:u}=l;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const g of[c.current,u.current]){if(!g)continue;const f=mr(g);if(f){f.focus();break}}})}},[r,t,o,i,a]),null}function Do(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...r}),n):n}function Eo(e){return s.useMemo(()=>({draggable:{...lt.draggable,...e?.draggable},droppable:{...lt.droppable,...e?.droppable},dragOverlay:{...lt.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function jo(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const a=s.useRef(!1),{x:i,y:l}=typeof o=="boolean"?{x:o,y:o}:o;pe(()=>{if(!i&&!l||!t){a.current=!1;return}if(a.current||!r)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const g=n(u),f=Nn(g,r);if(i||(f.x=0),l||(f.y=0),a.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const b=Rn(u);b&&b.scrollBy({top:f.y,left:f.x})}},[t,i,l,r,n])}const _n=s.createContext({...ue,scaleX:1,scaleY:1});var Ee;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ee||(Ee={}));const Ao=s.memo(function(t){var n,r,o,a;let{id:i,accessibility:l,autoScroll:c=!0,children:u,sensors:g=yo,collisionDetection:f=Mr,measuring:b,modifiers:p,...w}=t;const m=s.useReducer(No,void 0,Co),[x,k]=m,[N,v]=Sr(),[R,E]=s.useState(Ee.Uninitialized),j=R===Ee.Initialized,{draggable:{active:S,nodes:y,translate:I},droppable:{containers:O}}=x,M=S!=null?y.get(S):null,J=s.useRef({initial:null,translated:null}),Z=s.useMemo(()=>{var X;return S!=null?{id:S,data:(X=M?.data)!=null?X:wo,rect:J}:null},[S,M]),L=s.useRef(null),[be,Ie]=s.useState(null),[K,je]=s.useState(null),ne=Ze(w,Object.values(w)),H=ot("DndDescribedBy",i),Me=s.useMemo(()=>O.getEnabled(),[O]),W=Eo(b),{droppableRects:re,measureDroppableContainers:$,measuringScheduled:fe}=so(Me,{dragging:j,dependencies:[I.x,I.y],config:W.droppable}),_=ao(y,S),Te=s.useMemo(()=>K?It(K):null,[K]),le=qn(),oe=lo(_,W.draggable.measure);jo({activeNode:S!=null?y.get(S):null,config:le.layoutShiftCompensation,initialRect:oe,measure:W.draggable.measure});const A=an(_,W.draggable.measure,oe),we=an(_?_.parentElement:null),G=s.useRef({activatorEvent:null,active:null,activeNode:_,collisionRect:null,collisions:null,droppableRects:re,draggableNodes:y,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ke=O.getNodeFor((n=G.current.over)==null?void 0:n.id),ae=vo({measure:W.dragOverlay.measure}),me=(r=ae.nodeRef.current)!=null?r:_,xe=j?(o=ae.rect)!=null?o:A:null,Ye=!!(ae.nodeRef.current&&ae.rect),Le=fo(Ye?null:A),We=Ln(me?q(me):null),ce=go(j?ke??_:null),Ae=mo(ce),Oe=Do(p,{transform:{x:I.x-Le.x,y:I.y-Le.y,scaleX:1,scaleY:1},activatorEvent:K,active:Z,activeNodeRect:A,containerNodeRect:we,draggingNodeRect:xe,over:G.current.over,overlayNodeRect:ae.rect,scrollableAncestors:ce,scrollableAncestorRects:Ae,windowRect:We}),Se=Te?ze(Te,I):null,_e=ho(ce),h=ln(_e),T=ln(_e,[A]),F=ze(Oe,h),ve=xe?Or(xe,Oe):null,Ce=Z&&ve?f({active:Z,collisionRect:ve,droppableRects:re,droppableContainers:Me,pointerCoordinates:Se}):null,at=Cn(Ce,"id"),[U,xt]=s.useState(null),vt=Ye?Oe:ze(Oe,T),Kn=Tr(vt,(a=U?.rect)!=null?a:null,A),yt=s.useRef(null),Kt=s.useCallback((X,Q)=>{let{sensor:ee,options:Ne}=Q;if(L.current==null)return;const ie=y.get(L.current);if(!ie)return;const te=X.nativeEvent,ge=new ee({active:L.current,activeNode:ie,event:te,options:Ne,context:G,onAbort(Y){if(!y.get(Y))return;const{onDragAbort:he}=ne.current,ye={id:Y};he?.(ye),N({type:"onDragAbort",event:ye})},onPending(Y,Re,he,ye){if(!y.get(Y))return;const{onDragPending:Ke}=ne.current,De={id:Y,constraint:Re,initialCoordinates:he,offset:ye};Ke?.(De),N({type:"onDragPending",event:De})},onStart(Y){const Re=L.current;if(Re==null)return;const he=y.get(Re);if(!he)return;const{onDragStart:ye}=ne.current,Xe={activatorEvent:te,active:{id:Re,data:he.data,rect:J}};Ge.unstable_batchedUpdates(()=>{ye?.(Xe),E(Ee.Initializing),k({type:z.DragStart,initialCoordinates:Y,active:Re}),N({type:"onDragStart",event:Xe}),Ie(yt.current),je(te)})},onMove(Y){k({type:z.DragMove,coordinates:Y})},onEnd:Pe(z.DragEnd),onCancel:Pe(z.DragCancel)});yt.current=ge;function Pe(Y){return async function(){const{active:he,collisions:ye,over:Xe,scrollAdjustedTranslate:Ke}=G.current;let De=null;if(he&&Ke){const{cancelDrop:He}=ne.current;De={activatorEvent:te,active:he,collisions:ye,delta:Ke,over:Xe},Y===z.DragEnd&&typeof He=="function"&&await Promise.resolve(He(De))&&(Y=z.DragCancel)}L.current=null,Ge.unstable_batchedUpdates(()=>{k({type:Y}),E(Ee.Uninitialized),xt(null),Ie(null),je(null),yt.current=null;const He=Y===z.DragEnd?"onDragEnd":"onDragCancel";if(De){const wt=ne.current[He];wt?.(De),N({type:He,event:De})}})}}},[y]),Hn=s.useCallback((X,Q)=>(ee,Ne)=>{const ie=ee.nativeEvent,te=y.get(Ne);if(L.current!==null||!te||ie.dndKit||ie.defaultPrevented)return;const ge={active:te};X(ee,Q.options,ge)===!0&&(ie.dndKit={capturedBy:Q.sensor},L.current=Ne,Kt(ee,Q))},[y,Kt]),Ht=io(g,Hn);po(g),pe(()=>{A&&R===Ee.Initializing&&E(Ee.Initialized)},[A,R]),s.useEffect(()=>{const{onDragMove:X}=ne.current,{active:Q,activatorEvent:ee,collisions:Ne,over:ie}=G.current;if(!Q||!ee)return;const te={active:Q,activatorEvent:ee,collisions:Ne,delta:{x:F.x,y:F.y},over:ie};Ge.unstable_batchedUpdates(()=>{X?.(te),N({type:"onDragMove",event:te})})},[F.x,F.y]),s.useEffect(()=>{const{active:X,activatorEvent:Q,collisions:ee,droppableContainers:Ne,scrollAdjustedTranslate:ie}=G.current;if(!X||L.current==null||!Q||!ie)return;const{onDragOver:te}=ne.current,ge=Ne.get(at),Pe=ge&&ge.rect.current?{id:ge.id,rect:ge.rect.current,data:ge.data,disabled:ge.disabled}:null,Y={active:X,activatorEvent:Q,collisions:ee,delta:{x:ie.x,y:ie.y},over:Pe};Ge.unstable_batchedUpdates(()=>{xt(Pe),te?.(Y),N({type:"onDragOver",event:Y})})},[at]),pe(()=>{G.current={activatorEvent:K,active:Z,activeNode:_,collisionRect:ve,collisions:Ce,droppableRects:re,draggableNodes:y,draggingNode:me,draggingNodeRect:xe,droppableContainers:O,over:U,scrollableAncestors:ce,scrollAdjustedTranslate:F},J.current={initial:xe,translated:ve}},[Z,_,Ce,ve,y,me,xe,re,O,U,ce,F]),no({...le,delta:I,draggingRect:ve,pointerCoordinates:Se,scrollableAncestors:ce,scrollableAncestorRects:Ae});const Gn=s.useMemo(()=>({active:Z,activeNode:_,activeNodeRect:A,activatorEvent:K,collisions:Ce,containerNodeRect:we,dragOverlay:ae,draggableNodes:y,droppableContainers:O,droppableRects:re,over:U,measureDroppableContainers:$,scrollableAncestors:ce,scrollableAncestorRects:Ae,measuringConfiguration:W,measuringScheduled:fe,windowRect:We}),[Z,_,A,K,Ce,we,ae,y,O,re,U,$,ce,Ae,W,fe,We]),Vn=s.useMemo(()=>({activatorEvent:K,activators:Ht,active:Z,activeNodeRect:A,ariaDescribedById:{draggable:H},dispatch:k,draggableNodes:y,over:U,measureDroppableContainers:$}),[K,Ht,Z,A,k,H,y,U,$]);return V.createElement(wn.Provider,{value:v},V.createElement(mt.Provider,{value:Vn},V.createElement(On.Provider,{value:Gn},V.createElement(_n.Provider,{value:Kn},u)),V.createElement(Ro,{disabled:l?.restoreFocus===!1})),V.createElement(Rr,{...l,hiddenTextDescribedById:H}));function qn(){const X=be?.autoScrollEnabled===!1,Q=typeof c=="object"?c.enabled===!1:c===!1,ee=j&&!X&&!Q;return typeof c=="object"?{...c,enabled:ee}:{enabled:ee}}}),Io=s.createContext(null),dn="button",Mo="Draggable";function To(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const a=ot(Mo),{activators:i,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:g,draggableNodes:f,over:b}=s.useContext(mt),{role:p=dn,roleDescription:w="draggable",tabIndex:m=0}=o??{},x=c?.id===t,k=s.useContext(x?_n:Io),[N,v]=dt(),[R,E]=dt(),j=bo(i,t),S=Ze(n);pe(()=>(f.set(t,{id:t,key:a,node:N,activatorNode:R,data:S}),()=>{const I=f.get(t);I&&I.key===a&&f.delete(t)}),[f,t]);const y=s.useMemo(()=>({role:p,tabIndex:m,"aria-disabled":r,"aria-pressed":x&&p===dn?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[r,p,m,x,w,g.draggable]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:y,isDragging:x,listeners:r?void 0:j,node:N,over:b,setNodeRef:v,setActivatorNodeRef:E,transform:k}}function Lo(){return s.useContext(On)}const Oo="Droppable",_o={timeout:25};function Po(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const a=ot(Oo),{active:i,dispatch:l,over:c,measureDroppableContainers:u}=s.useContext(mt),g=s.useRef({disabled:n}),f=s.useRef(!1),b=s.useRef(null),p=s.useRef(null),{disabled:w,updateMeasurementsFor:m,timeout:x}={..._o,...o},k=Ze(m??r),N=s.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(k.current)?k.current:[k.current]),p.current=null},x)},[x]),v=bt({callback:N,disabled:w||!i}),R=s.useCallback((y,I)=>{v&&(I&&(v.unobserve(I),f.current=!1),y&&v.observe(y))},[v]),[E,j]=dt(R),S=Ze(t);return s.useEffect(()=>{!v||!E.current||(v.disconnect(),f.current=!1,v.observe(E.current))},[E,v]),s.useEffect(()=>(l({type:z.RegisterDroppable,element:{id:r,key:a,disabled:n,node:E,rect:b,data:S}}),()=>l({type:z.UnregisterDroppable,key:a,id:r})),[r]),s.useEffect(()=>{n!==g.current.disabled&&(l({type:z.SetDroppableDisabled,id:r,key:a,disabled:n}),g.current.disabled=n)},[r,a,n,l]),{active:i,rect:b,isOver:c?.id===r,node:E,over:c,setNodeRef:j}}const zo=e=>{let{transform:t}=e;return{...t,y:0}};function Pn(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Bo(e,t){return e.reduce((n,r,o)=>{const a=t.get(r);return a&&(n[o]=a),n},Array(e.length))}function it(e){return e!==null&&e>=0}function $o(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Fo(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const st={scaleX:1,scaleY:1},Uo=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:a,index:i}=e;const l=(t=n[o])!=null?t:r;if(!l)return null;const c=Yo(n,i,o);if(i===o){const u=n[a];return u?{x:o<a?u.left+u.width-(l.left+l.width):u.left-l.left,y:0,...st}:null}return i>o&&i<=a?{x:-l.width-c,y:0,...st}:i<o&&i>=a?{x:l.width+c,y:0,...st}:{x:0,y:0,...st}};function Yo(e,t,n){const r=e[t],o=e[t-1],a=e[t+1];return!r||!o&&!a?0:n<t?o?r.left-(o.left+o.width):a.left-(r.left+r.width):a?a.left-(r.left+r.width):r.left-(o.left+o.width)}const zn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const a=Pn(t,r,n),i=t[o],l=a[o];return!l||!i?null:{x:l.left-i.left,y:l.top-i.top,scaleX:l.width/i.width,scaleY:l.height/i.height}},Bn="Sortable",$n=V.createContext({activeIndex:-1,containerId:Bn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:zn,disabled:{draggable:!1,droppable:!1}});function Wo(e){let{children:t,id:n,items:r,strategy:o=zn,disabled:a=!1}=e;const{active:i,dragOverlay:l,droppableRects:c,over:u,measureDroppableContainers:g}=Lo(),f=ot(Bn,n),b=l.rect!==null,p=s.useMemo(()=>r.map(j=>typeof j=="object"&&"id"in j?j.id:j),[r]),w=i!=null,m=i?p.indexOf(i.id):-1,x=u?p.indexOf(u.id):-1,k=s.useRef(p),N=!$o(p,k.current),v=x!==-1&&m===-1||N,R=Fo(a);pe(()=>{N&&w&&g(p)},[N,p,w,g]),s.useEffect(()=>{k.current=p},[p]);const E=s.useMemo(()=>({activeIndex:m,containerId:f,disabled:R,disableTransforms:v,items:p,overIndex:x,useDragOverlay:b,sortedRects:Bo(p,c),strategy:o}),[m,f,R.draggable,R.droppable,v,p,x,c,b,o]);return V.createElement($n.Provider,{value:E},t)}const Xo=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Pn(n,r,o).indexOf(t)},Ko=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:a,newIndex:i,previousItems:l,previousContainerId:c,transition:u}=e;return!u||!r||l!==a&&o===i?!1:n?!0:i!==o&&t===c},Ho={duration:200,easing:"ease"},Fn="transform",Go=et.Transition.toString({property:Fn,duration:0,easing:"linear"}),Vo={roleDescription:"sortable"};function qo(e){let{disabled:t,index:n,node:r,rect:o}=e;const[a,i]=s.useState(null),l=s.useRef(n);return pe(()=>{if(!t&&n!==l.current&&r.current){const c=o.current;if(c){const u=Ue(r.current,{ignoreTransform:!0}),g={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(g.x||g.y)&&i(g)}}n!==l.current&&(l.current=n)},[t,n,r,o]),s.useEffect(()=>{a&&i(null)},[a]),a}function Jo(e){let{animateLayoutChanges:t=Ko,attributes:n,disabled:r,data:o,getNewIndex:a=Xo,id:i,strategy:l,resizeObserverConfig:c,transition:u=Ho}=e;const{items:g,containerId:f,activeIndex:b,disabled:p,disableTransforms:w,sortedRects:m,overIndex:x,useDragOverlay:k,strategy:N}=s.useContext($n),v=Zo(r,p),R=g.indexOf(i),E=s.useMemo(()=>({sortable:{containerId:f,index:R,items:g},...o}),[f,o,R,g]),j=s.useMemo(()=>g.slice(g.indexOf(i)),[g,i]),{rect:S,node:y,isOver:I,setNodeRef:O}=Po({id:i,data:E,disabled:v.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...c}}),{active:M,activatorEvent:J,activeNodeRect:Z,attributes:L,setNodeRef:be,listeners:Ie,isDragging:K,over:je,setActivatorNodeRef:ne,transform:H}=To({id:i,data:E,attributes:{...Vo,...n},disabled:v.draggable}),Me=gr(O,be),W=!!M,re=W&&!w&&it(b)&&it(x),$=!k&&K,fe=$&&re?H:null,Te=re?fe??(l??N)({rects:m,activeNodeRect:Z,activeIndex:b,overIndex:x,index:R}):null,le=it(b)&&it(x)?a({id:i,items:g,activeIndex:b,overIndex:x}):R,oe=M?.id,A=s.useRef({activeId:oe,items:g,newIndex:le,containerId:f}),we=g!==A.current.items,G=t({active:M,containerId:f,isDragging:K,isSorting:W,id:i,index:R,items:g,newIndex:A.current.newIndex,previousItems:A.current.items,previousContainerId:A.current.containerId,transition:u,wasDragging:A.current.activeId!=null}),ke=qo({disabled:!G,index:R,node:y,rect:S});return s.useEffect(()=>{W&&A.current.newIndex!==le&&(A.current.newIndex=le),f!==A.current.containerId&&(A.current.containerId=f),g!==A.current.items&&(A.current.items=g)},[W,le,f,g]),s.useEffect(()=>{if(oe===A.current.activeId)return;if(oe&&!A.current.activeId){A.current.activeId=oe;return}const me=setTimeout(()=>{A.current.activeId=oe},50);return()=>clearTimeout(me)},[oe]),{active:M,activeIndex:b,attributes:L,data:E,rect:S,index:R,newIndex:le,items:g,isOver:I,isSorting:W,isDragging:K,listeners:Ie,node:y,overIndex:x,over:je,setNodeRef:Me,setActivatorNodeRef:ne,setDroppableNodeRef:O,setDraggableNodeRef:be,transform:ke??Te,transition:ae()};function ae(){if(ke||we&&A.current.newIndex===R)return Go;if(!($&&!Ft(J)||!u)&&(W||G))return et.Transition.toString({...u,property:Fn})}}function Zo(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function gt(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Qo=[D.Down,D.Right,D.Up,D.Left],ea=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:a,over:i,scrollableAncestors:l}}=t;if(Qo.includes(e.code)){if(e.preventDefault(),!n||!r)return;const c=[];a.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const b=o.get(f.id);if(b)switch(e.code){case D.Down:r.top<b.top&&c.push(f);break;case D.Up:r.top>b.top&&c.push(f);break;case D.Left:r.left>b.left&&c.push(f);break;case D.Right:r.left<b.left&&c.push(f);break}});const u=Ar({collisionRect:r,droppableRects:o,droppableContainers:c});let g=Cn(u,"id");if(g===i?.id&&u.length>1&&(g=u[1].id),g!=null){const f=a.get(n.id),b=a.get(g),p=b?o.get(b.id):null,w=b?.node.current;if(w&&p&&f&&b){const x=pt(w).some((j,S)=>l[S]!==j),k=Un(f,b),N=ta(f,b),v=x||!k?{x:0,y:0}:{x:N?r.width-p.width:0,y:N?r.height-p.height:0},R={x:p.left,y:p.top};return v.x&&v.y?R:Qe(R,v)}}}};function Un(e,t){return!gt(e)||!gt(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function ta(e,t){return!gt(e)||!gt(t)||!Un(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Be(e,{min:t,max:n,fallback:r}){const o=Number(e);if(!Number.isFinite(o))return r;const a=Math.floor(o);return a<t?t:a>n?n:a}function na(e,t){const n=Be(t,{min:0,max:1e6,fallback:0}),r=Be(e,{min:1,max:Math.max(1,n||1),fallback:1});if(n<=1)return[1];const o=new Set([1,n,r-2,r-1,r,r+1,r+2]),a=Array.from(o).filter(c=>Number.isInteger(c)&&c>=1&&c<=n).sort((c,u)=>c-u),i=[];let l=null;for(const c of a)l!=null&&c-l>1&&i.push(null),i.push(c),l=c;return i}function ra({page:e,totalPages:t}){const n=typeof t=="number"&&Number.isFinite(t)&&t>=0,r=n?Be(t,{min:0,max:1e6,fallback:0}):null,o=Be(e,{min:1,max:n?Math.max(1,r||1):1e6,fallback:1}),a=o>1,i=n?o<r:!0;return{canPrev:a,canNext:i,safePage:o,safeTotal:r}}function oa({entries:e,me:t,meLabel:n,limit:r}){const o=Be(r,{min:1,max:1e3,fallback:20}),a=Array.isArray(e)?e.slice(0,o):[],i=t&&typeof t.rank=="number"?t.rank:null,l=a.some(w=>!!w?.is_me);if(!i||l)return a;const c={rank:i,is_me:!0,display_name:n,avatar_url:null,gpt_tokens:t?.gpt_tokens??"0",claude_tokens:t?.claude_tokens??"0",gemini_tokens:t?.gemini_tokens??"0",cursor_tokens:t?.cursor_tokens??"0",opencode_tokens:t?.opencode_tokens??"0",openclaw_tokens:t?.openclaw_tokens??"0",hermes_tokens:t?.hermes_tokens??"0",kiro_tokens:t?.kiro_tokens??"0",copilot_tokens:t?.copilot_tokens??"0",kimi_tokens:t?.kimi_tokens??"0",other_tokens:t?.other_tokens??"0",total_tokens:t?.total_tokens??"0"},u=a.filter(w=>!w?.is_me),g=u[u.length-1],f=g&&typeof g.rank=="number"?g.rank:0;return i>f+1?[...u.slice(0,Math.max(0,o-2)),{is_ellipsis:!0,rank:null,display_name:""},c]:[...u.slice(0,Math.max(0,o-1)),c]}function de({className:e}){return d.jsx("div",{className:P("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",e)})}function aa({index:e}){const t=e<3?"w-24":e<8?"w-20":"w-16",n=e<3?"w-16":"w-12",r=e<5?"w-14":"w-10";return d.jsxs("tr",{className:"group",children:[d.jsx("td",{className:P(Et(!1),"!group-hover:bg-transparent"),children:d.jsx(de,{className:"h-4 w-6"})}),d.jsx("td",{className:P(jt(!1),"!group-hover:bg-transparent"),children:d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx(de,{className:"h-8 w-8 min-w-8 rounded-full"}),d.jsx(de,{className:P("h-4",t)})]})}),d.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:d.jsx(de,{className:P("h-4",n)})}),d.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:d.jsx(de,{className:"h-4 w-12"})}),ct.map(o=>d.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:d.jsx(de,{className:P("h-4",r)})},o.key))]})}function ia({rows:e=10}){return d.jsx("div",{className:"w-full overflow-x-auto",children:d.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[d.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:d.jsxs("tr",{children:[d.jsx("th",{className:P(mn,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:d.jsx(de,{className:"h-3.5 w-6"})}),d.jsx("th",{className:P(xn,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:d.jsx(de,{className:"h-3.5 w-12"})}),d.jsx("th",{className:"px-4 py-4",children:d.jsx(de,{className:"h-3.5 w-10"})}),d.jsx("th",{className:"px-4 py-4",children:d.jsx(de,{className:"h-3.5 w-14"})}),ct.map(t=>d.jsx("th",{className:"px-4 py-4",children:d.jsx(de,{className:"h-3.5 w-12"})},t.key))]})}),d.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:Array.from({length:e},(t,n)=>d.jsx(aa,{index:n},n))})]})})}function sa({id:e,thClassName:t,children:n}){const{attributes:r,listeners:o,setNodeRef:a,transform:i,transition:l,isDragging:c}=Jo({id:e}),u=et.Transform.toString(i)||"";s.useLayoutEffect(()=>{const f=document.querySelectorAll(`td[data-column-key="${e}"]`),b="0 2px 10px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15, 23, 42, 0.06)";return f.forEach(p=>{p.style.transform=u,p.style.transition=l||"",p.style.zIndex=c?"20":"",p.style.position=u?"relative":"",p.style.boxShadow=c?b:""}),()=>{f.forEach(p=>{p.style.transform="",p.style.transition="",p.style.zIndex="",p.style.position="",p.style.boxShadow=""})}},[e,u,l,c]);const g={transform:u,transition:l,position:u?"relative":void 0,zIndex:c?20:void 0,boxShadow:c?"0 2px 10px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15, 23, 42, 0.06)":void 0};return d.jsx("th",{ref:a,style:g,className:P(t,"group/col select-none cursor-grab active:cursor-grabbing touch-none"),...r,...o,children:d.jsxs("div",{className:"flex items-center justify-end gap-2",children:[d.jsx("span",{"aria-hidden":"true",className:P("-mr-1 inline-flex h-4 w-3 shrink-0 items-center justify-center text-oai-gray-400 dark:text-oai-gray-600","opacity-0 transition-opacity duration-150 group-hover/col:opacity-100",c&&"opacity-100"),children:d.jsxs("svg",{viewBox:"0 0 8 14",width:"8",height:"14",fill:"currentColor","aria-hidden":"true",children:[d.jsx("circle",{cx:"2",cy:"2",r:"1"}),d.jsx("circle",{cx:"6",cy:"2",r:"1"}),d.jsx("circle",{cx:"2",cy:"7",r:"1"}),d.jsx("circle",{cx:"6",cy:"7",r:"1"}),d.jsx("circle",{cx:"2",cy:"12",r:"1"}),d.jsx("circle",{cx:"6",cy:"12",r:"1"})]})}),n]})})}const Yn="tokentracker.leaderboard.columnOrder.v1";function la(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(Yn);if(!e)return null;const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):null}catch{return null}}function Rt(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Yn,JSON.stringify(e))}catch{}}function un(e,t){if(!e)return t;const n=new Set(t),r=e.filter(a=>n.has(a)),o=t.filter(a=>!r.includes(a));return[...r,...o]}function ca(e){const t=s.useMemo(()=>e.join("|"),[e]),[n,r]=s.useState(()=>un(la(),e));s.useEffect(()=>{r(i=>{const l=un(i,e);return l.length===i.length&&l.every((u,g)=>u===i[g])?i:(Rt(l),l)})},[t,e]);const o=s.useCallback((i,l)=>{!i||!l||i===l||r(c=>{const u=c.indexOf(i),g=c.indexOf(l);if(u===-1||g===-1)return c;const f=c.slice(),[b]=f.splice(u,1);return f.splice(g,0,b),Rt(f),f})},[]),a=s.useCallback(()=>{Rt(e),r(e)},[e]);return{order:n,reorder:o,reset:a}}const Ot=[10,20,50,100],_t=20,Wn="tokentracker:leaderboard:pageSize";function da(){if(typeof window>"u")return _t;try{const e=window.localStorage.getItem(Wn),t=Number(e);if(Ot.includes(t))return t}catch{}return _t}function fn(e){const t=Number(e);return!Number.isFinite(t)||t<=0?"-":t>=1e3?`$${Math.round(t).toLocaleString()}`:t>=10?`$${Math.round(t)}`:`$${t.toFixed(2)}`}function gn(e,t,n){const r=t?"text-oai-gray-700 dark:text-oai-gray-300":"text-oai-gray-500 dark:text-oai-gray-400",o=t?"bg-oai-brand-50 dark:bg-oai-brand-900/10":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60";return n.map(a=>d.jsx("td",{"data-column-key":a.key,className:P("px-4 py-4 whitespace-nowrap text-right tabular-nums",r,o),children:Dt(e?.[a.key])},a.key))}const ua={1:{text:"text-amber-600 dark:text-amber-400",badge:"bg-amber-50 dark:bg-amber-900/20"},2:{text:"text-gray-500 dark:text-gray-300",badge:"bg-gray-50 dark:bg-gray-800/40"},3:{text:"text-orange-700 dark:text-orange-400",badge:"bg-orange-50 dark:bg-orange-900/20"}};function hn({rank:e,placeholder:t}){const n=ua[e];return n?d.jsx("span",{className:P("inline-flex items-center justify-center h-7 w-7 rounded-full text-xs font-bold",n.text,n.badge),children:e}):d.jsx("span",{className:"inline-flex items-center justify-center h-7 w-7 text-sm",children:e??t})}function Pt(e){if(typeof e!="string")return null;const t=e.trim().toLowerCase();return t==="week"||t==="month"||t==="total"?t:null}function fa(e){if(!e)return C("shared.error.prefix",{error:C("leaderboard.error.unknown")});const t=e?.message||String(e),n=String(t||"").trim()||C("leaderboard.error.unknown");return C("shared.error.prefix",{error:n})}function Xn(e){return typeof e!="string"?"":e.trim()}function ga(e){const t=Xn(e);return t?t.toLowerCase()==="anonymous":!0}function ha(e,t=""){if(typeof e!="string")return null;const n=e.trim().toLowerCase();if(!n)return null;const r=new URLSearchParams(typeof t=="string"?t:""),o=Pt(r.get("period")),a=o?`?period=${o}`:"";return`/share/pv1-${n}${a}`}function pn(e,t){const n=typeof e?.user_id=="string"?e.user_id.trim():"";return n||`${e?.rank??""}:${t}`}function bn({githubUrl:e}){return d.jsxs("span",{className:"relative inline-flex items-center group/gh shrink-0",children:[d.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",onClick:t=>t.stopPropagation(),"aria-label":C("leaderboard.github.aria"),className:"text-oai-black hover:text-oai-gray-500 dark:text-white dark:hover:text-oai-gray-400 transition-colors",children:d.jsx(dr,{provider:"GITHUB",size:16})}),d.jsxs("span",{role:"tooltip",className:"invisible opacity-0 group-hover/gh:visible group-hover/gh:opacity-100 absolute right-0 bottom-full mb-2 whitespace-nowrap rounded-md bg-oai-black dark:bg-oai-gray-700 px-2.5 py-1.5 text-[11px] leading-relaxed text-white shadow-lg transition-opacity duration-150 z-50 before:content-[''] before:absolute before:inset-x-0 before:top-full before:h-2.5",children:[d.jsx("span",{className:"block",children:C("leaderboard.github.tooltipAction")}),d.jsxs("span",{className:"block text-oai-gray-300 dark:text-oai-gray-400",children:[C("leaderboard.github.tooltipPrefix")," ",d.jsx(ir,{to:"/settings",onClick:t=>t.stopPropagation(),className:"text-white underline underline-offset-2 decoration-oai-gray-400 hover:text-oai-brand-300 hover:decoration-oai-brand-300",children:C("leaderboard.github.tooltipSettingsLink")}),C("leaderboard.github.tooltipSuffix")]})]})]})}function va({auth:e,signedIn:t,sessionSoftExpired:n}){const r=Jn(),o=Zn(),{openLoginModal:a}=Qn(),{signedIn:i,loading:l,user:c}=er(),u=s.useMemo(()=>tr(),[]),g=nr(),f=t&&!n,b=s.useMemo(()=>f&&(typeof e=="function"||typeof e=="string"||e&&typeof e=="object")?e:null,[e,f]),p=f?b:null,w=f&&rr(p),m=C("shared.placeholder.short"),x=s.useMemo(()=>ct.map(h=>h.key),[]),{order:k,reorder:N}=ca(x),v=s.useMemo(()=>{const h=new Map;for(const T of ct)h.set(T.key,T);return h},[]),R=s.useMemo(()=>k.map(h=>v.get(h)).filter(Boolean),[k,v]),E=Dr(Jt(Xt,{activationConstraint:{distance:6}}),Jt(Yt,{coordinateGetter:ea})),j=s.useCallback(h=>{const{active:T,over:F}=h;!F||T.id===F.id||N(String(T.id),String(F.id))},[N]),[S,y]=s.useState(1),[I,O]=s.useState(da),M=s.useCallback(h=>{const T=Ot.includes(h)?h:_t;O(T),y(1);try{window.localStorage.setItem(Wn,String(T))}catch{}},[]),[J,Z]=s.useState(0),[L,be]=s.useState(()=>({loading:!1,error:null,data:null})),[Ie,K]=s.useState(()=>or()),[je,ne]=s.useState(!1),H=s.useMemo(()=>{const h=new URLSearchParams(r?.search||"");return Pt(h.get("period"))||"total"},[r?.search]),Me=r?.search||"",W=h=>{const T=Pt(h);if(!T||T===H)return;const F=new URLSearchParams(r?.search||"");F.set("period",T),y(1),o(`${r?.pathname||"/leaderboard"}?${F.toString()}`,{replace:!0})};s.useEffect(()=>{l||g||i||a()},[i,l,g,a]),s.useEffect(()=>{y(1)},[H]);const re=s.useMemo(()=>(Be(S,{min:1,max:1e6,fallback:1})-1)*I,[S,I]);s.useEffect(()=>{if(!u&&!g)return;let h=!0;return be(T=>({...T,loading:!0,error:null})),(async()=>{const T=await ar({userId:c?.id||null,period:H,limit:I,offset:re});h&&be({loading:!1,error:null,data:T})})().catch(T=>{h&&be({loading:!1,error:fa(T),data:null})}),()=>{h=!1}},[u,c?.id,re,J,g,H,I]);const $=L.data,fe=$?.total_pages??null,_=$?.page??S,Te=s.useMemo(()=>na(_,fe),[_,fe]),le=$?.from||null,oe=$?.to||null,A=$?.generated_at||null,we=$?.me||null,G=C("leaderboard.me_label"),ke=C("leaderboard.anon_label"),ae=C("leaderboard.period.week"),me=C("leaderboard.period.month"),xe=C("leaderboard.period.total"),Ye=H==="month"?me:H==="total"?xe:ae,Le=s.useMemo(()=>{const h=Array.isArray($?.entries)?$.entries:[];return _!==1?h:oa({entries:h,me:we,meLabel:G,limit:I})},[_,$?.entries,we,G,I]),We=async()=>{ne(!0);try{sr(!0),K(!0),await lr(()=>Gt(p));const h=await Gt(p);h&&await cr({accessToken:h,period:H,source:"leaderboard-enable-sync"}),Z(T=>T+1)}catch(h){console.warn("[tokentracker] sync:",h)}finally{ne(!1)}},{canPrev:ce,canNext:Ae}=ra({page:_,totalPages:fe}),Oe=Array.isArray(Le)&&Le.length!==0;let Se=null;L.loading?Se=d.jsx(ia,{rows:I}):L.error?Se=d.jsx("div",{className:"px-6 py-12 text-center",children:d.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:L.error})}):Oe?Se=d.jsx(Ao,{sensors:E,collisionDetection:jr,modifiers:[zo],onDragEnd:j,children:d.jsx("div",{className:"w-full overflow-x-auto",children:d.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[d.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:d.jsxs("tr",{children:[d.jsx("th",{className:P(mn,"text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500"),children:C("leaderboard.column.rank")}),d.jsx("th",{className:P(xn,"text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500"),children:C("leaderboard.column.user")}),d.jsx("th",{className:"px-4 py-4 text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500 whitespace-nowrap text-right align-middle",children:C("leaderboard.column.total")}),d.jsx("th",{className:"px-4 py-4 text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500 whitespace-nowrap text-right align-middle",title:"Based on estimated API pricing, not actual billing",children:C("leaderboard.column.est_cost")}),d.jsx(Wo,{items:k,strategy:Uo,children:R.map(h=>d.jsx(sa,{id:h.key,thClassName:"px-4 py-4 text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500 whitespace-nowrap align-middle",children:d.jsx(ur,{iconSrc:h.icon,label:C(h.copyKey)})},h.key))})]})}),d.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:Le.map((h,T)=>{if(h?.is_ellipsis){const vt=4+R.length;return d.jsx("tr",{"aria-hidden":"true",children:d.jsx("td",{colSpan:vt,className:"px-4 py-2 text-center text-oai-gray-400 dark:text-oai-gray-600 bg-white dark:bg-oai-gray-950 select-none tracking-[0.4em] text-xs",children:"···"})},`ellipsis-${T}`)}const F=!!h?.is_me,ve=typeof h?.user_id=="string"?h.user_id:null,Ce=Xn(h?.display_name),at=ga(Ce)?ke:Ce,U=F?G:at;return!!ve&&!F&&!!h?.is_public&&ha(ve,Me),F?d.jsxs("tr",{className:"border-y border-oai-brand-300/40 dark:border-oai-brand-500/30 bg-oai-brand-50 dark:bg-oai-brand-900/10 transition-colors",children:[d.jsx("td",{className:P(Et(!0),"font-semibold text-oai-brand-600 dark:text-oai-brand-400"),children:d.jsx(hn,{rank:h?.rank,placeholder:m})}),d.jsx("td",{className:jt(!0),children:d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[d.jsx(Vt,{avatarUrl:h?.avatar_url,displayName:U,seed:pn(h,U)}),d.jsx("span",{className:"truncate font-semibold text-oai-black dark:text-oai-white",children:U}),h?.github_url&&d.jsx(bn,{githubUrl:h.github_url})]})}),d.jsx("td",{className:"px-4 py-4 font-medium text-oai-black dark:text-oai-white whitespace-nowrap text-right tabular-nums bg-oai-brand-50 dark:bg-oai-brand-900/10",children:Dt(h?.total_tokens)}),d.jsx("td",{className:"px-4 py-4 font-medium text-oai-brand-600 dark:text-oai-brand-400 whitespace-nowrap text-right tabular-nums bg-oai-brand-50 dark:bg-oai-brand-900/10",title:"Based on estimated API pricing, not actual billing",children:fn(h?.estimated_cost_usd)}),gn(h,!0,R)]},`row-${h?.rank}-${U}`):d.jsxs("tr",{className:"group transition-colors",children:[d.jsx("td",{className:P(Et(!1),"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:d.jsx(hn,{rank:h?.rank,placeholder:m})}),d.jsx("td",{className:jt(!1),children:d.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[d.jsx(Vt,{avatarUrl:h?.avatar_url,displayName:U,seed:pn(h,U)}),d.jsx("span",{className:"truncate font-medium text-oai-gray-800 dark:text-oai-gray-200",children:U}),h?.github_url&&d.jsx(bn,{githubUrl:h.github_url})]})}),d.jsx("td",{className:"px-4 py-4 font-semibold text-oai-gray-800 dark:text-oai-gray-200 whitespace-nowrap text-right tabular-nums bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60",children:Dt(h?.total_tokens)}),d.jsx("td",{className:"px-4 py-4 text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap text-right tabular-nums bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60",title:"Based on estimated API pricing, not actual billing",children:fn(h?.estimated_cost_usd)}),gn(h,!1,R)]},`row-${h?.rank}-${U}`)})})]})})}):Se=d.jsx("div",{className:"px-6 py-12 text-center",children:d.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:C("leaderboard.empty")})});let _e=null;return typeof fe=="number"?_e=Te.map((h,T)=>h==null?d.jsx("span",{className:"px-2 text-oai-gray-400 dark:text-oai-gray-500",children:C("leaderboard.pagination.ellipsis")},`ellipsis-${T}`):d.jsx("button",{className:P("flex h-8 w-8 items-center justify-center rounded-md text-sm font-medium transition-colors",h===_?"bg-oai-gray-200 dark:bg-oai-gray-800 text-oai-black dark:text-white":"text-oai-gray-500 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white"),onClick:()=>y(h),disabled:L.loading,children:String(h)},`page-${h}`)):_e=d.jsx("span",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:C("leaderboard.pagination.page_unknown",{page:String(_)})}),d.jsxs("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:[d.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:d.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[d.jsxs("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-6 mb-8",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:C("leaderboard.title")}),d.jsxs("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:[H==="total"?C("leaderboard.range.total"):le&&oe?C("leaderboard.range",{period:Ye,from:le,to:oe}):C("leaderboard.range_loading",{period:Ye}),A&&d.jsx("span",{className:"ml-2 pl-2 border-l border-oai-gray-200 dark:border-oai-gray-800 inline-block text-oai-gray-400 dark:text-oai-gray-500 text-xs",children:C("leaderboard.generated_at",{ts:A})})]})]}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsx("div",{className:"inline-flex p-1 border border-oai-gray-200 dark:border-oai-gray-800 rounded-lg",children:["week","month","total"].map(h=>d.jsx("button",{onClick:()=>W(h),disabled:L.loading,className:P("px-4 py-1.5 text-sm font-medium rounded-md transition-colors",H===h?"bg-oai-gray-200 dark:bg-oai-gray-800 text-oai-black dark:text-white":"text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-800 dark:hover:text-oai-gray-200"),children:h==="week"?ae:h==="month"?me:xe},h))})})]}),!t&&d.jsxs("div",{className:"mb-6 flex items-center justify-between text-sm",children:[d.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:C("leaderboard.signin_prompt")}),d.jsx("button",{onClick:a,className:"px-3 py-1.5 text-sm font-medium text-oai-gray-600 dark:text-oai-gray-300 border border-oai-gray-300 dark:border-oai-gray-700 rounded-md hover:text-oai-black dark:hover:text-white hover:border-oai-gray-400 dark:hover:border-oai-gray-600 transition-colors",children:C("leaderboard.signin_button")})]}),f&&w&&!Ie&&d.jsxs("div",{className:"mb-6 flex items-center justify-between text-sm",children:[d.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:C("leaderboard.sync_prompt")}),d.jsx("button",{onClick:We,disabled:je,className:"px-3 py-1.5 text-sm font-medium text-oai-gray-600 dark:text-oai-gray-300 border border-oai-gray-300 dark:border-oai-gray-700 rounded-md hover:text-oai-black dark:hover:text-white hover:border-oai-gray-400 dark:hover:border-oai-gray-600 disabled:opacity-50 transition-colors",children:je?C("leaderboard.sync_button.busy"):C("leaderboard.sync_button.idle")})]}),d.jsxs("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",children:[Se,d.jsxs("div",{className:"px-6 py-3 border-t border-oai-gray-200 dark:border-oai-gray-800 flex flex-wrap items-center justify-end gap-x-4 gap-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:[d.jsx("label",{htmlFor:"leaderboard-page-size",className:"whitespace-nowrap",children:C("leaderboard.pagination.page_size_label")}),d.jsxs("div",{className:"relative",children:[d.jsx("select",{id:"leaderboard-page-size",value:I,onChange:h=>M(Number(h.target.value)),disabled:L.loading,className:"appearance-none pl-3 pr-8 py-1 rounded-md bg-white dark:bg-oai-gray-950 border border-oai-gray-300 dark:border-oai-gray-700 text-oai-gray-700 dark:text-oai-gray-300 hover:border-oai-gray-400 dark:hover:border-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500 disabled:opacity-50 transition-colors",children:Ot.map(h=>d.jsx("option",{value:h,children:h},h))}),d.jsx(fr,{className:"pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:2,"aria-hidden":"true"})]})]}),d.jsx("div",{className:"h-5 w-px bg-oai-gray-200 dark:bg-oai-gray-800","aria-hidden":"true"}),d.jsx("button",{className:P("px-3 py-1.5 text-sm font-medium text-oai-gray-500 dark:text-oai-gray-400 rounded-md transition-colors",ce&&!L.loading?"hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white":"opacity-50 cursor-not-allowed"),onClick:()=>y(h=>Math.max(1,h-1)),disabled:!ce||L.loading,children:C("leaderboard.pagination.prev")}),d.jsx("div",{className:"flex flex-wrap items-center gap-1",children:_e}),d.jsx("button",{className:P("px-3 py-1.5 text-sm font-medium text-oai-gray-500 dark:text-oai-gray-400 rounded-md transition-colors",Ae&&!L.loading?"hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white":"opacity-50 cursor-not-allowed"),onClick:()=>y(h=>h+1),disabled:!Ae||L.loading,children:C("leaderboard.pagination.next")})]})]})]})}),d.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-900 py-8 transition-colors duration-200",children:d.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between px-4 sm:px-6 text-sm text-oai-gray-400 dark:text-oai-gray-500",children:[d.jsx("p",{children:C("landing.v2.footer.line")}),d.jsx("a",{href:"https://github.com/mm7894215/TokenTracker",className:"text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",target:"_blank",rel:"noopener noreferrer",children:C("landing.v2.nav.github")})]})})]})}export{va as LeaderboardPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,D as e,a8 as H,C as K,aa as W,h as Y,j as Z,ae as G,ag as q,B as a,a7 as L,a4 as B,L as E,ah as F,ai as J}from"./main-Dirgz7qK.js";import{b as I,d as Q,l as V,f as X,e as ee,L as re,g as ae}from"./leaderboard-columns-5fNRo700.js";const y=18;function O(){return e.jsxs("svg",{"aria-hidden":!0,width:y,height:y,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"4"}),e.jsx("path",{d:"M12 2v2"}),e.jsx("path",{d:"M12 20v2"}),e.jsx("path",{d:"m4.93 4.93 1.41 1.41"}),e.jsx("path",{d:"m17.66 17.66 1.41 1.41"}),e.jsx("path",{d:"M2 12h2"}),e.jsx("path",{d:"M20 12h2"}),e.jsx("path",{d:"m6.34 17.66-1.41 1.41"}),e.jsx("path",{d:"m19.07 4.93-1.41 1.41"})]})}function P(){return e.jsx("svg",{"aria-hidden":!0,width:y,height:y,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}function te(){return e.jsxs("svg",{"aria-hidden":!0,width:y,height:y,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),e.jsx("path",{d:"M8 21h8"}),e.jsx("path",{d:"M12 17v4"})]})}const oe=[{value:"light",label:"Light",Icon:O},{value:"dark",label:"Dark",Icon:P},{value:"system",label:"System",Icon:te}];function se(r){return r==="dark"?P:O}function ne({theme:r,resolvedTheme:s,onSetTheme:b,className:d="",direction:p="down",align:T="right"}){const[c,k]=n.useState(!1),h=n.useRef(null),x=n.useCallback(()=>k(!1),[]);n.useEffect(()=>{if(!c)return;const t=l=>{h.current&&!h.current.contains(l.target)&&x()};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[c,x]),n.useEffect(()=>{if(!c)return;const t=l=>{l.key==="Escape"&&x()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[c,x]);const i=se(s);return e.jsxs("div",{ref:h,className:`relative ${d}`,children:[e.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":c,onClick:()=>k(t=>!t),className:"flex items-center justify-center w-9 h-9 rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors",children:e.jsx(i,{})}),c&&e.jsx("div",{className:`absolute z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg ${p==="up"?"bottom-full mb-1":"top-full mt-1"} ${T==="left"?"left-0":"right-0"}`,children:oe.map(({value:t,label:l,Icon:j})=>{const m=r===t;return e.jsxs("button",{type:"button",onClick:()=>{b(t),x()},className:`flex w-full items-center gap-2.5 px-3 py-2 text-sm transition-colors ${m?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"}`,children:[e.jsx(j,{}),e.jsx("span",{children:l})]},t)})})]})}function ie(r){if(!r)return a("shared.error.prefix",{error:a("leaderboard.error.unknown")});const s=r?.message||String(r),b=String(s||"").trim()||a("leaderboard.error.unknown");return a("shared.error.prefix",{error:b})}function le(r){return typeof r!="string"?"":r.trim()}function de(r){if(typeof r!="string")return null;const s=r.trim().toLowerCase();return s==="week"||s==="month"||s==="total"?s:null}function me({auth:r,signedIn:s,sessionSoftExpired:b,userId:d}){const p=H(),{theme:T,resolvedTheme:c,setTheme:k}=K(),h=n.useMemo(()=>W(),[]),x=Y(),i=s&&!b,t=n.useMemo(()=>i&&(typeof r=="function"||typeof r=="string"||r&&typeof r=="object")?r:null,[r,i]),l=i?t:null,j=i&&Z(l),m=n.useMemo(()=>{const o=new URLSearchParams(p?.search||"");return de(o.get("period"))||"week"},[p?.search]),_=p?.search||"",[v,w]=n.useState(()=>({loading:!1,error:null,data:null}));n.useEffect(()=>{if(!h&&!x||!d||i&&!j)return;let o=!0;return w(f=>({...f,loading:!0,error:null})),(async()=>{const f=i?await G(l):null;if(!o)return;const D=await q({accessToken:f,userId:d,period:m});o&&w({loading:!1,error:null,data:D})})().catch(f=>{if(o){if(f?.status===404){w({loading:!1,error:null,data:null});return}w({loading:!1,error:ie(f),data:null})}}),()=>{o=!1}},[i,j,h,l,x,m,d]);const N=v.data,C=N?.from||null,M=N?.to||null,A=N?.generated_at||null,g=N?.entry||null,S=le(g?.display_name)||a("leaderboard.anon_label"),z=a("leaderboard.period.week"),U=a("leaderboard.period.month"),$=a("leaderboard.period.total"),R=m==="month"?U:m==="total"?$:z;let u=null;return d?v.loading?u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.loading")})}):v.error?u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:v.error})}):g?u=e.jsx("div",{className:"w-full overflow-x-auto",children:e.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:e.jsxs("tr",{children:[e.jsx("th",{className:L(re,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:a("leaderboard.column.rank")}),e.jsx("th",{className:L(ae,"font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap"),children:a("leaderboard.column.total")}),I.map(o=>e.jsx("th",{className:"px-4 py-4 font-medium text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:e.jsx(Q,{iconSrc:o.icon,label:a(o.copyKey)})},o.key))]})}),e.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:e.jsxs("tr",{className:"transition-colors hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900/60",children:[e.jsx("td",{className:L(V(!1),"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:g?.rank??a("shared.placeholder.short")}),e.jsx("td",{className:L(X(),"text-oai-gray-700 dark:text-oai-gray-300"),children:B(g?.total_tokens)}),I.map(o=>e.jsx("td",{className:"px-4 py-4 text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap",children:B(g?.[o.key])},o.key))]})})]})}):u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.empty")})}):u=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("leaderboard.empty")})}),e.jsxs("div",{className:"flex flex-col min-h-screen bg-oai-white dark:bg-oai-gray-950 text-oai-black dark:text-oai-white font-oai antialiased transition-colors duration-200",children:[e.jsx("header",{className:"sticky top-0 z-50 bg-white/80 dark:bg-oai-gray-950/80 backdrop-blur-md border-b border-oai-gray-200 dark:border-oai-gray-900 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex h-14 max-w-6xl items-center justify-between px-4 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsxs(E,{to:"/",className:"flex items-center gap-3 no-underline outline-none rounded focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:ring-offset-oai-gray-950 transition-opacity hover:opacity-80",children:[e.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),e.jsx("span",{className:"text-sm font-semibold tracking-wide text-oai-black dark:text-white uppercase",children:"Token Tracker"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(F,{})})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[e.jsx(E,{to:`/leaderboard${_}`,className:"no-underline inline-flex items-center justify-center h-9 px-5 text-sm font-medium rounded-full shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-900 hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors",children:a("leaderboard.profile.nav.back")}),e.jsx(ne,{theme:T,resolvedTheme:c,onSetTheme:k}),e.jsx(J,{})]})]})}),e.jsx("main",{className:"flex-1 py-12 sm:py-16",children:e.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-6 mb-10",children:[e.jsx(ee,{avatarUrl:g?.avatar_url,displayName:S,seed:typeof d=="string"?d:S,size:"lg",className:"shrink-0 ring-2 ring-oai-gray-200 dark:ring-oai-gray-800"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:S}),e.jsxs("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:[m==="total"?a("leaderboard.range.total"):C&&M?a("leaderboard.range",{period:R,from:C,to:M}):a("leaderboard.range_loading",{period:R}),A&&e.jsx("span",{className:"ml-2 pl-2 border-l border-oai-gray-200 dark:border-oai-gray-800 inline-block text-oai-gray-400 dark:text-oai-gray-500 text-xs",children:a("leaderboard.generated_at",{ts:A})})]})]})]}),e.jsx("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",children:u})]})}),e.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-900 py-8 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between px-4 sm:px-6 text-sm text-oai-gray-400 dark:text-oai-gray-500",children:[e.jsx("p",{children:a("landing.v2.footer.line")}),e.jsx(E,{to:`/leaderboard${_}`,className:"text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:a("leaderboard.profile.nav.back")})]})})]})}export{me as LeaderboardProfilePage};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{D as r,a7 as _,B as o,r as b,L as f,aj as j}from"./main-Dirgz7qK.js";import{u as v}from"./use-usage-limits-Z6xWV0y7.js";import{u as k}from"./use-limits-display-prefs-LMbFljwt.js";import{C as y}from"./Card-DmEuggKt.js";import{F as N}from"./FadeIn-CIKEJ1mC.js";const L=[3,2,3,3,2,2,3];function d({className:s}){return r.jsx("div",{className:_("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",s)})}function P(){return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(d,{className:"h-3 w-12 shrink-0"}),r.jsx(d,{className:"flex-1 h-1.5 rounded-full min-w-0"}),r.jsx(d,{className:"h-3 w-[30px] shrink-0"}),r.jsx(d,{className:"h-3 w-6 shrink-0"})]})}function C({bars:s,index:e}){const l=e%3===0?"w-24":e%3===1?"w-20":"w-[4.5rem]";return r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(d,{className:"h-[14px] w-[14px] rounded shrink-0"}),r.jsx(d,{className:_("h-4",l)})]}),Array.from({length:s},(i,a)=>r.jsx(P,{},a))]})}function E(){return r.jsx(y,{children:r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx(d,{className:"h-3.5 w-28"}),L.map((s,e)=>r.jsx(C,{bars:s,index:e},e))]})})}function t(s){if(!s)return null;const e=typeof s=="number"?s*1e3:Date.parse(s);if(!Number.isFinite(e))return null;const l=e-Date.now();if(l<=0)return o("shared.time.now");const i=Math.floor(l/6e4);if(i<60)return`${i}m`;const a=Math.floor(i/60);return a<24?`${a}h`:`${Math.floor(a/24)}d`}function O(s){return s>=90?"bg-red-500":s>=70?"bg-amber-500":"bg-emerald-500"}function n({label:s,pct:e,reset:l}){const i=Math.max(0,Math.min(100,Number(e)||0)),a=Math.round(i),x=i>0&&a===0?Math.max(i,.35):i,u=i>0&&a===0?"<1":String(a);return r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-[11px] text-oai-gray-500 dark:text-oai-gray-400 w-12 shrink-0",children:s}),r.jsx("div",{className:"flex-1 bg-oai-gray-100 dark:bg-oai-gray-700/50 rounded-full h-1.5 overflow-hidden",children:r.jsx("div",{className:`${O(a)} rounded-full h-full transition-[width] duration-500 ease-out`,style:{width:`${x}%`,minWidth:i>0?"3px":0}})}),r.jsxs("span",{className:"text-[11px] tabular-nums text-oai-gray-500 dark:text-oai-gray-400 w-[30px] text-right shrink-0",children:[u,"%"]}),l?r.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-500 w-6 text-right shrink-0",children:l}):null]})}function c({name:s,icon:e,children:l}){const a=e==="/brand-logos/cursor.svg"||e==="/brand-logos/kiro.svg"||e==="/brand-logos/copilot.svg"?"w-[14px] h-[14px] dark:invert":"w-[14px] h-[14px]";return r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[e?r.jsx("img",{src:e,alt:"",className:a}):null,r.jsx("span",{className:"text-sm font-medium text-oai-black dark:text-oai-white",children:s})]}),l]})}const T=["claude","codex","cursor","gemini","kiro","copilot","antigravity"];function R(s,e){if(!(i=>i?.configured&&!i.error)(e))return null;switch(s){case"claude":return r.jsxs(c,{name:"Claude",icon:"/brand-logos/claude-code.svg",children:[e.five_hour?r.jsx(n,{label:"5h",pct:e.five_hour.utilization,reset:t(e.five_hour.resets_at)}):null,e.seven_day?r.jsx(n,{label:"7d",pct:e.seven_day.utilization,reset:t(e.seven_day.resets_at)}):null,e.seven_day_opus?r.jsx(n,{label:"Opus",pct:e.seven_day_opus.utilization,reset:t(e.seven_day_opus.resets_at)}):null]},"claude");case"codex":return r.jsxs(c,{name:"Codex",icon:"/brand-logos/codex.svg",children:[e.primary_window?r.jsx(n,{label:"5h",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:"7d",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null]},"codex");case"cursor":return r.jsxs(c,{name:"Cursor",icon:"/brand-logos/cursor.svg",children:[e.primary_window?r.jsx(n,{label:o("limits.label.cursor_plan"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:o("limits.label.cursor_auto"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(n,{label:o("limits.label.cursor_api"),pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null]},"cursor");case"gemini":return r.jsxs(c,{name:"Gemini",icon:"/brand-logos/gemini.svg",children:[e.primary_window?r.jsx(n,{label:"Pro",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:"Flash",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(n,{label:"Lite",pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null]},"gemini");case"kiro":return r.jsxs(c,{name:"Kiro",icon:"/brand-logos/kiro.svg",children:[e.primary_window?r.jsx(n,{label:o("limits.label.kiro_month"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:o("limits.label.kiro_bonus"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null]},"kiro");case"antigravity":return r.jsxs(c,{name:"Antigravity",icon:"/brand-logos/antigravity.svg",children:[e.primary_window?r.jsx(n,{label:"Claude",pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:"G Pro",pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.tertiary_window?r.jsx(n,{label:"Flash",pct:e.tertiary_window.used_percent,reset:t(e.tertiary_window.reset_at)}):null]},"antigravity");case"copilot":return r.jsxs(c,{name:"GitHub Copilot",icon:"/brand-logos/copilot.svg",children:[e.primary_window?r.jsx(n,{label:o("limits.label.copilot_premium"),pct:e.primary_window.used_percent,reset:t(e.primary_window.reset_at)}):null,e.secondary_window?r.jsx(n,{label:o("limits.label.copilot_chat"),pct:e.secondary_window.used_percent,reset:t(e.secondary_window.reset_at)}):null,e.otel_has_files||e.otel_enabled?null:r.jsx(D,{defaultDir:e.otel_default_dir})]},"copilot");default:return null}}function D({defaultDir:s}){const[e,l]=b.useState(!1),a=["export COPILOT_OTEL_ENABLED=true","export COPILOT_OTEL_EXPORTER_TYPE=file",`export COPILOT_OTEL_FILE_EXPORTER_PATH="${s||"$HOME/.copilot/otel"}/copilot-otel-$(date +%Y%m%d).jsonl"`].join(`
|
|
2
|
-
`),x=async()=>{try{await navigator.clipboard.writeText(a),l(!0),setTimeout(()=>l(!1),1600)}catch{}};return r.jsxs("div",{className:"mt-1 rounded-md border border-amber-300/60 dark:border-amber-700/40 bg-amber-50/50 dark:bg-amber-900/10 px-2.5 py-2 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[r.jsx("div",{className:"font-medium text-oai-gray-700 dark:text-oai-gray-200",children:o("limits.copilot.otelHint.title")}),r.jsx("div",{className:"mt-0.5 leading-snug",children:o("limits.copilot.otelHint.body")}),r.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-tight whitespace-pre",children:a}),r.jsx("button",{type:"button",onClick:x,className:"mt-1 inline-flex items-center gap-1 rounded border border-oai-gray-300 dark:border-oai-gray-700 px-1.5 py-0.5 text-[10.5px] text-oai-gray-700 dark:text-oai-gray-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors",children:e?o("limits.copilot.otelHint.copied"):o("limits.copilot.otelHint.copy")})]})}function I({claude:s,codex:e,cursor:l,gemini:i,kiro:a,antigravity:x,copilot:u,order:p,visibility:w}){const h={claude:s,codex:e,cursor:l,gemini:i,kiro:a,antigravity:x,copilot:u},g=(Array.isArray(p)&&p.length>0?p:T).filter(m=>!w||w[m]!==!1).map(m=>R(m,h[m])).filter(Boolean);return g.length===0?null:r.jsx(N,{delay:.15,children:r.jsx(y,{children:r.jsxs("div",{className:"flex flex-col gap-3",children:[r.jsx("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:o("limits.panel.title")}),g]})})})}function $(){const{data:s,error:e,isLoading:l}=v({initialRefresh:!0}),i=k();return r.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:r.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:r.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[r.jsxs("div",{className:"flex flex-row items-start justify-between gap-4 mb-8",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:o("nav.limits")}),r.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:o("limits.page.subtitle")})]}),r.jsx(f,{to:"/settings","aria-label":o("limits.page.openSettings"),title:o("limits.page.openSettings"),className:"shrink-0 inline-flex h-9 w-9 items-center justify-center rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:r.jsx(j,{className:"h-4 w-4","aria-hidden":!0})})]}),l?r.jsx(E,{}):r.jsxs(r.Fragment,{children:[e?r.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",children:o("shared.error.prefix",{error:e})}):null,r.jsx(I,{claude:s?.claude,codex:s?.codex,cursor:s?.cursor,gemini:s?.gemini,kiro:s?.kiro,antigravity:s?.antigravity,copilot:s?.copilot,order:i.order,visibility:i.visibility})]})]})})})}export{$ as LimitsPage};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{aD as Ue,av as se,az as et,aI as Mo,aJ as Ao,r as d,aw as z,aA as Fo,aK as ls,ax as be,aL as us,D as ee,aB as je,aM as Ot,a6 as _e,aN as fs,F as ze,aF as qn,aG as Ce,aO as Pe,aP as ct,aC as ie,aQ as We,aR as Gn,aS as Cn,aT as Tn,aU as ft,aV as Ke,aW as ds,aX as Lo,aY as ps,aZ as Pt,a_ as Zt,E as gs}from"./main-Dirgz7qK.js";const ms=500,hs={style:{transition:"none"}},Do="data-base-ui-click-trigger",Ya={fallbackAxisSide:"none"},bs={fallbackAxisSide:"end"},vs={clipPath:"inset(50%)",position:"fixed",top:0,left:0},No={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Bo={...No,position:"fixed",top:0,left:0},Ua={...No,position:"absolute"};function Fe(e){const t=Ue(ys,e).current;return t.next=e,se(t.effect),t}function ys(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Ht=Symbol("NOT_FOUND");function Es(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Rs(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function xs(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(o=>typeof o=="function"?`function ${o.name||"unnamed"}()`:typeof o).join(", ");throw new TypeError(`${t}[${n}]`)}}var Xn=e=>Array.isArray(e)?e:[e];function Ss(e){const t=Array.isArray(e[0])?e[0]:e;return xs(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ws(e,t){const n=[],{length:o}=e;for(let r=0;r<o;r++)n.push(e[r].apply(null,t));return n}function Cs(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Ht},put(n,o){t={key:n,value:o}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Ts(e,t){let n=[];function o(a){const c=n.findIndex(l=>t(a,l.key));if(c>-1){const l=n[c];return c>0&&(n.splice(c,1),n.unshift(l)),l.value}return Ht}function r(a,c){o(a)===Ht&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:o,put:r,getEntries:s,clear:i}}var Os=(e,t)=>e===t;function Ps(e){return function(n,o){if(n===null||o===null||n.length!==o.length)return!1;const{length:r}=n;for(let s=0;s<r;s++)if(!e(n[s],o[s]))return!1;return!0}}function Is(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:o=Os,maxSize:r=1,resultEqualityCheck:s}=n,i=Ps(o);let a=0;const c=r<=1?Cs(i):Ts(r,i);function l(){let u=c.get(arguments);if(u===Ht){if(u=e.apply(null,arguments),a++,s){const p=c.getEntries().find(m=>s(m.value,u));p&&(u=p.value,a!==0&&a--)}c.put(arguments,u)}return u}return l.clearCache=()=>{c.clear(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}var ks=class{constructor(e){this.value=e}deref(){return this.value}},Ms=typeof WeakRef<"u"?WeakRef:ks,As=0,Kn=1;function Ft(){return{s:As,v:void 0,o:null,p:null}}function $o(e,t={}){let n=Ft();const{resultEqualityCheck:o}=t;let r,s=0;function i(){let a=n;const{length:c}=arguments;for(let f=0,p=c;f<p;f++){const m=arguments[f];if(typeof m=="function"||typeof m=="object"&&m!==null){let g=a.o;g===null&&(a.o=g=new WeakMap);const h=g.get(m);h===void 0?(a=Ft(),g.set(m,a)):a=h}else{let g=a.p;g===null&&(a.p=g=new Map);const h=g.get(m);h===void 0?(a=Ft(),g.set(m,a)):a=h}}const l=a;let u;if(a.s===Kn)u=a.v;else if(u=e.apply(null,arguments),s++,o){const f=r?.deref?.()??r;f!=null&&o(f,u)&&(u=f,s!==0&&s--),r=typeof u=="object"&&u!==null||typeof u=="function"?new Ms(u):u}return l.s=Kn,l.v=u,u}return i.clearCache=()=>{n=Ft(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function Wo(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,o=(...r)=>{let s=0,i=0,a,c={},l=r.pop();typeof l=="object"&&(c=l,l=r.pop()),Es(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const u={...n,...c},{memoize:f,memoizeOptions:p=[],argsMemoize:m=$o,argsMemoizeOptions:g=[]}=u,h=Xn(p),v=Xn(g),y=Ss(r),b=f(function(){return s++,l.apply(null,arguments)},...h),E=m(function(){i++;const w=ws(y,arguments);return a=b.apply(null,w),a},...v);return Object.assign(E,{resultFunc:l,memoizedResultFunc:b,dependencies:y,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:m})};return Object.assign(o,{withTypes:()=>o}),o}var Fs=Wo($o),Ls=Object.assign((e,t=Fs)=>{Rs(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),o=n.map(s=>e[s]);return t(o,(...s)=>s.reduce((i,a,c)=>(i[n[c]]=a,i),{}))},{withTypes:()=>Ls});Wo({memoize:Is,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const G=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(et(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var on={exports:{}},rn={};var Zn;function Ds(){if(Zn)return rn;Zn=1;var e=Mo();function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(f,p){var m=p(),g=o({inst:{value:m,getSnapshot:p}}),h=g[0].inst,v=g[1];return s(function(){h.value=m,h.getSnapshot=p,c(h)&&v({inst:h})},[f,m,p]),r(function(){return c(h)&&v({inst:h}),f(function(){c(h)&&v({inst:h})})},[f]),i(m),m}function c(f){var p=f.getSnapshot;f=f.value;try{var m=p();return!n(f,m)}catch{return!0}}function l(f,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return rn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,rn}var Jn;function Vo(){return Jn||(Jn=1,on.exports=Ds()),on.exports}var Ns=Vo(),sn={exports:{}},cn={};var Qn;function Bs(){if(Qn)return cn;Qn=1;var e=Mo(),t=Vo();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return cn.useSyncExternalStoreWithSelector=function(l,u,f,p,m){var g=s(null);if(g.current===null){var h={hasValue:!1,value:null};g.current=h}else h=g.current;g=a(function(){function y(O){if(!b){if(b=!0,E=O,O=p(O),m!==void 0&&h.hasValue){var C=h.value;if(m(C,O))return S=C}return S=O}if(C=S,o(E,O))return C;var I=p(O);return m!==void 0&&m(C,I)?(E=O,C):(E=O,S=I)}var b=!1,E,S,w=f===void 0?null:f;return[function(){return y(u())},w===null?void 0:function(){return y(w())}]},[u,f,p,m]);var v=r(l,g[0],g[1]);return i(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},cn}var eo;function $s(){return eo||(eo=1,sn.exports=Bs()),sn.exports}var Ws=$s();const Vs=Ao(19),js=Vs?_s:Ys;function Hs(e,t,n,o,r){return js(e,t,n,o,r)}function _s(e,t,n,o,r){const s=d.useCallback(()=>t(e.getSnapshot(),n,o,r),[e,t,n,o,r]);return Ns.useSyncExternalStore(e.subscribe,s,s)}function Ys(e,t,n,o,r){return Ws.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,o,r))}class St{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){St.prototype.setState.call(this,{...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||St.prototype.setState.call(this,{...this.state,[t]:n})}notifyAll(){const t={...this.state};St.prototype.setState.call(this,t)}}class On extends St{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}controlledValues=new Map;useSyncedValue(t,n){d.useDebugValue(t),se(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const o=this;se(()=>(o.state[t]!==n&&o.set(t,n),()=>{o.set(t,void 0)}),[o,t,n])}useSyncedValues(t){const n=this,o=Object.values(t);se(()=>{n.update(t)},[n,...o])}useControlledProp(t,n,o){d.useDebugValue(t);const r=this,s=n!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,s),!s&&!Object.is(this.state[t],o)&&super.setState({...this.state,[t]:o})),se(()=>{s&&!Object.is(r.state[t],n)&&super.setState({...r.state,[t]:n})},[r,t,n,o,s])}set(t,n){this.controlledValues.get(t)!==!0&&super.set(t,n)}update(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.update(n)}setState(t){const n={...t};for(const o in n)if(Object.hasOwn(n,o)&&this.controlledValues.get(o)===!0){delete n[o];continue}super.setState({...this.state,...n})}select=(t,n,o,r)=>{const s=this.selectors[t];return s(this.state,n,o,r)};useState=(t,n,o,r)=>{d.useDebugValue(t);const s=this.selectors[t];return Hs(this,s,n,o,r)};useContextCallback(t,n){d.useDebugValue(t);const o=z(n??Fo);this.context[t]=o}useStateSetter(t){const n=d.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(t,o)}),n.current}observe(t,n){let o;typeof t=="function"?o=t:o=this.selectors[t];let r=o(this.state);return n(r,r,this),this.subscribe(s=>{const i=o(s);if(!Object.is(r,i)){const a=r;r=i,n(i,a,this)}})}}const Us=[];function Pn(e){d.useEffect(e,Us)}const Lt=null;class zs{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<n.length;r+=1)n[r]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Dt=new zs;class Ae{static create(){return new Ae}static request(t){return Dt.request(t)}static cancel(t){return Dt.cancel(t)}currentId=Lt;request(t){this.cancel(),this.currentId=Dt.request(()=>{this.currentId=Lt,t()})}cancel=()=>{this.currentId!==Lt&&(Dt.cancel(this.currentId),this.currentId=Lt)};disposeEffect=()=>this.cancel}function In(){const e=Ue(Ae.create).current;return Pn(e.disposeEffect),e}const xt=0;class Ye{static create(){return new Ye}currentId=xt;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=xt,n()},t)}isStarted(){return this.currentId!==xt}clear=()=>{this.currentId!==xt&&(clearTimeout(this.currentId),this.currentId=xt)};disposeEffect=()=>this.clear}function Je(){const e=Ue(Ye.create).current;return Pn(e.disposeEffect),e}const ht=typeof navigator<"u",an=Ks(),jo=Js(),Ho=Zs(),qs=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),_o=an.platform==="MacIntel"&&an.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(an.platform),Gs=ht&&/apple/i.test(navigator.vendor),hn=ht&&/android/i.test(jo)||/android/i.test(Ho);ht&&jo.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const Xs=Ho.includes("jsdom/");function Ks(){if(!ht)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Zs(){if(!ht)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Js(){if(!ht)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const bn="data-base-ui-focusable",Yo="active",Uo="selected",zo="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",za="ArrowLeft",qa="ArrowRight",Ga="ArrowUp",Xa="ArrowDown";function it(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function re(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ls(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Ee(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Te(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Qs(e){return e.matches("html,body")}function fe(e){return e?.ownerDocument||document}function qo(e){return be(e)&&e.matches(zo)}function to(e){return e?e.getAttribute("role")==="combobox"&&qo(e):!1}function vn(e){return e?e.hasAttribute(bn)?e:e.querySelector(`[${bn}]`)||e:null}function Ze(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...Ze(e,r.id,n)])}function no(e,t){let n=[],o=e.find(r=>r.id===t)?.parentId;for(;o;){const r=e.find(s=>s.id===o);o=r?.parentId,r&&(n=n.concat(r))}return n}function ei(e){e.preventDefault(),e.stopPropagation()}function ti(e){return"nativeEvent"in e}function ni(e){return e.mozInputSource===0&&e.isTrusted?!0:hn&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function oi(e){return Xs?!1:!hn&&e.width===0&&e.height===0||hn&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function dt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Go(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const ri=["top","right","bottom","left"],pt=Math.min,Re=Math.max,_t=Math.round,Nt=Math.floor,Le=e=>({x:e,y:e}),si={left:"right",right:"left",bottom:"top",top:"bottom"};function yn(e,t,n){return Re(e,pt(t,n))}function $e(e,t){return typeof e=="function"?e(t):e}function ye(e){return e.split("-")[0]}function qe(e){return e.split("-")[1]}function kn(e){return e==="x"?"y":"x"}function Mn(e){return e==="y"?"height":"width"}function we(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function An(e){return kn(we(e))}function ii(e,t,n){n===void 0&&(n=!1);const o=qe(e),r=An(e),s=Mn(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Yt(i)),[i,Yt(i)]}function ci(e){const t=Yt(e);return[En(e),t,En(t)]}function En(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const oo=["left","right"],ro=["right","left"],ai=["top","bottom"],li=["bottom","top"];function ui(e,t,n){switch(e){case"top":case"bottom":return n?t?ro:oo:t?oo:ro;case"left":case"right":return t?ai:li;default:return[]}}function fi(e,t,n,o){const r=qe(e);let s=ui(ye(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(En)))),s}function Yt(e){const t=ye(e);return si[t]+e.slice(t.length)}function di(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xo(e){return typeof e!="number"?di(e):{top:e,right:e,bottom:e,left:e}}function Ut(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}var pi=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],zt=pi.join(","),Ko=typeof Element>"u",gt=Ko?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,qt=!Ko&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Gt=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=r===""||r==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Gt(t.parentNode));return i},gi=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},Zo=function(t,n,o){if(Gt(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(zt));return n&>.call(t,zt)&&r.unshift(t),r=r.filter(o),r},Xt=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!Gt(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),c=a.length?a:i.children,l=Xt(c,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{var u=gt.call(i,zt);u&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var f=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),p=!Gt(f,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(f&&p){var m=Xt(f===!0?i.children:f.children,!0,o);o.flatten?r.push.apply(r,m):r.push({scopeParent:i,candidates:m})}else s.unshift.apply(s,i.children)}}return r},Jo=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Qo=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||gi(t))&&!Jo(t)?0:t.tabIndex},mi=function(t,n){var o=Qo(t);return o<0&&n&&!Jo(t)?0:o},hi=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},er=function(t){return t.tagName==="INPUT"},bi=function(t){return er(t)&&t.type==="hidden"},vi=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},yi=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Ei=function(t){if(!t.name)return!0;var n=t.form||qt(t),o=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=yi(r,t.form);return!s||s===t},Ri=function(t){return er(t)&&t.type==="radio"},xi=function(t){return Ri(t)&&!Ei(t)},Si=function(t){var n,o=t&&qt(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,a,c;for(s=!!((i=r)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(r)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!s&&r;){var l,u,f;o=qt(r),r=(l=o)===null||l===void 0?void 0:l.host,s=!!((u=r)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(r))}}return s},so=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},wi=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=gt.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(gt.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var c=t;t;){var l=t.parentElement,u=qt(t);if(l&&!l.shadowRoot&&r(l)===!0)return so(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=c}if(Si(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return so(t);return!1},Ci=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return gt.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},Rn=function(t,n){return!(n.disabled||bi(n)||wi(n,t)||vi(n)||Ci(n))},xn=function(t,n){return!(xi(n)||Qo(n)<0||!Rn(t,n))},Ti=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},tr=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,a=i?r.scopeParent:r,c=mi(a,i),l=i?tr(r.candidates):a;c===0?i?n.push.apply(n,l):n.push(a):o.push({documentOrder:s,tabIndex:c,item:r,isScope:i,content:l})}),o.sort(hi).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},It=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Xt([t],n.includeContainer,{filter:xn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ti}):o=Zo(t,n.includeContainer,xn.bind(null,n)),tr(o)},Oi=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Xt([t],n.includeContainer,{filter:Rn.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=Zo(t,n.includeContainer,Rn.bind(null,n)),o},nr=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return gt.call(t,zt)===!1?!1:xn(n,t)};const bt=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function or(e,t){const n=It(e,bt()),o=n.length;if(o===0)return;const r=it(fe(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function Fn(e){return or(fe(e).body,1)||e}function rr(e){return or(fe(e).body,-1)||e}function sr(e,t){if(!e)return null;const n=It(fe(e).body,bt()),o=n.length;if(o===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+o)%o;return n[s]}function Pi(e){return sr(e,1)}function Ii(e){return sr(e,-1)}function at(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!re(n,o)}function ki(e){It(e,bt()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function io(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}const Mi={...us};let co=0;function Ai(e,t="mui"){const[n,o]=d.useState(e),r=e||n;return d.useEffect(()=>{n==null&&(co+=1,o(`${t}-${co}`))},[n,t]),r}const ao=Mi.useId;function vt(e,t){if(ao!==void 0){const n=ao();return e??(t?`${t}-${n}`:n)}return Ai(e,t)}function ir(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class Fi{nodesRef={current:[]};events=ir();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(o=>o===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const cr=d.createContext(null),ar=d.createContext(null),tt=()=>d.useContext(cr)?.id||null,yt=e=>{const t=d.useContext(ar);return e??t};function Li(e){const t=vt(),n=yt(e),o=tt();return se(()=>{if(!t)return;const r={id:t,parentId:o};return n?.addNode(r),()=>{n?.removeNode(r)}},[n,t,o]),t}function Di(e){const{children:t,id:n}=e,o=tt();return ee.jsx(cr.Provider,{value:d.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function Ni(e){const{children:t,externalTree:n}=e,o=Ue(()=>n??new Fi).current;return ee.jsx(ar.Provider,{value:o,children:t})}const Bi="none",He="trigger-press",xe="trigger-hover",lr="outside-press",Ka="item-press",Za="close-press",wt="focus-out",ur="escape-key",Ja="list-navigation",Qa="cancel-open",fr="imperative-action",el="window-resize";function ce(e,t,n,o){let r=!1,s=!1;const i=je;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...i}}function Ct(e){return`data-base-ui-${e}`}function ln(e,t,n){if(n&&!dt(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function nt(e){return e?.ownerDocument||document}const mt=d.forwardRef(function(t,n){const[o,r]=d.useState();se(()=>{Gs&&r("button")},[]);const s={tabIndex:0,role:o};return ee.jsx("span",{...t,ref:n,style:Bo,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})});let lo=0;function un(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(lo);const s=()=>e?.focus({preventScroll:n});r?s():lo=requestAnimationFrame(s)}const lt={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function uo(e){return e==="inert"?lt.inert:e==="aria-hidden"?lt["aria-hidden"]:lt.none}let Bt=new WeakSet,$t={},fn=0;const dr=e=>e&&(e.host||dr(e.parentNode)),$i=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=dr(n);return e.contains(o)?o:null}).filter(n=>n!=null);function Wi(e,t,n,o){const r="data-base-ui-inert",s=o?"inert":n?"aria-hidden":null,i=$i(t,e),a=new Set,c=new Set(i),l=[];$t[r]||($t[r]=new WeakMap);const u=$t[r];i.forEach(f),p(t),a.clear();function f(m){!m||a.has(m)||(a.add(m),m.parentNode&&f(m.parentNode))}function p(m){!m||c.has(m)||[].forEach.call(m.children,g=>{if(Ot(g)!=="script")if(a.has(g))p(g);else{const h=s?g.getAttribute(s):null,v=h!==null&&h!=="false",y=uo(s),b=(y.get(g)||0)+1,E=(u.get(g)||0)+1;y.set(g,b),u.set(g,E),l.push(g),b===1&&v&&Bt.add(g),E===1&&g.setAttribute(r,""),!v&&s&&g.setAttribute(s,s==="inert"?"":"true")}})}return fn+=1,()=>{l.forEach(m=>{const g=uo(s),v=(g.get(m)||0)-1,y=(u.get(m)||0)-1;g.set(m,v),u.set(m,y),v||(!Bt.has(m)&&s&&m.removeAttribute(s),Bt.delete(m)),y||m.removeAttribute(r)}),fn-=1,fn||(lt.inert=new WeakMap,lt["aria-hidden"]=new WeakMap,lt.none=new WeakMap,Bt=new WeakSet,$t={})}}function Vi(e,t=!1,n=!1){const o=fe(e[0]).body;return Wi(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const pr=d.createContext(null),gr=()=>d.useContext(pr),ji=Ct("portal");function Hi(e={}){const{ref:t,container:n,componentProps:o=je,elementProps:r,elementState:s}=e,i=vt(),c=gr()?.portalNode,[l,u]=d.useState(null),[f,p]=d.useState(null),m=z(y=>{y!==null&&p(y)}),g=d.useRef(null);se(()=>{if(n===null){g.current&&(g.current=null,p(null),u(null));return}if(i==null)return;const y=(n&&(fs(n)?n:n.current))??c??document.body;if(y==null){g.current&&(g.current=null,p(null),u(null));return}g.current!==y&&(g.current=y,p(null),u(y))},[n,c,i]);const h=ze("div",o,{ref:[t,m],state:s,props:[{id:i,[ji]:""},r]});return{portalNode:f,portalSubtree:l&&h?_e.createPortal(h,l):null}}const mr=d.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,renderGuards:a,...c}=t,{portalNode:l,portalSubtree:u}=Hi({container:r,ref:n,componentProps:t,elementProps:c}),f=d.useRef(null),p=d.useRef(null),m=d.useRef(null),g=d.useRef(null),[h,v]=d.useState(null),y=h?.modal,b=h?.open,E=typeof a=="boolean"?a:!!h&&!h.modal&&h.open&&!!l;d.useEffect(()=>{if(!l||y)return;function w(O){l&&O.relatedTarget&&at(O)&&(O.type==="focusin"?io:ki)(l)}return l.addEventListener("focusin",w,!0),l.addEventListener("focusout",w,!0),()=>{l.removeEventListener("focusin",w,!0),l.removeEventListener("focusout",w,!0)}},[l,y]),d.useEffect(()=>{!l||b||io(l)},[b,l]);const S=d.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:g,portalNode:l,setFocusManagerState:v}),[l]);return ee.jsxs(d.Fragment,{children:[u,ee.jsxs(pr.Provider,{value:S,children:[E&&l&&ee.jsx(mt,{"data-type":"outside",ref:f,onFocus:w=>{if(at(w,l))m.current?.focus();else{const O=h?h.domReference:null;rr(O)?.focus()}}}),E&&l&&ee.jsx("span",{"aria-owns":l.id,style:vs}),l&&_e.createPortal(o,l),E&&l&&ee.jsx(mt,{"data-type":"outside",ref:p,onFocus:w=>{if(at(w,l))g.current?.focus();else{const O=h?h.domReference:null;Fn(O)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,ce(wt,w.nativeEvent))}}})]})]})});function Be(e){return e==null?e:"current"in e?e.current:e}function _i(e,t){const n=Ce(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const fo=20;let Ve=[];function Ln(){Ve=Ve.filter(e=>e.isConnected)}function Yi(e){Ln(),e&&Ot(e)!=="body"&&(Ve.push(e),Ve.length>fo&&(Ve=Ve.slice(-fo)))}function dn(){return Ln(),Ve[Ve.length-1]}function Ui(e){if(!e)return null;const t=bt();return nr(e,t)?e:It(e,t)[0]||e}function zi(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Pe(e).display!=="none"}function po(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=bt(),r=Oi(e,n).filter(i=>{const a=i.getAttribute("data-tabindex")||"";return nr(i,n)||i.hasAttribute("data-tabindex")&&!a.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function hr(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],initialFocus:s=!0,returnFocus:i=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u="",getInsideElements:f=()=>[],nextFocusableElement:p,previousFocusableElement:m,beforeContentFocusGuardRef:g,externalTree:h}=e,v="rootStore"in t?t.rootStore:t,y=v.useState("open"),b=v.useState("domReferenceElement"),E=v.useState("floatingElement"),{events:S,dataRef:w}=v.context,O=z(()=>w.current.floatingContext?.nodeId),C=z(f),I=s===!1,N=to(b)&&I,k=Fe(r),L=Fe(s),A=Fe(i),T=Fe(u),D=yt(h),P=gr(),V=d.useRef(null),B=d.useRef(null),x=d.useRef(!1),F=d.useRef(!1),Q=d.useRef(!1),X=d.useRef(-1),K=d.useRef(""),Z=d.useRef(""),_=d.useRef(null),ne=d.useRef(null),U=qn(_,g,P?.beforeInsideRef),J=qn(ne,P?.afterInsideRef),de=Je(),pe=Je(),ge=In(),De=P!=null,R=vn(E),Y=z((M=R)=>M?It(M,bt()):[]),$=z(M=>{const W=Y(M);return k.current.map(()=>W).filter(Boolean).flat()});d.useEffect(()=>{if(o||!c)return;function M(q){q.key==="Tab"&&re(R,it(fe(R)))&&Y().length===0&&!N&&ei(q)}const W=fe(R);return W.addEventListener("keydown",M),()=>{W.removeEventListener("keydown",M)}},[o,b,R,c,k,N,Y,$]),d.useEffect(()=>{if(o||!E)return;function M(W){const q=Ee(W),oe=Y().indexOf(q);oe!==-1&&(X.current=oe)}return E.addEventListener("focusin",M),()=>{E.removeEventListener("focusin",M)}},[o,E,Y]),d.useEffect(()=>{if(o||!y)return;const M=fe(R);function W(){Q.current=!1}function q(oe){const H=Ee(oe),j=re(E,H)||re(b,H)||re(P?.portalNode,H);Q.current=!j,Z.current=oe.pointerType||"keyboard"}function te(){Z.current="keyboard"}return M.addEventListener("pointerdown",q,!0),M.addEventListener("pointerup",W,!0),M.addEventListener("pointercancel",W,!0),M.addEventListener("keydown",te,!0),()=>{M.removeEventListener("pointerdown",q,!0),M.removeEventListener("pointerup",W,!0),M.removeEventListener("pointercancel",W,!0),M.removeEventListener("keydown",te,!0)}},[o,E,b,R,y,P]),d.useEffect(()=>{if(o||!l)return;function M(){F.current=!0,pe.start(0,()=>{F.current=!1})}function W(H){const j=H.relatedTarget,me=H.currentTarget,ae=Ee(H);queueMicrotask(()=>{const Ne=O(),Ge=v.context.triggerElements,ot=j?.hasAttribute(Ct("focus-guard"))&&[_.current,ne.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Be(m),Be(p)].includes(j),Xe=!(re(b,j)||re(E,j)||re(j,E)||re(P?.portalNode,j)||j!=null&&Ge.hasElement(j)||Ge.hasMatchingElement(he=>re(he,j))||ot||D&&(Ze(D.nodesRef.current,Ne).find(he=>re(he.context?.elements.floating,j)||re(he.context?.elements.domReference,j))||no(D.nodesRef.current,Ne).find(he=>[he.context?.elements.floating,vn(he.context?.elements.floating)].includes(j)||he.context?.elements.domReference===j)));if(me===b&&R&&po(R,k),a&&me!==b&&!zi(ae)&&it(fe(R))===fe(R).body){if(be(R)&&(R.focus(),a==="popup")){ge.request(()=>{R.focus()});return}const he=X.current,Ie=Y(),ke=Ie[he]||Ie[Ie.length-1]||R;be(ke)&&ke.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(N||!c)&&j&&Xe&&!F.current&&(N||j!==dn())&&(x.current=!0,v.setOpen(!1,ce(wt,H)))})}function q(){Q.current||(w.current.insideReactTree=!0,de.start(0,()=>{w.current.insideReactTree=!1}))}const te=be(b)?b:null,oe=[];if(!(!E&&!te))return te&&(te.addEventListener("focusout",W),te.addEventListener("pointerdown",M),oe.push(()=>{te.removeEventListener("focusout",W),te.removeEventListener("pointerdown",M)})),E&&(E.addEventListener("focusout",W),P&&(E.addEventListener("focusout",q,!0),oe.push(()=>{E.removeEventListener("focusout",q,!0)})),oe.push(()=>{E.removeEventListener("focusout",W)})),()=>{oe.forEach(H=>{H()})}},[o,b,E,R,c,D,P,v,l,a,Y,N,O,k,w,de,pe,ge,p,m]),d.useEffect(()=>{if(o||!E||!y)return;const M=Array.from(P?.portalNode?.querySelectorAll(`[${Ct("portal")}]`)||[]),q=(D?no(D.nodesRef.current,O()):[]).find(H=>to(H.context?.elements.domReference||null))?.context?.elements.domReference,te=[E,q,...M,...C(),V.current,B.current,_.current,ne.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Be(m),Be(p),N?b:null].filter(H=>H!=null),oe=Vi(te,c||N);return()=>{oe()}},[y,o,b,E,c,k,P,N,D,O,C,p,m]),se(()=>{if(!y||o||!be(R))return;const M=fe(R),W=it(M);queueMicrotask(()=>{const q=$(R),te=L.current,oe=typeof te=="function"?te(T.current||""):te;if(oe===void 0||oe===!1)return;let H;oe===!0||oe===null?H=q[0]||R:H=Be(oe),H=H||q[0]||R,!re(R,W)&&un(H,{preventScroll:H===R})})},[o,y,R,I,$,L,T]),se(()=>{if(o||!R)return;const M=fe(R),W=it(M);Yi(W);function q(H){if(H.open||(K.current=_i(H.nativeEvent,Z.current)),H.reason===xe&&H.nativeEvent.type==="mouseleave"&&(x.current=!0),H.reason===lr)if(H.nested)x.current=!1;else if(ni(H.nativeEvent)||oi(H.nativeEvent))x.current=!1;else{let j=!1;document.createElement("div").focus({get preventScroll(){return j=!0,!1}}),j?x.current=!1:x.current=!0}}S.on("openchange",q);const te=M.createElement("span");te.setAttribute("tabindex","-1"),te.setAttribute("aria-hidden","true"),Object.assign(te.style,Bo),De&&b&&b.insertAdjacentElement("afterend",te);function oe(){const H=A.current;let j=typeof H=="function"?H(K.current):H;if(j===void 0||j===!1)return null;if(j===null&&(j=!0),typeof j=="boolean"){const ae=b||dn();return ae&&ae.isConnected?ae:te}const me=b||dn()||te;return Be(j)||me}return()=>{S.off("openchange",q);const H=it(M),j=re(E,H)||D&&Ze(D.nodesRef.current,O(),!1).some(ae=>re(ae.context?.elements.floating,H)),me=oe();queueMicrotask(()=>{const ae=Ui(me),Ne=typeof A.current!="boolean";A.current&&!x.current&&be(ae)&&(!(!Ne&&ae!==H&&H!==M.body)||j)&&ae.focus({preventScroll:!0}),te.remove()})}},[o,E,R,A,w,S,D,De,b,O]),d.useEffect(()=>{queueMicrotask(()=>{x.current=!1})},[o]),d.useEffect(()=>{if(o||!y)return;function M(q){Ee(q)?.closest(`[${Do}]`)&&(F.current=!0)}const W=fe(R);return W.addEventListener("pointerdown",M,!0),()=>{W.removeEventListener("pointerdown",M,!0)}},[o,y,R]),se(()=>{if(!o&&P)return P.setFocusManagerState({modal:c,closeOnFocusOut:l,open:y,onOpenChange:v.setOpen,domReference:b}),()=>{P.setFocusManagerState(null)}},[o,P,c,y,v,l,b]),se(()=>{if(!(o||!R))return po(R,k),()=>{queueMicrotask(Ln)}},[o,R,k]);const ue=!o&&(c?!N:!0)&&(De||c);return ee.jsxs(d.Fragment,{children:[ue&&ee.jsx(mt,{"data-type":"inside",ref:U,onFocus:M=>{if(c){const W=$();un(W[W.length-1])}else P?.portalNode&&(x.current=!1,at(M,P.portalNode)?Fn(b)?.focus():Be(m??P.beforeOutsideRef)?.focus())}}),n,ue&&ee.jsx(mt,{"data-type":"inside",ref:J,onFocus:M=>{c?un($()[0]):P?.portalNode&&(l&&(x.current=!0),at(M,P.portalNode)?rr(b)?.focus():Be(p??P.afterOutsideRef)?.focus())}})]})}function qi(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:r=!0,event:s="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:c=!0,touchOpenDelay:l=0}=t,u=d.useRef(void 0),f=In(),p=Je(),m=d.useMemo(()=>({onPointerDown(g){u.current=g.pointerType},onMouseDown(g){const h=u.current,v=g.nativeEvent,y=n.select("open");if(g.button!==0||s==="click"||dt(h,!0)&&a)return;const b=o.current.openEvent,E=b?.type,S=n.select("domReferenceElement")!==g.currentTarget,w=y&&S||!(y&&i&&(!(b&&c)||E==="click"||E==="mousedown"));if(qo(v.target)){const C=ce(He,v,v.target);w&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,C)}):n.setOpen(w,C);return}const O=g.currentTarget;f.request(()=>{const C=ce(He,v,O);w&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,C)}):n.setOpen(w,C)})},onClick(g){if(s==="mousedown-only")return;const h=u.current;if(s==="mousedown"&&h){u.current=void 0;return}if(dt(h,!0)&&a)return;const v=n.select("open"),y=o.current.openEvent,b=n.select("domReferenceElement")!==g.currentTarget,E=v&&b||!(v&&i&&(!(y&&c)||Go(y))),S=ce(He,g.nativeEvent,g.currentTarget);E&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,S)}):n.setOpen(E,S)},onKeyDown(){u.current=void 0}}),[o,s,a,n,c,i,f,p,l]);return d.useMemo(()=>r?{reference:m}:je,[r,m])}function go(e,t,n){let{reference:o,floating:r}=e;const s=we(t),i=An(t),a=Mn(i),c=ye(t),l=s==="y",u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,p=o[a]/2-r[a]/2;let m;switch(c){case"top":m={x:u,y:o.y-r.height};break;case"bottom":m={x:u,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:f};break;case"left":m={x:o.x-r.width,y:f};break;default:m={x:o.x,y:o.y}}switch(qe(t)){case"start":m[i]-=p*(n&&l?-1:1);break;case"end":m[i]+=p*(n&&l?-1:1);break}return m}async function Gi(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:m=0}=$e(t,e),g=Xo(m),v=a[p?f==="floating"?"reference":"floating":f],y=Ut(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),b=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},w=Ut(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:E,strategy:c}):b);return{top:(y.top-w.top+g.top)/S.y,bottom:(w.bottom-y.bottom+g.bottom)/S.y,left:(y.left-w.left+g.left)/S.x,right:(w.right-y.right+g.right)/S.x}}const Xi=50,Ki=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:Gi},c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=go(l,o,c),p=o,m=0;const g={};for(let h=0;h<s.length;h++){const v=s[h];if(!v)continue;const{name:y,fn:b}=v,{x:E,y:S,data:w,reset:O}=await b({x:u,y:f,initialPlacement:o,placement:p,strategy:r,middlewareData:g,rects:l,platform:a,elements:{reference:e,floating:t}});u=E??u,f=S??f,g[y]={...g[y],...w},O&&m<Xi&&(m++,typeof O=="object"&&(O.placement&&(p=O.placement),O.rects&&(l=O.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):O.rects),{x:u,y:f}=go(l,p,c)),h=-1)}return{x:u,y:f,placement:p,strategy:r,middlewareData:g}},Zi=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...v}=$e(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=ye(r),b=we(a),E=ye(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(l.floating)),w=p||(E||!h?[Yt(a)]:ci(a)),O=g!=="none";!p&&O&&w.push(...fi(a,h,g,S));const C=[a,...w],I=await c.detectOverflow(t,v),N=[];let k=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&N.push(I[y]),f){const D=ii(r,i,S);N.push(I[D[0]],I[D[1]])}if(k=[...k,{placement:r,overflows:N}],!N.every(D=>D<=0)){var L,A;const D=(((L=s.flip)==null?void 0:L.index)||0)+1,P=C[D];if(P&&(!(f==="alignment"?b!==we(P):!1)||k.every(x=>we(x.placement)===b?x.overflows[0]>0:!0)))return{data:{index:D,overflows:k},reset:{placement:P}};let V=(A=k.filter(B=>B.overflows[0]<=0).sort((B,x)=>B.overflows[1]-x.overflows[1])[0])==null?void 0:A.placement;if(!V)switch(m){case"bestFit":{var T;const B=(T=k.filter(x=>{if(O){const F=we(x.placement);return F===b||F==="y"}return!0}).map(x=>[x.placement,x.overflows.filter(F=>F>0).reduce((F,Q)=>F+Q,0)]).sort((x,F)=>x[1]-F[1])[0])==null?void 0:T[0];B&&(V=B);break}case"initialPlacement":V=a;break}if(r!==V)return{reset:{placement:V}}}return{}}}};function mo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ho(e){return ri.some(t=>e[t]>=0)}const Ji=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=$e(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),a=mo(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ho(a)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),a=mo(i,n.floating);return{data:{escapedOffsets:a,escaped:ho(a)}}}default:return{}}}}},br=new Set(["left","top"]);async function Qi(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=ye(n),a=qe(n),c=we(n)==="y",l=br.has(i)?-1:1,u=s&&c?-1:1,f=$e(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),c?{x:m*u,y:p*l}:{x:p*l,y:m*u}}const ec=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:a}=t,c=await Qi(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},tc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:b,y:E}=y;return{x:b,y:E}}},...l}=$e(e,t),u={x:n,y:o},f=await s.detectOverflow(t,l),p=we(ye(r)),m=kn(p);let g=u[m],h=u[p];if(i){const y=m==="y"?"top":"left",b=m==="y"?"bottom":"right",E=g+f[y],S=g-f[b];g=yn(E,g,S)}if(a){const y=p==="y"?"top":"left",b=p==="y"?"bottom":"right",E=h+f[y],S=h-f[b];h=yn(E,h,S)}const v=c.fn({...t,[m]:g,[p]:h});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[m]:i,[p]:a}}}}}},nc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=$e(e,t),u={x:n,y:o},f=we(r),p=kn(f);let m=u[p],g=u[f];const h=$e(a,t),v=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const E=p==="y"?"height":"width",S=s.reference[p]-s.floating[E]+v.mainAxis,w=s.reference[p]+s.reference[E]-v.mainAxis;m<S?m=S:m>w&&(m=w)}if(l){var y,b;const E=p==="y"?"width":"height",S=br.has(ye(r)),w=s.reference[f]-s.floating[E]+(S&&((y=i.offset)==null?void 0:y[f])||0)+(S?0:v.crossAxis),O=s.reference[f]+s.reference[E]+(S?0:((b=i.offset)==null?void 0:b[f])||0)-(S?v.crossAxis:0);g<w?g=w:g>O&&(g=O)}return{[p]:m,[f]:g}}}},oc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=$e(e,t),u=await i.detectOverflow(t,l),f=ye(r),p=qe(r),m=we(r)==="y",{width:g,height:h}=s.floating;let v,y;f==="top"||f==="bottom"?(v=f,y=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,v=p==="end"?"top":"bottom");const b=h-u.top-u.bottom,E=g-u.left-u.right,S=pt(h-u[v],b),w=pt(g-u[y],E),O=!t.middlewareData.shift;let C=S,I=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=E),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(C=b),O&&!p){const k=Re(u.left,0),L=Re(u.right,0),A=Re(u.top,0),T=Re(u.bottom,0);m?I=g-2*(k!==0||L!==0?k+L:Re(u.left,u.right)):C=h-2*(A!==0||T!==0?A+T:Re(u.top,u.bottom))}await c({...t,availableWidth:I,availableHeight:C});const N=await i.getDimensions(a.floating);return g!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}};function vr(e){const t=Pe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=be(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,a=_t(n)!==s||_t(o)!==i;return a&&(n=s,o=i),{width:n,height:o,$:a}}function Dn(e){return ie(e)?e:e.contextElement}function ut(e){const t=Dn(e);if(!be(t))return Le(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=vr(t);let i=(s?_t(n.width):n.width)/o,a=(s?_t(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const rc=Le(0);function yr(e){const t=Ce(e);return!Cn()||!t.visualViewport?rc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ce(e)?!1:t}function Qe(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Dn(e);let i=Le(1);t&&(o?ie(o)&&(i=ut(o)):i=ut(e));const a=sc(s,n,o)?yr(s):Le(0);let c=(r.left+a.x)/i.x,l=(r.top+a.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const p=Ce(s),m=o&&ie(o)?Ce(o):o;let g=p,h=Gn(g);for(;h&&o&&m!==g;){const v=ut(h),y=h.getBoundingClientRect(),b=Pe(h),E=y.left+(h.clientLeft+parseFloat(b.paddingLeft))*v.x,S=y.top+(h.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=E,l+=S,g=Ce(h),h=Gn(g)}}return Ut({width:u,height:f,x:c,y:l})}function Jt(e,t){const n=Zt(e).scrollLeft;return t?t.left+n:Qe(We(e)).left+n}function Er(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Jt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function ic(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=We(o),a=t?Tn(t.floating):!1;if(o===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=Le(1);const u=Le(0),f=be(o);if((f||!f&&!s)&&((Ot(o)!=="body"||Pt(i))&&(c=Zt(o)),f)){const m=Qe(o);l=ut(o),u.x=m.x+o.clientLeft,u.y=m.y+o.clientTop}const p=i&&!f&&!s?Er(i,c):Le(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:n.y*l.y-c.scrollTop*l.y+u.y+p.y}}function cc(e){return Array.from(e.getClientRects())}function ac(e){const t=We(e),n=Zt(e),o=e.ownerDocument.body,r=Re(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=Re(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Jt(e);const a=-n.scrollTop;return Pe(o).direction==="rtl"&&(i+=Re(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:a}}const bo=25;function lc(e,t){const n=Ce(e),o=We(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,a=0,c=0;if(r){s=r.width,i=r.height;const u=Cn();(!u||u&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}const l=Jt(o);if(l<=0){const u=o.ownerDocument,f=u.body,p=getComputedStyle(f),m=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(o.clientWidth-f.clientWidth-m);g<=bo&&(s-=g)}else l<=bo&&(s+=l);return{width:s,height:i,x:a,y:c}}function uc(e,t){const n=Qe(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=be(e)?ut(e):Le(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=r*s.x,l=o*s.y;return{width:i,height:a,x:c,y:l}}function vo(e,t,n){let o;if(t==="viewport")o=lc(e,n);else if(t==="document")o=ac(We(e));else if(ie(t))o=uc(t,n);else{const r=yr(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Ut(o)}function Rr(e,t){const n=ft(e);return n===t||!ie(n)||Ke(n)?!1:Pe(n).position==="fixed"||Rr(n,t)}function fc(e,t){const n=t.get(e);if(n)return n;let o=ct(e,[],!1).filter(a=>ie(a)&&Ot(a)!=="body"),r=null;const s=Pe(e).position==="fixed";let i=s?ft(e):e;for(;ie(i)&&!Ke(i);){const a=Pe(i),c=Lo(i);!c&&a.position==="fixed"&&(r=null),(s?!c&&!r:!c&&a.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Pt(i)&&!c&&Rr(e,i))?o=o.filter(u=>u!==i):r=a,i=ft(i)}return t.set(e,o),o}function dc(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?Tn(t)?[]:fc(t,this._c):[].concat(n),o],a=vo(t,i[0],r);let c=a.top,l=a.right,u=a.bottom,f=a.left;for(let p=1;p<i.length;p++){const m=vo(t,i[p],r);c=Re(m.top,c),l=pt(m.right,l),u=pt(m.bottom,u),f=Re(m.left,f)}return{width:l-f,height:u-c,x:f,y:c}}function pc(e){const{width:t,height:n}=vr(e);return{width:t,height:n}}function gc(e,t,n){const o=be(t),r=We(t),s=n==="fixed",i=Qe(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=Le(0);function l(){c.x=Jt(r)}if(o||!o&&!s)if((Ot(t)!=="body"||Pt(r))&&(a=Zt(t)),o){const m=Qe(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else r&&l();s&&!o&&r&&l();const u=r&&!o&&!s?Er(r,a):Le(0),f=i.left+a.scrollLeft-c.x-u.x,p=i.top+a.scrollTop-c.y-u.y;return{x:f,y:p,width:i.width,height:i.height}}function pn(e){return Pe(e).position==="static"}function yo(e,t){if(!be(e)||Pe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return We(e)===n&&(n=n.ownerDocument.body),n}function xr(e,t){const n=Ce(e);if(Tn(e))return n;if(!be(e)){let r=ft(e);for(;r&&!Ke(r);){if(ie(r)&&!pn(r))return r;r=ft(r)}return n}let o=yo(e,t);for(;o&&ds(o)&&pn(o);)o=yo(o,t);return o&&Ke(o)&&pn(o)&&!Lo(o)?n:o||ps(e)||n}const mc=async function(e){const t=this.getOffsetParent||xr,n=this.getDimensions,o=await n(e.floating);return{reference:gc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function hc(e){return Pe(e).direction==="rtl"}const bc={convertOffsetParentRelativeRectToViewportRelativeRect:ic,getDocumentElement:We,getClippingRect:dc,getOffsetParent:xr,getElementRects:mc,getClientRects:cc,getDimensions:pc,getScale:ut,isElement:ie,isRTL:hc};function Sr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vc(e,t){let n=null,o;const r=We(e);function s(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:f,width:p,height:m}=l;if(a||t(),!p||!m)return;const g=Nt(f),h=Nt(r.clientWidth-(u+p)),v=Nt(r.clientHeight-(f+m)),y=Nt(u),E={rootMargin:-g+"px "+-h+"px "+-v+"px "+-y+"px",threshold:Re(0,pt(1,c))||1};let S=!0;function w(O){const C=O[0].intersectionRatio;if(C!==c){if(!S)return i();C?i(!1,C):o=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!Sr(l,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(w,{...E,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,E)}n.observe(e)}return i(!0),s}function Eo(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=Dn(e),u=r||s?[...l?ct(l):[],...t?ct(t):[]]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=l&&a?vc(l,n):null;let p=-1,m=null;i&&(m=new ResizeObserver(y=>{let[b]=y;b&&b.target===l&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var E;(E=m)==null||E.observe(t)})),n()}),l&&!c&&m.observe(l),t&&m.observe(t));let g,h=c?Qe(e):null;c&&v();function v(){const y=Qe(e);h&&!Sr(h,y)&&n(),h=y,g=requestAnimationFrame(v)}return n(),()=>{var y;u.forEach(b=>{r&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),f?.(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const yc=ec,Ec=tc,Rc=Zi,xc=oc,Sc=Ji,wc=nc,Cc=(e,t,n)=>{const o=new Map,r={platform:bc,...n},s={...r.platform,_c:o};return Ki(e,t,{...r,platform:s})};var Tc=typeof document<"u",Oc=function(){},Vt=Tc?d.useLayoutEffect:Oc;function Kt(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Kt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!Kt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function wr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ro(e,t){const n=wr(e);return Math.round(t*n)/n}function gn(e){const t=d.useRef(e);return Vt(()=>{t.current=e}),t}function Pc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=d.useState(o);Kt(p,o)||m(o);const[g,h]=d.useState(null),[v,y]=d.useState(null),b=d.useCallback(x=>{x!==O.current&&(O.current=x,h(x))},[]),E=d.useCallback(x=>{x!==C.current&&(C.current=x,y(x))},[]),S=s||g,w=i||v,O=d.useRef(null),C=d.useRef(null),I=d.useRef(u),N=c!=null,k=gn(c),L=gn(r),A=gn(l),T=d.useCallback(()=>{if(!O.current||!C.current)return;const x={placement:t,strategy:n,middleware:p};L.current&&(x.platform=L.current),Cc(O.current,C.current,x).then(F=>{const Q={...F,isPositioned:A.current!==!1};D.current&&!Kt(I.current,Q)&&(I.current=Q,_e.flushSync(()=>{f(Q)}))})},[p,t,n,L,A]);Vt(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(x=>({...x,isPositioned:!1})))},[l]);const D=d.useRef(!1);Vt(()=>(D.current=!0,()=>{D.current=!1}),[]),Vt(()=>{if(S&&(O.current=S),w&&(C.current=w),S&&w){if(k.current)return k.current(S,w,T);T()}},[S,w,T,k,N]);const P=d.useMemo(()=>({reference:O,floating:C,setReference:b,setFloating:E}),[b,E]),V=d.useMemo(()=>({reference:S,floating:w}),[S,w]),B=d.useMemo(()=>{const x={position:n,left:0,top:0};if(!V.floating)return x;const F=Ro(V.floating,u.x),Q=Ro(V.floating,u.y);return a?{...x,transform:"translate("+F+"px, "+Q+"px)",...wr(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:Q}},[n,a,V.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:T,refs:P,elements:V,floatingStyles:B}),[u,T,P,V,B])}const Ic=(e,t)=>{const n=yc(e);return{name:n.name,fn:n.fn,options:[e,t]}},kc=(e,t)=>{const n=Ec(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mc=(e,t)=>({fn:wc(e).fn,options:[e,t]}),Ac=(e,t)=>{const n=Rc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fc=(e,t)=>{const n=xc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lc=(e,t)=>{const n=Sc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dc={intentional:"onClick",sloppy:"onPointerDown"};function Nc(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Cr(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:c}=n.context,{enabled:l=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:p="sloppy",referencePress:m=!1,referencePressEvent:g="sloppy",ancestorScroll:h=!1,bubbles:v,externalTree:y}=t,b=yt(y),E=z(typeof f=="function"?f:()=>!1),S=typeof f=="function"?E:f,w=d.useRef(!1),{escapeKey:O,outsidePress:C}=Nc(v),I=d.useRef(null),N=Je(),k=Je(),L=z(()=>{k.clear(),c.current.insideReactTree=!1}),A=d.useRef(!1),T=d.useRef(""),D=z(R=>{T.current=R.pointerType}),P=z(()=>{const R=T.current,Y=R==="pen"||!R?"mouse":R,$=typeof p=="function"?p():p;return typeof $=="string"?$:$[Y]}),V=z(R=>{if(!o||!l||!u||R.key!=="Escape"||A.current)return;const Y=c.current.floatingContext?.nodeId,$=b?Ze(b.nodesRef.current,Y):[];if(!O&&$.length>0){let W=!0;if($.forEach(q=>{q.context?.open&&!q.context.dataRef.current.__escapeKeyBubbles&&(W=!1)}),!W)return}const ue=ti(R)?R.nativeEvent:R,M=ce(ur,ue);n.setOpen(!1,M),!O&&!M.isPropagationAllowed&&R.stopPropagation()}),B=z(R=>{const Y=P();return Y==="intentional"&&R.type!=="click"||Y==="sloppy"&&R.type==="click"}),x=z(()=>{c.current.insideReactTree=!0,k.start(0,L)}),F=z((R,Y=!1)=>{if(B(R)){L();return}if(c.current.insideReactTree){L();return}if(P()==="intentional"&&Y||typeof S=="function"&&!S(R))return;const $=Ee(R),ue=`[${Ct("inert")}]`,M=fe(n.select("floatingElement")).querySelectorAll(ue),W=n.context.triggerElements;if($&&(W.hasElement($)||W.hasMatchingElement(j=>re(j,$))))return;let q=ie($)?$:null;for(;q&&!Ke(q);){const j=ft(q);if(Ke(j)||!ie(j))break;q=j}if(M.length&&ie($)&&!Qs($)&&!re($,n.select("floatingElement"))&&Array.from(M).every(j=>!re(q,j)))return;if(be($)&&!("touches"in R)){const j=Ke($),me=Pe($),ae=/auto|scroll/,Ne=j||ae.test(me.overflowX),Ge=j||ae.test(me.overflowY),ot=Ne&&$.clientWidth>0&&$.scrollWidth>$.clientWidth,Xe=Ge&&$.clientHeight>0&&$.scrollHeight>$.clientHeight,he=me.direction==="rtl",Ie=Xe&&(he?R.offsetX<=$.offsetWidth-$.clientWidth:R.offsetX>$.clientWidth),ke=ot&&R.offsetY>$.clientHeight;if(Ie||ke)return}const te=c.current.floatingContext?.nodeId,oe=b&&Ze(b.nodesRef.current,te).some(j=>Te(R,j.context?.elements.floating));if(Te(R,n.select("floatingElement"))||Te(R,n.select("domReferenceElement"))||oe)return;const H=b?Ze(b.nodesRef.current,te):[];if(H.length>0){let j=!0;if(H.forEach(me=>{me.context?.open&&!me.context.dataRef.current.__outsidePressBubbles&&(j=!1)}),!j)return}n.setOpen(!1,ce(lr,R)),L()}),Q=z(R=>{P()!=="sloppy"||R.pointerType==="touch"||!n.select("open")||!l||Te(R,n.select("floatingElement"))||Te(R,n.select("domReferenceElement"))||F(R)}),X=z(R=>{if(P()!=="sloppy"||!n.select("open")||!l||Te(R,n.select("floatingElement"))||Te(R,n.select("domReferenceElement")))return;const Y=R.touches[0];Y&&(I.current={startTime:Date.now(),startX:Y.clientX,startY:Y.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},N.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}),K=z(R=>{const Y=Ee(R);function $(){X(R),Y?.removeEventListener(R.type,$)}Y?.addEventListener(R.type,$)}),Z=z(R=>{const Y=w.current;if(w.current=!1,N.clear(),R.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const $=Ee(R);function ue(){R.type==="pointerdown"?Q(R):F(R,Y),$?.removeEventListener(R.type,ue)}$?.addEventListener(R.type,ue)}),_=z(R=>{if(P()!=="sloppy"||!I.current||Te(R,n.select("floatingElement"))||Te(R,n.select("domReferenceElement")))return;const Y=R.touches[0];if(!Y)return;const $=Math.abs(Y.clientX-I.current.startX),ue=Math.abs(Y.clientY-I.current.startY),M=Math.sqrt($*$+ue*ue);M>5&&(I.current.dismissOnTouchEnd=!0),M>10&&(F(R),N.clear(),I.current=null)}),ne=z(R=>{const Y=Ee(R);function $(){_(R),Y?.removeEventListener(R.type,$)}Y?.addEventListener(R.type,$)}),U=z(R=>{P()!=="sloppy"||!I.current||Te(R,n.select("floatingElement"))||Te(R,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&F(R),N.clear(),I.current=null)}),J=z(R=>{const Y=Ee(R);function $(){U(R),Y?.removeEventListener(R.type,$)}Y?.addEventListener(R.type,$)});d.useEffect(()=>{if(!o||!l)return;c.current.__escapeKeyBubbles=O,c.current.__outsidePressBubbles=C;const R=new Ye;function Y(q){n.setOpen(!1,ce(Bi,q))}function $(){R.clear(),A.current=!0}function ue(){R.start(Cn()?5:0,()=>{A.current=!1})}const M=fe(r);M.addEventListener("pointerdown",D,!0),u&&(M.addEventListener("keydown",V),M.addEventListener("compositionstart",$),M.addEventListener("compositionend",ue)),S&&(M.addEventListener("click",Z,!0),M.addEventListener("pointerdown",Z,!0),M.addEventListener("touchstart",K,!0),M.addEventListener("touchmove",ne,!0),M.addEventListener("touchend",J,!0),M.addEventListener("mousedown",Z,!0));let W=[];return h&&(ie(i)&&(W=ct(i)),ie(r)&&(W=W.concat(ct(r))),!ie(s)&&s&&s.contextElement&&(W=W.concat(ct(s.contextElement)))),W=W.filter(q=>q!==M.defaultView?.visualViewport),W.forEach(q=>{q.addEventListener("scroll",Y,{passive:!0})}),()=>{M.removeEventListener("pointerdown",D,!0),u&&(M.removeEventListener("keydown",V),M.removeEventListener("compositionstart",$),M.removeEventListener("compositionend",ue)),S&&(M.removeEventListener("click",Z,!0),M.removeEventListener("pointerdown",Z,!0),M.removeEventListener("touchstart",K,!0),M.removeEventListener("touchmove",ne,!0),M.removeEventListener("touchend",J,!0),M.removeEventListener("mousedown",Z,!0)),W.forEach(q=>{q.removeEventListener("scroll",Y)}),R.clear(),w.current=!1}},[c,r,s,i,u,S,o,a,h,l,O,C,V,F,Z,Q,K,ne,J,D,n]),d.useEffect(L,[S,L]);const de=d.useMemo(()=>({onKeyDown:V,...m&&{[Dc[g]]:R=>{n.setOpen(!1,ce(He,R.nativeEvent))},...g!=="intentional"&&{onClick(R){n.setOpen(!1,ce(He,R.nativeEvent))}}}}),[V,n,m,g]),pe=z(R=>{const Y=Ee(R.nativeEvent);!re(n.select("floatingElement"),Y)||R.button!==0||(w.current=!0)}),ge=z(R=>{!o||!l||R.button!==0||(w.current=!0)}),De=d.useMemo(()=>({onKeyDown:V,onPointerDown:pe,onMouseDown:pe,onMouseUp:pe,onClickCapture:x,onMouseDownCapture(R){x(),ge(R)},onPointerDownCapture(R){x(),ge(R)},onMouseUpCapture:x,onTouchEndCapture:x,onTouchMoveCapture:x}),[V,pe,x,ge]);return d.useMemo(()=>l?{reference:de,floating:De,trigger:de}:{},[l,de,De])}const Bc={open:G(e=>e.open),domReferenceElement:G(e=>e.domReferenceElement),referenceElement:G(e=>e.positionReference??e.referenceElement),floatingElement:G(e=>e.floatingElement),floatingId:G(e=>e.floatingId)};class Nn extends On{constructor(t){const{nested:n,noEmit:o,onOpenChange:r,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:ir(),nested:n,noEmit:o,triggerElements:s},Bc)}setOpen=(t,n)=>{if((!t||!this.state.open||Go(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const o={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",o)}this.context.onOpenChange?.(t,n)}}function $c(e,t=!1,n=!1){const[o,r]=d.useState(e&&t?"idle":void 0),[s,i]=d.useState(e);return e&&!s&&(i(!0),r("starting")),!e&&s&&o!=="ending"&&!n&&r("ending"),!e&&!s&&o==="ending"&&r(void 0),se(()=>{if(!e&&s&&o!=="ending"&&n){const a=Ae.request(()=>{r("ending")});return()=>{Ae.cancel(a)}}},[e,s,o,n]),se(()=>{if(!e||t)return;const a=Ae.request(()=>{r(void 0)});return()=>{Ae.cancel(a)}},[t,e]),se(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const a=Ae.request(()=>{r("idle")});return()=>{Ae.cancel(a)}},[t,e,s,r,o]),d.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:o}),[s,o])}let Tt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Wc={[Tt.startingStyle]:""},Vc={[Tt.endingStyle]:""},Qt={transitionStatus(e){return e==="starting"?Wc:e==="ending"?Vc:null}};function Tr(e,t=!1,n=!0){const o=In();return z((r,s=null)=>{o.cancel();function i(){_e.flushSync(r)}const a=Be(e);if(a==null)return;const c=a;if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let l=function(){const f=Tt.startingStyle;if(!c.hasAttribute(f)){o.request(u);return}const p=new MutationObserver(()=>{c.hasAttribute(f)||(p.disconnect(),u())});p.observe(c,{attributes:!0,attributeFilter:[f]}),s?.addEventListener("abort",()=>p.disconnect(),{once:!0})},u=function(){Promise.all(c.getAnimations().map(f=>f.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const f=c.getAnimations();if(n){if(s?.aborted)return;i()}else f.length>0&&f.some(p=>p.pending||p.playState!=="finished")&&u()})};if(t){l();return}o.request(u)}})}function Bn(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=z(r),i=Tr(o,n,!1);d.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}function jc(e,t){const n=d.useRef(null),o=d.useRef(null);return d.useCallback(r=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=o.current,a=t.context.triggerElements.getById(s);i&&a===i&&t.context.triggerElements.delete(s),n.current=null,o.current=null}r!==null&&(n.current=e,o.current=r,t.context.triggerElements.add(e,r))}},[t,e])}function Hc(e,t,n,o){const r=n.useState("isMountedByTrigger",e),s=jc(e,n),i=z(a=>{if(s(a),!a||!n.select("open"))return;const c=n.select("activeTriggerId");if(c===e){n.update({activeTriggerElement:a,...o});return}c==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...o})});return se(()=>{r&&n.update({activeTriggerElement:t.current,...o})},[r,n,t,...Object.values(o)]),{registerTrigger:i,isMountedByThisTrigger:r}}function Or(e){const t=e.useState("open");se(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[o,r]=n.value;e.update({activeTriggerId:o,activeTriggerElement:r})}}},[t,e])}function Pr(e,t,n){const{mounted:o,setMounted:r,transitionStatus:s}=$c(e);t.useSyncedValues({mounted:o,transitionStatus:s});const i=z(()=>{r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return Bn({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class en{constructor(){this.elements=new Set,this.idMap=new Map}add(t,n){const o=this.idMap.get(t);o!==n&&(o!==void 0&&this.elements.delete(o),this.elements.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elements.delete(n),this.idMap.delete(t))}hasElement(t){return this.elements.has(t)}hasMatchingElement(t){for(const n of this.elements)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function _c(){return new Nn({open:!1,floatingElement:null,referenceElement:null,triggerElements:new en,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Ir(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:_c(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:je,inactiveTriggerProps:je,popupProps:je}}const kr={open:G(e=>e.open),mounted:G(e=>e.mounted),transitionStatus:G(e=>e.transitionStatus),floatingRootContext:G(e=>e.floatingRootContext),preventUnmountingOnClose:G(e=>e.preventUnmountingOnClose),payload:G(e=>e.payload),activeTriggerId:G(e=>e.activeTriggerId),activeTriggerElement:G(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:G((e,t)=>t!==void 0&&e.activeTriggerId===t),isOpenedByTrigger:G((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.open),isMountedByTrigger:G((e,t)=>t!==void 0&&e.activeTriggerId===t&&e.mounted),triggerProps:G((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:G(e=>e.popupProps),popupElement:G(e=>e.popupElement),positionerElement:G(e=>e.positionerElement)};function Yc(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=vt(),s=tt()!=null,i=Ue(()=>new Nn({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:o.triggers??new en,floatingId:r,nested:s,noEmit:e.noEmit||!1})).current;return se(()=>{const a={open:t,floatingId:r};o.reference!==void 0&&(a.referenceElement=o.reference,a.domReferenceElement=ie(o.reference)?o.reference:null),o.floating!==void 0&&(a.floatingElement=o.floating),i.update(a)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=e.noEmit||!1,i}function Uc(e={}){const{nodeId:t,externalTree:n}=e,o=Yc(e),r=e.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,a]=d.useState(null),c=d.useRef(null),l=yt(n);se(()=>{s.domReference&&(c.current=s.domReference)},[s.domReference]);const u=Pc({...e,elements:{...s,...i&&{reference:i}}}),f=d.useCallback(C=>{const I=ie(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;a(I),u.refs.setReference(I)},[u.refs]),[p,m]=d.useState(null),[g,h]=d.useState(null);r.useSyncedValue("referenceElement",p),r.useSyncedValue("domReferenceElement",ie(p)?p:null),r.useSyncedValue("floatingElement",g);const v=d.useCallback(C=>{(ie(C)||C===null)&&(c.current=C,m(C)),(ie(u.refs.reference.current)||u.refs.reference.current===null||C!==null&&!ie(C))&&u.refs.setReference(C)},[u.refs,m]),y=d.useCallback(C=>{h(C),u.refs.setFloating(C)},[u.refs]),b=d.useMemo(()=>({...u.refs,setReference:v,setFloating:y,setPositionReference:f,domReference:c}),[u.refs,v,y,f]),E=d.useMemo(()=>({...u.elements,domReference:s.domReference}),[u.elements,s.domReference]),S=r.useState("open"),w=r.useState("floatingId"),O=d.useMemo(()=>({...u,dataRef:r.context.dataRef,open:S,onOpenChange:r.setOpen,events:r.context.events,floatingId:w,refs:b,elements:E,nodeId:t,rootStore:r}),[u,b,E,t,r,S,w]);return se(()=>{r.context.dataRef.current.floatingContext=O;const C=l?.nodesRef.current.find(I=>I.id===t);C&&(C.context=O)}),d.useMemo(()=>({...u,context:O,refs:b,elements:E,rootStore:r}),[u,b,E,O,r])}function Mr(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:o=!1,onOpenChange:r}=e,s=vt(),i=tt()!=null,a=t.useState("open"),c=t.useState("activeTriggerElement"),l=t.useState(o?"popupElement":"positionerElement"),u=t.context.triggerElements,f=Ue(()=>new Nn({open:a,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:r,floatingId:s,nested:i,noEmit:n})).current;return se(()=>{const p={open:a,floatingId:s,referenceElement:c,floatingElement:l};ie(c)&&(p.domReferenceElement=c),f.state.positionReference===f.state.referenceElement&&(p.positionReference=c),f.update(p)},[a,s,c,l,f]),f.context.onOpenChange=r,f.context.nested=i,f.context.noEmit=n,f}const Sn=Ct("safe-polygon"),zc=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${zo}`;function qc(e){return e?!!e.closest(zc):!1}function Ar(e){const t=d.useRef(void 0),n=d.useRef(!1),o=d.useRef(void 0),r=d.useRef(!0),s=d.useRef(!1),i=d.useRef(()=>{}),a=d.useRef(!1),c=Je(),l=Je(),u=d.useRef(void 0);return d.useMemo(()=>{const f=e.context.dataRef.current;return f.hoverInteractionState||(f.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:o,blockMouseMoveRef:r,performedPointerEventsMutationRef:s,unbindMouseMoveRef:i,restTimeoutPendingRef:a,openChangeTimeout:c,restTimeout:l,handleCloseOptionsRef:u}),f.hoverInteractionState},[e,t,n,o,r,s,i,a,c,l,u])}const Gc=new Set(["click","mousedown"]);function Xc(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:a=!0,closeDelay:c=0,externalTree:l}=t,{pointerTypeRef:u,interactedInsideRef:f,handlerRef:p,performedPointerEventsMutationRef:m,unbindMouseMoveRef:g,restTimeoutPendingRef:h,openChangeTimeout:v,handleCloseOptionsRef:y}=Ar(n),b=yt(l),E=tt(),S=z(()=>f.current?!0:i.current.openEvent?Gc.has(i.current.openEvent.type):!1),w=z(()=>{const k=i.current.openEvent?.type;return k?.includes("mouse")&&k!=="mousedown"}),O=d.useCallback((k,L=!0)=>{const A=Kc(c,u.current);A&&!p.current?v.start(A,()=>n.setOpen(!1,ce(xe,k))):L&&(v.clear(),n.setOpen(!1,ce(xe,k)))},[c,p,n,u,v]),C=z(()=>{g.current(),p.current=void 0}),I=z(()=>{if(m.current){const k=fe(r).body;k.style.pointerEvents="",k.removeAttribute(Sn),m.current=!1}}),N=z(k=>{const L=Ee(k);if(!qc(L)){f.current=!1;return}f.current=!0});se(()=>{o||(u.current=void 0,h.current=!1,f.current=!1,C(),I())},[o,u,h,f,C,I]),d.useEffect(()=>()=>{C()},[C]),d.useEffect(()=>I,[I]),se(()=>{if(a&&o&&y.current?.blockPointerEvents&&w()&&ie(s)&&r){m.current=!0;const k=fe(r).body;k.setAttribute(Sn,"");const L=s,A=r,T=b?.nodesRef.current.find(D=>D.id===E)?.context?.elements.floating;return T&&(T.style.pointerEvents=""),k.style.pointerEvents="none",L.style.pointerEvents="auto",A.style.pointerEvents="auto",()=>{k.style.pointerEvents="",L.style.pointerEvents="",A.style.pointerEvents=""}}},[a,o,s,r,y,w,b,E,m]),d.useEffect(()=>{if(!a)return;function k(D){if(S()||!i.current.floatingContext||!n.select("open"))return;const P=n.context.triggerElements;D.relatedTarget&&P.hasElement(D.relatedTarget)||(I(),C(),S()||O(D))}function L(D){v.clear(),I(),p.current?.(D),C()}function A(D){S()||O(D,!1)}const T=r;return T&&(T.addEventListener("mouseleave",k),T.addEventListener("mouseenter",L),T.addEventListener("mouseleave",A),T.addEventListener("pointerdown",N,!0)),()=>{T&&(T.removeEventListener("mouseleave",k),T.removeEventListener("mouseenter",L),T.removeEventListener("mouseleave",A),T.removeEventListener("pointerdown",N,!0))}})}function Kc(e,t){return t&&!dt(t)?0:typeof e=="function"?e():e}function mn(e){return typeof e=="function"?e():e}const Zc={current:null};function Jc(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:o,events:r}=n.context,{enabled:s=!0,delay:i=0,handleClose:a=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:f=Zc,externalTree:p,isActiveTrigger:m=!0}=t,g=yt(p),{pointerTypeRef:h,interactedInsideRef:v,handlerRef:y,blockMouseMoveRef:b,performedPointerEventsMutationRef:E,unbindMouseMoveRef:S,restTimeoutPendingRef:w,openChangeTimeout:O,restTimeout:C,handleCloseOptionsRef:I}=Ar(n),N=Fe(a),k=Fe(i),L=Fe(l);m&&(I.current=N.current?.__options);const A=z(()=>v.current?!0:o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1),T=d.useCallback((B,x=!0)=>{const F=ln(k.current,"close",h.current);F&&!y.current?O.start(F,()=>n.setOpen(!1,ce(xe,B))):x&&(O.clear(),n.setOpen(!1,ce(xe,B)))},[k,y,n,h,O]),D=z(()=>{S.current(),y.current=void 0}),P=z(()=>{if(E.current){const B=fe(n.select("domReferenceElement")).body;B.style.pointerEvents="",B.removeAttribute(Sn),E.current=!1}});d.useEffect(()=>{if(!s)return;function B(x){x.open||(O.clear(),C.clear(),b.current=!0,w.current=!1)}return r.on("openchange",B),()=>{r.off("openchange",B)}},[s,r,O,C,b,w]);const V=z(B=>{if(A()||!o.current.floatingContext)return;const x=n.context.triggerElements;if(B.relatedTarget&&x.hasElement(B.relatedTarget))return;const F=f.current;N.current?.({...o.current.floatingContext,tree:g,x:B.clientX,y:B.clientY,onClose(){P(),D(),!A()&&F===n.select("domReferenceElement")&&T(B)}})(B)});return d.useEffect(()=>{if(!s)return;const B=f.current??(m?n.select("domReferenceElement"):null);if(!ie(B))return;function x(X){if(O.clear(),b.current=!1,c&&!dt(h.current)||mn(L.current)>0&&!ln(k.current,"open"))return;const K=ln(k.current,"open",h.current),Z=n.select("domReferenceElement"),_=n.context.triggerElements,ne=(_.hasElement(X.target)||_.hasMatchingElement(pe=>re(pe,X.target)))&&(!Z||!re(Z,X.target)),U=X.currentTarget??null,J=n.select("open"),de=!J||ne;ne&&J?n.setOpen(!0,ce(xe,X,U)):K?O.start(K,()=>{de&&n.setOpen(!0,ce(xe,X,U))}):de&&n.setOpen(!0,ce(xe,X,U))}function F(X){if(A()){P();return}S.current();const K=n.select("domReferenceElement"),Z=fe(K);C.clear(),w.current=!1;const _=n.context.triggerElements;if(X.relatedTarget&&_.hasElement(X.relatedTarget))return;if(N.current&&o.current.floatingContext){n.select("open")||O.clear();const U=f.current;y.current=N.current({...o.current.floatingContext,tree:g,x:X.clientX,y:X.clientY,onClose(){P(),D(),!A()&&U===n.select("domReferenceElement")&&T(X,!0)}});const J=y.current;J(X),Z.addEventListener("mousemove",J),S.current=()=>{Z.removeEventListener("mousemove",J)};return}(h.current!=="touch"||!re(n.select("floatingElement"),X.relatedTarget))&&T(X)}function Q(X){V(X)}return n.select("open")&&B.addEventListener("mouseleave",Q),u&&B.addEventListener("mousemove",x,{once:!0}),B.addEventListener("mouseenter",x),B.addEventListener("mouseleave",F),()=>{B.removeEventListener("mouseleave",Q),u&&B.removeEventListener("mousemove",x),B.removeEventListener("mouseenter",x),B.removeEventListener("mouseleave",F)}},[D,P,b,o,k,T,n,s,N,V,m,A,c,u,h,L,C,w,O,f,g,S,y]),d.useMemo(()=>{function B(x){h.current=x.pointerType}return{onPointerDown:B,onPointerEnter:B,onMouseMove(x){const{nativeEvent:F}=x,Q=x.currentTarget,X=n.select("domReferenceElement"),K=n.context.triggerElements,Z=n.select("open"),_=(K.hasElement(x.target)||K.hasMatchingElement(U=>re(U,x.target)))&&(!X||!re(X,x.target));if(c&&!dt(h.current)||Z&&!_||mn(L.current)===0||!_&&w.current&&x.movementX**2+x.movementY**2<2)return;C.clear();function ne(){if(w.current=!1,A())return;const U=n.select("open");!b.current&&(!U||_)&&n.setOpen(!0,ce(xe,F,Q))}h.current==="touch"?_e.flushSync(()=>{ne()}):_&&Z?ne():(w.current=!0,C.start(mn(L.current),ne))}}},[b,A,c,n,h,L,C,w])}function $n(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=e.map(l=>l?.trigger),s=d.useCallback(l=>Wt(l,e,"reference"),t),i=d.useCallback(l=>Wt(l,e,"floating"),n),a=d.useCallback(l=>Wt(l,e,"item"),o),c=d.useCallback(l=>Wt(l,e,"trigger"),r);return d.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:c}),[s,i,a,c])}function Wt(e,t,n){const o=new Map,r=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[bn]="");for(const i in e)r&&e&&(i===Yo||i===Uo)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const c=t[i]?.[n];typeof c=="function"?a=e?c(e):null:a=c,a&&xo(s,a,r,o)}return xo(s,e,r,o),s}function xo(e,t,n,o){for(const r in t){const s=t[r];n&&(r===Yo||r===Uo)||(r.startsWith("on")?(o.has(r)||o.set(r,[]),typeof s=="function"&&(o.get(r)?.push(s),e[r]=(...i)=>o.get(r)?.map(a=>a(...i)).find(a=>a!==void 0))):e[r]=s)}}const Qc=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Fr(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{enabled:a=!0,role:c="dialog"}=t,l=vt(),u=s?.id||l,f=d.useMemo(()=>vn(i)?.id||r,[i,r]),p=Qc.get(c)??c,g=tt()!=null,h=d.useMemo(()=>p==="tooltip"||c==="label"?je:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&g&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[p,g,c]),v=d.useMemo(()=>p==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:o?f:void 0}:{...h,"aria-expanded":o?"true":"false","aria-controls":o?f:void 0,...p==="menu"&&{id:u}},[p,f,o,u,c,h]),y=d.useMemo(()=>{const E={id:f,...p&&{role:p}};return p==="tooltip"||c==="label"?E:{...E,...p==="menu"&&{"aria-labelledby":u}}},[p,f,u,c]),b=d.useCallback(({active:E,selected:S})=>{const w={role:"option",...E&&{id:`${f}-fui-option`}};switch(c){case"select":case"combobox":return{...w,"aria-selected":S}}return{}},[f,c]);return d.useMemo(()=>a?{reference:v,floating:y,item:b,trigger:h}:{},[a,v,y,h,b])}function So(e,t){const[n,o]=e;let r=!1;const s=t.length;for(let i=0,a=s-1;i<s;a=i++){const[c,l]=t[i]||[0,0],[u,f]=t[a]||[0,0];l>=o!=f>=o&&n<=(u-c)*(o-l)/(f-l)+c&&(r=!r)}return r}function ea(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function ta(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r=new Ye;let s=!1,i=null,a=null,c=typeof performance<"u"?performance.now():0;function l(f,p){const m=performance.now(),g=m-c;if(i===null||a===null||g===0)return i=f,a=p,c=m,null;const h=f-i,v=p-a,b=Math.sqrt(h*h+v*v)/g;return i=f,a=p,c=m,b}const u=({x:f,y:p,placement:m,elements:g,onClose:h,nodeId:v,tree:y})=>function(E){function S(){r.clear(),h()}if(r.clear(),!g.domReference||!g.floating||m==null||f==null||p==null)return;const{clientX:w,clientY:O}=E,C=[w,O],I=Ee(E),N=E.type==="mouseleave",k=re(g.floating,I),L=re(g.domReference,I),A=g.domReference.getBoundingClientRect(),T=g.floating.getBoundingClientRect(),D=m.split("-")[0],P=f>T.right-T.width/2,V=p>T.bottom-T.height/2,B=ea(C,A),x=T.width>A.width,F=T.height>A.height,Q=(x?A:T).left,X=(x?A:T).right,K=(F?A:T).top,Z=(F?A:T).bottom;if(k&&(s=!0,!N))return;if(L&&(s=!1),L&&!N){s=!0;return}if(N&&ie(E.relatedTarget)&&re(g.floating,E.relatedTarget)||y&&Ze(y.nodesRef.current,v).some(({context:U})=>U?.open))return;if(D==="top"&&p>=A.bottom-1||D==="bottom"&&p<=A.top+1||D==="left"&&f>=A.right-1||D==="right"&&f<=A.left+1)return S();let _=[];switch(D){case"top":_=[[Q,A.top+1],[Q,T.bottom-1],[X,T.bottom-1],[X,A.top+1]];break;case"bottom":_=[[Q,T.top+1],[Q,A.bottom-1],[X,A.bottom-1],[X,T.top+1]];break;case"left":_=[[T.right-1,Z],[T.right-1,K],[A.left+1,K],[A.left+1,Z]];break;case"right":_=[[A.right-1,Z],[A.right-1,K],[T.left+1,K],[T.left+1,Z]];break}function ne([U,J]){switch(D){case"top":{const de=[x?U+t/2:P?U+t*4:U-t*4,J+t+1],pe=[x?U-t/2:P?U+t*4:U-t*4,J+t+1],ge=[[T.left,P||x?T.bottom-t:T.top],[T.right,P?x?T.bottom-t:T.top:T.bottom-t]];return[de,pe,...ge]}case"bottom":{const de=[x?U+t/2:P?U+t*4:U-t*4,J-t],pe=[x?U-t/2:P?U+t*4:U-t*4,J-t],ge=[[T.left,P||x?T.top+t:T.bottom],[T.right,P?x?T.top+t:T.bottom:T.top+t]];return[de,pe,...ge]}case"left":{const de=[U+t+1,F?J+t/2:V?J+t*4:J-t*4],pe=[U+t+1,F?J-t/2:V?J+t*4:J-t*4];return[...[[V||F?T.right-t:T.left,T.top],[V?F?T.right-t:T.left:T.right-t,T.bottom]],de,pe]}case"right":{const de=[U-t,F?J+t/2:V?J+t*4:J-t*4],pe=[U-t,F?J-t/2:V?J+t*4:J-t*4],ge=[[V||F?T.left+t:T.right,T.top],[V?F?T.left+t:T.right:T.left+t,T.bottom]];return[de,pe,...ge]}default:return[]}}if(!So([w,O],_)){if(s&&!B)return S();if(!N&&o){const U=l(E.clientX,E.clientY);if(U!==null&&U<.1)return S()}So([w,O],ne([f,p]))?!s&&o&&r.start(40,S):S()}};return u.__options={blockPointerEvents:n},u}function Lr(e){return vt(e,"base-ui")}function na(e){const t=d.useRef(""),n=d.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:d.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r&&e(r,r.pointerType),e(r,t.current),t.current=""},[e]),onPointerDown:n}}function Dr(e){const[t,n]=d.useState(null),o=z((a,c)=>{e||n(c||(_o?"touch":""))}),r=d.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=na(o);return d.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}let Oe=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Tt.startingStyle]="startingStyle",e[e.endingStyle=Tt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),wn=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const oa={[wn.popupOpen]:""},ra={[wn.popupOpen]:"",[wn.pressed]:""},sa={[Oe.open]:""},ia={[Oe.closed]:""},ca={[Oe.anchorHidden]:""},aa={open(e){return e?oa:null}},la={open(e){return e?ra:null}},kt={open(e){return e?sa:ia},anchorHidden(e){return e?ca:null}};function Nr(e){return Ao(19)?e:e?"true":void 0}let wo={},Co={},To="";function ua(e){if(typeof document>"u")return!1;const t=nt(e);return Ce(t).innerWidth-t.documentElement.clientWidth>0}function fa(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const o=nt(e).documentElement,r={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY};o.style.scrollbarGutter="stable",o.style.overflowY="scroll";const s=o.offsetWidth;o.style.overflowY="hidden";const i=o.offsetWidth;return Object.assign(o.style,r),s===i}function da(e){const t=nt(e),n=t.documentElement,o=t.body,r=Pt(n)?n:o,s=r.style.overflow;return r.style.overflow="hidden",()=>{r.style.overflow=s}}function pa(e){const t=nt(e),n=t.documentElement,o=t.body,r=Ce(n);let s=0,i=0,a=!1;const c=Ae.create();if(qs&&(r.visualViewport?.scale??1)!==1)return()=>{};function l(){const p=r.getComputedStyle(n),m=r.getComputedStyle(o),v=(p.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,wo={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},To=n.style.scrollBehavior,Co={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const y=n.scrollHeight>n.clientHeight,b=n.scrollWidth>n.clientWidth,E=p.overflowY==="scroll"||m.overflowY==="scroll",S=p.overflowX==="scroll"||m.overflowX==="scroll",w=Math.max(0,r.innerWidth-o.clientWidth),O=Math.max(0,r.innerHeight-o.clientHeight),C=parseFloat(m.marginTop)+parseFloat(m.marginBottom),I=parseFloat(m.marginLeft)+parseFloat(m.marginRight),N=Pt(n)?n:o;if(a=fa(e),a){n.style.scrollbarGutter=v,N.style.overflowY="hidden",N.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(y||E)&&(n.style.overflowY="scroll"),(b||S)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:C||O?`calc(100dvh - ${C+O}px)`:"100dvh",width:I||w?`calc(100vw - ${I+w}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,wo),Object.assign(o.style,Co),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=To)}function f(){u(),c.request(l)}return l(),r.addEventListener("resize",f),()=>{c.cancel(),u(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",f)}}class ga{lockCount=0;restore=null;timeoutLock=Ye.create();timeoutUnlock=Ye.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const o=nt(t).documentElement,r=Ce(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=Fo;return}const s=_o||!ua(t);this.restore=s?da(t):pa(t)}}const ma=new ga;function Br(e=!0,t=null){se(()=>{if(e)return ma.acquire(t)},[e,t])}const ha=d.createContext(void 0);function ba(){return d.useContext(ha)?.direction??"ltr"}const va=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:f="real"}=$e(e,t)||{};if(l==null)return{};const p=Xo(u),m={x:n,y:o},g=An(r),h=Mn(g),v=await i.getDimensions(l),y=g==="y",b=y?"top":"left",E=y?"bottom":"right",S=y?"clientHeight":"clientWidth",w=s.reference[h]+s.reference[g]-m[g]-s.floating[h],O=m[g]-s.reference[g],C=f==="real"?await i.getOffsetParent?.(l):a.floating;let I=a.floating[S]||s.floating[h];(!I||!await i.isElement?.(C))&&(I=a.floating[S]||s.floating[h]);const N=w/2-O/2,k=I/2-v[h]/2-1,L=Math.min(p[b],k),A=Math.min(p[E],k),T=L,D=I-v[h]-A,P=I/2-v[h]/2+N,V=yn(T,P,D),B=!c.arrow&&qe(r)!=null&&P!==V&&s.reference[h]/2-(P<T?L:A)-v[h]/2<0,x=B?P<T?P-T:P-D:0;return{[g]:m[g]+x,data:{[g]:V,centerOffset:P-V-x,...B&&{alignmentOffset:x}},reset:B}}}),ya=(e,t)=>({...va(e),options:[e,t]}),Ea={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await Lc().fn(e)).data?.referenceHidden||s}}}},jt={sideX:"left",sideY:"top"},Ra={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:o},elements:{floating:r},platform:s,strategy:i,placement:a}=e,c=Ce(r),l=c.getComputedStyle(r);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:jt};const f=await s.getOffsetParent?.(r);let p={width:0,height:0};if(i==="fixed"&&c?.visualViewport)p={width:c.visualViewport.width,height:c.visualViewport.height};else if(f===c){const b=nt(r);p={width:b.documentElement.clientWidth,height:b.documentElement.clientHeight}}else await s.isElement?.(f)&&(p=await s.getDimensions(f));const m=ye(a);let g=t,h=n;m==="left"&&(g=p.width-(t+o.width)),m==="top"&&(h=p.height-(n+o.height));const v=m==="left"?"right":jt.sideX,y=m==="top"?"bottom":jt.sideY;return{x:g,y:h,data:{sideX:v,sideY:y}}}};function $r(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function Oo(e,t,n){const{rects:o,placement:r}=e;return{side:$r(t,ye(r),n),align:qe(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function xa(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:f=!1,keepMounted:p=!1,floatingRootContext:m,mounted:g,collisionAvoidance:h,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:b,lazyFlip:E=!1,externalTree:S}=e,[w,O]=d.useState(null);!g&&w!==null&&O(null);const C=h.side||"flip",I=h.align||"flip",N=h.fallbackAxisSide||"end",k=typeof t=="function"?t:void 0,L=z(k),A=k?L:t,T=Fe(t),P=ba()==="rtl",V=w||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":P?"left":"right","inline-start":P?"right":"left"}[o],B=s==="center"?V:`${V}-${s}`;let x=c;const F=1,Q=o==="bottom"?F:0,X=o==="top"?F:0,K=o==="right"?F:0,Z=o==="left"?F:0;typeof x=="number"?x={top:x+Q,right:x+Z,bottom:x+X,left:x+K}:x&&(x={top:(x.top||0)+Q,right:(x.right||0)+Z,bottom:(x.bottom||0)+X,left:(x.left||0)+K});const _={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:x},ne=d.useRef(null),U=Fe(r),J=Fe(i),ge=[Ic(le=>{const ve=Oo(le,o,P),Me=typeof U.current=="function"?U.current(ve):U.current,Se=typeof J.current=="function"?J.current(ve):J.current;return{mainAxis:Me,crossAxis:Se,alignmentAxis:Se}},[typeof r!="function"?r:0,typeof i!="function"?i:0,P,o])],De=I==="none"&&C!=="shift",R=!De&&(l||v||C==="shift"),Y=C==="none"?null:Ac({..._,padding:{top:x.top+F,right:x.right+F,bottom:x.bottom+F,left:x.left+F},mainAxis:!v&&C==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:N}),$=De?null:kc(le=>{const ve=nt(le.elements.floating).documentElement;return{..._,rootBoundary:v?{x:0,y:0,width:ve.clientWidth,height:ve.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:R,limiter:l||v?void 0:Mc(Me=>{if(!ne.current)return{};const{width:Se,height:rt}=ne.current.getBoundingClientRect(),st=we(ye(Me.placement)),At=st==="y"?Se:rt,tn=st==="y"?x.left+x.right:x.top+x.bottom;return{offset:At/2+tn/2}})}},[_,l,v,x,I]);C==="shift"||I==="shift"||s==="center"?ge.push($,Y):ge.push(Y,$),ge.push(Fc({..._,apply({elements:{floating:le},rects:{reference:ve},availableWidth:Me,availableHeight:Se}){Object.entries({"--available-width":`${Me}px`,"--available-height":`${Se}px`,"--anchor-width":`${ve.width}px`,"--anchor-height":`${ve.height}px`}).forEach(([rt,st])=>{le.style.setProperty(rt,st)})}}),ya(()=>({element:ne.current||document.createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(le){const{elements:ve,middlewareData:Me,placement:Se,rects:rt,y:st}=le,At=ye(Se),tn=we(At),Un=ne.current,es=Me.arrow?.x||0,ts=Me.arrow?.y||0,ns=Un?.clientWidth||0,os=Un?.clientHeight||0,nn=es+ns/2,zn=ts+os/2,rs=Math.abs(Me.shift?.y||0),ss=rt.reference.height/2,Rt=typeof r=="function"?r(Oo(le,o,P)):r,is=rs>Rt,cs={top:`${nn}px calc(100% + ${Rt}px)`,bottom:`${nn}px ${-Rt}px`,left:`calc(100% + ${Rt}px) ${zn}px`,right:`${-Rt}px ${zn}px`}[At],as=`${nn}px ${rt.reference.y+ss-st}px`;return ve.floating.style.setProperty("--transform-origin",R&&tn==="y"&&is?as:cs),{}}},Ea,b),se(()=>{!g&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,m]);const ue=d.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:M,elements:W,x:q,y:te,middlewareData:oe,update:H,placement:j,context:me,isPositioned:ae,floatingStyles:Ne}=Uc({rootContext:m,placement:B,middleware:ge,strategy:n,whileElementsMounted:p?void 0:(...le)=>Eo(...le,ue),nodeId:y,externalTree:S}),{sideX:Ge,sideY:ot}=oe.adaptiveOrigin||jt,Xe=ae?n:"fixed",he=d.useMemo(()=>b?{position:Xe,[Ge]:q,[ot]:te}:{position:Xe,...Ne},[b,Xe,Ge,q,ot,te,Ne]),Ie=d.useRef(null);se(()=>{if(!g)return;const le=T.current,ve=typeof le=="function"?le():le,Se=(Po(ve)?ve.current:ve)||null||null;Se!==Ie.current&&(M.setPositionReference(Se),Ie.current=Se)},[g,M,A,T]),d.useEffect(()=>{if(!g)return;const le=T.current;typeof le!="function"&&Po(le)&&le.current!==Ie.current&&(M.setPositionReference(le.current),Ie.current=le.current)},[g,M,A,T]),d.useEffect(()=>{if(p&&g&&W.domReference&&W.floating)return Eo(W.domReference,W.floating,H,ue)},[p,g,W,H,ue]);const ke=ye(j),Vn=$r(o,ke,P),jn=qe(j)||"center",Hn=!!oe.hide?.referenceHidden;se(()=>{E&&g&&ae&&O(ke)},[E,g,ae,ke]);const _n=d.useMemo(()=>({position:"absolute",top:oe.arrow?.y,left:oe.arrow?.x}),[oe.arrow]),Yn=oe.arrow?.centerOffset!==0;return d.useMemo(()=>({positionerStyles:he,arrowStyles:_n,arrowRef:ne,arrowUncentered:Yn,side:Vn,align:jn,physicalSide:ke,anchorHidden:Hn,refs:M,context:me,isPositioned:ae,update:H}),[he,_n,ne,Yn,Vn,jn,ke,Hn,M,me,ae,H])}function Po(e){return e!=null&&"current"in e}const Wr=d.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o?.getBoundingClientRect();s=`polygon(
|
|
2
|
-
0% 0%,
|
|
3
|
-
100% 0%,
|
|
4
|
-
100% 100%,
|
|
5
|
-
0% 100%,
|
|
6
|
-
0% 0%,
|
|
7
|
-
${i.left}px ${i.top}px,
|
|
8
|
-
${i.left}px ${i.bottom}px,
|
|
9
|
-
${i.right}px ${i.bottom}px,
|
|
10
|
-
${i.right}px ${i.top}px,
|
|
11
|
-
${i.left}px ${i.top}px
|
|
12
|
-
)`}return ee.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),Sa=d.createContext(void 0);function wa(e){return d.useContext(Sa)}const Vr="ArrowUp",jr="ArrowDown",Hr="ArrowLeft",_r="ArrowRight",Yr="Home",Ur="End",Ca=new Set([Hr,_r]),Ta=new Set([Vr,jr]),Oa=new Set([...Ca,...Ta]);[...Oa];const zr=new Set([Vr,jr,Hr,_r,Yr,Ur]);function qr(e){return e==="starting"?hs:je}function tl({children:e,variant:t="primary",size:n="md",onClick:o,disabled:r=!1,className:s="",as:i="button",...a}){const c="inline-flex items-center justify-center font-medium transition-all duration-200 rounded-md focus:outline-none focus:ring-2 focus:ring-oai-blue/30 active:scale-[0.98] active:duration-100",l={primary:"bg-oai-black dark:bg-oai-white text-white dark:text-oai-black border border-transparent hover:bg-oai-gray-800 dark:hover:bg-oai-gray-200 active:bg-oai-gray-900 dark:active:bg-oai-gray-300 disabled:bg-oai-gray-300 dark:disabled:bg-oai-gray-700 disabled:text-oai-gray-500 dark:disabled:text-oai-gray-400 focus:ring-oai-brand/30 transition-colors duration-200",secondary:"bg-oai-white dark:bg-oai-gray-900 text-oai-black dark:text-oai-white border border-oai-gray-300 dark:border-oai-gray-700 hover:border-oai-brand hover:text-oai-brand active:bg-oai-gray-50 dark:active:bg-oai-gray-800 active:border-oai-brand-dark disabled:text-oai-gray-400 dark:disabled:text-oai-gray-500 disabled:border-oai-gray-200 dark:disabled:border-oai-gray-700 focus:ring-oai-brand/30 transition-colors duration-200",ghost:"bg-transparent text-oai-gray-600 dark:text-oai-gray-300 border border-transparent hover:text-oai-brand hover:bg-oai-brand-50/50 dark:hover:bg-oai-brand-950/30 active:bg-oai-brand-50 dark:active:bg-oai-brand-900/50 disabled:text-oai-gray-400 dark:disabled:text-oai-gray-500 focus:ring-oai-brand/30 transition-colors duration-200"},u={sm:"h-8 px-3 text-sm",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"},f=r?"cursor-not-allowed opacity-60":"cursor-pointer",p=`${c} ${l[t]} ${u[n]} ${f} ${s}`;return ee.jsx(i,{className:p,onClick:o,disabled:r,...a,children:e})}const Gr=d.createContext(void 0);function Et(e){const t=d.useContext(Gr);if(e===!1&&t===void 0)throw new Error(et(27));return t}const Pa={...kt,...Qt},nl=d.forwardRef(function(t,n){const{render:o,className:r,forceRender:s=!1,...i}=t,{store:a}=Et(),c=a.useState("open"),l=a.useState("nested"),u=a.useState("mounted"),f=a.useState("transitionStatus"),p=d.useMemo(()=>({open:c,transitionStatus:f}),[c,f]);return ze("div",t,{state:p,ref:[a.context.backdropRef,n],stateAttributesMapping:Pa,props:[{role:"presentation",hidden:!u,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!l})});let Ia=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),ka=(function(e){return e[e.open=Oe.open]="open",e[e.closed=Oe.closed]="closed",e[e.startingStyle=Oe.startingStyle]="startingStyle",e[e.endingStyle=Oe.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const Xr=d.createContext(void 0);function Kr(){const e=d.useContext(Xr);if(e===void 0)throw new Error(et(26));return e}const Ma={...kt,...Qt,nestedDialogOpen(e){return e?{[ka.nestedDialogOpen]:""}:null}},ol=d.forwardRef(function(t,n){const{className:o,finalFocus:r,initialFocus:s,render:i,...a}=t,{store:c}=Et(),l=c.useState("descriptionElementId"),u=c.useState("disablePointerDismissal"),f=c.useState("floatingRootContext"),p=c.useState("popupProps"),m=c.useState("modal"),g=c.useState("mounted"),h=c.useState("nested"),v=c.useState("nestedOpenDialogCount"),y=c.useState("open"),b=c.useState("openMethod"),E=c.useState("titleElementId"),S=c.useState("transitionStatus"),w=c.useState("role");Kr(),Bn({open:y,ref:c.context.popupRef,onComplete(){y&&c.context.onOpenChangeComplete?.(!0)}});function O(L){return L==="touch"?c.context.popupRef.current:!0}const C=s===void 0?O:s,I=v>0,N=d.useMemo(()=>({open:y,nested:h,transitionStatus:S,nestedDialogOpen:I}),[y,h,S,I]),k=ze("div",t,{state:N,props:[p,{"aria-labelledby":E??void 0,"aria-describedby":l??void 0,role:w,tabIndex:-1,hidden:!g,onKeyDown(L){zr.has(L.key)&&L.stopPropagation()},style:{[Ia.nestedDialogs]:v}},a],ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],stateAttributesMapping:Ma});return ee.jsx(hr,{context:f,openInteractionType:b,disabled:!g,closeOnFocusOut:!u,initialFocus:C,returnFocus:r,modal:m!==!1,restoreFocus:"popup",children:k})}),rl=d.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=Et(),i=s.useState("mounted"),a=s.useState("modal"),c=s.useState("open");return i||o?ee.jsx(Xr.Provider,{value:o,children:ee.jsxs(mr,{ref:n,...r,children:[i&&a===!0&&ee.jsx(Wr,{ref:s.context.internalBackdropRef,inert:Nr(!c)}),t.children]})}):null});function Aa(e){const{store:t,parentContext:n,actionsRef:o}=e,r=t.useState("open"),s=t.useState("disablePointerDismissal"),i=t.useState("modal"),a=t.useState("popupElement"),{openMethod:c,triggerProps:l,reset:u}=Dr(r);Or(t);const{forceUnmount:f}=Pr(r,t,()=>{u()}),p=z(k=>{const L=ce(k);return L.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},L}),m=d.useCallback(()=>{t.setOpen(!1,p(fr))},[t,p]);d.useImperativeHandle(o,()=>({unmount:f,close:m}),[f,m]);const g=Mr({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,v]=d.useState(0),y=h===0,b=Fr(g),E=Cr(g,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(k){if("button"in k&&k.button!==0||"touches"in k&&k.touches.length!==1)return!1;const L=Ee(k);if(y&&!s){const A=L;return i&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===A||t.context.backdropRef.current===A||re(A,a)&&!A?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:y});Br(r&&i===!0,a);const{getReferenceProps:S,getFloatingProps:w,getTriggerProps:O}=$n([b,E]);t.useContextCallback("onNestedDialogOpen",k=>{v(k+1)}),t.useContextCallback("onNestedDialogClose",()=>{v(0)}),d.useEffect(()=>(n?.onNestedDialogOpen&&r&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!r&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&r&&n.onNestedDialogClose()}),[r,n,h]);const C=d.useMemo(()=>S(l),[S,l]),I=d.useMemo(()=>O(l),[O,l]),N=d.useMemo(()=>w(),[w]);t.useSyncedValues({openMethod:c,activeTriggerProps:C,inactiveTriggerProps:I,popupProps:N,floatingRootContext:g,nestedOpenDialogCount:h})}const Fa={...kr,modal:G(e=>e.modal),nested:G(e=>e.nested),nestedOpenDialogCount:G(e=>e.nestedOpenDialogCount),disablePointerDismissal:G(e=>e.disablePointerDismissal),openMethod:G(e=>e.openMethod),descriptionElementId:G(e=>e.descriptionElementId),titleElementId:G(e=>e.titleElementId),viewportElement:G(e=>e.viewportElement),role:G(e=>e.role)};class La extends On{constructor(t){super(Da(t),{popupRef:d.createRef(),backdropRef:d.createRef(),internalBackdropRef:d.createRef(),triggerElements:new en,onOpenChange:void 0,onOpenChangeComplete:void 0},Fa)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const o={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",o);const r={open:t},s=n.trigger?.id??null;(s||t)&&(r.activeTriggerId=s,r.activeTriggerElement=n.trigger??null),this.update(r)}}function Da(e={}){return{...Ir(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function sl(e){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:r,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:a=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:f=null}=e,p=Et(!0),m=!!p,g=Ue(()=>l?.store??new La({open:n??o,activeTriggerId:u!==void 0?u:f,modal:a,disablePointerDismissal:i,nested:m})).current;g.useControlledProp("open",n,o),g.useControlledProp("activeTriggerId",u,f),g.useSyncedValues({disablePointerDismissal:i,nested:m,modal:a}),g.useContextCallback("onOpenChange",r),g.useContextCallback("onOpenChangeComplete",s);const h=g.useState("payload");Aa({store:g,actionsRef:c,parentContext:p?.store.context});const v=d.useMemo(()=>({store:g}),[g]);return ee.jsx(Gr.Provider,{value:v,children:typeof t=="function"?t({payload:h}):t})}let Io=(function(e){return e[e.open=Oe.open]="open",e[e.closed=Oe.closed]="closed",e[e.startingStyle=Oe.startingStyle]="startingStyle",e[e.endingStyle=Oe.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const Na={...kt,...Qt,nested(e){return e?{[Io.nested]:""}:null},nestedDialogOpen(e){return e?{[Io.nestedDialogOpen]:""}:null}},il=d.forwardRef(function(t,n){const{className:o,render:r,children:s,...i}=t,a=Kr(),{store:c}=Et(),l=c.useState("open"),u=c.useState("nested"),f=c.useState("transitionStatus"),p=c.useState("nestedOpenDialogCount"),m=c.useState("mounted"),g=p>0,h=d.useMemo(()=>({open:l,nested:u,transitionStatus:f,nestedDialogOpen:g}),[l,u,f,g]);return ze("div",t,{enabled:a||m,state:h,ref:[n,c.useStateSetter("viewportElement")],stateAttributesMapping:Na,props:[{role:"presentation",hidden:!m,children:s},i]})}),cl=d.forwardRef(function(t,n){const{render:o,className:r,id:s,...i}=t,{store:a}=Et(),c=Lr(s);return a.useSyncedValueWithCleanup("titleElementId",c),ze("h2",t,{ref:n,props:[{id:c},i]})}),Zr=d.createContext(void 0);function Mt(e){const t=d.useContext(Zr);if(t===void 0&&!e)throw new Error(et(47));return t}function Ba(){return{...Ir(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const $a={...kr,disabled:G(e=>e.disabled),instantType:G(e=>e.instantType),openMethod:G(e=>e.openMethod),openChangeReason:G(e=>e.openChangeReason),modal:G(e=>e.modal),stickIfOpen:G(e=>e.stickIfOpen),titleElementId:G(e=>e.titleElementId),descriptionElementId:G(e=>e.descriptionElementId),openOnHover:G(e=>e.openOnHover),closeDelay:G(e=>e.closeDelay),hasViewport:G(e=>e.hasViewport)};class Wn extends On{constructor(t){const n={...Ba(),...t};n.open&&t?.mounted===void 0&&(n.mounted=!0),super(n,{popupRef:d.createRef(),backdropRef:d.createRef(),internalBackdropRef:d.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:d.createRef(),beforeContentFocusGuardRef:d.createRef(),stickIfOpenTimeout:new Ye,triggerElements:new en},$a)}setOpen=(t,n)=>{const o=n.reason===xe,r=n.reason===He&&n.event.detail===0,s=!t&&(n.reason===ur||n.reason==null);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const i={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested,triggerElement:n.trigger};this.state.floatingRootContext.context.events?.emit("openchange",i);const c=()=>{const l={open:t,openChangeReason:n.reason},u=n.trigger?.id??null;(u||t)&&(l.activeTriggerId=u,l.activeTriggerElement=n.trigger??null),this.update(l)};o?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(ms,()=>{this.set("stickIfOpen",!1)}),_e.flushSync(c)):c(),r||s?this.set("instantType",r?"click":"dismiss"):n.reason===wt?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(t,n){const o=Ue(()=>new Wn(n)).current,r=t??o;return Pn(o.disposeEffect),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function ko({props:e}){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:r,onOpenChangeComplete:s,modal:i=!1,handle:a,triggerId:c,defaultTriggerId:l=null}=e,u=Wn.useStore(a?.store,{open:n??o,modal:i,activeTriggerId:c!==void 0?c:l});u.useControlledProp("open",n,o),u.useControlledProp("activeTriggerId",c,l);const f=u.useState("open"),p=u.useState("positionerElement"),m=u.useState("payload"),g=u.useState("openChangeReason");u.useContextCallback("onOpenChange",r),u.useContextCallback("onOpenChangeComplete",s);const{openMethod:h,triggerProps:v,reset:y}=Dr(f);Or(u);const{forceUnmount:b}=Pr(f,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null}),y()});Br(f&&i===!0&&g!==xe&&h!=="touch",p),d.useEffect(()=>{f||u.context.stickIfOpenTimeout.clear()},[u,f]);const E=d.useCallback(P=>{const V=ce(P);return V.preventUnmountOnClose=()=>{u.set("preventUnmountingOnClose",!0)},V},[u]),S=d.useCallback(()=>{u.setOpen(!1,E(fr))},[u,E]);d.useImperativeHandle(e.actionsRef,()=>({unmount:b,close:S}),[b,S]);const w=Mr({popupStore:u,onOpenChange:u.setOpen}),O=Cr(w,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),C=Fr(w),{getReferenceProps:I,getFloatingProps:N,getTriggerProps:k}=$n([O,C]),L=d.useMemo(()=>I(v),[I,v]),A=d.useMemo(()=>k(v),[k,v]),T=d.useMemo(()=>N(),[N]);u.useSyncedValues({modal:i,openMethod:h,activeTriggerProps:L,inactiveTriggerProps:A,popupProps:T,floatingRootContext:w,nested:tt()!=null});const D=d.useMemo(()=>({store:u}),[u]);return ee.jsx(Zr.Provider,{value:D,children:typeof t=="function"?t({payload:m}):t})}function al(e){return Mt(!0)?ee.jsx(ko,{props:e}):ee.jsx(Ni,{children:ee.jsx(ko,{props:e})})}const Wa=300,ll=d.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,handle:a,payload:c,openOnHover:l=!1,delay:u=Wa,closeDelay:f=0,id:p,...m}=t,g=Mt(!0),h=a?.store??g?.store;if(!h)throw new Error(et(74));const v=Lr(p),y=h.useState("isTriggerActive",v),b=h.useState("floatingRootContext"),E=h.useState("isOpenedByTrigger",v),S=d.useRef(null),{registerTrigger:w,isMountedByThisTrigger:O}=Hc(v,S,h,{payload:c,disabled:s,openOnHover:l,closeDelay:f}),C=h.useState("openChangeReason"),I=h.useState("stickIfOpen"),N=h.useState("openMethod"),k=Jc(b,{enabled:b!=null&&l&&(N!=="touch"||C!==He),mouseOnly:!0,move:!1,handleClose:ta(),restMs:u,delay:{close:f},triggerElementRef:S,isActiveTrigger:y}),L=qi(b,{enabled:b!=null,stickIfOpen:I}),A=$n([L]),T=h.useState("triggerProps",O),D=d.useMemo(()=>({disabled:s,open:E}),[s,E]),{getButtonProps:P,buttonRef:V}=gs({disabled:s,native:i}),B=d.useMemo(()=>({open(K){return K&&C===He?la.open(K):aa.open(K)}}),[C]),x=ze("button",t,{state:D,ref:[V,n,w,S],props:[A.getReferenceProps(),k,T,{[Do]:"",id:v},m,P],stateAttributesMapping:B}),F=d.useRef(null),Q=z(K=>{_e.flushSync(()=>{h.setOpen(!1,ce(wt,K.nativeEvent,K.currentTarget))}),Ii(F.current)?.focus()}),X=z(K=>{const Z=h.select("positionerElement");if(Z&&at(K,Z))h.context.beforeContentFocusGuardRef.current?.focus();else{_e.flushSync(()=>{h.setOpen(!1,ce(wt,K.nativeEvent,K.currentTarget))});let _=Pi(h.context.triggerFocusTargetRef.current||S.current);for(;_!==null&&re(Z,_);){const ne=_;if(_=Fn(_),_===ne)break}_?.focus()}});return y?ee.jsxs(d.Fragment,{children:[ee.jsx(mt,{ref:F,onFocus:Q}),ee.jsx(d.Fragment,{children:x},v),ee.jsx(mt,{ref:h.context.triggerFocusTargetRef,onFocus:X})]}):ee.jsx(d.Fragment,{children:x},v)}),Jr=d.createContext(void 0);function Va(){const e=d.useContext(Jr);if(e===void 0)throw new Error(et(45));return e}const ul=d.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=Mt();return s.useState("mounted")||o?ee.jsx(Jr.Provider,{value:o,children:ee.jsx(mr,{ref:n,...r,renderGuards:!1})}):null}),Qr=d.createContext(void 0);function ja(){const e=d.useContext(Qr);if(!e)throw new Error(et(46));return e}const fl=d.forwardRef(function(t,n){const{render:o,className:r,anchor:s,positionMethod:i="absolute",side:a="bottom",align:c="center",sideOffset:l=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:p=5,arrowPadding:m=5,sticky:g=!1,disableAnchorTracking:h=!1,collisionAvoidance:v=bs,...y}=t,{store:b}=Mt(),E=Va(),S=Li(),w=b.useState("floatingRootContext"),O=b.useState("mounted"),C=b.useState("open"),I=b.useState("openChangeReason"),N=b.useState("activeTriggerElement"),k=b.useState("modal"),L=b.useState("positionerElement"),A=b.useState("instantType"),T=b.useState("transitionStatus"),D=b.useState("hasViewport"),P=d.useRef(null),V=Tr(L,!1,!1),B=xa({anchor:s,floatingRootContext:w,positionMethod:i,mounted:O,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:m,collisionBoundary:f,collisionPadding:p,sticky:g,disableAnchorTracking:h,keepMounted:E,nodeId:S,collisionAvoidance:v,adaptiveOrigin:D?Ra:void 0}),x=d.useMemo(()=>{const _={};return C||(_.pointerEvents="none"),{role:"presentation",hidden:!O,style:{...B.positionerStyles,..._}}},[C,O,B.positionerStyles]),F=d.useMemo(()=>({props:x,...B}),[x,B]),Q=w?.select("domReferenceElement");se(()=>{const _=Q,ne=P.current;if(_&&(P.current=_),ne&&_&&_!==ne){b.set("instantType",void 0);const U=new AbortController;return V(()=>{b.set("instantType","trigger-change")},U.signal),()=>{U.abort()}}},[Q,V,b]);const X=d.useMemo(()=>({open:C,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:A}),[C,F.side,F.align,F.anchorHidden,A]),K=d.useCallback(_=>{b.set("positionerElement",_)},[b]),Z=ze("div",t,{state:X,props:[F.props,qr(T),y],ref:[n,K],stateAttributesMapping:kt});return ee.jsxs(Qr.Provider,{value:F,children:[O&&k===!0&&I!==xe&&ee.jsx(Wr,{ref:b.context.internalBackdropRef,inert:Nr(!C),cutout:N}),ee.jsx(Di,{id:S,children:Z})]})}),Ha={...kt,...Qt},dl=d.forwardRef(function(t,n){const{className:o,render:r,initialFocus:s,finalFocus:i,...a}=t,{store:c}=Mt(),l=ja(),u=wa()!=null,f=c.useState("open"),p=c.useState("openMethod"),m=c.useState("instantType"),g=c.useState("transitionStatus"),h=c.useState("popupProps"),v=c.useState("titleElementId"),y=c.useState("descriptionElementId"),b=c.useState("modal"),E=c.useState("mounted"),S=c.useState("openChangeReason"),w=c.useState("activeTriggerElement"),O=c.useState("floatingRootContext");Bn({open:f,ref:c.context.popupRef,onComplete(){f&&c.context.onOpenChangeComplete?.(!0)}});const C=c.useState("disabled"),I=c.useState("openOnHover"),N=c.useState("closeDelay");Xc(O,{enabled:I&&!C,closeDelay:N});function k(P){return P==="touch"?c.context.popupRef.current:!0}const L=s===void 0?k:s,A=d.useMemo(()=>({open:f,side:l.side,align:l.align,instant:m,transitionStatus:g}),[f,l.side,l.align,m,g]),T=d.useCallback(P=>{c.set("popupElement",P)},[c]),D=ze("div",t,{state:A,ref:[n,c.context.popupRef,T],props:[h,{"aria-labelledby":v,"aria-describedby":y,onKeyDown(P){u&&zr.has(P.key)&&P.stopPropagation()}},qr(g),a],stateAttributesMapping:Ha});return ee.jsx(hr,{context:O,openInteractionType:p,modal:b==="trap-focus",disabled:!E||S===xe,initialFocus:L,returnFocus:i,restoreFocus:"popup",previousFocusableElement:be(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:D})});export{Qa as $,Ga as A,tl as B,Ja as C,sl as D,Ee as E,wt as F,ni as G,oi as H,Je as I,Lr as J,G as K,$c as L,Dr as M,Hs as N,lr as O,al as P,Bn as Q,Yc as R,St as S,qi as T,Cr as U,$n as V,Ua as W,Bo as X,Bi as Y,la as Z,nt as _,Za as a,aa as a0,mr as a1,Ya as a2,Br as a3,xa as a4,Wr as a5,Nr as a6,kt as a7,wa as a8,In as a9,qs as aa,hr as ab,el as ac,Qt as ad,qr as ae,zr as af,Ka as ag,rl as b,ce as c,nl as d,il as e,ol as f,cl as g,ll as h,ul as i,fl as j,dl as k,Xa as l,za as m,qa as n,Nt as o,vn as p,Fe as q,tt as r,ei as s,yt as t,Et as u,to as v,un as w,it as x,fe as y,re as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as o}from"./main-Dirgz7qK.js";function i({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:c,children:o.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})})}function d({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:c,children:o.jsx("path",{d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"})})}function a({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:c,children:o.jsx("path",{d:"M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"})})}function v({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:c,children:o.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})})}function u({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 -1 22 28",fill:"currentColor",fillRule:"evenodd",className:c,children:o.jsx("path",{d:"M4.125 20.149c-2.69 5.959 3.036 7.453 7.26 3.966 1.24 3.91 5.898.993 7.569-2.036 3.682-6.678 2.195-13.49 1.813-14.895-2.617-9.582-15.699-9.592-17.95.049-.526 1.687-.535 3.606-.833 5.598-.15 1.005-.256 1.646-.645 2.703-.223.607-.53 1.147-1.014 2.056-.75 1.412-.434 4.138 3.434 2.724v.001ZM11.895 11.332c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.395.9.395 1.578 0 1.283-.493 2.048-1.319 2.048Zm4.416 0c-1.073 0-1.234-1.283-1.234-2.048 0-.69.124-1.239.358-1.586a1 1 0 0 1 .876-.462c.375 0 .697.158.924.47.259.354.396.9.396 1.578 0 1.283-.494 2.048-1.32 2.048Z"})})}function s({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:c,children:o.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})})}function g({size:l=16,className:c=""}){return o.jsxs("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:c,children:[o.jsx("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),o.jsx("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]})}function x({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:c,children:o.jsx("path",{d:"M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"})})}function f({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",className:c,children:o.jsx("path",{d:"M7 2h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5V7a5 5 0 015-5zm0 4.5v11h2.35v-4.55h5.3V17.5H17v-11h-2.35v4.1h-5.3V6.5H7z"})})}function C({size:l=16,className:c=""}){return o.jsx("svg",{width:l,height:l,viewBox:"0 0 16 16",fill:"currentColor",className:c,children:o.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})})}const j={CLAUDE:i,CODEX:d,COPILOT:x,CURSOR:a,GEMINI:v,GITHUB:C,HERMES:f,KIMI:g,KIRO:u,OPENCODE:s},I={ANTIGRAVITY:"/brand-logos/antigravity.svg",CLAUDE:"/brand-logos/claude-code.svg",CODEX:"/brand-logos/codex.svg",GEMINI:"/brand-logos/gemini.svg",HERMES:"/brand-logos/hermes.svg",OPENCLAW:"/brand-logos/openclaw.svg",OPENCODE:"/brand-logos/opencode.svg"};function p({provider:l,size:c=16,color:h,className:n=""}){const e=l?.toUpperCase?.()||"",r=I[e];if(r)return o.jsx("img",{src:r,alt:"",width:c,height:c,className:n,style:{width:c,height:c,objectFit:"contain"},"aria-hidden":!0});const t=j[e];return t?o.jsx(t,{size:c,className:n}):o.jsx("div",{className:"rounded-full shrink-0",style:{width:c*.5,height:c*.5,backgroundColor:h}})}export{p as P};
|