"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9360,8252],{88507:function(e,s,t){t.d(s,{Z:function(){return r}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,t(60998).Z)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},81260:function(e,s,t){t.d(s,{Z:function(){return r}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,t(60998).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},47603:function(e,s,t){t.d(s,{Z:function(){return r}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,t(60998).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"}]])},28586:function(e,s,t){t.d(s,{Z:function(){return r}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,t(60998).Z)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},43767:function(e,s,t){t.d(s,{Z:function(){return r}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,t(60998).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},1812:function(e,s,t){t.d(s,{X:function(){return n}});var r=t(85893),l=t(67294);let a=e=>{if(!(null==e?void 0:e.message))return"An unexpected error occurred.";let s=e.message;return s.includes("failed:")&&(s=s.split("failed:")[1].trim()),s},n=e=>{let{error:s,title:t="Error",onDismiss:n}=e,[i,o]=(0,l.useState)(!1);if((0,l.useEffect)(()=>{s&&o(!1)},[s]),!s||i)return null;let c="string"==typeof s?s:a(s);return(0,r.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-3 mb-4",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),(0,r.jsx)("div",{className:"ml-3",children:(0,r.jsxs)("div",{className:"text-sm text-red-800",children:[(0,r.jsxs)("strong",{children:[t,":"]})," ",c]})})]}),(0,r.jsx)("button",{onClick:()=>{o(!0),n&&n()},className:"flex-shrink-0 ml-4 text-red-400 hover:text-red-600 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 focus:ring-offset-red-50 rounded","aria-label":"Dismiss error",children:(0,r.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]})})}},82077:function(e,s,t){t.r(s),t.d(s,{Workspaces:function(){return E}});var r=t(85893),l=t(67294),a=t(11163),n=t(23266),i=t(68969),o=t(17324),c=t(37673),d=t(68764),u=t(30803),m=t(55739),x=t(1272),h=t(50326);t(53850);var p=t(1812),f=t(13626),g=t(81260);/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let j=(0,t(60998).Z)("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);var v=t(47603),k=t(23001),y=t(9159),w=t(6378),b=t(51214),N=t(36856),C=t(47145),L=t(94545),S=t(93225),Z=t(41664),z=t.n(Z);let M=e=>{let{isPrivate:s}=e;return s?(0,r.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-700 border border-gray-300",children:"Private"}):(0,r.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-700 border border-green-300",children:"Public"})},D=b.nb.REFRESH_INTERVAL;function E(){let[e,s]=(0,l.useState)([]),[t,b]=(0,l.useState)({runningClusters:0,totalClusters:0,managedJobs:0}),[Z,E]=(0,l.useState)(!0),[R,O]=(0,l.useState)(null),[J,A]=(0,l.useState)({key:"name",direction:"asc"}),[P,T]=(0,l.useState)(""),[W,F]=(0,l.useState)(!1),[q,B]=(0,l.useState)({confirmOpen:!1,workspaceToDelete:null,deleting:!1,error:null}),[V,X]=(0,l.useState)({open:!1,message:"",userName:""}),[H,I]=(0,l.useState)(null),[U,_]=(0,l.useState)(!1),[K,$]=(0,l.useState)(null),[G,Q]=(0,l.useState)(null),Y=(0,a.useRouter)(),ee=(0,k.X)(),es=async()=>{if(H&&Date.now()-H.timestamp<3e5)return H;_(!0);try{let e=await C.x.get("/users/role");if(!e.ok){let s=await e.json();throw Error(s.detail||"Failed to get user role")}let s=await e.json(),t={role:s.role,name:s.name,timestamp:Date.now()};return I(t),_(!1),t}catch(e){throw _(!1),e}},et=async(e,s)=>{try{let t=await es();if("admin"!==t.role)return X({open:!0,message:e,userName:t.name.toLowerCase()}),!1;return s(),!0}catch(e){return console.error("Failed to check user role:",e),X({open:!0,message:"Error: ".concat(e.message),userName:""}),!1}},er=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&E(!0);try{let[e,t,r]=await Promise.all([w.default.get(o.fX),w.default.get(n.getClusters),w.default.get(i.getManagedJobs,[{allUsers:!0}])]);O(e);let l=Object.keys(e),a=await Promise.all(l.map(e=>w.default.get(o.yz,[e]))),c=Object.fromEntries(l.map((e,s)=>[e,a[s]]));Object.fromEntries(t.map(e=>[e.cluster,e.workspace||"default"]));let d={};l.forEach(e=>{d[e]={name:e,totalClusterCount:0,runningClusterCount:0,managedJobsCount:0,clouds:new Set}});let u=0;t.forEach(e=>{let s=e.workspace||"default";d[s]||(d[s]={name:s,totalClusterCount:0,runningClusterCount:0,managedJobsCount:0,clouds:new Set}),d[s].totalClusterCount++,("RUNNING"===e.status||"LAUNCHING"===e.status)&&(d[s].runningClusterCount++,u++),e.cloud&&d[s].clouds.add(e.cloud)});let m=r.jobs||[],x=new Set(y.statusGroups.active),h=0;m.forEach(e=>{let s=e.workspace||"default";d[s]&&x.has(e.status)&&d[s].managedJobsCount++,x.has(e.status)&&h++});let p=Object.values(d).filter(e=>l.includes(e.name)).map(e=>({...e,clouds:Array.isArray(c[e.name])?c[e.name]:[]})).sort((e,s)=>e.name.localeCompare(s.name));s(p),b({runningClusters:u,totalClusters:t.length,managedJobs:h})}catch(e){console.error("Error fetching workspace data:",e),s([]),b({runningClusters:0,totalClusters:0,managedJobs:0})}e&&E(!1)};(0,l.useEffect)(()=>{(async()=>{await N.ZP.preloadForPage("workspaces"),er(!0)})();let e=setInterval(()=>{er(!1)},D);return()=>clearInterval(e)},[]);let el=e=>{let s="asc";J.key===e&&"asc"===J.direction&&(s="desc"),A({key:e,direction:s})},ea=e=>J.key===e?"asc"===J.direction?" ↑":" ↓":"",en=l.useMemo(()=>{if(!e)return[];let s=e;if(P&&""!==P.trim()){let t=P.toLowerCase().trim();s=e.filter(e=>!!(e.name.toLowerCase().includes(t)||e.clouds.some(e=>{let s=S.Z2[e.toLowerCase()]||e;return e.toLowerCase().includes(t)||s.toLowerCase().includes(t)}))||!!(!0===((null==R?void 0:R[e.name])||{}).private?"private":"public").includes(t))}return(0,L.R0)(s,J.key,J.direction)},[e,J,P,R]),ei=e=>{et("cannot delete workspace",()=>{B({confirmOpen:!0,workspaceToDelete:e,deleting:!1,error:null})})},eo=async()=>{if(q.workspaceToDelete){B(e=>({...e,deleting:!0,error:null}));try{await (0,o.zl)(q.workspaceToDelete),Q('Workspace "'.concat(q.workspaceToDelete,'" deleted successfully!')),B({confirmOpen:!1,workspaceToDelete:null,deleting:!1,error:null}),w.default.invalidate(o.fX),await er(!0)}catch(e){console.error("Error deleting workspace:",e),B(e=>({...e,deleting:!1,error:null})),$(e)}}},ec=()=>{B({confirmOpen:!1,workspaceToDelete:null,deleting:!1,error:null})},ed=e=>{et("cannot edit workspace",()=>{Y.push("/workspaces/".concat(e))})};return Z&&0===e.length?(0,r.jsxs)("div",{className:"flex justify-center items-center h-64",children:[(0,r.jsx)(m.Z,{}),(0,r.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading workspaces..."})]}):(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"fixed top-20 right-4 z-[9999] max-w-md",children:[G&&(0,r.jsx)("div",{className:"bg-green-50 border border-green-200 rounded p-4 mb-4",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)("svg",{className:"h-5 w-5 text-green-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})}),(0,r.jsx)("div",{className:"ml-3",children:(0,r.jsx)("p",{className:"text-sm font-medium text-green-800",children:G})})]}),(0,r.jsx)("div",{className:"ml-auto pl-3",children:(0,r.jsxs)("button",{type:"button",onClick:()=>Q(null),className:"inline-flex rounded-md bg-green-50 p-1.5 text-green-500 hover:bg-green-100",children:[(0,r.jsx)("span",{className:"sr-only",children:"Dismiss"}),(0,r.jsx)("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})]})})]})}),(0,r.jsx)(p.X,{error:K,title:"Error",onDismiss:()=>$(null)})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2 h-5",children:[(0,r.jsx)("div",{className:"text-base flex items-center",children:(0,r.jsx)("span",{className:"text-sky-blue leading-none",children:"Workspaces"})}),(0,r.jsxs)("div",{className:"flex items-center",children:[Z&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(m.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500 text-xs",children:"Refreshing..."})]}),(0,r.jsxs)("button",{onClick:()=>{w.default.invalidate(o.fX),w.default.invalidate(n.getClusters),w.default.invalidate(i.getManagedJobs,[{allUsers:!0}]),w.default.invalidateFunction(o.yz),er(!0)},disabled:Z,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,r.jsx)(f.Z,{className:"h-4 w-4 mr-1.5"}),!ee&&(0,r.jsx)("span",{children:"Refresh"})]})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{className:"relative flex-1 max-w-md",children:[(0,r.jsx)("input",{type:"text",placeholder:"Filter workspaces",value:P,onChange:e=>T(e.target.value),className:"h-8 w-full px-3 pr-8 text-sm border border-gray-300 rounded-md focus:ring-1 focus:ring-sky-500 focus:border-sky-500 outline-none"}),P&&(0,r.jsx)("button",{onClick:()=>T(""),className:"absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",title:"Clear search",children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("button",{onClick:()=>{et("cannot create workspace",()=>{Y.push("/workspace/new")})},disabled:U,className:"ml-4 bg-sky-600 hover:bg-sky-700 text-white flex items-center rounded-md px-3 py-1 text-sm font-medium transition-colors duration-200",title:"Create Workspace",children:U?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.Z,{size:12,className:"mr-2"}),(0,r.jsx)("span",{children:"Create Workspace"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.Z,{className:"h-4 w-4 mr-2"}),"Create Workspace"]})})]}),0!==e.length||Z?(0,r.jsx)(c.Zb,{children:(0,r.jsx)("div",{className:"overflow-x-auto rounded-lg",children:(0,r.jsxs)(d.iA,{className:"min-w-full",children:[(0,r.jsx)(d.xD,{children:(0,r.jsxs)(d.SC,{children:[(0,r.jsxs)(d.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>el("name"),children:["Workspace",ea("name")]}),(0,r.jsxs)(d.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>el("totalClusterCount"),children:["Clusters ",ea("totalClusterCount")]}),(0,r.jsxs)(d.ss,{className:"sortable whitespace-nowrap cursor-pointer hover:bg-gray-50",onClick:()=>el("managedJobsCount"),children:["Jobs",ea("managedJobsCount")]}),(0,r.jsx)(d.ss,{className:"whitespace-nowrap",children:"Enabled infra"}),(0,r.jsx)(d.ss,{className:"whitespace-nowrap",children:"Actions"})]})}),(0,r.jsx)(d.RM,{children:Z&&0===en.length?(0,r.jsx)(d.SC,{children:(0,r.jsx)(d.pj,{colSpan:5,className:"text-center py-6 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(m.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]})})}):en.length>0?en.map(e=>{let s=!0===((null==R?void 0:R[e.name])||{}).private;return(0,r.jsxs)(d.SC,{className:"hover:bg-gray-50",children:[(0,r.jsxs)(d.pj,{className:"",children:[(0,r.jsx)("button",{onClick:()=>ed(e.name),disabled:U,className:"text-blue-600 hover:text-blue-600 hover:underline text-left",children:e.name}),(0,r.jsx)("span",{className:"ml-2",children:(0,r.jsx)(M,{isPrivate:s})})]}),(0,r.jsx)(d.pj,{children:(0,r.jsxs)("button",{onClick:()=>{Y.push({pathname:"/clusters",query:{workspace:e.name}})},className:"text-gray-700 hover:text-blue-600 hover:underline",children:[e.runningClusterCount," running,"," ",e.totalClusterCount," total"]})}),(0,r.jsx)(d.pj,{children:(0,r.jsx)("button",{onClick:()=>{Y.push({pathname:"/jobs",query:{workspace:e.name}})},className:"text-gray-700 hover:text-blue-600 hover:underline",children:e.managedJobsCount})}),(0,r.jsx)(d.pj,{children:e.clouds.length>0?[...e.clouds].sort().map((s,t)=>{let l=S.Z2[s.toLowerCase()]||s;return(0,r.jsxs)("span",{children:[(0,r.jsx)(z(),{href:"/infra",className:"inline-flex items-center px-2 py-1 rounded text-sm bg-sky-100 text-sky-800 hover:bg-sky-200 hover:text-sky-900 transition-colors duration-200",children:l}),t<e.clouds.length-1&&" "]},s)}):(0,r.jsx)("span",{className:"text-gray-500 text-sm",children:"-"})}),(0,r.jsxs)(d.pj,{children:[(0,r.jsx)(u.z,{variant:"ghost",size:"sm",onClick:()=>ed(e.name),disabled:U,className:"text-gray-600 hover:text-gray-800 mr-1",children:(0,r.jsx)(j,{className:"w-4 h-4"})}),(0,r.jsx)(u.z,{variant:"ghost",size:"sm",onClick:()=>ei(e.name),disabled:"default"===e.name||U,title:"default"===e.name?"Cannot delete default workspace":"Delete workspace",className:"text-red-600 hover:text-red-700 hover:bg-red-50",children:(0,r.jsx)(v.Z,{className:"w-4 h-4"})})]})]},e.name)}):(0,r.jsx)(d.SC,{children:(0,r.jsx)(d.pj,{colSpan:5,className:"text-center py-6 text-gray-500",children:"No workspaces found"})})})]})})}):(0,r.jsxs)("div",{className:"text-center py-10",children:[(0,r.jsx)("p",{className:"text-lg text-gray-600",children:"No workspaces found."}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-2",children:"Create a cluster to see its workspace here."})]}),R&&(0,r.jsx)(h.Vq,{open:W,onOpenChange:F,children:(0,r.jsxs)(h.cZ,{className:"sm:max-w-md md:max-w-lg lg:max-w-xl xl:max-w-2xl w-full max-h-[90vh] flex flex-col",children:[(0,r.jsx)(h.fK,{children:(0,r.jsx)(h.$N,{className:"pr-10",children:"All Workspaces Configuration"})}),(0,r.jsx)("div",{className:"flex-grow overflow-y-auto py-4",children:(0,r.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",overflowX:"auto",whiteSpace:"pre",wordBreak:"normal"},children:x.ZP.dump(R,{indent:2})})})]})}),(0,r.jsx)(h.Vq,{open:V.open,onOpenChange:e=>{X(s=>({...s,open:e})),e||$(null)},children:(0,r.jsxs)(h.cZ,{className:"sm:max-w-md transition-all duration-200 ease-in-out",children:[(0,r.jsxs)(h.fK,{children:[(0,r.jsx)(h.$N,{children:"Permission Denied"}),(0,r.jsx)(h.Be,{children:U?(0,r.jsxs)("div",{className:"flex items-center py-2",children:[(0,r.jsx)(m.Z,{size:16,className:"mr-2"}),(0,r.jsx)("span",{children:"Checking permissions..."})]}):(0,r.jsx)(r.Fragment,{children:V.userName?(0,r.jsxs)(r.Fragment,{children:[V.userName," is logged in as non-admin and ",V.message,"."]}):V.message})})]}),(0,r.jsx)(h.cN,{children:(0,r.jsx)(u.z,{variant:"outline",onClick:()=>X(e=>({...e,open:!1})),disabled:U,children:"OK"})})]})}),(0,r.jsx)(h.Vq,{open:q.confirmOpen,onOpenChange:e=>{e||(ec(),$(null))},children:(0,r.jsxs)(h.cZ,{className:"sm:max-w-md",children:[(0,r.jsxs)(h.fK,{children:[(0,r.jsx)(h.$N,{children:"Delete Workspace"}),(0,r.jsxs)(h.Be,{children:['Are you sure you want to delete workspace "',q.workspaceToDelete,'"? This action cannot be undone.']})]}),(0,r.jsxs)(h.cN,{children:[(0,r.jsx)(u.z,{variant:"outline",onClick:ec,disabled:q.deleting,children:"Cancel"}),(0,r.jsx)(u.z,{variant:"destructive",onClick:eo,disabled:q.deleting,children:q.deleting?"Deleting...":"Delete"})]})]})})]})}},12003:function(e,s,t){t.d(s,{j:function(){return n}});var r=t(90512);let l=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=r.W,n=(e,s)=>t=>{var r;if((null==s?void 0:s.variants)==null)return a(e,null==t?void 0:t.class,null==t?void 0:t.className);let{variants:n,defaultVariants:i}=s,o=Object.keys(n).map(e=>{let s=null==t?void 0:t[e],r=null==i?void 0:i[e];if(null===s)return null;let a=l(s)||l(r);return n[e][a]}),c=t&&Object.entries(t).reduce((e,s)=>{let[t,r]=s;return void 0===r||(e[t]=r),e},{});return a(e,o,null==s?void 0:null===(r=s.compoundVariants)||void 0===r?void 0:r.reduce((e,s)=>{let{class:t,className:r,...l}=s;return Object.entries(l).every(e=>{let[s,t]=e;return Array.isArray(t)?t.includes({...i,...c}[s]):({...i,...c})[s]===t})?[...e,t,r]:e},[]),null==t?void 0:t.class,null==t?void 0:t.className)}}}]);