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