@deslop/auth 0.1.1227 → 0.1.1231

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.
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{At as t,Bt as n,Co as r,Ct as i,Ea as a,Ei as o,Eo as s,Et as c,F as l,Ft as u,G as d,I as f,K as p,Ko as m,Lt as h,M as g,Mi as _,Mr as v,Nt as y,O as b,Oa as ee,Oi as x,Pt as S,R as C,S as w,Tt as T,U as E,Va as D,Vt as te,W as O,Xa as k,Za as A,_ as j,b as M,c as N,co as P,d as F,f as I,g as L,gt as R,h as z,io as ne,j as B,ji as V,l as H,lo as re,m as U,o as W,on as G,oo as K,ot as q,p as ie,qt as ae,ro as oe,s as se,sn as ce,tt as le,u as ue,v as de,x as J,xo as fe,y as pe,yt as me,z as he,zt as ge}from"./client-c9qebYWa.js";import{$ as _e,$t as ve,A as ye,At as be,B as xe,Bn as Y,Bt as Se,Cn as Ce,Ct as we,D as Te,Dt as Ee,E as De,F as Oe,Fn as ke,Ft as Ae,G as je,Gt as Me,H as Ne,Ht as Pe,I as Fe,J as Ie,Jt as Le,K as Re,Kt as ze,L as Be,M as Ve,Mt as He,N as Ue,O as We,Ot as Ge,P as Ke,Pt as qe,Q as Je,Qt as X,R as Ye,Rn as Xe,Rt as Ze,S as Qe,St as $e,T as et,Tt as tt,U as nt,Ut as rt,V as it,Vt as at,W as ot,Wt as st,X as ct,Xt as lt,Y as ut,Yt as dt,Z as ft,Zt as pt,_ as mt,_n as ht,_t as gt,a as _t,an as vt,at as yt,b as bt,bn as xt,bt as St,cn as Ct,ct as wt,dn as Tt,dt as Et,en as Dt,et as Ot,fn as kt,ft as At,g as jt,gn as Mt,gt as Nt,h as Pt,hn as Ft,ht as It,i as Lt,in as Rt,it as zt,j as Bt,jn as Vt,jt as Ht,k as Ut,kt as Wt,l as Gt,ln as Kt,lt as qt,mn as Jt,mt as Yt,n as Xt,nn as Zt,on as Qt,ot as $t,p as en,pn as tn,pt as nn,q as rn,qt as an,r as on,rn as sn,rt as cn,s as ln,sn as un,st as dn,t as fn,tn as pn,tt as mn,un as hn,ut as gn,v as _n,vn,vt as yn,w as bn,wn as xn,wt as Sn,x as Cn,xn as wn,xt as Tn,y as En,yn as Dn,yt as On,z as kn,zt as An}from"./components-CRByL0Z7.js";import{i as jn,n as Mn,r as Nn,t as Pn}from"./index-JMt3-1H2.js";var Fn={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Fn.node;var In=d(Fn),Ln=0;function Rn(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Ln);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),I;let o=requestAnimationFrame(a);return Ln=o,()=>{Ln===o&&(cancelAnimationFrame(o),Ln=0)}}var zn=`data-base-ui-inert`,Bn=new WeakMap,Vn=new WeakSet,Hn=new WeakMap,Un=0;function Wn(e){return e?he(e)?e.host:Wn(e.parentNode):null}var Gn=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Wn(t);return e.contains(n)?n:null}).filter(e=>e!=null),Kn=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},qn=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{b(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Jn(e,t,n,{mark:r=!0}){let i=Gn(t,e),a=r?qn(t,Kn(i),new Set(i)):[],o=[],s=[];if(n){let e=Gn(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);qn(t,Kn(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(Bn.get(e)||0)+1;Bn.set(e,r),o.push(e),r===1&&n&&Vn.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Hn.get(e)||0)+1;Hn.set(e,t),s.push(e),t===1&&e.setAttribute(zn,``)}),Un+=1,()=>{o.forEach(e=>{let t=(Bn.get(e)||0)-1;Bn.set(e,t),t||(Vn.has(e)||e.removeAttribute(`aria-hidden`),Vn.delete(e))}),r&&s.forEach(e=>{let t=(Hn.get(e)||0)-1;Hn.set(e,t),t||e.removeAttribute(zn)}),--Un,Un||(Bn=new WeakMap,Vn=new WeakSet,Hn=new WeakMap)}}function Yn(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Y(e[0]).body;return Jn(e,i,n,{mark:r})}var Z=e(m(),1),Q=s();function Xn(e,t){let n=g(ve(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(pn(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Zn=20,Qn=[];function $n(){Qn=Qn.filter(e=>e.deref()?.isConnected)}function er(e){$n(),e&&b(e)!==`body`&&(Qn.push(new WeakRef(e)),Qn.length>Zn&&(Qn=Qn.slice(-20)))}function tr(){return $n(),Qn[Qn.length-1]?.deref()}function nr(e){return e?nn(e)?e:Yt(e)[0]||e:null}function rr(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=wt(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return nn(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function ir(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:d=``,nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:h,getInsideElements:g}=e,_=t.useState(`open`),v=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:ee,dataRef:x}=t.context,S=J(()=>x.current.floatingContext?.nodeId),C=i===!1,w=Pe(v)&&C,T=$e(i),E=$e(a),D=$e(o),te=$e(d),O=$e(_),k=Je(h),A=mn(),j=Z.useRef(!1),N=Z.useRef(!1),P=Z.useRef(!1),F=Z.useRef(null),I=Z.useRef(``),L=Z.useRef(``),R=Z.useRef(null),z=Z.useRef(null),ne=U(R,m,A?.beforeInsideRef),B=U(z,A?.afterInsideRef),V=Ft(),H=Ft(),re=xt(),W=A!=null,G=at(y),K=J((e=G)=>e?Yt(e):[]),q=J(()=>g?.().filter(e=>e!=null)??[]);Z.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&X(G,lt(Y(G)))&&K().length===0&&!w&&sn(e)}let t=Y(G);return Sn(t,`keydown`,e)},[r,G,c,w,K]),Z.useEffect(()=>{if(r||!_)return;let e=Y(G);function t(){P.current=!1}function n(e){let t=ve(e),n=q(),r=X(y,t)||X(v,t)||X(A?.portalNode,t)||n.some(e=>e===t||X(e,t));P.current=!r,L.current=e.pointerType||`keyboard`,pt(t,`[data-base-ui-click-trigger]`)&&(N.current=!0,H.start(0,()=>{N.current=!1}))}function i(){L.current=`keyboard`}return we(Sn(e,`pointerdown`,n,!0),Sn(e,`pointerup`,t,!0),Sn(e,`pointercancel`,t,!0),Sn(e,`keydown`,i,!0),t)},[r,y,v,G,_,A,H,q]),Z.useEffect(()=>{if(r||!u)return;let e=Y(G);function n(){N.current=!0,H.start(0,()=>{N.current=!1})}function i(e){let t=ve(e);nn(t)&&(F.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=ve(n);c&&r==null&&a!=null&&X(y,a)&&er(a),queueMicrotask(()=>{let o=S(),u=t.context.triggerElements,d=q(),m=r?.hasAttribute(yt(`focus-guard`))&&[R.current,z.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,vn(p),vn(f)].includes(r),h=!(X(v,r)||X(y,r)||X(r,y)||X(A?.portalNode,r)||d.some(e=>e===r||X(e,r))||u.hasMatchingElement(e=>X(e,r))||m||k&&(dn(k.nodesRef.current,o).find(e=>X(e.context?.elements.floating,r)||X(e.context?.elements.domReference,r))||$t(k.nodesRef.current,o).find(e=>[e.context?.elements.floating,at(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===v&&G&&rr(G),s&&i!==v&&!yn(a)&&lt(e)===e.body){if(l(G)&&(G.focus(),s===`popup`)){re.request(()=>{G.focus()});return}let e=K(),t=F.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||G;l(n)&&n.focus()}x.current.insideReactTree?x.current.insideReactTree=!1:(w||!c)&&r&&h&&!N.current&&(w||r!==tr())&&(j.current=!0,t.setOpen(!1,An(Ee,n)))})}function o(){P.current||(x.current.insideReactTree=!0,V.start(0,()=>{x.current.insideReactTree=!1}))}let d=l(v)?v:null;if(y||d)return we(d&&Sn(d,`focusout`,a),d&&Sn(d,`pointerdown`,n),y&&Sn(y,`focusin`,i),y&&Sn(y,`focusout`,a),y&&A&&Sn(y,`focusout`,o,!0))},[r,v,y,G,c,k,A,t,u,s,K,w,S,x,V,H,re,f,p,q]),Z.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${yt(`portal`)}]`)||[]),t=(k?$t(k.nodesRef.current,S()):[]).find(e=>Pe(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Yn([y,...e,R.current,z.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...q(),t,vn(p),vn(f),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=Yn([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,c,A,w,k,S,f,p,q]),M(()=>{if(!_||r||!l(G))return;I.current=``,L.current=``;let e=Y(G),t=lt(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(te.current||``):n;if(r===void 0||r===!1||X(G,t))return;let i=null,a=()=>(i??=K(G),i[0]||G),o;o=r===!0||r===null?a():vn(r),o||=a();let s=X(G,lt(e)),c=x.current.openEvent,l=c?.type===`mousedown`&&pn(c);Rn(o,{sync:l,preventScroll:o===G,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=lt(e);return!(t!==o&&X(G,t))}})})},[r,_,G,K,T,te,O,x]);let ie=Z.useRef(null);M(()=>{if(r||!G){ie.current=null;return}ie.current&&=(ie.current.cancelled=!0,null);let e=Y(G),t=lt(e),n=te.current==null;er(t);function i(e){if(e.open||(I.current=Xn(e.nativeEvent,L.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(yt(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(pn(e.nativeEvent)||Zt(e.nativeEvent))j.current=!1;else{let e=!1;Y(G).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}ee.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&b(t)!==`body`?t:null,s=n?o||a:a||o;return s||=tr()||null,typeof i==`boolean`?s:vn(i)||s||null}return()=>{ee.off(`openchange`,i);let t=lt(e),n=q(),r=X(y,t)||n.some(e=>e===t||X(e,t))||k&&dn(k.nodesRef.current,S(),!1).some(e=>X(e.context?.elements.floating,t)),o=E.current,s=I.current,c=a(s),u={cancelled:!1};ie.current=u,queueMicrotask(()=>{ie.current===u&&(ie.current=null);let n=nr(c),i=D.current??typeof o!=`boolean`;if(!u.cancelled&&o&&!j.current&&l(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,y,G,E,D,te,ee,k,v,S,q]),M(()=>{if(!vt||_||!y)return;let e=lt(Y(y));l(e)&&rt(e)&&X(y,e)&&e.blur()},[_,y]),M(()=>{if(!r&&A)return A.setFocusManagerState({modal:c,closeOnFocusOut:u,open:_,onOpenChange:t.setOpen,domReference:v}),()=>{A.setFocusManagerState(null)}},[r,A,c,_,t,u,v]),M(()=>{if(!r&&G)return rr(G),()=>{queueMicrotask($n)}},[r,G]);let ae=!r&&(!c||!w)&&(W||c);return(0,Q.jsxs)(Z.Fragment,{children:[ae&&(0,Q.jsx)(Tn,{"data-type":`inside`,ref:ne,onFocus:e=>{if(c){let e=K();Rn(e[e.length-1])}else A?.portalNode&&(j.current=!1,At(e,A.portalNode)?qt(v)?.focus():vn(p??A.beforeOutsideRef)?.focus())}}),n,ae&&(0,Q.jsx)(Tn,{"data-type":`inside`,ref:B,onFocus:e=>{c?Rn(K()[0]):A?.portalNode&&(u&&(j.current=!0),At(e,A.portalNode)?gn(v)?.focus():vn(f??A.afterOutsideRef)?.focus())}})]})}function ar(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Ze}=t,l=e.context.dataRef,u=Z.useRef(void 0),d=xt(),f=Ft(),p=Z.useMemo(()=>{function t(t,n,r,i){let a=An(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=Dt(e.pointerType,!0)&&Zt(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||Dt(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=ve(s),p=rt(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:Dt(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return Z.useMemo(()=>n?{reference:p}:F,[n,p])}function or(e){return vt&&e.movementX===0&&e.movementY===0}function sr(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function cr(e,t){return sr(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function lr(e,t,n){return sr(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function ur(e,t,n){return sr(t,n?e===an:e===Le,e===ze)}function dr(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:sr(t,n?e===Le:e===an,e===dt)}function fr(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:u=!1,rtl:d=!1,virtual:f=!1,focusItemOnOpen:p=`auto`,focusItemOnHover:m=!0,openOnArrowKeyDown:h=!0,disabledIndices:g=void 0,orientation:_=`vertical`,triggerOrientation:v=_,parentOrientation:y,id:b,resetOnPointerLeave:ee=!0,externalTree:x,nestedReturnFocusRef:S,grid:C}=t,w=C!=null,T=e.useState(`open`),E=e.useState(`floatingElement`),D=e.useState(`domReferenceElement`),te=e.context.dataRef,O=at(E),k=Pe(D),A=$e(O),j=ft(),N=Je(x),P=Z.useRef(p),F=Z.useRef(o??-1),I=Z.useRef(null),L=Z.useRef(!0),R=J(e=>{i(F.current===-1?null:F.current,e)}),z=Z.useRef(!!E),ne=Z.useRef(T),B=Z.useRef(!1),V=Z.useRef(!1),H=Z.useRef(null),re=$e(g),U=$e(T),W=$e(o),G=$e(ee),K=xt(),q=xt(),ie=J(()=>{K.cancel();function e(e){f||(H.current=Rn(e,{sync:B.current,preventScroll:!0}))}let t=n.current[F.current],r=V.current;t&&e(t),(B.current?e=>e():e=>K.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),ue&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});M(()=>{te.current.orientation=_},[te,_]),M(()=>{T||(I.current=null),T&&p===`auto`||(P.current=p)},[T,p]),M(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(V.current=!0,R())):z.current&&(F.current=-1,R()))},[a,T,E,o,R]),M(()=>{if(a){if(!T)B.current=!1;else if(E){if(r==null){if(B.current=!1,W.current!=null)return;if(z.current&&(F.current=-1,ie()),(!ne.current||!z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>q.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||lr(I.current,v,d)||u?Nt(n):It(n),I.current=null,R())};t()}}else On(n.current,r)||(F.current=r,ie(),V.current=!1)}}},[a,T,E,r,W,u,n,v,d,R,ie,q]),M(()=>{if(!a||E||!N||f||!z.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===j)?.context?.elements.floating,n=lt(Y(D??t??null)),r=e.some(e=>e.context&&X(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,j,f]),M(()=>{ne.current=T,z.current=!!E});let ae=r!=null,oe=J(e=>{if(!U.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),se=J(()=>y??N?.nodesRef.current.find(e=>e.id===j)?.context?.dataRef?.current.orientation),ce=J(()=>Nt(n,re.current)),le=J(t=>{if(L.current=!1,B.current=!0,t.which===229||!U.current&&t.currentTarget===A.current)return;if(u&&dr(t.key,_,d,w)){cr(t.key,se())||sn(t),e.setOpen(!1,An(Ht,t.nativeEvent));let n=S?.current??D;l(n)&&n.focus();return}r!=null&&r!==F.current&&!On(n.current,r)&&(F.current=r);let i=F.current,a=Nt(n,g),o=It(n,g);if(k||(t.key===`Home`&&(sn(t),F.current=a,R(t)),t.key===`End`&&(sn(t),F.current=o,R(t))),C!=null){let e=C(t,F.current,n,_,c,d,g,a,o);if(e!=null&&e!==F.current&&(F.current=e,R(t)),_===`both`)return}if(cr(t.key,_)){sn(t);let e=lt(t.currentTarget.ownerDocument);if(T&&!f&&X(t.currentTarget,e)&&!n.current.some(t=>t!=null&&X(t,e))){F.current=lr(t.key,_,d)?a:o,R(t),r===F.current&&ie();return}let{index:l,wrapped:u}=gt(n.current,i,{decrement:!lr(t.key,_,d),loopFocus:c,allowEscape:s,disabledIndices:g,minIndex:a,maxIndex:o});u&&(B.current=!1),F.current=l,R(t)}}),ue=Z.useMemo(()=>({onFocus(e){B.current=!0,oe(e)},onClick({currentTarget:e}){f||e.focus({preventScroll:!0})},onMouseMove(e){or(e)||(B.current=!0,V.current=!1,m&&oe(e))},onPointerLeave(e){if(!U.current||!L.current||e.pointerType===`touch`)return;B.current=!0;let t=e.relatedTarget;if(m&&!n.current.includes(t)&&G.current&&(H.current?.(),H.current=null,F.current=-1,R(e),!f)){let e=A.current,t=lt(Y(e));e&&X(e,t)&&e.focus({preventScroll:!0})}}}),[oe,U,A,m,n,R,G,f]),de=Z.useMemo(()=>f&&T&&ae&&{"aria-activedescendant":`${b}-${r}`},[f,T,ae,b,r]),fe=Z.useMemo(()=>({...k?{}:de,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&T&&!f){let n=ve(t.nativeEvent);if(n&&!X(A.current,n))return;sn(t);let r=An(Ee,t.nativeEvent);e.setOpen(!1,r);let i=S?.current??D;!r.isCanceled&&l(i)&&i.focus()}else le(t)},onPointerMove(e){or(e)||(L.current=!0)}}),[de,le,A,k,e,T,f,D,S]),pe=Z.useMemo(()=>{function t(t){e.setOpen(!0,An(Ht,t.nativeEvent,t.currentTarget))}function n(e){p===`auto`&&pn(e.nativeEvent)&&(P.current=!f)}function r(e){P.current=p,p===`auto`&&Zt(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(n){let r=e.select(`open`);L.current=!1;let i=n.key.startsWith(`Arrow`),a=ur(n.key,se(),d),o=cr(n.key,r?_:v),s=(u?a:o)||n.key===`Enter`||n.key.trim()===``;if(f&&r&&(!u||rt(n.currentTarget)))return le(n);if(r||h||!i){if(s){let e=cr(n.key,se());I.current=u&&e?null:n.key}u?a&&(sn(n),r?(F.current=ce(),R(n),f&&A.current?.focus()):t(n)):o&&(W.current!=null&&(F.current=W.current),sn(n),!r&&h?t(n):le(n),r&&R(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!f&&(F.current=-1,R(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[le,p,ce,u,R,e,h,_,v,se,d,W,f,A]),me=Z.useMemo(()=>({...de,...pe}),[de,pe]);return Z.useMemo(()=>a?{reference:me,floating:fe,item:ue,trigger:pe}:{},[a,me,fe,pe,ue])}function pr(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=J(s),f=e.useState(`open`),p=Ft(),m=Z.useRef(``),h=Z.useRef(u??i??-1),g=Z.useRef(null),_=J(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!yn(n)||n?.matches(`:disabled`)?!1:o==null||!St(ue,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(sn(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(sn(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=J(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);X(r,n)||X(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});M(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=Z.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return Z.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}function mr(e){return ie(19)?e:e?`true`:void 0}var hr=e(Pn(),1);function gr(e){let t=hr.unstable_scheduleCallback(4,e);return()=>hr.unstable_cancelCallback(t)}var _r=Z.createContext(R({scheduleTask:gr,defaultIdleTTL:400})),vr=new WeakMap,yr=0,br=new Set;function xr(e){yr++;try{return e()}finally{yr--}}function Sr(e){if(yr===0)return e();br.size===0&&queueMicrotask(Cr),br.add(e)}function Cr(){for(let e of br)br.delete(e),e()}function wr(e,t){let n=vr.get(e);n===void 0&&(n=new WeakMap,vr.set(e,n));let r=n.get(t);if(r!==void 0)return r;let i=0,a,o={subscribe(n){i++;let r=e.subscribe(t,()=>Sr(n));return()=>{i--,br.delete(n),r()}},snapshot(){return xr(()=>e.get(t))},getServerSnapshot(){return(i===0||a===void 0)&&(a={value:xr(()=>le(t,e))}),a.value}};return n.set(t,o),o}function Tr(e,t){let n=wr(e,t);return Z.useEffect(Cr),Z.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}function Er(e,t,n){let r=wr(e,t),i=Z.useMemo(()=>{let e;return t=>(e!==void 0&&Object.is(e.source,t)||(e={source:t,value:n(t)}),e.value)},[n]);return Z.useEffect(Cr),Z.useSyncExternalStore(r.subscribe,()=>i(r.snapshot()),()=>i(r.getServerSnapshot()))}var Dr=(e,t)=>{let n=Z.useContext(_r);return t?Er(n,e,t):Tr(n,e)},Or=Z.createContext(void 0);function kr(e){let t=Z.useContext(Or);if(t===void 0&&!e)throw Error(de(33));return t}var Ar=Z.createContext(void 0);function jr(e){let t=Z.useContext(Ar);if(t===void 0&&!e)throw Error(de(36));return t}var Mr=Z.createContext(void 0);function Nr(e=!0){let t=Z.useContext(Mr);if(t===void 0&&!e)throw Error(de(25));return t}var Pr=Z.createContext(null);function Fr(e=`root`){let t=Z.useContext(Pr),n=Z.useContext(Ar);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var Ir={visible:!0,ref:null};function Lr(){return Ir}function Rr(e,t,n=`root`){let r=Fr(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??Lr)({label:e.label,children:e.children,render:e.render}),a=U(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function zr(e){e.preventDefault()}function Br(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=jr(),u=Nr(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return Z.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?zr:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:Wt})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!un&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&L(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var Vr={type:`regular-item`};function Hr(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=Z.useRef(null),{getButtonProps:d,buttonRef:f}=z({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Br({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=Z.useCallback(e=>pe(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=U(u,f);return Z.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Ur=Z.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Wr(){return Z.useContext(Ur)}function Gr(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Wr(),u=Z.useRef(-1),[d,f]=Z.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=Z.useRef(null),h=Z.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return M(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var Kr=Z.createContext(void 0);function qr(){let e=Z.useContext(Kr);if(e===void 0)throw Error(de(31));return e}var Jr=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=Z.useState(void 0),c=H(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,Q.jsx)(Kr.Provider,{value:s,children:c})}),Yr=Z.forwardRef(function(e,t){let n=Fr()?.Group??Jr;return(0,Q.jsx)(n,{...e,ref:t})}),Xr=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=We(a),c=qr();return M(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),H(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),Zr=Z.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=jr(),f=Gr({guess:!0,label:a}),p=We(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=Hr({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:Vr});return H(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Qr=Z.forwardRef(function(e,t){let n=Rr(e,t);return n.visible?(0,Q.jsx)(Zr,{...e,ref:n.ref}):null}),$r=Z.createContext(void 0);function ei(e){let t=Z.useContext($r);if(t===void 0&&!e)throw Error(de(69));return t}var ti=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),ni=Z.createContext(void 0);function ri(){return Z.useContext(ni)}function ii(e,t){let n=N(e.render);if(Z.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function ai(e,t,n){let r=ii(e,t),i=r===t?void 0:r;return[r,Z.useCallback(e=>n?.(e?i:void 0),[i,n])]}function oi(e,t,n){let r=N(e.render),i=Z.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var si=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=jr(),m=ri(),{side:h,align:g}=kr(),_=ei(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),ee=l.useState(`mounted`),x=l.useState(`instantType`),S=l.useState(`activeTriggerElement`),C=l.useState(`parent`),w=l.useState(`lastOpenChangeReason`),T=l.useState(`rootId`),E=l.useState(`floatingRootContext`),D=l.useState(`floatingTreeRoot`),te=l.useState(`closeDelay`),O=l.useState(`hoverEnabled`),k=l.useState(`disabled`),A=l.useState(`openMethod`),j=l.useState(`activeTriggerId`),M=l.useState(`listElement`),[N,P]=ai(e,u,d),F=oi(e,S,j),I=C.type===`menu`?m:void 0,L=C.type===`context-menu`,R=s??C.type!==`menu`;s===void 0&&M&&C.type!==`menu`&&(R=()=>l.state.activeIndex===null&&M),Mt({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),Z.useEffect(()=>{function e(e){l.setOpen(!1,An(e.reason,e.domEvent))}return D.events.on(`close`,e),()=>{D.events.off(`close`,e)}},[D.events,l]),ot(E,{enabled:O&&!k&&!L&&C.type!==`menubar`,closeDelay:te});let z=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:ne,handleFocus:B}=(Z.useContext(Pr)?.useParentHandoff??li)(l,C,v,f),V={transitionStatus:y,side:h,align:g,open:v,nested:C.type===`menu`,instant:x},re=H(`div`,e,{state:V,ref:[t,l.context.popupRef,z,P],stateAttributesMapping:st,props:[b,{id:N,...M?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":F},onKeyDown(e){I?.onPopupKeyDown?.(e),_&&ti.has(e.key)&&e.stopPropagation()},onFocus:B},et(y),c,{"data-rootownerid":T}]}),U=C.type===void 0||L;(S||C.type===`menubar`&&w!==`outside-press`)&&(U=!0);let W=I?.getReturnElement??ne;return(0,Q.jsx)(ir,{context:E,openInteractionType:A,modal:L,disabled:!ee,returnFocus:a??W??U,explicitReturnFocus:a===void 0&&W?!1:void 0,initialFocus:R,restoreFocus:!0,getInsideElements:C.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:C.type===`menubar`?void 0:D,previousFocusableElement:S,nextFocusableElement:C.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:re})}),ci={parentVirtualFocusRef:void 0,handleFocus:void 0};function li(){return ci}var ui=Z.forwardRef(function(e,t){let n=Fr()?.Popup??si;return(0,Q.jsx)(n,{...e,ref:t})}),di=Z.createContext(void 0);function fi(){let e=Z.useContext(di);if(e===void 0)throw Error(de(32));return e}var pi=Z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=jr();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Q.jsx)(di.Provider,{value:n,children:(0,Q.jsx)(Ot,{ref:t,...r,portalOwnerRole:o})})});function mi(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=J(i),[,o]=Z.useState(0),s=w(gi).current,c=w(hi).current,l=Z.useRef(0),u=Z.useRef(!0),d=Z.useRef(null),f=Z.useRef(null),p=J(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=J((e,t)=>{c.set(e,t),p()}),h=J(e=>{c.delete(e),p()}),g=J(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!yi(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&bi(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=vi(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=J(()=>{let[e,t]=_i(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});M(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),M(()=>{u.current&&v()}),M(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=J(e=>(s.add(e),()=>{s.delete(e)})),b=Z.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,Q.jsx)(Ur.Provider,{value:b,children:t})}function hi(){return new Map}function gi(){return new Set}function _i(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>bi(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function vi(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function yi(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function bi(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var xi=Z.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function Si(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=Z.useRef(null),o=Z.useRef(null),s=ht(r);M(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),M(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}var Ci={},wi={},Ti=``;function Ei(e,t){return C(e)?e:t}function Di(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Ei(t,n)).overflowY)}function Oi(e){if(typeof document>`u`)return!1;let t=Y(e);return g(t).innerWidth-t.documentElement.clientWidth>0}function ki(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Y(e),n=t.documentElement,r=t.body,i=Ei(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Ai(e){let t=Y(e),n=t.documentElement,r=t.body,i=Ei(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function ji(e){let t=Y(e),n=t.documentElement,r=t.body,i=g(n),a=0,o=0,s=!1,c=Dn.create();if(vt&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Ci={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ti=n.style.scrollBehavior,wi={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Ei(n,r);s=ki(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,Ci),Object.assign(r.style,wi),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Ti)}function d(){u(),c.request(l)}l();let f=Sn(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Mi=new class{lockCount=0;restore=null;timeoutLock=Jt.create();timeoutUnlock=Jt.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Y(e),n=t.documentElement,r=t.body,i=g(n);if(Di(i,n,r)){let t=new i.MutationObserver(()=>{Di(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Qt||!Oi(e);this.restore=a?Ai(e):ji(e)}};function Ni(e=!0,t=null){M(()=>{if(e)return Mi.acquire(t)},[e,t])}var Pi=20;function Fi(e,t,n,r){let[i,a]=Z.useState(!1);M(()=>{if(!e||!t||n==null){a(!1);return}let r=Y(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Pi)},[e,t,n]),Ni(e&&(!t||i),r)}var Ii=Z.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=cn,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:b}=jr(),ee=fi(),x=Nr(!0),S=v.useState(`parent`),C=v.useState(`floatingRootContext`),w=v.useState(`floatingTreeRoot`),T=v.useState(`mounted`),E=v.useState(`open`),D=v.useState(`modal`),te=v.useState(`openMethod`),O=v.useState(`activeTriggerElement`),k=v.useState(`transitionStatus`),A=v.useState(`positionerElement`),j=v.useState(`instantType`),M=v.useState(`adaptiveOrigin`),N=v.useState(`lastOpenChangeReason`),P=v.useState(`floatingNodeId`),F=v.useState(`floatingParentNodeId`),I=C.useState(`domReferenceElement`),L=n,R=c,z=l,ne=s,B=h;S.type===`context-menu`&&(L=n??S.context?.anchor,ne??=`start`,!o&&ne!==`center`&&(z=e.alignOffset??2,R=e.sideOffset??-5));let V=o,H=ne;S.type===`menu`?(V??=`inline-end`,H??=`start`,B=e.collisionAvoidance??zt):S.type===`menubar`&&(V??=S.context.orientation===`vertical`?`inline-end`:`bottom`,H??=`start`);let re=S.type===`context-menu`,U=De({anchor:L,floatingRootContext:C,positionMethod:x?`fixed`:r,mounted:T,side:V,sideOffset:R,align:H,alignOffset:z,arrowPadding:re?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:P,keepMounted:ee,disableAnchorTracking:m,collisionAvoidance:B,shift:re?{crossAxis:!(`side`in B&&B.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:w,adaptiveOrigin:M,lazyFlip:y?`placement`:!1});Z.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===P&&v.set(`hoverEnabled`,!1),e.nodeId!==P&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,An(Ae)))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[v,w.events,P]),Z.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,An(t))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[w.events,v]);let W=Ft();Z.useEffect(()=>{E||W.clear()},[E,W]),Z.useEffect(()=>{function e(e){if(E&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&O&&O!==e.target){let e=v.select(`closeDelay`);e>0?W.isStarted()||W.start(e,()=>{v.setOpen(!1,An(Ae))}):v.setOpen(!1,An(Ae))}else W.clear()}}return w.events.on(`itemhover`,e),()=>{w.events.off(`itemhover`,e)}},[w.events,E,O,v,W]),Z.useEffect(()=>{let e={open:E,nodeId:P,parentNodeId:F,reason:v.select(`lastOpenChangeReason`)};w.events.emit(`menuopenchange`,e)},[w.events,E,v,P,F]),Si({store:v,domReference:I,positionerElement:A,open:E});let G={open:E,side:U.side,align:U.align,anchorHidden:U.anchorHidden,nested:S.type===`menu`,instant:j},K=S.type===`menubar`&&S.context.modal;Fi(E&&(K||D&&N!==`trigger-hover`),te===`touch`,A,O);let q=bn(e,G,{styles:U.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!T,inert:!E}),ie=T&&S.type!==`menu`&&(S.type!==`menubar`&&D&&N!==`trigger-hover`||S.type===`menubar`&&S.context.modal),ae=null;return S.type===`menubar`?ae=S.context.contentElement:S.type===void 0&&(ae=O),(0,Q.jsxs)(Or.Provider,{value:U,children:[ie&&(0,Q.jsx)(xi,{ref:S.type===`context-menu`||S.type===`nested-context-menu`?S.context.internalBackdropRef:null,inert:mr(!E),cutout:ae}),(0,Q.jsx)(Ie,{id:P,children:(0,Q.jsx)(mi,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:b,children:q})})]})}),Li=Z.createContext(null);function Ri(e){let t=Z.useContext(Li);if(t===null&&!e)throw Error(de(5));return t}function zi(e){let t=Z.useRef(``),n=Z.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:Z.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function Bi(e,t){let n=Z.useRef(e),r=J(t);M(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Vi(e,t){let{onClick:n,onPointerDown:r}=zi(J((n,r)=>{(typeof e==`function`?e():e)||t(r||(Qt?`touch`:``))}));return Z.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Hi(e){let[t,n]=Z.useState(null),r=Vi(e,n);return Bi(e,t=>{t&&!e&&n(null)}),Z.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Ui(e){return e==null?He:e.type.startsWith(`key`)?be:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?qe:He}var Wi={...Bt,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=Bt.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>vt&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!Bt.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Gi=class extends Ve{constructor(e,t,n=!1){let r=new Ue,i=qi(r,t,n,e);super(i,Ki(r),Wi),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function Ki(e){return{positionerRef:Z.createRef(),popupRef:Z.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:Z.createRef(),beforeTriggerFocusGuardRef:Z.createRef(),beforeContentFocusGuardRef:Z.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function qi(e,t,n=!1,r){return{...ye(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:F,inputProps:F,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new _e,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:F,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Ji=Z.createContext(null);function Yi(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function Xi(e,t){return e===`list-navigation`||Yi(e,t)}var Zi=Ct(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:_=!1,virtualFocus:v=!1,virtualFocusRef:y,allowEscape:b=!0,resetOnPointerLeave:ee=!0}=e,x=Nr(!0),S=jr(!0),C=Ri(!0),T=S?.store,E=S?.virtualFocus??!1,D=Z.useMemo(()=>_&&T?{type:`menu`,store:T}:C?{type:`menubar`,context:C}:x&&!T?{type:`context-menu`,context:x}:{type:void 0},[x,T,C,_]),te=We(),O=We(),[k,A]=Z.useState(void 0),j=(k??O)||void 0,N=ft(),P=D.type===`menu`?D.store:void 0,I=(n??o)&&P?.state.transitionStatus===`starting`,L=w(()=>I?P?.state.instantType:void 0).current,R=w(()=>{let e=new Gi({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:D,disabled:s,highlightItemOnHover:g,modal:D.type===void 0?c:void 0,rootId:te,instantType:L},j,N!=null);return e.context.virtualFocusRef=y,e}).current;R.useControlledProp(`openProp`,n),R.useControlledProp(`triggerIdProp`,m),R.useContextCallback(`onOpenChangeComplete`,i);let z=R.useState(`floatingTreeRoot`),ne=ct(z),B=R.useState(`open`),V=R.useState(`activeTriggerElement`),H=R.useState(`positionerElement`),re=R.useState(`hoverEnabled`),U=R.useState(`disabled`),W=R.useState(`lastOpenChangeReason`),G=R.useState(`parent`),K=R.useState(`activeIndex`),q=R.useState(`keyboardOpen`),ie=R.useState(`payload`),ae=R.useState(`floatingParentNodeId`),oe=Z.useRef(null),se=Z.useRef(G.type!==`context-menu`),ce=Ft(),le=Z.useRef(!0),de=Ft(),fe=ae!=null,{openMethod:me,triggerProps:he}=Hi(B);R.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:G.type===void 0?c:void 0,openMethod:me,rootId:te}),Ye(R);let{forceUnmount:ge,transitionStatus:_e}=kn(B,R,()=>{R.set(`allowMouseEnter`,!1)},I),ve=ht(R.context.popupRef);Z.useEffect(()=>{if(L===void 0)return;let e=()=>{R.state.instantType===L&&R.set(`instantType`,void 0)};if(!B){e();return}if(_e!==void 0)return;if(R.context.popupRef.current==null){e();return}let t=new AbortController;return ve(e,t.signal),()=>{t.abort()}},[L,B,_e,ve,R]),M(()=>{x&&!S?R.update({parent:{type:`context-menu`,context:x},floatingNodeId:ne,floatingParentNodeId:N}):(S||!R.select(`activeTriggerElement`))&&R.update({floatingNodeId:ne,floatingParentNodeId:N})},[x,S,ne,N,V,R]),Z.useEffect(()=>{B||(oe.current=null),G.type===`context-menu`&&(B?ce.start(500,()=>{se.current=!0}):(ce.clear(),se.current=!1))},[ce,B,G.type]),M(()=>{!B&&!re&&R.set(`hoverEnabled`,!0)},[B,re,R]);let ye=J((e,t)=>{let n=t.reason;if(!e&&!R.select(`open`)||B===e&&t.trigger===V&&W===n)return;let i=Fe(t);if(!e&&t.trigger==null&&(t.trigger=V??void 0),r?.(e,t),t.isCanceled)return;R.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!le.current)return;e&&n===`trigger-focus`?(le.current=!1,de.start(300,()=>{le.current=!0})):(le.current=!0,de.clear());let o=!e&&(n===`escape-key`||n==null);oe.current=t.event;let s=Be(R.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&Xi(n,a),s.instantType=G.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:Yi(n,a)?`click`:o?`dismiss`:void 0,R.update(s)}),Y=Re({popupStore:R,floatingRootContext:R.state.floatingRootContext,floatingId:j,nested:N!=null,onOpenChange:ye}),Ce=Y.context.events;M(()=>{let e=({open:e,eventDetails:t})=>ye(e,t);return Ce.on(`setOpen`,e),()=>{Ce?.off(`setOpen`,e)}},[Ce,ye]),M(()=>R.subscribeToParentMenu(),[R]);let we=Z.useCallback(()=>{R.setOpen(!1,An(Ge))},[R]);Z.useImperativeHandle(d,()=>({unmount:ge,close:we}),[ge,we]);let Ee;G.type===`context-menu`&&(Ee=G.context),Z.useImperativeHandle(Ee?.positionerRef,()=>H,[H]),Z.useImperativeHandle(Ee?.actionsRef,()=>({setOpen:ye}),[ye]);let De=rn(Y,{enabled:!U,bubbles:{escapeKey:f&&G.type===`menu`},outsidePress(){return G.type!==`context-menu`||oe.current?.type===`contextmenu`||se.current},externalTree:fe?z:void 0}),ke=Te(),Ae=fr(Y,{enabled:!U,listRef:R.context.itemDomElements,activeIndex:K,virtual:v,nested:G.type===`menubar`||!v&&G.type!==void 0,parentOrientation:G.type===`menubar`?G.context.orientation:void 0,loopFocus:l,focusItemOnOpen:v?q:void 0,allowEscape:v&&l&&b,orientation:u,triggerOrientation:v?`vertical`:u,rtl:ke===`rtl`,disabledIndices:ue,onNavigate(e,t){R.setActiveIndex(e,Ui(t),t?.nativeEvent)},openOnArrowKeyDown:G.type!==`context-menu`&&!(v&&_),externalTree:!v&&fe?z:void 0,nestedReturnFocusRef:P?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:ee}),je=Z.useCallback(e=>{R.context.typingRef.current=e},[R]),Me=pr(Y,{enabled:!U&&!v,listRef:R.context.itemLabels,elementsRef:R.context.itemDomElements,activeIndex:K,resetMs:500,onMatch:(e,t)=>{B&&e!==K&&R.setActiveIndex(e,be,t.nativeEvent)},onTyping:je}),Ne=J(a),Pe=Z.useRef(-1),Ie=J(()=>{let e=R.state.activeIndex,t=e===null?void 0:R.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Pe.current===n&&R.context.reportedItem===t)return;Pe.current=n,R.context.reportedItem=t,v&&R.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=R.context;R.context.highlightReason=He,R.context.highlightEvent=void 0,a&&Ne(t,Se(r,i,{label:t===void 0?void 0:R.context.itemLabels.current[n]??void 0}))});M(()=>{Ie()},[K,Ie]);let Le=Z.useMemo(()=>{if(!v)return Ae.reference;if(!Ae.trigger)return F;let{onFocus:e,...t}=Ae.trigger;return t},[v,Ae.reference,Ae.trigger]);R.useSyncedValue(`inputProps`,v?Ae.reference??F:F);let ze=Z.useMemo(()=>{let e=pe(Me.reference,Le,De.reference,{onMouseMove(){R.set(`allowMouseEnter`,!0)}},he);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=B,e},[R,Me.reference,Le,De.reference,he,B]),Ve=Z.useMemo(()=>{let e=pe(Ae.trigger,De.trigger,he);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Ae.trigger,De.trigger,he]);w(()=>(R.update({inactiveTriggerProps:Ve}),null));let Ue=Z.useMemo(()=>pe(Ke,{onMouseMove(){R.set(`allowMouseEnter`,!0),G.type===`menu`&&R.set(`hoverEnabled`,!1)},onClick(){R.select(`hoverEnabled`)&&R.set(`hoverEnabled`,!1)},onKeyDown(e){let t=R.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Me.floating,Ae.floating,De.floating),[G.type,R,Me.floating,Ae.floating,De.floating]),qe=Ae.item??F;xe(R,{floatingRootContext:Y,activeTriggerProps:ze,inactiveTriggerProps:Ve,popupProps:Ue,itemProps:qe});let Je=Z.useMemo(()=>({store:R,parent:D,orientation:u,loopFocus:l,allowEscape:b,defaultFloatingId:O,setRenderedFloatingId:A,virtualFocus:v,parentVirtualFocus:E,syncHighlightedItem:Ie}),[R,D,u,l,b,O,v,E,Ie]),X=typeof t==`function`?t({payload:ie}):t,Xe=(0,Q.jsxs)(Ar.Provider,{value:Je,children:[p&&(0,Q.jsx)(Oe,{handle:p,store:R}),X]});return(G.type===void 0||G.type===`context-menu`)&&(Xe=(0,Q.jsx)(ut,{externalTree:z,children:Xe})),Xe});function Qi(e){let t=Z.useContext(Ji);if(t===null)return(0,Q.jsx)(Zi,{...e});let n=t.Root;return(0,Q.jsx)(Ji.Provider,{value:null,children:(0,Q.jsx)(n,{...t.options,...e})})}var $i=5;function ea(e,t){let n=ta(t);return e.clientX>=n.left-$i&&e.clientX<=n.right+$i&&e.clientY>=n.top-$i&&e.clientY<=n.bottom+$i}function ta(e){let t=e.getBoundingClientRect(),n=g(e);if(Rt)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function na(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=j(),{ref:i,index:a}=Gr(e),o=n===a,s=Z.useRef(null),c=U(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function ra(e){let{render:t,className:n,style:r,state:i=F,props:a=ue,refs:o=ue,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=na({metadata:s});return H(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function ia(e){if(l(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!f(e))return ia(B(e))}var aa=e(r(),1);function oa(e,t){function n(n,r,i){let a=n.currentTarget;aa.flushSync(()=>{e.setOpen(!1,An(Ee,n.nativeEvent,a))}),Et(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&At(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function sa(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=Z.useRef(!1);return Z.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Y(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:F,[t,n,r])}var ca=Kt(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=jr(!0),h=Ut(d)??m?.store;if(!h)throw Error(de(85));let g=We(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerControlsId`,g),ee=Z.useRef(null),x=ua(),S=j(!0),C=Je(),w=Z.useMemo(()=>C??new _e,[C]),T=ct(w),E=ft(),{registerTrigger:D,isMountedByThisTrigger:te}=it(g,ee,h,{payload:f,closeDelay:u,parent:x,floatingTreeRoot:w,floatingNodeId:T,floatingParentNodeId:E,keyboardEventRelay:S?.relayKeyboardEvent}),O=x.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&x.context.disabled,{getButtonProps:M,buttonRef:N}=z({disabled:A,native:o});Z.useEffect(()=>{!y&&x.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,x.type]);let P=Z.useRef(null),I=Ft(),L=J(e=>{if(!P.current)return;I.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;X(P.current,t)||X(h.select(`positionerElement`),t)||t===P.current||t!=null&&ia(t)===h.select(`rootId`)||ea(e,P.current)||w.events.emit(`close`,{domEvent:e,reason:tt})});Z.useEffect(()=>{let e=Y(P.current);if(y&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,L,{once:!0}),()=>{e.removeEventListener(`mouseup`,L)}},[y,L,h]);let R=O&&x.context.hasSubmenuOpen,ne=nt(v,{enabled:(c??R)&&!A&&(!O||R&&!te),handleClose:Ne({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:x.type===void 0?l:void 0,delay:{close:u},triggerElementRef:ee,externalTree:w,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),B=la(y,h.select(`lastOpenChangeReason`)),V=ar(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:x.type===void 0&&B}),re=je(v,{enabled:!A&&R}),U=sa({open:y,enabled:O,mouseDownAction:`open`}),W=Z.useMemo(()=>pe(re.reference,V.reference),[re.reference,V.reference]),G=h.useState(`triggerProps`,te),K=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:q,handleFocusTargetFocus:ie}=oa(h,ee),ae={disabled:A,open:y},oe=[P,t,N,D,ee],se=[W,ne??F,G,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(I.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Y(e.currentTarget).addEventListener(`mouseup`,L,{once:!0}))}},K,O?{role:`menuitem`}:{},U,p,M],ce=H(`button`,e,{enabled:!O,stateAttributesMapping:Me,state:ae,ref:oe,props:se});return O?(0,Q.jsx)(ra,{tag:`button`,render:n,className:r,style:i,state:ae,refs:oe,props:se,stateAttributesMapping:Me}):y?(0,Q.jsxs)(Z.Fragment,{children:[(0,Q.jsx)(Tn,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:q},`${g}-pre-focus-guard`),(0,Q.jsx)(Z.Fragment,{children:ce},g),(0,Q.jsx)(Tn,{ref:h.context.triggerFocusTargetRef,onFocus:ie},`${g}-post-focus-guard`)]}):(0,Q.jsx)(Z.Fragment,{children:ce},g)});function la(e,t){let n=Ft(),[r,i]=Z.useState(!1);return M(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function ua(){let e=Ri(!0);return Z.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var $=p();function da(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Qi,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function fa(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(ca,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function pa(e){let t=(0,$.c)(18),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({align:i,alignOffset:a,side:o,sideOffset:s,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=i===void 0?`start`:i,l=a===void 0?0:a,u=o===void 0?`bottom`:o,d=s===void 0?4:s,f;t[7]===n?f=t[8]:(f=E(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[7]=n,t[8]=f);let p;t[9]!==r||t[10]!==f?(p=(0,Q.jsx)(ui,{"data-slot":`dropdown-menu-content`,className:f,...r}),t[9]=r,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==d||t[16]!==p?(m=(0,Q.jsx)(pi,{children:(0,Q.jsx)(Ii,{className:`isolate z-50 outline-none`,align:c,alignOffset:l,side:u,sideOffset:d,children:p})}),t[12]=c,t[13]=l,t[14]=u,t[15]=d,t[16]=p,t[17]=m):m=t[17],m}function ma(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Yr,{"data-slot":`dropdown-menu-group`,...n}),t[2]=n,t[3]=r),r}function ha(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=E(`px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Q.jsx)(Xr,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function ga(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=E(`group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,Q.jsx)(Qr,{"data-slot":`dropdown-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function _a(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=E(`-mx-1 my-1 h-px bg-border/50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(Vt,{"data-slot":`dropdown-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var va=ce({id:G,name:G,signOut:ae}),ya=q(t).atom(fe(y(`/auth/user`),v(S),v(u(va))));function ba(){let e=(0,$.c)(27),t=Dr(ya);if(!T(t))return null;let n;e[0]===t.value.id?n=e[1]:(n=o(`github:`,``)(t.value.id),e[0]=t.value.id,e[1]=n);let r=`https://avatars.githubusercontent.com/u/${n}?s=96`,i;e[2]!==t.value.name||e[3]!==r?(i=(0,Q.jsx)(tn,{src:r,alt:t.value.name}),e[2]=t.value.name,e[3]=r,e[4]=i):i=e[4];let a;e[5]===t.value.name?a=e[6]:(a=_(x(0,1)(t.value.name)),e[5]=t.value.name,e[6]=a);let s;e[7]===a?s=e[8]:(s=(0,Q.jsx)(kt,{children:a}),e[7]=a,e[8]=s);let c;e[9]!==i||e[10]!==s?(c=(0,Q.jsx)(fa,{"aria-label":`Account`,children:(0,Q.jsxs)(Tt,{size:`sm`,children:[i,s]})}),e[9]=i,e[10]=s,e[11]=c):c=e[11];let l;e[12]===t.value.name?l=e[13]:(l=(0,Q.jsx)(ma,{children:(0,Q.jsxs)(ha,{children:[`@`,t.value.name]})}),e[12]=t.value.name,e[13]=l);let u;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(_a,{}),e[14]=u):u=e[14];let d=!t.value.signOut,f;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(f=new URLSearchParams({next:location.href}),e[15]=f):f=e[15];let p=`/auth/sign-out?${f}`,m;e[16]===p?m=e[17]:(m=(0,Q.jsx)(`a`,{"aria-label":`Sign out`,href:p}),e[16]=p,e[17]=m);let h;e[18]!==m||e[19]!==d?(h=(0,Q.jsx)(ga,{variant:`destructive`,disabled:d,render:m,children:`Sign out`}),e[18]=m,e[19]=d,e[20]=h):h=e[20];let g;e[21]!==h||e[22]!==l?(g=(0,Q.jsxs)(pa,{align:`end`,className:`w-auto min-w-48`,children:[l,u,h]}),e[21]=h,e[22]=l,e[23]=g):g=e[23];let v;return e[24]!==g||e[25]!==c?(v=(0,Q.jsxs)(da,{children:[c,g]}),e[24]=g,e[25]=c,e[26]=v):v=e[26],v}function xa(e){let t=(0,$.c)(15),n;t[0]===e.icon?n=t[1]:(n=(0,Q.jsx)(`img`,{src:e.icon,alt:``,className:`pixelated size-8`}),t[0]=e.icon,t[1]=n);let r;t[2]===e.name?r=t[3]:(r=(0,Q.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:e.name}),t[2]=e.name,t[3]=r);let i;t[4]!==n||t[5]!==r?(i=(0,Q.jsxs)(`a`,{href:`/`,className:`-ml-1 flex shrink-0 items-center gap-1.5`,children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6];let a;t[7]===e.account?a=t[8]:(a=e.account??(0,Q.jsx)(ba,{}),t[7]=e.account,t[8]=a);let o;t[9]!==e.children||t[10]!==a?(o=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[e.children,a]}),t[9]=e.children,t[10]=a,t[11]=o):o=t[11];let s;return t[12]!==i||t[13]!==o?(s=(0,Q.jsxs)(`header`,{className:`bg-background border-border sticky top-0 z-30 flex h-12 shrink-0 items-center justify-between gap-4 border-b px-4`,children:[i,o]}),t[12]=i,t[13]=o,t[14]=s):s=t[14],s}function Sa(e){let t=(0,$.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.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.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z`}),t[0]=n):n=t[0];let r;return t[1]===e.className?r=t[2]:(r=(0,Q.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`currentColor`,className:e.className,"aria-hidden":`true`,children:n}),t[1]=e.className,t[2]=r),r}var Ca=O(`inline-block size-1.5 shrink-0 rounded-full`,{defaultVariants:{status:`live`},variants:{status:{error:`bg-destructive`,live:`bg-primary`,off:`border-muted-foreground border`,quiet:`bg-muted-foreground/50`,warning:`bg-warning`}}});function wa(e){let t=(0,$.c)(6),n;t[0]!==e.className||t[1]!==e.status||t[2]!==e.waiting?(n=E(Ca({status:e.status}),e.waiting===!0&&`motion-safe:animate-pulse`,e.className),t[0]=e.className,t[1]=e.status,t[2]=e.waiting,t[3]=n):n=t[3];let r;return t[4]===n?r=t[5]:(r=(0,Q.jsx)(`span`,{"data-slot":`status-dot`,"aria-hidden":`true`,className:n}),t[4]=n,t[5]=r),r}function Ta(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=E(`size-4 animate-spin`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(In,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Ea=`/assets/icon-dark-zztc3HXC.svg`;function Da(e){let t=(0,$.c)(40),[n,r]=ke(_n),i;if(t[0]!==e.request.clientName||t[1]!==e.request.device||t[2]!==e.request.kind){let n;t[4]!==e.request.clientName||t[5]!==e.request.device?(n=()=>En(e.request.clientName,e.request.device),t[4]=e.request.clientName,t[5]=e.request.device,t[6]=n):n=t[6],i=a(e.request.kind===`Browser`,{onFalse:n,onTrue:Oa}),t[0]=e.request.clientName,t[1]=e.request.device,t[2]=e.request.kind,t[3]=i}else i=t[3];let o;t[7]===i?o=t[8]:(o=(0,Q.jsx)(`h2`,{className:`text-xl font-semibold wrap-anywhere`,children:i}),t[7]=i,t[8]=o);let s;t[9]===e.request.id?s=t[10]:(s=ln(e.request.id),t[9]=e.request.id,t[10]=s);let l;t[11]===e.request.id?l=t[12]:(l=ln(e.request.id),t[11]=e.request.id,t[12]=l);let u;t[13]===l?u=t[14]:(u=(0,Q.jsx)(on,{text:l,className:`text-background size-44`}),t[13]=l,t[14]=u);let d;t[15]!==s||t[16]!==u?(d=(0,Q.jsx)(`a`,{href:s,"aria-label":`Approve this sign-in`,className:`bg-foreground rounded-lg p-3`,children:u}),t[15]=s,t[16]=u,t[17]=d):d=t[17];let f;t[18]===e.request.id?f=t[19]:(f=jt(e.request.id),t[18]=e.request.id,t[19]=f);let p;t[20]===f?p=t[21]:(p=(0,Q.jsx)(`p`,{className:`font-mono text-3xl font-semibold tracking-widest`,children:f}),t[20]=f,t[21]=p);let m;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(`p`,{className:`text-muted-foreground font-mono text-xs`,children:location.host}),t[22]=m):m=t[22];let h;t[23]===p?h=t[24]:(h=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[p,m]}),t[23]=p,t[24]=h);let g;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(wa,{waiting:!0}),t[25]=g):g=t[25];let _;t[26]===e.request.expiresAt?_=t[27]:(_=Qe(e.request.expiresAt),t[26]=e.request.expiresAt,t[27]=_);let v;t[28]===_?v=t[29]:(v=(0,Q.jsxs)(`p`,{className:`text-muted-foreground mt-auto flex items-center gap-2 font-mono text-xs`,role:`status`,children:[g,`Waiting · until `,_]}),t[28]=_,t[29]=v);let y;t[30]!==e.request.kind||t[31]!==n||t[32]!==r?(y=e.request.kind===`App`&&(0,Q.jsxs)(W,{variant:`ghost`,size:`sm`,disabled:c(n),onClick:()=>r(),children:[(0,Q.jsx)(Sa,{}),`Approve here with GitHub`]}),t[30]=e.request.kind,t[31]=n,t[32]=r,t[33]=y):y=t[33];let b;return t[34]!==o||t[35]!==v||t[36]!==y||t[37]!==d||t[38]!==h?(b=(0,Q.jsxs)(`section`,{className:`flex flex-1 flex-col items-center gap-6 pt-6 text-center`,"aria-label":`Waiting sign-in`,children:[o,d,h,v,y]}),t[34]=o,t[35]=v,t[36]=y,t[37]=d,t[38]=h,t[39]=b):b=t[39],b}function Oa(){return`Sign in this browser`}function ka(e){let t=(0,$.c)(7),r;t[0]===e.id?r=t[1]:(r=Pt(e.id),t[0]=e.id,t[1]=r);let i=Xe(r),a;if(t[2]!==e.account||t[3]!==i.value){let r;t[5]===e.account?r=t[6]:(r=t=>K(A(e.account,Aa),{onNone:()=>(0,Q.jsx)(Da,{request:t.request}),onSome:()=>(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(Ce,{label:`Apps`,media:!0,rows:Lt.length}),children:(0,Q.jsx)(Xt,{pending:re(t.request)})})}),t[5]=e.account,t[6]=r),a=fe(i.value,n,ge({Decided:Ma,Expired:ja,Waiting:r})),t[2]=e.account,t[3]=i.value,t[4]=a}else a=t[4];return a}function Aa(e){return e.role!==`Waiting`}function ja(){return(0,Q.jsx)(wn,{children:`This request expired. Start sign-in again in the app.`})}function Ma(){return(0,Q.jsx)(`p`,{className:`text-muted-foreground text-sm`,role:`status`,children:`Continuing…`})}function Na(){let e=(0,$.c)(4),t=Mn(),n;e[0]===t?n=e[1]:(n=e=>(0,Q.jsxs)(jn,{to:e.to,activeOptions:{exact:!0},className:se({variant:a(t({to:e.to})!==!1,{onFalse:Fa,onTrue:Pa})}),children:[e.label,e.count>0&&(0,Q.jsx)(hn,{children:e.count})]},e.to),e[0]=t,e[1]=n);let r=D([{count:0,label:`Sign-ins`,to:`/`},{count:ee(Xe(en).value,Ia),label:`People`,to:`/people`}],n),i;return e[2]===r?i=e[3]:(i=(0,Q.jsx)(`nav`,{className:`flex items-center gap-1`,"aria-label":`Sections`,children:r}),e[2]=r,e[3]=i),i}function Pa(){return`secondary`}function Fa(){return`ghost`}function Ia(e){return e.role===`Waiting`}function La(e){return fe(n(e.account.role),te(`Waiting`,()=>(0,Q.jsx)(`section`,{className:`flex flex-col gap-1`,role:`status`,children:(0,Q.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold tracking-tight`,children:[(0,Q.jsx)(wa,{waiting:!0}),`Waiting for an admin`]})})),h(()=>(0,Q.jsx)(Nn,{})))}function Ra(e){let t=(0,$.c)(24),[n,r]=ke(bt),i;t[0]!==e.account.id||t[1]!==e.account.name?(i=(0,Q.jsx)(fa,{"aria-label":`Account`,className:`focus-visible:ring-ring rounded-full outline-none focus-visible:ring-2`,children:(0,Q.jsx)(fn,{id:e.account.id,name:e.account.name})}),t[0]=e.account.id,t[1]=e.account.name,t[2]=i):i=t[2];let a=e.account.fullName??e.account.name,o;t[3]===a?o=t[4]:(o=(0,Q.jsx)(`span`,{className:`text-foreground block text-sm`,children:a}),t[3]=a,t[4]=o);let s=e.account.name,l;t[5]===e.account.role?l=t[6]:(l=V(e.account.role),t[5]=e.account.role,t[6]=l);let u=`@${s} · ${l}`,d;t[7]!==o||t[8]!==u?(d=(0,Q.jsx)(ma,{children:(0,Q.jsxs)(ha,{children:[o,u]})}),t[7]=o,t[8]=u,t[9]=d):d=t[9];let f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(_a,{}),t[10]=f):f=t[10];let p;t[11]===n?p=t[12]:(p=c(n),t[11]=n,t[12]=p);let m;t[13]===r?m=t[14]:(m=()=>r(),t[13]=r,t[14]=m);let h;t[15]!==p||t[16]!==m?(h=(0,Q.jsx)(ga,{variant:`destructive`,disabled:p,onClick:m,children:`Sign out`}),t[15]=p,t[16]=m,t[17]=h):h=t[17];let g;t[18]!==h||t[19]!==d?(g=(0,Q.jsxs)(pa,{align:`end`,className:`w-auto min-w-48`,children:[d,f,h]}),t[18]=h,t[19]=d,t[20]=g):g=t[20];let _;return t[21]!==i||t[22]!==g?(_=(0,Q.jsxs)(da,{children:[i,g]}),t[21]=i,t[22]=g,t[23]=_):_=t[23],_}function za(){let e=(0,$.c)(21),[t,n]=ke(_n),[r,i]=ke(Gt),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:`Sign in`}),e[0]=o):o=e[0];let s;e[1]===t?s=e[2]:(s=c(t),e[1]=t,e[2]=s);let l;e[3]===n?l=e[4]:(l=()=>n(),e[3]=n,e[4]=l);let u;e[5]===t?u=e[6]:(u=a(c(t),{onFalse:Va,onTrue:Ba}),e[5]=t,e[6]=u);let d;e[7]!==s||e[8]!==l||e[9]!==u?(d=(0,Q.jsxs)(W,{size:`lg`,disabled:s,onClick:l,children:[u,`Sign in with GitHub`]}),e[7]=s,e[8]=l,e[9]=u,e[10]=d):d=e[10];let f;e[11]===r?f=e[12]:(f=c(r),e[11]=r,e[12]=f);let p;e[13]===i?p=e[14]:(p=()=>i(),e[13]=i,e[14]=p);let m;e[15]!==f||e[16]!==p?(m=(0,Q.jsx)(W,{size:`lg`,variant:`outline`,disabled:f,onClick:p,children:`Sign in with a code`}),e[15]=f,e[16]=p,e[17]=m):m=e[17];let h;return e[18]!==d||e[19]!==m?(h=(0,Q.jsxs)(`section`,{className:`flex flex-col gap-4`,children:[o,(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[d,m]})]}),e[18]=d,e[19]=m,e[20]=h):h=e[20],h}function Ba(){return(0,Q.jsx)(Ta,{})}function Va(){return(0,Q.jsx)(Sa,{})}function Ha(){let e=(0,$.c)(11),[t]=ke(_n),[n]=ke(Gt),[r]=ke(bt),i;if(e[0]!==n||e[1]!==t||e[2]!==r){let a;e[4]===n?a=e[5]:(a=()=>me(n),e[4]=n,e[5]=a);let o;e[6]===r?o=e[7]:(o=()=>me(r),e[6]=r,e[7]=o),i=K(fe(me(t),P(a),P(o)),{onNone:Wa,onSome:Ua}),e[0]=n,e[1]=t,e[2]=r,e[3]=i}else i=e[3];let a;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(a=new URLSearchParams(location.search).has(`error`)&&(0,Q.jsx)(wn,{children:`GitHub sign-in failed. Try again.`}),e[8]=a):a=e[8];let o;return e[9]===i?o=e[10]:(o=(0,Q.jsxs)(Q.Fragment,{children:[i,a]}),e[9]=i,e[10]=o),o}function Ua(e){return(0,Q.jsx)(wn,{children:e.message})}function Wa(){return null}function Ga(){let e=(0,$.c)(7),[t,n]=ke(bt),r,o;e[0]===n?(r=e[1],o=e[2]):(r=()=>n(),o=[n],e[0]=n,e[1]=r,e[2]=o),(0,Z.useEffect)(r,o);let s;e[3]===t?s=e[4]:(s=a(i(t),{onFalse:qa,onTrue:Ka}),e[3]=t,e[4]=s);let c;return e[5]===s?c=e[6]:(c=(0,Q.jsx)(`p`,{className:`text-muted-foreground text-sm`,role:`status`,children:s}),e[5]=s,e[6]=c),c}function Ka(){return`Sign-out failed.`}function qa(){return`Signing out…`}function Ja(){let e=(0,$.c)(19),t=Xe(_t).value,n;e[0]===t?n=e[1]:(n=K(t,{onNone:to,onSome:eo}),e[0]=t,e[1]=n);let r;e[2]===t?r=e[3]:(r=k(t,$a)&&(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(Na,{})}),e[2]=t,e[3]=r);let i;e[4]!==n||e[5]!==r?(i=(0,Q.jsx)(xa,{icon:Ea,name:`auth`,account:n,children:r}),e[4]=n,e[5]=r,e[6]=i):i=e[6];let a;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(a=Cn&&(0,Q.jsx)(Ga,{}),e[7]=a):a=e[7];let o;e[8]===t?o=e[9]:(o=K(mt,{onNone:Qa,onSome:e=>(0,Q.jsx)(ka,{account:t,id:e})}),e[8]=t,e[9]=o);let s;e[10]===t?s=e[11]:(s=K(t,{onNone:Za,onSome:Ya}),e[10]=t,e[11]=s);let c;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(Ha,{}),e[12]=c):c=e[12];let l;e[13]!==o||e[14]!==s?(l=(0,Q.jsx)(`main`,{className:`pb-safe flex min-h-0 flex-1 justify-center overflow-y-auto px-4 pt-8 md:pt-16`,children:(0,Q.jsxs)(`div`,{className:`flex w-full max-w-xl flex-col gap-6 self-start`,children:[a,o,s,c]})}),e[13]=o,e[14]=s,e[15]=l):l=e[15];let u;return e[16]!==i||e[17]!==l?(u=(0,Q.jsxs)(Q.Fragment,{children:[i,l]}),e[16]=i,e[17]=l,e[18]=u):u=e[18],u}function Ya(e){return a(ne(mt)&&e.role!==`Waiting`,{onFalse:()=>(0,Q.jsx)(La,{account:e}),onTrue:Xa})}function Xa(){return null}function Za(){return oe(mt)&&!Cn&&(0,Q.jsx)(za,{})}function Qa(){return null}function $a(e){return e.role===`Admin`}function eo(e){return(0,Q.jsx)(Ra,{account:e})}function to(){return!1}function no(){let e=(0,$.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(xa,{icon:Ea,name:`auth`,account:!1}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsxs)(Q.Fragment,{children:[t,(0,Q.jsx)(`main`,{className:`pb-safe flex min-h-0 flex-1 justify-center overflow-y-auto px-4 pt-8 md:pt-16`,children:(0,Q.jsxs)(`div`,{className:`flex w-full max-w-xl flex-col gap-6 self-start`,children:[(0,Q.jsx)(xn,{className:`h-7 w-48`}),(0,Q.jsx)(Ce,{label:`Apps`,media:!0,rows:Lt.length})]})})]}),children:(0,Q.jsx)(Ja,{})}),e[1]=n):n=e[1],n}export{no as component};