@exulu/frontend 1.7.0 → 1.9.0
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/.next/BUILD_ID +1 -1
- package/dist/.next/app-build-manifest.json +124 -127
- package/dist/.next/app-path-routes-manifest.json +1 -1
- package/dist/.next/build-manifest.json +2 -2
- package/dist/.next/prerender-manifest.json +1 -1
- package/dist/.next/server/app/(application)/agents/edit/[id]/page.js +1 -1
- package/dist/.next/server/app/(application)/agents/edit/[id]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/agents/edit/[id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/agents/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js +7 -7
- package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/chat/[agent]/[session]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/chat/[agent]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/chat/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/configuration/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/dashboard/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/data/[[...query]]/page.js +4 -4
- package/dist/.next/server/app/(application)/data/[[...query]]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/data/[[...query]]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/evals/[id]/page.js +1 -1
- package/dist/.next/server/app/(application)/evals/[id]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/evals/[id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/evals/cases/page.js +1 -1
- package/dist/.next/server/app/(application)/evals/cases/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/evals/cases/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/evals/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/explorer/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/keys/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/projects/[project]/page.js +1 -1
- package/dist/.next/server/app/(application)/projects/[project]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/projects/[project]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/projects/page.js +1 -1
- package/dist/.next/server/app/(application)/projects/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/prompts/page.js +1 -1
- package/dist/.next/server/app/(application)/prompts/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/roles/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/token/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/users/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/create/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/edit/[variable_id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/usage/[variable_id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/workflows/page.js +1 -1
- package/dist/.next/server/app/(application)/workflows/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(authentication)/login/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/_not-found.html +1 -1
- package/dist/.next/server/app/_not-found.rsc +1 -1
- package/dist/.next/server/app/api/auth/[...nextauth]/route.js +2 -2
- package/dist/.next/server/app-paths-manifest.json +4 -4
- package/dist/.next/server/chunks/1025.js +1 -0
- package/dist/.next/server/chunks/1051.js +2 -2
- package/dist/.next/server/chunks/2270.js +12 -48
- package/dist/.next/server/chunks/3434.js +1 -1
- package/dist/.next/server/chunks/3503.js +1 -0
- package/dist/.next/server/chunks/3575.js +1 -1
- package/dist/.next/server/chunks/5084.js +1 -0
- package/dist/.next/server/chunks/5192.js +1 -1
- package/dist/.next/server/chunks/5485.js +1 -0
- package/dist/.next/server/chunks/5600.js +1 -1
- package/dist/.next/server/chunks/5974.js +1 -0
- package/dist/.next/server/chunks/6590.js +1 -1
- package/dist/.next/server/chunks/7471.js +1 -1
- package/dist/.next/server/chunks/8286.js +1 -1
- package/dist/.next/server/chunks/{3679.js → 9874.js} +5 -5
- package/dist/.next/server/middleware-manifest.json +5 -5
- package/dist/.next/server/pages/404.html +1 -1
- package/dist/.next/server/pages/500.html +1 -1
- package/dist/.next/server/server-reference-manifest.json +1 -1
- package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js +2 -0
- package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js.map +1 -0
- package/dist/.next/static/chunks/{4811-316807e25b634f9f.js → 192-72d6868cd891ccc6.js} +8 -8
- package/dist/.next/static/chunks/192-72d6868cd891ccc6.js.map +1 -0
- package/dist/.next/static/chunks/1957-cf44b1d31a9c7d5c.js +2 -0
- package/dist/.next/static/chunks/1957-cf44b1d31a9c7d5c.js.map +1 -0
- package/dist/.next/static/chunks/342-d9c2d6ae9f9435cb.js +2 -0
- package/dist/.next/static/chunks/342-d9c2d6ae9f9435cb.js.map +1 -0
- package/dist/.next/static/chunks/{3750-90a213a3c7cceb29.js → 3750-f45c59ef1cc79417.js} +2 -2
- package/dist/.next/static/chunks/3750-f45c59ef1cc79417.js.map +1 -0
- package/dist/.next/static/chunks/552-39155a93c527ec6d.js +2 -0
- package/dist/.next/static/chunks/552-39155a93c527ec6d.js.map +1 -0
- package/dist/.next/static/chunks/{7856-9fa733bdd6429ba8.js → 6066-65606593516b2a3a.js} +18 -18
- package/dist/.next/static/chunks/6066-65606593516b2a3a.js.map +1 -0
- package/dist/.next/static/chunks/6367-59655a85d75e19be.js +2 -0
- package/dist/.next/static/chunks/6367-59655a85d75e19be.js.map +1 -0
- package/dist/.next/static/chunks/6373-601400fab8a3bb55.js +2 -0
- package/dist/.next/static/chunks/6373-601400fab8a3bb55.js.map +1 -0
- package/dist/.next/static/chunks/8030-9c926ea4dfd3a54e.js +2 -0
- package/dist/.next/static/chunks/8030-9c926ea4dfd3a54e.js.map +1 -0
- package/dist/.next/static/chunks/{6805-792cc8008b165c07.js → 8293-0e69d89d2dac7111.js} +10 -10
- package/dist/.next/static/chunks/8293-0e69d89d2dac7111.js.map +1 -0
- package/dist/.next/static/chunks/9105-dfbce1bad8e3e8dd.js +2 -0
- package/dist/.next/static/chunks/9105-dfbce1bad8e3e8dd.js.map +1 -0
- package/dist/.next/static/chunks/9953-95900a236271a222.js +2 -0
- package/dist/.next/static/chunks/9953-95900a236271a222.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-e4a4693953329671.js +2 -0
- package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-e4a4693953329671.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-7edb1c7c850f982c.js +2 -0
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-7edb1c7c850f982c.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/chat/layout-093baa26f89338bc.js +2 -0
- package/dist/.next/static/chunks/app/(application)/chat/layout-093baa26f89338bc.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-8d2b3995cacfd832.js +2 -0
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-8d2b3995cacfd832.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/evals/[id]/page-a7728cf9b0524489.js +2 -0
- package/dist/.next/static/chunks/app/(application)/evals/[id]/page-a7728cf9b0524489.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/evals/cases/{page-a39fef7444581565.js → page-827f50c6d1f150d0.js} +2 -2
- package/dist/.next/static/chunks/app/(application)/evals/cases/{page-a39fef7444581565.js.map → page-827f50c6d1f150d0.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/projects/[project]/page-f04fd5291a1ef7b1.js +2 -0
- package/dist/.next/static/chunks/app/(application)/projects/[project]/page-f04fd5291a1ef7b1.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/prompts/page-2c500e9898447506.js +2 -0
- package/dist/.next/static/chunks/app/(application)/prompts/page-2c500e9898447506.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/workflows/{page-47dedb88cec600d5.js → page-e38f9456120dab69.js} +2 -2
- package/dist/.next/static/chunks/app/(application)/workflows/page-e38f9456120dab69.js.map +1 -0
- package/dist/.next/static/css/6f8c5212af8ef284.css +4 -0
- package/dist/.next/static/css/6f8c5212af8ef284.css.map +1 -0
- package/dist/.next/static/css/e3f2a16ab7676b05.css.map +1 -1
- package/dist/package.json +1 -0
- package/package.json +1 -1
- package/dist/.next/server/chunks/2948.js +0 -1
- package/dist/.next/server/chunks/38.js +0 -1
- package/dist/.next/server/chunks/6623.js +0 -1
- package/dist/.next/server/chunks/7958.js +0 -1
- package/dist/.next/server/chunks/8050.js +0 -1
- package/dist/.next/static/chunks/1685-39351b8a15bbecab.js +0 -2
- package/dist/.next/static/chunks/1685-39351b8a15bbecab.js.map +0 -1
- package/dist/.next/static/chunks/1957-899d0d6d0d9c11fd.js +0 -2
- package/dist/.next/static/chunks/1957-899d0d6d0d9c11fd.js.map +0 -1
- package/dist/.next/static/chunks/3750-90a213a3c7cceb29.js.map +0 -1
- package/dist/.next/static/chunks/4811-316807e25b634f9f.js.map +0 -1
- package/dist/.next/static/chunks/5282-68f9880f1f951f44.js +0 -2
- package/dist/.next/static/chunks/5282-68f9880f1f951f44.js.map +0 -1
- package/dist/.next/static/chunks/6367-59cef3c74213925b.js +0 -2
- package/dist/.next/static/chunks/6367-59cef3c74213925b.js.map +0 -1
- package/dist/.next/static/chunks/6373-7908bd5269f95aa3.js +0 -2
- package/dist/.next/static/chunks/6373-7908bd5269f95aa3.js.map +0 -1
- package/dist/.next/static/chunks/6805-792cc8008b165c07.js.map +0 -1
- package/dist/.next/static/chunks/7856-9fa733bdd6429ba8.js.map +0 -1
- package/dist/.next/static/chunks/8030-c1b6be46253076cb.js +0 -2
- package/dist/.next/static/chunks/8030-c1b6be46253076cb.js.map +0 -1
- package/dist/.next/static/chunks/8269-0e17dac508340ccf.js +0 -2
- package/dist/.next/static/chunks/8269-0e17dac508340ccf.js.map +0 -1
- package/dist/.next/static/chunks/9105-78d236e8399181e0.js +0 -2
- package/dist/.next/static/chunks/9105-78d236e8399181e0.js.map +0 -1
- package/dist/.next/static/chunks/9621-f81c4d7c0ecf5a67.js +0 -2
- package/dist/.next/static/chunks/9621-f81c4d7c0ecf5a67.js.map +0 -1
- package/dist/.next/static/chunks/9953-dfb5fc0e5b74ec09.js +0 -2
- package/dist/.next/static/chunks/9953-dfb5fc0e5b74ec09.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-29794b9c33d2bf7e.js +0 -2
- package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-29794b9c33d2bf7e.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-57021bb06089261a.js +0 -2
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-57021bb06089261a.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/chat/layout-42021d301fc609b6.js +0 -2
- package/dist/.next/static/chunks/app/(application)/chat/layout-42021d301fc609b6.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-841b2ed48010048e.js +0 -2
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-841b2ed48010048e.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/evals/[id]/page-c1e7e0c81ca508c3.js +0 -2
- package/dist/.next/static/chunks/app/(application)/evals/[id]/page-c1e7e0c81ca508c3.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/projects/[project]/page-0b2d9832e5a023e7.js +0 -2
- package/dist/.next/static/chunks/app/(application)/projects/[project]/page-0b2d9832e5a023e7.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/prompts/page-d2f36ff149385efd.js +0 -2
- package/dist/.next/static/chunks/app/(application)/prompts/page-d2f36ff149385efd.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/workflows/page-47dedb88cec600d5.js.map +0 -1
- package/dist/.next/static/css/a181dac3df0dc7a7.css +0 -4
- package/dist/.next/static/css/a181dac3df0dc7a7.css.map +0 -1
- /package/dist/.next/static/{J23NmkaMjAJYnE0jX_kO0 → ls-syPkq9-MWp-VWWDEZJ}/_buildManifest.js +0 -0
- /package/dist/.next/static/{J23NmkaMjAJYnE0jX_kO0 → ls-syPkq9-MWp-VWWDEZJ}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
exports.id=1051,exports.ids=[1051],exports.modules={65534:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,12994,23)),Promise.resolve().then(r.t.bind(r,96114,23)),Promise.resolve().then(r.t.bind(r,9727,23)),Promise.resolve().then(r.t.bind(r,79671,23)),Promise.resolve().then(r.t.bind(r,41868,23)),Promise.resolve().then(r.t.bind(r,84759,23))},75983:(e,t,r)=>{"use strict";r.d(t,{TanstackQueryClientProvider:()=>i});var s=r(10326),o=r(22852),n=r(44976);let a=new o.S,i=({children:e})=>s.jsx(n.aH,{client:a,children:e})},30463:(e,t,r)=>{"use strict";r.d(t,{ConfigContextProvider:()=>n,E:()=>o});var s=r(10326);let o=(0,r(17577).createContext)(null);function n({children:e,config:t}){if(console.log("[EXULU] Config: ",t),!t)throw Error("Config not found");return s.jsx(o.Provider,{value:t,children:e})}},2424:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var s=r(10326),o=r(30463),n=r(17577);let a=({width:e=64,height:t=32,className:r="",alt:a="Logo"})=>{let i=(0,n.useContext)(o.E);return(0,s.jsxs)(s.Fragment,{children:[s.jsx("img",{src:i?.backend+"/logo_dark.png",alt:a,width:e,height:t,className:r+"hidden dark:block"}),s.jsx("img",{src:i?.backend+"/logo_light.png",alt:a,width:e,height:t,className:r+"block dark:hidden"})]})}},15813:(e,t,r)=>{"use strict";r.d(t,{ThemeProvider:()=>n});var s=r(10326),o=r(3574);function n({children:e,...t}){return s.jsx(o.f,{...t,defaultTheme:"dark",children:e})}r(17577)},90772:(e,t,r)=>{"use strict";r.d(t,{d:()=>l,z:()=>d});var s=r(10326),o=r(34214),n=r(79360),a=r(17577),i=r(77863);let l=(0,n.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),d=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...a},d)=>{let c=n?o.g7:"button";return s.jsx(c,{className:(0,i.cn)(l({variant:t,size:r,className:e})),ref:d,...a})});d.displayName="Button"},54432:(e,t,r)=>{"use strict";r.d(t,{I:()=>a});var s=r(10326),o=r(17577),n=r(77863);let a=o.forwardRef(({className:e,type:t,...r},o)=>s.jsx("input",{type:t,className:(0,n.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));a.displayName="Input"},77083:(e,t,r)=>{"use strict";r.d(t,{Toaster:()=>h});var s=r(10326),o=r(10321),n=r(79360),a=r(94019),i=r(17577),l=r(77863);let d=o.zt,c=i.forwardRef(({className:e,...t},r)=>s.jsx(o.l_,{ref:r,className:(0,l.cn)("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));c.displayName=o.l_.displayName;let u=(0,n.j)("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),p=i.forwardRef(({className:e,variant:t,...r},n)=>s.jsx(o.fC,{ref:n,className:(0,l.cn)(u({variant:t}),e),...r}));p.displayName=o.fC.displayName,i.forwardRef(({className:e,...t},r)=>s.jsx(o.aU,{ref:r,className:(0,l.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t})).displayName=o.aU.displayName;let f=i.forwardRef(({className:e,...t},r)=>s.jsx(o.x8,{ref:r,className:(0,l.cn)("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(a.Z,{className:"size-4"})}));f.displayName=o.x8.displayName;let g=i.forwardRef(({className:e,...t},r)=>s.jsx(o.Dx,{ref:r,className:(0,l.cn)("text-sm font-semibold",e),...t}));g.displayName=o.Dx.displayName;let m=i.forwardRef(({className:e,...t},r)=>s.jsx(o.dk,{ref:r,className:(0,l.cn)("text-sm opacity-90",e),...t}));m.displayName=o.dk.displayName;var v=r(34789);function h(){let{toasts:e}=(0,v.pm)();return(0,s.jsxs)(d,{children:[e.map(function({id:e,title:t,description:r,action:o,...n}){return(0,s.jsxs)(p,{...n,children:[(0,s.jsxs)("div",{className:"grid gap-1",children:[t&&s.jsx(g,{children:t}),r&&s.jsx(m,{children:r})]}),o,s.jsx(f,{})]},e)}),s.jsx(c,{})]})}},34789:(e,t,r)=>{"use strict";r.d(t,{Am:()=>u,pm:()=>p});var s=r(17577);let o=0,n=new Map,a=e=>{if(n.has(e))return;let t=setTimeout(()=>{n.delete(e),c({type:"REMOVE_TOAST",toastId:e})},1e6);n.set(e,t)},i=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:r}=t;return r?a(r):e.toasts.forEach(e=>{a(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===r||void 0===r?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},l=[],d={toasts:[]};function c(e){d=i(d,e),l.forEach(e=>{e(d)})}function u({...e}){let t=(o=(o+1)%Number.MAX_SAFE_INTEGER).toString(),r=()=>c({type:"DISMISS_TOAST",toastId:t});return c({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:e=>c({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function p(){let[e,t]=s.useState(d);return s.useEffect(()=>(l.push(t),()=>{let e=l.indexOf(t);e>-1&&l.splice(e,1)}),[e]),{...e,toast:u,dismiss:e=>c({type:"DISMISS_TOAST",toastId:e})}}},77863:(e,t,r)=>{"use strict";r.d(t,{L:()=>a,cn:()=>n});var s=r(41135),o=r(31009);function n(...e){return(0,o.m6)((0,s.W)(e))}function a(e){if(!e)return"0s";let t=Math.floor(e/3600),r=Math.floor(e%3600/60),s=Math.round(e%60);return t>0?`${t}h ${r}m`:r>0?`${r}m ${s}s`:`${s}s`}},64640:(e,t,r)=>{"use strict";r.d(t,{u:()=>s});let s=(0,r(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/query-client.tsx#TanstackQueryClientProvider`)},19579:(e,t,r)=>{"use strict";r.a(e,async(e,s)=>{try{r.d(t,{b:()=>x,d:()=>v});var o=r(14029),n=r(53797),a=r(55245),i=r(84770),l=r(1203),d=r(8678),c=r(98691),u=r(35515),p=r(30849),f=r(77234),g=e([d]);d=(g.then?(await g)():g)[0];let m=async e=>{let t=process.env.NEXTAUTH_SECRET
|
|
1
|
+
exports.id=1051,exports.ids=[1051],exports.modules={65534:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,12994,23)),Promise.resolve().then(r.t.bind(r,96114,23)),Promise.resolve().then(r.t.bind(r,9727,23)),Promise.resolve().then(r.t.bind(r,79671,23)),Promise.resolve().then(r.t.bind(r,41868,23)),Promise.resolve().then(r.t.bind(r,84759,23))},75983:(e,t,r)=>{"use strict";r.d(t,{TanstackQueryClientProvider:()=>i});var s=r(10326),o=r(22852),n=r(44976);let a=new o.S,i=({children:e})=>s.jsx(n.aH,{client:a,children:e})},30463:(e,t,r)=>{"use strict";r.d(t,{ConfigContextProvider:()=>n,E:()=>o});var s=r(10326);let o=(0,r(17577).createContext)(null);function n({children:e,config:t}){if(console.log("[EXULU] Config: ",t),!t)throw Error("Config not found");return s.jsx(o.Provider,{value:t,children:e})}},2424:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var s=r(10326),o=r(30463),n=r(17577);let a=({width:e=64,height:t=32,className:r="",alt:a="Logo"})=>{let i=(0,n.useContext)(o.E);return(0,s.jsxs)(s.Fragment,{children:[s.jsx("img",{src:i?.backend+"/logo_dark.png",alt:a,width:e,height:t,className:r+"hidden dark:block"}),s.jsx("img",{src:i?.backend+"/logo_light.png",alt:a,width:e,height:t,className:r+"block dark:hidden"})]})}},15813:(e,t,r)=>{"use strict";r.d(t,{ThemeProvider:()=>n});var s=r(10326),o=r(3574);function n({children:e,...t}){return s.jsx(o.f,{...t,defaultTheme:"dark",children:e})}r(17577)},90772:(e,t,r)=>{"use strict";r.d(t,{d:()=>l,z:()=>d});var s=r(10326),o=r(34214),n=r(79360),a=r(17577),i=r(77863);let l=(0,n.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),d=a.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...a},d)=>{let c=n?o.g7:"button";return s.jsx(c,{className:(0,i.cn)(l({variant:t,size:r,className:e})),ref:d,...a})});d.displayName="Button"},54432:(e,t,r)=>{"use strict";r.d(t,{I:()=>a});var s=r(10326),o=r(17577),n=r(77863);let a=o.forwardRef(({className:e,type:t,...r},o)=>s.jsx("input",{type:t,className:(0,n.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));a.displayName="Input"},77083:(e,t,r)=>{"use strict";r.d(t,{Toaster:()=>h});var s=r(10326),o=r(10321),n=r(79360),a=r(94019),i=r(17577),l=r(77863);let d=o.zt,c=i.forwardRef(({className:e,...t},r)=>s.jsx(o.l_,{ref:r,className:(0,l.cn)("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));c.displayName=o.l_.displayName;let u=(0,n.j)("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),p=i.forwardRef(({className:e,variant:t,...r},n)=>s.jsx(o.fC,{ref:n,className:(0,l.cn)(u({variant:t}),e),...r}));p.displayName=o.fC.displayName,i.forwardRef(({className:e,...t},r)=>s.jsx(o.aU,{ref:r,className:(0,l.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t})).displayName=o.aU.displayName;let f=i.forwardRef(({className:e,...t},r)=>s.jsx(o.x8,{ref:r,className:(0,l.cn)("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(a.Z,{className:"size-4"})}));f.displayName=o.x8.displayName;let g=i.forwardRef(({className:e,...t},r)=>s.jsx(o.Dx,{ref:r,className:(0,l.cn)("text-sm font-semibold",e),...t}));g.displayName=o.Dx.displayName;let m=i.forwardRef(({className:e,...t},r)=>s.jsx(o.dk,{ref:r,className:(0,l.cn)("text-sm opacity-90",e),...t}));m.displayName=o.dk.displayName;var v=r(34789);function h(){let{toasts:e}=(0,v.pm)();return(0,s.jsxs)(d,{children:[e.map(function({id:e,title:t,description:r,action:o,...n}){return(0,s.jsxs)(p,{...n,children:[(0,s.jsxs)("div",{className:"grid gap-1",children:[t&&s.jsx(g,{children:t}),r&&s.jsx(m,{children:r})]}),o,s.jsx(f,{})]},e)}),s.jsx(c,{})]})}},34789:(e,t,r)=>{"use strict";r.d(t,{Am:()=>u,pm:()=>p});var s=r(17577);let o=0,n=new Map,a=e=>{if(n.has(e))return;let t=setTimeout(()=>{n.delete(e),c({type:"REMOVE_TOAST",toastId:e})},1e6);n.set(e,t)},i=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:r}=t;return r?a(r):e.toasts.forEach(e=>{a(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===r||void 0===r?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},l=[],d={toasts:[]};function c(e){d=i(d,e),l.forEach(e=>{e(d)})}function u({...e}){let t=(o=(o+1)%Number.MAX_SAFE_INTEGER).toString(),r=()=>c({type:"DISMISS_TOAST",toastId:t});return c({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:e=>c({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function p(){let[e,t]=s.useState(d);return s.useEffect(()=>(l.push(t),()=>{let e=l.indexOf(t);e>-1&&l.splice(e,1)}),[e]),{...e,toast:u,dismiss:e=>c({type:"DISMISS_TOAST",toastId:e})}}},77863:(e,t,r)=>{"use strict";r.d(t,{L:()=>a,cn:()=>n});var s=r(41135),o=r(31009);function n(...e){return(0,o.m6)((0,s.W)(e))}function a(e){if(!e)return"0s";let t=Math.floor(e/3600),r=Math.floor(e%3600/60),s=Math.round(e%60);return t>0?`${t}h ${r}m`:r>0?`${r}m ${s}s`:`${s}s`}},64640:(e,t,r)=>{"use strict";r.d(t,{u:()=>s});let s=(0,r(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/query-client.tsx#TanstackQueryClientProvider`)},19579:(e,t,r)=>{"use strict";r.a(e,async(e,s)=>{try{r.d(t,{b:()=>x,d:()=>v});var o=r(14029),n=r(53797),a=r(55245),i=r(84770),l=r(1203),d=r(8678),c=r(98691),u=r(35515),p=r(30849),f=r(77234),g=e([d]);d=(g.then?(await g)():g)[0];let m=async e=>{let t=process.env.NEXTAUTH_SECRET;if(!t)throw Error("NEXTAUTH_SECRET is not defined");let r=Buffer.from(t,"utf-8").toString("base64url"),s=await (0,u.nO)({k:r,alg:"HS256",kty:"oct"});return await new p.N(e).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("365d").sign(s)},v=global.__db_pool||new d.Pool({host:process.env.POSTGRES_DB_HOST,user:process.env.POSTGRES_DB_USER,port:parseInt(process.env.POSTGRES_DB_PORT||"5432",10),password:process.env.POSTGRES_DB_PASSWORD,database:process.env.POSTGRES_DB_NAME||"exulu",min:2,max:20,acquireTimeoutMillis:3e4,createTimeoutMillis:3e4,idleTimeoutMillis:3e4,reapIntervalMillis:1e3,createRetryIntervalMillis:200,connectionTimeoutMillis:1e4}),h=[(0,n.Z)({name:"Credentials",credentials:{email:{label:"Email",type:"email"},password:{label:"Password",type:"password"}},authorize:async e=>{let t=await v.connect();try{if(!e?.email||!e?.password)return null;let r=await t.query("SELECT * FROM users WHERE email = $1",[e.email]);if(console.log("[NEXT AUTH] authorize res rows count:",r.rows.length),console.log("[NEXT AUTH] Full user object:",JSON.stringify(r.rows[0],null,2)),!r?.rows?.length)return null;for(let s of r.rows){let r=await c.ZP.compare(e.password,s.password);if(console.log("[NEXT AUTH] isMatch",r),r)return await t.query("UPDATE users SET last_used = $1 WHERE email = $2",[new Date,s.email]),s}}finally{t.release()}}})];process.env.EMAIL_SERVER_HOST&&h.push((0,o.Z)({async sendVerificationRequest({identifier:e,token:t,url:r,provider:{server:s,from:o}}){var n;let{host:i}=new URL(r),l=(0,a.createTransport)(s);await l.sendMail({to:e,from:o,subject:`Sign in to ${i}`,text:(n={token:t,host:i},`
|
|
2
2
|
Sign in to ${n.host}
|
|
3
3
|
|
|
4
4
|
Sign in code: ${n.token}
|
|
@@ -31,7 +31,7 @@ exports.id=1051,exports.ids=[1051],exports.modules={65534:(e,t,r)=>{Promise.reso
|
|
|
31
31
|
</tr>
|
|
32
32
|
</table>
|
|
33
33
|
</body>
|
|
34
|
-
`}({token:t,host:i})})},generateVerificationToken:async()=>(0,i.randomInt)(1e5,999999).toString(),maxAge:180,server:{host:process.env.EMAIL_SERVER_HOST,port:parseInt(process.env.EMAIL_SERVER_PORT,10),auth:{user:process.env.EMAIL_SERVER_USER,pass:process.env.EMAIL_SERVER_PASSWORD}},from:process.env.EMAIL_FROM})),process.env.GOOGLE_CLIENT_ID&&process.env.GOOGLE_CLIENT_SECRET&&h.push((0,f.Z)({clientId:process.env.GOOGLE_CLIENT_ID,clientSecret:process.env.GOOGLE_CLIENT_SECRET,authorization:{params:{access_type:"offline",response_type:"code",scope:"https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/directory.readonly https://www.googleapis.com/auth/user.emails.read https://www.googleapis.com/auth/admin.directory.group.readonly https://www.googleapis.com/auth/admin.directory.user.readonly https://www.googleapis.com/auth/userinfo.email openid"}}}));let x=async()=>({pages:{signIn:"/login"},adapter:(0,l.Z)(v),session:{strategy:"jwt"},jwt:{secret:process.env.NEXTAUTH_SECRET},providers:h,callbacks:{async signIn({account:e,profile:t,user:r}){let s=await v.connect();try{let o=r.email;if(console.log("[EXULU] Sign in callback",e,t,r),e?.provider==="google"&&!(o=t?.email))return console.error("[EXULU] Google auth failed, no email in profile.")
|
|
34
|
+
`}({token:t,host:i})})},generateVerificationToken:async()=>(0,i.randomInt)(1e5,999999).toString(),maxAge:180,server:{host:process.env.EMAIL_SERVER_HOST,port:parseInt(process.env.EMAIL_SERVER_PORT,10),auth:{user:process.env.EMAIL_SERVER_USER,pass:process.env.EMAIL_SERVER_PASSWORD}},from:process.env.EMAIL_FROM})),process.env.GOOGLE_CLIENT_ID&&process.env.GOOGLE_CLIENT_SECRET&&h.push((0,f.Z)({clientId:process.env.GOOGLE_CLIENT_ID,clientSecret:process.env.GOOGLE_CLIENT_SECRET,authorization:{params:{access_type:"offline",response_type:"code",scope:"https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/directory.readonly https://www.googleapis.com/auth/user.emails.read https://www.googleapis.com/auth/admin.directory.group.readonly https://www.googleapis.com/auth/admin.directory.user.readonly https://www.googleapis.com/auth/userinfo.email openid"}}}));let x=async()=>({pages:{signIn:"/login"},adapter:(0,l.Z)(v),session:{strategy:"jwt"},jwt:{secret:process.env.NEXTAUTH_SECRET},providers:h,callbacks:{async signIn({account:e,profile:t,user:r}){let s=await v.connect();try{let o=r.email;if(console.log("[EXULU] Sign in callback",e,t,r),e?.provider==="google"&&!(o=t?.email))return console.error("[EXULU] Google auth failed, no email in profile."),!1;if(console.log("[EXULU] ALLOWED_EMAIL_DOMAINS",process.env.ALLOWED_EMAIL_DOMAINS),process.env.ALLOWED_EMAIL_DOMAINS){let e=process.env.ALLOWED_EMAIL_DOMAINS.split(",");if(e.push("exulu.com"),e.push("qventu.com"),!e.some(e=>o.endsWith(`@${e}`)))return!1}let n=await s.query("SELECT * FROM users WHERE email = $1",[o]),a=n?.rows[0];if(console.log("[EXULU] Sign in callback user query result",a),a&&await s.query("UPDATE users SET last_used = $1 WHERE email = $2",[new Date,o]),!a&&e?.provider==="google"){let e=t?.given_name||"",r=await s.query("SELECT * FROM roles WHERE name = $1",["default"]),n=r?.rows[0],i=await s.query('INSERT INTO users ("email", "name", "createdAt", "updatedAt", "emailVerified", "last_used", "type", "super_admin", "role") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING *',[o,e,new Date,new Date,new Date,new Date,"user",!1,n?.id]);a=i?.rows[0],console.log("[EXULU] Sign in callback new user query result",a)}if(a){if(e?.provider==="google"){console.log("[EXULU] Checking for existing account (provider account id: ",e.providerAccountId);let t=(await s.query('SELECT * FROM accounts WHERE provider = $1 AND "providerAccountId" = $2',["google",e.providerAccountId])).rows[0];console.log("[EXULU] Existing account query result",t),t?await s.query('UPDATE accounts SET access_token = $1, refresh_token = $2, expires_at = $3, id_token = $4, scope = $5, session_state = $6, token_type = $7, "userId" = $8 WHERE id = $9',[e.access_token,e.refresh_token,e.expires_at,e.id_token,e.scope,e.session_state,e.token_type,a.id,t.id]):await s.query('INSERT INTO accounts ("provider", "providerAccountId", "access_token", "refresh_token", "expires_at", "id_token", "scope", "session_state", "token_type", "userId", "type") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)',["google",e.providerAccountId,e.access_token,e.refresh_token,e.expires_at,e.id_token,e.scope,e.session_state,e.token_type,a.id,"oauth"])}return!0}return!1}catch(e){return console.error("[EXULU] Sign in callback error",e),!1}finally{s.release()}},async jwt({token:e,user:t}){e.uid=e.sub??"nosub";let r=await m({id:t?t.id:e.sub,email:t?t.email:e.email});return e.jwt=r,e},session:async({session:e,token:t})=>(t&&e.user&&(e.user.id=t.id,e.user.jwt=t.jwt,e.user.email=t.email),e)},secret:process.env.NEXTAUTH_SECRET});s()}catch(e){s(e)}})},14796:(e,t,r)=>{"use strict";r.d(t,{b:()=>o});var s=r(68570);(0,s.createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/components/config-context.tsx#ConfigContext`);let o=(0,s.createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/components/config-context.tsx#ConfigContextProvider`)},10296:(e,t,r)=>{"use strict";r.d(t,{f:()=>s});let s=(0,r(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/components/theme-provider.tsx#ThemeProvider`)},23067:(e,t,r)=>{"use strict";r.d(t,{x:()=>s});let s=(0,r(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/components/ui/toaster.tsx#Toaster`)},53254:(e,t,r)=>{"use strict";r.d(t,{s8:()=>d});var s=r(68666),o=r.n(s),n=r(50100),a=r.n(n),i=r(11344),l=r.n(i);let d=[o().variable,a().variable,l().variable].join(" ")},29375:(e,t,r)=>{"use strict";r.a(e,async(e,s)=>{try{r.d(t,{x:()=>i});var o=r(75571),n=r(19579),a=e([n]);n=(a.then?(await a)():a)[0];let i=async()=>{let e=await (0,n.b)(),t=await (0,o.getServerSession)(e);if(!t?.user)return!1;console.log("[EXULU] serverSideAuthCheck session:",t);let r=await n.d.connect();try{let e=await r.query(`
|
|
35
35
|
SELECT
|
|
36
36
|
users.*,
|
|
37
37
|
json_build_object(
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
"use strict";exports.id=2270,exports.ids=[2270],exports.modules={42270:(e,t,i)=>{i.d(t,{$6:()=>ed,$W:()=>eE,A1:()=>_,Ak:()=>ev,Au:()=>e_,Az:()=>Z,B4:()=>eH,BK:()=>es,B_:()=>en,C3:()=>I,CN:()=>eP,Dt:()=>F,E3:()=>W,Ep:()=>e0,Eq:()=>f,GJ:()=>m,Hk:()=>el,Iv:()=>e4,JL:()=>b,JM:()=>L,Jq:()=>eV,L5:()=>ea,Ll:()=>e5,MU:()=>C,Md:()=>s,Mh:()=>eO,Mp:()=>ei,N:()=>h,Nl:()=>tt,Nu:()=>eY,OP:()=>eX,P3:()=>l,Pe:()=>O,QW:()=>eZ,Qf:()=>H,RV:()=>ej,S9:()=>K,Tj:()=>em,Tp:()=>E,Ts:()=>eG,UK:()=>e8,Ul:()=>N,W6:()=>eu,W9:()=>j,Wc:()=>r,Wr:()=>eL,X0:()=>e7,YH:()=>ef,Yr:()=>eb,ZA:()=>ey,ZX:()=>w,Zy:()=>er,_J:()=>eo,as:()=>R,b2:()=>eh,bI:()=>B,c2:()=>X,ci:()=>Y,d5:()=>eC,dc:()=>c,eY:()=>V,fA:()=>e1,fB:()=>x,fG:()=>M,fM:()=>eS,fV:()=>
|
|
1
|
+
"use strict";exports.id=2270,exports.ids=[2270],exports.modules={42270:(e,t,i)=>{i.d(t,{$6:()=>ed,$W:()=>eE,A1:()=>_,Ak:()=>ev,Au:()=>e_,Az:()=>Z,B4:()=>eH,BK:()=>es,B_:()=>en,C3:()=>I,CN:()=>eP,Dt:()=>F,E3:()=>W,Ep:()=>e0,Eq:()=>f,GJ:()=>m,Hk:()=>el,Iv:()=>e4,JL:()=>b,JM:()=>L,Jq:()=>eV,L5:()=>ea,Ll:()=>e5,MU:()=>C,Md:()=>s,Mh:()=>eO,Mp:()=>ei,N:()=>h,Nl:()=>tt,Nu:()=>eY,OP:()=>eX,P3:()=>l,Pe:()=>O,QW:()=>eZ,Qf:()=>H,RV:()=>ej,S9:()=>K,Tj:()=>em,Tp:()=>E,Ts:()=>eG,UK:()=>e8,Ul:()=>N,W6:()=>eu,W9:()=>j,Wc:()=>r,Wr:()=>eL,X0:()=>e7,YH:()=>ef,Yr:()=>eb,ZA:()=>ey,ZX:()=>w,Zy:()=>er,_J:()=>eo,as:()=>R,b2:()=>eh,bI:()=>B,c2:()=>X,ci:()=>Y,d5:()=>eC,dc:()=>c,eY:()=>V,fA:()=>e1,fB:()=>x,fG:()=>M,fM:()=>eS,fV:()=>g,fc:()=>eM,fo:()=>q,hx:()=>ek,i9:()=>eT,iA:()=>eN,iC:()=>eK,j9:()=>ec,jA:()=>e3,jL:()=>eA,jm:()=>ew,k9:()=>eW,kH:()=>J,kZ:()=>ep,kk:()=>e$,kp:()=>eB,l1:()=>D,lU:()=>et,lW:()=>eU,lk:()=>k,m8:()=>ti,mN:()=>v,oo:()=>eQ,ps:()=>P,qK:()=>T,r1:()=>A,rR:()=>G,re:()=>e6,s5:()=>eJ,s7:()=>z,tK:()=>eg,tO:()=>y,ty:()=>S,ui:()=>Q,uw:()=>p,vP:()=>eF,ve:()=>U,xR:()=>ee,xx:()=>e9,ym:()=>u});var a=i(74904);let s="_itemsPagination",r="_itemsCreateOne",n=`
|
|
2
2
|
id
|
|
3
3
|
name
|
|
4
4
|
description
|
|
5
5
|
embedder {
|
|
6
6
|
name
|
|
7
7
|
id
|
|
8
|
+
queue
|
|
8
9
|
config {
|
|
9
10
|
name
|
|
10
11
|
description
|
|
@@ -54,10 +55,6 @@ RBAC {
|
|
|
54
55
|
id
|
|
55
56
|
rights
|
|
56
57
|
}
|
|
57
|
-
projects {
|
|
58
|
-
id
|
|
59
|
-
rights
|
|
60
|
-
}
|
|
61
58
|
}
|
|
62
59
|
${e.join("\n")}
|
|
63
60
|
`,d=`
|
|
@@ -116,10 +113,6 @@ RBAC {
|
|
|
116
113
|
id
|
|
117
114
|
rights
|
|
118
115
|
}
|
|
119
|
-
projects {
|
|
120
|
-
id
|
|
121
|
-
rights
|
|
122
|
-
}
|
|
123
116
|
}
|
|
124
117
|
createdAt
|
|
125
118
|
updatedAt
|
|
@@ -174,6 +167,7 @@ updatedAt
|
|
|
174
167
|
user
|
|
175
168
|
title
|
|
176
169
|
agent
|
|
170
|
+
project
|
|
177
171
|
rights_mode
|
|
178
172
|
RBAC {
|
|
179
173
|
type
|
|
@@ -185,16 +179,12 @@ updatedAt
|
|
|
185
179
|
id
|
|
186
180
|
rights
|
|
187
181
|
}
|
|
188
|
-
projects {
|
|
189
|
-
id
|
|
190
|
-
rights
|
|
191
|
-
}
|
|
192
182
|
}
|
|
193
183
|
id
|
|
194
184
|
}
|
|
195
185
|
}
|
|
196
186
|
}
|
|
197
|
-
`,
|
|
187
|
+
`,p=(0,a.Ps)`
|
|
198
188
|
query GetContexts {
|
|
199
189
|
contexts {
|
|
200
190
|
items {
|
|
@@ -202,7 +192,7 @@ updatedAt
|
|
|
202
192
|
}
|
|
203
193
|
}
|
|
204
194
|
}
|
|
205
|
-
`,
|
|
195
|
+
`,g=(0,a.Ps)`
|
|
206
196
|
query GetContextById($id: ID!) {
|
|
207
197
|
contextById(id: $id) {
|
|
208
198
|
${n}
|
|
@@ -468,8 +458,8 @@ updatedAt
|
|
|
468
458
|
}
|
|
469
459
|
}
|
|
470
460
|
`;let R=(0,a.Ps)`
|
|
471
|
-
query GetAgentById($id: ID
|
|
472
|
-
agentById(id: $id) {
|
|
461
|
+
query GetAgentById($id: ID!, $project: ID) {
|
|
462
|
+
agentById(id: $id, project: $project) {
|
|
473
463
|
${$}
|
|
474
464
|
}
|
|
475
465
|
}
|
|
@@ -489,6 +479,7 @@ updatedAt
|
|
|
489
479
|
agent
|
|
490
480
|
created_by
|
|
491
481
|
rights_mode
|
|
482
|
+
project
|
|
492
483
|
RBAC {
|
|
493
484
|
type
|
|
494
485
|
users {
|
|
@@ -499,10 +490,6 @@ updatedAt
|
|
|
499
490
|
id
|
|
500
491
|
rights
|
|
501
492
|
}
|
|
502
|
-
projects {
|
|
503
|
-
id
|
|
504
|
-
rights
|
|
505
|
-
}
|
|
506
493
|
}
|
|
507
494
|
id
|
|
508
495
|
}
|
|
@@ -511,6 +498,7 @@ updatedAt
|
|
|
511
498
|
query GetAgentSession($filters: [FilterAgent_session]) {
|
|
512
499
|
agent_sessionOne(filters: $filters) {
|
|
513
500
|
createdAt
|
|
501
|
+
project
|
|
514
502
|
updatedAt
|
|
515
503
|
user
|
|
516
504
|
title
|
|
@@ -611,7 +599,7 @@ updatedAt
|
|
|
611
599
|
$RBAC: RBACInput
|
|
612
600
|
) {
|
|
613
601
|
agent_sessionsCreateOne(
|
|
614
|
-
input: { agent: $agent, user: $user,
|
|
602
|
+
input: { agent: $agent, user: $user, project: $project, title: $title, rights_mode: $rights_mode, RBAC: $RBAC }
|
|
615
603
|
) {
|
|
616
604
|
item {
|
|
617
605
|
id
|
|
@@ -652,10 +640,6 @@ updatedAt
|
|
|
652
640
|
id
|
|
653
641
|
rights
|
|
654
642
|
}
|
|
655
|
-
projects {
|
|
656
|
-
id
|
|
657
|
-
rights
|
|
658
|
-
}
|
|
659
643
|
}
|
|
660
644
|
createdAt
|
|
661
645
|
}
|
|
@@ -733,10 +717,6 @@ updatedAt
|
|
|
733
717
|
id
|
|
734
718
|
rights
|
|
735
719
|
}
|
|
736
|
-
projects {
|
|
737
|
-
id
|
|
738
|
-
rights
|
|
739
|
-
}
|
|
740
720
|
}
|
|
741
721
|
}
|
|
742
722
|
}
|
|
@@ -1022,10 +1002,6 @@ updatedAt
|
|
|
1022
1002
|
id
|
|
1023
1003
|
rights
|
|
1024
1004
|
}
|
|
1025
|
-
projects {
|
|
1026
|
-
id
|
|
1027
|
-
rights
|
|
1028
|
-
}
|
|
1029
1005
|
}
|
|
1030
1006
|
}
|
|
1031
1007
|
}
|
|
@@ -1134,10 +1110,6 @@ updatedAt
|
|
|
1134
1110
|
id
|
|
1135
1111
|
rights
|
|
1136
1112
|
}
|
|
1137
|
-
projects {
|
|
1138
|
-
id
|
|
1139
|
-
rights
|
|
1140
|
-
}
|
|
1141
1113
|
}
|
|
1142
1114
|
variables
|
|
1143
1115
|
steps_json
|
|
@@ -1191,7 +1163,7 @@ updatedAt
|
|
|
1191
1163
|
count
|
|
1192
1164
|
}
|
|
1193
1165
|
}
|
|
1194
|
-
`;let
|
|
1166
|
+
`;let ep=(0,a.Ps)`
|
|
1195
1167
|
query FunctionCallsStatistics($from: Date!, $to: Date!) {
|
|
1196
1168
|
trackingStatistics(filters: {
|
|
1197
1169
|
type: { eq: TOOL_CALL }
|
|
@@ -1201,7 +1173,7 @@ updatedAt
|
|
|
1201
1173
|
count
|
|
1202
1174
|
}
|
|
1203
1175
|
}
|
|
1204
|
-
`,
|
|
1176
|
+
`,eg=(0,a.Ps)`
|
|
1205
1177
|
query AgentCallsStatistics($from: Date!, $to: Date!) {
|
|
1206
1178
|
trackingStatistics(filters: {
|
|
1207
1179
|
type: { eq: AGENT_RUN }
|
|
@@ -1436,10 +1408,6 @@ query AgentStatistics($from: Date!, $to: Date!, $names: [String!]) {
|
|
|
1436
1408
|
id
|
|
1437
1409
|
rights
|
|
1438
1410
|
}
|
|
1439
|
-
projects {
|
|
1440
|
-
id
|
|
1441
|
-
rights
|
|
1442
|
-
}
|
|
1443
1411
|
}
|
|
1444
1412
|
`,ej=(0,a.Ps)`
|
|
1445
1413
|
query GetTestCases(
|
|
@@ -1754,10 +1722,6 @@ query AgentStatistics($from: Date!, $to: Date!, $names: [String!]) {
|
|
|
1754
1722
|
id
|
|
1755
1723
|
rights
|
|
1756
1724
|
}
|
|
1757
|
-
projects {
|
|
1758
|
-
id
|
|
1759
|
-
rights
|
|
1760
|
-
}
|
|
1761
1725
|
}
|
|
1762
1726
|
`,e9=(0,a.Ps)`
|
|
1763
1727
|
query GetPrompts(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.id=3434,exports.ids=[3434],exports.modules={360:(e,s,a)=>{a.d(s,{x:()=>w});var t=a(10326),r=a(17577),l=a(18753),i=a(15211),n=a(42270),d=a(62288),o=a(90772),c=a(54432),m=a(87673),x=a(31048),h=a(941),u=a(85206),p=a(98091),v=a(34789),g=a(77863),b=a(15286),j=a(79210),f=a(36931);function w({isOpen:e,onClose:s,messages:a,sessionTitle:w,existingWorkflow:N,isReadOnly:y=!1}){let{user:C}=(0,r.useContext)(i.S),{toast:k}=(0,v.pm)(),[_,Z]=(0,r.useState)({rights_mode:N?.rights_mode||"private",users:N?.RBAC?.users||[],roles:N?.RBAC?.roles||[],projects:N?.RBAC?.projects||[]}),A=!!N,[S,z]=(0,r.useState)(N?.name||""),[E,D]=(0,r.useState)(N?.description||""),[U,B]=(0,r.useState)(N?.variables||[]),[R,W]=(0,r.useState)(N?.steps_json||[]),[$,M]=(0,r.useState)(!1),[P,V]=(0,r.useState)("setup"),[q,F]=(0,r.useState)(!1),[I,O]=(0,r.useState)(null),[H,K]=(0,r.useState)(""),[L]=(0,l.D)(n.B_),[T]=(0,l.D)(n._J),J=(0,r.useCallback)((e,s)=>{if(!e.match(/^[A-Za-z_][A-Za-z0-9_]{1,63}$/))return k({title:"Invalid variable name",description:"Variable name must start with a letter or underscore, contain only letters, numbers, and underscores, and be 2-64 characters long.",variant:"destructive"}),!1;if(U.some(s=>s.name===e))return!0;let a={name:e,type:"string",required:!0,description:s||"Auto-detected variable"};return B(e=>[...e,a]),!0},[U,k]),Q=(0,r.useCallback)((e,s)=>{let a=(s.match(/\{([A-Za-z_][A-Za-z0-9_]{1,63})\}/g)||[]).map(e=>e.slice(1,-1));a.forEach(e=>{J(e)}),W(t=>t.map(t=>t.id===e?{...t,content:s,variablesUsed:a}:t));let t=new Set;R.forEach(a=>{a.id===e?(s.match(/\{([A-Za-z_][A-Za-z0-9_]{1,63})\}/g)||[]).forEach(e=>t.add(e.slice(1,-1))):a.variablesUsed&&a.variablesUsed.forEach(e=>t.add(e))}),B(e=>e.filter(e=>t.has(e.name)))},[R,J]),G=(0,r.useCallback)(e=>{B(s=>s.filter(s=>s.name!==e)),W(s=>s.map(s=>({...s,content:s.content?.replace(RegExp(`\\{${e}\\}`,"g"),""),variablesUsed:s.variablesUsed?.filter(s=>s!==e)||[]})))},[]),X=(0,r.useCallback)((e,s)=>s.match(/^[A-Za-z_][A-Za-z0-9_]{1,63}$/)?U.some(a=>a.name===s&&a.name!==e)?(k({title:"Variable name already exists",description:"A variable with this name already exists.",variant:"destructive"}),!1):(B(a=>a.map(a=>a.name===e?{...a,name:s}:a)),W(a=>a.map(a=>({...a,content:a.content?.replace(RegExp(`\\{${e}\\}`,"g"),`{${s}}`),variablesUsed:a.variablesUsed?.map(a=>a===e?s:a)||[]}))),!0):(k({title:"Invalid variable name",description:"Variable name must start with a letter or underscore and contain only letters, numbers, and underscores.",variant:"destructive"}),!1),[U,k]),Y=(0,r.useMemo)(()=>!!S.trim()&&0!==R.length&&("users"!==_.rights_mode||_.users?.length!==0)&&("roles"!==_.rights_mode||_.roles?.length!==0)&&("projects"!==_.rights_mode||_.projects?.length!==0)&&R.filter(e=>"user"===e.type).every(e=>(e.content||"").replace(/\{[^}]+\}/g,"").trim().length>0),[S,R,_]),ee=(0,r.useCallback)(async()=>{if(Y&&C?.id){M(!0);try{let e=R.map(e=>({id:e.id,type:e.type,..."user"===e.type&&{content:e.content},..."assistant"===e.type&&{contentExample:e.contentExample},..."tool"===e.type&&{toolName:e.toolName}}));A&&N?(await T({variables:{id:N.id,name:S.trim(),description:E.trim()||null,rights_mode:_.rights_mode,RBAC:{users:_.users,roles:_.roles,projects:_.projects},variables:U,steps_json:e}}),k({title:"Workflow updated!",description:`"${S}" has been updated successfully.`})):(await L({variables:{name:S.trim(),description:E.trim()||null,owner:C.id,rights_mode:_.rights_mode,RBAC:{users:_.users,roles:_.roles,projects:_.projects},variables:U,steps_json:e}}),k({title:"Workflow created!",description:`"${S}" has been saved as a workflow template.`})),s()}catch(e){console.error("Error saving workflow:",e),k({title:"Error saving workflow",description:"There was an error saving your workflow. Please try again.",variant:"destructive"})}finally{M(!1)}}},[Y,C?.id,S,E,_,U,R,L,T,k,s,A,N]);return e?t.jsx(d.Vq,{open:e,onOpenChange:s,children:(0,t.jsxs)(d.cZ,{className:"max-w-4xl max-h-[92vh] flex flex-col",children:[(0,t.jsxs)(d.fK,{className:"pb-4",children:[t.jsx(d.$N,{className:"text-lg",children:A?y?"View Workflow":"Edit Workflow":"Save as Workflow"}),t.jsx(d.Be,{className:"text-sm",children:A?y?"View workflow details and configuration.":"Modify this workflow template. Edit your messages and use {variable_name} syntax to create variables.":"Convert this conversation into a reusable workflow template. Edit your messages and use {variable_name} syntax to create variables."})]}),t.jsx("div",{className:"flex-1 mt-6",children:(0,t.jsxs)(j.mQ,{value:P,onValueChange:V,className:"h-full flex flex-col",children:[(0,t.jsxs)(j.dr,{className:"grid w-full grid-cols-2 mb-6",children:[t.jsx(j.SP,{value:"setup",className:"data-[state=active]:bg-background",children:"Setup & Permissions"}),t.jsx(j.SP,{value:"workflow",className:"data-[state=active]:bg-background",children:"Workflow Steps & Variables"})]}),(0,t.jsxs)("div",{className:"flex-1 pb-6",children:[t.jsx(j.nU,{value:"setup",className:"mt-0 h-full",children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[t.jsx(x._,{htmlFor:"workflow-name",className:"text-base font-semibold",children:"Workflow Name *"}),t.jsx(c.I,{id:"workflow-name",value:S,onChange:e=>z(e.target.value),placeholder:"My Workflow",className:"mt-2 h-11",readOnly:y}),!S.trim()&&(0,t.jsxs)("p",{className:"text-sm text-destructive mt-1 flex items-center",children:[t.jsx("span",{className:"mr-1",children:"⚠️"}),"Workflow name is required"]})]}),(0,t.jsxs)("div",{children:[t.jsx(x._,{htmlFor:"workflow-description",className:"text-base font-semibold",children:"Description"}),t.jsx(m.g,{id:"workflow-description",value:E,onChange:e=>D(e.target.value),placeholder:"Describe what this workflow does and when to use it...",rows:3,className:"mt-2 resize-none",readOnly:y})]})]}),(0,t.jsxs)("div",{className:"border-t pt-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{children:[t.jsx("h3",{className:"text-base font-semibold mb-1",children:"Sharing & Permissions"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Control who can view and edit this workflow"})]}),(0,t.jsxs)(o.z,{type:"button",variant:"outline",size:"sm",onClick:()=>F(!q),className:"ml-4",children:[q?"Hide Advanced":"Show Advanced",t.jsx(h.Z,{className:(0,g.cn)("w-4 h-4 ml-1 transition-transform",q&&"rotate-180")})]})]}),q&&t.jsx(b.P,{initialRightsMode:N?.rights_mode,initialUsers:N?.RBAC?.users,initialRoles:N?.RBAC?.roles,initialProjects:N?.RBAC?.projects,onChange:(e,s,a,t)=>{Z({rights_mode:e,users:s,roles:a,projects:t})}}),!q&&t.jsx("div",{className:"text-sm text-muted-foreground bg-muted/30 p-3 rounded-md",children:"Using default permissions (private to you)"})]})]})}),t.jsx(j.nU,{value:"workflow",className:"mt-0 h-full",children:(0,t.jsxs)("div",{className:"h-full flex gap-6",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"mb-4",children:[t.jsx("h3",{className:"text-base font-semibold mb-2",children:"Conversation Steps"}),t.jsx("div",{className:"border rounded-lg p-3 mb-4",children:(0,t.jsxs)("p",{className:"text-sm",children:["\uD83D\uDCA1 ",t.jsx("strong",{children:"Pro tip:"})," Use ","{variable_name}"," syntax in your messages to create reusable variables. For example you can use ","{company_name}"," to create a variable for the company name so you can reuse this flow template with different companies."]})})]}),t.jsx("div",{className:"space-y-4 max-h-[500px] overflow-y-auto pr-2",children:R.map((e,s)=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"border rounded-lg p-4 bg-card",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[t.jsx("span",{className:(0,g.cn)("text-sm font-medium px-3 py-1 rounded-full","user"===e.type?"bg-blue-100 text-blue-700":"assistant"===e.type?"bg-green-100 text-green-700":"bg-purple-100 text-purple-700"),children:"user"===e.type?"\uD83D\uDC64 User":"assistant"===e.type?"\uD83E\uDD16 Assistant":`🔧 ${e.toolName}`}),e.variablesUsed&&e.variablesUsed.length>0&&t.jsx("div",{className:"flex gap-1 flex-wrap",children:e.variablesUsed.map(e=>t.jsx("span",{className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded font-mono border border-blue-200",children:`{${e}}`},e))})]}),"user"===e.type?t.jsx("div",{children:t.jsx(m.g,{value:e.content||"",onChange:s=>Q(e.id,s.target.value),placeholder:"Enter your message...",className:"min-h-[80px] resize-none",rows:3,readOnly:y})}):t.jsx("div",{className:"bg-muted/50 p-3 rounded-md",children:"assistant"===e.type?(0,t.jsxs)("div",{children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Example response (will be regenerated):"}),t.jsx(f.H,{children:e.contentExample})]}):(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:["Tool: ",e.toolName]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:"Parameters will be generated dynamically"})]})})]}),s<R.length-1&&t.jsx("div",{className:"flex justify-center my-3",children:t.jsx(h.Z,{className:"w-5 h-5 text-muted-foreground/50"})})]},e.id))})]}),(0,t.jsxs)("div",{className:"w-80",children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("h3",{className:"text-base font-semibold mb-2",children:["Variables (",U.length,")"]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Auto-detected from your messages"})]}),U.length>0?t.jsx("div",{className:"space-y-3 max-h-[500px] overflow-y-auto",children:U.map(e=>(0,t.jsxs)("div",{className:"border rounded-lg p-3 bg-card",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[t.jsx("div",{className:"font-mono text-blue-600 font-medium text-sm",children:`{${e.name}}`}),!y&&t.jsx("div",{className:"flex gap-1",children:I===e.name?t.jsx(c.I,{value:H,onChange:e=>K(e.target.value),className:"h-6 text-xs font-mono w-20",placeholder:"variable_name",autoFocus:!0,onKeyDown:s=>{"Enter"===s.key?(H&&H!==e.name&&X(e.name,H),O(null),K("")):"Escape"===s.key&&(O(null),K(""))},onBlur:()=>{H&&H!==e.name&&X(e.name,H),O(null),K("")}}):(0,t.jsxs)(t.Fragment,{children:[t.jsx(o.z,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>{O(e.name),K(e.name)},children:t.jsx(u.Z,{className:"w-3 h-3"})}),t.jsx(o.z,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-destructive hover:bg-destructive/10",onClick:()=>G(e.name),children:t.jsx(p.Z,{className:"w-3 h-3"})})]})})]}),t.jsx("div",{className:"text-xs text-muted-foreground mb-2",children:e.description}),(0,t.jsxs)("div",{className:"flex gap-1",children:[t.jsx("span",{className:"text-xs bg-gray-100 text-gray-700 px-1.5 py-0.5 rounded",children:e.type}),e.required&&t.jsx("span",{className:"text-xs bg-orange-100 text-orange-700 px-1.5 py-0.5 rounded",children:"required"})]})]},e.name))}):(0,t.jsxs)("div",{className:"text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",children:[t.jsx("div",{className:"mb-3",children:t.jsx("span",{className:"text-3xl",children:"\uD83D\uDCDD"})}),t.jsx("div",{className:"text-sm mb-1 font-medium",children:"No variables yet"}),(0,t.jsxs)("div",{className:"text-xs",children:["Use ","{variable_name}"," syntax in your messages"]})]})]})]})})]})]})}),t.jsx("div",{className:"border-t p-4 bg-background",children:(0,t.jsxs)(d.cN,{children:[t.jsx(o.z,{variant:"outline",onClick:s,children:y?"Close":"Cancel"}),!y&&t.jsx(t.Fragment,{children:t.jsx(o.z,{onClick:ee,disabled:!Y||$,className:(0,g.cn)("min-w-[140px]",!Y&&"opacity-50 cursor-not-allowed"),children:$?(0,t.jsxs)(t.Fragment,{children:[t.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),A?"Updating...":"Saving..."]}):A?"Update Workflow":"Save Workflow"})})]})})]})}):null}},37859:(e,s,a)=>{a.d(s,{g:()=>l});var t=a(10326),r=a(77863);let l=({className:e})=>(0,t.jsxs)("svg",{"aria-hidden":"true",role:"status",className:(0,r.cn)("inline w-4 h-4 text-white animate-spin fill-inherit",e),viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",className:"fill-inherit opacity-20"}),t.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",className:"fill-inherit"})]})},54659:(e,s,a)=>{a.d(s,{Z:()=>t});let t=(0,a(76557).Z)("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},12714:(e,s,a)=>{a.d(s,{Z:()=>t});let t=(0,a(76557).Z)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},85206:(e,s,a)=>{a.d(s,{Z:()=>t});let t=(0,a(76557).Z)("Pen",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}]])}};
|
|
1
|
+
"use strict";exports.id=3434,exports.ids=[3434],exports.modules={360:(e,s,a)=>{a.d(s,{x:()=>w});var t=a(10326),r=a(17577),l=a(18753),n=a(15211),i=a(42270),d=a(62288),o=a(90772),c=a(54432),m=a(87673),x=a(31048),u=a(941),h=a(85206),p=a(98091),v=a(34789),b=a(77863),g=a(15286),f=a(79210),j=a(36931);function w({isOpen:e,onClose:s,messages:a,sessionTitle:w,existingWorkflow:N,isReadOnly:y=!1}){let{user:C}=(0,r.useContext)(n.S),{toast:k}=(0,v.pm)(),[_,Z]=(0,r.useState)({rights_mode:N?.rights_mode||"private",users:N?.RBAC?.users||[],roles:N?.RBAC?.roles||[]}),S=!!N,[z,A]=(0,r.useState)(N?.name||""),[E,D]=(0,r.useState)(N?.description||""),[U,W]=(0,r.useState)(N?.variables||[]),[$,B]=(0,r.useState)(N?.steps_json||[]),[M,R]=(0,r.useState)(!1),[V,P]=(0,r.useState)("setup"),[q,F]=(0,r.useState)(!1),[I,O]=(0,r.useState)(null),[H,K]=(0,r.useState)(""),[L]=(0,l.D)(i.B_),[T]=(0,l.D)(i._J),J=(0,r.useCallback)((e,s)=>{if(!e.match(/^[A-Za-z_][A-Za-z0-9_]{1,63}$/))return k({title:"Invalid variable name",description:"Variable name must start with a letter or underscore, contain only letters, numbers, and underscores, and be 2-64 characters long.",variant:"destructive"}),!1;if(U.some(s=>s.name===e))return!0;let a={name:e,type:"string",required:!0,description:s||"Auto-detected variable"};return W(e=>[...e,a]),!0},[U,k]),Q=(0,r.useCallback)((e,s)=>{let a=(s.match(/\{([A-Za-z_][A-Za-z0-9_]{1,63})\}/g)||[]).map(e=>e.slice(1,-1));a.forEach(e=>{J(e)}),B(t=>t.map(t=>t.id===e?{...t,content:s,variablesUsed:a}:t));let t=new Set;$.forEach(a=>{a.id===e?(s.match(/\{([A-Za-z_][A-Za-z0-9_]{1,63})\}/g)||[]).forEach(e=>t.add(e.slice(1,-1))):a.variablesUsed&&a.variablesUsed.forEach(e=>t.add(e))}),W(e=>e.filter(e=>t.has(e.name)))},[$,J]),G=(0,r.useCallback)(e=>{W(s=>s.filter(s=>s.name!==e)),B(s=>s.map(s=>({...s,content:s.content?.replace(RegExp(`\\{${e}\\}`,"g"),""),variablesUsed:s.variablesUsed?.filter(s=>s!==e)||[]})))},[]),X=(0,r.useCallback)((e,s)=>s.match(/^[A-Za-z_][A-Za-z0-9_]{1,63}$/)?U.some(a=>a.name===s&&a.name!==e)?(k({title:"Variable name already exists",description:"A variable with this name already exists.",variant:"destructive"}),!1):(W(a=>a.map(a=>a.name===e?{...a,name:s}:a)),B(a=>a.map(a=>({...a,content:a.content?.replace(RegExp(`\\{${e}\\}`,"g"),`{${s}}`),variablesUsed:a.variablesUsed?.map(a=>a===e?s:a)||[]}))),!0):(k({title:"Invalid variable name",description:"Variable name must start with a letter or underscore and contain only letters, numbers, and underscores.",variant:"destructive"}),!1),[U,k]),Y=(0,r.useMemo)(()=>!!z.trim()&&0!==$.length&&("users"!==_.rights_mode||_.users?.length!==0)&&("roles"!==_.rights_mode||_.roles?.length!==0)&&$.filter(e=>"user"===e.type).every(e=>{let s=e.content||"";return(s?.replace(/\{[^}]+\}/g,"")).trim().length>0}),[z,$,_]),ee=(0,r.useCallback)(async()=>{if(Y&&C?.id){R(!0);try{let e=$.map(e=>({id:e.id,type:e.type,..."user"===e.type&&{content:e.content},..."assistant"===e.type&&{contentExample:e.contentExample},..."tool"===e.type&&{toolName:e.toolName}}));S&&N?(await T({variables:{id:N.id,name:z.trim(),description:E.trim()||null,rights_mode:_.rights_mode,RBAC:{users:_.users,roles:_.roles},variables:U,steps_json:e}}),k({title:"Workflow updated!",description:`"${z}" has been updated successfully.`})):(await L({variables:{name:z.trim(),description:E.trim()||null,owner:C.id,rights_mode:_.rights_mode,RBAC:{users:_.users,roles:_.roles},variables:U,steps_json:e}}),k({title:"Workflow created!",description:`"${z}" has been saved as a workflow template.`})),s()}catch(e){console.error("Error saving workflow:",e),k({title:"Error saving workflow",description:"There was an error saving your workflow. Please try again.",variant:"destructive"})}finally{R(!1)}}},[Y,C?.id,z,E,_,U,$,L,T,k,s,S,N]);return e?t.jsx(d.Vq,{open:e,onOpenChange:s,children:(0,t.jsxs)(d.cZ,{className:"max-w-4xl max-h-[92vh] flex flex-col",children:[(0,t.jsxs)(d.fK,{className:"pb-4",children:[t.jsx(d.$N,{className:"text-lg",children:S?y?"View Workflow":"Edit Workflow":"Save as Workflow"}),t.jsx(d.Be,{className:"text-sm",children:S?y?"View workflow details and configuration.":"Modify this workflow template. Edit your messages and use {variable_name} syntax to create variables.":"Convert this conversation into a reusable workflow template. Edit your messages and use {variable_name} syntax to create variables."})]}),t.jsx("div",{className:"flex-1 mt-6",children:(0,t.jsxs)(f.mQ,{value:V,onValueChange:P,className:"h-full flex flex-col",children:[(0,t.jsxs)(f.dr,{className:"grid w-full grid-cols-2 mb-6",children:[t.jsx(f.SP,{value:"setup",className:"data-[state=active]:bg-background",children:"Setup & Permissions"}),t.jsx(f.SP,{value:"workflow",className:"data-[state=active]:bg-background",children:"Workflow Steps & Variables"})]}),(0,t.jsxs)("div",{className:"flex-1 pb-6",children:[t.jsx(f.nU,{value:"setup",className:"mt-0 h-full",children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[t.jsx(x._,{htmlFor:"workflow-name",className:"text-base font-semibold",children:"Workflow Name *"}),t.jsx(c.I,{id:"workflow-name",value:z,onChange:e=>A(e.target.value),placeholder:"My Workflow",className:"mt-2 h-11",readOnly:y}),!z.trim()&&(0,t.jsxs)("p",{className:"text-sm text-destructive mt-1 flex items-center",children:[t.jsx("span",{className:"mr-1",children:"⚠️"}),"Workflow name is required"]})]}),(0,t.jsxs)("div",{children:[t.jsx(x._,{htmlFor:"workflow-description",className:"text-base font-semibold",children:"Description"}),t.jsx(m.g,{id:"workflow-description",value:E,onChange:e=>D(e.target.value),placeholder:"Describe what this workflow does and when to use it...",rows:3,className:"mt-2 resize-none",readOnly:y})]})]}),(0,t.jsxs)("div",{className:"border-t pt-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{children:[t.jsx("h3",{className:"text-base font-semibold mb-1",children:"Sharing & Permissions"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Control who can view and edit this workflow"})]}),(0,t.jsxs)(o.z,{type:"button",variant:"outline",size:"sm",onClick:()=>F(!q),className:"ml-4",children:[q?"Hide Advanced":"Show Advanced",t.jsx(u.Z,{className:(0,b.cn)("w-4 h-4 ml-1 transition-transform",q&&"rotate-180")})]})]}),q&&t.jsx(g.P,{initialRightsMode:N?.rights_mode,initialUsers:N?.RBAC?.users,initialRoles:N?.RBAC?.roles,onChange:(e,s,a)=>{Z({rights_mode:e,users:s,roles:a})}}),!q&&t.jsx("div",{className:"text-sm text-muted-foreground bg-muted/30 p-3 rounded-md",children:"Using default permissions (private to you)"})]})]})}),t.jsx(f.nU,{value:"workflow",className:"mt-0 h-full",children:(0,t.jsxs)("div",{className:"h-full flex gap-6",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"mb-4",children:[t.jsx("h3",{className:"text-base font-semibold mb-2",children:"Conversation Steps"}),t.jsx("div",{className:"border rounded-lg p-3 mb-4",children:(0,t.jsxs)("p",{className:"text-sm",children:["\uD83D\uDCA1 ",t.jsx("strong",{children:"Pro tip:"})," Use ","{variable_name}"," syntax in your messages to create reusable variables. For example you can use ","{company_name}"," to create a variable for the company name so you can reuse this flow template with different companies."]})})]}),t.jsx("div",{className:"space-y-4 max-h-[500px] overflow-y-auto pr-2",children:$.map((e,s)=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"border rounded-lg p-4 bg-card",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[t.jsx("span",{className:(0,b.cn)("text-sm font-medium px-3 py-1 rounded-full","user"===e.type?"bg-blue-100 text-blue-700":"assistant"===e.type?"bg-green-100 text-green-700":"bg-purple-100 text-purple-700"),children:"user"===e.type?"\uD83D\uDC64 User":"assistant"===e.type?"\uD83E\uDD16 Assistant":`🔧 ${e.toolName}`}),e.variablesUsed&&e.variablesUsed.length>0&&t.jsx("div",{className:"flex gap-1 flex-wrap",children:e.variablesUsed.map(e=>t.jsx("span",{className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded font-mono border border-blue-200",children:`{${e}}`},e))})]}),"user"===e.type?t.jsx("div",{children:t.jsx(m.g,{value:e.content||"",onChange:s=>Q(e.id,s.target.value),placeholder:"Enter your message...",className:"min-h-[80px] resize-none",rows:3,readOnly:y})}):t.jsx("div",{className:"bg-muted/50 p-3 rounded-md",children:"assistant"===e.type?(0,t.jsxs)("div",{children:[t.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Example response (will be regenerated):"}),t.jsx(j.H,{children:e.contentExample})]}):(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:["Tool: ",e.toolName]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:"Parameters will be generated dynamically"})]})})]}),s<$.length-1&&t.jsx("div",{className:"flex justify-center my-3",children:t.jsx(u.Z,{className:"w-5 h-5 text-muted-foreground/50"})})]},e.id))})]}),(0,t.jsxs)("div",{className:"w-80",children:[(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)("h3",{className:"text-base font-semibold mb-2",children:["Variables (",U.length,")"]}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Auto-detected from your messages"})]}),U.length>0?t.jsx("div",{className:"space-y-3 max-h-[500px] overflow-y-auto",children:U.map(e=>(0,t.jsxs)("div",{className:"border rounded-lg p-3 bg-card",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[t.jsx("div",{className:"font-mono text-blue-600 font-medium text-sm",children:`{${e.name}}`}),!y&&t.jsx("div",{className:"flex gap-1",children:I===e.name?t.jsx(c.I,{value:H,onChange:e=>K(e.target.value),className:"h-6 text-xs font-mono w-20",placeholder:"variable_name",autoFocus:!0,onKeyDown:s=>{"Enter"===s.key?(H&&H!==e.name&&X(e.name,H),O(null),K("")):"Escape"===s.key&&(O(null),K(""))},onBlur:()=>{H&&H!==e.name&&X(e.name,H),O(null),K("")}}):(0,t.jsxs)(t.Fragment,{children:[t.jsx(o.z,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:()=>{O(e.name),K(e.name)},children:t.jsx(h.Z,{className:"w-3 h-3"})}),t.jsx(o.z,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0 text-destructive hover:bg-destructive/10",onClick:()=>G(e.name),children:t.jsx(p.Z,{className:"w-3 h-3"})})]})})]}),t.jsx("div",{className:"text-xs text-muted-foreground mb-2",children:e.description}),(0,t.jsxs)("div",{className:"flex gap-1",children:[t.jsx("span",{className:"text-xs bg-gray-100 text-gray-700 px-1.5 py-0.5 rounded",children:e.type}),e.required&&t.jsx("span",{className:"text-xs bg-orange-100 text-orange-700 px-1.5 py-0.5 rounded",children:"required"})]})]},e.name))}):(0,t.jsxs)("div",{className:"text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",children:[t.jsx("div",{className:"mb-3",children:t.jsx("span",{className:"text-3xl",children:"\uD83D\uDCDD"})}),t.jsx("div",{className:"text-sm mb-1 font-medium",children:"No variables yet"}),(0,t.jsxs)("div",{className:"text-xs",children:["Use ","{variable_name}"," syntax in your messages"]})]})]})]})})]})]})}),t.jsx("div",{className:"border-t p-4 bg-background",children:(0,t.jsxs)(d.cN,{children:[t.jsx(o.z,{variant:"outline",onClick:s,children:y?"Close":"Cancel"}),!y&&t.jsx(t.Fragment,{children:t.jsx(o.z,{onClick:ee,disabled:!Y||M,className:(0,b.cn)("min-w-[140px]",!Y&&"opacity-50 cursor-not-allowed"),children:M?(0,t.jsxs)(t.Fragment,{children:[t.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),S?"Updating...":"Saving..."]}):S?"Update Workflow":"Save Workflow"})})]})})]})}):null}},37859:(e,s,a)=>{a.d(s,{g:()=>l});var t=a(10326),r=a(77863);let l=({className:e})=>(0,t.jsxs)("svg",{"aria-hidden":"true",role:"status",className:(0,r.cn)("inline w-4 h-4 text-white animate-spin fill-inherit",e),viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",className:"fill-inherit opacity-20"}),t.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",className:"fill-inherit"})]})},54659:(e,s,a)=>{a.d(s,{Z:()=>t});let t=(0,a(76557).Z)("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},12714:(e,s,a)=>{a.d(s,{Z:()=>t});let t=(0,a(76557).Z)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},85206:(e,s,a)=>{a.d(s,{Z:()=>t});let t=(0,a(76557).Z)("Pen",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}]])}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=3503,exports.ids=[3503],exports.modules={5354:(e,t,s)=>{s.d(t,{iG:()=>i,ri:()=>n});var a=s(10326);s(90772);var r=s(77863);s(17577);var l=s(30778);let n=({className:e,...t})=>a.jsx(l.h,{className:(0,r.cn)("relative flex-1 overflow-y-auto",e),initial:"smooth",resize:"smooth",role:"log",...t}),i=({className:e,...t})=>a.jsx(l.h.Content,{className:(0,r.cn)("p-4",e),...t})},87599:(e,t,s)=>{s.d(t,{K:()=>M});var a=s(10326);s(28758);var r=s(77863);let l=({className:e,from:t,...s})=>a.jsx("div",{className:(0,r.cn)("group flex w-full items-end justify-end gap-2 py-4","user"===t?"is-user flex-row-reverse justify-end":"is-assistant flex-row-reverse justify-end","[&>div]:max-w-[80%]",e),...s}),n=({children:e,className:t,...s})=>a.jsx("div",{className:(0,r.cn)("flex flex-col gap-2 overflow-hidden rounded-lg py-3 text-foreground text-sm","group-[.is-user]:bg-secondary group-[.is-user]:text-primary-foreground group-[.is-user]:px-4","group-[.is-assistant]:bg-transparent group-[.is-assistant]:text-foreground",t),...s,children:a.jsx("div",{className:"is-user:dark",children:e})});var i=s(90772),o=s(68232);let d=({className:e,children:t,...s})=>a.jsx("div",{className:(0,r.cn)("flex items-center gap-1",e),...s,children:t}),c=({tooltip:e,children:t,label:s,className:l,variant:n="ghost",size:d="sm",...c})=>{let m=(0,a.jsxs)(i.z,{className:(0,r.cn)("size-9 p-1.5 text-muted-foreground hover:text-foreground",l),size:d,type:"button",variant:n,...c,children:[t,a.jsx("span",{className:"sr-only",children:s||e})]});return e?a.jsx(o.pn,{children:(0,a.jsxs)(o.u,{children:[a.jsx(o.aJ,{asChild:!0,children:m}),a.jsx(o._v,{children:a.jsx("p",{children:e})})]})}):m};var m=s(36931),u=s(52067),p=s(24295),x=s(98360),h=s(941),g=s(17577);let f=(0,g.createContext)(null),j=()=>{let e=(0,g.useContext)(f);if(!e)throw Error("Reasoning components must be used within Reasoning");return e},N=(0,g.memo)(({className:e,isStreaming:t=!1,open:s,defaultOpen:l=!1,onOpenChange:n,duration:i,children:o,...d})=>{let[c,m]=(0,u.T)({prop:s,defaultProp:l,onChange:n}),[x,h]=(0,u.T)({prop:i,defaultProp:0}),[j,N]=(0,g.useState)(!1),[y,v]=(0,g.useState)(null);return(0,g.useEffect)(()=>{t?null===y&&v(Date.now()):null!==y&&(h(Math.round((Date.now()-y)/1e3)),v(null))},[t,y,h]),(0,g.useEffect)(()=>{if(t&&!c)m(!0);else if(!t&&c&&!l&&!j){let e=setTimeout(()=>{m(!1),N(!0)},1e3);return()=>clearTimeout(e)}},[t,c,l,m,j]),a.jsx(f.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:m,duration:x},children:a.jsx(p.zF,{className:(0,r.cn)("not-prose mb-4",e),onOpenChange:e=>{m(e)},open:c,...d,children:o})})}),y=(0,g.memo)(({className:e,title:t="Reasoning",children:s,...l})=>{let{isStreaming:n,isOpen:i,duration:o}=j();return a.jsx(p.wy,{className:(0,r.cn)("flex items-center gap-2 text-muted-foreground text-sm",e),...l,children:s??(0,a.jsxs)(a.Fragment,{children:[a.jsx(x.Z,{className:"size-4"}),n||0===o?a.jsx("p",{children:"Thinking..."}):(0,a.jsxs)("p",{children:["Thought for ",o," seconds"]}),a.jsx(h.Z,{className:(0,r.cn)("size-4 text-muted-foreground transition-transform",i?"rotate-180":"rotate-0")})]})})}),v=(0,g.memo)(({className:e,children:t,...s})=>a.jsx(p.Fw,{className:(0,r.cn)("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...s,children:a.jsx(m.H,{className:"grid gap-2",children:t})}));N.displayName="Reasoning",y.displayName="ReasoningTrigger",v.displayName="ReasoningContent";var w=s(71876);let b=({className:e,...t})=>a.jsx(p.zF,{className:(0,r.cn)("not-prose mb-4 text-primary text-xs",e),...t}),C=({className:e,count:t,children:s,...r})=>a.jsx(p.wy,{className:"flex items-center gap-2",...r,children:s??(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{className:"font-medium",children:["Used ",t," sources"]}),a.jsx(h.Z,{className:"h-4 w-4"})]})}),T=({className:e,...t})=>a.jsx(p.Fw,{className:(0,r.cn)("mt-3 flex w-fit flex-col gap-2","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),_=({href:e,title:t,children:s,...r})=>a.jsx("a",{className:"flex items-center gap-2",href:e,rel:"noreferrer",target:"_blank",...r,children:s??(0,a.jsxs)(a.Fragment,{children:[a.jsx(w.Z,{className:"h-4 w-4"}),a.jsx("span",{className:"block font-medium",children:t})]})});var k=s(91468),F=s(43810),$=s(46226),z=s(34789),Z=s(53982),P=s(75290),R=s(2179),I=s(91470);let L={pending:{icon:Z.Z,label:"Pending",className:"text-muted-foreground"},in_progress:{icon:P.Z,label:"In Progress",className:"text-blue-500 animate-spin"},completed:{icon:R.Z,label:"Completed",className:"text-green-500"},cancelled:{icon:I.Z,label:"Cancelled",className:"text-red-500"}},S={high:{label:"High",className:"bg-red-500/10 text-red-500 border-red-500/20"},medium:{label:"Medium",className:"bg-yellow-500/10 text-yellow-500 border-yellow-500/20"},low:{label:"Low",className:"bg-blue-500/10 text-blue-500 border-blue-500/20"}},E=({todos:e,showPriority:t=!1,state:s,className:l,...n})=>{if("string"==typeof e&&(e=JSON.parse(e)),!e||0===e.length)return null;let i=e.filter(e=>"completed"===e.status).length,o=e.length;return(0,a.jsxs)("div",{className:(0,r.cn)("my-2 space-y-1","input-streaming"===s&&"opacity-70",l),...n,children:[e.map((s,l)=>{let n=L[s.status]?L[s.status].icon:L.pending.icon,i=L[s.status]?L[s.status].className:L.pending.className;S[s.priority]?S[s.priority].className:S.medium.className;let o="in_progress"===s.status&&l===e.findIndex(e=>"in_progress"===e.status);return(0,a.jsxs)("div",{className:(0,r.cn)("flex items-start gap-2 py-0.5","cancelled"===s.status&&"opacity-50"),children:[a.jsx("div",{className:"flex-shrink-0 pt-0.5",children:a.jsx(n,{className:(0,r.cn)("size-3.5",i)})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:(0,r.cn)("text-sm","completed"===s.status&&"text-muted-foreground line-through","cancelled"===s.status&&"text-muted-foreground line-through","in_progress"===s.status&&o&&"font-medium"),children:s.content}),t&&"high"===s.priority&&a.jsx("span",{className:"ml-2 text-red-500 text-xs",children:"(!)"})]})]},s.id)}),o>1&&(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-1 text-muted-foreground text-xs",children:[a.jsx("div",{className:"h-1 flex-1 overflow-hidden rounded-full bg-secondary",children:a.jsx("div",{className:"h-full bg-primary transition-all duration-300",style:{width:`${i/o*100}%`}})}),(0,a.jsxs)("span",{className:"whitespace-nowrap",children:[i,"/",o]})]}),"output-error"===s&&(0,a.jsxs)("div",{className:"flex items-center gap-1 pt-1 text-red-500 text-xs",children:[a.jsx(I.Z,{className:"size-3"}),a.jsx("span",{children:"Error updating tasks"})]})]})};var K=s(77961);function M({messages:e,status:t="idle",className:s,showActions:i=!0,onRegenerate:o,onAddToolResult:u,UntypedToolPartComponent:p,addToContext:x,writeAccess:h=!0,config:g}){let{toast:f}=(0,z.pm)();return a.jsx(a.Fragment,{children:e?.map((e,j)=>{let w=e.metadata,z=e.parts.filter(e=>"text"===e.type&&e.text?.includes('<file name="'))?.flatMap(e=>{let t=e.text.match(/<file name="([^"]+)">([^<]+)<\/file>/g);return t?.map(e=>{console.log("filePart",e);let t=e.match(/<file name="([^"]+)">/)?.[1]??"";return console.log("s3Key",t),{s3Key:t,content:e.match(/<file name="([^"]+)">([^<]+)<\/file>/)?.[2]??""}})??[]})??[];return console.log("files",z),a.jsx(l,{className:r.cn("assistant"===e.role&&(g?.customAssistantClassnames?g?.customAssistantClassnames:""),0===j&&(g?.marginTopFirstMessage?g?.marginTopFirstMessage:"mt-12"),s),from:e.role,children:a.jsxs(n,{children:[e.parts.map((s,r)=>{if("step-start"===s.type)return null;if("text"===s.type){let t=s.text.replace(/<file name="([^"]+)">([^<]+)<\/file>/g,"");return a.jsx(m.H,{className:"chat-response-container",children:t},`${e.id}-${r}_response`)}if("tool-askForConfirmation"===s.type&&u){let e=s.toolCallId;switch(s.state){case"input-streaming":return a.jsx("div",{children:"Loading confirmation request..."},e);case"input-available":return a.jsxs("div",{children:[s.input.message,a.jsxs("div",{children:[a.jsx("button",{onClick:()=>u({tool:"askForConfirmation",toolCallId:e,output:"Yes, confirmed"}),children:"Yes"}),a.jsx("button",{onClick:()=>u({tool:"askForConfirmation",toolCallId:e,output:"No, denied"}),children:"No"})]})]},e);case"output-available":return a.jsxs("div",{children:["Tool call allowed: ",s.output]},e);case"output-error":return a.jsxs("div",{children:["Error: ",s.errorText]},e)}}if(s.type?.toLowerCase().includes("preview_pdf")||s.type?.toLowerCase().includes("pdf_file_in_a_web_view")){let e=JSON.parse(s.output?.result??"{}");if(!e?.url)return a.jsxs("div",{children:["No URL provided for PDF preview ",JSON.stringify(e)]});let t=`${e.url}#page=${e.page??1}`;return a.jsx("iframe",{src:t,style:{width:"100%",height:"100vh"},title:"PDF viewer"})}if(s.type?.toLowerCase()==="tool-todo_write"||s.type?.toLowerCase()==="tool-todo_read"){let e=s.output;if(!e?.result)return null;let t=s.state;return a.jsx(E,{todos:e.result,showPriority:!0,state:t})}if((s.type.startsWith("tool-")||"dynamic-tool"===s.type)&&p&&x){let e=s.toolCallId;return a.jsx(p,{untypedToolPart:s,callId:e,addToContext:x},e)}return"file"===s.type&&s.mediaType?.startsWith("image/")?a.jsx($.default,{src:s.url,width:300,height:300,alt:"Generated image"},`${e.id}-${r}`):"source-url"===s.type?a.jsxs(b,{children:[a.jsx(C,{count:e.parts.filter(e=>"source-url"===e.type).length}),a.jsx(T,{children:e.parts.map((t,s)=>{if("source-url"===t.type)return a.jsx(_,{href:t.url,title:t.title},`${e.id}-${s}`)})},`${e.id}`)]},`${e.id}-${r}`):"reasoning"===s.type?a.jsxs(N,{className:"w-full",isStreaming:"streaming"===t,children:[a.jsx(y,{}),a.jsx(v,{children:s.text})]},`${e.id}-${r}`):null}),z.length>0&&a.jsx("div",{className:"grid grid-cols-6 min-w-[500px] gap-2 mt-3 mb-3",children:z.map(t=>a.jsx(K.jU,{s3Key:t.s3Key,onRemove:()=>{},active:!1,disabled:!1},t.s3Key+"_file_item_"+e.id))}),i&&"assistant"===e.role&&a.jsxs(d,{className:"mt-2",children:[o&&a.jsx(c,{onClick:()=>o(),label:"Retry",disabled:!h,children:a.jsx(k.Z,{className:"size-3"})}),a.jsx(c,{onClick:()=>{navigator.clipboard.writeText(e.parts.map(e=>e?.text||"").join("\n")),f({title:"Copied message",description:"The message was copied to your clipboard."})},label:"Copy",children:a.jsx(F.Z,{className:"size-3"})}),w?.totalTokens&&a.jsxs("small",{className:"text-muted-foreground",children:[Intl.NumberFormat("en-US").format(w?.totalTokens)," tokens"]})]})]})},e.id)})})}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
exports.id=3575,exports.ids=[3575],exports.modules={30058:(e,s,t)=>{Promise.resolve().then(t.bind(t,92214))},92214:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>F});var a=t(10326),l=t(90434),n=t(88307),r=t(11890),i=t(33734),d=t(18019),o=t(90772),c=t(54432),x=t(39167),h=t(18753),u=t(42270),m=t(17577),g=t(29718),f=t(35047),p=t(65304),j=t(30510),v=t(15211),N=t(76812),w=t(32663),b=t(83855),y=t(60097),k=t(62288),S=t(34789),C=t(77863),z=t(13854),_=t(43641);function O({agent:e,type:s}){let t=(0,f.usePathname)(),{toast:r}=(0,S.pm)(),{user:i}=(0,m.useContext)(v.S),[d,g]=(0,m.useState)("");(0,z.d)();let j=(0,f.useRouter)(),[O,P]=(0,m.useState)({searchString:null}),[F,D]=(0,m.useState)(!1),[$,I]=(0,m.useState)(null),[Z,A]=(0,m.useState)(""),B=(0,x.aM)(u.GJ,{returnPartialData:!0,fetchPolicy:"network-only",nextFetchPolicy:"network-only",variables:{page:1,limit:40,filters:{agent:{eq:e}}}}),[R,G]=(0,h.D)(u.S9,{refetchQueries:[u.GJ,"GetAgentSessions"]}),[L,W]=(0,h.D)(u.fB),[E,K]=(0,h.D)(u.bI,{refetchQueries:[u.GJ,"GetAgentSessions"]}),J=async()=>{let s=await L({variables:{user:i.id,agent:e,type:"FLOW",title:d.trim(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}});if(s.errors){console.error("error",s.errors);return}if(!s.data?.agent_sessionsCreateOne?.item?.id){console.error("error","failed to create session");return}g(""),B.refetch(),j.push(`/chat/${e}/${s.data?.agent_sessionsCreateOne?.item?.id}`)},M=async()=>{if(!$||!Z.trim())return;let e=await E({variables:{id:$,title:Z.trim()}});if(e.errors){console.error("error",e.errors),r({title:"Error",description:"Failed to rename session.",variant:"destructive"});return}r({title:"Session renamed",description:"The session has been renamed successfully."}),D(!1),I(null),A("")};return(0,a.jsxs)("div",{className:"relative hidden flex-col items-start md:flex h-100 overflow-y-scroll border-r","x-chunk":"dashboard-03-chunk-0",children:[a.jsx("h2",{className:"mb-2 px-4 text-lg font-semibold tracking-tight",children:"Sessions"}),a.jsx("div",{className:"bg-background/95 w-full backdrop-blur supports-[backdrop-filter]:bg-background/60",children:a.jsx("form",{children:(0,a.jsxs)("div",{className:"relative",children:[a.jsx(n.Z,{className:"absolute left-2 top-2.5 size-4 text-muted-foreground"}),a.jsx(c.I,{onKeyUp:e=>{P(e.currentTarget.value)},placeholder:"Search sessions",className:"pl-8 border-0"})]})})}),(0,a.jsxs)("div",{className:"flex w-full items-center gap-2 p-3 border-t justify-between",children:[a.jsx(c.I,{autoFocus:!0,value:d,onChange:e=>g(e.target.value),onKeyDown:e=>{"Enter"===e.key&&J()},placeholder:"Name",className:"flex-1"}),a.jsx(o.z,{variant:"secondary",tabIndex:1,disabled:W.loading||!d.trim(),onClick:async()=>{J()},children:a.jsx("div",{className:"font-semibold",children:a.jsx(b.Z,{})})})]}),B.loading&&(0,a.jsxs)("div",{className:"w-full flex flex-col p-2 pt-0 pb-2",children:[a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md"}),a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md mt-3"}),a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md mt-3"}),a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md mt-3"})]}),!B.loading&&!B?.data?.agent_sessionsPagination?.items?.length&&a.jsx("div",{className:"w-full flex",children:a.jsx("p",{className:"mx-auto mt-5",children:"No sessions found."})}),B.loading?null:B?.data?.agent_sessionsPagination?.items?.map(s=>{let n=_.I({...s,agent:s.agent.id},i);return a.jsx("div",{className:"w-full px-2 flex flex-col items-start gap-0 rounded-none border-none text-left text-sm mb-2",children:a.jsx(l.default,{href:`/chat/${e}/${s.id}`,className:C.cn("p-2 w-full flex flex-col items-start gap-2 rounded-md p-3 text-left text-sm transition-all hover:bg-accent",t.includes(s.id)&&"bg-muted",n?"border border-l-4 border-r-0 border-y-0 border-gray-700":"border border-l-4 border-r-0 border-y-0 border-yellow-900"),children:a.jsxs("div",{className:"flex w-full flex-col px-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("div",{className:"text-md font-medium max-w-[80%] truncate",children:s.title?s.title?.substring(0,20):"No title"}),a.jsxs("div",{className:C.cn("ml-0 text-xs capitalize",t.includes(s.id)?"text-foreground":"text-muted-foreground"),children:[s.updatedAt?w.Q(new Date(s.updatedAt),{addSuffix:!0}):null,"."]})]}),n&&a.jsxs(y.h_,{modal:!1,children:[a.jsx(y.$F,{asChild:!0,children:a.jsxs(o.z,{variant:"ghost",className:"flex size-8 p-0 data-[state=open]:bg-muted",children:[a.jsx(N.nWS,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Open menu"})]})}),a.jsxs(y.AW,{align:"end",className:"w-[160px]",children:[a.jsx(y.Xi,{className:"cursor-pointer",onClick:e=>{e.preventDefault(),e.stopPropagation(),I(s.id),A(s.title||""),D(!0)},children:"Rename"}),a.jsx(y.Xi,{className:"cursor-pointer",onClick:()=>{R({variables:{id:s.id}}),r({title:"Deleting session",description:"We deleted the session."})},children:"Delete"})]})]})]}),a.jsx("small",{className:"text-xs text-muted-foreground",children:s.agent?.name})]})},s.id)},s.id)}),a.jsx(k.Vq,{open:F,onOpenChange:D,children:(0,a.jsxs)(k.cZ,{children:[(0,a.jsxs)(k.fK,{children:[a.jsx(k.$N,{children:"Rename Session"}),a.jsx(k.Be,{children:"Enter a new name for this session."})]}),a.jsx(c.I,{value:Z,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"===e.key&&M()},placeholder:"Session name"}),(0,a.jsxs)(k.cN,{children:[a.jsx(o.z,{variant:"outline",onClick:()=>{D(!1),I(null),A("")},children:"Cancel"}),a.jsx(o.z,{onClick:M,disabled:K.loading||!Z.trim(),children:"Rename"})]})]})})]},e+s)}function P(){let[e,s]=m.useState(""),[t,N]=m.useState(null),[w,b]=m.useState(!1),[y,k]=m.useState(!1),[S,C]=m.useState(!1),z=(0,f.useParams)(),_=(0,f.usePathname)(),{user:P}=(0,m.useContext)(v.S),[F,D]=(0,m.useState)(P),$=(0,x.aM)(u.W9,{fetchPolicy:"no-cache",nextFetchPolicy:"network-only",variables:{ids:F?.favourite_agents||[]},skip:!F?.favourite_agents?.length}),I=(0,x.aM)(u.ym,{fetchPolicy:"no-cache",nextFetchPolicy:"network-only",variables:{page:1,limit:200,filters:{...F?.super_admin?{}:{active:!0},...e?{name:{contains:e}}:{}}}}),[Z]=(0,h.D)(u.Pe,{onCompleted:e=>{D({...F,favourite_agents:e.usersUpdateOneById?.item?.favourite_agents})}}),A=(e,s)=>{s.preventDefault(),s.stopPropagation(),N(e),b(!0)},B=(e,s)=>{let t;s.preventDefault(),s.stopPropagation(),console.log("user",F);let a=F?.favourite_agents||[];console.log("newFavourites",t=a.includes(e)?a.filter(s=>s!==e):[...a,e]),Z({variables:{id:F.id,favourite_agents:t}})},R=z.agent?I?.data?.agentsPagination?.items?.find(e=>e.id===z.agent):null,G=e=>e.image?a.jsx("img",{src:e.image,alt:`${e.name} profile`,className:"h-4 w-4 rounded-full object-cover"}):a.jsx("div",{className:"h-4 w-4 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white text-xs font-medium",children:e.name?.charAt(0).toUpperCase()||"A"});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"pb-12 w-[250px]",children:[a.jsx("div",{className:"space-y-4 py-4",children:(0,a.jsxs)("div",{children:[a.jsx("h2",{className:"mb-2 px-4 text-lg font-semibold tracking-tight",children:"Agents"}),a.jsx("div",{children:(0,a.jsxs)("div",{className:"relative",children:[a.jsx(n.Z,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),a.jsx(c.I,{placeholder:"Search agents...",value:e,onChange:e=>s(e.target.value),className:"pl-8 h-9 border-0"})]})}),(0,a.jsxs)("div",{className:"space-y-1 border-t px-2 pt-2",children:[R&&!S&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:()=>C(!S),children:a.jsx(r.Z,{className:"h-3 w-3"})}),a.jsx(l.default,{onClick:()=>C(!1),href:`/chat/${R.id}`,className:"flex-1",children:(0,a.jsxs)(o.z,{onClick:()=>C(!1),variant:_.includes(R.id)?"secondary":"ghost",className:"w-full justify-start gap-2 pr-5",children:[G(R),a.jsx("span",{className:"flex-1 text-left",children:a.jsx(g.L,{text:R.name,length:7})})]})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:e=>B(R.id,e),children:a.jsx(i.Z,{className:"h-3 w-3 fill-yellow-400 text-yellow-400"})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:e=>A(R.id,e),children:a.jsx(d.Z,{className:"h-3 w-3"})})]},`fav-${R.id}`),(!R||S||e)&&(0,a.jsxs)(a.Fragment,{children:[F?.favourite_agents&&F?.favourite_agents?.length>0&&!e&&(0,a.jsxs)(a.Fragment,{children:[$.loading&&(0,a.jsxs)(a.Fragment,{children:[a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"})]}),!$.loading&&(()=>{let e=$?.data?.agentByIds||[],s=y?e:e.slice(0,4);return(0,a.jsxs)(a.Fragment,{children:[s.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[a.jsx(l.default,{href:`/chat/${e.id}`,className:"flex-1",children:(0,a.jsxs)(o.z,{variant:_.includes(e.id)?"secondary":"ghost",className:"w-full justify-start gap-2 pr-1",children:[G(e),a.jsx("span",{className:"flex-1 text-left",children:a.jsx(g.L,{text:e.name,length:10})})]})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>B(e.id,s),children:a.jsx(i.Z,{className:"h-3 w-3 fill-yellow-400 text-yellow-400"})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>A(e.id,s),children:a.jsx(d.Z,{className:"h-3 w-3"})})]},`fav-${e.id}`)),e.length>4&&a.jsx(o.z,{variant:"ghost",className:"w-full justify-center text-xs text-muted-foreground h-8",onClick:()=>k(!y),children:y?"Show less":`Show more (${e.length-4})`})]})})()]}),I.loading&&(0,a.jsxs)(a.Fragment,{children:[a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"})]}),!I.loading&&(()=>{let s=I?.data?.agentsPagination?.items?.filter(s=>!F?.favourite_agents?.includes(s.id)||e)||[],t=e||S?s:s.slice(0,4);return(0,a.jsxs)(a.Fragment,{children:[t.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[a.jsx(l.default,{href:`/chat/${e.id}`,className:"flex-1",children:(0,a.jsxs)(o.z,{variant:_.includes(e.id)?"secondary":"ghost",className:"w-full justify-start gap-2 pr-1",children:[G(e),a.jsx("span",{className:"flex-1 text-left",children:a.jsx(g.L,{text:e.name,length:14})})]})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>B(e.id,s),children:a.jsx(i.Z,{className:`h-3 w-3 ${F?.favourite_agents?.includes(e.id)?"fill-yellow-400 text-yellow-400":""}`})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>A(e.id,s),children:a.jsx(d.Z,{className:"h-3 w-3"})})]},e.id)),!e&&s.length>4&&a.jsx(o.z,{variant:"ghost",className:"w-full justify-center text-xs text-muted-foreground h-8",onClick:()=>C(!S),children:S?"Show less":`Show more (${s.length-4})`})]})})()]})]})]})}),z.agent&&a.jsx(O,{agent:z.agent,type:"chat"})]}),t&&a.jsx(j.z,{agentId:t,open:w,onOpenChange:e=>{b(e),e||N(null)}})]})}function F({children:e}){return(0,a.jsxs)("div",{className:"flex h-full",children:[a.jsx("div",{className:"border-r bg-muted/10",children:a.jsx(P,{})}),e]})}},29718:(e,s,t)=>{"use strict";t.d(s,{L:()=>l});var a=t(10326);function l({text:e,length:s}){return e.length>s?(0,a.jsxs)(a.Fragment,{children:[e.slice(0,s),"..."]}):a.jsx(a.Fragment,{children:e})}},43641:(e,s,t)=>{"use strict";t.d(s,{I:()=>a});let a=(e,s)=>{let t="private"===e.rights_mode,a="public"===e.rights_mode,l="users"===e.rights_mode,n="roles"===e.rights_mode,r=s.super_admin,i=e.created_by===s.id.toString(),d=!1;return t&&i&&(d=!0),a&&(d=!0),l&&(d=e.RBAC?.users?.find(e=>e.id===s.id)?.rights==="write"),n&&(d=e.RBAC?.roles?.find(e=>e.id===s.role?.id)?.rights==="write"),r&&(d=!0),d}},33734:(e,s,t)=>{"use strict";t.d(s,{Z:()=>a});let a=(0,t(76557).Z)("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]])},90502:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>a});let a=(0,t(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/chat/layout.tsx#default`)}};
|
|
1
|
+
exports.id=3575,exports.ids=[3575],exports.modules={30058:(e,s,t)=>{Promise.resolve().then(t.bind(t,92214))},92214:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>F});var a=t(10326),l=t(90434),n=t(88307),r=t(11890),i=t(33734),d=t(18019),o=t(90772),c=t(54432),x=t(39167),h=t(18753),u=t(42270),m=t(17577),g=t(29718),f=t(35047),p=t(65304),j=t(30510),v=t(15211),N=t(76812),w=t(32663),b=t(83855),y=t(60097),k=t(62288),S=t(34789),C=t(77863),z=t(13854),_=t(43641);function O({agent:e,type:s}){let t=(0,f.usePathname)(),{toast:r}=(0,S.pm)(),{user:i}=(0,m.useContext)(v.S),[d,g]=(0,m.useState)("");(0,z.d)();let j=(0,f.useRouter)(),[O,P]=(0,m.useState)({searchString:null}),[F,D]=(0,m.useState)(!1),[$,I]=(0,m.useState)(null),[Z,A]=(0,m.useState)(""),B=(0,x.aM)(u.GJ,{returnPartialData:!0,fetchPolicy:"network-only",nextFetchPolicy:"network-only",variables:{page:1,limit:40,filters:{agent:{eq:e}}}}),[R,G]=(0,h.D)(u.S9,{refetchQueries:[u.GJ,"GetAgentSessions"]}),[L,W]=(0,h.D)(u.fB),[E,K]=(0,h.D)(u.bI,{refetchQueries:[u.GJ,"GetAgentSessions"]}),J=async()=>{let s=await L({variables:{user:i.id,agent:e,type:"FLOW",title:d.trim(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}});if(s.errors){console.error("error",s.errors);return}if(!s.data?.agent_sessionsCreateOne?.item?.id){console.error("error","failed to create session");return}g(""),B.refetch(),j.push(`/chat/${e}/${s.data?.agent_sessionsCreateOne?.item?.id}`)},M=async()=>{if(!$||!Z.trim())return;let e=await E({variables:{id:$,title:Z.trim()}});if(e.errors){console.error("error",e.errors),r({title:"Error",description:"Failed to rename session.",variant:"destructive"});return}r({title:"Session renamed",description:"The session has been renamed successfully."}),D(!1),I(null),A("")};return(0,a.jsxs)("div",{className:"relative hidden flex-col items-start md:flex border-r","x-chunk":"dashboard-03-chunk-0",children:[a.jsx("h2",{className:"mb-2 px-4 text-lg font-semibold tracking-tight",children:"Sessions"}),a.jsx("div",{className:"bg-background/95 w-full backdrop-blur supports-[backdrop-filter]:bg-background/60",children:a.jsx("form",{children:(0,a.jsxs)("div",{className:"relative",children:[a.jsx(n.Z,{className:"absolute left-2 top-2.5 size-4 text-muted-foreground"}),a.jsx(c.I,{onKeyUp:e=>{P(e.currentTarget.value)},placeholder:"Search sessions",className:"pl-8 border-0"})]})})}),(0,a.jsxs)("div",{className:"flex w-full items-center gap-2 p-3 border-t justify-between",children:[a.jsx(c.I,{autoFocus:!0,value:d,onChange:e=>g(e.target.value),onKeyDown:e=>{"Enter"===e.key&&J()},placeholder:"Name",className:"flex-1"}),a.jsx(o.z,{variant:"secondary",tabIndex:1,disabled:W.loading||!d.trim(),onClick:async()=>{J()},children:a.jsx("div",{className:"font-semibold",children:a.jsx(b.Z,{})})})]}),B.loading&&(0,a.jsxs)("div",{className:"w-full flex flex-col p-2 pt-0 pb-2",children:[a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md"}),a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md mt-3"}),a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md mt-3"}),a.jsx(p.O,{className:"w-full rounded h-[70px] rounded-md mt-3"})]}),!B.loading&&!B?.data?.agent_sessionsPagination?.items?.length&&a.jsx("div",{className:"w-full flex",children:a.jsx("p",{className:"mx-auto mt-5",children:"No sessions found."})}),B.loading?null:B?.data?.agent_sessionsPagination?.items?.map(s=>{let n=_.I({...s,agent:s.agent.id},i);return a.jsx("div",{className:"w-full px-2 flex flex-col items-start gap-0 rounded-none border-none text-left text-sm mb-2",children:a.jsx(l.default,{href:`/chat/${e}/${s.id}`,className:C.cn("p-2 w-full flex flex-col items-start gap-2 rounded-md p-3 text-left text-sm transition-all hover:bg-accent",t.includes(s.id)&&"bg-muted",n?"border border-l-4 border-r-0 border-y-0 border-gray-700":"border border-l-4 border-r-0 border-y-0 border-yellow-900"),children:a.jsxs("div",{className:"flex w-full flex-col px-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("div",{className:"text-md font-medium max-w-[80%] truncate",children:s.title?s.title?.substring(0,20):"No title"}),a.jsxs("div",{className:C.cn("ml-0 text-xs capitalize",t.includes(s.id)?"text-foreground":"text-muted-foreground"),children:[s.updatedAt?w.Q(new Date(s.updatedAt),{addSuffix:!0}):null,"."]})]}),n&&a.jsxs(y.h_,{modal:!1,children:[a.jsx(y.$F,{asChild:!0,children:a.jsxs(o.z,{variant:"ghost",className:"flex size-8 p-0 data-[state=open]:bg-muted",children:[a.jsx(N.nWS,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Open menu"})]})}),a.jsxs(y.AW,{align:"end",className:"w-[160px]",children:[a.jsx(y.Xi,{className:"cursor-pointer",onClick:e=>{e.preventDefault(),e.stopPropagation(),I(s.id),A(s.title||""),D(!0)},children:"Rename"}),a.jsx(y.Xi,{className:"cursor-pointer",onClick:()=>{R({variables:{id:s.id}}),r({title:"Deleting session",description:"We deleted the session."})},children:"Delete"})]})]})]}),a.jsx("small",{className:"text-xs text-muted-foreground",children:s.agent?.name})]})},s.id)},s.id)}),a.jsx(k.Vq,{open:F,onOpenChange:D,children:(0,a.jsxs)(k.cZ,{children:[(0,a.jsxs)(k.fK,{children:[a.jsx(k.$N,{children:"Rename Session"}),a.jsx(k.Be,{children:"Enter a new name for this session."})]}),a.jsx(c.I,{value:Z,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"===e.key&&M()},placeholder:"Session name"}),(0,a.jsxs)(k.cN,{children:[a.jsx(o.z,{variant:"outline",onClick:()=>{D(!1),I(null),A("")},children:"Cancel"}),a.jsx(o.z,{onClick:M,disabled:K.loading||!Z.trim(),children:"Rename"})]})]})})]},e+s)}function P(){let[e,s]=m.useState(""),[t,N]=m.useState(null),[w,b]=m.useState(!1),[y,k]=m.useState(!1),[S,C]=m.useState(!1),z=(0,f.useParams)(),_=(0,f.usePathname)(),{user:P}=(0,m.useContext)(v.S),[F,D]=(0,m.useState)(P),$=(0,x.aM)(u.W9,{fetchPolicy:"no-cache",nextFetchPolicy:"network-only",variables:{ids:F?.favourite_agents||[]},skip:!F?.favourite_agents?.length}),I=(0,x.aM)(u.ym,{fetchPolicy:"no-cache",nextFetchPolicy:"network-only",variables:{page:1,limit:200,filters:{...F?.super_admin?{}:{active:!0},...e?{name:{contains:e}}:{}}}}),[Z]=(0,h.D)(u.Pe,{onCompleted:e=>{D({...F,favourite_agents:e.usersUpdateOneById?.item?.favourite_agents})}}),A=(e,s)=>{s.preventDefault(),s.stopPropagation(),N(e),b(!0)},B=(e,s)=>{let t;s.preventDefault(),s.stopPropagation(),console.log("user",F);let a=F?.favourite_agents||[];console.log("newFavourites",t=a.includes(e)?a.filter(s=>s!==e):[...a,e]),Z({variables:{id:F.id,favourite_agents:t}})},R=z.agent?I?.data?.agentsPagination?.items?.find(e=>e.id===z.agent):null,G=e=>e.image?a.jsx("img",{src:e.image,alt:`${e.name} profile`,className:"h-4 w-4 rounded-full object-cover"}):a.jsx("div",{className:"h-4 w-4 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white text-xs font-medium",children:e.name?.charAt(0).toUpperCase()||"A"});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"pb-12 w-[250px] max-h-[calc(100vh)] overflow-y-auto overflow-x-hidden",children:[a.jsx("div",{className:"space-y-4 py-4",children:(0,a.jsxs)("div",{children:[a.jsx("h2",{className:"mb-2 px-4 text-lg font-semibold tracking-tight",children:"Agents"}),a.jsx("div",{children:(0,a.jsxs)("div",{className:"relative",children:[a.jsx(n.Z,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),a.jsx(c.I,{placeholder:"Search agents...",value:e,onChange:e=>s(e.target.value),className:"pl-8 h-9 border-0"})]})}),(0,a.jsxs)("div",{className:"space-y-1 border-t px-2 pt-2",children:[R&&!S&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:()=>C(!S),children:a.jsx(r.Z,{className:"h-3 w-3"})}),a.jsx(l.default,{onClick:()=>C(!1),href:`/chat/${R.id}`,className:"flex-1",children:(0,a.jsxs)(o.z,{onClick:()=>C(!1),variant:_.includes(R.id)?"secondary":"ghost",className:"w-full justify-start gap-2 pr-5",children:[G(R),a.jsx("span",{className:"flex-1 text-left",children:a.jsx(g.L,{text:R.name,length:7})})]})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:e=>B(R.id,e),children:a.jsx(i.Z,{className:"h-3 w-3 fill-yellow-400 text-yellow-400"})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:e=>A(R.id,e),children:a.jsx(d.Z,{className:"h-3 w-3"})})]},`fav-${R.id}`),(!R||S||e)&&(0,a.jsxs)(a.Fragment,{children:[F?.favourite_agents&&F?.favourite_agents?.length>0&&!e&&(0,a.jsxs)(a.Fragment,{children:[$.loading&&(0,a.jsxs)(a.Fragment,{children:[a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"})]}),!$.loading&&(()=>{let e=$?.data?.agentByIds||[],s=y?e:e.slice(0,4);return(0,a.jsxs)(a.Fragment,{children:[s.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[a.jsx(l.default,{href:`/chat/${e.id}`,className:"flex-1",children:(0,a.jsxs)(o.z,{variant:_.includes(e.id)?"secondary":"ghost",className:"w-full justify-start gap-2 pr-1",children:[G(e),a.jsx("span",{className:"flex-1 text-left",children:a.jsx(g.L,{text:e.name,length:10})})]})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>B(e.id,s),children:a.jsx(i.Z,{className:"h-3 w-3 fill-yellow-400 text-yellow-400"})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>A(e.id,s),children:a.jsx(d.Z,{className:"h-3 w-3"})})]},`fav-${e.id}`)),e.length>4&&a.jsx(o.z,{variant:"ghost",className:"w-full justify-center text-xs text-muted-foreground h-8",onClick:()=>k(!y),children:y?"Show less":`Show more (${e.length-4})`})]})})()]}),I.loading&&(0,a.jsxs)(a.Fragment,{children:[a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"}),a.jsx(p.O,{className:"w-[100%] h-[32px] rounded-lg"})]}),!I.loading&&(()=>{let s=I?.data?.agentsPagination?.items?.filter(s=>!F?.favourite_agents?.includes(s.id)||e)||[],t=e||S?s:s.slice(0,4);return(0,a.jsxs)(a.Fragment,{children:[t.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[a.jsx(l.default,{href:`/chat/${e.id}`,className:"flex-1",children:(0,a.jsxs)(o.z,{variant:_.includes(e.id)?"secondary":"ghost",className:"w-full justify-start gap-2 pr-1",children:[G(e),a.jsx("span",{className:"flex-1 text-left",children:a.jsx(g.L,{text:e.name,length:14})})]})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>B(e.id,s),children:a.jsx(i.Z,{className:`h-3 w-3 ${F?.favourite_agents?.includes(e.id)?"fill-yellow-400 text-yellow-400":""}`})}),a.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:s=>A(e.id,s),children:a.jsx(d.Z,{className:"h-3 w-3"})})]},e.id)),!e&&s.length>4&&a.jsx(o.z,{variant:"ghost",className:"w-full justify-center text-xs text-muted-foreground h-8",onClick:()=>C(!S),children:S?"Show less":`Show more (${s.length-4})`})]})})()]})]})]})}),z.agent&&a.jsx(O,{agent:z.agent,type:"chat"})]}),t&&a.jsx(j.z,{agentId:t,open:w,onOpenChange:e=>{b(e),e||N(null)}})]})}function F({children:e}){return(0,a.jsxs)("div",{className:"flex h-full",children:[a.jsx("div",{className:"border-r bg-muted/10",children:a.jsx(P,{})}),e]})}},29718:(e,s,t)=>{"use strict";t.d(s,{L:()=>l});var a=t(10326);function l({text:e,length:s}){return e.length>s?(0,a.jsxs)(a.Fragment,{children:[e.slice(0,s),"..."]}):a.jsx(a.Fragment,{children:e})}},43641:(e,s,t)=>{"use strict";t.d(s,{I:()=>a});let a=(e,s)=>{let t="private"===e.rights_mode,a="public"===e.rights_mode,l="users"===e.rights_mode,n="roles"===e.rights_mode,r=s.super_admin,i=e.created_by===s.id.toString(),d=!1;return t&&i&&(d=!0),a&&(d=!0),l&&(d=e.RBAC?.users?.find(e=>e.id===s.id)?.rights==="write"),n&&(d=e.RBAC?.roles?.find(e=>e.id===s.role?.id)?.rights==="write"),r&&(d=!0),d}},33734:(e,s,t)=>{"use strict";t.d(s,{Z:()=>a});let a=(0,t(76557).Z)("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]])},90502:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>a});let a=(0,t(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/chat/layout.tsx#default`)}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=5084,exports.ids=[5084],exports.modules={85060:(e,s,t)=>{t.d(s,{F:()=>T});var a=t(10326),r=t(17577),l=t(39167),d=t(18753),n=t(18019),i=t(40617),o=t(1572),c=t(83855),m=t(87888),x=t(75290),u=t(62288),p=t(90772),f=t(54432),h=t(31048),g=t(87673),b=t(42270),v=t(34789),j=t(79210),N=t(33071),y=t(567),w=t(65685),C=t(77961),k=t(87599),S=t(5354);function T({open:e,onClose:s,evalSetId:t,onSuccess:T,testCase:Z}){let{toast:D}=(0,v.pm)(),R=!!Z,{data:_}=(0,l.aM)(b.Ul,{variables:{page:1,limit:100}}),{regularTools:z,agentTools:F,knowledgeSourceTools:V}=(0,r.useMemo)(()=>{let e=_?.tools?.items||[];return console.log("tools",e),{regularTools:e.filter(e=>"function"===e.type),agentTools:e.filter(e=>"agent"===e.type),knowledgeSourceTools:e.filter(e=>"context"===e.type)}},[_]),[M,A]=(0,r.useState)(""),[E,q]=(0,r.useState)(""),[O,U]=(0,r.useState)(""),[K,P]=(0,r.useState)([]),[Y,$]=(0,r.useState)(""),[B,I]=(0,r.useState)(null),[H,L]=(0,r.useState)([]),[W,G]=(0,r.useState)([]),[J,Q]=(0,r.useState)([]),[X,ee]=(0,r.useState)([]),[es,et]=(0,r.useState)(""),[ea,er]=(0,r.useState)(""),[el,ed]=(0,r.useState)(""),[en,{loading:ei}]=(0,d.D)(b.hx,{onCompleted:()=>{D({title:"Test case created",description:"The test case has been successfully created."}),T()},onError:e=>{D({title:"Failed to create test case",description:e.message,variant:"destructive"})}}),[eo,{loading:ec}]=(0,d.D)(b.Mh,{onCompleted:()=>{D({title:"Test case updated",description:"The test case has been successfully updated."}),T()},onError:e=>{D({title:"Failed to update test case",description:e.message,variant:"destructive"})}}),em=()=>{if(!Y.trim()&&0===H.length)return;let e=[];Y.trim()&&e.push({type:"text",text:Y.trim()}),H.length>0&&e.push(...H),P([...K,{id:`msg-${Date.now()}`,role:"user",parts:e},{id:`msg-${Date.now()}`,role:"assistant",metadata:{type:"placeholder"},parts:[{type:"text",text:"\uD83D\uDCAC Placeholder, generated agent response will be added here when the test case is run..."}]}]),$(""),I(null),L([])},ex=ei||ec;return a.jsx(u.Vq,{open:e,onOpenChange:s,children:(0,a.jsxs)(u.cZ,{className:"max-w-4xl max-h-[90vh] overflow-hidden flex flex-col",children:[(0,a.jsxs)(u.fK,{children:[(0,a.jsxs)(u.$N,{children:[R?"Edit Test Case":"Create Test Case"," ",t?`for Eval Set: ${t}`:""]}),a.jsx(u.Be,{children:R?"Update the test case details.":"Create a new test case with conversation inputs and expected outputs."})]}),(0,a.jsxs)("form",{onSubmit:e=>{if(e.preventDefault(),!M.trim()||!O.trim()||0===K.length){D({title:"Validation error",description:"Name, at least one input message, and expected output are required.",variant:"destructive"});return}let s={name:M.trim(),description:E.trim()||null,inputs:K,expected_output:O.trim(),expected_tools:W.length>0?W:null,expected_knowledge_sources:J.length>0?J:null,expected_agent_tools:X.length>0?X:null,...t?{eval_set_id:t}:{}};R?eo({variables:{id:Z.id,data:s}}):en({variables:{data:s}})},className:"flex-1 overflow-hidden flex flex-col",children:[(0,a.jsxs)(j.mQ,{defaultValue:"basic",className:"flex-1 overflow-hidden flex flex-col",children:[(0,a.jsxs)(j.dr,{className:"grid w-full grid-cols-2",children:[(0,a.jsxs)(j.SP,{value:"basic",className:"gap-2",children:[a.jsx(n.Z,{className:"h-4 w-4"}),"Basic Info"]}),(0,a.jsxs)(j.SP,{value:"conversation",className:"gap-2",children:[a.jsx(i.Z,{className:"h-4 w-4"}),"Conversation"]})]}),(0,a.jsxs)(w.x,{className:"flex-1",children:[a.jsx(j.nU,{value:"basic",className:"space-y-4 p-1 mt-4",children:(0,a.jsxs)("div",{className:"grid gap-5",children:[(0,a.jsxs)("div",{className:"grid gap-2",children:[a.jsx(h._,{htmlFor:"name",children:"Name *"}),a.jsx(f.I,{id:"name",placeholder:"e.g., Customer Support - Refund Request",value:M,onChange:e=>A(e.target.value),disabled:ex,required:!0})]}),(0,a.jsxs)("div",{className:"grid gap-2",children:[a.jsx(h._,{htmlFor:"description",children:"Description"}),a.jsx(g.g,{id:"description",placeholder:"Describe what this test case evaluates...",value:E,onChange:e=>q(e.target.value),disabled:ex,rows:3})]}),(0,a.jsxs)("div",{className:"grid gap-2",children:[a.jsx(h._,{htmlFor:"expectedOutput",children:"Expected Output *"}),a.jsx(g.g,{id:"expectedOutput",placeholder:"Describe the expected final output (e.g., 'A JSON object containing refund details', 'An empathetic response offering alternatives')",value:O,onChange:e=>U(e.target.value),disabled:ex,rows:4,required:!0}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"This can be an exact expected response or a description of what the output should contain."})]})]})}),a.jsx(j.nU,{value:"conversation",className:"space-y-4 p-1 mt-4",children:(0,a.jsxs)(N.Zb,{children:[a.jsx(N.Ol,{className:"pb-3",children:a.jsx("div",{className:"flex items-start justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.ll,{className:"text-sm flex items-center gap-2",children:[a.jsx(i.Z,{className:"h-4 w-4"}),"Conversation Flow",K.length>0&&(0,a.jsxs)(y.C,{variant:"secondary",className:"ml-2",children:[K.length," ",1===K.length?"message":"messages"]})]}),a.jsx(N.SZ,{className:"mt-1.5",children:"Add user messages in order. The agent will run through this conversation flow and respond between each message automatically."})]})})}),(0,a.jsxs)(N.aY,{className:"space-y-6",children:[K?.length===0?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center border-2 border-dashed border-muted rounded-lg",children:[a.jsx(o.Z,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),a.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No messages yet"}),a.jsx("p",{className:"text-sm text-muted-foreground max-w-sm",children:"Start building your test conversation by adding user messages below."})]}):a.jsx(S.ri,{className:"max-h-[350px] overflow-y-auto border rounded-lg bg-muted/30 transition-all duration-300 ease-in-out",children:a.jsx(S.iG,{className:"px-6 py-4",children:a.jsx("div",{className:"animate-in fade-in duration-500",children:a.jsx(k.K,{messages:K,config:{marginTopFirstMessage:"mt-0",customAssistantClassnames:"bg-secondary/50 rounded-lg px-3 py-1 border-l-2 border-primary/30"},status:"ready",showActions:!1,writeAccess:!1})})})}),(0,a.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[a.jsx(h._,{htmlFor:"currentInput",className:"text-sm font-semibold",children:"Add User Message"}),(0,a.jsxs)("div",{className:"space-y-3",children:[a.jsx(g.g,{id:"currentInput",placeholder:"Type the user's message...",value:Y,onChange:e=>$(e.target.value),disabled:ex,rows:2,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),em())}}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[a.jsx(C.ZP,{id:"test-case-files",selectionLimit:10,allowedFileTypes:[".png",".jpg",".jpeg",".gif",".webp",".pdf",".docx",".xlsx",".xls",".csv",".pptx",".ppt",".mp3",".wav",".m4a",".mp4",".mpeg"],dependencies:[],onConfirm:e=>{I(e)}}),(0,a.jsxs)(p.z,{type:"button",variant:"outline",onClick:em,disabled:ex||!Y.trim()&&0===H.length,className:"ml-auto",size:"default",children:[a.jsx(c.Z,{className:"h-4 w-4 mr-2"}),"Add Message"]})]}),B&&B.length>0&&(0,a.jsxs)(a.Fragment,{children:[a.jsx("div",{className:"grid grid-cols-3 gap-2",children:B.map(e=>a.jsx(C.jU,{s3Key:e,disabled:!0,active:!1,onRemove:()=>{I(B?.filter(s=>s!==e))}}))}),(0,a.jsxs)("div",{className:"flex items-start gap-2 p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[a.jsx(m.Z,{className:"h-4 w-4 text-amber-600 dark:text-amber-500 mt-0.5 flex-shrink-0"}),(0,a.jsxs)("p",{className:"text-xs text-amber-900 dark:text-amber-200",children:[a.jsx("strong",{children:"Note:"})," When running this test case, ensure the selected agent supports the file types you've attached here (images, documents, audio, etc.)."]})]})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Press Enter to add, Shift+Enter for new line. You can attach files to messages."})]})]})]})})]})]}),(0,a.jsxs)(u.cN,{className:"mt-4 gap-2",children:[a.jsx(p.z,{type:"button",variant:"outline",onClick:s,disabled:ex,children:"Cancel"}),(0,a.jsxs)(p.z,{type:"submit",disabled:ex||!M.trim()||!O.trim()||0===K.length,className:"shadow-sm hover:shadow-md transition-all",children:[ex&&a.jsx(x.Z,{className:"mr-2 h-4 w-4 animate-spin"}),R?"Update Test Case":"Create Test Case"]})]})]})]})})}},567:(e,s,t)=>{t.d(s,{C:()=>n});var a=t(10326),r=t(79360);t(17577);var l=t(77863);let d=(0,r.j)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function n({className:e,variant:s,...t}){return a.jsx("div",{className:(0,l.cn)(d({variant:s}),e),...t})}},33071:(e,s,t)=>{t.d(s,{Ol:()=>n,SZ:()=>o,Zb:()=>d,aY:()=>c,eW:()=>m,ll:()=>i});var a=t(10326),r=t(17577),l=t(77863);let d=r.forwardRef(({className:e,...s},t)=>a.jsx("div",{ref:t,className:(0,l.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",e),...s}));d.displayName="Card";let n=r.forwardRef(({className:e,...s},t)=>a.jsx("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5 p-6",e),...s}));n.displayName="CardHeader";let i=r.forwardRef(({className:e,...s},t)=>a.jsx("h3",{ref:t,className:(0,l.cn)("text-2xl font-semibold leading-none tracking-tight",e),...s}));i.displayName="CardTitle";let o=r.forwardRef(({className:e,...s},t)=>a.jsx("p",{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",e),...s}));o.displayName="CardDescription";let c=r.forwardRef(({className:e,...s},t)=>a.jsx("div",{ref:t,className:(0,l.cn)("p-6 pt-0",e),...s}));c.displayName="CardContent";let m=r.forwardRef(({className:e,...s},t)=>a.jsx("div",{ref:t,className:(0,l.cn)("flex items-center p-6 pt-0",e),...s}));m.displayName="CardFooter"},62288:(e,s,t)=>{t.d(s,{$N:()=>f,Be:()=>h,Vq:()=>i,cN:()=>p,cZ:()=>x,fK:()=>u,hg:()=>o});var a=t(10326),r=t(98986),l=t(94019),d=t(17577),n=t(77863);let i=r.fC,o=r.xz,c=r.h_;r.x8;let m=d.forwardRef(({className:e,...s},t)=>a.jsx(r.aV,{ref:t,className:(0,n.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...s}));m.displayName=r.aV.displayName;let x=d.forwardRef(({className:e,children:s,...t},d)=>(0,a.jsxs)(c,{children:[a.jsx(m,{}),(0,a.jsxs)(r.VY,{ref:d,className:(0,n.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t,children:[s,(0,a.jsxs)(r.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(l.Z,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));x.displayName=r.VY.displayName;let u=({className:e,...s})=>a.jsx("div",{className:(0,n.cn)("flex flex-col space-y-1.5 text-center sm:text-left",e),...s});u.displayName="DialogHeader";let p=({className:e,...s})=>a.jsx("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...s});p.displayName="DialogFooter";let f=d.forwardRef(({className:e,...s},t)=>a.jsx(r.Dx,{ref:t,className:(0,n.cn)("text-lg font-semibold leading-none tracking-tight",e),...s}));f.displayName=r.Dx.displayName;let h=d.forwardRef(({className:e,...s},t)=>a.jsx(r.dk,{ref:t,className:(0,n.cn)("text-sm text-muted-foreground",e),...s}));h.displayName=r.dk.displayName},31048:(e,s,t)=>{t.d(s,{_:()=>o});var a=t(10326),r=t(34478),l=t(79360),d=t(17577),n=t(77863);let i=(0,l.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=d.forwardRef(({className:e,...s},t)=>a.jsx(r.f,{ref:t,className:(0,n.cn)(i(),e),...s}));o.displayName=r.f.displayName},65685:(e,s,t)=>{t.d(s,{B:()=>i,x:()=>n});var a=t(10326),r=t(9261),l=t(17577),d=t(77863);let n=l.forwardRef(({className:e,children:s,...t},l)=>(0,a.jsxs)(r.fC,{ref:l,className:(0,d.cn)("relative overflow-hidden",e),...t,children:[a.jsx(r.l_,{className:"size-full rounded-[inherit]",children:s}),a.jsx(i,{}),a.jsx(r.Ns,{})]}));n.displayName=r.fC.displayName;let i=l.forwardRef(({className:e,orientation:s="vertical",...t},l)=>a.jsx(r.gb,{ref:l,orientation:s,className:(0,d.cn)("flex touch-none select-none transition-colors","vertical"===s&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===s&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...t,children:a.jsx(r.q4,{className:"relative flex-1 rounded-full bg-border"})}));i.displayName=r.gb.displayName},87673:(e,s,t)=>{t.d(s,{g:()=>d});var a=t(10326),r=t(17577),l=t(77863);let d=r.forwardRef(({className:e,...s},t)=>a.jsx("textarea",{className:(0,l.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:t,...s}));d.displayName="Textarea"},75290:(e,s,t)=>{t.d(s,{Z:()=>a});let a=(0,t(76557).Z)("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},98091:(e,s,t)=>{t.d(s,{Z:()=>a});let a=(0,t(76557).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
exports.id=5192,exports.ids=[5192],exports.modules={73022:(e,t,r)=>{Promise.resolve().then(r.bind(r,8078))},8078:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>
|
|
1
|
+
exports.id=5192,exports.ids=[5192],exports.modules={73022:(e,t,r)=>{Promise.resolve().then(r.bind(r,8078))},8078:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>P});var s=r(10326),n=r(90434),a=r(88307),i=r(83855),l=r(33734),o=r(90772),c=r(54432),d=r(39167),u=r(18753),m=r(42270),p=r(17577),h=r(29718),x=r(35047),j=r(65304),f=r(15211),v=r(31048),g=r(87673),y=r(62288),N=r(75290),w=r(34789);function b({open:e,onOpenChange:t,refetchProjects:r}){let[n,a]=(0,p.useState)({name:"",description:"",custom_instructions:""}),[i,l]=(0,p.useState)(!1),{toast:d}=(0,w.pm)(),h=(0,x.useRouter)(),[j]=(0,u.D)(m.kp,{refetchQueries:[{query:m.fM,variables:{page:1,limit:200}}]}),f=async e=>{if(e.preventDefault(),!n.name.trim()){d({title:"Validation Error",description:"Project name is required.",variant:"destructive"});return}l(!0);try{let e=await j({variables:{input:{name:n.name.trim(),description:n.description.trim()||null,custom_instructions:n.custom_instructions.trim()||null,rights_mode:"private"}}});console.log(e);let s=e.data?.projectsCreateOne?.item;s&&(d({title:"Success",description:"Project created successfully!"}),a({name:"",description:"",custom_instructions:""}),t(!1),h.push(`/projects/${s.id}`),r())}catch(e){console.error("Error creating project:",e),d({title:"Error",description:e.message||"Failed to create project. Please try again.",variant:"destructive"})}finally{l(!1)}};return s.jsx(y.Vq,{open:e,onOpenChange:t,children:(0,s.jsxs)(y.cZ,{className:"sm:max-w-[500px]",children:[(0,s.jsxs)(y.fK,{children:[s.jsx(y.$N,{children:"Create New Project"}),s.jsx(y.Be,{children:"Create a new project to organize your chat sessions and documents."})]}),(0,s.jsxs)("form",{onSubmit:f,className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[s.jsx(v._,{htmlFor:"project-name",children:"Project Name *"}),s.jsx(c.I,{id:"project-name",value:n.name,onChange:e=>a({...n,name:e.target.value}),placeholder:"Enter project name",required:!0,disabled:i})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[s.jsx(v._,{htmlFor:"project-description",children:"Description"}),s.jsx(g.g,{id:"project-description",value:n.description,onChange:e=>a({...n,description:e.target.value}),placeholder:"Describe what this project is about...",rows:3,disabled:i})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[s.jsx(v._,{htmlFor:"custom-instructions",children:"Custom Instructions"}),s.jsx(g.g,{id:"custom-instructions",value:n.custom_instructions,onChange:e=>a({...n,custom_instructions:e.target.value}),placeholder:"Enter custom instructions for chat sessions in this project...",rows:3,disabled:i})]}),(0,s.jsxs)(y.cN,{children:[s.jsx(o.z,{type:"button",variant:"outline",onClick:()=>{a({name:"",description:"",custom_instructions:""}),t(!1)},disabled:i,children:"Cancel"}),s.jsx(o.z,{type:"submit",disabled:i,children:i?(0,s.jsxs)(s.Fragment,{children:[s.jsx(N.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating..."]}):"Create Project"})]})]})]})})}function C(){let[e,t]=(0,p.useState)(""),[r,v]=(0,p.useState)(!1),g=(0,x.usePathname)(),{user:y}=(0,p.useContext)(f.S),[N,w]=(0,p.useState)(y),C=(0,d.aM)(m.Ak,{fetchPolicy:"no-cache",nextFetchPolicy:"network-only",variables:{ids:N?.favourite_projects||[]},skip:!N?.favourite_projects?.length}),P=(0,d.aM)(m.fM,{fetchPolicy:"no-cache",nextFetchPolicy:"network-only",variables:{page:1,limit:200,filters:e?[{name:{contains:e}}]:void 0}}),[_]=(0,u.D)(m.d5),k=e=>e.image?s.jsx("img",{src:e.image,alt:`${e.name} thumbnail`,className:"h-4 w-4 rounded-full object-cover"}):s.jsx("div",{className:"h-4 w-4 rounded-full bg-gradient-to-br from-green-500 to-blue-600 flex items-center justify-center text-white text-xs font-medium",children:e.name?.charAt(0).toUpperCase()||"P"}),F=async(e,t)=>{t.preventDefault(),t.stopPropagation();try{let t;let r=N?.favourite_projects||[];t=r.includes(e)?r.filter(t=>t!==e):[...r,e],await _({variables:{id:N?.id,favourite_projects:t}}),w(e=>({...e,favourite_projects:t}))}catch(e){console.error("Error updating favourite projects:",e)}},E=P?.data?.projectsPagination?.items||P?.previousData?.projectsPagination?.items||[],M=C?.data?.projectByIds||C?.previousData?.projectByIds||[];return(0,s.jsxs)("div",{className:"h-full w-[250px] flex-col gap-2 p-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[s.jsx(a.Z,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(c.I,{type:"search",placeholder:"Search projects...",className:"pl-8",value:e,onChange:e=>t(e.target.value)})]}),s.jsx(o.z,{variant:"outline",size:"lg",className:"h-10 w-10 p-0",onClick:()=>{v(!0)},title:"Create new project",children:s.jsx(i.Z,{className:"h-3 w-3"})})]}),s.jsx("div",{className:"flex-1 overflow-auto space-y-1",children:(0,s.jsxs)(s.Fragment,{children:[N?.favourite_projects&&M.length>0&&!e&&(0,s.jsxs)(s.Fragment,{children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-2 py-1",children:"Favorites"}),C.loading&&(0,s.jsxs)(s.Fragment,{children:[s.jsx(j.O,{className:"w-[100%] h-[32px] rounded-lg"}),s.jsx(j.O,{className:"w-[100%] h-[32px] rounded-lg"})]}),!C.loading&&s.jsx(s.Fragment,{children:M.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[s.jsx(n.default,{href:`/projects/${e.id}`,className:"flex-1",children:(0,s.jsxs)(o.z,{variant:g.includes(e.id)?"secondary":"ghost",className:"w-full justify-start gap-2 pr-1",children:[k(e),s.jsx("span",{className:"flex-1 text-left",children:s.jsx(h.L,{text:e.name,length:10})})]})}),s.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:t=>F(e.id,t),children:s.jsx(l.Z,{className:"h-3 w-3 fill-yellow-400 text-yellow-400"})})]},e.id))})]}),s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-2 py-1 mt-2",children:"All projects:"}),P.loading&&(0,s.jsxs)(s.Fragment,{children:[s.jsx(j.O,{className:"w-[100%] h-[32px] rounded-lg"}),s.jsx(j.O,{className:"w-[100%] h-[32px] rounded-lg"}),s.jsx(j.O,{className:"w-[100%] h-[32px] rounded-lg"})]}),!P.loading&&E.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[s.jsx(n.default,{href:`/projects/${e.id}`,className:"flex-1",children:(0,s.jsxs)(o.z,{variant:g.includes(e.id)?"secondary":"ghost",className:"w-full justify-start gap-2 pr-1",children:[k(e),s.jsx("span",{className:"flex-1 text-left",children:s.jsx(h.L,{text:e.name,length:14})})]})}),s.jsx(o.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 flex-shrink-0",onClick:t=>F(e.id,t),children:s.jsx(l.Z,{className:`h-3 w-3 ${N?.favourite_projects?.includes(e.id)?"fill-yellow-400 text-yellow-400":""}`})})]},e.id))]})}),s.jsx(b,{open:r,onOpenChange:v,refetchProjects:P.refetch})]})}function P({children:e}){return(0,s.jsxs)("div",{className:"flex h-full",children:[s.jsx("div",{className:"border-r bg-muted/10",children:s.jsx(C,{})}),e]})}},29718:(e,t,r)=>{"use strict";r.d(t,{L:()=>n});var s=r(10326);function n({text:e,length:t}){return e.length>t?(0,s.jsxs)(s.Fragment,{children:[e.slice(0,t),"..."]}):s.jsx(s.Fragment,{children:e})}},83855:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});let s=(0,r(76557).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},33734:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});let s=(0,r(76557).Z)("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]])},98637:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});let s=(0,r(68570).createProxy)(String.raw`/home/runner/work/exulu-frontend/exulu-frontend/app/(application)/projects/layout.tsx#default`)},18753:(e,t,r)=>{"use strict";r.d(t,{D:()=>u});var s=r(65826),n=r(66126),a=r(34837),i=r(20208),l=r(76049),o=r(17267),c=r(88571),d=r(51047).Nq?n.useLayoutEffect:n.useEffect;function u(e,t){var r=(0,c.x)(null==t?void 0:t.client);(0,l.Vp)(e,l.n_.Mutation);var u=n.useState({called:!1,loading:!1,client:r}),m=u[0],p=u[1],h=n.useRef({result:m,mutationId:0,isMounted:!0,client:r,mutation:e,options:t});d(function(){Object.assign(h.current,{client:r,options:t,mutation:e})});var x=n.useCallback(function(e){void 0===e&&(e={});var t=h.current,r=t.options,n=t.mutation,l=(0,s.pi)((0,s.pi)({},r),{mutation:n}),c=e.client||h.current.client;h.current.result.loading||l.ignoreResults||!h.current.isMounted||p(h.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:c});var d=++h.current.mutationId,u=(0,a.J)(l,e);return c.mutate(u).then(function(t){var r,s,n=t.data,a=t.errors,l=a&&a.length>0?new o.cA({graphQLErrors:a}):void 0,m=e.onError||(null===(r=h.current.options)||void 0===r?void 0:r.onError);if(l&&m&&m(l,u),d===h.current.mutationId&&!u.ignoreResults){var x={called:!0,loading:!1,data:n,error:l,client:c};h.current.isMounted&&!(0,i.D)(h.current.result,x)&&p(h.current.result=x)}var j=e.onCompleted||(null===(s=h.current.options)||void 0===s?void 0:s.onCompleted);return l||null==j||j(t.data,u),t},function(t){if(d===h.current.mutationId&&h.current.isMounted){var r,s={loading:!1,error:t,data:void 0,called:!0,client:c};(0,i.D)(h.current.result,s)||p(h.current.result=s)}var n=e.onError||(null===(r=h.current.options)||void 0===r?void 0:r.onError);if(n)return n(t,u),{data:void 0,errors:t};throw t})},[]),j=n.useCallback(function(){if(h.current.isMounted){var e={called:!1,loading:!1,client:h.current.client};Object.assign(h.current,{mutationId:0,result:e}),p(e)}},[]);return n.useEffect(function(){var e=h.current;return e.isMounted=!0,function(){e.isMounted=!1}},[]),[x,(0,s.pi)({reset:j},m)]}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=5485,exports.ids=[5485],exports.modules={19753:(e,s,a)=>{a.d(s,{R:()=>S});var t=a(10326),l=a(17577),i=a(39167),r=a(18753),n=a(42270),d=a(90772),c=a(33071),o=a(53313),x=a(15940),m=a(79210),u=a(99440),h=a(567),j=a(75290),p=a(94893),g=a(71059),f=a(56762),b=a(98091),N=a(91468),v=a(11890),y=a(39183),w=a(34789),C=a(98181),k=a(18615),R=a(76812);function S({queueName:e,nameGenerator:s,retryJob:a}){let{toast:S}=(0,w.pm)(),[P,z]=(0,l.useState)(!1),[T,Z]=(0,l.useState)(!1),[q,D]=(0,l.useState)(!1),[$,A]=(0,l.useState)([]),[I,O]=(0,l.useState)(null),[L,Q]=(0,l.useState)("completed"),[J,M]=(0,l.useState)(1),[Y,F]=(0,l.useState)(20),[_,V]=(0,l.useState)(new Set),{data:E,loading:H,refetch:G}=(0,i.aM)(n.k9,{variables:{queue:e},pollInterval:5e3}),{data:W,loading:B,refetch:U,networkStatus:X}=(0,i.aM)(n.Jq,{variables:{queue:e,statusses:L,page:J,limit:Y},pollInterval:5e3}),[K,{loading:ee}]=(0,r.D)(n.Wr,{onError:e=>{S({title:"Failed to delete job",description:e.message,variant:"destructive"})}}),[es,{loading:ea}]=(0,r.D)(n.fc,{onCompleted:()=>{S({title:"Queue paused",description:`The ${e} queue has been paused.`}),G(),z(!1)},onError:e=>{S({title:"Failed to pause queue",description:e.message,variant:"destructive"})}}),[et,{loading:el}]=(0,r.D)(n.iC,{onCompleted:()=>{S({title:"Queue resumed",description:`The ${e} queue has been resumed.`}),G(),D(!1)},onError:e=>{S({title:"Failed to resume queue",description:e.message,variant:"destructive"})}}),[ei,{loading:er}]=(0,r.D)(n.QW,{onCompleted:()=>{S({title:"Queue drained",description:"All waiting and delayed jobs have been removed from the queue."}),G(),U(),Z(!1)},onError:e=>{S({title:"Failed to drain queue",description:e.message,variant:"destructive"})}}),en=e=>{A([e])},ed=e=>{O(e)},ec=e=>{let s=new Set(_);s.has(e)?s.delete(e):s.add(e),V(s)},eo=async()=>{if($.filter(e=>!e.id).length>0){S({title:"Failed to delete jobs",description:"Some jobs have no ID.",variant:"destructive"});return}try{await Promise.all($.map(s=>K({variables:{queue:e,id:s.id}}))),S({title:1===$.length?"Job deleted":"Jobs deleted",description:`Successfully deleted ${$.length} job${1===$.length?"":"s"}.`}),U(),G(),A([]),V(new Set)}catch(e){}},ex=E?.queue,em=W?.jobs||{items:[],pageInfo:{pageCount:0,itemCount:0,currentPage:1,hasPreviousPage:!1,hasNextPage:!1}},eu=e=>t.jsx(h.C,{variant:"outline",className:{active:"bg-blue-100 text-blue-800 border-blue-200",waiting:"bg-yellow-100 text-yellow-800 border-yellow-200",completed:"bg-green-100 text-green-800 border-green-200",failed:"bg-red-100 text-red-800 border-red-200",delayed:"bg-orange-100 text-orange-800 border-orange-200",paused:"bg-gray-100 text-gray-800 border-gray-200"}[e]||"bg-gray-100 text-gray-800",children:e});return H&&B?t.jsx("div",{className:"space-y-4",children:t.jsx(c.Zb,{children:t.jsx(c.aY,{className:"pt-6",children:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(j.Z,{className:"h-6 w-6 animate-spin"})})})})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(c.Zb,{children:[t.jsx(c.Ol,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"flex items-center gap-3",children:(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.ll,{children:["Queue: ",e]}),(0,t.jsxs)(c.SZ,{children:["Manage the ",e," job queue and view all jobs."]})]})}),ex&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)(d.z,{variant:"outline",size:"sm",onClick:()=>ex?.isPaused?D(!0):z(!0),disabled:ea||el,children:[ex?.isPaused?t.jsx(p.Z,{className:"mr-2 h-4 w-4"}):t.jsx(g.Z,{className:"mr-2 h-4 w-4"}),ex?.isPaused?"Resume queue":"Pause queue"]}),(0,t.jsxs)(d.z,{variant:"outline",size:"sm",onClick:()=>Z(!0),disabled:er,children:[t.jsx(f.Z,{className:"mr-2 h-4 w-4"}),"Drain queue"]})]})]})}),(0,t.jsxs)(c.aY,{className:"space-y-6",children:[ex&&(0,t.jsxs)("div",{className:"flex items-center gap-8 p-4 bg-muted/50 rounded-lg",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Status:"}),t.jsx("div",{children:ex.isPaused?t.jsx(h.C,{variant:"outline",className:"bg-gray-100 text-gray-800",children:"Paused"}):ex.isMaxed?t.jsx(h.C,{variant:"outline",className:"bg-red-100 text-red-800",children:"Maxed"}):t.jsx(h.C,{variant:"outline",className:"bg-green-100 text-green-800",children:"Active"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Concurrency:"}),t.jsx("div",{className:"font-semibold",children:ex.concurrency})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Rate Limit:"}),t.jsx("div",{className:"font-semibold",children:ex.ratelimit||"None"})]}),t.jsx(m.mQ,{value:L,onValueChange:e=>Q(e),className:"w-auto",children:(0,t.jsxs)(m.dr,{children:[(0,t.jsxs)(m.SP,{value:"active",className:"gap-1.5",children:[t.jsx("span",{children:"Active"}),t.jsx(h.C,{variant:"secondary",className:"ml-1 bg-blue-100 text-blue-600 border-blue-200",children:ex.jobs?.active||0})]}),(0,t.jsxs)(m.SP,{value:"waiting",className:"gap-1.5",children:[t.jsx("span",{children:"Waiting"}),t.jsx(h.C,{variant:"secondary",className:"ml-1 bg-yellow-100 text-yellow-600 border-yellow-200",children:ex.jobs?.waiting||0})]}),(0,t.jsxs)(m.SP,{value:"failed",className:"gap-1.5",children:[t.jsx("span",{children:"Failed"}),t.jsx(h.C,{variant:"secondary",className:"ml-1 bg-red-100 text-red-600 border-red-200",children:ex.jobs?.failed||0})]}),(0,t.jsxs)(m.SP,{value:"completed",className:"gap-1.5",children:[t.jsx("span",{children:"Completed"}),t.jsx(h.C,{variant:"secondary",className:"ml-1 bg-green-100 text-green-600 border-green-200",children:ex.jobs?.completed||0})]})]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Queue Jobs"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["All jobs currently in the ",e," queue"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[_.size>0&&(0,t.jsxs)(d.z,{variant:"destructive",size:"sm",onClick:()=>{A(em.items.filter(e=>_.has(e.id)))},disabled:ee,children:[t.jsx(b.Z,{className:"mr-2 h-4 w-4"}),"Delete ",_.size," job",1===_.size?"":"s"]}),(0,t.jsxs)(h.C,{variant:"outline",children:["Auto Refresh: ",t.jsx(j.Z,{className:"h-4 w-4 animate-spin text-muted-foreground ml-1"})]})]})]}),(0,t.jsxs)("div",{className:"border rounded-lg",children:[B?t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(j.Z,{className:"h-6 w-6 animate-spin"})}):em.items?.length===0?t.jsx("div",{className:"text-center pt-8 text-muted-foreground",children:"No jobs in queue"}):(0,t.jsxs)(x.iA,{children:[t.jsx(x.xD,{children:(0,t.jsxs)(x.SC,{children:[t.jsx(x.ss,{className:"w-12",children:t.jsx(o.X,{checked:em.items.filter(e=>"active"!==e.state).length>0&&_.size===em.items.filter(e=>"active"!==e.state).length,onCheckedChange:()=>{let e=em.items.filter(e=>"active"!==e.state);_.size===e.length&&e.length>0?V(new Set):V(new Set(e.map(e=>e.id)))},"aria-label":"Select all jobs"})}),t.jsx(x.ss,{children:"Name"}),t.jsx(x.ss,{children:"State"}),t.jsx(x.ss,{children:"Timestamp"}),t.jsx(x.ss,{children:"Inputs"}),t.jsx(x.ss,{children:"Outputs"}),t.jsx(x.ss,{className:"text-right",children:"Actions"})]})}),t.jsx(x.RM,{children:em.items?.map((e,a)=>t.jsxs(x.SC,{children:[t.jsx(x.pj,{children:t.jsx(o.X,{checked:_.has(e.id),onCheckedChange:()=>ec(e.id),disabled:"active"===e.state,"aria-label":`Select job ${s(e)}`})}),t.jsx(x.pj,{className:"font-medium max-w-[200px] truncate",children:s(e)}),t.jsx(x.pj,{children:eu(e.state)}),t.jsx(x.pj,{children:e.timestamp?C.WU(new Date(e.timestamp),"MMM d, yyyy HH:mm:ss"):"N/A"}),t.jsx(x.pj,{children:e.data?t.jsx("div",{className:"text-xs max-w-[200px] truncate",children:t.jsx(k.J,{text:JSON.stringify(e.data)})}):null}),t.jsx(x.pj,{children:e.failedReason?t.jsx("div",{className:"text-xs text-red-600 max-w-[200px] truncate",children:t.jsx(k.J,{text:"Error: "+e.failedReason})}):t.jsx("div",{className:"text-xs text-muted-foreground max-w-[200px] truncate",children:t.jsx(k.J,{text:JSON.stringify(e.returnvalue)})})}),t.jsxs(x.pj,{className:"text-right",children:["active"!==e.state&&t.jsx(d.z,{variant:"ghost",size:"sm",onClick:()=>en(e),disabled:ee,children:t.jsx(b.Z,{className:"h-4 w-4 text-red-600"})}),"failed"===e.state&&t.jsxs(d.z,{variant:"ghost",size:"sm",onClick:()=>ed(e),children:[t.jsx(N.Z,{className:"h-4 w-4 text-blue-600"}),"Retry"]})]})]},a))})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between px-2 pb-2",children:[(0,t.jsxs)("div",{className:"flex-1 text-sm text-muted-foreground",children:["(",em?.pageInfo?.itemCount||0," total"," ","items)."]}),t.jsx("div",{className:"flex items-center space-x-6 lg:space-x-8",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsxs)(d.z,{variant:"outline",className:"hidden size-8 p-0 lg:flex",onClick:()=>{M(1),U()},disabled:!em?.pageInfo?.hasPreviousPage,children:[t.jsx("span",{className:"sr-only",children:"Go to first page"}),t.jsx(R.kRt,{className:"size-4"})]}),(0,t.jsxs)(d.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{console.log("itemsData.data?.pageInfo.hasPreviousPage",em?.pageInfo?.hasPreviousPage),M(em?.pageInfo?.hasPreviousPage?em?.pageInfo?.currentPage-1:1),U()},disabled:!em?.pageInfo?.hasPreviousPage,children:[t.jsx("span",{className:"sr-only",children:"Go to previous page"}),t.jsx(v.Z,{className:"size-4"})]}),(0,t.jsxs)(d.z,{variant:"outline",className:"size-8 p-0",onClick:()=>{M(em?.pageInfo?.hasNextPage?em?.pageInfo?.currentPage+1:1),U()},disabled:!em?.pageInfo.hasNextPage,children:[t.jsx("span",{className:"sr-only",children:"Go to next page"}),t.jsx(y.Z,{className:"size-4"})]})]})})]})]})]})]})]}),t.jsx(u.aR,{open:$.length>0,onOpenChange:e=>!e&&A([]),children:(0,t.jsxs)(u._T,{children:[(0,t.jsxs)(u.fY,{children:[t.jsx(u.f$,{children:1===$.length?"Delete Job?":`Delete ${$.length} Jobs?`}),t.jsx(u.yT,{children:1===$.length?`Are you sure you want to delete the job "${$[0]?.name}"? This action cannot be undone.`:`Are you sure you want to delete ${$.length} jobs? This action cannot be undone.`})]}),(0,t.jsxs)(u.xo,{children:[t.jsx(u.le,{children:"Cancel"}),(0,t.jsxs)(u.OL,{onClick:eo,disabled:ee,children:[ee&&t.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Delete"]})]})]})}),t.jsx(u.aR,{open:!!I,onOpenChange:e=>!e&&O(null),children:(0,t.jsxs)(u._T,{children:[(0,t.jsxs)(u.fY,{children:[t.jsx(u.f$,{children:"Retry Job?"}),(0,t.jsxs)(u.yT,{children:['Are you sure you want to retry the job "',I?.name,'"? This will schedule a new job with the same data.']})]}),(0,t.jsxs)(u.xo,{children:[t.jsx(u.le,{children:"Cancel"}),t.jsx(u.OL,{onClick:()=>{I&&a(I)},disabled:ee,children:"Retry"})]})]})}),t.jsx(u.aR,{open:P,onOpenChange:z,children:(0,t.jsxs)(u._T,{children:[(0,t.jsxs)(u.fY,{children:[t.jsx(u.f$,{children:"Pause Queue?"}),(0,t.jsxs)(u.yT,{children:["Are you sure you want to pause the ",e," queue? No jobs will be processed until the queue is resumed."]})]}),(0,t.jsxs)(u.xo,{children:[t.jsx(u.le,{children:"Cancel"}),(0,t.jsxs)(u.OL,{onClick:()=>{es({variables:{queue:e}})},disabled:ea,children:[ea&&t.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Pause Queue"]})]})]})}),t.jsx(u.aR,{open:q,onOpenChange:D,children:(0,t.jsxs)(u._T,{children:[(0,t.jsxs)(u.fY,{children:[t.jsx(u.f$,{children:"Resume Queue?"}),(0,t.jsxs)(u.yT,{children:["Are you sure you want to resume the ",e," queue?."]})]}),(0,t.jsxs)(u.xo,{children:[t.jsx(u.le,{children:"Cancel"}),(0,t.jsxs)(u.OL,{onClick:()=>{et({variables:{queue:e}})},disabled:el,children:[el&&t.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Resume Queue"]})]})]})}),t.jsx(u.aR,{open:T,onOpenChange:Z,children:(0,t.jsxs)(u._T,{children:[(0,t.jsxs)(u.fY,{children:[t.jsx(u.f$,{children:"Drain Queue?"}),(0,t.jsxs)(u.yT,{children:["Are you sure you want to drain the ",e," queue? This will remove all jobs that are waiting or delayed, but not active, waiting-children, completed or failed. This action cannot be undone."]})]}),(0,t.jsxs)(u.xo,{children:[t.jsx(u.le,{children:"Cancel"}),(0,t.jsxs)(u.OL,{onClick:()=>{ei({variables:{queue:e}})},disabled:er,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[er&&t.jsx(j.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Drain Queue"]})]})]})})]})}},57004:(e,s,a)=>{a.a(e,async(e,t)=>{try{a.d(s,{G:()=>g});var l=a(10326),i=a(48644),r=a(93801),n=a(45747),d=a(17577),c=a(94966),o=a(12533),x=a(12428),m=a(47355),u=a(62288),h=a(34789),j=a(77863),p=e([i,r,n]);function g({className:e=null,code:s,language:a,slice:t=200}){let{toast:i}=(0,h.pm)(),[r,n]=(0,d.useState)(null);return(0,l.jsxs)(u.Vq,{children:[l.jsx(u.hg,{asChild:!0,children:r?.length&&l.jsx(c.Z,{className:(0,j.cn)("cursor-pointer",e),showLineNumbers:!0,wrapLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap"}},language:a||"plaintext",style:m.Z,children:`${r?.slice(0,t||200)} ${r?.length>(t||200)?"...":""}`})}),l.jsx(u.cZ,{className:"sm:max-w-[800px] overflow-hidden max-h-[500px] overflow-y-scroll",children:(0,l.jsxs)(u.fK,{children:[l.jsx(u.$N,{children:"Code"}),l.jsx("div",{className:"cursor-copy",onClick:async()=>{await navigator.clipboard.writeText(r??""),i({title:"Copied to clipboard"})},children:l.jsx(c.Z,{className:(0,j.cn)(e),showLineNumbers:!0,wrapLines:!0,lineProps:{style:{wordBreak:"break-all",whiteSpace:"pre-wrap"}},language:a||"plaintext",style:m.Z,children:r??""})})]})})]})}[i,r,n]=p.then?(await p)():p,c.Z.registerLanguage("json",x.Z),c.Z.registerLanguage("javascript",o.Z),t()}catch(e){t(e)}})},99440:(e,s,a)=>{a.d(s,{OL:()=>p,_T:()=>x,aR:()=>d,f$:()=>h,fY:()=>m,le:()=>g,xo:()=>u,yT:()=>j});var t=a(10326),l=a(12194),i=a(17577),r=a(90772),n=a(77863);let d=l.fC;l.xz;let c=l.h_,o=i.forwardRef(({className:e,...s},a)=>t.jsx(l.aV,{className:(0,n.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...s,ref:a}));o.displayName=l.aV.displayName;let x=i.forwardRef(({className:e,...s},a)=>(0,t.jsxs)(c,{children:[t.jsx(o,{}),t.jsx(l.VY,{ref:a,className:(0,n.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...s})]}));x.displayName=l.VY.displayName;let m=({className:e,...s})=>t.jsx("div",{className:(0,n.cn)("flex flex-col space-y-2 text-center sm:text-left",e),...s});m.displayName="AlertDialogHeader";let u=({className:e,...s})=>t.jsx("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...s});u.displayName="AlertDialogFooter";let h=i.forwardRef(({className:e,...s},a)=>t.jsx(l.Dx,{ref:a,className:(0,n.cn)("text-lg font-semibold",e),...s}));h.displayName=l.Dx.displayName;let j=i.forwardRef(({className:e,...s},a)=>t.jsx(l.dk,{ref:a,className:(0,n.cn)("text-sm text-muted-foreground",e),...s}));j.displayName=l.dk.displayName;let p=i.forwardRef(({className:e,...s},a)=>t.jsx(l.aU,{ref:a,className:(0,n.cn)((0,r.d)(),e),...s}));p.displayName=l.aU.displayName;let g=i.forwardRef(({className:e,...s},a)=>t.jsx(l.$j,{ref:a,className:(0,n.cn)((0,r.d)({variant:"outline"}),"mt-2 sm:mt-0",e),...s}));g.displayName=l.$j.displayName},53313:(e,s,a)=>{a.d(s,{X:()=>d});var t=a(10326),l=a(13635),i=a(32933),r=a(17577),n=a(77863);let d=r.forwardRef(({className:e,...s},a)=>t.jsx(l.fC,{ref:a,className:(0,n.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...s,children:t.jsx(l.z$,{className:(0,n.cn)("flex items-center justify-center text-current"),children:t.jsx(i.Z,{className:"size-4"})})}));d.displayName=l.fC.displayName},15940:(e,s,a)=>{a.d(s,{RM:()=>d,Rn:()=>m,SC:()=>c,iA:()=>r,pj:()=>x,ss:()=>o,xD:()=>n});var t=a(10326),l=a(17577),i=a(77863);let r=l.forwardRef(({className:e,...s},a)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:a,className:(0,i.cn)("w-full caption-bottom text-sm",e),...s})}));r.displayName="Table";let n=l.forwardRef(({className:e,...s},a)=>t.jsx("thead",{ref:a,className:(0,i.cn)("[&_tr]:border-b",e),...s}));n.displayName="TableHeader";let d=l.forwardRef(({className:e,...s},a)=>t.jsx("tbody",{ref:a,className:(0,i.cn)("[&_tr:last-child]:border-0",e),...s}));d.displayName="TableBody",l.forwardRef(({className:e,...s},a)=>t.jsx("tfoot",{ref:a,className:(0,i.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...s})).displayName="TableFooter";let c=l.forwardRef(({className:e,...s},a)=>t.jsx("tr",{ref:a,className:(0,i.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...s}));c.displayName="TableRow";let o=l.forwardRef(({className:e,...s},a)=>t.jsx("th",{ref:a,className:(0,i.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&:has([role=checkbox])]:w-[40px]",e),...s}));o.displayName="TableHead";let x=l.forwardRef(({className:e,...s},a)=>t.jsx("td",{ref:a,className:(0,i.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0 [&:has([role=checkbox])]:w-[40px]",e),...s}));x.displayName="TableCell";let m=l.forwardRef(({className:e,...s},a)=>t.jsx("caption",{ref:a,className:(0,i.cn)("mt-4 text-sm text-muted-foreground",e),...s}));m.displayName="TableCaption"}};
|