@deslop/auth 0.1.1248 → 0.1.1249

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.
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{a as t,n,o as r}from"./react-COyt-gOi.js";import{$t as i,C as a,G as o,K as s,Q as c,S as l,St as u,W as d,X as f,Y as p,c as m,ct as h,et as g,g as _,mt as v,nn as y,nt as b,o as x,rt as S,t as C,tt as w,yt as T}from"./components-BY_sC06M.js";import{B as E,Ca as D,Fa as O,Oa as k,Za as A,eo as j,oa as M,wa as N}from"./effect-CKR-Y9J0.js";import{n as P}from"./index-DzL4Am0X.js";import{a as F,c as ee,i as te,n as ne,r as re,s as ie,t as I}from"./dialog-C7fAOB6e.js";import{$t as L,C as R,Gt as z,Ht as ae,Jt as B,S as oe,T as se,Xt as V,bt as H,kt as U,on as W,qt as G,s as ce,xt as K,z as le}from"./toast-BKQ798Jo.js";var q=e(r(),1),J=t();function ue(e){let[t,n]=q.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=q.useRef(null),i=q.useRef(null),a=q.useRef(null),s=q.useRef(null),c=q.useRef(!0),l=q.useRef(null),u=se(),d=q.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:s,allowMouseUpTriggerRef:c,initialCursorPointRef:l,rootId:u}),[t,u]);return(0,J.jsx)(g.Provider,{value:d,children:(0,J.jsx)(b.Provider,{value:void 0,children:(0,J.jsx)(o,{...e})})})}var Y=500,de=q.forwardRef(function(e,t){let{render:n,className:r,style:a,...o}=e,{setAnchor:s,actionsRef:c,internalBackdropRef:l,backdropRef:u,positionerRef:f,allowMouseUpTriggerRef:p,initialCursorPointRef:m,rootId:h}=w(!1),{store:g}=S(!1),_=g.useState(`open`),v=g.useState(`disabled`),b=q.useRef(null),x=q.useRef(null),C=U(),T=U(),E=q.useRef(!1),D=q.useRef(null);function O(e,t,n){let r=n.type.startsWith(`touch`);m.current={x:e,y:t},s({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),E.current=!1,c.current?.setOpen(!0,R(oe,n)),T.start(Y,()=>{E.current=!0})}function k(e){if(v)return;p.current=!0,i(e),O(e.clientX,e.clientY,e.nativeEvent);let t=W(b.current);D.current?.abort();let n=new AbortController;D.current=n,t.addEventListener(`mouseup`,e=>{if(p.current=!1,!E.current)return;T.clear(),E.current=!1;let t=K(e);H(f.current,t)||h&&t&&d(t)===h||c.current?.setOpen(!1,R(ce,e))},{once:!0,signal:n.signal})}function A(){C.clear(),x.current=null}function j(e){if(v||(p.current=!1,e.touches.length!==1)){A();return}e.stopPropagation();let t=e.touches[0],n={x:t.clientX,y:t.clientY};x.current=n,C.start(Y,()=>{O(n.x,n.y,e.nativeEvent)})}function M(e){if(e.touches.length!==1)A();else if(C.isStarted()&&x.current){let t=e.touches[0],n=Math.abs(t.clientX-x.current.x),r=Math.abs(t.clientY-x.current.y);(n>10||r>10)&&A()}}return q.useEffect(()=>()=>{D.current?.abort()},[]),q.useEffect(()=>{function e(e){if(v)return;let t=K(e);(H(b.current,t)||H(l.current,t)||H(u.current,t))&&e.preventDefault()}let t=W(b.current);return le(t,`contextmenu`,e)},[u,v,l]),L(`div`,e,{state:{open:_},ref:[b,t],props:[{onContextMenu:k,onTouchStart:j,onTouchMove:M,onTouchEnd:A,onTouchCancel:A,style:{WebkitTouchCallout:`none`}},o],stateAttributesMapping:y})}),fe=s,X=n();function pe(e){let t=(0,X.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,J.jsx)(ue,{"data-slot":`context-menu`,...n}),t[2]=n,t[3]=r),r}function me(e){let t=(0,X.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=V(`select-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,J.jsx)(de,{"data-slot":`context-menu-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function he(e){let t=(0,X.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]):({className:n,align:i,alignOffset:a,side:o,sideOffset:s,...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?4:a,u=o===void 0?`right`:o,d=s===void 0?0:s,m;t[7]===n?m=t[8]:(m=V(`z-50 max-h-(--available-height) 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:fade-out-0 data-closed:zoom-out-95`,n),t[7]=n,t[8]=m);let h;t[9]!==r||t[10]!==m?(h=(0,J.jsx)(f,{"data-slot":`context-menu-content`,className:m,...r}),t[9]=r,t[10]=m,t[11]=h):h=t[11];let g;return t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==d||t[16]!==h?(g=(0,J.jsx)(p,{children:(0,J.jsx)(fe,{className:`isolate z-50 outline-none`,align:c,alignOffset:l,side:u,sideOffset:d,children:h})}),t[12]=c,t[13]=l,t[14]=u,t[15]=d,t[16]=h,t[17]=g):g=t[17],g}function ge(e){let t=(0,X.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=V(`group/context-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 l;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(l=(0,J.jsx)(c,{"data-slot":`context-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]=l):l=t[11],l}function Z(e){let t=(0,X.c)(11),n;t[0]!==e.person.id||t[1]!==e.person.name?(n=(0,J.jsx)(C,{id:e.person.id,name:e.person.name}),t[0]=e.person.id,t[1]=e.person.name,t[2]=n):n=t[2];let r=e.person.fullName??e.person.name,i;t[3]===r?i=t[4]:(i=(0,J.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:r}),t[3]=r,t[4]=i);let a=e.person.fullName!==void 0&&`@${e.person.name}`,o;t[5]===a?o=t[6]:(o=(0,J.jsx)(`span`,{className:`text-muted-foreground min-w-0 flex-1 truncate font-mono text-xs`,children:a}),t[5]=a,t[6]=o);let s;return t[7]!==n||t[8]!==i||t[9]!==o?(s=(0,J.jsxs)(J.Fragment,{children:[n,i,o]}),t[7]=n,t[8]=i,t[9]=o,t[10]=s):s=t[10],s}function Q(e){let t=(0,X.c)(9),n=`person-${e.person.id}`,r;t[0]===e.person?r=t[1]:(r=(0,J.jsx)(Z,{person:e.person}),t[0]=e.person,t[1]=r);let i;t[2]!==e.children||t[3]!==r?(i=(0,J.jsxs)(`div`,{className:`flex h-8 min-w-0 items-center gap-3 px-1 text-sm max-sm:h-11`,children:[r,e.children]}),t[2]=e.children,t[3]=r,t[4]=i):i=t[4];let a;return t[5]!==e.failure||t[6]!==n||t[7]!==i?(a=(0,J.jsxs)(`div`,{role:`listitem`,id:n,className:`border-b`,children:[i,e.failure]}),t[5]=e.failure,t[6]=n,t[7]=i,t[8]=a):a=t[8],a}function $(e){let t=(0,X.c)(28),n;t[0]===e.person.id?n=t[1]:(n=m(e.person.id),t[0]=e.person.id,t[1]=n);let[r,i]=T(n),a=e.person,o;t[2]===r?o=t[3]:(o=(0,J.jsx)(h,{result:r,className:`mr-1 mb-2 ml-10 wrap-anywhere`}),t[2]=r,t[3]=o);let s;t[4]===e.person.since?s=t[5]:(s=_(e.person.since),t[4]=e.person.since,t[5]=s);let c;t[6]===s?c=t[7]:(c=(0,J.jsx)(`span`,{className:`text-muted-foreground shrink-0 font-mono text-xs max-sm:hidden`,children:s}),t[6]=s,t[7]=c);let l;t[8]===r?l=t[9]:(l=E(r),t[8]=r,t[9]=l);let u;t[10]===i?u=t[11]:(u=()=>i(!0),t[10]=i,t[11]=u);let d;t[12]!==l||t[13]!==u?(d=(0,J.jsx)(B,{size:`sm`,className:`shrink-0 max-sm:h-11`,disabled:l,onClick:u,children:`Allow`}),t[12]=l,t[13]=u,t[14]=d):d=t[14];let f;t[15]===r?f=t[16]:(f=E(r),t[15]=r,t[16]=f);let p;t[17]===i?p=t[18]:(p=()=>i(!1),t[17]=i,t[18]=p);let g;t[19]!==f||t[20]!==p?(g=(0,J.jsx)(B,{size:`sm`,variant:`outline`,className:`shrink-0 max-sm:h-11`,disabled:f,onClick:p,children:`Decline`}),t[19]=f,t[20]=p,t[21]=g):g=t[21];let v;return t[22]!==e.person||t[23]!==g||t[24]!==o||t[25]!==c||t[26]!==d?(v=(0,J.jsxs)(Q,{person:a,failure:o,children:[c,d,g]}),t[22]=e.person,t[23]=g,t[24]=o,t[25]=c,t[26]=d,t[27]=v):v=t[27],v}function _e(e){let t=(0,X.c)(60),n;t[0]===e.person.id?n=t[1]:(n=a(e.person.id),t[0]=e.person.id,t[1]=n);let[r,i]=T(n),[o,s]=(0,q.useState)(!1);if(e.person.role===`Admin`){let n;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,J.jsx)(ee,{variant:`outline`,className:`shrink-0`,children:`admin`}),t[2]=n):n=t[2];let r;return t[3]===e.person?r=t[4]:(r=(0,J.jsx)(Q,{person:e.person,children:n}),t[3]=e.person,t[4]=r),r}let c=e.person.fullName??e.person.name,l=`person-${e.person.id}`,u;t[5]===e.person.since?u=t[6]:(u=_(e.person.since),t[5]=e.person.since,t[6]=u);let d=`${c}, member since ${u}`,f;t[7]===d?f=t[8]:(f=(0,J.jsx)(`div`,{role:`button`,tabIndex:0,"aria-haspopup":`menu`,"aria-label":d,className:`hover:bg-muted/50 flex h-8 min-w-0 items-center gap-3 px-1 text-sm max-sm:h-11`}),t[7]=d,t[8]=f);let p;t[9]===e.person?p=t[10]:(p=(0,J.jsx)(Z,{person:e.person}),t[9]=e.person,t[10]=p);let m;t[11]===e.person.since?m=t[12]:(m=_(e.person.since),t[11]=e.person.since,t[12]=m);let g;t[13]===m?g=t[14]:(g=(0,J.jsx)(`span`,{className:`text-muted-foreground shrink-0 font-mono text-xs`,children:m}),t[13]=m,t[14]=g);let v;t[15]!==f||t[16]!==p||t[17]!==g?(v=(0,J.jsxs)(me,{render:f,children:[p,g]}),t[15]=f,t[16]=p,t[17]=g,t[18]=v):v=t[18];let y;t[19]===r?y=t[20]:(y=(0,J.jsx)(h,{result:r,className:`mr-1 mb-2 ml-10 wrap-anywhere`}),t[19]=r,t[20]=y);let b;t[21]!==l||t[22]!==v||t[23]!==y?(b=(0,J.jsxs)(`div`,{role:`listitem`,id:l,className:`border-b`,children:[v,y]}),t[21]=l,t[22]=v,t[23]=y,t[24]=b):b=t[24];let x;t[25]===r?x=t[26]:(x=E(r),t[25]=r,t[26]=x);let S;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>s(!0),t[27]=S):S=t[27];let C;t[28]===x?C=t[29]:(C=(0,J.jsx)(he,{className:`w-auto min-w-36`,children:(0,J.jsx)(ge,{variant:`destructive`,disabled:x,onClick:S,children:`Remove`})}),t[28]=x,t[29]=C);let w;t[30]===c?w=t[31]:(w=(0,J.jsxs)(ie,{children:[`Remove `,c,`?`]}),t[30]=c,t[31]=w);let D;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,J.jsx)(te,{children:`They will no longer be able to sign in to any Deslop app, and their sign-ins end.`}),t[32]=D):D=t[32];let O;t[33]===r?O=t[34]:(O=(0,J.jsx)(h,{result:r}),t[33]=r,t[34]=O);let k;t[35]===r?k=t[36]:(k=E(r),t[35]=r,t[36]=k);let A;t[37]===k?A=t[38]:(A=(0,J.jsx)(ne,{render:(0,J.jsx)(B,{variant:`ghost`,disabled:k}),children:`Cancel`}),t[37]=k,t[38]=A);let j;t[39]===r?j=t[40]:(j=E(r),t[39]=r,t[40]=j);let M;t[41]===i?M=t[42]:(M=()=>i(),t[41]=i,t[42]=M);let N;t[43]!==j||t[44]!==M?(N=(0,J.jsx)(B,{variant:`destructive`,disabled:j,onClick:M,children:`Remove`}),t[43]=j,t[44]=M,t[45]=N):N=t[45];let P;t[46]!==A||t[47]!==N?(P=(0,J.jsxs)(F,{children:[A,N]}),t[46]=A,t[47]=N,t[48]=P):P=t[48];let L;t[49]!==w||t[50]!==O||t[51]!==P?(L=(0,J.jsxs)(re,{children:[w,D,O,P]}),t[49]=w,t[50]=O,t[51]=P,t[52]=L):L=t[52];let R;t[53]!==o||t[54]!==L?(R=(0,J.jsx)(I,{open:o,onOpenChange:s,children:L}),t[53]=o,t[54]=L,t[55]=R):R=t[55];let z;return t[56]!==b||t[57]!==C||t[58]!==R?(z=(0,J.jsxs)(pe,{children:[b,C,R]}),t[56]=b,t[57]=C,t[58]=R,t[59]=z):z=t[59],z}function ve(){return N(k(u(l).value,j(A,Se)),{onEmpty:xe,onNonEmpty:ye})}function ye(e){return(0,J.jsx)(`div`,{role:`list`,"aria-label":`People`,children:D(e,be)})}function be(e){return M(e.role===`Waiting`,{onFalse:()=>(0,J.jsx)(_e,{person:e},e.id),onTrue:()=>(0,J.jsx)($,{person:e},e.id)})}function xe(){return(0,J.jsx)(ae,{children:(0,J.jsx)(z,{children:(0,J.jsx)(G,{children:`No one yet`})})})}function Se(e){return e.role!==`Waiting`}function Ce(){let e=(0,X.c)(2);if(!O(u(x).value,we)){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(P,{to:`/`}),e[0]=t):t=e[0],t}let t;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(v,{label:`People`,media:!0,rows:3}),children:(0,J.jsx)(ve,{})}),e[1]=t):t=e[1],t}function we(e){return e.role===`Admin`}export{Ce as component};