@vibecodeapp/cloud-studio 0.1.3 → 0.1.4
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.
|
@@ -167,4 +167,4 @@ Error generating stack: `+s.message+`
|
|
|
167
167
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
168
168
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
169
169
|
`)},oE=0,Jr=[];function sE(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(oE++)[0],s=m.useState(Ev)[0],i=m.useRef(e);m.useEffect(function(){i.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=PC([e.lockRef.current],(e.shards||[]).map(Mp),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(g,b){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var p=_i(g),f=n.current,v="deltaX"in g?g.deltaX:f[0]-p[0],S="deltaY"in g?g.deltaY:f[1]-p[1],E,k=g.target,P=Math.abs(v)>Math.abs(S)?"h":"v";if("touches"in g&&P==="h"&&k.type==="range")return!1;var R=window.getSelection(),O=R&&R.anchorNode,T=O?O===k||O.contains(k):!1;if(T)return!1;var D=Ap(P,k);if(!D)return!0;if(D?E=P:(E=P==="v"?"h":"v",D=Ap(P,k)),!D)return!1;if(!r.current&&"changedTouches"in g&&(v||S)&&(r.current=E),!E)return!0;var A=r.current||E;return tE(A,b,g,A==="h"?v:S)},[]),a=m.useCallback(function(g){var b=g;if(!(!Jr.length||Jr[Jr.length-1]!==s)){var p="deltaY"in b?jp(b):_i(b),f=t.current.filter(function(E){return E.name===b.type&&(E.target===b.target||b.target===E.shadowParent)&&nE(E.delta,p)})[0];if(f&&f.should){b.cancelable&&b.preventDefault();return}if(!f){var v=(i.current.shards||[]).map(Mp).filter(Boolean).filter(function(E){return E.contains(b.target)}),S=v.length>0?l(b,v[0]):!i.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),u=m.useCallback(function(g,b,p,f){var v={name:g,delta:b,target:p,should:f,shadowParent:iE(p)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(S){return S!==v})},1)},[]),d=m.useCallback(function(g){n.current=_i(g),r.current=void 0},[]),c=m.useCallback(function(g){u(g.type,jp(g),g.target,l(g,e.lockRef.current))},[]),h=m.useCallback(function(g){u(g.type,_i(g),g.target,l(g,e.lockRef.current))},[]);m.useEffect(function(){return Jr.push(s),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:h}),document.addEventListener("wheel",a,Zr),document.addEventListener("touchmove",a,Zr),document.addEventListener("touchstart",d,Zr),function(){Jr=Jr.filter(function(g){return g!==s}),document.removeEventListener("wheel",a,Zr),document.removeEventListener("touchmove",a,Zr),document.removeEventListener("touchstart",d,Zr)}},[]);var y=e.removeScrollBar,x=e.inert;return m.createElement(m.Fragment,null,x?m.createElement(s,{styles:rE(o)}):null,y?m.createElement(YC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function iE(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lE=IC(Cv,sE);var Pd=m.forwardRef(function(e,t){return m.createElement(ea,en({},e,{ref:t,sideCar:lE}))});Pd.classNames=ea.classNames;var aE=[" ","Enter","ArrowUp","ArrowDown"],uE=[" ","Enter"],Vr="Select",[ta,na,cE]=vS(Vr),[Xo]=Kl(Vr,[cE,Jl]),ra=Jl(),[dE,dr]=Xo(Vr),[fE,pE]=Xo(Vr),Rv=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:l,onValueChange:a,dir:u,name:d,autoComplete:c,disabled:h,required:y,form:x}=e,g=ra(t),[b,p]=m.useState(null),[f,v]=m.useState(null),[S,E]=m.useState(!1),k=wS(u),[P,R]=oc({prop:r,defaultProp:o??!1,onChange:s,caller:Vr}),[O,T]=oc({prop:i,defaultProp:l,onChange:a,caller:Vr}),D=m.useRef(null),A=b?x||!!b.closest("form"):!0,[B,V]=m.useState(new Set),J=Array.from(B).map(I=>I.props.value).join(";");return w.jsx(mv,{...g,children:w.jsxs(dE,{required:y,scope:t,trigger:b,onTriggerChange:p,valueNode:f,onValueNodeChange:v,valueNodeHasChildren:S,onValueNodeHasChildrenChange:E,contentId:Yl(),value:O,onValueChange:T,open:P,onOpenChange:R,dir:k,triggerPointerDownPosRef:D,disabled:h,children:[w.jsx(ta.Provider,{scope:t,children:w.jsx(fE,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(I=>{V(U=>new Set(U).add(I))},[]),onNativeOptionRemove:m.useCallback(I=>{V(U=>{const N=new Set(U);return N.delete(I),N})},[]),children:n})}),A?w.jsxs(Kv,{"aria-hidden":!0,required:y,tabIndex:-1,name:d,autoComplete:c,value:O,onChange:I=>T(I.target.value),disabled:h,form:x,children:[O===void 0?w.jsx("option",{value:""}):null,Array.from(B)]},J):null]})})};Rv.displayName=Vr;var Tv="SelectTrigger",Ov=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=ra(n),i=dr(Tv,n),l=i.disabled||r,a=Ne(t,i.onTriggerChange),u=na(n),d=m.useRef("touch"),[c,h,y]=qv(g=>{const b=u().filter(v=>!v.disabled),p=b.find(v=>v.value===i.value),f=Gv(b,g,p);f!==void 0&&i.onValueChange(f.value)}),x=g=>{l||(i.onOpenChange(!0),y()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return w.jsx(Ed,{asChild:!0,...s,children:w.jsx(be.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Yv(i.value)?"":void 0,...o,ref:a,onClick:ge(o.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&x(g)}),onPointerDown:ge(o.onPointerDown,g=>{d.current=g.pointerType;const b=g.target;b.hasPointerCapture(g.pointerId)&&b.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(x(g),g.preventDefault())}),onKeyDown:ge(o.onKeyDown,g=>{const b=c.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&h(g.key),!(b&&g.key===" ")&&aE.includes(g.key)&&(x(),g.preventDefault())})})})});Ov.displayName=Tv;var _v="SelectValue",Av=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...l}=e,a=dr(_v,n),{onValueNodeHasChildrenChange:u}=a,d=s!==void 0,c=Ne(t,a.onValueNodeChange);return Ke(()=>{u(d)},[u,d]),w.jsx(be.span,{...l,ref:c,style:{pointerEvents:"none"},children:Yv(a.value)?w.jsx(w.Fragment,{children:i}):s})});Av.displayName=_v;var hE="SelectIcon",mE=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return w.jsx(be.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});mE.displayName=hE;var gE="SelectPortal",jv=e=>w.jsx(kd,{asChild:!0,...e});jv.displayName=gE;var $r="SelectContent",Mv=m.forwardRef((e,t)=>{const n=dr($r,e.__scopeSelect),[r,o]=m.useState();if(Ke(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Qo.createPortal(w.jsx(Iv,{scope:e.__scopeSelect,children:w.jsx(ta.Slot,{scope:e.__scopeSelect,children:w.jsx("div",{children:e.children})})}),s):null}return w.jsx(Dv,{...e,ref:t})});Mv.displayName=$r;var It=10,[Iv,fr]=Xo($r),vE="SelectContentImpl",yE=dC("SelectContent.RemoveScroll"),Dv=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:l,sideOffset:a,align:u,alignOffset:d,arrowPadding:c,collisionBoundary:h,collisionPadding:y,sticky:x,hideWhenDetached:g,avoidCollisions:b,...p}=e,f=dr($r,n),[v,S]=m.useState(null),[E,k]=m.useState(null),P=Ne(t,$=>S($)),[R,O]=m.useState(null),[T,D]=m.useState(null),A=na(n),[B,V]=m.useState(!1),J=m.useRef(!1);m.useEffect(()=>{if(v)return xv(v)},[v]),Qg();const I=m.useCallback($=>{const[W,...pe]=A().map(ee=>ee.ref.current),[se]=pe.slice(-1),re=document.activeElement;for(const ee of $)if(ee===re||(ee==null||ee.scrollIntoView({block:"nearest"}),ee===W&&E&&(E.scrollTop=0),ee===se&&E&&(E.scrollTop=E.scrollHeight),ee==null||ee.focus(),document.activeElement!==re))return},[A,E]),U=m.useCallback(()=>I([R,v]),[I,R,v]);m.useEffect(()=>{B&&U()},[B,U]);const{onOpenChange:N,triggerPointerDownPosRef:M}=f;m.useEffect(()=>{if(v){let $={x:0,y:0};const W=se=>{var re,ee;$={x:Math.abs(Math.round(se.pageX)-(((re=M.current)==null?void 0:re.x)??0)),y:Math.abs(Math.round(se.pageY)-(((ee=M.current)==null?void 0:ee.y)??0))}},pe=se=>{$.x<=10&&$.y<=10?se.preventDefault():v.contains(se.target)||N(!1),document.removeEventListener("pointermove",W),M.current=null};return M.current!==null&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",pe,{capture:!0})}}},[v,N,M]),m.useEffect(()=>{const $=()=>N(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[N]);const[L,Q]=qv($=>{const W=A().filter(re=>!re.disabled),pe=W.find(re=>re.ref.current===document.activeElement),se=Gv(W,$,pe);se&&setTimeout(()=>se.ref.current.focus())}),ae=m.useCallback(($,W,pe)=>{const se=!J.current&&!pe;(f.value!==void 0&&f.value===W||se)&&(O($),se&&(J.current=!0))},[f.value]),K=m.useCallback(()=>v==null?void 0:v.focus(),[v]),X=m.useCallback(($,W,pe)=>{const se=!J.current&&!pe;(f.value!==void 0&&f.value===W||se)&&D($)},[f.value]),ne=r==="popper"?ic:Fv,ue=ne===ic?{side:l,sideOffset:a,align:u,alignOffset:d,arrowPadding:c,collisionBoundary:h,collisionPadding:y,sticky:x,hideWhenDetached:g,avoidCollisions:b}:{};return w.jsx(Iv,{scope:n,content:v,viewport:E,onViewportChange:k,itemRefCallback:ae,selectedItem:R,onItemLeave:K,itemTextRefCallback:X,focusSelectedItem:U,selectedItemText:T,position:r,isPositioned:B,searchRef:L,children:w.jsx(Pd,{as:yE,allowPinchZoom:!0,children:w.jsx(md,{asChild:!0,trapped:f.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:ge(o,$=>{var W;(W=f.trigger)==null||W.focus({preventScroll:!0}),$.preventDefault()}),children:w.jsx(hd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>f.onOpenChange(!1),children:w.jsx(ne,{role:"listbox",id:f.contentId,"data-state":f.open?"open":"closed",dir:f.dir,onContextMenu:$=>$.preventDefault(),...p,...ue,onPlaced:()=>V(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...p.style},onKeyDown:ge(p.onKeyDown,$=>{const W=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!W&&$.key.length===1&&Q($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let se=A().filter(re=>!re.disabled).map(re=>re.ref.current);if(["ArrowUp","End"].includes($.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const re=$.target,ee=se.indexOf(re);se=se.slice(ee+1)}setTimeout(()=>I(se)),$.preventDefault()}})})})})})})});Dv.displayName=vE;var wE="SelectItemAlignedPosition",Fv=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=dr($r,n),i=fr($r,n),[l,a]=m.useState(null),[u,d]=m.useState(null),c=Ne(t,P=>d(P)),h=na(n),y=m.useRef(!1),x=m.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:p,focusSelectedItem:f}=i,v=m.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&u&&g&&b&&p){const P=s.trigger.getBoundingClientRect(),R=u.getBoundingClientRect(),O=s.valueNode.getBoundingClientRect(),T=p.getBoundingClientRect();if(s.dir!=="rtl"){const re=T.left-R.left,ee=O.left-re,_e=P.left-ee,De=P.width+_e,Qt=Math.max(De,R.width),_t=window.innerWidth-It,nt=up(ee,[It,Math.max(It,_t-Qt)]);l.style.minWidth=De+"px",l.style.left=nt+"px"}else{const re=R.right-T.right,ee=window.innerWidth-O.right-re,_e=window.innerWidth-P.right-ee,De=P.width+_e,Qt=Math.max(De,R.width),_t=window.innerWidth-It,nt=up(ee,[It,Math.max(It,_t-Qt)]);l.style.minWidth=De+"px",l.style.right=nt+"px"}const D=h(),A=window.innerHeight-It*2,B=g.scrollHeight,V=window.getComputedStyle(u),J=parseInt(V.borderTopWidth,10),I=parseInt(V.paddingTop,10),U=parseInt(V.borderBottomWidth,10),N=parseInt(V.paddingBottom,10),M=J+I+B+N+U,L=Math.min(b.offsetHeight*5,M),Q=window.getComputedStyle(g),ae=parseInt(Q.paddingTop,10),K=parseInt(Q.paddingBottom,10),X=P.top+P.height/2-It,ne=A-X,ue=b.offsetHeight/2,$=b.offsetTop+ue,W=J+I+$,pe=M-W;if(W<=X){const re=D.length>0&&b===D[D.length-1].ref.current;l.style.bottom="0px";const ee=u.clientHeight-g.offsetTop-g.offsetHeight,_e=Math.max(ne,ue+(re?K:0)+ee+U),De=W+_e;l.style.height=De+"px"}else{const re=D.length>0&&b===D[0].ref.current;l.style.top="0px";const _e=Math.max(X,J+g.offsetTop+(re?ae:0)+ue)+pe;l.style.height=_e+"px",g.scrollTop=W-X+g.offsetTop}l.style.margin=`${It}px 0`,l.style.minHeight=L+"px",l.style.maxHeight=A+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[h,s.trigger,s.valueNode,l,u,g,b,p,s.dir,r]);Ke(()=>v(),[v]);const[S,E]=m.useState();Ke(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const k=m.useCallback(P=>{P&&x.current===!0&&(v(),f==null||f(),x.current=!1)},[v,f]);return w.jsx(SE,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:k,children:w.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:w.jsx(be.div,{...o,ref:c,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Fv.displayName=wE;var xE="SelectPopperPosition",ic=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=It,...s}=e,i=ra(n);return w.jsx(gv,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ic.displayName=xE;var[SE,Nd]=Xo($r,{}),lc="SelectViewport",Lv=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=fr(lc,n),i=Nd(lc,n),l=Ne(t,s.onViewportChange),a=m.useRef(0);return w.jsxs(w.Fragment,{children:[w.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),w.jsx(ta.Slot,{scope:n,children:w.jsx(be.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ge(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&c){const y=Math.abs(a.current-d.scrollTop);if(y>0){const x=window.innerHeight-It*2,g=parseFloat(c.style.minHeight),b=parseFloat(c.style.height),p=Math.max(g,b);if(p<x){const f=p+y,v=Math.min(x,f),S=f-v;c.style.height=v+"px",c.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,c.style.justifyContent="flex-end")}}}a.current=d.scrollTop})})})]})});Lv.displayName=lc;var zv="SelectGroup",[bE,CE]=Xo(zv),EE=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Yl();return w.jsx(bE,{scope:n,id:o,children:w.jsx(be.div,{role:"group","aria-labelledby":o,...r,ref:t})})});EE.displayName=zv;var Bv="SelectLabel",kE=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=CE(Bv,n);return w.jsx(be.div,{id:o.id,...r,ref:t})});kE.displayName=Bv;var Nl="SelectItem",[PE,Uv]=Xo(Nl),Vv=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,l=dr(Nl,n),a=fr(Nl,n),u=l.value===r,[d,c]=m.useState(s??""),[h,y]=m.useState(!1),x=Ne(t,f=>{var v;return(v=a.itemRefCallback)==null?void 0:v.call(a,f,r,o)}),g=Yl(),b=m.useRef("touch"),p=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return w.jsx(PE,{scope:n,value:r,disabled:o,textId:g,isSelected:u,onItemTextChange:m.useCallback(f=>{c(v=>v||((f==null?void 0:f.textContent)??"").trim())},[]),children:w.jsx(ta.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:w.jsx(be.div,{role:"option","aria-labelledby":g,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:x,onFocus:ge(i.onFocus,()=>y(!0)),onBlur:ge(i.onBlur,()=>y(!1)),onClick:ge(i.onClick,()=>{b.current!=="mouse"&&p()}),onPointerUp:ge(i.onPointerUp,()=>{b.current==="mouse"&&p()}),onPointerDown:ge(i.onPointerDown,f=>{b.current=f.pointerType}),onPointerMove:ge(i.onPointerMove,f=>{var v;b.current=f.pointerType,o?(v=a.onItemLeave)==null||v.call(a):b.current==="mouse"&&f.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ge(i.onPointerLeave,f=>{var v;f.currentTarget===document.activeElement&&((v=a.onItemLeave)==null||v.call(a))}),onKeyDown:ge(i.onKeyDown,f=>{var S;((S=a.searchRef)==null?void 0:S.current)!==""&&f.key===" "||(uE.includes(f.key)&&p(),f.key===" "&&f.preventDefault())})})})})});Vv.displayName=Nl;var ps="SelectItemText",$v=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=dr(ps,n),l=fr(ps,n),a=Uv(ps,n),u=pE(ps,n),[d,c]=m.useState(null),h=Ne(t,p=>c(p),a.onItemTextChange,p=>{var f;return(f=l.itemTextRefCallback)==null?void 0:f.call(l,p,a.value,a.disabled)}),y=d==null?void 0:d.textContent,x=m.useMemo(()=>w.jsx("option",{value:a.value,disabled:a.disabled,children:y},a.value),[a.disabled,a.value,y]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=u;return Ke(()=>(g(x),()=>b(x)),[g,b,x]),w.jsxs(w.Fragment,{children:[w.jsx(be.span,{id:a.textId,...s,ref:h}),a.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Qo.createPortal(s.children,i.valueNode):null]})});$v.displayName=ps;var Hv="SelectItemIndicator",Wv=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Uv(Hv,n).isSelected?w.jsx(be.span,{"aria-hidden":!0,...r,ref:t}):null});Wv.displayName=Hv;var ac="SelectScrollUpButton",NE=m.forwardRef((e,t)=>{const n=fr(ac,e.__scopeSelect),r=Nd(ac,e.__scopeSelect),[o,s]=m.useState(!1),i=Ne(t,r.onScrollButtonChange);return Ke(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=a.scrollTop>0;s(u)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?w.jsx(Qv,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=n;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});NE.displayName=ac;var uc="SelectScrollDownButton",RE=m.forwardRef((e,t)=>{const n=fr(uc,e.__scopeSelect),r=Nd(uc,e.__scopeSelect),[o,s]=m.useState(!1),i=Ne(t,r.onScrollButtonChange);return Ke(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)<u;s(d)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?w.jsx(Qv,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=n;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});RE.displayName=uc;var Qv=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=fr("SelectScrollButton",n),i=m.useRef(null),l=na(n),a=m.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return m.useEffect(()=>()=>a(),[a]),Ke(()=>{var d;const u=l().find(c=>c.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),w.jsx(be.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ge(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:ge(o.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:ge(o.onPointerLeave,()=>{a()})})}),TE="SelectSeparator",OE=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return w.jsx(be.div,{"aria-hidden":!0,...r,ref:t})});OE.displayName=TE;var cc="SelectArrow",_E=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ra(n),s=dr(cc,n),i=fr(cc,n);return s.open&&i.position==="popper"?w.jsx(vv,{...o,...r,ref:t}):null});_E.displayName=cc;var AE="SelectBubbleInput",Kv=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=m.useRef(null),s=Ne(r,o),i=xC(t);return m.useEffect(()=>{const l=o.current;if(!l)return;const a=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(a,"value").set;if(i!==t&&d){const c=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(c)}},[i,t]),w.jsx(be.select,{...n,style:{...yv,...n.style},ref:s,defaultValue:t})});Kv.displayName=AE;function Yv(e){return e===""||e===void 0}function qv(e){const t=Br(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(i=>{const l=n.current+i;t(l),function a(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(l)},[t]),s=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Gv(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=jE(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const a=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return a!==n?a:void 0}function jE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Xv=Rv,Zv=Ov,ME=Av,Jv=jv,ey=Mv,ty=Lv,ny=Vv,ry=$v,oy=Wv;function Rl({value:e,placeholder:t,options:n,onChange:r,mono:o=!1,disabled:s=!1}){const i=n.find(l=>l.value===e);return w.jsxs(Xv,{value:e||void 0,onValueChange:r,disabled:s,children:[w.jsx(Zv,{asChild:!0,children:w.jsx(Wl,{mono:o,placeholder:!i,icon:"chevron-down",children:w.jsx(ME,{placeholder:t})})}),w.jsx(Jv,{children:w.jsx(ey,{className:ie("bg-background rounded-xl shadow-lg border border-border-tertiary","overflow-hidden z-50 min-w-[160px]"),position:"popper",sideOffset:4,children:w.jsx(ty,{className:"p-1",children:n.map(l=>w.jsxs(ny,{value:l.value,className:ie("relative flex items-center justify-between","px-3 py-1.5 rounded-lg cursor-pointer outline-none","text-sm font-medium text-text-primary","data-[highlighted]:bg-bg-secondary",o&&"font-mono text-xs"),children:[w.jsx(ry,{children:l.label}),w.jsx(oy,{children:w.jsx(Sl,{className:"w-4 h-4 text-icon-primary"})})]},l.value))})})})]})}function IE(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Rd=e=>{const{present:t,children:n}=e,r=DE(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),s=Ne(r.ref,FE(o));return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:s}):null};Rd.displayName="Presence";function DE(e){const[t,n]=m.useState(),r=m.useRef(null),o=m.useRef(e),s=m.useRef("none"),i=e?"mounted":"unmounted",[l,a]=IE(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=Ai(r.current);s.current=l==="mounted"?u:"none"},[l]),Ke(()=>{const u=r.current,d=o.current;if(d!==e){const h=s.current,y=Ai(u);e?a("MOUNT"):y==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(d&&h!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,a]),Ke(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,c=y=>{const g=Ai(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&g&&(a("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=y=>{y.target===t&&(s.current=Ai(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:m.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Ai(e){return(e==null?void 0:e.animationName)||"none"}function FE(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function LE(e){const t=zE(e),n=m.forwardRef((r,o)=>{const{children:s,...i}=r,l=m.Children.toArray(s),a=l.find(UE);if(a){const u=a.props.children,d=l.map(c=>c===a?m.Children.count(u)>1?m.Children.only(null):m.isValidElement(u)?u.props.children:null:c);return w.jsx(t,{...i,ref:o,children:m.isValidElement(u)?m.cloneElement(u,void 0,d):null})}return w.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function zE(e){const t=m.forwardRef((n,r)=>{const{children:o,...s}=n;if(m.isValidElement(o)){const i=$E(o),l=VE(s,o.props);return o.type!==m.Fragment&&(l.ref=r?ti(r,i):i),m.cloneElement(o,l)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var BE=Symbol("radix.slottable");function UE(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===BE}function VE(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const a=s(...l);return o(...l),a}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function $E(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var oa="Popover",[sy]=Kl(oa,[Jl]),ri=Jl(),[HE,pr]=sy(oa),iy=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,l=ri(t),a=m.useRef(null),[u,d]=m.useState(!1),[c,h]=oc({prop:r,defaultProp:o??!1,onChange:s,caller:oa});return w.jsx(mv,{...l,children:w.jsx(HE,{scope:t,contentId:Yl(),triggerRef:a,open:c,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(y=>!y),[h]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:i,children:n})})};iy.displayName=oa;var ly="PopoverAnchor",WE=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=pr(ly,n),s=ri(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=o;return m.useEffect(()=>(i(),()=>l()),[i,l]),w.jsx(Ed,{...s,...r,ref:t})});WE.displayName=ly;var ay="PopoverTrigger",uy=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=pr(ay,n),s=ri(n),i=Ne(t,o.triggerRef),l=w.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":hy(o.open),...r,ref:i,onClick:ge(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:w.jsx(Ed,{asChild:!0,...s,children:l})});uy.displayName=ay;var Td="PopoverPortal",[QE,KE]=sy(Td,{forceMount:void 0}),cy=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=pr(Td,t);return w.jsx(QE,{scope:t,forceMount:n,children:w.jsx(Rd,{present:n||s.open,children:w.jsx(kd,{asChild:!0,container:o,children:r})})})};cy.displayName=Td;var Vo="PopoverContent",dy=m.forwardRef((e,t)=>{const n=KE(Vo,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=pr(Vo,e.__scopePopover);return w.jsx(Rd,{present:r||s.open,children:s.modal?w.jsx(qE,{...o,ref:t}):w.jsx(GE,{...o,ref:t})})});dy.displayName=Vo;var YE=LE("PopoverContent.RemoveScroll"),qE=m.forwardRef((e,t)=>{const n=pr(Vo,e.__scopePopover),r=m.useRef(null),o=Ne(t,r),s=m.useRef(!1);return m.useEffect(()=>{const i=r.current;if(i)return xv(i)},[]),w.jsx(Pd,{as:YE,allowPinchZoom:!0,children:w.jsx(fy,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ge(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),s.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ge(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0,u=l.button===2||a;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:ge(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),GE=m.forwardRef((e,t)=>{const n=pr(Vo,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return w.jsx(fy,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var a,u;(a=e.onInteractOutside)==null||a.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),fy=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:u,onInteractOutside:d,...c}=e,h=pr(Vo,n),y=ri(n);return Qg(),w.jsx(md,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:w.jsx(hd,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:w.jsx(gv,{"data-state":hy(h.open),role:"dialog",id:h.contentId,...y,...c,ref:t,style:{...c.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),py="PopoverClose",XE=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=pr(py,n);return w.jsx(be.button,{type:"button",...r,ref:t,onClick:ge(e.onClick,()=>o.onOpenChange(!1))})});XE.displayName=py;var ZE="PopoverArrow",JE=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ri(n);return w.jsx(vv,{...o,...r,ref:t})});JE.displayName=ZE;function hy(e){return e?"open":"closed"}var ek=iy,tk=uy,nk=cy,rk=dy;const my="[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",ok=["January","February","March","April","May","June","July","August","September","October","November","December"],sk=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ik=["Su","Mo","Tu","We","Th","Fr","Sa"];function Wa({count:e,selected:t,onSelect:n,scrollRef:r}){return w.jsx("div",{ref:r,className:ie("h-64 overflow-y-auto w-10",my),children:Array.from({length:e}).map((o,s)=>w.jsx("button",{"data-selected":t===s,onClick:()=>n(s),className:ie("w-full py-1 text-sm font-medium rounded transition-colors",t===s?"bg-kiwi-800 text-white":"hover:bg-bg-secondary text-text-secondary"),children:String(s).padStart(2,"0")},s))})}function lk({hour:e,minute:t,second:n,onChange:r,hoursRef:o,minutesRef:s,secondsRef:i}){return w.jsxs("div",{className:"p-2 flex gap-1 justify-center",children:[w.jsx(Wa,{count:24,selected:e,onSelect:l=>r(l,t,n),scrollRef:o}),w.jsx(Wa,{count:60,selected:t,onSelect:l=>r(e,l,n),scrollRef:s}),w.jsx(Wa,{count:60,selected:n,onSelect:l=>r(e,t,l),scrollRef:i})]})}function ak({viewDate:e,setViewDate:t,view:n,setView:r,selectedDate:o,onSelectDate:s,yearsRef:i}){const l=new Date(e.getFullYear(),e.getMonth()+1,0).getDate(),a=new Date(e.getFullYear(),e.getMonth(),1).getDay(),u=new Date().getFullYear(),d=Array.from({length:101},(c,h)=>u-50+h);return w.jsxs("div",{className:"p-3 w-64",children:[w.jsxs("div",{className:"flex items-center justify-between mb-3",children:[w.jsx("button",{onClick:()=>t(new Date(e.getFullYear(),e.getMonth()-1)),className:"p-1.5 hover:bg-bg-secondary rounded-lg transition-colors",children:w.jsx(Bg,{className:"w-4 h-4 text-icon-secondary"})}),w.jsxs("div",{className:"flex gap-1",children:[w.jsx("button",{onClick:()=>r(n==="months"?"days":"months"),className:"px-2 py-1 hover:bg-bg-secondary rounded-lg text-sm font-medium transition-colors",children:ok[e.getMonth()]}),w.jsx("button",{onClick:()=>r(n==="years"?"days":"years"),className:"px-2 py-1 hover:bg-bg-secondary rounded-lg text-sm font-medium transition-colors",children:e.getFullYear()})]}),w.jsx("button",{onClick:()=>t(new Date(e.getFullYear(),e.getMonth()+1)),className:"p-1.5 hover:bg-bg-secondary rounded-lg transition-colors",children:w.jsx(Ug,{className:"w-4 h-4 text-icon-secondary"})})]}),n==="days"&&w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"grid grid-cols-7 gap-1 mb-1",children:ik.map(c=>w.jsx("div",{className:"text-center text-xs text-text-tertiary py-1 font-medium",children:c},c))}),w.jsxs("div",{className:"grid grid-cols-7 gap-1",children:[Array.from({length:a}).map((c,h)=>w.jsx("div",{},`empty-${h}`)),Array.from({length:l}).map((c,h)=>{const y=h+1,x=o&&o.getFullYear()===e.getFullYear()&&o.getMonth()===e.getMonth()&&o.getDate()===y,g=new Date().getFullYear()===e.getFullYear()&&new Date().getMonth()===e.getMonth()&&new Date().getDate()===y;return w.jsx("button",{onClick:()=>s(e.getFullYear(),e.getMonth(),y),className:ie("w-8 h-8 rounded-lg text-sm font-medium transition-colors",x?"bg-kiwi-800 text-white":g?"bg-bg-secondary text-text-primary":"hover:bg-bg-secondary text-text-primary"),children:y},y)})]})]}),n==="months"&&w.jsx("div",{className:"grid grid-cols-3 gap-2",children:sk.map((c,h)=>w.jsx("button",{onClick:()=>{t(new Date(e.getFullYear(),h)),r("days")},className:ie("px-2 py-2 rounded-lg text-sm font-medium transition-colors",e.getMonth()===h?"bg-kiwi-800 text-white":"hover:bg-bg-secondary text-text-primary"),children:c},c))}),n==="years"&&w.jsx("div",{ref:i,className:ie("h-48 overflow-y-auto grid grid-cols-3 gap-1",my),children:d.map(c=>w.jsx("button",{"data-selected":e.getFullYear()===c,onClick:()=>{t(new Date(c,e.getMonth())),r("days")},className:ie("px-2 py-1.5 rounded-lg text-sm font-medium transition-colors",e.getFullYear()===c?"bg-kiwi-800 text-white":"hover:bg-bg-secondary text-text-primary"),children:c},c))})]})}function gy({value:e,onChange:t,placeholder:n="null",defaultOpen:r=!1}){const[o,s]=m.useState(r),[i,l]=m.useState("days"),[a,u]=m.useState(()=>e?new Date(e):new Date),[d,c]=m.useState("date"),h=m.useRef(null),y=m.useRef(null),x=m.useRef(null),g=m.useRef(null);m.useEffect(()=>{var O;i==="years"&&h.current&&((O=h.current.querySelector('[data-selected="true"]'))==null||O.scrollIntoView({block:"center"}))},[i]),m.useEffect(()=>{o&&setTimeout(()=>{var O,T,D,A,B,V;(T=(O=y.current)==null?void 0:O.querySelector('[data-selected="true"]'))==null||T.scrollIntoView({block:"center"}),(A=(D=x.current)==null?void 0:D.querySelector('[data-selected="true"]'))==null||A.scrollIntoView({block:"center"}),(V=(B=g.current)==null?void 0:B.querySelector('[data-selected="true"]'))==null||V.scrollIntoView({block:"center"})},0)},[o,d]);const b=e?new Date(e):null,p=new Date,f=(b==null?void 0:b.getHours())??p.getHours(),v=(b==null?void 0:b.getMinutes())??p.getMinutes(),S=(b==null?void 0:b.getSeconds())??p.getSeconds(),E=b?`${b.getFullYear()}-${b.getMonth()+1}-${b.getDate()} ${String(b.getHours()).padStart(2,"0")}:${String(b.getMinutes()).padStart(2,"0")}:${String(b.getSeconds()).padStart(2,"0")}`:null,k=(O,T,D)=>{const A=new Date(O,T,D,f,v,S);t(A.toISOString())},P=(O,T,D)=>{const A=b||new Date,B=new Date(A.getFullYear(),A.getMonth(),A.getDate(),O,T,D);t(B.toISOString())},R=[{label:"NULL",action:()=>t(null)},{label:"now",action:()=>t(new Date().toISOString())},{label:"today",action:()=>{const O=new Date;O.setHours(0,0,0,0),t(O.toISOString())}},{label:"tomorrow",action:()=>{const O=new Date;O.setDate(O.getDate()+1),O.setHours(0,0,0,0),t(O.toISOString())}},{label:"yesterday",action:()=>{const O=new Date;O.setDate(O.getDate()-1),O.setHours(0,0,0,0),t(O.toISOString())}}];return w.jsxs(ek,{open:o,onOpenChange:s,children:[w.jsx(tk,{asChild:!0,children:w.jsx(Wl,{placeholder:!E,icon:"chevron-down",children:E||n})}),w.jsx(nk,{children:w.jsxs(rk,{className:"bg-background border border-border-tertiary rounded-xl shadow-lg z-50 flex max-h-[80vh]",sideOffset:4,align:"start",children:[w.jsx("div",{className:"p-2 border-r border-border-tertiary flex flex-col gap-1",children:R.map(({label:O,action:T})=>w.jsx("button",{onClick:T,className:"px-3 py-1.5 text-sm text-text-secondary text-left hover:bg-bg-secondary rounded-lg transition-colors whitespace-nowrap",children:O},O))}),w.jsxs("div",{className:"flex flex-col flex-1",children:[w.jsxs("div",{className:"flex border-b border-border-tertiary sm:hidden",children:[w.jsx("button",{onClick:()=>c("date"),className:ie("flex-1 px-4 py-2 text-sm font-medium transition-colors",d==="date"?"text-text-primary border-b-2 border-kiwi-800":"text-text-secondary"),children:"Date"}),w.jsx("button",{onClick:()=>c("time"),className:ie("flex-1 px-4 py-2 text-sm font-medium transition-colors",d==="time"?"text-text-primary border-b-2 border-kiwi-800":"text-text-secondary"),children:"Time"})]}),w.jsxs("div",{className:"flex flex-col sm:flex-row",children:[w.jsx("div",{className:ie(d==="time"&&"hidden sm:block"),children:w.jsx(ak,{viewDate:a,setViewDate:u,view:i,setView:l,selectedDate:b,onSelectDate:k,yearsRef:h})}),w.jsx("div",{className:ie("sm:border-l border-border-tertiary w-64 sm:w-auto",d==="date"&&"hidden sm:block"),children:w.jsx(lk,{hour:f,minute:v,second:S,onChange:P,hoursRef:y,minutesRef:x,secondsRef:g})})]})]})]})})]})}const uk=[{value:"true",label:"true"},{value:"false",label:"false"}];function ck({value:e,onChange:t,type:n="text",placeholder:r="Enter value",disabled:o=!1,autoFocus:s=!1}){return n==="boolean"?w.jsx(Rl,{value:e||"true",placeholder:"Select value",options:uk,onChange:t,disabled:o}):n==="date"?w.jsx(gy,{value:e||null,onChange:i=>t(i||""),placeholder:r,defaultOpen:s}):w.jsx("input",{type:n,value:e,onChange:i=>t(i.target.value),placeholder:r,disabled:o,autoFocus:s,className:ie("h-8 px-2.5 py-1.5 rounded-lg w-full flex-1 min-w-32","text-sm font-medium text-text-primary","bg-transparent border border-border-tertiary","outline-none focus:border-primary","placeholder:text-text-tertiary",o&&"opacity-50 cursor-not-allowed")})}const Ip={String:[{value:"equals",label:"equals"},{value:"not",label:"does not equal"},{value:"contains",label:"contains"},{value:"startsWith",label:"starts with"},{value:"endsWith",label:"ends with"}],Int:[{value:"equals",label:"equals"},{value:"not",label:"does not equal"},{value:"gt",label:"greater than"},{value:"gte",label:"greater or equal"},{value:"lt",label:"less than"},{value:"lte",label:"less or equal"}],BigInt:[{value:"equals",label:"equals"},{value:"not",label:"does not equal"},{value:"gt",label:"greater than"},{value:"gte",label:"greater or equal"},{value:"lt",label:"less than"},{value:"lte",label:"less or equal"}],Float:[{value:"equals",label:"equals"},{value:"not",label:"does not equal"},{value:"gt",label:"greater than"},{value:"gte",label:"greater or equal"},{value:"lt",label:"less than"},{value:"lte",label:"less or equal"}],Decimal:[{value:"equals",label:"equals"},{value:"not",label:"does not equal"},{value:"gt",label:"greater than"},{value:"gte",label:"greater or equal"},{value:"lt",label:"less than"},{value:"lte",label:"less or equal"}],Boolean:[{value:"equals",label:"is"}],DateTime:[{value:"equals",label:"equals"},{value:"not",label:"does not equal"},{value:"gt",label:"after"},{value:"gte",label:"on or after"},{value:"lt",label:"before"},{value:"lte",label:"on or before"}]};function Dp(e){return Ip[e]||Ip.String}function dk(e){switch(e){case"Int":case"BigInt":case"Float":case"Decimal":return"number";case"Boolean":return"boolean";case"DateTime":return"date";default:return"text"}}function fk(e){return!!(e.field&&e.operator&&e.value!==void 0&&e.value!=="")}function dc(e){return e.conditions.some(fk)}function vy(){return`filter-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function pk(){return{conditions:[],logic:"AND"}}function hk(){return{id:vy(),field:"",operator:void 0,value:""}}function mk({index:e,condition:t,fields:n,onChange:r,onRemove:o}){const s=n.find(y=>y.name===t.field),i=s?Dp(s.type):[],l=s?dk(s.type):"text",a=n.map(y=>({value:y.name,label:y.name})),u=i.map(y=>({value:y.value,label:y.label})),d=y=>{const x=n.find(f=>f.name===y),g=x?Dp(x.type):[],b=g.length===1?g[0].value:void 0,p=(x==null?void 0:x.type)==="Boolean"&&b?"true":"";r({...t,field:y,operator:b,value:p})},c=y=>{r({...t,operator:y})},h=y=>{r({...t,value:y})};return w.jsxs("div",{className:"flex items-start gap-3",children:[w.jsx("div",{className:"w-2.5 h-8 py-1.5 flex justify-center items-center shrink-0",children:w.jsx("span",{className:"text-text-disabled text-sm font-medium",children:e+1})}),w.jsxs("div",{className:"flex-1 flex items-center gap-1 flex-wrap",children:[w.jsx(Rl,{value:t.field,placeholder:"Select property",options:a,onChange:d,mono:!0}),t.field&&w.jsx(Rl,{value:t.operator,placeholder:"Select condition",options:u,onChange:c}),t.field&&t.operator&&w.jsx(ck,{value:t.value||"",onChange:h,type:l,placeholder:"Enter value",autoFocus:!0})]}),w.jsx("button",{type:"button",onClick:o,className:ie("w-8 h-8 flex items-center justify-center shrink-0","text-icon-tertiary hover:text-icon-primary transition-colors"),children:w.jsx(Vg,{className:"w-5 h-5"})})]})}const Fp=[{value:"AND",label:"and"},{value:"OR",label:"or"}];function gk({value:e,onChange:t}){const n=Fp.find(r=>r.value===e);return w.jsxs("div",{className:"relative flex items-center px-6 py-4",children:[w.jsx("div",{className:"absolute left-0 right-0 h-px bg-border-tertiary"}),w.jsxs(Xv,{value:e,onValueChange:t,children:[w.jsx(Zv,{asChild:!0,children:w.jsx(Wl,{variant:"outlined",icon:"chevron-down",className:"relative z-10",children:w.jsx("span",{className:"text-sm font-medium text-text-primary",children:n==null?void 0:n.label})})}),w.jsx(Jv,{children:w.jsx(ey,{className:ie("bg-background rounded-xl shadow-lg border border-border-tertiary","overflow-hidden z-50 min-w-[100px]"),position:"popper",sideOffset:4,children:w.jsx(ty,{className:"p-1",children:Fp.map(r=>w.jsxs(ny,{value:r.value,className:ie("relative flex items-center justify-between","px-3 py-1.5 rounded-lg cursor-pointer outline-none","text-sm font-medium text-text-primary","data-[highlighted]:bg-bg-secondary"),children:[w.jsx(ry,{children:r.label}),w.jsx(oy,{children:w.jsx(Sl,{className:"w-4 h-4 text-icon-primary"})})]},r.value))})})})]})]})}function vk({fields:e,initialFilters:t,onBack:n,onApply:r}){const[o,s]=m.useState(()=>t||{conditions:[],logic:"AND"}),[i,l]=m.useState(!1),a=dc(o),u=t?dc(t):!1,d=a||u&&!a&&o.conditions.length===0,c=e.filter(f=>f.kind==="scalar"),h=()=>{const f=hk();s(v=>({...v,conditions:[...v.conditions,f]})),l(!0)},y=f=>{s(v=>{const S=v.conditions.filter(E=>E.id!==f);return S.length===0&&l(!1),{...v,conditions:S}})},x=(f,v)=>{s(S=>({...S,conditions:S.conditions.map(E=>E.id===f?{...E,...v}:E)}))},g=f=>{s(v=>({...v,logic:f}))},b=()=>{const f={...o,conditions:o.conditions.filter(v=>v.field&&v.operator&&v.value!==void 0&&v.value!=="")};r(f)},p=o.conditions.length===0;return w.jsxs("div",{className:"flex flex-col h-full",children:[w.jsx("div",{className:"pr-4",children:w.jsx(bl,{title:"Filter",onBack:n,rightAction:d?w.jsx("button",{onClick:b,className:"bg-kiwi-800 text-white/90 font-semibold text-sm hover:opacity-80 rounded-full px-3 py-1.5",children:a?"Apply":"Clear"}):null})}),w.jsx("div",{className:"flex-1 overflow-auto p-4 pb-32",children:p?w.jsx("div",{className:"h-full flex items-center justify-center",children:w.jsx("p",{className:"text-text-tertiary text-sm font-semibold",children:"No filters yet"})}):w.jsx("div",{className:"space-y-0",children:o.conditions.map((f,v)=>w.jsxs("div",{children:[w.jsx(mk,{index:v,condition:f,fields:c,onChange:S=>x(f.id,S),onRemove:()=>y(f.id)}),v<o.conditions.length-1&&w.jsx(gk,{value:o.logic,onChange:g})]},f.id))})}),w.jsx(Ql,{primaryButton:{label:"Add a filter",onClick:h,disabled:i&&!d}})]})}function yk({value:e,onChange:t,placeholder:n="null",autoFocus:r=!1}){const o=e?typeof e=="string"?e:JSON.stringify(e,null,2):"",s=l=>{if(!l){t(null);return}try{t(JSON.parse(l))}catch{t(l)}},i=!e;return w.jsx("textarea",{value:o,onChange:l=>s(l.target.value),placeholder:n,autoFocus:r,rows:3,className:ie("w-full bg-transparent outline-none resize-none font-mono text-xs","focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-ring",i?"text-text-disabled":"text-text-primary")})}const wk={Int:{type:"number",step:"1",parse:e=>e?parseInt(e,10):null},BigInt:{type:"number",step:"1",parse:e=>e?parseInt(e,10):null},Float:{type:"number",step:"any",parse:e=>e?parseFloat(e):null},Decimal:{type:"number",step:"any",parse:e=>e?parseFloat(e):null}};function xk({value:e,onChange:t,fieldType:n="String",placeholder:r="null",autoFocus:o=!1}){const s=m.useRef(null);m.useEffect(()=>{o&&s.current&&s.current.focus()},[o]);const i=wk[n],l=e==null||e==="",a=u=>{t(i?i.parse(u.target.value):u.target.value||null)};return w.jsx("input",{ref:s,type:(i==null?void 0:i.type)??"text",step:i==null?void 0:i.step,value:e??"",onChange:a,placeholder:r,className:ie("w-full bg-transparent outline-none text-sm font-medium rounded-sm px-1","focus:outline-1 focus:outline-border-tertiary focus:outline-offset-2",l?"text-text-disabled":"text-text-primary")})}function Sk({field:e,value:t,onChange:n,placeholder:r="null",autoFocus:o=!1}){const s={value:t,onChange:n,placeholder:r,autoFocus:o},i=()=>{switch(e.type){case"Boolean":return w.jsx(Rl,{value:t===!0?"true":t===!1?"false":void 0,placeholder:r,options:[{value:"true",label:"true"},{value:"false",label:"false"}],onChange:l=>n(l==="true")});case"DateTime":return w.jsx(gy,{value:t,onChange:n,placeholder:r,defaultOpen:o});case"Json":return w.jsx(yk,{...s});default:return w.jsx(xk,{...s,fieldType:e.type})}};return w.jsxs("div",{className:"flex items-start gap-3",children:[w.jsx("div",{className:"w-28 min-w-24 px-2.5 py-1.5 shrink-0",children:w.jsxs("span",{className:"text-xs font-semibold text-text-secondary",children:[w.jsx("span",{className:"font-mono",children:e.name}),e.isRequired&&w.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]})}),w.jsx("div",{className:"flex-1 min-w-24 px-2.5 py-1.5 rounded-lg",children:i()})]})}function bk(e,t){return!t&&e.hasDefaultValue?"(auto-generated)":"null"}function Lp(e,t){const n={};for(const r of t)r.kind!=="object"&&(e?n[r.name]=e[r.name]:n[r.name]=r.type==="Boolean"?!1:null);return n}function Ck({tableName:e,record:t,fields:n,focusField:r,onBack:o}){var S;const s=!!t,i=s?"Edit Entry":"Add Entry",l=m.useMemo(()=>n.filter(E=>E.kind!=="object"),[n]),a=r??(s||(S=l.find(E=>!E.hasDefaultValue))==null?void 0:S.name),[u,d]=m.useState(()=>Lp(t,n)),[c]=m.useState(()=>Lp(t,n)),[h,y]=m.useState(!1),x=W1(e),g=Q1(e),b=m.useMemo(()=>Object.keys(u).some(E=>u[E]!==c[E]),[u,c]),p=m.useMemo(()=>{const E=l.filter(k=>k.isRequired&&!(k.hasDefaultValue&&!s)).every(k=>{const P=u[k.name];return P!=null&&P!==""});return s?E&&b:E},[l,u,s,b]),f=(E,k)=>{d(P=>({...P,[E]:k}))},v=async()=>{if(!h){y(!0);try{if(s&&t){const E={};for(const k of Object.keys(u))u[k]!==c[k]&&(E[k]=u[k]);await g.mutateAsync({id:String(t.id),data:E}),rr.success("Entry updated")}else{const E={};for(const k of l){const P=u[k.name];k.hasDefaultValue&&P==null||(E[k.name]=P)}await x.mutateAsync(E),rr.success("Entry created")}o()}catch(E){rr.error(E instanceof Error?E.message:"Failed to save entry")}finally{y(!1)}}};return w.jsxs("div",{className:"flex flex-col h-full",children:[w.jsx(bl,{title:i,onBack:o}),w.jsx("div",{className:"flex-1 overflow-auto p-4 pb-32",children:w.jsx("div",{className:"flex flex-col gap-0.5",children:l.map(E=>w.jsx(Sk,{field:E,value:u[E.name],onChange:k=>f(E.name,k),placeholder:bk(E,s),autoFocus:a===E.name},E.name))})}),w.jsx(Ql,{primaryButton:{label:h?"Saving...":s?"Save Entry":"Add Entry",onClick:v,disabled:!p||h}})]})}function Ek(e){const t=[];for(const{tableName:n,fields:r,rows:o,selectedIndices:s}of e){if(s.size===0)continue;t.push(`Table: ${n}`),t.push("---");const i=o.filter((l,a)=>s.has(a));for(const l of i){for(const a of r){const u=l[a.name],d=u==null?"null":typeof u=="object"?JSON.stringify(u):String(u);t.push(`${a.name}: ${d}`)}t.push("")}}return t.join(`
|
|
170
|
-
`).trim()}async function yy(e){const t=e.reduce((r,o)=>r+o.selectedIndices.size,0);if(t===0)return rr.error("No rows selected"),!1;const n=Ek(e);try{return await navigator.clipboard.writeText(n),rr.success(`Copied ${t} row${t!==1?"s":""}`),!0}catch{return rr.error("Failed to copy to clipboard"),!1}}function kk({tableName:e,initialFilters:t,onBack:n}){var _e,De,Qt,_t,nt,hr;const{navigateToTable:r}=Tg(),[o,s]=m.useState(0),i=50,[l,a]=m.useState(!1),[u,d]=m.useState(null),[c,h]=m.useState(void 0),[y,x]=m.useState(new Set),[g,b]=m.useState(!1),[p,f]=m.useState(()=>t||pk()),[v,S]=m.useState(),[E,k]=m.useState(),P=dc(p),{data:R,isLoading:O,error:T,refetch:D}=Fg(e,{offset:o*i,limit:i,filters:P?p:void 0,orderBy:v,orderDir:E}),{data:A}=Og(),B=K1(e),[V,J]=m.useState(!1),I=((_e=R==null?void 0:R.data)==null?void 0:_e.rows)||[],U=Math.ceil((((De=R==null?void 0:R.data)==null?void 0:De.total)||0)/i),N=(nt=(_t=(Qt=A==null?void 0:A.data)==null?void 0:Qt.schema)==null?void 0:_t.models)==null?void 0:nt.find(Y=>Y.name===e),M=(N==null?void 0:N.fields)||[],L=Y=>{x(Ye=>{const St=new Set(Ye);return St.has(Y)?St.delete(Y):St.add(Y),St})},Q=()=>{x(Y=>I.every((St,Fe)=>Y.has(Fe))?new Set:new Set(I.map((St,Fe)=>Fe)))},ae=Y=>{v!==Y?(S(Y),k("asc")):E==="asc"?k("desc"):(S(void 0),k(void 0))},K=(Y,Ye,St)=>{d(Y),h(St),a(!0)},X=()=>{d(null),h(void 0),a(!0)},ne=()=>{a(!1),d(null),h(void 0)},ue=async()=>{await yy([{tableName:e,fields:M,rows:I,selectedIndices:y}])},$=()=>{J(!0),rr.warning("Are you sure? This action cannot be undone")},W=()=>{J(!1)},pe=async()=>{const Y=I.filter((Ye,St)=>y.has(St));for(const Ye of Y)await B.mutateAsync(String(Ye.id));rr.success(`Deleted ${Y.length} record${Y.length!==1?"s":""}`),x(new Set),J(!1)},se=()=>{if(V)return{primaryButton:{label:"Confirm",onClick:pe},secondaryButton:{icon:w.jsx(rS,{className:"w-5 h-5"}),onClick:W,active:!0,activeColor:"blackberry-1000"}};if(y.size>0)return{primaryButton:{label:"Copy to clipboard",onClick:ue},secondaryButton:{icon:w.jsx(Vg,{className:"w-5 h-5"}),onClick:$,active:!0,activeColor:"blackberry-1000",badge:y.size}};const Y=p.conditions.filter(Ye=>Ye.field&&Ye.operator&&Ye.value!==void 0&&Ye.value!=="").length;return{primaryButton:{label:"Copy to clipboard",onClick:ue,disabled:!0},secondaryButton:{icon:w.jsx(eS,{className:"w-5 h-5"}),onClick:()=>b(!0),active:P,activeColor:"blueberry-500",badge:Y>0?Y:void 0}}},re=Y=>{f(Y),b(!1),s(0)},ee=Y=>{const Ye={conditions:[{id:vy(),field:Y.filterField,operator:"equals",value:Y.filterValue}],logic:"AND"};r(Y.targetTable,Ye)};return l?w.jsx(Ck,{tableName:e,record:u,fields:M,focusField:c,onBack:ne}):g?w.jsx(vk,{fields:M,initialFilters:p,onBack:()=>b(!1),onApply:re}):O?w.jsx("div",{className:"h-full flex items-center justify-center",children:w.jsx(pd,{className:"h-8 w-8 animate-spin text-text-secondary"})}):T?w.jsxs("div",{className:"flex flex-col h-full",children:[w.jsx(bl,{title:e,onBack:n}),w.jsx("div",{className:"flex-1 flex items-center justify-center",children:w.jsxs("div",{className:"text-center max-w-md",children:[w.jsx("p",{className:"text-destructive font-semibold mb-2",children:"Error loading table"}),w.jsx("p",{className:"text-sm text-text-secondary",children:T instanceof Error?T.message:"Unknown error"}),w.jsx("button",{onClick:()=>D(),className:"mt-4 px-4 py-2 bg-button-primary rounded-md hover:bg-bg-secondary",children:"Retry"})]})})]}):w.jsxs("div",{className:"flex flex-col h-full pl-1",children:[w.jsx(bl,{title:e,onBack:n,rightAction:w.jsx("button",{onClick:X,className:"w-7 h-7 rounded-lg flex justify-center items-center hover:bg-button-primary",children:w.jsx(nS,{className:"w-5 h-5 text-icon-primary"})})}),w.
|
|
170
|
+
`).trim()}async function yy(e){const t=e.reduce((r,o)=>r+o.selectedIndices.size,0);if(t===0)return rr.error("No rows selected"),!1;const n=Ek(e);try{return await navigator.clipboard.writeText(n),rr.success(`Copied ${t} row${t!==1?"s":""}`),!0}catch{return rr.error("Failed to copy to clipboard"),!1}}function kk({tableName:e,initialFilters:t,onBack:n}){var _e,De,Qt,_t,nt,hr;const{navigateToTable:r}=Tg(),[o,s]=m.useState(0),i=50,[l,a]=m.useState(!1),[u,d]=m.useState(null),[c,h]=m.useState(void 0),[y,x]=m.useState(new Set),[g,b]=m.useState(!1),[p,f]=m.useState(()=>t||pk()),[v,S]=m.useState(),[E,k]=m.useState(),P=dc(p),{data:R,isLoading:O,error:T,refetch:D}=Fg(e,{offset:o*i,limit:i,filters:P?p:void 0,orderBy:v,orderDir:E}),{data:A}=Og(),B=K1(e),[V,J]=m.useState(!1),I=((_e=R==null?void 0:R.data)==null?void 0:_e.rows)||[],U=Math.ceil((((De=R==null?void 0:R.data)==null?void 0:De.total)||0)/i),N=(nt=(_t=(Qt=A==null?void 0:A.data)==null?void 0:Qt.schema)==null?void 0:_t.models)==null?void 0:nt.find(Y=>Y.name===e),M=(N==null?void 0:N.fields)||[],L=Y=>{x(Ye=>{const St=new Set(Ye);return St.has(Y)?St.delete(Y):St.add(Y),St})},Q=()=>{x(Y=>I.every((St,Fe)=>Y.has(Fe))?new Set:new Set(I.map((St,Fe)=>Fe)))},ae=Y=>{v!==Y?(S(Y),k("asc")):E==="asc"?k("desc"):(S(void 0),k(void 0))},K=(Y,Ye,St)=>{d(Y),h(St),a(!0)},X=()=>{d(null),h(void 0),a(!0)},ne=()=>{a(!1),d(null),h(void 0)},ue=async()=>{await yy([{tableName:e,fields:M,rows:I,selectedIndices:y}])},$=()=>{J(!0),rr.warning("Are you sure? This action cannot be undone")},W=()=>{J(!1)},pe=async()=>{const Y=I.filter((Ye,St)=>y.has(St));for(const Ye of Y)await B.mutateAsync(String(Ye.id));rr.success(`Deleted ${Y.length} record${Y.length!==1?"s":""}`),x(new Set),J(!1)},se=()=>{if(V)return{primaryButton:{label:"Confirm",onClick:pe},secondaryButton:{icon:w.jsx(rS,{className:"w-5 h-5"}),onClick:W,active:!0,activeColor:"blackberry-1000"}};if(y.size>0)return{primaryButton:{label:"Copy to clipboard",onClick:ue},secondaryButton:{icon:w.jsx(Vg,{className:"w-5 h-5"}),onClick:$,active:!0,activeColor:"blackberry-1000",badge:y.size}};const Y=p.conditions.filter(Ye=>Ye.field&&Ye.operator&&Ye.value!==void 0&&Ye.value!=="").length;return{primaryButton:{label:"Copy to clipboard",onClick:ue,disabled:!0},secondaryButton:{icon:w.jsx(eS,{className:"w-5 h-5"}),onClick:()=>b(!0),active:P,activeColor:"blueberry-500",badge:Y>0?Y:void 0}}},re=Y=>{f(Y),b(!1),s(0)},ee=Y=>{const Ye={conditions:[{id:vy(),field:Y.filterField,operator:"equals",value:Y.filterValue}],logic:"AND"};r(Y.targetTable,Ye)};return l?w.jsx(Ck,{tableName:e,record:u,fields:M,focusField:c,onBack:ne}):g?w.jsx(vk,{fields:M,initialFilters:p,onBack:()=>b(!1),onApply:re}):O?w.jsx("div",{className:"h-full flex items-center justify-center",children:w.jsx(pd,{className:"h-8 w-8 animate-spin text-text-secondary"})}):T?w.jsxs("div",{className:"flex flex-col h-full",children:[w.jsx(bl,{title:e,onBack:n}),w.jsx("div",{className:"flex-1 flex items-center justify-center",children:w.jsxs("div",{className:"text-center max-w-md",children:[w.jsx("p",{className:"text-destructive font-semibold mb-2",children:"Error loading table"}),w.jsx("p",{className:"text-sm text-text-secondary",children:T instanceof Error?T.message:"Unknown error"}),w.jsx("button",{onClick:()=>D(),className:"mt-4 px-4 py-2 bg-button-primary rounded-md hover:bg-bg-secondary",children:"Retry"})]})})]}):w.jsxs("div",{className:"flex flex-col h-full pl-1",children:[w.jsx(bl,{title:e,onBack:n,rightAction:w.jsx("button",{onClick:X,className:"w-7 h-7 rounded-lg flex justify-center items-center hover:bg-button-primary",children:w.jsx(nS,{className:"w-5 h-5 text-icon-primary"})})}),w.jsxs("div",{className:"flex-1 overflow-auto p-2 pb-32",children:[w.jsx($g,{columns:M,rows:I,selectedRows:y,onToggleRow:V?void 0:L,onSelectAll:V?void 0:Q,onRowClick:K,onNavigateToRelation:ee,schema:(hr=A==null?void 0:A.data)==null?void 0:hr.schema,tableName:e,orderBy:v,orderDir:E,onSort:ae,isDestructive:V}),I.length===0&&w.jsx("div",{className:"py-12 flex items-center justify-center",children:w.jsx("p",{className:"text-text-tertiary text-sm",children:"No records found"})})]}),U>1&&w.jsxs("div",{className:"p-4 flex items-center justify-between",children:[w.jsxs("div",{className:"text-sm text-text-secondary",children:["Page ",o+1," of ",U]}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("button",{onClick:()=>s(Y=>Math.max(0,Y-1)),disabled:o===0,className:"px-3 py-1 bg-button-primary rounded-md hover:bg-bg-secondary disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),w.jsx("button",{onClick:()=>s(Y=>Math.min(U-1,Y+1)),disabled:o>=U-1,className:"px-3 py-1 bg-button-primary rounded-md hover:bg-bg-secondary disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]}),w.jsx(Ql,{...se()})]})}function Pk({tableName:e,fields:t,onSelect:n,selectedRows:r,onSelectionChange:o}){var h,y;const{data:s,isLoading:i}=Fg(e,{limit:4}),l=((h=s==null?void 0:s.data)==null?void 0:h.rows)||[],a=((y=s==null?void 0:s.data)==null?void 0:y.total)||0,u=r??new Set,d=x=>{const g=new Set(u);g.has(x)?g.delete(x):g.add(x),o==null||o(g,l)},c=()=>{const x=l.slice(0,4);if(x.every((b,p)=>u.has(p)))o==null||o(new Set,l);else{const b=new Set;x.forEach((p,f)=>b.add(f)),o==null||o(b,l)}};return w.jsxs("div",{className:"flex flex-col gap-2",children:[w.jsxs("div",{className:"px-2 flex justify-between items-end",children:[w.jsx("h3",{className:"text-text-primary text-xl font-semibold font-mono",children:e}),w.jsxs("span",{className:"text-text-secondary text-xs font-semibold font-mono",children:[a," ",a===1?"entry":"entries"]})]}),w.jsxs("div",{className:"bg-background rounded-[20px] shadow-[0px_0px_20px_0px_hsl(var(--shadow-color)/0.05)] p-2 overflow-hidden flex flex-col",children:[w.jsxs("div",{className:"h-44",children:[i?w.jsx("div",{className:"h-full flex items-center justify-center",children:w.jsx(pd,{className:"h-6 w-6 animate-spin text-text-secondary"})}):w.jsx($g,{columns:t,rows:l,selectedRows:u,onToggleRow:d,onSelectAll:c,isPreview:!0}),l.length===0&&w.jsx("div",{className:"h-full flex items-center justify-center",children:w.jsx("p",{className:"text-text-tertiary text-sm",children:"No records"})})]}),w.jsx("div",{className:"flex justify-center pt-5 pb-1",children:w.jsxs("button",{onClick:n,className:"h-8 px-3 pr-2 bg-button-primary rounded-full inline-flex items-center gap-1 hover:bg-bg-secondary transition-colors",children:[w.jsx("span",{className:"text-text-primary text-sm font-medium",children:"Full table"}),w.jsx(X1,{className:"w-5 h-5 text-icon-primary stroke-2"})]})})]})]})}function Nk({tables:e,onSelectTable:t,onVisibleTableChange:n}){const[r,o]=m.useState(new Map),s=m.useRef(null),i=m.useRef(new Map);m.useEffect(()=>{if(!n||!s.current)return;const d=new IntersectionObserver(h=>{h.forEach(g=>{const b=g.target.id.replace("table-","");i.current.set(b,g.intersectionRatio)});let y=0,x=null;i.current.forEach((g,b)=>{g>y&&(y=g,x=b)}),x&&n(x)},{root:s.current,threshold:[0,.25,.5,.75,1]});return s.current.querySelectorAll('[id^="table-"]').forEach(h=>d.observe(h)),()=>d.disconnect()},[n,e]);const l=m.useCallback((d,c,h)=>{o(y=>{const x=new Map(y);return c.size===0?x.delete(d):x.set(d,{indices:c,rows:h}),x})},[]),a=Array.from(r.values()).reduce((d,c)=>d+c.indices.size,0),u=m.useCallback(async()=>{const d=Array.from(r.entries()).map(([c,h])=>{const y=e.find(x=>x.name===c);return{tableName:c,fields:(y==null?void 0:y.fields)||[],rows:h.rows,selectedIndices:h.indices}});await yy(d)},[r,e]);return w.jsxs("div",{ref:s,className:"h-full overflow-auto p-6 pb-44",children:[w.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-[repeat(auto-fit,minmax(380px,1fr))] gap-6",children:e.map(d=>{var c;return w.jsx("div",{id:`table-${d.name}`,className:"scroll-mt-14",children:w.jsx(Pk,{tableName:d.name,fields:d.fields,onSelect:()=>t(d.name),selectedRows:(c=r.get(d.name))==null?void 0:c.indices,onSelectionChange:(h,y)=>l(d.name,h,y)})},d.name)})}),w.jsx(Ql,{primaryButton:{label:"Copy to clipboard ",onClick:u,disabled:a===0}})]})}function Rk(){var y,x;const{currentEntry:e,navigateToTable:t,goBack:n}=Tg(),{data:r,isLoading:o,error:s,refetch:i}=Og(),[l,a]=m.useState(null),u=g=>{var b;(b=document.getElementById(`table-${g}`))==null||b.scrollIntoView({behavior:"smooth"})},d=(e==null?void 0:e.type)==="table"?e.tableName:null,c=(e==null?void 0:e.type)==="table"?e.filters:void 0,h=((x=(y=r==null?void 0:r.data)==null?void 0:y.schema)==null?void 0:x.models)||[];return o?w.jsx("div",{className:"h-screen flex items-center justify-center",children:w.jsxs("div",{className:"text-center",children:[w.jsx(pd,{className:"h-8 w-8 animate-spin mx-auto mb-4 text-primary"}),w.jsx("p",{className:"text-muted-foreground",children:"Loading database schema..."})]})}):s?w.jsx("div",{className:"h-screen flex items-center justify-center",children:w.jsxs("div",{className:"text-center max-w-md",children:[w.jsx(J1,{className:"h-12 w-12 mx-auto mb-4 text-destructive"}),w.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Connecting to database"}),w.jsx("p",{className:"text-text-secondary text-sm",children:"Please wait while we connect to your database..."}),w.jsx("button",{onClick:()=>i(),className:"mt-4 px-4 py-2 bg-button-primary rounded-md hover:bg-bg-secondary",children:"Retry"})]})}):w.jsxs("div",{className:"flex flex-col h-screen bg-background",children:[!d&&w.jsx(H1,{tables:h,selectedTable:l,onSelectTable:u}),w.jsx("div",{className:"flex-1 overflow-hidden",children:d?w.jsx(kk,{tableName:d,initialFilters:c,onBack:n},e==null?void 0:e.id):w.jsx(Nk,{tables:h,onSelectTable:t,onVisibleTableChange:a})})]})}const Tk=new Sx({defaultOptions:{queries:{refetchInterval:5e3,staleTime:2e3,retry:2}}});dg(document.getElementById("root")).render(w.jsx(m.StrictMode,{children:w.jsxs(bx,{client:Tk,children:[w.jsx(u1,{children:w.jsx(Rk,{})}),w.jsx(i1,{position:"bottom-right",mobileOffset:{bottom:6},visibleToasts:2,theme:"system"})]})}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--radius: .5rem;--text-primary: 0 0% 0%;--text-secondary: 0 0% 0% / .6;--text-tertiary: 0 0% 0% / .4;--bg-secondary: 0 0% 0% / .05;--border-tertiary: 0 0% 0% / .05;--button-primary: 0 0% 0% / .05;--button-disabled: 0 0% 0% / .025;--kiwi-500: 164 66% 48%;--kiwi-600: 160 76% 39%;--kiwi-800: 163 66% 22%;--blueberry-500: 223 100% 53%;--blackberry-1000: 0 0% 0%;--coconut-1000: 0 0% 100%;--text-disabled: 0 0% 0% / .2;--icon-primary: 0 0% 0%;--icon-secondary: 0 0% 0% / .6;--icon-tertiary: 0 0% 0% / .4;--shadow-color: 0 0% 0%}.dark{--background: 0 0% 5%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 212.7 26.8% 83.9%;--text-primary: 0 0% 100%;--text-secondary: 0 0% 100% / .7;--text-tertiary: 0 0% 100% / .5;--bg-secondary: 0 0% 100% / .05;--border-tertiary: 0 0% 100% / .1;--button-primary: 0 0% 100% / .1;--button-disabled: 0 0% 100% / .05;--kiwi-500: 164 69% 51%;--kiwi-600: 162 67% 45%;--kiwi-800: 161 67% 29%;--blueberry-500: 220 99% 53%;--blackberry-1000: 0 0% 100%;--coconut-1000: 0 0% 0%;--text-disabled: 0 0% 100% / .2;--icon-primary: 0 0% 100%;--icon-secondary: 0 0% 100% / .7;--icon-tertiary: 0 0% 100% / .5;--shadow-color: 0 0% 100%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-0\.5{margin-left:.125rem}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-12{height:3rem}.h-14{height:3.5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-44{height:11rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\[80vh\]{max-height:80vh}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-2\.5{width:.625rem}.w-28{width:7rem}.w-3{width:.75rem}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-20{min-width:5rem}.min-w-24{min-width:6rem}.min-w-32{min-width:8rem}.min-w-\[100px\]{min-width:100px}.min-w-\[160px\]{min-width:160px}.min-w-max{min-width:-moz-max-content;min-width:max-content}.max-w-40{max-width:10rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.scroll-mt-14{scroll-margin-top:3.5rem}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-6{gap:1.5rem}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-\[20px\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-t-\[20px\]{border-top-left-radius:20px;border-top-right-radius:20px}.rounded-bl-lg{border-bottom-left-radius:var(--radius)}.rounded-bl-xl{border-bottom-left-radius:.75rem}.rounded-br-xl{border-bottom-right-radius:.75rem}.rounded-tl-lg{border-top-left-radius:var(--radius)}.rounded-tl-xl{border-top-left-radius:.75rem}.rounded-tr-xl{border-top-right-radius:.75rem}.border{border-width:1px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-border-tertiary{border-color:hsl(var(--border-tertiary))}.border-kiwi-800{border-color:hsl(var(--kiwi-800))}.border-transparent{border-color:transparent}.\!border-b-destructive\/20{border-bottom-color:hsl(var(--destructive) / .2)!important}.\!border-b-kiwi-600\/20{border-bottom-color:hsl(var(--kiwi-600) / .2)!important}.\!border-l-destructive\/20{border-left-color:hsl(var(--destructive) / .2)!important}.\!border-l-kiwi-600\/20{border-left-color:hsl(var(--kiwi-600) / .2)!important}.\!border-t-destructive\/20{border-top-color:hsl(var(--destructive) / .2)!important}.\!border-t-kiwi-600\/20{border-top-color:hsl(var(--kiwi-600) / .2)!important}.border-b-border-tertiary{border-bottom-color:hsl(var(--border-tertiary))}.border-b-transparent{border-bottom-color:transparent}.border-l-border-tertiary{border-left-color:hsl(var(--border-tertiary))}.border-r-border-tertiary{border-right-color:hsl(var(--border-tertiary))}.border-t-border-tertiary{border-top-color:hsl(var(--border-tertiary))}.border-t-transparent{border-top-color:transparent}.bg-background{background-color:hsl(var(--background))}.bg-bg-secondary{background-color:hsl(var(--bg-secondary))}.bg-blackberry-1000{background-color:hsl(var(--blackberry-1000))}.bg-border-tertiary{background-color:hsl(var(--border-tertiary))}.bg-button-disabled{background-color:hsl(var(--button-disabled))}.bg-button-primary{background-color:hsl(var(--button-primary))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-kiwi-600{background-color:hsl(var(--kiwi-600))}.bg-kiwi-600\/10{background-color:hsl(var(--kiwi-600) / .1)}.bg-kiwi-800{background-color:hsl(var(--kiwi-800))}.bg-transparent{background-color:transparent}.stroke-2{stroke-width:2}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-1{padding-bottom:.25rem}.pb-16{padding-bottom:4rem}.pb-32{padding-bottom:8rem}.pb-44{padding-bottom:11rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-2\.5{padding-left:.625rem}.pl-3{padding-left:.75rem}.pr-1{padding-right:.25rem}.pr-1\.5{padding-right:.375rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pt-5{padding-top:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tracking-tight{letter-spacing:-.025em}.text-blackberry-1000{color:hsl(var(--blackberry-1000))}.text-blueberry-500{color:hsl(var(--blueberry-500))}.text-coconut-1000{color:hsl(var(--coconut-1000))}.text-destructive{color:hsl(var(--destructive))}.text-icon-primary{color:hsl(var(--icon-primary))}.text-icon-secondary{color:hsl(var(--icon-secondary))}.text-icon-tertiary{color:hsl(var(--icon-tertiary))}.text-kiwi-500{color:hsl(var(--kiwi-500))}.text-kiwi-600{color:hsl(var(--kiwi-600))}.text-kiwi-800{color:hsl(var(--kiwi-800))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-primary{color:hsl(var(--primary))}.text-text-disabled{color:hsl(var(--text-disabled))}.text-text-primary{color:hsl(var(--text-primary))}.text-text-secondary{color:hsl(var(--text-secondary))}.text-text-tertiary{color:hsl(var(--text-tertiary))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/90{color:#ffffffe6}.opacity-50{opacity:.5}.shadow-\[0px_0px_20px_0px_hsl\(var\(--shadow-color\)\/0\.05\)\]{--tw-shadow: 0px 0px 20px 0px hsl(var(--shadow-color)/.05);--tw-shadow-colored: 0px 0px 20px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-primary\/20{--tw-ring-color: hsl(var(--primary) / .2)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide::-webkit-scrollbar{display:none}.\[-ms-overflow-style\:none\]{-ms-overflow-style:none}.\[scrollbar-width\:none\]{scrollbar-width:none}*{-webkit-tap-highlight-color:transparent;touch-action:manipulation}.placeholder\:text-text-tertiary::-moz-placeholder{color:hsl(var(--text-tertiary))}.placeholder\:text-text-tertiary::placeholder{color:hsl(var(--text-tertiary))}.hover\:bg-bg-secondary:hover{background-color:hsl(var(--bg-secondary))}.hover\:bg-bg-secondary\/50:hover{background-color:hsl(var(--bg-secondary) / .5)}.hover\:bg-button-primary:hover{background-color:hsl(var(--button-primary))}.hover\:text-icon-primary:hover{color:hsl(var(--icon-primary))}.hover\:text-text-primary:hover{color:hsl(var(--text-primary))}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.focus\:border-primary:focus{border-color:hsl(var(--primary))}.focus\:outline:focus{outline-style:solid}.focus\:outline-1:focus{outline-width:1px}.focus\:outline-2:focus{outline-width:2px}.focus\:outline-offset-2:focus{outline-offset:2px}.focus\:outline-border-tertiary:focus{outline-color:hsl(var(--border-tertiary))}.focus\:outline-ring:focus{outline-color:hsl(var(--ring))}.active\:opacity-100:active{opacity:1}.active\:opacity-80:active{opacity:.8}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[highlighted\]\:bg-bg-secondary[data-highlighted]{background-color:hsl(var(--bg-secondary))}@media (min-width: 640px){.sm\:block{display:block}.sm\:hidden{display:none}.sm\:w-auto{width:auto}.sm\:grid-cols-\[repeat\(auto-fit\,minmax\(380px\,1fr\)\)\]{grid-template-columns:repeat(auto-fit,minmax(380px,1fr))}.sm\:flex-row{flex-direction:row}.sm\:border-l{border-left-width:1px}}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}
|
|
1
|
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--radius: .5rem;--text-primary: 0 0% 0%;--text-secondary: 0 0% 0% / .6;--text-tertiary: 0 0% 0% / .4;--bg-secondary: 0 0% 0% / .05;--border-tertiary: 0 0% 0% / .05;--button-primary: 0 0% 0% / .05;--button-disabled: 0 0% 0% / .025;--kiwi-500: 164 66% 48%;--kiwi-600: 160 76% 39%;--kiwi-800: 163 66% 22%;--blueberry-500: 223 100% 53%;--blackberry-1000: 0 0% 0%;--coconut-1000: 0 0% 100%;--text-disabled: 0 0% 0% / .2;--icon-primary: 0 0% 0%;--icon-secondary: 0 0% 0% / .6;--icon-tertiary: 0 0% 0% / .4;--shadow-color: 0 0% 0%}.dark{--background: 0 0% 5%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 212.7 26.8% 83.9%;--text-primary: 0 0% 100%;--text-secondary: 0 0% 100% / .7;--text-tertiary: 0 0% 100% / .5;--bg-secondary: 0 0% 100% / .05;--border-tertiary: 0 0% 100% / .1;--button-primary: 0 0% 100% / .1;--button-disabled: 0 0% 100% / .05;--kiwi-500: 164 69% 51%;--kiwi-600: 162 67% 45%;--kiwi-800: 161 67% 29%;--blueberry-500: 220 99% 53%;--blackberry-1000: 0 0% 100%;--coconut-1000: 0 0% 0%;--text-disabled: 0 0% 100% / .2;--icon-primary: 0 0% 100%;--icon-secondary: 0 0% 100% / .7;--icon-tertiary: 0 0% 100% / .5;--shadow-color: 0 0% 100%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-0\.5{margin-left:.125rem}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-12{height:3rem}.h-14{height:3.5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-44{height:11rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\[80vh\]{max-height:80vh}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-2\.5{width:.625rem}.w-28{width:7rem}.w-3{width:.75rem}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-full{width:100%}.min-w-20{min-width:5rem}.min-w-24{min-width:6rem}.min-w-32{min-width:8rem}.min-w-\[100px\]{min-width:100px}.min-w-\[160px\]{min-width:160px}.min-w-max{min-width:-moz-max-content;min-width:max-content}.max-w-40{max-width:10rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.scroll-mt-14{scroll-margin-top:3.5rem}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-6{gap:1.5rem}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-\[20px\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-t-\[20px\]{border-top-left-radius:20px;border-top-right-radius:20px}.rounded-bl-lg{border-bottom-left-radius:var(--radius)}.rounded-bl-xl{border-bottom-left-radius:.75rem}.rounded-br-xl{border-bottom-right-radius:.75rem}.rounded-tl-lg{border-top-left-radius:var(--radius)}.rounded-tl-xl{border-top-left-radius:.75rem}.rounded-tr-xl{border-top-right-radius:.75rem}.border{border-width:1px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-border-tertiary{border-color:hsl(var(--border-tertiary))}.border-kiwi-800{border-color:hsl(var(--kiwi-800))}.border-transparent{border-color:transparent}.\!border-b-destructive\/20{border-bottom-color:hsl(var(--destructive) / .2)!important}.\!border-b-kiwi-600\/20{border-bottom-color:hsl(var(--kiwi-600) / .2)!important}.\!border-l-destructive\/20{border-left-color:hsl(var(--destructive) / .2)!important}.\!border-l-kiwi-600\/20{border-left-color:hsl(var(--kiwi-600) / .2)!important}.\!border-t-destructive\/20{border-top-color:hsl(var(--destructive) / .2)!important}.\!border-t-kiwi-600\/20{border-top-color:hsl(var(--kiwi-600) / .2)!important}.border-b-border-tertiary{border-bottom-color:hsl(var(--border-tertiary))}.border-b-transparent{border-bottom-color:transparent}.border-l-border-tertiary{border-left-color:hsl(var(--border-tertiary))}.border-r-border-tertiary{border-right-color:hsl(var(--border-tertiary))}.border-t-border-tertiary{border-top-color:hsl(var(--border-tertiary))}.border-t-transparent{border-top-color:transparent}.bg-background{background-color:hsl(var(--background))}.bg-bg-secondary{background-color:hsl(var(--bg-secondary))}.bg-blackberry-1000{background-color:hsl(var(--blackberry-1000))}.bg-border-tertiary{background-color:hsl(var(--border-tertiary))}.bg-button-disabled{background-color:hsl(var(--button-disabled))}.bg-button-primary{background-color:hsl(var(--button-primary))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-kiwi-600{background-color:hsl(var(--kiwi-600))}.bg-kiwi-600\/10{background-color:hsl(var(--kiwi-600) / .1)}.bg-kiwi-800{background-color:hsl(var(--kiwi-800))}.bg-transparent{background-color:transparent}.stroke-2{stroke-width:2}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-1{padding-bottom:.25rem}.pb-16{padding-bottom:4rem}.pb-32{padding-bottom:8rem}.pb-44{padding-bottom:11rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-2\.5{padding-left:.625rem}.pl-3{padding-left:.75rem}.pr-1{padding-right:.25rem}.pr-1\.5{padding-right:.375rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pt-5{padding-top:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tracking-tight{letter-spacing:-.025em}.text-blackberry-1000{color:hsl(var(--blackberry-1000))}.text-blueberry-500{color:hsl(var(--blueberry-500))}.text-coconut-1000{color:hsl(var(--coconut-1000))}.text-destructive{color:hsl(var(--destructive))}.text-icon-primary{color:hsl(var(--icon-primary))}.text-icon-secondary{color:hsl(var(--icon-secondary))}.text-icon-tertiary{color:hsl(var(--icon-tertiary))}.text-kiwi-500{color:hsl(var(--kiwi-500))}.text-kiwi-600{color:hsl(var(--kiwi-600))}.text-kiwi-800{color:hsl(var(--kiwi-800))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-primary{color:hsl(var(--primary))}.text-text-disabled{color:hsl(var(--text-disabled))}.text-text-primary{color:hsl(var(--text-primary))}.text-text-secondary{color:hsl(var(--text-secondary))}.text-text-tertiary{color:hsl(var(--text-tertiary))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/90{color:#ffffffe6}.opacity-50{opacity:.5}.shadow-\[0px_0px_20px_0px_hsl\(var\(--shadow-color\)\/0\.05\)\]{--tw-shadow: 0px 0px 20px 0px hsl(var(--shadow-color)/.05);--tw-shadow-colored: 0px 0px 20px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-primary\/20{--tw-ring-color: hsl(var(--primary) / .2)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide::-webkit-scrollbar{display:none}.\[-ms-overflow-style\:none\]{-ms-overflow-style:none}.\[scrollbar-width\:none\]{scrollbar-width:none}*{-webkit-tap-highlight-color:transparent;touch-action:manipulation}.placeholder\:text-text-tertiary::-moz-placeholder{color:hsl(var(--text-tertiary))}.placeholder\:text-text-tertiary::placeholder{color:hsl(var(--text-tertiary))}.hover\:bg-bg-secondary:hover{background-color:hsl(var(--bg-secondary))}.hover\:bg-bg-secondary\/50:hover{background-color:hsl(var(--bg-secondary) / .5)}.hover\:bg-button-primary:hover{background-color:hsl(var(--button-primary))}.hover\:text-icon-primary:hover{color:hsl(var(--icon-primary))}.hover\:text-text-primary:hover{color:hsl(var(--text-primary))}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.focus\:border-primary:focus{border-color:hsl(var(--primary))}.focus\:outline:focus{outline-style:solid}.focus\:outline-1:focus{outline-width:1px}.focus\:outline-2:focus{outline-width:2px}.focus\:outline-offset-2:focus{outline-offset:2px}.focus\:outline-border-tertiary:focus{outline-color:hsl(var(--border-tertiary))}.focus\:outline-ring:focus{outline-color:hsl(var(--ring))}.active\:opacity-100:active{opacity:1}.active\:opacity-80:active{opacity:.8}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.data-\[highlighted\]\:bg-bg-secondary[data-highlighted]{background-color:hsl(var(--bg-secondary))}@media (min-width: 640px){.sm\:block{display:block}.sm\:hidden{display:none}.sm\:w-auto{width:auto}.sm\:grid-cols-\[repeat\(auto-fit\,minmax\(380px\,1fr\)\)\]{grid-template-columns:repeat(auto-fit,minmax(380px,1fr))}.sm\:flex-row{flex-direction:row}.sm\:border-l{border-left-width:1px}}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}
|
package/dist/client/index.html
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
mq.addEventListener('change', update);
|
|
16
16
|
})();
|
|
17
17
|
</script>
|
|
18
|
-
<script type="module" crossorigin src="/assets/index-
|
|
19
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
18
|
+
<script type="module" crossorigin src="/assets/index-D6Eq_zDr.js"></script>
|
|
19
|
+
<link rel="stylesheet" crossorigin href="/assets/index-zLaI5tVH.css">
|
|
20
20
|
</head>
|
|
21
21
|
<body>
|
|
22
22
|
<div id="root"></div>
|
package/dist/server/index.js
CHANGED
|
@@ -2358,7 +2358,6 @@ var cors = (options) => {
|
|
|
2358
2358
|
// server/db.ts
|
|
2359
2359
|
import { pathToFileURL } from "url";
|
|
2360
2360
|
import { join as join2 } from "path";
|
|
2361
|
-
var prismaClient = null;
|
|
2362
2361
|
var cachedSchema = null;
|
|
2363
2362
|
var PrismaClientConstructor = null;
|
|
2364
2363
|
async function loadPrismaClient() {
|
|
@@ -2379,18 +2378,14 @@ async function loadPrismaClient() {
|
|
|
2379
2378
|
);
|
|
2380
2379
|
}
|
|
2381
2380
|
}
|
|
2382
|
-
async function
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
} catch (error) {
|
|
2390
|
-
throw error;
|
|
2391
|
-
}
|
|
2381
|
+
async function withPrisma(fn) {
|
|
2382
|
+
const ClientConstructor = await loadPrismaClient();
|
|
2383
|
+
const prisma = new ClientConstructor({ log: ["error"] });
|
|
2384
|
+
try {
|
|
2385
|
+
return await fn(prisma);
|
|
2386
|
+
} finally {
|
|
2387
|
+
await prisma.$disconnect();
|
|
2392
2388
|
}
|
|
2393
|
-
return prismaClient;
|
|
2394
2389
|
}
|
|
2395
2390
|
async function getDatabaseSchema() {
|
|
2396
2391
|
await loadPrismaClient();
|
|
@@ -2399,29 +2394,18 @@ async function getDatabaseSchema() {
|
|
|
2399
2394
|
}
|
|
2400
2395
|
return cachedSchema;
|
|
2401
2396
|
}
|
|
2402
|
-
async function
|
|
2403
|
-
const prisma = await getPrismaClient();
|
|
2397
|
+
async function withModel(tableName, fn) {
|
|
2404
2398
|
const schema = await getDatabaseSchema();
|
|
2405
2399
|
const modelExists = schema.models.some((m) => m.name === tableName);
|
|
2406
2400
|
if (!modelExists) {
|
|
2407
2401
|
throw new Error(`Table '${tableName}' not found`);
|
|
2408
2402
|
}
|
|
2409
2403
|
const modelName = tableName.charAt(0).toLowerCase() + tableName.slice(1);
|
|
2410
|
-
return prisma
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
await prismaClient.$disconnect();
|
|
2415
|
-
}
|
|
2404
|
+
return withPrisma(async (prisma) => {
|
|
2405
|
+
const model = prisma[modelName];
|
|
2406
|
+
return fn(model, prisma);
|
|
2407
|
+
});
|
|
2416
2408
|
}
|
|
2417
|
-
process.on("SIGINT", async () => {
|
|
2418
|
-
await disconnectPrisma();
|
|
2419
|
-
process.exit(0);
|
|
2420
|
-
});
|
|
2421
|
-
process.on("SIGTERM", async () => {
|
|
2422
|
-
await disconnectPrisma();
|
|
2423
|
-
process.exit(0);
|
|
2424
|
-
});
|
|
2425
2409
|
|
|
2426
2410
|
// server/lib/errors.ts
|
|
2427
2411
|
function getCleanMessage(message) {
|
|
@@ -6608,49 +6592,50 @@ tableRoutes.get("/:tableName", async (c) => {
|
|
|
6608
6592
|
const tableName = c.req.param("tableName");
|
|
6609
6593
|
const query = listQuerySchema.parse(c.req.query());
|
|
6610
6594
|
try {
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
const schema = await getDatabaseSchema();
|
|
6618
|
-
const modelDef = schema.models.find((m) => m.name === tableName);
|
|
6619
|
-
const field = modelDef?.fields.find((f) => f.name === query.orderBy);
|
|
6620
|
-
if (field && field.kind !== "object") {
|
|
6621
|
-
queryOptions.orderBy = {
|
|
6622
|
-
[query.orderBy]: query.orderDir
|
|
6623
|
-
};
|
|
6624
|
-
}
|
|
6625
|
-
}
|
|
6626
|
-
if (query.filters) {
|
|
6627
|
-
try {
|
|
6595
|
+
return await withModel(tableName, async (model) => {
|
|
6596
|
+
const queryOptions = {
|
|
6597
|
+
skip: query.offset,
|
|
6598
|
+
take: query.limit
|
|
6599
|
+
};
|
|
6600
|
+
if (query.orderBy) {
|
|
6628
6601
|
const schema = await getDatabaseSchema();
|
|
6629
6602
|
const modelDef = schema.models.find((m) => m.name === tableName);
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
}
|
|
6603
|
+
const field = modelDef?.fields.find((f) => f.name === query.orderBy);
|
|
6604
|
+
if (field && field.kind !== "object") {
|
|
6605
|
+
queryOptions.orderBy = {
|
|
6606
|
+
[query.orderBy]: query.orderDir
|
|
6607
|
+
};
|
|
6636
6608
|
}
|
|
6637
|
-
} catch {
|
|
6638
6609
|
}
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6610
|
+
if (query.filters) {
|
|
6611
|
+
try {
|
|
6612
|
+
const schema = await getDatabaseSchema();
|
|
6613
|
+
const modelDef = schema.models.find((m) => m.name === tableName);
|
|
6614
|
+
if (modelDef) {
|
|
6615
|
+
const filters = JSON.parse(query.filters);
|
|
6616
|
+
const filterWhere = buildFilterWhereClause(filters, modelDef);
|
|
6617
|
+
if (filterWhere) {
|
|
6618
|
+
queryOptions.where = filterWhere;
|
|
6619
|
+
}
|
|
6620
|
+
}
|
|
6621
|
+
} catch {
|
|
6622
|
+
}
|
|
6651
6623
|
}
|
|
6652
|
-
|
|
6653
|
-
|
|
6624
|
+
const [rows, total] = await Promise.all([
|
|
6625
|
+
model.findMany(queryOptions),
|
|
6626
|
+
model.count(queryOptions.where ? { where: queryOptions.where } : {})
|
|
6627
|
+
]);
|
|
6628
|
+
const response = {
|
|
6629
|
+
success: true,
|
|
6630
|
+
data: {
|
|
6631
|
+
rows,
|
|
6632
|
+
total,
|
|
6633
|
+
offset: query.offset,
|
|
6634
|
+
limit: query.limit
|
|
6635
|
+
}
|
|
6636
|
+
};
|
|
6637
|
+
return c.json(response);
|
|
6638
|
+
});
|
|
6654
6639
|
} catch (error) {
|
|
6655
6640
|
return handlePrismaError(error, c);
|
|
6656
6641
|
}
|
|
@@ -6659,26 +6644,27 @@ tableRoutes.get("/:tableName/:id", async (c) => {
|
|
|
6659
6644
|
const tableName = c.req.param("tableName");
|
|
6660
6645
|
const rawId = c.req.param("id");
|
|
6661
6646
|
try {
|
|
6662
|
-
const model = await getModelDelegate(tableName);
|
|
6663
6647
|
const id = await convertIdParameter(tableName, rawId);
|
|
6664
|
-
|
|
6665
|
-
|
|
6648
|
+
return await withModel(tableName, async (model) => {
|
|
6649
|
+
const record = await model.findUnique({
|
|
6650
|
+
where: { id }
|
|
6651
|
+
});
|
|
6652
|
+
if (!record) {
|
|
6653
|
+
return c.json(
|
|
6654
|
+
{
|
|
6655
|
+
success: false,
|
|
6656
|
+
error: "Record not found",
|
|
6657
|
+
code: "NOT_FOUND"
|
|
6658
|
+
},
|
|
6659
|
+
404
|
|
6660
|
+
);
|
|
6661
|
+
}
|
|
6662
|
+
const response = {
|
|
6663
|
+
success: true,
|
|
6664
|
+
data: record
|
|
6665
|
+
};
|
|
6666
|
+
return c.json(response);
|
|
6666
6667
|
});
|
|
6667
|
-
if (!record) {
|
|
6668
|
-
return c.json(
|
|
6669
|
-
{
|
|
6670
|
-
success: false,
|
|
6671
|
-
error: "Record not found",
|
|
6672
|
-
code: "NOT_FOUND"
|
|
6673
|
-
},
|
|
6674
|
-
404
|
|
6675
|
-
);
|
|
6676
|
-
}
|
|
6677
|
-
const response = {
|
|
6678
|
-
success: true,
|
|
6679
|
-
data: record
|
|
6680
|
-
};
|
|
6681
|
-
return c.json(response);
|
|
6682
6668
|
} catch (error) {
|
|
6683
6669
|
return handlePrismaError(error, c);
|
|
6684
6670
|
}
|
|
@@ -6687,16 +6673,17 @@ tableRoutes.post("/:tableName", async (c) => {
|
|
|
6687
6673
|
const tableName = c.req.param("tableName");
|
|
6688
6674
|
try {
|
|
6689
6675
|
const body = await c.req.json();
|
|
6690
|
-
const model = await getModelDelegate(tableName);
|
|
6691
6676
|
const safeData = await filterEditableFields(tableName, body);
|
|
6692
|
-
|
|
6693
|
-
|
|
6677
|
+
return await withModel(tableName, async (model) => {
|
|
6678
|
+
const record = await model.create({
|
|
6679
|
+
data: safeData
|
|
6680
|
+
});
|
|
6681
|
+
const response = {
|
|
6682
|
+
success: true,
|
|
6683
|
+
data: record
|
|
6684
|
+
};
|
|
6685
|
+
return c.json(response, 201);
|
|
6694
6686
|
});
|
|
6695
|
-
const response = {
|
|
6696
|
-
success: true,
|
|
6697
|
-
data: record
|
|
6698
|
-
};
|
|
6699
|
-
return c.json(response, 201);
|
|
6700
6687
|
} catch (error) {
|
|
6701
6688
|
return handlePrismaError(error, c);
|
|
6702
6689
|
}
|
|
@@ -6706,18 +6693,19 @@ tableRoutes.patch("/:tableName/:id", async (c) => {
|
|
|
6706
6693
|
const rawId = c.req.param("id");
|
|
6707
6694
|
try {
|
|
6708
6695
|
const body = await c.req.json();
|
|
6709
|
-
const model = await getModelDelegate(tableName);
|
|
6710
6696
|
const id = await convertIdParameter(tableName, rawId);
|
|
6711
6697
|
const safeData = await filterEditableFields(tableName, body);
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
6698
|
+
return await withModel(tableName, async (model) => {
|
|
6699
|
+
const record = await model.update({
|
|
6700
|
+
where: { id },
|
|
6701
|
+
data: safeData
|
|
6702
|
+
});
|
|
6703
|
+
const response = {
|
|
6704
|
+
success: true,
|
|
6705
|
+
data: record
|
|
6706
|
+
};
|
|
6707
|
+
return c.json(response);
|
|
6715
6708
|
});
|
|
6716
|
-
const response = {
|
|
6717
|
-
success: true,
|
|
6718
|
-
data: record
|
|
6719
|
-
};
|
|
6720
|
-
return c.json(response);
|
|
6721
6709
|
} catch (error) {
|
|
6722
6710
|
return handlePrismaError(error, c);
|
|
6723
6711
|
}
|
|
@@ -6726,16 +6714,17 @@ tableRoutes.delete("/:tableName/:id", async (c) => {
|
|
|
6726
6714
|
const tableName = c.req.param("tableName");
|
|
6727
6715
|
const rawId = c.req.param("id");
|
|
6728
6716
|
try {
|
|
6729
|
-
const model = await getModelDelegate(tableName);
|
|
6730
6717
|
const id = await convertIdParameter(tableName, rawId);
|
|
6731
|
-
await model
|
|
6732
|
-
|
|
6718
|
+
return await withModel(tableName, async (model) => {
|
|
6719
|
+
await model.delete({
|
|
6720
|
+
where: { id }
|
|
6721
|
+
});
|
|
6722
|
+
const response = {
|
|
6723
|
+
success: true,
|
|
6724
|
+
data: { message: "Record deleted successfully" }
|
|
6725
|
+
};
|
|
6726
|
+
return c.json(response);
|
|
6733
6727
|
});
|
|
6734
|
-
const response = {
|
|
6735
|
-
success: true,
|
|
6736
|
-
data: { message: "Record deleted successfully" }
|
|
6737
|
-
};
|
|
6738
|
-
return c.json(response);
|
|
6739
6728
|
} catch (error) {
|
|
6740
6729
|
return handlePrismaError(error, c);
|
|
6741
6730
|
}
|
|
@@ -6778,7 +6767,9 @@ app.get("/health", (c) => {
|
|
|
6778
6767
|
app.use("/*", serveStatic({ root: clientPath }));
|
|
6779
6768
|
console.log(`Cloud Studio starting on http://${HOSTNAME}:${PORT}`);
|
|
6780
6769
|
try {
|
|
6781
|
-
await
|
|
6770
|
+
await withPrisma(async (prisma) => {
|
|
6771
|
+
await prisma.$queryRaw`SELECT 1`;
|
|
6772
|
+
});
|
|
6782
6773
|
console.log("Prisma Client connected");
|
|
6783
6774
|
} catch (error) {
|
|
6784
6775
|
console.error("Failed to connect to Prisma Client:", error);
|