@prisma/studio-core 0.0.0-dev.202504121748 → 0.0.0-dev.202504132239
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data/pglite/index.cjs +1 -1
- package/dist/data/pglite/index.js +1 -1
- package/dist/ui/index.cjs +587 -427
- package/dist/ui/index.js +163 -1
- package/package.json +1 -1
package/dist/ui/index.js
CHANGED
|
@@ -1 +1,163 @@
|
|
|
1
|
-
import{B as x,aa as b,c as p,q as g,r as P,t as C}from"../chunk-N2MLAUEV.js";import"../chunk-2FW6TKD6.js";import"../index-ESMXH6DI.css";import{Slot as se}from"@radix-ui/react-slot";import{useQuery as ee}from"@tanstack/react-query";import{QueryClient as W,QueryClientProvider as K}from"@tanstack/react-query";import*as c from"react";import{onlineManager as B,useQueryClient as V}from"@tanstack/react-query";var w=class{#t;#u;#p;#c;#e=!1;#d;#o;#s;#r;#n;#i;#a;#l;constructor(e){let{client:t,queryFlavor:o,version:r,onlineManager:s,buttonPosition:a,position:n,initialIsOpen:l,errorTypes:u,styleNonce:i,shadowDOMTarget:T}=e;this.#t=p(t),this.#p=o,this.#c=r,this.#u=s,this.#d=i,this.#o=T,this.#s=p(a),this.#r=p(n),this.#n=p(l),this.#i=p(u)}setButtonPosition(e){this.#s[1](e)}setPosition(e){this.#r[1](e)}setInitialIsOpen(e){this.#n[1](e)}setErrorTypes(e){this.#i[1](e)}setClient(e){this.#t[1](e)}mount(e){if(this.#e)throw new Error("Devtools is already mounted");let t=x(()=>{let o=this,[r]=this.#s,[s]=this.#r,[a]=this.#n,[n]=this.#i,[l]=this.#t,u;return this.#a?u=this.#a:(u=C(()=>import("../CPIOZS5X-NALOZFPD.js")),this.#a=u),b(this.#d,this.#o),g(u,P({get queryFlavor(){return o.#p},get version(){return o.#c},get onlineManager(){return o.#u},get shadowDOMTarget(){return o.#o}},{get client(){return l()},get buttonPosition(){return r()},get position(){return s()},get initialIsOpen(){return a()},get errorTypes(){return n()}}))},e);this.#e=!0,this.#l=t}unmount(){if(!this.#e)throw new Error("Devtools is not mounted");this.#l?.(),this.#e=!1}},R=class{#t;#u;#p;#c;#e=!1;#d;#o;#s;#r;#n;#i;#a;#l;#m;constructor(e){let{client:t,queryFlavor:o,version:r,onlineManager:s,buttonPosition:a,position:n,initialIsOpen:l,errorTypes:u,styleNonce:i,shadowDOMTarget:T,onClose:F}=e;this.#t=p(t),this.#p=o,this.#c=r,this.#u=s,this.#d=i,this.#o=T,this.#s=p(a),this.#r=p(n),this.#n=p(l),this.#i=p(u),this.#a=p(F)}setButtonPosition(e){this.#s[1](e)}setPosition(e){this.#r[1](e)}setInitialIsOpen(e){this.#n[1](e)}setErrorTypes(e){this.#i[1](e)}setClient(e){this.#t[1](e)}setOnClose(e){this.#a[1](()=>e)}mount(e){if(this.#e)throw new Error("Devtools is already mounted");let t=x(()=>{let o=this,[r]=this.#s,[s]=this.#r,[a]=this.#n,[n]=this.#i,[l]=this.#t,[u]=this.#a,i;return this.#l?i=this.#l:(i=C(()=>import("../OKF6E45R-6KC3BLVB.js")),this.#l=i),b(this.#d,this.#o),g(i,P({get queryFlavor(){return o.#p},get version(){return o.#c},get onlineManager(){return o.#u},get shadowDOMTarget(){return o.#o}},{get client(){return l()},get buttonPosition(){return r()},get position(){return s()},get initialIsOpen(){return a()},get errorTypes(){return n()},get onClose(){return u()}}))},e);this.#e=!0,this.#m=t}unmount(){if(!this.#e)throw new Error("Devtools is not mounted");this.#m?.(),this.#e=!1}};import{jsx as _}from"react/jsx-runtime";function N(e){let t=V(e.client),o=c.useRef(null),{buttonPosition:r,position:s,initialIsOpen:a,errorTypes:n,styleNonce:l,shadowDOMTarget:u}=e,[i]=c.useState(new w({client:t,queryFlavor:"React Query",version:"5",onlineManager:B,buttonPosition:r,position:s,initialIsOpen:a,errorTypes:n,styleNonce:l,shadowDOMTarget:u}));return c.useEffect(()=>{i.setClient(t)},[t,i]),c.useEffect(()=>{r&&i.setButtonPosition(r)},[r,i]),c.useEffect(()=>{s&&i.setPosition(s)},[s,i]),c.useEffect(()=>{i.setInitialIsOpen(a||!1)},[a,i]),c.useEffect(()=>{i.setErrorTypes(n||[])},[n,i]),c.useEffect(()=>(o.current&&i.mount(o.current),()=>{i.unmount()}),[i]),_("div",{dir:"ltr",className:"tsqd-parent-container",ref:o})}import*as m from"react";import{onlineManager as $,useQueryClient as z}from"@tanstack/react-query";import{jsx as U}from"react/jsx-runtime";function E(e){let t=z(e.client),o=m.useRef(null),{errorTypes:r,styleNonce:s,shadowDOMTarget:a}=e,[n]=m.useState(new R({client:t,queryFlavor:"React Query",version:"5",onlineManager:$,buttonPosition:"bottom-left",position:"bottom",initialIsOpen:!0,errorTypes:r,styleNonce:s,shadowDOMTarget:a,onClose:e.onClose}));return m.useEffect(()=>{n.setClient(t)},[t,n]),m.useEffect(()=>{n.setOnClose(e.onClose??(()=>{}))},[e.onClose,n]),m.useEffect(()=>{n.setErrorTypes(r||[])},[r,n]),m.useEffect(()=>(o.current&&n.mount(o.current),()=>{n.unmount()}),[n]),U("div",{style:{height:"500px",...e.style},className:"tsqd-parent-container",ref:o})}var I=process.env.NODE_ENV!=="development"?function(){return null}:N,Ne=process.env.NODE_ENV!=="development"?function(){return null}:E;import{NuqsAdapter as G}from"nuqs/adapters/react";import{createContext as J,useContext as X,useState as Y}from"react";import{jsx as D,jsxs as j}from"react/jsx-runtime";var Z=new W,O=J(void 0);function M(e){let{children:t,...o}=e,[r,s]=Y(null);return j(K,{client:Z,children:[D(I,{}),D(G,{children:D(O.Provider,{value:{...o,activeTable:r,setActiveTable:s},children:t})})]})}function y(){let e=X(O);if(!e)throw new Error("`useStudio` must be used within a `StudioContext.Provider`");return e}var Q=-1;function A(){let{adapter:e}=y();return ee({initialData:{schemas:{[e.defaultSchema||"db"]:{tables:{}}}},initialDataUpdatedAt:Q,queryFn:async({signal:t})=>{let[o,r]=await e.introspect({abortSignal:t});if(o)throw o;return r},queryKey:["introspection"],staleTime:t=>t.state.dataUpdatedAt===Q?0:1/0})}import{clsx as te}from"clsx";import{twMerge as oe}from"tailwind-merge";function S(...e){return oe(te(e))}import{jsx as h,jsxs as ie}from"react/jsx-runtime";var f=()=>{let{data:e}=A(),{activeTable:t,adapter:o,setActiveTable:r}=y();return h("div",{className:"ps-flex ps-flex-col ps-w-64 ps-gap-4 ps-shrink-0",children:h(f.Block,{label:"Tables",children:Object.values(e.schemas[o.defaultSchema||"db"].tables).map(s=>h(f.Item,{isActive:t===s,onClick:a=>{a.preventDefault(),t!==s&&r(s)},className:`ps-px-2 ps-py-1 ps-cursor-pointer ps-rounded ${t===s?"ps-bg-primary ps-text-white":"ps-hover:ps-bg-gray-100"}`,children:s.name},`${s.schema}-${s.name}`))})})},re=({className:e,label:t,children:o,...r})=>ie("div",{className:S("ps-rounded-lg ps-border ps-bg-card ps-text-card-foreground ps-shadow-xs",e),...r,children:[h("div",{className:"ps-pt-4 ps-pb-2 ps-px-4",children:h("h2",{className:"ps-text-sm ps-font-medium",children:t})}),h("nav",{"aria-label":t,className:"ps-flex ps-flex-col ps-gap-px ps-pb-3",children:o})]}),ne=({className:e,asChild:t=!1,isActive:o,size:r,...s})=>h(t?se:"button",{"data-sidebar":"menu-button","data-size":r,"data-active":o,className:S("ps-py-1.5 ps-px-4 ps-text-sm ps-font-medium ps-flex ps-gap-2 ps-items-center ps-border ps-border-transparent ps-bg-transparent ps-hover:bg-muted/50",e),...s});f.Block=re;f.Item=ne;var q=f;import{createContext as ae,useContext as et,useEffect as le,useState as ue}from"react";import{jsx as de}from"react/jsx-runtime";var pe={theme:"system",setTheme:()=>null},ce=ae(pe);function k({children:e,defaultTheme:t="system",storageKey:o="vite-ui-theme",...r}){let[s,a]=ue(()=>localStorage.getItem(o)||t);le(()=>{let l=window.document.documentElement;if(l.classList.remove("light","dark"),s==="system"){let u=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";l.classList.add(u);return}l.classList.add(s)},[s]);let n={theme:s,setTheme:l=>{localStorage.setItem(o,l),a(l)}};return de(ce.Provider,{...r,value:n,children:e})}import{jsx as v,jsxs as he}from"react/jsx-runtime";function me(e){let{adapter:t}=e;return t?v(k,{children:v(M,{adapter:t,children:he("div",{className:"ps-flex ps-gap-4 ps-w-full ps-rounded-sm ps-bg-background ps-p-4 ps-relative",children:[v(q,{}),v("div",{className:"ps-flex ps-w-full ps-flex-col ps-border ps-rounded-lg"})]})})}):(console.error("No adapter provided to Studio component"),v("div",{children:"Error: No adapter provided"}))}export{me as Studio};
|
|
1
|
+
import{B as Re,aa as ve,c as y,q as Pe,r as we,t as ke}from"../chunk-N2MLAUEV.js";import"../chunk-2FW6TKD6.js";import"../index-ESMXH6DI.css";import{Slot as et}from"@radix-ui/react-slot";import{useQuery as Ya}from"@tanstack/react-query";import{QueryClient as Va,QueryClientProvider as Wa}from"@tanstack/react-query";import*as M from"react";import{onlineManager as qa,useQueryClient as Ua}from"@tanstack/react-query";var Je=class{#a;#f;#i;#n;#e=!1;#c;#t;#o;#l;#u;#s;#r;#d;constructor(e){let{client:a,queryFlavor:t,version:o,onlineManager:l,buttonPosition:f,position:d,initialIsOpen:L,errorTypes:x,styleNonce:i,shadowDOMTarget:C}=e;this.#a=y(a),this.#i=t,this.#n=o,this.#f=l,this.#c=i,this.#t=C,this.#o=y(f),this.#l=y(d),this.#u=y(L),this.#s=y(x)}setButtonPosition(e){this.#o[1](e)}setPosition(e){this.#l[1](e)}setInitialIsOpen(e){this.#u[1](e)}setErrorTypes(e){this.#s[1](e)}setClient(e){this.#a[1](e)}mount(e){if(this.#e)throw new Error("Devtools is already mounted");let a=Re(()=>{let t=this,[o]=this.#o,[l]=this.#l,[f]=this.#u,[d]=this.#s,[L]=this.#a,x;return this.#r?x=this.#r:(x=ke(()=>import("../CPIOZS5X-NALOZFPD.js")),this.#r=x),ve(this.#c,this.#t),Pe(x,we({get queryFlavor(){return t.#i},get version(){return t.#n},get onlineManager(){return t.#f},get shadowDOMTarget(){return t.#t}},{get client(){return L()},get buttonPosition(){return o()},get position(){return l()},get initialIsOpen(){return f()},get errorTypes(){return d()}}))},e);this.#e=!0,this.#d=a}unmount(){if(!this.#e)throw new Error("Devtools is not mounted");this.#d?.(),this.#e=!1}},_e=class{#a;#f;#i;#n;#e=!1;#c;#t;#o;#l;#u;#s;#r;#d;#p;constructor(e){let{client:a,queryFlavor:t,version:o,onlineManager:l,buttonPosition:f,position:d,initialIsOpen:L,errorTypes:x,styleNonce:i,shadowDOMTarget:C,onClose:g}=e;this.#a=y(a),this.#i=t,this.#n=o,this.#f=l,this.#c=i,this.#t=C,this.#o=y(f),this.#l=y(d),this.#u=y(L),this.#s=y(x),this.#r=y(g)}setButtonPosition(e){this.#o[1](e)}setPosition(e){this.#l[1](e)}setInitialIsOpen(e){this.#u[1](e)}setErrorTypes(e){this.#s[1](e)}setClient(e){this.#a[1](e)}setOnClose(e){this.#r[1](()=>e)}mount(e){if(this.#e)throw new Error("Devtools is already mounted");let a=Re(()=>{let t=this,[o]=this.#o,[l]=this.#l,[f]=this.#u,[d]=this.#s,[L]=this.#a,[x]=this.#r,i;return this.#d?i=this.#d:(i=ke(()=>import("../OKF6E45R-6KC3BLVB.js")),this.#d=i),ve(this.#c,this.#t),Pe(i,we({get queryFlavor(){return t.#i},get version(){return t.#n},get onlineManager(){return t.#f},get shadowDOMTarget(){return t.#t}},{get client(){return L()},get buttonPosition(){return o()},get position(){return l()},get initialIsOpen(){return f()},get errorTypes(){return d()},get onClose(){return x()}}))},e);this.#e=!0,this.#p=a}unmount(){if(!this.#e)throw new Error("Devtools is not mounted");this.#p?.(),this.#e=!1}};import{jsx as Oa}from"react/jsx-runtime";function Ye(e){let a=Ua(e.client),t=M.useRef(null),{buttonPosition:o,position:l,initialIsOpen:f,errorTypes:d,styleNonce:L,shadowDOMTarget:x}=e,[i]=M.useState(new Je({client:a,queryFlavor:"React Query",version:"5",onlineManager:qa,buttonPosition:o,position:l,initialIsOpen:f,errorTypes:d,styleNonce:L,shadowDOMTarget:x}));return M.useEffect(()=>{i.setClient(a)},[a,i]),M.useEffect(()=>{o&&i.setButtonPosition(o)},[o,i]),M.useEffect(()=>{l&&i.setPosition(l)},[l,i]),M.useEffect(()=>{i.setInitialIsOpen(f||!1)},[f,i]),M.useEffect(()=>{i.setErrorTypes(d||[])},[d,i]),M.useEffect(()=>(t.current&&i.mount(t.current),()=>{i.unmount()}),[i]),Oa("div",{dir:"ltr",className:"tsqd-parent-container",ref:t})}import*as q from"react";import{onlineManager as Na,useQueryClient as Ea}from"@tanstack/react-query";import{jsx as Ga}from"react/jsx-runtime";function $e(e){let a=Ea(e.client),t=q.useRef(null),{errorTypes:o,styleNonce:l,shadowDOMTarget:f}=e,[d]=q.useState(new _e({client:a,queryFlavor:"React Query",version:"5",onlineManager:Na,buttonPosition:"bottom-left",position:"bottom",initialIsOpen:!0,errorTypes:o,styleNonce:l,shadowDOMTarget:f,onClose:e.onClose}));return q.useEffect(()=>{d.setClient(a)},[a,d]),q.useEffect(()=>{d.setOnClose(e.onClose??(()=>{}))},[e.onClose,d]),q.useEffect(()=>{d.setErrorTypes(o||[])},[o,d]),q.useEffect(()=>(t.current&&d.mount(t.current),()=>{d.unmount()}),[d]),Ga("div",{style:{height:"500px",...e.style},className:"tsqd-parent-container",ref:t})}var je=process.env.NODE_ENV!=="development"?function(){return null}:Ye,vo=process.env.NODE_ENV!=="development"?function(){return null}:$e;import{NuqsAdapter as Xa}from"nuqs/adapters/react";import{createContext as Ka,useContext as Qa,useState as Za}from"react";import{jsx as be,jsxs as _a}from"react/jsx-runtime";var Ja=new Va,ea=Ka(void 0);function aa(e){let{children:a,...t}=e,[o,l]=Za(null);return _a(Wa,{client:Ja,children:[be(je,{}),be(Xa,{children:be(ea.Provider,{value:{...t,activeTable:o,setActiveTable:l},children:a})})]})}function B(){let e=Qa(ea);if(!e)throw new Error("`useStudio` must be used within a `StudioContext.Provider`");return e}var ta=-1;function oa(){let{adapter:e}=B();return Ya({initialData:{schemas:{[e.defaultSchema||"db"]:{tables:{}}}},initialDataUpdatedAt:ta,queryFn:async({signal:a})=>{let[t,o]=await e.introspect({abortSignal:a});if(t)throw t;return o},queryKey:["introspection"],staleTime:a=>a.state.dataUpdatedAt===ta?0:1/0})}import{clsx as $a}from"clsx";import{twMerge as ja}from"tailwind-merge";function u(...e){return ja($a(e))}import{jsx as Q,jsxs as ot}from"react/jsx-runtime";var ae=()=>{let{data:e}=oa(),{activeTable:a,adapter:t,setActiveTable:o}=B();return Q("div",{className:"ps-flex ps-flex-col ps-w-64 ps-gap-4 ps-shrink-0",children:Q(ae.Block,{label:"Tables",children:Object.values(e.schemas[t.defaultSchema||"db"].tables).map(l=>Q(ae.Item,{isActive:a===l,onClick:f=>{f.preventDefault(),a!==l&&o(l)},className:`ps-px-2 ps-py-1 ps-cursor-pointer ps-rounded ${a===l?"ps-bg-primary ps-text-white":"ps-hover:ps-bg-gray-100"}`,children:l.name},`${l.schema}-${l.name}`))})})},at=({className:e,label:a,children:t,...o})=>ot("div",{className:u("ps-rounded-lg ps-border ps-bg-card ps-text-card-foreground ps-shadow-xs",e),...o,children:[Q("div",{className:"ps-pt-4 ps-pb-2 ps-px-4",children:Q("h2",{className:"ps-text-sm ps-font-medium",children:a})}),Q("nav",{"aria-label":a,className:"ps-flex ps-flex-col ps-gap-px ps-pb-3",children:t})]}),tt=({className:e,asChild:a=!1,isActive:t,size:o,...l})=>Q(a?et:"button",{"data-sidebar":"menu-button","data-size":o,"data-active":t,className:u("ps-py-1.5 ps-px-4 ps-text-sm ps-font-medium ps-flex ps-gap-2 ps-items-center ps-border ps-border-transparent ps-bg-transparent ps-hover:bg-muted/50",e),...l});ae.Block=at;ae.Item=tt;var la=ae;import{useQuery as lt}from"@tanstack/react-query";function ua(){let{activeTable:e,adapter:a}=B();return lt({enabled:!!e,gcTime:0,queryKey:["active-table",e?.schema,e?.name,"query"],queryFn:async({signal:t})=>{let[o,l]=await a.query({table:e.name,schema:e.schema},{abortSignal:t});if(o)throw o;return l}})}import{DndContext as Nt,MouseSensor as Et,useSensor as Gt,useSensors as zt}from"@dnd-kit/core";import{horizontalListSortingStrategy as Vt,SortableContext as Wt,useSortable as Xt}from"@dnd-kit/sortable";import{CSS as Kt}from"@dnd-kit/utilities";import{getCoreRowModel as Qt,getFilteredRowModel as Zt,getPaginationRowModel as Jt,getSortedRowModel as _t,useReactTable as Yt}from"@tanstack/react-table";import{useEffect as $t,useMemo as jt,useState as j}from"react";import*as O from"react";import{jsx as U}from"react/jsx-runtime";var ye=O.forwardRef(({className:e,...a},t)=>U("div",{className:"ps-relative ps-w-full ps-overflow-auto ps-flex ps-items-start ps-h-full",children:U("table",{ref:t,className:u("ps-w-full ps-caption-bottom ps-text-sm table-fixed",e),...a})}));ye.displayName="Table";var Me=O.forwardRef(({className:e,...a},t)=>U("thead",{ref:t,className:u("[&_tr]:ps-border-b",e),...a}));Me.displayName="TableHeader";var De=O.forwardRef(({className:e,...a},t)=>U("tbody",{ref:t,className:u("[&_tr:last-child]:ps-border-0",e),...a}));De.displayName="TableBody";var ut=O.forwardRef(({className:e,...a},t)=>U("tfoot",{ref:t,className:u("ps-border-t ps-bg-muted/50 ps-font-medium [&>tr]:last:ps-border-b-0",e),...a}));ut.displayName="TableFooter";var te=O.forwardRef(({className:e,...a},t)=>U("tr",{ref:t,className:u("ps-border-b ps-transition-colors hover:ps-bg-muted/50 data-[state=selected]:ps-bg-muted",e),...a}));te.displayName="TableRow";var xe=O.forwardRef(({className:e,...a},t)=>U("th",{ref:t,className:u("ps-h-10 ps-px-2 ps-text-left ps-align-middle ps-font-medium ps-text-muted-foreground [&:has([role=checkbox])]:ps-pr-0 [&>[role=checkbox]]:ps-translate-y-[2px]",e),...a}));xe.displayName="TableHead";var oe=O.forwardRef(({className:e,...a},t)=>U("td",{ref:t,className:u("ps-p-2 ps-align-middle [&:has([role=checkbox])]:ps-pr-0 [&>[role=checkbox]]:ps-translate-y-[2px]",e),...a}));oe.displayName="TableCell";var st=O.forwardRef(({className:e,...a},t)=>U("caption",{ref:t,className:u("ps-mt-4 ps-text-sm ps-text-muted-foreground",e),...a}));st.displayName="TableCaption";import{tokyoNight as gt}from"@uiw/codemirror-theme-tokyo-night";import ht from"@uiw/react-codemirror";import*as H from"@radix-ui/react-popover";import*as k from"react";import{jsx as le}from"react/jsx-runtime";var sa=k.createContext(null),Te=({children:e,...a})=>{let[t,o]=k.useState(!1);return le(sa.Provider,{value:{open:t,setOpen:o},children:le(H.Root,{open:t,onOpenChange:o,...a,children:e})})};Te.displayName="PopoverCell";var Ae=k.forwardRef(({children:e,onDoubleClick:a,className:t,...o},l)=>{let f=k.useContext(sa),[d,L]=k.useState(!1),x=k.useRef(null);return k.useEffect(()=>{let g=ge=>{let he=ge.target;x.current&&!x.current.contains(he)&&(console.log("Outside click - removing focus"),L(!1))};return document.addEventListener("click",g),()=>document.removeEventListener("click",g)},[]),le(H.Trigger,{ref:g=>{typeof l=="function"?l(g):l&&(l.current=g),x.current=g},onClick:g=>{g.preventDefault(),console.log("Click handler - setting focus to true"),L(!0)},onDoubleClick:g=>{g.preventDefault(),f?.setOpen(!0),a?.()},"data-focus":d.toString(),className:u("w-full h-full cursor-pointer",t),...o,children:e})});Ae.displayName="PopoverCellTrigger";var Be=k.forwardRef(({className:e,align:a="center",sideOffset:t=4,...o},l)=>le(H.Portal,{children:le(H.Content,{ref:l,align:a,sideOffset:t,className:u("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Be.displayName=H.Content.displayName;import{forwardRef as dt,createElement as ft}from"react";var ra=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ie=(...e)=>e.filter((a,t,o)=>!!a&&o.indexOf(a)===t).join(" ");import{forwardRef as rt,createElement as fa}from"react";var da={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var ia=rt(({color:e="currentColor",size:a=24,strokeWidth:t=2,absoluteStrokeWidth:o,className:l="",children:f,iconNode:d,...L},x)=>fa("svg",{ref:x,...da,width:a,height:a,stroke:e,strokeWidth:o?Number(t)*24/Number(a):t,className:Ie("lucide",l),...L},[...d.map(([i,C])=>fa(i,C)),...Array.isArray(f)?f:[f]]));var m=(e,a)=>{let t=dt(({className:o,...l},f)=>ft(ia,{ref:f,iconNode:a,className:Ie(`lucide-${ra(e)}`,o),...l}));return t.displayName=`${e}`,t};var V=m("ArrowDownWideNarrow",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]]);var ue=m("ArrowUpWideNarrow",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h4",key:"1krc32"}]]);var N=m("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var Y=m("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var se=m("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var E=m("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var re=m("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);var de=m("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);var fe=m("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var Z=m("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var ie=m("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);var W=m("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);var ne=m("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);var ce=m("PinOff",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);var pe=m("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);import{isValidElement as It}from"react";import*as n from"@radix-ui/react-context-menu";import*as G from"react";import{jsx as R,jsxs as Ue}from"react/jsx-runtime";var na=n.Root,ca=n.Trigger;var it=G.forwardRef(({className:e,inset:a,children:t,...o},l)=>Ue(n.SubTrigger,{ref:l,className:u("ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[state=open]:ps-bg-accent data-[state=open]:ps-text-accent-foreground",a&&"ps-pl-8",e),...o,children:[t,R(E,{className:"ps-ml-auto ps-h-4 ps-w-4"})]}));it.displayName=n.SubTrigger.displayName;var nt=G.forwardRef(({className:e,...a},t)=>R(n.SubContent,{ref:t,className:u("ps-z-50 ps-min-w-[8rem] ps-overflow-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-lg data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-context-menu-content-transform-origin]",e),...a}));nt.displayName=n.SubContent.displayName;var Fe=G.forwardRef(({className:e,...a},t)=>R(n.Portal,{children:R(n.Content,{ref:t,className:u("ps-z-50 ps-max-h-[--radix-context-menu-content-available-height] ps-min-w-[8rem] ps-overflow-y-auto ps-overflow-x-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-md data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-context-menu-content-transform-origin]",e),...a})}));Fe.displayName=n.Content.displayName;var qe=G.forwardRef(({className:e,inset:a,...t},o)=>R(n.Item,{ref:o,className:u("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",a&&"ps-pl-8",e),...t}));qe.displayName=n.Item.displayName;var ct=G.forwardRef(({className:e,children:a,checked:t,...o},l)=>Ue(n.CheckboxItem,{ref:l,className:u("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),checked:t,...o,children:[R("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:R(n.ItemIndicator,{children:R(N,{className:"ps-h-4 ps-w-4"})})}),a]}));ct.displayName=n.CheckboxItem.displayName;var pt=G.forwardRef(({className:e,children:a,...t},o)=>Ue(n.RadioItem,{ref:o,className:u("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),...t,children:[R("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:R(n.ItemIndicator,{children:R(Z,{className:"ps-h-4 ps-w-4 ps-fill-current"})})}),a]}));pt.displayName=n.RadioItem.displayName;var mt=G.forwardRef(({className:e,inset:a,...t},o)=>R(n.Label,{ref:o,className:u("ps-px-2 ps-py-1.5 ps-text-sm ps-font-semibold ps-text-foreground",a&&"ps-pl-8",e),...t}));mt.displayName=n.Label.displayName;var Lt=G.forwardRef(({className:e,...a},t)=>R(n.Separator,{ref:t,className:u("ps--mx-1 ps-my-1 ps-h-px ps-bg-border",e),...a}));Lt.displayName=n.Separator.displayName;var xt=({className:e,...a})=>R("span",{className:u("ps-ml-auto ps-text-xs ps-tracking-widest ps-text-muted-foreground",e),...a});xt.displayName="ContextMenuShortcut";import{jsx as Oe,jsxs as pa}from"react/jsx-runtime";var He=e=>{if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(e==null)return"";if(It(e)){let a=e.props;return e.type&&typeof e.type=="function"&&e.type.name==="RevealText"?a.text||"":e.type&&typeof e.type=="function"&&e.type.name==="NullValue"?"NULL":a.children?He(a.children):""}return Array.isArray(e)?e.map(He).join(""):""},ma=({children:e})=>pa(na,{children:[Oe(ca,{className:"ps-block ps-w-full ps-p-[var(--studio-cell-spacing)]",children:e}),Oe(Fe,{children:pa(qe,{onClick:()=>{let a=He(e);navigator.clipboard.writeText(a).catch(t=>{console.error("Failed to copy to clipboard:",t)})},className:"ps-flex ps-items-center ps-gap-2",children:[Oe(ie,{size:12}),"Copy"]})})]});import{jsx as Ct}from"react/jsx-runtime";function La(){return Ct("code",{className:"ps-text-gray-500",children:"NULL"})}import{jsx as $,jsxs as St}from"react/jsx-runtime";function xa({cell:e,getPinningStyles:a,dataType:t,isRelational:o,relatesTo:l,relationField:f}){let d=e.getValue(),L=d==null,x=i=>{if(i==null)return"NULL";if(typeof i=="object")try{return JSON.stringify(i,null,2)}catch(C){return console.error("Error stringifying value:",C),String(i)}return String(i)};return St(Te,{children:[$(Ae,{asChild:!0,children:$(oe,{...a(e.column),"data-cell-type":"data","data-type":t.toLowerCase(),"data-relational":o?"true":void 0,"data-relates-to":l,"data-relation-field":f,className:u(a(e.column).className,"ps-p-0",e.column.getIsPinned()&&"ps-sticky"),children:$(ma,{children:L?$(La,{}):x(d)})})}),$(Be,{align:"start",alignOffset:0,sideOffset:0,className:"ps-min-w-(--radix-popover-trigger-width) ps-rounded-none ps-bg-muted ps-p-0",children:$(ht,{value:x(d),theme:gt,height:"100px",basicSetup:{lineNumbers:!0,foldGutter:!1,dropCursor:!1,allowMultipleSelections:!1,indentOnInput:!1},onChange:i=>{console.log("New value:",i)}})})]},e.id)}import{jsx as Pt}from"react/jsx-runtime";function Ia({cell:e,getPinningStyles:a,dataType:t}){let o={cell:e,getPinningStyles:a},l=e.column.columnDef.meta,f={...o,isRelational:l?.isRelational,relatesTo:l?.relatesTo,relationField:l?.relationField};return Pt(xa,{...f,dataType:t||"STRING"})}import{flexRender as Ft}from"@tanstack/react-table";import{Slot as wt}from"@radix-ui/react-slot";import{cva as kt}from"class-variance-authority";import*as Ca from"react";import{jsx as vt}from"react/jsx-runtime";var Rt=kt("ps-inline-flex ps-items-center ps-justify-center ps-gap-2 ps-whitespace-nowrap ps-rounded-md ps-text-sm ps-font-medium ps-transition-colors focus-visible:ps-outline-none focus-visible:ps-ring-1 focus-visible:ps-ring-ring disabled:ps-pointer-events-none disabled:ps-opacity-50 [&_svg]:ps-pointer-events-none [&_svg]:ps-size-4 [&_svg]:ps-shrink-0",{variants:{variant:{default:"ps-bg-primary ps-text-primary-foreground ps-shadow hover:ps-bg-primary/90",destructive:"ps-bg-destructive ps-text-destructive-foreground ps-shadow-sm hover:ps-bg-destructive/90",outline:"ps-border ps-border-input ps-bg-background ps-shadow-sm hover:ps-bg-accent hover:ps-text-accent-foreground",secondary:"ps-bg-secondary ps-text-secondary-foreground ps-shadow-sm hover:ps-bg-secondary/80",ghost:"hover:ps-bg-accent hover:ps-text-accent-foreground",link:"ps-text-primary ps-underline-offset-4 hover:ps-underline"},size:{default:"ps-h-9 ps-px-4 ps-py-2",sm:"ps-h-8 ps-rounded-md ps-px-3 ps-text-xs",lg:"ps-h-10 ps-rounded-md ps-px-8",icon:"ps-h-9 ps-w-9"}},defaultVariants:{variant:"default",size:"default"}}),F=Ca.forwardRef(({className:e,variant:a,size:t,asChild:o=!1,...l},f)=>vt(o?wt:"button",{className:u(Rt({variant:a,size:t,className:e})),ref:f,...l}));F.displayName="Button";import*as c from"@radix-ui/react-dropdown-menu";import*as z from"react";import{jsx as v,jsxs as Ee}from"react/jsx-runtime";var ga=c.Root,ha=c.Trigger;var bt=z.forwardRef(({className:e,inset:a,children:t,...o},l)=>Ee(c.SubTrigger,{ref:l,className:u("ps-flex ps-cursor-default ps-select-none ps-items-center ps-gap-2 ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none focus:ps-bg-accent data-[state=open]:ps-bg-accent [&_svg]:ps-pointer-events-none [&_svg]:ps-size-4 [&_svg]:ps-shrink-0",a&&"ps-pl-8",e),...o,children:[t,v(E,{className:"ps-ml-auto"})]}));bt.displayName=c.SubTrigger.displayName;var yt=z.forwardRef(({className:e,...a},t)=>v(c.SubContent,{ref:t,className:u("ps-z-50 ps-min-w-[8rem] ps-overflow-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-lg data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-dropdown-menu-content-transform-origin]",e),...a}));yt.displayName=c.SubContent.displayName;var Ne=z.forwardRef(({className:e,sideOffset:a=4,...t},o)=>v(c.Portal,{children:v(c.Content,{ref:o,sideOffset:a,className:u("ps-z-50 ps-max-h-[var(--radix-dropdown-menu-content-available-height)] ps-min-w-[8rem] ps-overflow-y-auto ps-overflow-x-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-md","data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-dropdown-menu-content-transform-origin]",e),...t})}));Ne.displayName=c.Content.displayName;var Ce=z.forwardRef(({className:e,inset:a,...t},o)=>v(c.Item,{ref:o,className:u("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-gap-2 ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none ps-transition-colors focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50 [&>svg]:ps-size-4 [&>svg]:ps-shrink-0",a&&"ps-pl-8",e),...t}));Ce.displayName=c.Item.displayName;var Mt=z.forwardRef(({className:e,children:a,checked:t,...o},l)=>Ee(c.CheckboxItem,{ref:l,className:u("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none ps-transition-colors focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),checked:t,...o,children:[v("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:v(c.ItemIndicator,{children:v(N,{className:"ps-h-4 ps-w-4"})})}),a]}));Mt.displayName=c.CheckboxItem.displayName;var Dt=z.forwardRef(({className:e,children:a,...t},o)=>Ee(c.RadioItem,{ref:o,className:u("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none ps-transition-colors focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),...t,children:[v("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:v(c.ItemIndicator,{children:v(Z,{className:"ps-h-2 ps-w-2 ps-fill-current"})})}),a]}));Dt.displayName=c.RadioItem.displayName;var Tt=z.forwardRef(({className:e,inset:a,...t},o)=>v(c.Label,{ref:o,className:u("ps-px-2 ps-py-1.5 ps-text-sm ps-font-semibold",a&&"ps-pl-8",e),...t}));Tt.displayName=c.Label.displayName;var At=z.forwardRef(({className:e,...a},t)=>v(c.Separator,{ref:t,className:u("ps--mx-1 ps-my-1 ps-h-px ps-bg-muted",e),...a}));At.displayName=c.Separator.displayName;var Bt=({className:e,...a})=>v("span",{className:u("ps-ml-auto ps-text-xs ps-tracking-widest ps-opacity-60",e),...a});Bt.displayName="DropdownMenuShortcut";import{jsx as b,jsxs as X}from"react/jsx-runtime";function Ge({header:e}){let a=e.column.columnDef.meta,t=a?.dataType,o=a?.isRelational;return X("div",{className:"ps-flex ps-items-center ps-justify-between ps-w-full ps-h-full",children:[X("div",{className:"ps-flex-1 ps-flex ps-items-center ps-justify-between",children:[o&&b(ne,{size:14,className:"text-blue-700"}),X("div",{className:"ps-align-text-bottom ps-leading-none ps-h-[20px]",children:[b("span",{className:"ps-inline-block ps-text-foreground ps-font-bold ps-text-sm",children:e.isPlaceholder?null:Ft(e.column.columnDef.header,e.getContext())}),t&&t!=="NONE"&&b("span",{className:"ps-inline-block ps-ml-2 ps-text-xs ps-font-mono ps-text-muted-foreground/70 ps-lowercase",children:t})]}),b("span",{className:"ps-flex ps-items-center ps-gap-1",children:e.column.getCanPin()&&e.column.id!=="select"&&X(ga,{children:[b(ha,{asChild:!0,children:b(F,{variant:"ghost",size:"icon",children:b(W,{size:16})})}),X(Ne,{children:[e.column.getCanSort()&&b(Ce,{onClick:()=>e.column.toggleSorting(e.column.getIsSorted()==="asc"),children:X("span",{className:"ps-flex ps-items-center ps-gap-2",children:[e.column.getIsSorted()==="asc"?b(V,{size:16}):b(ue,{size:16}),e.column.getIsSorted()==="asc"?"Sort descending":"Sort ascending"]})}),b(Ce,{onClick:()=>e.column.pin(e.column.getIsPinned()?!1:"left"),children:e.column.getIsPinned()?X("span",{className:"ps-flex ps-items-center ps-gap-2",children:[b(ce,{size:16}),"Unpin column"]}):X("span",{className:"ps-flex ps-items-center ps-gap-2",children:[b(pe,{size:16}),"Pin column"]})})]})]})})]}),e.column.getCanResize()&&b("button",{type:"button",tabIndex:0,onMouseDown:l=>{l.stopPropagation(),e.getResizeHandler()(l)},onTouchStart:l=>{l.stopPropagation(),e.getResizeHandler()(l)},onClick:l=>l.stopPropagation(),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),l.stopPropagation(),e.getResizeHandler()(l))},className:u("ps-absolute ps-right-0 ps-top-0 ps-h-full ps-w-3 ps-cursor-col-resize","ps-select-none ps-touch-none ps-transition-colors ps-group","ps-border-0 ps-bg-transparent",e.column.getIsResizing()&&"ps-bg-gray-300","before:ps-absolute before:ps-right-[3px] before:ps-top-1/2 before:ps--translate-y-1/2","after:ps-absolute after:ps-right-[7px] after:ps-top-1/2 after:ps--translate-y-1/2","before:ps-w-[2px] before:ps-h-0 before:ps-bg-gray-400 before:ps-rounded-full before:ps-opacity-0","after:ps-w-[2px] after:ps-h-0 after:ps-bg-gray-400 after:ps-rounded-full after:ps-opacity-0","before:ps-transition-all before:ps-duration-200","after:ps-transition-all after:ps-duration-200","group-hover:before:ps-opacity-100","group-hover:after:ps-opacity-100","group-hover:before:ps-h-4","group-hover:after:ps-h-4","group-active:ps-bg-transparent group-active:before:ps-bg-white group-active:after:ps-bg-white",e.column.getIsResizing()&&"before:ps-opacity-100"),"aria-label":"Resize column"})]})}import*as Sa from"react";import{jsx as qt}from"react/jsx-runtime";var ze=Sa.forwardRef(({className:e,type:a,...t},o)=>qt("input",{type:a,className:u("ps-flex ps-h-9 ps-w-full ps-rounded-md ps-border ps-border-input ps-bg-transparent ps-px-3 ps-py-1 ps-text-base ps-shadow-sm ps-transition-colors file:ps-border-0 file:ps-bg-transparent file:ps-text-sm file:ps-font-medium file:ps-text-foreground placeholder:ps-text-muted-foreground focus-visible:ps-outline-none focus-visible:ps-ring-1 focus-visible:ps-ring-ring disabled:ps-cursor-not-allowed disabled:ps-opacity-50 md:ps-text-sm",e),ref:o,...t}));ze.displayName="Input";import*as p from"@radix-ui/react-select";import*as K from"react";import{jsx as S,jsxs as Ke}from"react/jsx-runtime";var Pa=p.Root;var wa=p.Value,Ve=K.forwardRef(({className:e,children:a,...t},o)=>Ke(p.Trigger,{ref:o,className:u("ps-flex ps-h-9 ps-w-full ps-items-center ps-justify-between ps-whitespace-nowrap ps-rounded-md ps-border ps-border-input ps-bg-transparent ps-px-3 ps-py-2 ps-text-sm ps-shadow-sm ps-ring-offset-background data-[placeholder]:ps-text-muted-foreground focus:ps-outline-none focus:ps-ring-1 focus:ps-ring-ring disabled:ps-cursor-not-allowed disabled:ps-opacity-50 [&>span]:ps-line-clamp-1",e),...t,children:[a,S(p.Icon,{asChild:!0,children:S(Y,{className:"ps-h-4 ps-w-4 ps-opacity-50"})})]}));Ve.displayName=p.Trigger.displayName;var ka=K.forwardRef(({className:e,...a},t)=>S(p.ScrollUpButton,{ref:t,className:u("ps-flex ps-cursor-default ps-items-center ps-justify-center ps-py-1",e),...a,children:S(re,{className:"ps-h-4 ps-w-4"})}));ka.displayName=p.ScrollUpButton.displayName;var Ra=K.forwardRef(({className:e,...a},t)=>S(p.ScrollDownButton,{ref:t,className:u("ps-flex ps-cursor-default ps-items-center ps-justify-center ps-py-1",e),...a,children:S(Y,{className:"ps-h-4 ps-w-4"})}));Ra.displayName=p.ScrollDownButton.displayName;var We=K.forwardRef(({className:e,children:a,position:t="popper",...o},l)=>S(p.Portal,{children:Ke(p.Content,{ref:l,className:u("ps-relative ps-z-50 ps-max-h-[--radix-select-content-available-height] ps-min-w-[8rem] ps-overflow-y-auto ps-overflow-x-hidden ps-rounded-md ps-border ps-bg-popover ps-text-popover-foreground ps-shadow-md data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-select-content-transform-origin]",t==="popper"&&"data-[side=bottom]:ps-translate-y-1 data-[side=left]:ps--translate-x-1 data-[side=right]:ps-translate-x-1 data-[side=top]:ps--translate-y-1",e),position:t,...o,children:[S(ka,{}),S(p.Viewport,{className:u("ps-p-1",t==="popper"&&"ps-h-[var(--radix-select-trigger-height)] ps-w-full ps-min-w-[var(--radix-select-trigger-width)]"),children:a}),S(Ra,{})]})}));We.displayName=p.Content.displayName;var Ut=K.forwardRef(({className:e,...a},t)=>S(p.Label,{ref:t,className:u("ps-px-2 ps-py-1.5 ps-text-sm ps-font-semibold",e),...a}));Ut.displayName=p.Label.displayName;var Xe=K.forwardRef(({className:e,children:a,...t},o)=>Ke(p.Item,{ref:o,className:u("ps-relative ps-flex ps-w-full ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-2 ps-pr-8 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),...t,children:[S("span",{className:"ps-absolute ps-right-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:S(p.ItemIndicator,{children:S(N,{className:"ps-h-4 ps-w-4"})})}),S(p.ItemText,{children:a})]}));Xe.displayName=p.Item.displayName;var Ot=K.forwardRef(({className:e,...a},t)=>S(p.Separator,{ref:t,className:u("ps--mx-1 ps-my-1 ps-h-px ps-bg-muted",e),...a}));Ot.displayName=p.Separator.displayName;import{jsx as w,jsxs as J}from"react/jsx-runtime";var Ht=[10,20,50,100];function va({table:e,variant:a="basic",className:t}){let{pageSize:o,pageIndex:l}=e.getState().pagination,f=e.getPageCount();return w("div",{className:u("ps-flex ps-items-center ps-justify-between ps-space-x-2 ps-py-4 ps-px-4",t),children:a==="basic"?J("div",{className:"ps-flex ps-items-center ps-space-x-2",children:[w(F,{variant:"outline",size:"sm",className:"ps-h-9",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:"Previous"}),w(F,{variant:"outline",size:"sm",className:"ps-h-9",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:"Next"})]}):J("div",{className:"ps-flex ps-items-center ps-space-x-2",children:[J("div",{className:"ps-flex ps-items-center ps-space-x-2",children:[w(F,{variant:"outline",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:w(de,{className:"ps-w-4 ps-h-4"})}),w(F,{variant:"outline",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:w(se,{className:"ps-w-4 ps-h-4"})}),J("div",{className:"ps-flex ps-items-center ps-gap-1 ps-text-xs ps-font-medium",children:["Page",w(ze,{type:"number",min:1,max:f,value:l+1,className:"ps-w-12",onChange:d=>{let L=d.target.value?Number(d.target.value)-1:0;e.setPageIndex(L)}}),J("span",{className:"ps-shrink-0 ps-w-max",children:["of ",f]})]}),w(F,{variant:"outline",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:w(E,{className:"ps-w-4 ps-h-4"})}),w(F,{variant:"outline",onClick:()=>e.setPageIndex(f-1),disabled:!e.getCanNextPage(),children:w(fe,{className:"ps-w-4 ps-h-4"})})]}),J(Pa,{value:o.toString(),onValueChange:d=>e.setPageSize(Number(d)),children:[w(Ve,{children:w(wa,{})}),w(We,{children:Ht.map(d=>J(Xe,{value:d.toString(),children:[d," per page"]},d))})]})]})})}var me=e=>{let a=e.getIsPinned(),t=a==="left"&&e.getIsLastColumn("left"),o=a==="right"&&e.getIsFirstColumn("right");return{className:u("ps-overflow-hidden ps-whitespace-nowrap ps-text-ellipsis",a&&["ps-sticky ps-bg-background ps-shadow-[1px_0_0_0_hsl(var(--border))]",a==="left"?"ps-left-0":"ps-right-0","ps-z-20"],!a&&"ps-relative ps-z-10",t&&"ps-shadow-[1px_0_0_0_hsl(var(--border))]",o&&"ps-shadow-[-1px_0_0_0_hsl(var(--border))]"),style:{width:e.getSize(),left:a==="left"?`${e.getStart("left")}px`:void 0,right:a==="right"?`${e.getAfter("right")}px`:void 0}}};import{Fragment as to,jsx as I,jsxs as Le}from"react/jsx-runtime";var eo=e=>{let{activeTable:a}=B();return a?I("div",{className:"ps-flex ps-items-center ps-justify-between ps-w-full ps-gap-2",children:I("div",{className:"ps-flex ps-items-center ps-gap-2",children:I("span",{className:"ps-flex ps-items-center ps-gap-2",children:I("h1",{className:"ps-text-sm ps-font-medium",children:a.name})})})}):null},ao=({header:e,children:a,getPinningStyles:t})=>{let{attributes:o,listeners:l,transform:f,transition:d,setNodeRef:L,isDragging:x,isOver:i}=Xt({id:e.id}),C=e.column.columnDef.meta,g={transform:Kt.Transform.toString(f),transition:d,...t(e.column).style,cursor:"grab",touchAction:"none"};return Le(xe,{ref:L,...o,...l,style:g,"data-relational":C?.isRelational?"true":void 0,"data-relates-to":C?.relatesTo,"data-relation-field":C?.relationField,className:u("ps-group",t(e.column).className,x&&"ps-opacity-50",i&&"ps-bg-gray-100","ps-select-none ps-touch-none ps-relative",e.column.getIsPinned()&&"ps-sticky"),children:[a,i&&I("div",{className:"ps-absolute ps-inset-0 ps-border-2 ps-border-primary ps-rounded-sm ps-pointer-events-none"})]})};function ba({data:e=[],columns:a}){console.log("Data received in StudioGrid:",e);let[t,o]=j([]),[l,f]=j([]),[d,L]=j({}),[x,i]=j({left:[],right:[]}),[C,g]=j([]),[ge,he]=j("");$t(()=>{if(a&&a.length>0){let P=a.map(A=>A.id);if(C.length===0){g(P);return}let s=[...C],h=s.filter(A=>!a.some(_=>_.id===A));h.forEach(A=>{let _=s.indexOf(A);_!==-1&&s.splice(_,1)});let T=P.filter(A=>!s.includes(A));T.length>0&&s.push(...T),(h.length>0||T.length>0)&&g(s)}},[a,C]);let Da=Gt(Et,{activationConstraint:{distance:10}}),Ta=zt(Da),Aa=P=>{let{active:s,over:h}=P;if(h&&s.id!==h.id){let T=D.getColumn(s.id),A=D.getColumn(h.id);if(!T||!A)return;let _=T.getIsPinned(),Fa=A.getIsPinned();if(_!==Fa)return;let Qe=C.indexOf(s.id),Ze=C.indexOf(h.id);if(Qe===-1||Ze===-1)return;let Se=[...C];Se.splice(Qe,1),Se.splice(Ze,0,s.id),g(Se)}},Ba=jt(()=>{if(!a||a.length===0)return console.log("No columns configuration available"),[];let P=(s,h)=>{if(s==null)return"";switch(h){case"TIMESTAMP":return s?new Date(s).toLocaleString():"";case"UUID":case"STRING":return String(s);default:return String(s)}};return a.map(s=>({accessorKey:s.id,header:()=>I("div",{className:"ps-font-medium",children:s.id}),cell:({getValue:h})=>P(h(),s.type),meta:{dataType:s.type,isRelational:s.isRelational,relatesTo:s.relatesTo,relationField:s.relationField}}))},[a]),D=Yt({data:e||[],defaultColumn:{size:200,minSize:50,maxSize:500},columns:Ba,getCoreRowModel:Qt(),onSortingChange:o,getSortedRowModel:_t(),getPaginationRowModel:Jt(),getFilteredRowModel:Zt(),onColumnFiltersChange:f,enableColumnResizing:!0,columnResizeMode:"onChange",onColumnSizingChange:L,enableColumnPinning:!0,onColumnPinningChange:i,onGlobalFilterChange:he,globalFilterFn:(P,s,h)=>{let T=P.getValue(s);return T==null?!1:String(T).toLowerCase().includes(String(h).toLowerCase())},state:{sorting:t,columnFilters:l,columnSizing:d,columnPinning:x,columnOrder:C,globalFilter:ge}});return!e||e.length===0?Le("div",{className:"ps-p-4 ps-border ps-rounded-md ps-w-full",children:[I("p",{className:"ps-text-lg ps-font-semibold",children:"No data available."}),I("p",{className:"ps-text-sm ps-text-gray-500",children:e?"Data array is empty.":"Data is undefined."})]}):Le(to,{children:[I("div",{className:"ps-bg-studio-header-background ps-flex ps-w-full ps-p-2 ps-py-3 ps-border-b",children:I(eo,{_table:D})}),I("div",{"data-studio":"content",className:"ps-flex-1 ps-w-0 ps-h-0 ps-min-w-full",children:Le("div",{className:"ps-flex ps-flex-col ps-w-full ps-h-full ps-overflow-scroll",children:[I(Nt,{sensors:Ta,onDragEnd:Aa,children:Le(ye,{children:[I(Me,{children:D.getHeaderGroups().map(P=>I(te,{className:u("ps-relative",D.getLeftLeafHeaders().some(s=>s.column.getIsPinned()==="left")&&`ps-pl-[${D.getLeftLeafHeaders().filter(s=>s.column.getIsPinned()==="left").reduce((s,h)=>s+h.getSize(),0)}px]`),children:I(Wt,{items:P.headers.map(s=>s.id),strategy:Vt,children:P.headers.map(s=>s.column.id==="select"?I(xe,{className:u("ps-px-[var(--studio-cell-spacing)]",me(s.column).className,s.column.getIsPinned()&&"ps-sticky"),style:me(s.column).style,"data-cell-type":"select",children:I(Ge,{header:s})},s.id):I(ao,{header:s,table:D,getPinningStyles:me,children:I(Ge,{header:s})},s.id))})},P.id))}),I(De,{children:D.getRowModel().rows?.length?D.getRowModel().rows.map(P=>I(te,{className:u("ps-bg-table-row ps-odd:bg-table-row-odd ps-group"),children:P.getVisibleCells().map(s=>I(Ia,{cell:s,getPinningStyles:me,dataType:a.find(h=>h.id===s.column.id)?.type},s.id))},P.id)):I(te,{children:I(oe,{colSpan:a.length,className:"ps-h-24 ps-text-center",children:"No results."})})})]})}),I(va,{table:D,variant:"numeric"})]})})]})}import{jsx as oo}from"react/jsx-runtime";function ya(e){let{activeTable:a}=B(),{data:t,isLoading:o}=ua();if(!a)return null;let l=t?.rows||[];return oo(ba,{columns:a.columns,isLoading:o,rows:l})}import{createContext as lo,useContext as Ir,useEffect as uo,useState as so}from"react";import{jsx as io}from"react/jsx-runtime";var ro={theme:"system",setTheme:()=>null},fo=lo(ro);function Ma({children:e,defaultTheme:a="system",storageKey:t="vite-ui-theme",...o}){let[l,f]=so(()=>localStorage.getItem(t)||a);uo(()=>{let L=window.document.documentElement;if(L.classList.remove("light","dark"),l==="system"){let x=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";L.classList.add(x);return}L.classList.add(l)},[l]);let d={theme:l,setTheme:L=>{localStorage.setItem(t,L),f(L)}};return io(fo.Provider,{...o,value:d,children:e})}import{jsx as ee,jsxs as co}from"react/jsx-runtime";function no(e){let{adapter:a}=e;return a?ee(Ma,{children:ee(aa,{adapter:a,children:co("div",{className:"ps-flex ps-gap-4 ps-w-full ps-rounded-sm ps-bg-background ps-p-4 ps-relative",children:[ee(la,{}),ee("div",{className:"ps-flex ps-w-full ps-flex-col ps-border ps-rounded-lg",children:ee(ya,{})})]})})}):(console.error("No adapter provided to Studio component"),ee("div",{children:"Error: No adapter provided"}))}export{no as Studio};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
lucide-react/dist/esm/shared/src/utils.js:
|
|
5
|
+
(**
|
|
6
|
+
* @license lucide-react v0.427.0 - ISC
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the ISC license.
|
|
9
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
10
|
+
*)
|
|
11
|
+
|
|
12
|
+
lucide-react/dist/esm/defaultAttributes.js:
|
|
13
|
+
(**
|
|
14
|
+
* @license lucide-react v0.427.0 - ISC
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the ISC license.
|
|
17
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
18
|
+
*)
|
|
19
|
+
|
|
20
|
+
lucide-react/dist/esm/Icon.js:
|
|
21
|
+
(**
|
|
22
|
+
* @license lucide-react v0.427.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*)
|
|
27
|
+
|
|
28
|
+
lucide-react/dist/esm/createLucideIcon.js:
|
|
29
|
+
(**
|
|
30
|
+
* @license lucide-react v0.427.0 - ISC
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the ISC license.
|
|
33
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
34
|
+
*)
|
|
35
|
+
|
|
36
|
+
lucide-react/dist/esm/icons/arrow-down-wide-narrow.js:
|
|
37
|
+
(**
|
|
38
|
+
* @license lucide-react v0.427.0 - ISC
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the ISC license.
|
|
41
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
+
*)
|
|
43
|
+
|
|
44
|
+
lucide-react/dist/esm/icons/arrow-up-wide-narrow.js:
|
|
45
|
+
(**
|
|
46
|
+
* @license lucide-react v0.427.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*)
|
|
51
|
+
|
|
52
|
+
lucide-react/dist/esm/icons/check.js:
|
|
53
|
+
(**
|
|
54
|
+
* @license lucide-react v0.427.0 - ISC
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the ISC license.
|
|
57
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
+
*)
|
|
59
|
+
|
|
60
|
+
lucide-react/dist/esm/icons/chevron-down.js:
|
|
61
|
+
(**
|
|
62
|
+
* @license lucide-react v0.427.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*)
|
|
67
|
+
|
|
68
|
+
lucide-react/dist/esm/icons/chevron-left.js:
|
|
69
|
+
(**
|
|
70
|
+
* @license lucide-react v0.427.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*)
|
|
75
|
+
|
|
76
|
+
lucide-react/dist/esm/icons/chevron-right.js:
|
|
77
|
+
(**
|
|
78
|
+
* @license lucide-react v0.427.0 - ISC
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the ISC license.
|
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
+
*)
|
|
83
|
+
|
|
84
|
+
lucide-react/dist/esm/icons/chevron-up.js:
|
|
85
|
+
(**
|
|
86
|
+
* @license lucide-react v0.427.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*)
|
|
91
|
+
|
|
92
|
+
lucide-react/dist/esm/icons/chevrons-left.js:
|
|
93
|
+
(**
|
|
94
|
+
* @license lucide-react v0.427.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*)
|
|
99
|
+
|
|
100
|
+
lucide-react/dist/esm/icons/chevrons-right.js:
|
|
101
|
+
(**
|
|
102
|
+
* @license lucide-react v0.427.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*)
|
|
107
|
+
|
|
108
|
+
lucide-react/dist/esm/icons/circle.js:
|
|
109
|
+
(**
|
|
110
|
+
* @license lucide-react v0.427.0 - ISC
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the ISC license.
|
|
113
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
+
*)
|
|
115
|
+
|
|
116
|
+
lucide-react/dist/esm/icons/copy.js:
|
|
117
|
+
(**
|
|
118
|
+
* @license lucide-react v0.427.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*)
|
|
123
|
+
|
|
124
|
+
lucide-react/dist/esm/icons/ellipsis.js:
|
|
125
|
+
(**
|
|
126
|
+
* @license lucide-react v0.427.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*)
|
|
131
|
+
|
|
132
|
+
lucide-react/dist/esm/icons/link.js:
|
|
133
|
+
(**
|
|
134
|
+
* @license lucide-react v0.427.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*)
|
|
139
|
+
|
|
140
|
+
lucide-react/dist/esm/icons/pin-off.js:
|
|
141
|
+
(**
|
|
142
|
+
* @license lucide-react v0.427.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*)
|
|
147
|
+
|
|
148
|
+
lucide-react/dist/esm/icons/pin.js:
|
|
149
|
+
(**
|
|
150
|
+
* @license lucide-react v0.427.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*)
|
|
155
|
+
|
|
156
|
+
lucide-react/dist/esm/lucide-react.js:
|
|
157
|
+
(**
|
|
158
|
+
* @license lucide-react v0.427.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*)
|
|
163
|
+
*/
|