skypilot-nightly 1.0.0.dev20251023__py3-none-any.whl → 1.0.0.dev20251025__py3-none-any.whl

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.

Potentially problematic release.


This version of skypilot-nightly might be problematic. Click here for more details.

Files changed (50) hide show
  1. sky/__init__.py +2 -2
  2. sky/client/cli/command.py +22 -15
  3. sky/client/cli/table_utils.py +3 -1
  4. sky/dashboard/out/404.html +1 -1
  5. sky/dashboard/out/_next/static/{CJlKj9Z9fXGlQCmH4EpLX → WfMolkH3tkVNEHhHaH9uk}/_buildManifest.js +1 -1
  6. sky/dashboard/out/_next/static/chunks/{1141-ec6f902ffb865853.js → 1141-d5204f35a3388bf4.js} +1 -1
  7. sky/dashboard/out/_next/static/chunks/{1871-165dc0e1553d9822.js → 1871-81adbc5f25dff78f.js} +1 -1
  8. sky/dashboard/out/_next/static/chunks/2755.227c84f5adf75c6b.js +26 -0
  9. sky/dashboard/out/_next/static/chunks/3294.6d5054a953a818cb.js +1 -0
  10. sky/dashboard/out/_next/static/chunks/{3785.483a3dda2d52f26e.js → 3785.538eb23a098fc304.js} +1 -1
  11. sky/dashboard/out/_next/static/chunks/9353-cff34f7e773b2e2b.js +1 -0
  12. sky/dashboard/out/_next/static/chunks/pages/{_app-ce361c6959bc2001.js → _app-513d332313670f2a.js} +1 -1
  13. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/{[job]-602eeead010ec1d6.js → [job]-c815b90e296b8075.js} +1 -1
  14. sky/dashboard/out/_next/static/chunks/pages/clusters/{[cluster]-18b334dedbd9f6f2.js → [cluster]-fbf2907ce2bb67e2.js} +1 -1
  15. sky/dashboard/out/_next/static/chunks/pages/{clusters-57221ec2e4e01076.js → clusters-9e0df5442b04f7d0.js} +1 -1
  16. sky/dashboard/out/_next/static/chunks/pages/infra/{[context]-44ce535a0a0ad4ec.js → [context]-9b6e47c2e8b485a2.js} +1 -1
  17. sky/dashboard/out/_next/static/chunks/pages/{infra-872e6a00165534f4.js → infra-c84a3b8a9d599b02.js} +1 -1
  18. sky/dashboard/out/_next/static/chunks/pages/jobs/{[job]-8677af16befde039.js → [job]-eb5822dac0c9509b.js} +1 -1
  19. sky/dashboard/out/_next/static/chunks/pages/{users-3a543725492fb896.js → users-96d6b8bb2dec055f.js} +1 -1
  20. sky/dashboard/out/_next/static/chunks/pages/workspaces/{[name]-9ad108cd67d16d96.js → [name]-fb1b4d3bfb047cad.js} +1 -1
  21. sky/dashboard/out/_next/static/chunks/{webpack-434b7577d72c879b.js → webpack-4abaae354da0ba13.js} +1 -1
  22. sky/dashboard/out/_next/static/css/4c052b4444e52a58.css +3 -0
  23. sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
  24. sky/dashboard/out/clusters/[cluster].html +1 -1
  25. sky/dashboard/out/clusters.html +1 -1
  26. sky/dashboard/out/config.html +1 -1
  27. sky/dashboard/out/index.html +1 -1
  28. sky/dashboard/out/infra/[context].html +1 -1
  29. sky/dashboard/out/infra.html +1 -1
  30. sky/dashboard/out/jobs/[job].html +1 -1
  31. sky/dashboard/out/jobs/pools/[pool].html +1 -1
  32. sky/dashboard/out/jobs.html +1 -1
  33. sky/dashboard/out/users.html +1 -1
  34. sky/dashboard/out/volumes.html +1 -1
  35. sky/dashboard/out/workspace/new.html +1 -1
  36. sky/dashboard/out/workspaces/[name].html +1 -1
  37. sky/dashboard/out/workspaces.html +1 -1
  38. sky/jobs/server/utils.py +4 -1
  39. sky/jobs/utils.py +39 -0
  40. {skypilot_nightly-1.0.0.dev20251023.dist-info → skypilot_nightly-1.0.0.dev20251025.dist-info}/METADATA +37 -37
  41. {skypilot_nightly-1.0.0.dev20251023.dist-info → skypilot_nightly-1.0.0.dev20251025.dist-info}/RECORD +46 -46
  42. sky/dashboard/out/_next/static/chunks/2755.1ffbda43f960962b.js +0 -26
  43. sky/dashboard/out/_next/static/chunks/3294.27318ad826343ea6.js +0 -1
  44. sky/dashboard/out/_next/static/chunks/6135-4b4d5e824b7f9d3c.js +0 -1
  45. sky/dashboard/out/_next/static/css/4614e06482d7309e.css +0 -3
  46. /sky/dashboard/out/_next/static/{CJlKj9Z9fXGlQCmH4EpLX → WfMolkH3tkVNEHhHaH9uk}/_ssgManifest.js +0 -0
  47. {skypilot_nightly-1.0.0.dev20251023.dist-info → skypilot_nightly-1.0.0.dev20251025.dist-info}/WHEEL +0 -0
  48. {skypilot_nightly-1.0.0.dev20251023.dist-info → skypilot_nightly-1.0.0.dev20251025.dist-info}/entry_points.txt +0 -0
  49. {skypilot_nightly-1.0.0.dev20251023.dist-info → skypilot_nightly-1.0.0.dev20251025.dist-info}/licenses/LICENSE +0 -0
  50. {skypilot_nightly-1.0.0.dev20251023.dist-info → skypilot_nightly-1.0.0.dev20251025.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3294],{53294:function(e,s,t){t.r(s),t.d(s,{ContextDetails:function(){return D},GPUs:function(){return E},InfrastructureSection:function(){return I}});var a=t(85893),l=t(67294),r=t(55739);t(9353);var n=t(26409),o=t(98418),i=t(13626),c=t(23001),d=t(17853),m=t(32045),u=t(23266),x=t(68969),h=t(29326),g=t(50326),p=t(30803),f=t(42557),y=t(36185),j=t(69123);function b(e){let{isOpen:s,onClose:t,onSave:n,poolData:o=null,isLoading:i=!1}=e,[c,d]=(0,l.useState)(""),[m,u]=(0,l.useState)(""),[x,b]=(0,l.useState)("ubuntu"),[N,v]=(0,l.useState)(null),[w,S]=(0,l.useState)(""),[_,C]=(0,l.useState)({}),k=null!==o;(0,l.useEffect)(()=>{if(k&&o){var e,s,t;d(o.name||""),u(((null===(e=o.config)||void 0===e?void 0:e.hosts)||[]).join("\n")),b((null===(s=o.config)||void 0===s?void 0:s.user)||"ubuntu"),S((null===(t=o.config)||void 0===t?void 0:t.password)||"")}else d(""),u(""),b("ubuntu"),v(null),S("");C({})},[k,o]);let P=()=>{let e={};return c.trim()||(e.poolName="Pool name is required"),m.trim()||(e.hosts="At least one host is required"),x.trim()||(e.sshUser="SSH user is required"),N||w||(e.auth="Either SSH key file or password is required"),C(e),0===Object.keys(e).length},U=async()=>{if(!P())return;let e={hosts:m.split("\n").map(e=>e.trim()).filter(e=>e.length>0),user:x};try{if(N){let s=N.name;await (0,h.hY)(s,N),e.identity_file="~/.sky/ssh_keys/".concat(s)}w&&(e.password=w),n(c,e)}catch(e){console.error("Failed to upload SSH key:",e),C({..._,keyUpload:"Failed to upload SSH key"})}},I=()=>{i||t()};return(0,a.jsx)(g.Vq,{open:s,onOpenChange:I,children:(0,a.jsxs)(g.cZ,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[(0,a.jsx)(g.fK,{children:(0,a.jsx)(g.$N,{children:k?"Edit SSH Node Pool: ".concat(null==o?void 0:o.name):"Add SSH Node Pool"})}),(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(y._,{htmlFor:"poolName",children:"Pool Name"}),(0,a.jsx)(f.I,{id:"poolName",placeholder:"my-ssh-cluster",value:c,onChange:e=>d(e.target.value),disabled:k,className:"placeholder:text-gray-500 ".concat(_.poolName?"border-red-500":"")}),_.poolName&&(0,a.jsx)("p",{className:"text-sm text-red-500",children:_.poolName})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(y._,{htmlFor:"hosts",children:"Hosts (one per line)"}),(0,a.jsx)(j.g,{id:"hosts",placeholder:"192.168.1.10\n192.168.1.11\nhostname.example.com",value:m,onChange:e=>u(e.target.value),rows:6,className:"placeholder:text-gray-500 ".concat(_.hosts?"border-red-500":"")}),_.hosts&&(0,a.jsx)("p",{className:"text-sm text-red-500",children:_.hosts})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(y._,{htmlFor:"sshUser",children:"SSH User"}),(0,a.jsx)(f.I,{id:"sshUser",placeholder:"ubuntu",value:x,onChange:e=>b(e.target.value),className:"placeholder:text-gray-500 ".concat(_.sshUser?"border-red-500":"")}),_.sshUser&&(0,a.jsx)("p",{className:"text-sm text-red-500",children:_.sshUser})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(y._,{htmlFor:"keyFile",children:"SSH Private Key File"}),(0,a.jsx)(f.I,{id:"keyFile",type:"file",accept:".pem,.key,id_rsa,id_ed25519",onChange:e=>{var s;return v((null===(s=e.target.files)||void 0===s?void 0:s[0])||null)},className:"border-0 bg-transparent p-0 shadow-none focus:ring-0 file:mr-2 file:text-sm file:py-1 file:px-3 file:border file:border-gray-300 file:rounded file:bg-gray-50 hover:file:bg-gray-100 file:cursor-pointer"}),_.keyUpload&&(0,a.jsx)("p",{className:"text-sm text-red-500",children:_.keyUpload})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(y._,{htmlFor:"password",children:"Password (optional, if sudo requires a password)"}),(0,a.jsx)(f.I,{id:"password",type:"password",placeholder:"Leave empty if using passwordless sudo",value:w,onChange:e=>S(e.target.value),className:"placeholder:text-gray-500"})]}),_.auth&&(0,a.jsx)("p",{className:"text-sm text-red-500",children:_.auth})]}),(0,a.jsxs)(g.cN,{children:[(0,a.jsx)(p.z,{variant:"outline",onClick:I,disabled:i,children:"Cancel"}),(0,a.jsx)(p.z,{onClick:U,disabled:i,className:"bg-blue-600 hover:bg-blue-700 text-white disabled:bg-gray-300 disabled:text-gray-500",children:i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.Z,{size:16,className:"mr-2"}),"Saving..."]}):k?"Update Pool":"Create Pool"})]})]})})}var N=t(6378),v=t(36856),w=t(51214),S=t(11163),_=t(41664),C=t.n(_),k=t(36989);t(37673);let P=w.nb.REFRESH_INTERVAL,U=w.MO.NAME_TRUNCATE_LENGTH;function I(e){let{title:s,isLoading:t,isDataLoaded:l,contexts:n,gpus:o,groupedPerContextGPUs:i,groupedPerNodeGPUs:c,handleContextClick:d,contextStats:m={},jobsData:u={},isJobsDataLoading:x=!0,isSSH:h=!1,actionButton:g=null,contextWorkspaceMap:p={}}=e,f=n||[];return t&&0===f.length?(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm mb-6",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold mb-4",children:s}),(0,a.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,a.jsx)(r.Z,{size:24,className:"mr-3"}),(0,a.jsxs)("span",{className:"text-gray-500",children:["Loading ",s,"..."]})]})]})}):l&&0===f.length?(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm mb-6",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:s}),g]}),(0,a.jsxs)("p",{className:"text-sm text-gray-500",children:["No ",s," found or ",s," is not configured."]})]})}):f.length>0?(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm mb-6",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:s}),(0,a.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-blue-100 text-blue-800 rounded-full text-xs font-medium",children:[f.length," ",1===f.length?h?"pool":"context":h?"pools":"contexts"]})]}),g]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"overflow-x-auto rounded-md border border-gray-200 shadow-sm bg-white",children:(0,a.jsxs)("table",{className:"min-w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/4",children:h?"Node Pool":"Context"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/8",children:"Clusters"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/8",children:"Jobs"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/8",children:"Nodes"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/4",children:"GPU Types"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/8",children:"#GPUs"})]})}),(0,a.jsx)("tbody",{className:"bg-white divide-y divide-gray-200 ".concat(f.length>5?"max-h-[250px] overflow-y-auto block":""),children:f.map(e=>{var s,t;let n=i[e]||[],o=c[e]||[],g=n.reduce((e,s)=>e+(s.gpu_total||0),0),f=h?"ssh/".concat(e.replace(/^ssh-/,"")):"kubernetes/".concat(e),y=m[f]||{clusters:0,jobs:0},j=Object.keys(m).length>0&&m[f]||l,b=i&&Object.keys(i).length>0||l,N=c&&Object.keys(c).length>0||l,v=b?Object.keys(n.reduce((e,s)=>(e[s.gpu_name]=(e[s.gpu_name]||0)+(s.gpu_total||0),e),{})).join(", "):null,w=h?e.replace(/^ssh-/,""):e,S=p[e]||[],_=S.length>0?" (".concat(S.join(", "),")"):"";return(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"p-3",children:(0,a.jsx)(k.Md,{content:"".concat(w).concat(_),className:"text-sm text-muted-foreground",children:(0,a.jsxs)("span",{className:"text-blue-600 hover:underline cursor-pointer",onClick:()=>d(e),children:[w.length>U?"".concat(w.substring(0,Math.floor((U-3)/2)),"...").concat(w.substring(w.length-Math.ceil((U-3)/2))):w,_&&(0,a.jsx)("span",{className:"text-xs text-gray-500 ml-1",children:_})]})})}),(0,a.jsx)("td",{className:"p-3",children:j?y.clusters>0?(0,a.jsx)("span",{className:"px-2 py-0.5 bg-blue-100 text-blue-800 rounded text-xs font-medium",children:y.clusters}):(0,a.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-500 rounded text-xs font-medium",children:"0"}):(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)(r.Z,{size:12})})}),(0,a.jsx)("td",{className:"p-3",children:x?(0,a.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-500 rounded text-xs font-medium",children:(0,a.jsx)(r.Z,{size:12})}):(null===(s=u[f])||void 0===s?void 0:s.jobs)?(0,a.jsx)("span",{className:"px-2 py-0.5 bg-green-100 text-green-800 rounded text-xs font-medium",children:null===(t=u[f])||void 0===t?void 0:t.jobs}):(0,a.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-500 rounded text-xs font-medium",children:"0"})}),(0,a.jsx)("td",{className:"p-3",children:N?(0,a.jsx)("span",{className:0===o.length?"text-gray-400":"",title:0===o.length?"Context may be unavailable or timed out":"",children:0===o.length?"0*":o.length}):(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)(r.Z,{size:16})})}),(0,a.jsx)("td",{className:"p-3",children:b?v||"-":(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)(r.Z,{size:16})})}),(0,a.jsx)("td",{className:"p-3",children:b?g:(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)(r.Z,{size:16})})})]},e)})})]})})}),o&&o.length>0&&(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"overflow-x-auto rounded-md border border-gray-200 shadow-sm bg-white",children:(0,a.jsxs)("table",{className:"min-w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsxs)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/4 whitespace-nowrap",children:["GPU",(0,a.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-green-100 text-green-800 rounded-full text-xs font-medium whitespace-nowrap",children:[o.reduce((e,s)=>e+s.gpu_free,0)," ","of"," ",o.reduce((e,s)=>e+s.gpu_total,0)," ","free"]})]}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/4",children:"Requestable"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-1/2",children:(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsx)("span",{children:"Utilization"})})})]})}),(0,a.jsx)("tbody",{className:"bg-white divide-y divide-gray-200 ".concat(o.length>5?"max-h-[250px] overflow-y-auto block":""),children:o.map(e=>{let s=e.gpu_total-e.gpu_free,t=e.gpu_total>0?e.gpu_free/e.gpu_total*100:0,l=e.gpu_total>0?s/e.gpu_total*100:0,r=i?Object.values(i).flat().filter(s=>s.gpu_name===e.gpu_name&&(h?s.context.startsWith("ssh-"):!s.context.startsWith("ssh-"))).map(e=>e.gpu_requestable_qty_per_node).filter((e,s,t)=>t.indexOf(e)===s).join(", "):"-";return(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"p-3 font-medium w-24 whitespace-nowrap",children:e.gpu_name}),(0,a.jsxs)("td",{className:"p-3 text-xs text-gray-600",children:[r||"-"," / node"]}),(0,a.jsx)("td",{className:"p-3 w-2/3",children:(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsxs)("div",{className:"flex-1 bg-gray-100 rounded-md h-5 flex overflow-hidden shadow-sm min-w-[100px] w-full",children:[l>0&&(0,a.jsx)("div",{style:{width:"".concat(l,"%")},className:"bg-yellow-500 h-full flex items-center justify-center text-white text-xs font-medium",children:l>15&&"".concat(s," used")}),t>0&&(0,a.jsx)("div",{style:{width:"".concat(t,"%")},className:"bg-green-700 h-full flex items-center justify-center text-white text-xs font-medium",children:t>15&&"".concat(e.gpu_free," free")})]})})})]},e.gpu_name)})})]})})})]})]})}):null}function D(e){let{contextName:s,gpusInContext:t,nodesInContext:n}=e,o=s.startsWith("ssh-"),[i,c]=(0,l.useState)([]),[m,u]=(0,l.useState)("$__all"),[x,h]=(0,l.useState)({from:"now-1h",to:"now"}),[g,p]=(0,l.useState)(!1),[f,y]=(0,l.useState)(!1);(0,l.useEffect)(()=>{(async()=>{y(await (0,d.TO)())})()},[]);let j=(0,l.useCallback)(async()=>{if(f){p(!0);try{let e=(0,d.ki)(),t="in-cluster"===s?"^$":s,a="query="+encodeURIComponent('group by (node) (DCGM_FI_DEV_GPU_TEMP{cluster=~"'.concat(t,'"} or label_replace(amd_gpu_gfx_activity{cluster=~"').concat(t,'"}, "node", "$1", "hostname", "(.*)"))')),l="/api/datasources/proxy/1/api/v1/query?".concat(a);try{let s=await fetch("".concat(e).concat(l),{method:"GET",credentials:"include",headers:{Accept:"application/json"}});if(s.ok){let e=await s.json();if(e.data&&e.data.result&&e.data.result.length>0){let s=e.data.result.map(e=>e.metric.node).filter(Boolean).sort();c(s),console.log("Successfully fetched hosts for cluster ".concat(t||"in-cluster",":"),s)}else console.log("No nodes found for this cluster"),c([])}else console.log("HTTP ".concat(s.status," from ").concat(l,": ").concat(s.statusText)),c([])}catch(e){console.log("Failed to fetch from ".concat(l,":"),e),c([])}}catch(e){console.error("Error fetching available hosts:",e),c([])}finally{p(!1)}}},[f,s]);(0,l.useEffect)(()=>{f&&n&&n.length>0&&j()},[n,f,j]);let b=e=>{let t=(0,d.ki)(),a="in-cluster"===s?"^$":s;return"".concat(t,"/d-solo/skypilot-dcgm-cluster-dashboard/skypilot-dcgm-kubernetes-cluster-dashboard?orgId=1&timezone=browser&var-datasource=prometheus&var-host=").concat(encodeURIComponent(m),"&var-gpu=$__all&var-cluster=").concat(encodeURIComponent(a),"&refresh=5s&theme=light&from=").concat(encodeURIComponent(x.from),"&to=").concat(encodeURIComponent(x.to),"&panelId=").concat(e,"&__feature.dashboardSceneSolo")},N=e=>{h({"15m":{from:"now-15m",to:"now"},"1h":{from:"now-1h",to:"now"},"6h":{from:"now-6h",to:"now"},"24h":{from:"now-24h",to:"now"},"7d":{from:"now-7d",to:"now"}}[e])};return(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm h-full",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,a.jsx)("h4",{className:"text-lg font-semibold",children:"Available GPUs"})}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-6",children:t.map(e=>{let s=e.gpu_total-e.gpu_free,t=e.gpu_total>0?e.gpu_free/e.gpu_total*100:0,l=e.gpu_total>0?s/e.gpu_total*100:0;return(0,a.jsxs)("div",{className:"p-3 bg-gray-50 rounded-md border border-gray-200 shadow-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-1.5 flex-wrap",children:[(0,a.jsxs)("div",{className:"font-medium text-gray-800 text-sm",children:[e.gpu_name,(0,a.jsxs)("span",{className:"text-xs text-gray-500 ml-2",children:["(Requestable: ",e.gpu_requestable_qty_per_node," / node)"]})]}),(0,a.jsxs)("span",{className:"text-xs font-medium",children:[e.gpu_free," free / ",e.gpu_total," total"]})]}),(0,a.jsxs)("div",{className:"w-full bg-gray-100 rounded-md h-4 flex overflow-hidden shadow-sm",children:[l>0&&(0,a.jsx)("div",{style:{width:"".concat(l,"%")},className:"bg-yellow-500 h-full flex items-center justify-center text-white text-xs",children:l>15&&"".concat(s," used")}),t>0&&(0,a.jsx)("div",{style:{width:"".concat(t,"%")},className:"bg-green-700 h-full flex items-center justify-center text-white text-xs",children:t>15&&"".concat(e.gpu_free," free")})]})]},e.gpu_name)})}),n&&n.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h4",{className:"text-lg font-semibold mb-4",children:"Nodes"}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-md border border-gray-200 shadow-sm",children:(0,a.jsxs)("table",{className:"min-w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-100",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600",children:"Node"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600",children:"IP Address"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600",children:"GPU"}),(0,a.jsx)("th",{className:"p-3 text-right font-medium text-gray-600",children:"Availability"})]})}),(0,a.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:n.map((e,s)=>(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"p-3 whitespace-nowrap text-gray-700",children:e.node_name}),(0,a.jsx)("td",{className:"p-3 whitespace-nowrap text-gray-700",children:e.ip_address||"-"}),(0,a.jsx)("td",{className:"p-3 whitespace-nowrap text-gray-700",children:e.gpu_name}),(0,a.jsx)("td",{className:"p-3 whitespace-nowrap text-right text-gray-700",children:"".concat(e.gpu_free," of ").concat(e.gpu_total," free")})]},"".concat(e.node_name,"-").concat(s)))})]})})]}),f&&t&&t.length>0&&!o&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h4",{className:"text-lg font-semibold mb-4 mt-6",children:"GPU Metrics"}),(0,a.jsxs)("div",{className:"mb-4 p-4 bg-gray-50 rounded-md border border-gray-200",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center",children:[n&&n.length>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("label",{htmlFor:"host-select",className:"text-sm font-medium text-gray-700 whitespace-nowrap",children:"Node:"}),(0,a.jsxs)("select",{id:"host-select",value:m,onChange:e=>{u(e.target.value)},disabled:g,className:"px-3 py-1 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-sky-blue focus:border-transparent",children:[(0,a.jsx)("option",{value:"$__all",children:"All Nodes"}),i.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]}),g&&(0,a.jsx)("div",{className:"ml-2",children:(0,a.jsx)(r.Z,{size:16})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700 whitespace-nowrap",children:"Time Range:"}),(0,a.jsx)("div",{className:"flex gap-1",children:[{label:"15m",value:"15m"},{label:"1h",value:"1h"},{label:"6h",value:"6h"},{label:"24h",value:"24h"},{label:"7d",value:"7d"}].map(e=>(0,a.jsx)("button",{onClick:()=>N(e.value),className:"px-2 py-1 text-xs font-medium rounded border transition-colors ".concat(x.from==="now-".concat(e.value)&&"now"===x.to?"bg-sky-blue text-white border-sky-blue":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50"),children:e.label},e.value))})]})]}),(0,a.jsx)("div",{className:"mt-2 text-xs text-gray-500",children:n&&n.length>0?(0,a.jsxs)(a.Fragment,{children:["Showing:"," ","$__all"===m?"All nodes":m," ","• Time: ",x.from," to ",x.to,i.length>0&&(0,a.jsxs)("span",{children:[" ","• ",i.length," nodes available"]})]}):(0,a.jsxs)(a.Fragment,{children:["Cluster:"," ",o?s.replace(/^ssh-/,""):s," ","• Time: ",x.from," to ",x.to," • Showing metrics for all nodes in cluster"]})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,a.jsx)("div",{className:"bg-white rounded-md border border-gray-200 shadow-sm",children:(0,a.jsx)("div",{className:"p-2",children:(0,a.jsx)("iframe",{src:b("6"),width:"100%",height:"400",frameBorder:"0",title:"GPU Utilization",className:"rounded"},"gpu-util-".concat(m,"-").concat(x.from,"-").concat(x.to))})}),(0,a.jsx)("div",{className:"bg-white rounded-md border border-gray-200 shadow-sm",children:(0,a.jsx)("div",{className:"p-2",children:(0,a.jsx)("iframe",{src:b("18"),width:"100%",height:"400",frameBorder:"0",title:"GPU Memory",className:"rounded"},"gpu-memory-".concat(m,"-").concat(x.from,"-").concat(x.to))})}),(0,a.jsx)("div",{className:"bg-white rounded-md border border-gray-200 shadow-sm",children:(0,a.jsx)("div",{className:"p-2",children:(0,a.jsx)("iframe",{src:b("10"),width:"100%",height:"400",frameBorder:"0",title:"GPU Power Consumption",className:"rounded"},"gpu-power-".concat(m,"-").concat(x.from,"-").concat(x.to))})}),(0,a.jsx)("div",{className:"bg-white rounded-md border border-gray-200 shadow-sm",children:(0,a.jsx)("div",{className:"p-2",children:(0,a.jsx)("iframe",{src:b("12"),width:"100%",height:"400",frameBorder:"0",title:"GPU Temperature",className:"rounded"},"gpu-temp-".concat(m,"-").concat(x.from,"-").concat(x.to))})}),(0,a.jsx)("div",{className:"bg-white rounded-md border border-gray-200 shadow-sm",children:(0,a.jsx)("div",{className:"p-2",children:(0,a.jsx)("iframe",{src:b("22"),width:"100%",height:"400",frameBorder:"0",title:"CPU Utilization",className:"rounded"},"cpu-util-".concat(m,"-").concat(x.from,"-").concat(x.to))})}),(0,a.jsx)("div",{className:"bg-white rounded-md border border-gray-200 shadow-sm",children:(0,a.jsx)("div",{className:"p-2",children:(0,a.jsx)("iframe",{src:b("21"),width:"100%",height:"400",frameBorder:"0",title:"Memory Utilization",className:"rounded"},"memory-util-".concat(m,"-").concat(x.from,"-").concat(x.to))})})]})]})]})})})}function F(e){var s;let{poolName:t,gpusInContext:i,nodesInContext:c,handleDeploySSHPool:d,handleEditSSHPool:m,handleDeleteSSHPool:u,poolConfig:x}=e,[f,y]=(0,l.useState)(null),[j,b]=(0,l.useState)(!0),[N,v]=(0,l.useState)({isOpen:!1,action:null,loading:!1}),[w,S]=(0,l.useState)({isOpen:!1,logs:"",isStreaming:!1,deploymentComplete:!1,deploymentSuccess:!1,requestId:null});(0,l.useEffect)(()=>{(async()=>{try{b(!0);let e=await (0,h.IS)(t);y(e)}catch(e){console.error("Failed to fetch SSH Node Pool status:",e),y({pool_name:t,status:"Error",reason:"Failed to fetch status"})}finally{b(!1)}})()},[t]);let{deployDisabled:_}=(()=>{if(!f)return{deployDisabled:!0};let e=f.status;return"Ready"===e?{deployDisabled:!0}:"Error"===e?{deployDisabled:!0}:{deployDisabled:!1}})(),C=async()=>{v({...N,loading:!0});try{if("deploy"===N.action){v({isOpen:!1,action:null,loading:!1}),S({isOpen:!0,logs:"",isStreaming:!0,deploymentComplete:!1,deploymentSuccess:!1,requestId:null});try{let e=(await d(t)).request_id;S(s=>({...s,requestId:e}));let s=new AbortController;await (0,h.wJ)({requestId:e,signal:s.signal,onNewLog:e=>{S(s=>({...s,logs:s.logs+e}))}}),S(e=>({...e,isStreaming:!1,deploymentComplete:!0,deploymentSuccess:!0})),setTimeout(async()=>{(async()=>{try{let e=await (0,h.IS)(t);y(e)}catch(e){console.error("Failed to fetch SSH Node Pool status after deployment:",e)}})()},1e3)}catch(e){console.error("Deployment failed:",e),S(s=>({...s,isStreaming:!1,deploymentComplete:!0,deploymentSuccess:!1,logs:s.logs+"\nDeployment failed: ".concat(e.message)}))}}else if("delete"===N.action){v({isOpen:!1,action:null,loading:!1}),S({isOpen:!0,logs:"",isStreaming:!0,deploymentComplete:!1,deploymentSuccess:!1,requestId:null});try{let e=(await (0,h.ez)(t)).request_id;S(s=>({...s,requestId:e})),e&&await (0,h.mF)({requestId:e,signal:null,onNewLog:e=>{S(s=>({...s,logs:s.logs+e}))},operationType:"down"}),await u(t),S(e=>({...e,isStreaming:!1,deploymentComplete:!0,deploymentSuccess:!0,logs:e.logs+"\nSSH Node Pool teardown completed successfully."}))}catch(e){console.error("Down operation failed:",e),S(s=>({...s,isStreaming:!1,deploymentComplete:!0,deploymentSuccess:!1,logs:s.logs+"\nTeardown failed: ".concat(e.message)}))}}}catch(e){console.error("Action failed:",e),v({...N,loading:!1})}},k=()=>{v({isOpen:!1,action:null,loading:!1})},P=()=>{S({isOpen:!1,logs:"",isStreaming:!1,deploymentComplete:!1,deploymentSuccess:!1,requestId:null}),w.deploymentComplete&&setTimeout(()=>{(async()=>{try{let e=await (0,h.IS)(t);y(e)}catch(e){console.error("Failed to refresh status:",e)}})()},1e3)},U="deploy"===N.action?{title:"Deploy SSH Node Pool",description:'Are you sure you want to deploy SSH Node Pool "'.concat(t,'"?'),details:["• Set up SkyPilot runtime on the configured SSH hosts","• Install required components and dependencies","• Make the node pool available for workloads","","This process may take a few minutes to complete."]}:{title:"Delete SSH Node Pool",description:'Are you sure you want to delete SSH Node Pool "'.concat(t,'"?'),details:["• Clean up any deployed resources","• Remove the SSH Node Pool configuration"]};return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsxs)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 pt-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"SSH Node Pool Details"}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsxs)("button",{className:"px-3 py-1 text-sm border rounded flex items-center ".concat(_?"border-gray-300 bg-gray-100 text-gray-400 cursor-not-allowed":"border-green-300 bg-green-50 text-green-700 hover:bg-green-100"),onClick:_?void 0:()=>{v({isOpen:!0,action:"deploy",loading:!1})},disabled:_,children:[(0,a.jsx)(n.Z,{className:"w-4 h-4 mr-2"}),"Deploy"]}),(0,a.jsxs)("button",{className:"px-3 py-1 text-sm border border-gray-300 rounded hover:bg-gray-50 flex items-center text-red-600 hover:text-red-700",onClick:()=>{v({isOpen:!0,action:"delete",loading:!1})},children:[(0,a.jsx)(o.Z,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]}),(0,a.jsx)("div",{className:"p-4",children:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Pool Name"}),(0,a.jsx)("div",{className:"text-base mt-1",children:t})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Nodes"}),(0,a.jsx)("div",{className:"text-base mt-1",children:c?c.length:0})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Status"}),(0,a.jsx)("div",{className:"text-base mt-1",children:j?(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(r.Z,{size:16,className:"mr-2"}),(0,a.jsx)("span",{className:"text-gray-500",children:"Loading..."})]}):f?(0,a.jsx)(e=>{let{status:s,reason:t}=e,l="Ready"===s,r="Not Ready"===s?"Click Deploy to set up this node pool":t;return(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"px-2 py-0.5 rounded text-xs font-medium ".concat(l?"bg-green-100":"bg-red-100"," ").concat(l?"text-green-800":"text-red-800"),children:s}),!l&&r&&(0,a.jsxs)("span",{className:"text-sm text-gray-600",children:["(",r,")"]})]})},{status:f.status,reason:f.reason}):(0,a.jsx)("span",{className:"text-gray-500",children:"Unknown"})})]})]})})]})}),(0,a.jsx)(D,{contextName:"ssh-".concat(t),gpusInContext:i,nodesInContext:c}),(0,a.jsx)(g.Vq,{open:N.isOpen,onOpenChange:k,children:(0,a.jsxs)(g.cZ,{className:"sm:max-w-md",children:[(0,a.jsxs)(g.fK,{className:"",children:[(0,a.jsx)(g.$N,{className:"",children:U.title}),(0,a.jsx)(g.Be,{className:"",children:U.description})]}),(0,a.jsx)("div",{className:"py-4",children:(0,a.jsxs)("div",{className:"text-sm text-gray-600 space-y-1",children:[(0,a.jsx)("p",{className:"font-medium mb-2",children:"This will:"}),U.details.map((e,s)=>(0,a.jsx)("p",{className:""===e?"pt-2":"",children:e},s))]})}),(0,a.jsxs)(g.cN,{className:"",children:[(0,a.jsx)(p.z,{variant:"outline",onClick:k,disabled:N.loading,className:"",children:"Cancel"}),(0,a.jsx)(p.z,{onClick:C,disabled:N.loading,className:"deploy"===N.action?"bg-green-600 hover:bg-green-700 text-white":"bg-red-600 hover:bg-red-700 text-white",children:N.loading?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.Z,{size:16,className:"mr-2"}),"deploy"===N.action?"Deploying...":"Deleting..."]}):"deploy"===N.action?"Deploy":"Delete"})]})]})}),(0,a.jsx)(g.Vq,{open:w.isOpen,onOpenChange:w.isStreaming?void 0:P,children:(0,a.jsxs)(g.cZ,{className:"sm:max-w-4xl max-h-[80vh]",children:[(0,a.jsxs)(g.fK,{className:"",children:[(0,a.jsxs)(g.$N,{className:"",children:["Deploying SSH Node Pool: ",t]}),(0,a.jsx)(g.Be,{className:"",children:w.isStreaming?"Deployment in progress. Do not close this dialog.":w.deploymentSuccess?"Deployment completed successfully!":"Deployment completed with errors."})]}),(0,a.jsx)("div",{className:"py-4",children:(0,a.jsxs)("div",{className:"bg-black text-green-400 p-4 rounded-md font-mono text-sm max-h-96 overflow-y-auto",children:[(0,a.jsx)("pre",{className:"whitespace-pre-wrap",children:(s=w.logs)?s.split("\n").map(e=>(e=e.replace(/\x1b\[[0-9;]*m/g,"")).match(/^D \d{2}-\d{2} \d{2}:\d{2}:\d{2}/)?null:e=(e=e.replace(/├──/g,"├─")).replace(/└──/g,"└─")).filter(e=>null!==e&&""!==e.trim()).join("\n"):""}),w.isStreaming&&(0,a.jsxs)("div",{className:"flex items-center mt-2",children:[(0,a.jsx)(r.Z,{size:16,className:"mr-2 text-green-400"}),(0,a.jsx)("span",{className:"text-green-400",children:"Streaming logs..."})]})]})}),(0,a.jsx)(g.cN,{className:"",children:(0,a.jsx)(p.z,{onClick:P,disabled:w.isStreaming,className:w.deploymentSuccess?"bg-green-600 hover:bg-green-700 text-white":w.deploymentComplete&&!w.deploymentSuccess?"bg-red-600 hover:bg-red-700 text-white":"bg-gray-600 hover:bg-gray-700 text-white",children:w.isStreaming?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.Z,{size:16,className:"mr-2"}),"Deploying..."]}):"Close"})})]})})]})}function E(){let[e,s]=(0,l.useState)(!0),[t,n]=(0,l.useState)(!0),[o,d]=(0,l.useState)(!0),g=l.useRef(null),p=(0,c.X)(),[f,y]=(0,l.useState)(!1),[j,w]=(0,l.useState)(!1),_=(0,S.useRouter)(),[k,U]=(0,l.useState)([]),[E,H]=(0,l.useState)([]),[A,z]=(0,l.useState)([]),[R,q]=(0,l.useState)([]),[O,M]=(0,l.useState)([]),[Z,G]=(0,l.useState)(0),[L,T]=(0,l.useState)(0),[W,B]=(0,l.useState)({}),[K,$]=(0,l.useState)({}),[J,V]=(0,l.useState)({}),[X,Y]=(0,l.useState)("all"),[Q,ee]=(0,l.useState)([]),[es,et]=(0,l.useState)({}),[ea,el]=(0,l.useState)(!1),[er,en]=(0,l.useState)(null),[eo,ei]=(0,l.useState)(!1),[ec,ed]=(0,l.useState)(!0),[em,eu]=(0,l.useState)({}),[ex,eh]=(0,l.useState)(null),eg=l.useCallback(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{showLoadingIndicators:!0},{showLoadingIndicators:t=!0,forceRefresh:a=!1}=e;t&&(s(!0),n(!0),ei(!0),ed(!0));try{async function l(e){await ep(e),await ej(e)}await Promise.all([l(a),ey(a),ef(a)])}catch(e){console.error("Error in fetchData:",e),V({}),U([]),H([]),z([]),q([]),B({}),$({}),ee([]),y(!0),s(!1),M([]),G(0),T(0),w(!0),et({}),ei(!1),eu({}),ed(!1)}finally{t&&(s(!1),n(!1),ei(!1),ed(!1)),o&&t&&d(!1)}},[o]),ep=async e=>{try{let t=e?await (0,m.Xg)():await N.default.get(m.Xg);if(t){let{workspaces:e,allContextNames:a,allGPUs:l,perContextGPUs:r,perNodeGPUs:n,contextStats:o,contextWorkspaceMap:i}=t;V(e||{}),U(a||[]),H(l||[]),z(r||[]),q(n||[]),B(o||{}),$(i||{});let c=Object.keys(e||{});ee(c.sort()),y(!0),s(!1)}else null===t&&(V({}),U([]),H([]),z([]),q([]),B({}),$({}),ee([]),y(!0),s(!1))}catch(e){console.error("Error in fetchKubernetesData:",e),V({}),U([]),H([]),z([]),q([]),B({}),$({}),ee([]),y(!0),s(!1)}},ef=async e=>{try{let s=e?await (0,x.getManagedJobs)({allUsers:!0,skipFinished:!0,fields:["cloud","region"]}):await N.default.get(x.getManagedJobs,[{allUsers:!0,skipFinished:!0,fields:["cloud","region"]}]),t=(null==s?void 0:s.jobs)||[];eu(await (0,m.R8)(t)),ed(!1)}catch(e){console.error("Error in fetchManagedJobsData:",e),eu({}),ed(!1)}},ey=async e=>{try{let s=e?await (0,m.ef)():await N.default.get(m.ef,[e]);s?(M(s.clouds||[]),G(s.totalClouds||0),T(s.enabledClouds||0),w(!0)):null===s&&(M([]),G(0),T(0),w(!0))}catch(e){console.error("Error in fetchCloudData:",e),M([]),G(0),T(0),w(!0)}},ej=async e=>{try{let s=e?await (0,h.It)():await N.default.get(h.It);et(s),ei(!1)}catch(e){console.error("Failed to fetch SSH Node Pools:",e),et({}),ei(!1)}},eb=(e,s)=>{en({name:e,config:s}),el(!0)},eN=async e=>{try{await (0,h.MV)(e),await ej(),eh(null),_.push("/infra")}catch(e){throw console.error("Failed to delete SSH Node Pool:",e),e}},ev=async e=>{try{await (0,h._x)(e)}catch(e){throw console.error("Failed to deploy SSH Node Pool:",e),e}},ew=async(e,s)=>{ei(!0);try{let t={...es};t[e]=s,await (0,h.Ri)(t),await ej(),el(!1)}catch(e){console.error("Failed to save SSH Node Pool:",e),alert("Failed to save SSH Node Pool. Please try again.")}finally{ei(!1)}};(0,l.useEffect)(()=>{g.current=eg},[eg]),(0,l.useEffect)(()=>{(async()=>{await v.ZP.preloadForPage("infra"),eg({showLoadingIndicators:!0})})()},[]),(0,l.useEffect)(()=>{let e=!0,s=setInterval(()=>{e&&g.current&&"visible"===window.document.visibilityState&&g.current({showLoadingIndicators:!1})},P);return()=>{e=!1,clearInterval(s)}},[]),(0,l.useEffect)(()=>()=>{y(!1),w(!1),ei(!1),d(!0),ed(!1)},[]);let eS=()=>{N.default.invalidate(u.getClusters),N.default.invalidate(x.getManagedJobs,[{allUsers:!0,skipFinished:!0,fields:["cloud","region"]}]),N.default.invalidate(m.Xg),N.default.invalidate(m.ef,[!1]),N.default.invalidate(h.It),g.current&&g.current({showLoadingIndicators:!0,forceRefresh:!0})};(0,l.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"r"===e.key&&(e.preventDefault(),eS())};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[]),(E||[]).length,(E||[]).reduce((e,s)=>e+s.gpu_total,0),(E||[]).reduce((e,s)=>e+s.gpu_free,0);let e_=l.useMemo(()=>A?A.reduce((e,s)=>{let{context:t}=s;return e[t]||(e[t]=[]),e[t].push(s),e},{}):{},[A]),eC=l.useCallback(e=>"all"===X?e:e.filter(e=>(K[e]||[]).includes(X)),[X,K]),ek=l.useMemo(()=>k&&Array.isArray(k)?eC(k.filter(e=>e.startsWith("ssh-"))):[],[k,eC]),eP=l.useMemo(()=>k&&Array.isArray(k)?eC(k.filter(e=>!e.startsWith("ssh-"))):[],[k,eC]),eU=l.useMemo(()=>{if(!A||!E)return[];let e=new Set;return A.forEach(s=>{s.context.startsWith("ssh-")&&e.add(s.gpu_name)}),E.filter(s=>e.has(s.gpu_name))},[E,A]),eI=l.useMemo(()=>{if(!A||!E)return[];let e=new Set;return A.forEach(s=>{s.context.startsWith("ssh-")||e.add(s.gpu_name)}),E.filter(s=>e.has(s.gpu_name))},[E,A]),eD=l.useMemo(()=>R?R.reduce((e,s)=>{let{context:t}=s;return e[t]||(e[t]=[]),e[t].push(s),e},{}):{},[R]);(0,l.useEffect)(()=>{_.isReady&&_.query.context&&eh(decodeURIComponent(Array.isArray(_.query.context)?_.query.context[0]:_.query.context))},[_.isReady,_.query.context]);let eF=e=>{eh(e);let s="/infra/".concat(encodeURIComponent(e));_.asPath!==s&&_.push(s)},eE=s=>{let t=e_[s]||[],l=eD[s]||[];if(e&&!f)return(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-64",children:[(0,a.jsx)(r.Z,{size:32,className:"mb-4"}),(0,a.jsx)("span",{className:"text-gray-500 text-lg",children:"Loading Context..."})]});if(s.startsWith("ssh-")){let e=s.replace(/^ssh-/,"");return(0,a.jsx)(F,{poolName:e,gpusInContext:t,nodesInContext:l,handleDeploySSHPool:ev,handleEditSSHPool:eb,handleDeleteSSHPool:eN,poolConfig:es[e]})}return(0,a.jsx)(D,{contextName:s,gpusInContext:t,nodesInContext:l})},eH=()=>t&&(!O||0===O.length)?(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm mb-6",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Cloud"}),(0,a.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,a.jsx)(r.Z,{size:24,className:"mr-3"}),(0,a.jsx)("span",{className:"text-gray-500",children:"Loading Cloud..."})]})]})}):(0,a.jsx)("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm mb-6",children:(0,a.jsxs)("div",{className:"p-5",children:[(0,a.jsxs)("div",{className:"flex items-center mb-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Cloud"}),(0,a.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-blue-100 text-blue-800 rounded-full text-xs font-medium",children:[L," of ",Z," enabled"]})]}),O&&0!==O.length?(0,a.jsx)("div",{className:"overflow-x-auto rounded-md border border-gray-200 shadow-sm bg-white",children:(0,a.jsxs)("table",{className:"min-w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-gray-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-32",children:"Cloud"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-24",children:"Clusters"}),(0,a.jsx)("th",{className:"p-3 text-left font-medium text-gray-600 w-24",children:"Jobs"})]})}),(0,a.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:O.map(e=>{let s=j&&void 0!==e.clusters&&void 0!==e.jobs;return(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"p-3 font-medium text-gray-700",children:e.name}),(0,a.jsx)("td",{className:"p-3",children:s?e.clusters>0?(0,a.jsx)("span",{className:"px-2 py-0.5 bg-blue-100 text-blue-800 rounded text-xs font-medium",children:e.clusters}):(0,a.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-500 rounded text-xs font-medium",children:"0"}):(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)(r.Z,{size:16})})}),(0,a.jsx)("td",{className:"p-3",children:s?e.jobs>0?(0,a.jsx)("span",{className:"px-2 py-0.5 bg-green-100 text-green-800 rounded text-xs font-medium",children:e.jobs}):(0,a.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-500 rounded text-xs font-medium",children:"0"}):(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)(r.Z,{size:16})})})]},e.name)})})]})}):(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"No enabled clouds available."})]})}),eA=()=>(0,a.jsx)(I,{title:"SSH Node Pool",isLoading:e,isDataLoaded:f,contexts:ek,gpus:eU,groupedPerContextGPUs:e_,groupedPerNodeGPUs:eD,handleContextClick:eF,contextStats:W,jobsData:em,isJobsDataLoading:ec,isSSH:!0,contextWorkspaceMap:K,actionButton:null}),ez=()=>(0,a.jsx)(I,{title:"Kubernetes",isLoading:e,isDataLoaded:f,contexts:eP,gpus:eI,groupedPerContextGPUs:e_,groupedPerNodeGPUs:eD,handleContextClick:eF,contextStats:W,jobsData:em,isJobsDataLoading:ec,isSSH:!1,contextWorkspaceMap:K}),eR=e||t;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,a.jsxs)("div",{className:"text-base flex items-center",children:[(0,a.jsx)(C(),{href:"/infra",className:"text-sky-blue hover:underline ".concat(ex?"":"cursor-default"),children:"Infrastructure"}),ex&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),ex.startsWith("ssh-")?(0,a.jsx)(C(),{href:"/infra",className:"text-sky-blue hover:underline cursor-pointer",children:"SSH Node Pool"}):(0,a.jsx)(C(),{href:"/infra",className:"text-sky-blue hover:underline cursor-pointer",children:"Kubernetes"}),(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,a.jsx)("span",{className:"text-sky-blue",children:ex.startsWith("ssh-")?ex.replace(/^ssh-/,""):ex})]})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[Q.length>0&&(0,a.jsxs)("div",{className:"flex items-center mr-4",children:[(0,a.jsx)("label",{htmlFor:"workspace-selector",className:"text-sm font-medium text-gray-700 mr-2",children:"Workspace:"}),(0,a.jsxs)("select",{id:"workspace-selector",value:X,onChange:e=>Y(e.target.value),className:"px-3 py-1 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-sky-blue focus:border-transparent",children:[(0,a.jsx)("option",{value:"all",children:"All Workspaces"}),Q.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]})]}),eR&&(0,a.jsxs)("div",{className:"flex items-center mr-2",children:[(0,a.jsx)(r.Z,{size:15,className:"mt-0"}),(0,a.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),(0,a.jsxs)("button",{onClick:eS,disabled:eR,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 mr-1.5"}),!p&&"Refresh"]})]})]}),(()=>{if(ex)return e&&!f?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-64",children:[(0,a.jsx)(r.Z,{size:32,className:"mb-4"}),(0,a.jsx)("span",{className:"text-gray-500 text-lg",children:"Loading Context..."})]}):eE(ex);let s=[];s.push({name:"Kubernetes",render:ez,hasActivity:eP.length>0,priority:1}),s.push({name:"Cloud",render:eH,hasActivity:L>0,priority:2}),s.push({name:"SSH Node Pool",render:eA,hasActivity:ek.length>0&&function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.some(e=>{let t=W[s?"ssh/".concat(e.replace(/^ssh-/,"")):"kubernetes/".concat(e)]||{clusters:0,jobs:0};return t.clusters>0||t.jobs>0})}(ek,!0),priority:3});let t=s.sort((e,s)=>e.hasActivity!==s.hasActivity?e.hasActivity?-1:1:e.priority-s.priority);return(0,a.jsx)(a.Fragment,{children:t.map((e,s)=>(0,a.jsx)(l.Fragment,{children:e.render()},s))})})(),(0,a.jsx)(b,{isOpen:ea,onClose:()=>el(!1),onSave:ew,poolData:er,isLoading:eo})]})}},42557:function(e,s,t){t.d(s,{I:function(){return n}});var a=t(85893),l=t(67294),r=t(32350);let n=l.forwardRef((e,s)=>{let{className:t,type:l,...n}=e;return(0,a.jsx)("input",{type:l,className:(0,r.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",t),ref:s,...n})});n.displayName="Input"},36185:function(e,s,t){t.d(s,{_:function(){return c}});var a=t(85893),l=t(67294),r=t(49102),n=t(12003),o=t(32350);let i=(0,n.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=l.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsx)(r.f,{ref:s,className:(0,o.cn)(i(),t),...l})});c.displayName=r.f.displayName},69123:function(e,s,t){t.d(s,{g:function(){return n}});var a=t(85893),l=t(67294),r=t(32350);let n=l.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsx)("textarea",{className:(0,r.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",t),ref:s,...l})});n.displayName="Textarea"},17853:function(e,s,t){t.d(s,{TO:function(){return r},ki:function(){return n}});let a=null,l=null,r=async()=>null!==a?a:l||(l=(async()=>{try{let e="".concat(window.location.origin,"/grafana"),s=await fetch("".concat(e,"/api/health"),{method:"GET",credentials:"include",headers:{Accept:"application/json"},signal:AbortSignal.timeout(5e3)});return 200==s.status}catch(e){return console.debug("Grafana availability check failed:",e),a=!1,!1}finally{l=null}})()),n=()=>"".concat(window.location.origin,"/grafana")}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3785],{42557:function(e,s,r){r.d(s,{I:function(){return l}});var t=r(85893),a=r(67294),n=r(32350);let l=a.forwardRef((e,s)=>{let{className:r,type:a,...l}=e;return(0,t.jsx)("input",{type:a,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",r),ref:s,...l})});l.displayName="Input"},36185:function(e,s,r){r.d(s,{_:function(){return c}});var t=r(85893),a=r(67294),n=r(49102),l=r(12003),o=r(32350);let i=(0,l.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=a.forwardRef((e,s)=>{let{className:r,...a}=e;return(0,t.jsx)(n.f,{ref:s,className:(0,o.cn)(i(),r),...a})});c.displayName=n.f.displayName},33785:function(e,s,r){r.r(s),r.d(s,{NewWorkspace:function(){return b}});var t=r(85893),a=r(67294),n=r(11163),l=r(41664),o=r.n(l),i=r(5152),c=r.n(i),u=r(17324),d=r(30803),f=r(42557),m=r(36185),p=r(37673);let x=c()(()=>Promise.all([r.e(616),r.e(5739),r.e(7411),r.e(1272),r.e(7359),r.e(6989),r.e(3850),r.e(8969),r.e(6135),r.e(4282),r.e(6601),r.e(3015),r.e(1141)]).then(r.bind(r,11141)).then(e=>e.WorkspaceEditor),{loadableGenerated:{webpack:()=>[11141]},ssr:!1});function b(){(0,n.useRouter)();let[e,s]=(0,a.useState)(""),[r,l]=(0,a.useState)(!1),[i,c]=(0,a.useState)({}),[b,h]=(0,a.useState)(!0);(0,a.useEffect)(()=>{v()},[]);let v=async()=>{try{let e=await (0,u.getWorkspaces)();c(e)}catch(e){console.error("Failed to fetch existing workspaces:",e)}finally{h(!1)}},k=()=>{e.trim()&&!y&&l(!0)},y=e.trim()&&i.hasOwnProperty(e.trim()),w=e.trim()&&!y;return r?(0,t.jsx)(x,{workspaceName:e,isNewWorkspace:!0}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4 h-5",children:(0,t.jsxs)("div",{className:"text-base flex items-center",children:[(0,t.jsx)(o(),{href:"/workspaces",className:"text-sky-blue hover:underline",children:"Workspaces"}),(0,t.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,t.jsx)("span",{className:"text-sky-blue",children:"New Workspace"})]})}),(0,t.jsxs)(p.Zb,{className:"max-w-md",children:[(0,t.jsx)(p.Ol,{children:(0,t.jsx)(p.ll,{className:"text-base font-normal",children:"Create New Workspace"})}),(0,t.jsxs)(p.aY,{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(m._,{htmlFor:"workspace-name",className:"text-sm font-normal",children:"Workspace name"}),(0,t.jsx)(f.I,{id:"workspace-name",value:e,onChange:e=>s(e.target.value),placeholder:"Enter workspace name",autoFocus:!0,onKeyPress:e=>{"Enter"===e.key&&w&&k()}}),y?(0,t.jsxs)("p",{className:"text-sm text-gray-500 mt-1",children:['Workspace "',e,'" already exists.'," ",(0,t.jsx)(o(),{href:"/workspaces/".concat(e),className:"text-blue-600 hover:underline",children:"View the workspace"})]}):(0,t.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Choose a unique name for your workspace"})]}),(0,t.jsx)(d.z,{onClick:k,disabled:!w||b,className:"w-full bg-sky-600 hover:bg-sky-700 text-white disabled:bg-gray-300 disabled:text-gray-500",children:b?"Loading...":"Next: Configure Workspace"})]})]})]})}},49102:function(e,s,r){r.d(s,{f:function(){return o}});var t=r(67294),a=r(75320),n=r(85893),l=t.forwardRef((e,s)=>(0,n.jsx)(a.WV.label,{...e,ref:s,onMouseDown:s=>{s.target.closest("button, input, select, textarea")||(e.onMouseDown?.(s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}}));l.displayName="Label";var o=l},12003:function(e,s,r){r.d(s,{j:function(){return l}});var t=r(90512);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=t.W,l=(e,s)=>r=>{var t;if((null==s?void 0:s.variants)==null)return n(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:l,defaultVariants:o}=s,i=Object.keys(l).map(e=>{let s=null==r?void 0:r[e],t=null==o?void 0:o[e];if(null===s)return null;let n=a(s)||a(t);return l[e][n]}),c=r&&Object.entries(r).reduce((e,s)=>{let[r,t]=s;return void 0===t||(e[r]=t),e},{});return n(e,i,null==s?void 0:null===(t=s.compoundVariants)||void 0===t?void 0:t.reduce((e,s)=>{let{class:r,className:t,...a}=s;return Object.entries(a).every(e=>{let[s,r]=e;return Array.isArray(r)?r.includes({...o,...c}[s]):({...o,...c})[s]===r})?[...e,r,t]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3785],{42557:function(e,s,r){r.d(s,{I:function(){return l}});var t=r(85893),a=r(67294),n=r(32350);let l=a.forwardRef((e,s)=>{let{className:r,type:a,...l}=e;return(0,t.jsx)("input",{type:a,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",r),ref:s,...l})});l.displayName="Input"},36185:function(e,s,r){r.d(s,{_:function(){return c}});var t=r(85893),a=r(67294),n=r(49102),l=r(12003),o=r(32350);let i=(0,l.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=a.forwardRef((e,s)=>{let{className:r,...a}=e;return(0,t.jsx)(n.f,{ref:s,className:(0,o.cn)(i(),r),...a})});c.displayName=n.f.displayName},33785:function(e,s,r){r.r(s),r.d(s,{NewWorkspace:function(){return b}});var t=r(85893),a=r(67294),n=r(11163),l=r(41664),o=r.n(l),i=r(5152),c=r.n(i),u=r(17324),d=r(30803),f=r(42557),m=r(36185),p=r(37673);let x=c()(()=>Promise.all([r.e(616),r.e(5739),r.e(7411),r.e(1272),r.e(7359),r.e(6989),r.e(3850),r.e(8969),r.e(9353),r.e(4282),r.e(6601),r.e(3015),r.e(1141)]).then(r.bind(r,11141)).then(e=>e.WorkspaceEditor),{loadableGenerated:{webpack:()=>[11141]},ssr:!1});function b(){(0,n.useRouter)();let[e,s]=(0,a.useState)(""),[r,l]=(0,a.useState)(!1),[i,c]=(0,a.useState)({}),[b,h]=(0,a.useState)(!0);(0,a.useEffect)(()=>{v()},[]);let v=async()=>{try{let e=await (0,u.getWorkspaces)();c(e)}catch(e){console.error("Failed to fetch existing workspaces:",e)}finally{h(!1)}},k=()=>{e.trim()&&!y&&l(!0)},y=e.trim()&&i.hasOwnProperty(e.trim()),w=e.trim()&&!y;return r?(0,t.jsx)(x,{workspaceName:e,isNewWorkspace:!0}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4 h-5",children:(0,t.jsxs)("div",{className:"text-base flex items-center",children:[(0,t.jsx)(o(),{href:"/workspaces",className:"text-sky-blue hover:underline",children:"Workspaces"}),(0,t.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,t.jsx)("span",{className:"text-sky-blue",children:"New Workspace"})]})}),(0,t.jsxs)(p.Zb,{className:"max-w-md",children:[(0,t.jsx)(p.Ol,{children:(0,t.jsx)(p.ll,{className:"text-base font-normal",children:"Create New Workspace"})}),(0,t.jsxs)(p.aY,{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(m._,{htmlFor:"workspace-name",className:"text-sm font-normal",children:"Workspace name"}),(0,t.jsx)(f.I,{id:"workspace-name",value:e,onChange:e=>s(e.target.value),placeholder:"Enter workspace name",autoFocus:!0,onKeyPress:e=>{"Enter"===e.key&&w&&k()}}),y?(0,t.jsxs)("p",{className:"text-sm text-gray-500 mt-1",children:['Workspace "',e,'" already exists.'," ",(0,t.jsx)(o(),{href:"/workspaces/".concat(e),className:"text-blue-600 hover:underline",children:"View the workspace"})]}):(0,t.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Choose a unique name for your workspace"})]}),(0,t.jsx)(d.z,{onClick:k,disabled:!w||b,className:"w-full bg-sky-600 hover:bg-sky-700 text-white disabled:bg-gray-300 disabled:text-gray-500",children:b?"Loading...":"Next: Configure Workspace"})]})]})]})}},49102:function(e,s,r){r.d(s,{f:function(){return o}});var t=r(67294),a=r(75320),n=r(85893),l=t.forwardRef((e,s)=>(0,n.jsx)(a.WV.label,{...e,ref:s,onMouseDown:s=>{s.target.closest("button, input, select, textarea")||(e.onMouseDown?.(s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}}));l.displayName="Label";var o=l},12003:function(e,s,r){r.d(s,{j:function(){return l}});var t=r(90512);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=t.W,l=(e,s)=>r=>{var t;if((null==s?void 0:s.variants)==null)return n(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:l,defaultVariants:o}=s,i=Object.keys(l).map(e=>{let s=null==r?void 0:r[e],t=null==o?void 0:o[e];if(null===s)return null;let n=a(s)||a(t);return l[e][n]}),c=r&&Object.entries(r).reduce((e,s)=>{let[r,t]=s;return void 0===t||(e[r]=t),e},{});return n(e,i,null==s?void 0:null===(t=s.compoundVariants)||void 0===t?void 0:t.reduce((e,s)=>{let{class:r,className:t,...a}=s;return Object.entries(a).every(e=>{let[s,r]=e;return Array.isArray(r)?r.includes({...o,...c}[s]):({...o,...c})[s]===r})?[...e,r,t]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9353],{9353:function(e,t,r){r.r(t),r.d(t,{Layout:function(){return v}});var s=r(85893),n=r(67294),a=r(66235),l=r(23001),o=r(43767),i=r(33067),c=r(26409),d=r(94849),u=r(6556);function x(){let{startTour:e}=(0,d.r)(),{shouldShowTourPrompt:t,markTourCompleted:r}=(0,u.n)(),[a,l]=(0,n.useState)(!1),[x,m]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(m(!0),t){let e=setTimeout(()=>{l(!0)},2e3);return()=>clearTimeout(e)}},[t]);let h=()=>{l(!1),r()};return x&&t&&a?(0,s.jsx)("div",{className:"fixed top-20 right-6 z-50 max-w-sm",children:(0,s.jsxs)("div",{className:"bg-white rounded-md shadow-lg border border-gray-200 p-4 transform transition-all duration-300 ease-out",children:[(0,s.jsx)("button",{onClick:h,className:"absolute top-3 right-3 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full p-1 transition-all duration-150","aria-label":"Dismiss notification",children:(0,s.jsx)(o.Z,{className:"w-3 h-3"})}),(0,s.jsxs)("div",{className:"pr-6",children:[(0,s.jsxs)("div",{className:"flex items-start mb-3",children:[(0,s.jsx)("div",{className:"flex items-center justify-center w-7 h-7 bg-blue-50 rounded-full mr-3 mt-0.5",children:(0,s.jsx)(i.Z,{className:"w-3.5 h-3.5 text-blue-600"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-gray-900 mb-1",children:"Welcome to SkyPilot!"}),(0,s.jsx)("p",{className:"text-sm text-gray-600 leading-relaxed",children:"New to the dashboard? Take a quick guided tour to discover all the features."})]})]}),(0,s.jsxs)("div",{className:"flex space-x-2 ml-10",children:[(0,s.jsxs)("button",{onClick:()=>{l(!1),e()},className:"flex items-center px-3 py-1.5 bg-blue-600 text-white text-sm font-medium rounded hover:bg-blue-700 transition-colors duration-150",children:[(0,s.jsx)(c.Z,{className:"w-3 h-3 mr-1.5"}),"Start Tour"]}),(0,s.jsx)("button",{onClick:h,className:"px-3 py-1.5 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded transition-colors duration-150",children:"Maybe Later"})]})]})]})}):null}var m=r(19185);function h(e){let{children:t,text:r}=e,[a,l]=(0,n.useState)(!1);return(0,s.jsxs)("div",{className:"relative",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[t,a&&(0,s.jsx)("div",{className:"absolute top-0 right-0 transform -translate-y-full -translate-x-2 mb-2 px-2 py-1 bg-gray-700 text-white text-xs rounded-md shadow-lg whitespace-nowrap z-50",children:r})]})}function f(){let{startTour:e}=(0,d.r)();return(0,s.jsx)(h,{text:"Start a tour",children:(0,s.jsx)("button",{onClick:e,className:"fixed bottom-4 right-4 bg-transparent text-gray-400 p-2 rounded-full hover:text-gray-500 focus:outline-none","aria-label":"Start Tour",children:(0,s.jsx)(m.Z,{className:"h-5 w-5"})})})}let p=(0,n.createContext)(void 0);function g(e){let{children:t}=e,[r,a]=(0,n.useState)(!1),l=(0,n.useCallback)(()=>{a(!0)},[]),o=(0,n.useCallback)(()=>{a(!1)},[]);return(0,s.jsx)(p.Provider,{value:{isUpgrading:r,reportUpgrade:l,clearUpgrade:o},children:t})}function b(){let e=(0,n.useContext)(p);if(!e)throw Error("useUpgradeDetection must be used within UpgradeDetectionProvider");return e}function j(){let{isUpgrading:e}=b();return e?(0,s.jsx)("div",{className:"fixed top-[56px] left-0 right-0 z-40 bg-yellow-50 border-b border-yellow-200",children:(0,s.jsx)("div",{className:"max-w-7xl mx-auto py-3 px-4 sm:px-6 lg:px-8",children:(0,s.jsx)("div",{className:"flex items-center justify-center",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsxs)("svg",{className:"h-5 w-5 text-yellow-600 mr-2 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),(0,s.jsx)("span",{className:"text-sm font-medium text-yellow-800",children:"Your SkyPilot deployment is undergoing upgrades. Refresh in a few moments."})]})})})}):null}function y(e){let{children:t,highlighted:r}=e;(0,l.X)();let{reportUpgrade:o,clearUpgrade:i,isUpgrading:c}=b();return(0,n.useEffect)(()=>{window.__upgradeInterceptorInstalled||(window.fetch=function(e,t){let r=window.fetch;return async function(s,n){let a;try{a=await r(s,n)}catch(e){throw e}try{if(function(e){let t;try{t="string"==typeof e?e:e.url}catch(e){return!1}return["/_next/static/","/_next/image",".js",".mjs",".css",".woff",".woff2",".ttf",".eot",".svg",".png",".jpg",".jpeg",".gif",".webp",".ico"].some(e=>t.includes(e))}(s))return a;if(503===a.status){let t=a.clone();try{let r=await t.json();r.detail&&(r.detail.includes("shutting down")||r.detail.includes("try again later"))&&e()}catch(e){console.debug("Non-JSON 503 response, ignoring.")}}else(a.ok||a.status>=200&&a.status<300)&&t()}catch(e){console.error("Error in upgrade detection interceptor:",e)}return a}}(o,i),window.__upgradeInterceptorInstalled=!0)},[o,i]),(0,s.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,s.jsx)("div",{className:"fixed top-0 left-0 right-0 z-50 shadow-sm",children:(0,s.jsx)(a.Du,{})}),(0,s.jsx)(j,{}),(0,s.jsx)("div",{className:"transition-all duration-200 ease-in-out min-h-screen",style:{paddingTop:c?"112px":"56px"},children:(0,s.jsx)("main",{className:"p-6",children:t})}),(0,s.jsx)(x,{}),(0,s.jsx)(f,{})]})}function v(e){return(0,s.jsx)(g,{children:(0,s.jsx)(a.Hn,{children:(0,s.jsx)(y,{...e})})})}},66235:function(e,t,r){r.d(t,{Ap:function(){return b},Du:function(){return j},Hn:function(){return g}});var s=r(85893),n=r(67294),a=r(25675),l=r.n(a),o=r(11163),i=r(41664),c=r.n(i),d=r(53850),u=r(40355),x=r(6021),m=r(93225),h=r(36989),f=r(23001);let p=(0,n.createContext)(null);function g(e){let{children:t}=e,[r,a]=(0,n.useState)(!0),[l,o]=(0,n.useState)(!1),[i,c]=(0,n.useState)(null),[d,u]=(0,n.useState)(null),x=window.location.origin,h="".concat(x).concat(m.f4);return(0,n.useEffect)(()=>{fetch("".concat(h,"/api/health")).then(e=>e.json()).then(e=>{e.user&&e.user.name&&(c(e.user.name),(async()=>{try{let e=await fetch("".concat(h,"/users/role"));if(e.ok){let t=await e.json();t.role&&u(t.role)}}catch(e){console.log("Could not fetch user role:",e)}})())}).catch(e=>{console.error("Error fetching user data:",e)})},[h]),(0,s.jsx)(p.Provider,{value:{isSidebarOpen:r,toggleSidebar:()=>{a(e=>!e)},isMobileSidebarOpen:l,toggleMobileSidebar:()=>{o(e=>!e)},userEmail:i,userRole:d},children:t})}function b(){let e=(0,n.useContext)(p);if(!e)throw Error("useSidebar must be used within a SidebarProvider");return e}function j(){let e,t;let r=(0,o.useRouter)(),a=(0,f.X)(),{userEmail:i,userRole:p,isMobileSidebarOpen:g,toggleMobileSidebar:j}=b(),[y,v]=(0,n.useState)(!1),N=(0,n.useRef)(null),w=(0,n.useRef)(null);(0,n.useEffect)(()=>{function e(e){N.current&&!N.current.contains(e.target)&&v(!1),w.current&&!w.current.contains(e.target)&&!e.target.closest(".mobile-menu-button")&&g&&j()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[N,g,j]);let k=e=>"/workspaces"===e?r.pathname.startsWith("/workspaces")||r.pathname.startsWith("/workspace"):r.pathname.startsWith(e),C=e=>{let t=k(e);return"inline-flex items-center border-b-2 ".concat(t?"border-transparent text-blue-600":"border-transparent hover:text-blue-600"," ").concat(a?"px-2 py-1":"px-1 pt-1 space-x-2")};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed top-0 left-0 right-0 bg-white z-30 h-14 px-4 border-b border-gray-200 shadow-sm",children:(0,s.jsxs)("div",{className:"flex items-center justify-between h-full",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-4 mr-4 md:mr-6",children:[a&&(0,s.jsx)("button",{onClick:j,className:"mobile-menu-button p-2 rounded-md text-gray-600 hover:text-blue-600 hover:bg-gray-100 transition-colors","aria-label":"Toggle mobile menu",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:g?"M6 18L18 6M6 6l12 12":"M4 6h16M4 12h16M4 18h16"})})}),(0,s.jsx)(c(),{href:"/",className:"flex items-center px-1 pt-1 h-full",prefetch:!1,children:(0,s.jsx)("div",{className:"h-20 w-20 flex items-center justify-center",children:(0,s.jsx)(l(),{src:"".concat(m.GW,"/skypilot.svg"),alt:"SkyPilot Logo",width:80,height:80,priority:!0,className:"w-full h-full object-contain"})})})]}),!a&&(0,s.jsxs)("div",{className:"flex items-center space-x-2 md:space-x-4 mr-6",children:[(0,s.jsxs)(c(),{href:"/clusters",className:C("/clusters"),prefetch:!1,children:[(0,s.jsx)(d.QT,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Clusters"})]}),(0,s.jsxs)(c(),{href:"/jobs",className:C("/jobs"),prefetch:!1,children:[(0,s.jsx)(d.Vp,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Jobs"})]}),(0,s.jsxs)(c(),{href:"/volumes",className:C("/volumes"),prefetch:!1,children:[(0,s.jsx)(d.eU,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Volumes"})]}),(0,s.jsx)("div",{className:"border-l border-gray-200 h-6 mx-1"}),(0,s.jsxs)(c(),{href:"/infra",className:C("/infra"),prefetch:!1,children:[(0,s.jsx)(d.PC,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Infra"})]}),(0,s.jsxs)(c(),{href:"/workspaces",className:C("/workspaces"),prefetch:!1,children:[(0,s.jsx)(d.E9,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Workspaces"})]}),(0,s.jsxs)(c(),{href:"/users",className:C("/users"),prefetch:!1,children:[(0,s.jsx)(d.oy,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Users"})]})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-1 ml-auto",children:[!a&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.WH,{content:"Documentation",className:"text-sm text-muted-foreground",children:(0,s.jsxs)("a",{href:"https://skypilot.readthedocs.io/en/latest/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-2 py-1 text-gray-600 hover:text-blue-600 transition-colors duration-150 cursor-pointer",title:"Docs",children:[(0,s.jsx)("span",{className:"mr-1",children:"Docs"}),(0,s.jsx)(d.h0,{className:"w-3.5 h-3.5"})]})}),(0,s.jsx)(h.WH,{content:"GitHub Repository",className:"text-sm text-muted-foreground",children:(0,s.jsx)("a",{href:"https://github.com/skypilot-org/skypilot",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center p-2 rounded-full text-gray-600 hover:bg-gray-100 transition-colors duration-150 cursor-pointer",title:"GitHub",children:(0,s.jsx)(d.fy,{className:"w-5 h-5"})})}),(0,s.jsx)(h.WH,{content:"Join Slack",className:"text-sm text-muted-foreground",children:(0,s.jsx)("a",{href:"https://slack.skypilot.co/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center p-2 rounded-full text-gray-600 hover:bg-gray-100 transition-colors duration-150 cursor-pointer",title:"Slack",children:(0,s.jsx)(d.mU,{className:"w-5 h-5"})})}),(0,s.jsx)(h.WH,{content:"Leave Feedback",className:"text-sm text-muted-foreground",children:(0,s.jsx)("a",{href:"https://github.com/skypilot-org/skypilot/issues/new",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center p-2 rounded-full text-gray-600 hover:bg-gray-100 transition-colors duration-150 cursor-pointer",title:"Leave Feedback",children:(0,s.jsx)(d.aD,{className:"w-5 h-5"})})}),(0,s.jsx)("div",{className:"border-l border-gray-200 h-6"}),(0,s.jsx)(h.WH,{content:"Configuration",className:"text-sm text-muted-foreground",children:(0,s.jsx)(c(),{href:"/config",className:"inline-flex items-center justify-center p-2 rounded-full transition-colors duration-150 cursor-pointer ".concat(k("/config")?"text-blue-600 hover:bg-gray-100":"text-gray-600 hover:bg-gray-100"),title:"Configuration",prefetch:!1,children:(0,s.jsx)(u.Z,{className:"w-5 h-5"})})})]}),i&&(0,s.jsxs)("div",{className:"relative",ref:N,children:[(0,s.jsx)("button",{onClick:()=>v(!y),className:"inline-flex items-center justify-center rounded-full transition-colors duration-150 cursor-pointer hover:ring-2 hover:ring-blue-200",title:"User Profile",children:(0,s.jsx)("div",{className:"".concat(a?"w-6 h-6 text-xs":"w-7 h-7 text-sm"," bg-blue-600 text-white rounded-full flex items-center justify-center font-medium hover:bg-blue-700 transition-colors"),children:i?i.includes("@")?i.split("@")[0].charAt(0).toUpperCase():i.charAt(0).toUpperCase():"?"})}),y&&(0,s.jsxs)("div",{className:"absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg z-50 border border-gray-200",children:[(e=i,t=null,i&&i.includes("@")&&(e=i.split("@")[0],t=i),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"px-4 pt-2 pb-1 text-sm font-medium text-gray-900",children:e}),t&&(0,s.jsx)("div",{className:"px-4 pt-0 pb-1 text-xs text-gray-500",children:t}),p&&(0,s.jsx)("div",{className:"px-4 pt-0 pb-2 text-xs",children:"admin"===p?(0,s.jsxs)("span",{className:"inline-flex items-center text-blue-600",children:[(0,s.jsx)(d.r7,{className:"w-3 h-3 mr-1"}),"Admin"]}):(0,s.jsxs)("span",{className:"inline-flex items-center text-gray-600",children:[(0,s.jsx)(x.Z,{className:"w-3 h-3 mr-1"}),"User"]})})]})),(0,s.jsx)("div",{className:"border-t border-gray-200 mx-1 my-1"}),(0,s.jsx)(c(),{href:"/users",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-blue-600",onClick:()=>v(!1),prefetch:!1,children:"See all users"})]})]})]})]})}),a&&(0,s.jsxs)(s.Fragment,{children:[g&&(0,s.jsx)("div",{className:"fixed top-14 left-0 right-0 bottom-0 bg-black bg-opacity-50 z-40",onClick:j}),(0,s.jsx)("div",{ref:w,className:"fixed top-14 left-0 h-[calc(100vh-56px)] w-64 bg-white border-r border-gray-200 shadow-lg z-50 transform transition-transform duration-300 ease-in-out ".concat(g?"translate-x-0":"-translate-x-full"),children:(0,s.jsx)("nav",{className:"flex-1 overflow-y-auto py-6",children:(0,s.jsxs)("div",{className:"px-4 space-y-1",children:[(0,s.jsxs)(c(),{href:"/clusters",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(k("/clusters")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:j,prefetch:!1,children:[(0,s.jsx)(d.QT,{className:"w-5 h-5 mr-3"}),"Clusters"]}),(0,s.jsxs)(c(),{href:"/jobs",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(k("/jobs")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:j,prefetch:!1,children:[(0,s.jsx)(d.Vp,{className:"w-5 h-5 mr-3"}),"Jobs"]}),(0,s.jsxs)(c(),{href:"/volumes",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(k("/volumes")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:j,prefetch:!1,children:[(0,s.jsx)(d.eU,{className:"w-5 h-5 mr-3"}),"Volumes"]}),(0,s.jsx)("div",{className:"border-t border-gray-200 my-4"}),(0,s.jsxs)(c(),{href:"/infra",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(k("/infra")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:j,prefetch:!1,children:[(0,s.jsx)(d.PC,{className:"w-5 h-5 mr-3"}),"Infra"]}),(0,s.jsxs)(c(),{href:"/workspaces",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(k("/workspaces")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:j,prefetch:!1,children:[(0,s.jsx)(d.E9,{className:"w-5 h-5 mr-3"}),"Workspaces"]}),(0,s.jsxs)(c(),{href:"/users",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(k("/users")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:j,prefetch:!1,children:[(0,s.jsx)(d.oy,{className:"w-5 h-5 mr-3"}),"Users"]}),(0,s.jsx)("div",{className:"border-t border-gray-200 my-4"}),(0,s.jsxs)("a",{href:"https://skypilot.readthedocs.io/en/latest/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-blue-600 rounded-md transition-colors",onClick:j,children:[(0,s.jsx)(d.h0,{className:"w-5 h-5 mr-3"}),"Documentation"]}),(0,s.jsxs)("a",{href:"https://github.com/skypilot-org/skypilot",target:"_blank",rel:"noopener noreferrer",className:"flex items-center px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-blue-600 rounded-md transition-colors",onClick:j,children:[(0,s.jsx)(d.fy,{className:"w-5 h-5 mr-3"}),"GitHub"]}),(0,s.jsxs)("a",{href:"https://slack.skypilot.co/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center px-4 py-3 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-blue-600 rounded-md transition-colors",onClick:j,children:[(0,s.jsx)(d.mU,{className:"w-5 h-5 mr-3"}),"Slack"]}),(0,s.jsxs)(c(),{href:"/config",className:"flex items-center px-4 py-3 text-sm font-medium rounded-md transition-colors ".concat(k("/config")?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-100 hover:text-blue-600"),onClick:j,prefetch:!1,children:[(0,s.jsx)(u.Z,{className:"w-5 h-5 mr-3"}),"Configuration"]})]})})})]})]})}},23001:function(e,t,r){r.d(t,{X:function(){return n}});var s=r(67294);function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[t,r]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let t=()=>{r(window.innerWidth<e)};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[e]),t}}}]);
@@ -31,4 +31,4 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
31
31
  H${n}\
32
32
  V${o}\
33
33
  Z\
34
- ${t}`.replace(/\s/g,"")}(l))},[i,s,r,e=>{e.stopPropagation()},l,()=>i,a,c,u,function(e){f(),e.tour.options.useModalOverlay?(function(e){let{modalOverlayOpeningPadding:t,modalOverlayOpeningRadius:n,modalOverlayOpeningXOffset:r=0,modalOverlayOpeningYOffset:i=0}=e.options,l=function(e){let t={top:0,left:0};if(!e)return t;let n=e.ownerDocument.defaultView;for(;n!==window.top;){var o,r,i;let e=null==(o=n)?void 0:o.frameElement;if(e){let n=e.getBoundingClientRect();t.top+=n.top+(null!=(r=n.scrollTop)?r:0),t.left+=n.left+(null!=(i=n.scrollLeft)?i:0)}n=n.parent}return t}(e.target),s=function e(t){if(!t)return null;let n=t instanceof HTMLElement&&window.getComputedStyle(t).overflowY;return"hidden"!==n&&"visible"!==n&&t.scrollHeight>=t.clientHeight?t:e(t.parentElement)}(e.target),a=()=>{o=void 0,u(t,n,r+l.left,i+l.top,s,e.target,e._resolvedExtraHighlightElements),o=requestAnimationFrame(a)};a(),window.addEventListener("touchmove",h,{passive:!1})}(e),d()):c()},d,function(e){e3[e?"unshift":"push"](()=>{n(0,i=e)})}]}class tZ extends tp{constructor(e){super(),tf(this,e,tX,tJ,eV,{element:0,openingProperties:4,getElement:5,closeModalOpening:6,hide:7,positionModal:8,setupForStep:9,show:10})}get getElement(){return this.$$.ctx[5]}get closeModalOpening(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}get positionModal(){return this.$$.ctx[8]}get setupForStep(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}}class tQ extends p{constructor(){super(),this.activeTour=void 0,_(this)}}class t0 extends p{constructor(e={}){return super(),this.trackedEvents=["active","cancel","complete","show"],this.classPrefix=void 0,this.currentStep=void 0,this.focusedElBeforeOpen=void 0,this.id=void 0,this.modal=void 0,this.options=void 0,this.steps=void 0,_(this),this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},e),this.classPrefix=P(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps),["active","cancel","complete","inactive","show","start"].map(e=>{(e=>{this.on(e,t=>{(t=t||{}).tour=this,t1.trigger(e,t)})})(e)}),this._setTourID(e.id),this}addStep(e,t){let n=e;return n instanceof tK?n.tour=this:n=new tK(this,n),f(t)?this.steps.push(n):this.steps.splice(t,0,n),n}addSteps(e){return Array.isArray(e)&&e.forEach(e=>{this.addStep(e)}),this}back(){let e=this.steps.indexOf(this.currentStep);this.show(e-1,!1)}async cancel(){if(this.options.confirmCancel){let e=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";(d(this.options.confirmCancel)?await this.options.confirmCancel():window.confirm(e))&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(e){return this.steps.find(t=>t.id===e)}getCurrentStep(){return this.currentStep}hide(){let e=this.getCurrentStep();if(e)return e.hide()}isActive(){return t1.activeTour===this}next(){let e=this.steps.indexOf(this.currentStep);e===this.steps.length-1?this.complete():this.show(e+1,!0)}removeStep(e){let t=this.getCurrentStep();this.steps.some((t,n)=>{if(t.id===e)return t.isOpen()&&t.hide(),t.destroy(),this.steps.splice(n,1),!0}),t&&t.id===e&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(e=0,t=!0){let n=h(e)?this.getById(e):this.steps[e];n&&(this._updateStateBeforeShow(),d(n.options.showOn)&&!n.options.showOn()?this._skipStep(n,t):(this.currentStep=n,this.trigger("show",{step:n,previous:this.currentStep}),n.show()))}async start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this.setupModal(),this._setupActiveTour(),this.next()}_done(e){let t=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach(e=>e.destroy()),!function(e){if(e){let{steps:t}=e;t.forEach(e=>{e.options&&!1===e.options.canClickTarget&&e.options.attachTo&&(u(e.target)&&e.target.classList.remove("shepherd-target-click-disabled"),e._resolvedExtraHighlightElements&&e._resolvedExtraHighlightElements.forEach(e=>{u(e)&&e.classList.remove("shepherd-target-click-disabled")}))})}}(this),this.trigger(e,{index:t}),t1.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),("cancel"===e||"complete"===e)&&this.modal){let e=document.querySelector(".shepherd-modal-overlay-container");e&&(e.remove(),this.modal=null)}u(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),t1.activeTour=this}setupModal(){this.modal=new tZ({target:this.options.modalContainer||document.body,props:{styles:this.styles}})}_skipStep(e,t){let n=this.steps.indexOf(e);n===this.steps.length-1?this.complete():this.show(t?n+1:n-1,t)}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(e){let t=this.options.tourName||"tour",n=e||L();this.id=`${t}--${n}`}}let t1=new tQ,t2="undefined"==typeof window;t1.Step=t2?C:tK,t1.Tour=t2?O:t0;var t4=n(6556);let t6=(0,a.createContext)(null);function t3(){let e=(0,a.useContext)(t6);if(!e)throw Error("useTour must be used within a TourProvider");return e}function t5(e){let{children:t}=e,n=(0,a.useRef)(null),o=(0,c.useRouter)(),{isFirstVisit:r,markTourCompleted:i}=(0,t4.n)(),[l,u]=(0,a.useState)(!1),[d,h]=(0,a.useState)(!1),[f,p]=(0,a.useState)(!1),m=(0,a.useRef)(!1),g=()=>{n.current&&(h(!0),p(!0),n.current.start(),setTimeout(()=>{p(!1)},1e3))};(0,a.useEffect)(()=>{if(!n.current){n.current=new t1.Tour({useModalOverlay:!1,defaultStepOptions:{cancelIcon:{enabled:!0},scrollTo:{behavior:"smooth",block:"center"},arrow:!1,highlightClass:"shepherd-highlight",when:{show(){var e,t,n;let o=null===(e=t1.activeTour)||void 0===e?void 0:e.getCurrentStep(),r=null==o?void 0:o.getElement(),i=null==r?void 0:r.querySelector(".shepherd-footer"),l=document.createElement("span");if(l.className="shepherd-progress",l.innerText="".concat((null===(t=t1.activeTour)||void 0===t?void 0:t.steps.indexOf(o))+1," of ").concat(null===(n=t1.activeTour)||void 0===n?void 0:n.steps.length),null==i||i.insertBefore(l,i.firstChild),r){let e=r.offsetHeight;if(document.documentElement.style.setProperty("--shepherd-dialog-height","".concat(e+20,"px")),window.innerWidth<768){let e=null;for(let t of[".fixed.top-14.left-0.w-64","div.fixed.w-64.bg-white.border-r",".fixed.w-64.transform",'[class*="fixed"][class*="w-64"][class*="bg-white"]','div[class*="fixed"][class*="top-14"][class*="left-0"][class*="w-64"]'])if(e=document.querySelector(t))break;if(!e)for(let t of document.querySelectorAll("div.fixed")){let n=t.getBoundingClientRect();if(256===n.width&&0===n.left&&n.top>=50){e=t;break}}if(e&&e instanceof HTMLElement){let t=r.getBoundingClientRect().top-56;e.style.setProperty("height","".concat(t,"px"),"important"),e.style.setProperty("max-height","".concat(t,"px"),"important")}}}let s=null==o?void 0:o.getTarget();s&&s instanceof HTMLElement&&(s.style.outline="3px solid #3b82f6",s.style.outlineOffset="2px",s.style.borderRadius="8px",s.style.position="relative",s.style.zIndex="9999",s.setAttribute("data-shepherd-highlighted","true"))},hide(){let e=document.querySelector('[data-shepherd-highlighted="true"]');e&&e instanceof HTMLElement&&(e.style.outline="",e.style.outlineOffset="",e.style.borderRadius="",e.style.boxShadow="",e.style.position="",e.style.zIndex="",e.removeAttribute("data-shepherd-highlighted")),document.documentElement.style.removeProperty("--shepherd-dialog-height");let t=document.querySelector(".fixed.top-14.left-0.w-64")||document.querySelector("div.fixed.w-64.bg-white.border-r")||document.querySelector(".fixed.w-64.transform")||document.querySelector('[class*="fixed"][class*="w-64"][class*="bg-white"]');t&&t instanceof HTMLElement&&(t.style.removeProperty("height"),t.style.removeProperty("max-height"))}}}});let e=document.createElement("style");e.id="shepherd-global-custom-style",e.textContent='\n .shepherd-element {\n /* Uniform 1px border using inner box-shadow so corners stay consistent */\n border: none !important;\n border-radius: 10px !important;\n z-index: 30000 !important;\n box-shadow: 0 0 0 1px #d1d5db inset, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;\n overflow: visible !important;\n background-clip: padding-box !important;\n }\n\n .shepherd-title {\n font-weight: bold;\n color: #111827;\n margin: 0;\n }\n\n .shepherd-element .shepherd-header {\n padding: 1rem 1rem 0.5rem 1rem;\n }\n\n .shepherd-element .shepherd-text {\n padding: 0.5rem 1rem 1rem 1rem;\n }\n\n /* Fix mobile menu gap when tour dialog is present */\n @media (max-width: 767px) {\n /* Very specific selector to override Tailwind\'s h-[calc(100vh-56px)] class */\n div.fixed.top-14.left-0.w-64.bg-white.border-r.shadow-lg.z-50.transform,\n .fixed.top-14.left-0.w-64.bg-white.shadow-lg.z-50,\n div[class*="fixed"][class*="top-14"][class*="left-0"][class*="w-64"][class*="bg-white"][class*="shadow-lg"][class*="z-50"] {\n height: calc(100vh - 56px - var(--shepherd-dialog-height, 200px)) !important;\n max-height: calc(100vh - 56px - var(--shepherd-dialog-height, 200px)) !important;\n }\n\n /* Target the mobile menu by its exact class combination from the HTML */\n .fixed.w-64.bg-white.border-r.border-gray-200.shadow-lg.z-50.transform,\n .fixed[class*="w-64"][class*="bg-white"][class*="border-r"][class*="shadow-lg"][class*="z-50"][class*="transform"] {\n height: calc(100vh - 56px - var(--shepherd-dialog-height, 200px)) !important;\n }\n\n /* Even more specific - target by multiple class combinations */\n .fixed.top-14.left-0[class*="w-64"],\n div.fixed[class*="top-14"][class*="left-0"][class*="w-64"] {\n height: calc(100vh - 56px - var(--shepherd-dialog-height, 200px)) !important;\n }\n\n /* Super aggressive approach - use high specificity to override Tailwind */\n body div.fixed.w-64:not(.shepherd-element),\n html body div.fixed.w-64:not(.shepherd-element) {\n height: calc(100vh - 56px - var(--shepherd-dialog-height, 200px)) !important;\n }\n\n /* Fallback selectors for other mobile menu patterns */\n nav[data-state="open"],\n .mobile-menu.open,\n [data-mobile-menu="true"] {\n height: calc(100vh - var(--shepherd-dialog-height, 200px)) !important;\n max-height: calc(100vh - var(--shepherd-dialog-height, 200px)) !important;\n }\n\n /* Ensure mobile menu content flows properly */\n .fixed.w-64 nav,\n .fixed[class*="w-64"] nav {\n height: 100% !important;\n overflow-y: auto !important;\n }\n }\n\n ',document.getElementById("shepherd-global-custom-style")||document.head.appendChild(e),n.current.on("complete",()=>{let e=document.querySelector('[data-shepherd-highlighted="true"]');e&&e instanceof HTMLElement&&(e.style.outline="",e.style.outlineOffset="",e.style.borderRadius="",e.style.boxShadow="",e.style.position="",e.style.zIndex="",e.removeAttribute("data-shepherd-highlighted"));let t=document.getElementById("shepherd-column-overlay");t&&t.remove();let n=document.getElementById("shepherd-column-anchor");n&&n.remove();let o=document.getElementById("shepherd-user-column-overlay");o&&o.remove();let r=document.getElementById("shepherd-user-column-anchor");r&&r.remove();let l=document.getElementById("shepherd-global-custom-style");l&&l.remove(),document.documentElement.style.removeProperty("--shepherd-dialog-height");let s=document.querySelector(".fixed.top-14.left-0.w-64")||document.querySelector("div.fixed.w-64.bg-white.border-r")||document.querySelector(".fixed.w-64.transform")||document.querySelector('[class*="fixed"][class*="w-64"][class*="bg-white"]');s&&s instanceof HTMLElement&&(s.style.removeProperty("height"),s.style.removeProperty("max-height")),h(!1),p(!1),i()}),n.current.on("cancel",()=>{let e=document.querySelector('[data-shepherd-highlighted="true"]');e&&e instanceof HTMLElement&&(e.style.outline="",e.style.outlineOffset="",e.style.borderRadius="",e.style.boxShadow="",e.style.position="",e.style.zIndex="",e.removeAttribute("data-shepherd-highlighted"));let t=document.getElementById("shepherd-column-overlay");t&&t.remove();let n=document.getElementById("shepherd-column-anchor");n&&n.remove();let o=document.getElementById("shepherd-user-column-overlay");o&&o.remove();let r=document.getElementById("shepherd-user-column-anchor");r&&r.remove();let l=document.getElementById("shepherd-global-custom-style");l&&l.remove(),document.documentElement.style.removeProperty("--shepherd-dialog-height");let s=document.querySelector(".fixed.top-14.left-0.w-64")||document.querySelector("div.fixed.w-64.bg-white.border-r")||document.querySelector(".fixed.w-64.transform")||document.querySelector('[class*="fixed"][class*="w-64"][class*="bg-white"]');s&&s instanceof HTMLElement&&(s.style.removeProperty("height"),s.style.removeProperty("max-height")),h(!1),p(!1),i()}),[{title:"\uD83D\uDC4B Welcome to SkyPilot!",text:"\n <p>SkyPilot is a system for managing AI workloads on any cluster and cloud infrastructure.</p>\n ",buttons:[{text:"Skip Tour",action(){this.cancel()},classes:"shepherd-button-secondary"},{text:"Start Tour",action(){this.next()}}]},{title:"Clusters",text:"\n <p>Spin up <strong>Sky Clusters</strong> on any infrastructure you have access to.</p>\n <p>Easily SSH into any node, connect an IDE, or queue development jobs.</p>\n ",attachTo:{element:'a[href="/dashboard/clusters"]',on:"bottom",offset:{skidding:0,distance:10}},beforeShowPromise:function(){return new Promise(e=>{let t=()=>{let t=window.innerWidth<768,n=document.querySelector('[data-testid="mobile-menu-button"], button[aria-label*="menu"], button[aria-label*="Menu"], .mobile-menu-button, [role="button"][aria-expanded]');if(t&&n&&!("true"===n.getAttribute("aria-expanded")||n.classList.contains("open")||document.querySelector('nav[data-state="open"], .mobile-menu.open, [data-mobile-menu="true"]'))){n instanceof HTMLElement&&n.click(),setTimeout(()=>{e()},300);return}e()};"/dashboard/clusters"!==o.pathname?(m.current=!0,o.push("/clusters").then(()=>{m.current=!1,setTimeout(t,200)})):t()})},when:{show(){var e,t,n;let o=null===(e=t1.activeTour)||void 0===e?void 0:e.getCurrentStep(),r=null==o?void 0:o.getElement(),i=null==r?void 0:r.querySelector(".shepherd-footer"),l=document.createElement("span");if(l.className="shepherd-progress",l.innerText="".concat((null===(t=t1.activeTour)||void 0===t?void 0:t.steps.indexOf(o))+1," of ").concat(null===(n=t1.activeTour)||void 0===n?void 0:n.steps.length),null==i||i.insertBefore(l,i.firstChild),r){let e=r.offsetHeight;if(document.documentElement.style.setProperty("--shepherd-dialog-height","".concat(e+20,"px")),window.innerWidth<768){let e=null;for(let t of[".fixed.top-14.left-0.w-64","div.fixed.w-64.bg-white.border-r",".fixed.w-64.transform",'[class*="fixed"][class*="w-64"][class*="bg-white"]','div[class*="fixed"][class*="top-14"][class*="left-0"][class*="w-64"]'])if(e=document.querySelector(t))break;if(!e)for(let t of document.querySelectorAll("div.fixed")){let n=t.getBoundingClientRect();if(256===n.width&&0===n.left&&n.top>=50){e=t;break}}if(e&&e instanceof HTMLElement){let t=r.getBoundingClientRect().top-56;e.style.setProperty("height","".concat(t,"px"),"important"),e.style.setProperty("max-height","".concat(t,"px"),"important")}}}let s=document.querySelector('a[href="/dashboard/clusters"]');s&&s instanceof HTMLElement&&(s.style.outline="3px solid #3b82f6",s.style.outlineOffset="2px",s.style.borderRadius="8px",s.style.position="relative",s.style.zIndex="9999",s.setAttribute("data-shepherd-highlighted","true"))},hide(){let e=document.querySelector('[data-shepherd-highlighted="true"]');e&&e instanceof HTMLElement&&(e.style.outline="",e.style.outlineOffset="",e.style.borderRadius="",e.style.boxShadow="",e.style.position="",e.style.zIndex="",e.removeAttribute("data-shepherd-highlighted")),document.documentElement.style.removeProperty("--shepherd-dialog-height");let t=document.querySelector(".fixed.top-14.left-0.w-64")||document.querySelector("div.fixed.w-64.bg-white.border-r")||document.querySelector(".fixed.w-64.transform")||document.querySelector('[class*="fixed"][class*="w-64"][class*="bg-white"]');t&&t instanceof HTMLElement&&(t.style.removeProperty("height"),t.style.removeProperty("max-height"))}},buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"SkyPilot is infra-agnostic",text:"\n <p>Run compute on any hyperscaler, neocloud, or Kubernetes cluster — all within a unified system.</p>\n ",attachTo:{element:function(){let e=document.getElementById("shepherd-column-anchor");if(e)return e;let t=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"Infra"===e.textContent.trim());if(t){let e=t.closest("table"),n=Array.from(t.parentElement.children).indexOf(t);if(e){let t=e.querySelectorAll("tbody tr"),o=null;for(let e=t.length-1;e>=0;e--){let r=t[e].children[n];if(r){o=r;break}}if(o)return o}return t}return document.querySelector("table")||"body"},on:"bottom",offset:{skidding:0,distance:15}},beforeShowPromise:function(){return new Promise(e=>{let t=()=>{let t=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"Infra"===e.textContent.trim());if(t&&t instanceof HTMLElement){let o=t.closest("table");if(o){let r=t.getBoundingClientRect(),i=window.innerWidth,l=o.closest('.overflow-x-auto, .overflow-auto, [style*="overflow"]')||o.parentElement;if((r.right>i||r.left<0)&&l&&l instanceof HTMLElement){let o=l.getBoundingClientRect(),i=t.offsetLeft-o.width/2+r.width/2;l.scrollTo({left:Math.max(0,i),behavior:"smooth"}),setTimeout(()=>{n(),e()},300);return}n()}}e()},n=()=>{let e=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"Infra"===e.textContent.trim());if(e&&e instanceof HTMLElement){let t=e.closest("table");if(t){let n=Array.from(e.parentElement.children).indexOf(e),o=e.getBoundingClientRect(),r=t.querySelectorAll("tbody tr"),i=o;r.forEach(e=>{let t=e.children[n];t&&(i=t.getBoundingClientRect())});let l=i.bottom+4,s=document.createElement("div");s.id="shepherd-column-anchor",s.style.position="fixed",s.style.left="".concat(o.left+o.width/2,"px"),s.style.top="".concat(l,"px"),s.style.width="1px",s.style.height="1px",s.style.zIndex="9999",s.style.pointerEvents="none",s.style.backgroundColor="transparent",s.style.transform="translate(-50%, -50%)",document.body.appendChild(s)}}};"/dashboard/clusters"!==window.location.pathname?(m.current=!0,o.push("/clusters").then(()=>{m.current=!1,setTimeout(t,200)})):t()})},when:{show(){var e,t,n;let o=null===(e=t1.activeTour)||void 0===e?void 0:e.getCurrentStep(),r=null==o?void 0:o.getElement(),i=null==r?void 0:r.querySelector(".shepherd-footer"),l=document.createElement("span");if(l.className="shepherd-progress",l.innerText="".concat((null===(t=t1.activeTour)||void 0===t?void 0:t.steps.indexOf(o))+1," of ").concat(null===(n=t1.activeTour)||void 0===n?void 0:n.steps.length),null==i||i.insertBefore(l,i.firstChild),r){let e=r.offsetHeight;if(document.documentElement.style.setProperty("--shepherd-dialog-height","".concat(e+20,"px")),window.innerWidth<768){let e=null;for(let t of[".fixed.top-14.left-0.w-64","div.fixed.w-64.bg-white.border-r",".fixed.w-64.transform",'[class*="fixed"][class*="w-64"][class*="bg-white"]','div[class*="fixed"][class*="top-14"][class*="left-0"][class*="w-64"]'])if(e=document.querySelector(t))break;if(!e)for(let t of document.querySelectorAll("div.fixed")){let n=t.getBoundingClientRect();if(256===n.width&&0===n.left&&n.top>=50){e=t;break}}if(e&&e instanceof HTMLElement){let t=r.getBoundingClientRect().top-56;e.style.setProperty("height","".concat(t,"px"),"important"),e.style.setProperty("max-height","".concat(t,"px"),"important")}}}setTimeout(()=>{let e=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"Infra"===e.textContent.trim());if(e&&e instanceof HTMLElement){let t=e.closest("table");if(t){let n=Array.from(e.parentElement.children).indexOf(e),o=e.getBoundingClientRect(),r=t.querySelectorAll("tbody tr"),i=o;r.forEach(e=>{let t=e.children[n];t&&(i=t.getBoundingClientRect())});let l=document.createElement("div");l.id="shepherd-column-overlay",l.style.position="fixed",l.style.left="".concat(o.left-4,"px"),l.style.top="".concat(o.top-4,"px"),l.style.width="".concat(o.width+8,"px"),l.style.height="".concat(i.bottom-o.top+8,"px"),l.style.outline="3px solid #3b82f6",l.style.outlineOffset="2px",l.style.borderRadius="8px",l.style.zIndex="9998",l.style.pointerEvents="none",l.style.backgroundColor="transparent",document.body.appendChild(l)}}},100)},hide(){let e=document.getElementById("shepherd-column-overlay");e&&e.remove();let t=document.getElementById("shepherd-column-anchor");t&&t.remove(),document.documentElement.style.removeProperty("--shepherd-dialog-height");let n=document.querySelector(".fixed.top-14.left-0.w-64")||document.querySelector("div.fixed.w-64.bg-white.border-r")||document.querySelector(".fixed.w-64.transform")||document.querySelector('[class*="fixed"][class*="w-64"][class*="bg-white"]');n&&n instanceof HTMLElement&&(n.style.removeProperty("height"),n.style.removeProperty("max-height"));let o=document.getElementById("shepherd-global-custom-style");o&&o.remove()}},buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"Multi-user support",text:"\n <p>SkyPilot supports multiple users in an organization.</p>\n <p>Each user can have their own clusters and jobs, with proper access controls.</p>\n ",attachTo:{element:function(){let e=document.getElementById("shepherd-user-column-anchor");if(e)return e;let t=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"User"===e.textContent.trim());if(t){let e=t.closest("table"),n=Array.from(t.parentElement.children).indexOf(t);if(e){let t=e.querySelectorAll("tbody tr"),o=null;for(let e=t.length-1;e>=0;e--){let r=t[e].children[n];if(r){o=r;break}}if(o)return o}return t}return document.querySelector("table")||"body"},on:"bottom",offset:{skidding:0,distance:15}},beforeShowPromise:function(){return new Promise(e=>{let t=()=>{let t=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"User"===e.textContent.trim());if(t&&t instanceof HTMLElement){let o=t.closest("table");if(o){let r=t.getBoundingClientRect(),i=window.innerWidth,l=o.closest('.overflow-x-auto, .overflow-auto, [style*="overflow"]')||o.parentElement;if((r.right>i||r.left<0)&&l&&l instanceof HTMLElement){let o=l.getBoundingClientRect(),i=t.offsetLeft-o.width/2+r.width/2;l.scrollTo({left:Math.max(0,i),behavior:"smooth"}),setTimeout(()=>{n(),e()},300);return}n()}}e()},n=()=>{let e=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"User"===e.textContent.trim());if(e&&e instanceof HTMLElement){let t=e.closest("table");if(t){let n=Array.from(e.parentElement.children).indexOf(e),o=e.getBoundingClientRect(),r=t.querySelectorAll("tbody tr"),i=o;r.forEach(e=>{let t=e.children[n];t&&(i=t.getBoundingClientRect())});let l=i.bottom+4,s=document.createElement("div");s.id="shepherd-user-column-anchor",s.style.position="fixed",s.style.left="".concat(o.left+o.width/2,"px"),s.style.top="".concat(l,"px"),s.style.width="1px",s.style.height="1px",s.style.zIndex="9999",s.style.pointerEvents="none",s.style.backgroundColor="transparent",s.style.transform="translate(-50%, -50%)",document.body.appendChild(s)}}};"/dashboard/clusters"!==window.location.pathname?(m.current=!0,o.push("/clusters").then(()=>{m.current=!1,setTimeout(t,200)})):t()})},when:{show(){var e,t,n;let o=null===(e=t1.activeTour)||void 0===e?void 0:e.getCurrentStep(),r=null==o?void 0:o.getElement(),i=null==r?void 0:r.querySelector(".shepherd-footer"),l=document.createElement("span");if(l.className="shepherd-progress",l.innerText="".concat((null===(t=t1.activeTour)||void 0===t?void 0:t.steps.indexOf(o))+1," of ").concat(null===(n=t1.activeTour)||void 0===n?void 0:n.steps.length),null==i||i.insertBefore(l,i.firstChild),r){let e=r.offsetHeight;if(document.documentElement.style.setProperty("--shepherd-dialog-height","".concat(e+20,"px")),window.innerWidth<768){let e=null;for(let t of[".fixed.top-14.left-0.w-64","div.fixed.w-64.bg-white.border-r",".fixed.w-64.transform",'[class*="fixed"][class*="w-64"][class*="bg-white"]','div[class*="fixed"][class*="top-14"][class*="left-0"][class*="w-64"]'])if(e=document.querySelector(t))break;if(!e)for(let t of document.querySelectorAll("div.fixed")){let n=t.getBoundingClientRect();if(256===n.width&&0===n.left&&n.top>=50){e=t;break}}if(e&&e instanceof HTMLElement){let t=r.getBoundingClientRect().top-56;e.style.setProperty("height","".concat(t,"px"),"important"),e.style.setProperty("max-height","".concat(t,"px"),"important")}}}setTimeout(()=>{let e=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"User"===e.textContent.trim());if(e&&e instanceof HTMLElement){let t=e.closest("table");if(t){let n=Array.from(e.parentElement.children).indexOf(e),o=e.getBoundingClientRect(),r=t.querySelectorAll("tbody tr"),i=o;r.forEach(e=>{let t=e.children[n];t&&(i=t.getBoundingClientRect())});let l=document.createElement("div");l.id="shepherd-user-column-overlay",l.style.position="fixed",l.style.left="".concat(o.left-4,"px"),l.style.top="".concat(o.top-4,"px"),l.style.width="".concat(o.width+8,"px"),l.style.height="".concat(i.bottom-o.top+8,"px"),l.style.outline="3px solid #3b82f6",l.style.outlineOffset="2px",l.style.borderRadius="8px",l.style.zIndex="9998",l.style.pointerEvents="none",l.style.backgroundColor="transparent",document.body.appendChild(l)}}},100)},hide(){let e=document.getElementById("shepherd-user-column-overlay");e&&e.remove();let t=document.getElementById("shepherd-user-column-anchor");t&&t.remove(),document.documentElement.style.removeProperty("--shepherd-dialog-height");let n=document.querySelector(".fixed.top-14.left-0.w-64")||document.querySelector("div.fixed.w-64.bg-white.border-r")||document.querySelector(".fixed.w-64.transform")||document.querySelector('[class*="fixed"][class*="w-64"][class*="bg-white"]');n&&n instanceof HTMLElement&&(n.style.removeProperty("height"),n.style.removeProperty("max-height"));let o=document.getElementById("shepherd-global-custom-style");o&&o.remove()}},buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"Spin up compute in seconds",text:'\n <p>Spin up clusters using the Python SDK or the CLI.</p>\n <div class="space-y-2">\n <div class="rounded-lg border text-card-foreground shadow-sm p-3 bg-gray-50">\n <div class="flex items-center justify-between">\n <pre class="text-sm w-full whitespace-pre-wrap">\n <code class="block">sky launch</code>\n </pre>\n <button class="inline-flex items-center justify-center whitespace-nowrap 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 hover:bg-accent hover:text-accent-foreground h-8 w-8 rounded-full" onclick="copyDashboardCodeBlock(this)" title="Copy to clipboard">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy h-4 w-4">\n <rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>\n <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>\n </svg>\n </button>\n </div>\n </div>\n <div class="rounded-lg border text-card-foreground shadow-sm p-3 bg-gray-50">\n <div class="flex items-center justify-between">\n <pre class="text-sm w-full whitespace-pre-wrap">\n <code class="block">sky launch --gpus L4:8</code>\n </pre>\n <button class="inline-flex items-center justify-center whitespace-nowrap 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 hover:bg-accent hover:text-accent-foreground h-8 w-8 rounded-full" onclick="copyDashboardCodeBlock(this)" title="Copy to clipboard">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy h-4 w-4">\n <rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>\n <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>\n </svg>\n </button>\n </div>\n </div>\n <div class="rounded-lg border text-card-foreground shadow-sm p-3 bg-gray-50">\n <div class="flex items-center justify-between">\n <pre class="text-sm w-full whitespace-pre-wrap">\n <code class="block">sky launch --num-nodes 10 --cpus 32+</code>\n </pre>\n <button class="inline-flex items-center justify-center whitespace-nowrap 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 hover:bg-accent hover:text-accent-foreground h-8 w-8 rounded-full" onclick="copyDashboardCodeBlock(this)" title="Copy to clipboard">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy h-4 w-4">\n <rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>\n <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>\n </svg>\n </button>\n </div>\n </div>\n </div>\n ',buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"Jobs",text:"\n <p>Use <strong>Managed Jobs</strong> for long-running workloads.</p>\n <p>They provide automatic recovery against failures, such as recovering from preemptions or transient errors.</p>\n ",attachTo:{element:function(){return document.querySelector('a[href="/dashboard/jobs"]')||document.querySelector('a[href="/dashboard/jobs"]')||'a[href="/dashboard/jobs"]'},on:"bottom",offset:{skidding:0,distance:10}},beforeShowPromise:function(){return new Promise(e=>{(()=>{let t=window.innerWidth<768,n=document.querySelector('[data-testid="mobile-menu-button"], button[aria-label*="menu"], button[aria-label*="Menu"], .mobile-menu-button, [role="button"][aria-expanded]');if(t&&n&&!("true"===n.getAttribute("aria-expanded")||n.classList.contains("open")||document.querySelector('nav[data-state="open"], .mobile-menu.open, [data-mobile-menu="true"]'))){n instanceof HTMLElement&&n.click(),setTimeout(()=>{e()},300);return}e()})()})},buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"Bring one or many infrastructure",text:"\n <p>SkyPilot combines your Kubernetes clusters, cloud VMs, or on-premise nodes into a unified compute pool.</p>\n <p>You can monitor them in this page.</p>\n ",attachTo:{element:function(){return document.querySelector('a[href="/dashboard/infra"]')||document.querySelector('a[href="/dashboard/infra"]')||'a[href="/dashboard/infra"]'},on:"bottom",offset:{skidding:0,distance:10}},beforeShowPromise:function(){return new Promise(e=>{(()=>{let t=window.innerWidth<768,n=document.querySelector('[data-testid="mobile-menu-button"], button[aria-label*="menu"], button[aria-label*="Menu"], .mobile-menu-button, [role="button"][aria-expanded]');if(t&&n&&!("true"===n.getAttribute("aria-expanded")||n.classList.contains("open")||document.querySelector('nav[data-state="open"], .mobile-menu.open, [data-mobile-menu="true"]'))){n instanceof HTMLElement&&n.click(),setTimeout(()=>{e()},300);return}e()})()})},buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"Workspaces",text:"\n <p>For team deployments, admins can use Workspaces to manage teams or projects.</p>\n ",attachTo:{element:'a[href="/dashboard/workspaces"]',on:"bottom",offset:{skidding:0,distance:10}},beforeShowPromise:function(){return new Promise(e=>{(()=>{let t=window.innerWidth<768,n=document.querySelector('[data-testid="mobile-menu-button"], button[aria-label*="menu"], button[aria-label*="Menu"], .mobile-menu-button, [role="button"][aria-expanded]');if(t&&n&&!("true"===n.getAttribute("aria-expanded")||n.classList.contains("open")||document.querySelector('nav[data-state="open"], .mobile-menu.open, [data-mobile-menu="true"]'))){n instanceof HTMLElement&&n.click(),setTimeout(()=>{e()},300);return}e()})()})},buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"Users",text:"\n <p>SkyPilot provides user management with RBAC and SSO support. Admins can manage users in this page.</p>\n ",attachTo:{element:'a[href="/dashboard/users"]',on:"bottom",offset:{skidding:0,distance:10}},beforeShowPromise:function(){return new Promise(e=>{(()=>{let t=window.innerWidth<768,n=document.querySelector('[data-testid="mobile-menu-button"], button[aria-label*="menu"], button[aria-label*="Menu"], .mobile-menu-button, [role="button"][aria-expanded]');if(t&&n&&!("true"===n.getAttribute("aria-expanded")||n.classList.contains("open")||document.querySelector('nav[data-state="open"], .mobile-menu.open, [data-mobile-menu="true"]'))){n instanceof HTMLElement&&n.click(),setTimeout(()=>{e()},300);return}e()})()})},buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"\uD83C\uDF89 Tour complete!",text:'\n <p>We invite you to to explore the rest of the dashboard.</p>\n <p>To get started with SkyPilot, refer to <a href="https://docs.skypilot.co/en/latest/getting-started/quickstart.html">Quickstart</a>. You can restart this tour by clicking the <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="inline-block h-4 w-4 align-middle"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><path d="M12 17h.01"></path></svg> icon in the bottom right corner.</p>\n <p>Have questions? Join Slack to directly chat with the SkyPilot team.</p>\n ',buttons:[{text:"Finish",action(){this.complete()},classes:"shepherd-button-secondary"},{text:"Join Slack",action(){window.open("https://slack.skypilot.co/","_blank"),this.complete()}}]}].forEach(e=>{n.current.addStep(e)})}return r&&!l&&(g(),u(!0)),()=>{n.current&&n.current.complete()}},[r]),(0,a.useEffect)(()=>{if(!d||f)return;let e=e=>{if(!m.current){if(window.confirm("The tour is currently in progress. Do you want to abort the tour and navigate away?\n\nYou can resume the tour by clicking the question mark on the bottom right."))n.current&&n.current.cancel();else throw o.events.emit("routeChangeError"),"Route change aborted by user during tour."}},t=e=>(e.preventDefault(),e.returnValue="The tour is currently in progress. Are you sure you want to leave?",e.returnValue);return o.events.on("routeChangeStart",e),window.addEventListener("beforeunload",t),()=>{o.events.off("routeChangeStart",e),window.removeEventListener("beforeunload",t)}},[d,f,o]);let y={startTour:g,completeTour:()=>{n.current&&n.current.complete(),p(!1)},tour:n.current};return(0,s.jsx)(t6.Provider,{value:y,children:t})}window.copyDashboardCodeBlock=function(e){let t=e.closest(".bg-gray-50").querySelector("pre").querySelector("code.block").textContent;navigator.clipboard.writeText(t).then(()=>{let t=e.innerHTML;e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check h-5 w-5 text-green-600"><path d="m9 12 2 2 4-4"/></svg>',setTimeout(()=>{e.innerHTML=t},2e3)})}},32586:function(e,t,n){"use strict";n.r(t);var o=n(85893),r=n(67294),i=n(5152),l=n.n(i),s=n(45697),a=n.n(s);n(36501);var c=n(93225),u=n(94849);let d=l()(()=>Promise.all([n.e(616),n.e(6130),n.e(7411),n.e(6989),n.e(3850),n.e(6135),n.e(2350)]).then(n.bind(n,6135)).then(e=>e.Layout),{loadableGenerated:{webpack:()=>[6135]},ssr:!1});function h(e){let{Component:t,pageProps:n}=e;return(0,r.useEffect)(()=>{let e=document.createElement("link");e.rel="icon",e.href="".concat(c.GW,"/favicon.ico"),document.head.appendChild(e)},[]),(0,o.jsx)(u.C,{children:(0,o.jsx)(d,{highlighted:n.highlighted,children:(0,o.jsx)(t,{...n})})})}h.propTypes={Component:a().elementType.isRequired,pageProps:a().object.isRequired},t.default=h},36501:function(){},77663:function(e){!function(){var t={229:function(e){var t,n,o,r=e.exports={};function i(){throw Error("setTimeout has not been defined")}function l(){throw Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:l}catch(e){n=l}}();var a=[],c=!1,u=-1;function d(){c&&o&&(c=!1,o.length?a=o.concat(a):u=-1,a.length&&h())}function h(){if(!c){var e=s(d);c=!0;for(var t=a.length;t;){for(o=a,a=[];++u<t;)o&&o[u].run();u=-1,t=a.length}o=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===l||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}r.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];a.push(new f(e,t)),1!==a.length||c||s(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(e){return[]},r.binding=function(e){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw Error("process.chdir is not supported")},r.umask=function(){return 0}}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}},l=!0;try{t[e](i,i.exports,o),l=!1}finally{l&&delete n[e]}return i.exports}o.ab="//";var r=o(229);e.exports=r}()},5152:function(e,t,n){e.exports=n(19606)},11163:function(e,t,n){e.exports=n(26036)},92703:function(e,t,n){"use strict";var o=n(50414);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,l){if(l!==o){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},45697:function(e,t,n){e.exports=n(92703)()},50414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[9774,179],function(){return t(91118),t(26036)}),_N_E=e.O()}]);
34
+ ${t}`.replace(/\s/g,"")}(l))},[i,s,r,e=>{e.stopPropagation()},l,()=>i,a,c,u,function(e){f(),e.tour.options.useModalOverlay?(function(e){let{modalOverlayOpeningPadding:t,modalOverlayOpeningRadius:n,modalOverlayOpeningXOffset:r=0,modalOverlayOpeningYOffset:i=0}=e.options,l=function(e){let t={top:0,left:0};if(!e)return t;let n=e.ownerDocument.defaultView;for(;n!==window.top;){var o,r,i;let e=null==(o=n)?void 0:o.frameElement;if(e){let n=e.getBoundingClientRect();t.top+=n.top+(null!=(r=n.scrollTop)?r:0),t.left+=n.left+(null!=(i=n.scrollLeft)?i:0)}n=n.parent}return t}(e.target),s=function e(t){if(!t)return null;let n=t instanceof HTMLElement&&window.getComputedStyle(t).overflowY;return"hidden"!==n&&"visible"!==n&&t.scrollHeight>=t.clientHeight?t:e(t.parentElement)}(e.target),a=()=>{o=void 0,u(t,n,r+l.left,i+l.top,s,e.target,e._resolvedExtraHighlightElements),o=requestAnimationFrame(a)};a(),window.addEventListener("touchmove",h,{passive:!1})}(e),d()):c()},d,function(e){e3[e?"unshift":"push"](()=>{n(0,i=e)})}]}class tZ extends tp{constructor(e){super(),tf(this,e,tX,tJ,eV,{element:0,openingProperties:4,getElement:5,closeModalOpening:6,hide:7,positionModal:8,setupForStep:9,show:10})}get getElement(){return this.$$.ctx[5]}get closeModalOpening(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}get positionModal(){return this.$$.ctx[8]}get setupForStep(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}}class tQ extends p{constructor(){super(),this.activeTour=void 0,_(this)}}class t0 extends p{constructor(e={}){return super(),this.trackedEvents=["active","cancel","complete","show"],this.classPrefix=void 0,this.currentStep=void 0,this.focusedElBeforeOpen=void 0,this.id=void 0,this.modal=void 0,this.options=void 0,this.steps=void 0,_(this),this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},e),this.classPrefix=P(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps),["active","cancel","complete","inactive","show","start"].map(e=>{(e=>{this.on(e,t=>{(t=t||{}).tour=this,t1.trigger(e,t)})})(e)}),this._setTourID(e.id),this}addStep(e,t){let n=e;return n instanceof tK?n.tour=this:n=new tK(this,n),f(t)?this.steps.push(n):this.steps.splice(t,0,n),n}addSteps(e){return Array.isArray(e)&&e.forEach(e=>{this.addStep(e)}),this}back(){let e=this.steps.indexOf(this.currentStep);this.show(e-1,!1)}async cancel(){if(this.options.confirmCancel){let e=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";(d(this.options.confirmCancel)?await this.options.confirmCancel():window.confirm(e))&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(e){return this.steps.find(t=>t.id===e)}getCurrentStep(){return this.currentStep}hide(){let e=this.getCurrentStep();if(e)return e.hide()}isActive(){return t1.activeTour===this}next(){let e=this.steps.indexOf(this.currentStep);e===this.steps.length-1?this.complete():this.show(e+1,!0)}removeStep(e){let t=this.getCurrentStep();this.steps.some((t,n)=>{if(t.id===e)return t.isOpen()&&t.hide(),t.destroy(),this.steps.splice(n,1),!0}),t&&t.id===e&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(e=0,t=!0){let n=h(e)?this.getById(e):this.steps[e];n&&(this._updateStateBeforeShow(),d(n.options.showOn)&&!n.options.showOn()?this._skipStep(n,t):(this.currentStep=n,this.trigger("show",{step:n,previous:this.currentStep}),n.show()))}async start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this.setupModal(),this._setupActiveTour(),this.next()}_done(e){let t=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach(e=>e.destroy()),!function(e){if(e){let{steps:t}=e;t.forEach(e=>{e.options&&!1===e.options.canClickTarget&&e.options.attachTo&&(u(e.target)&&e.target.classList.remove("shepherd-target-click-disabled"),e._resolvedExtraHighlightElements&&e._resolvedExtraHighlightElements.forEach(e=>{u(e)&&e.classList.remove("shepherd-target-click-disabled")}))})}}(this),this.trigger(e,{index:t}),t1.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),("cancel"===e||"complete"===e)&&this.modal){let e=document.querySelector(".shepherd-modal-overlay-container");e&&(e.remove(),this.modal=null)}u(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),t1.activeTour=this}setupModal(){this.modal=new tZ({target:this.options.modalContainer||document.body,props:{styles:this.styles}})}_skipStep(e,t){let n=this.steps.indexOf(e);n===this.steps.length-1?this.complete():this.show(t?n+1:n-1,t)}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(e){let t=this.options.tourName||"tour",n=e||L();this.id=`${t}--${n}`}}let t1=new tQ,t2="undefined"==typeof window;t1.Step=t2?C:tK,t1.Tour=t2?O:t0;var t4=n(6556);let t6=(0,a.createContext)(null);function t3(){let e=(0,a.useContext)(t6);if(!e)throw Error("useTour must be used within a TourProvider");return e}function t5(e){let{children:t}=e,n=(0,a.useRef)(null),o=(0,c.useRouter)(),{isFirstVisit:r,markTourCompleted:i}=(0,t4.n)(),[l,u]=(0,a.useState)(!1),[d,h]=(0,a.useState)(!1),[f,p]=(0,a.useState)(!1),m=(0,a.useRef)(!1),g=()=>{n.current&&(h(!0),p(!0),n.current.start(),setTimeout(()=>{p(!1)},1e3))};(0,a.useEffect)(()=>{if(!n.current){n.current=new t1.Tour({useModalOverlay:!1,defaultStepOptions:{cancelIcon:{enabled:!0},scrollTo:{behavior:"smooth",block:"center"},arrow:!1,highlightClass:"shepherd-highlight",when:{show(){var e,t,n;let o=null===(e=t1.activeTour)||void 0===e?void 0:e.getCurrentStep(),r=null==o?void 0:o.getElement(),i=null==r?void 0:r.querySelector(".shepherd-footer"),l=document.createElement("span");if(l.className="shepherd-progress",l.innerText="".concat((null===(t=t1.activeTour)||void 0===t?void 0:t.steps.indexOf(o))+1," of ").concat(null===(n=t1.activeTour)||void 0===n?void 0:n.steps.length),null==i||i.insertBefore(l,i.firstChild),r){let e=r.offsetHeight;if(document.documentElement.style.setProperty("--shepherd-dialog-height","".concat(e+20,"px")),window.innerWidth<768){let e=null;for(let t of[".fixed.top-14.left-0.w-64","div.fixed.w-64.bg-white.border-r",".fixed.w-64.transform",'[class*="fixed"][class*="w-64"][class*="bg-white"]','div[class*="fixed"][class*="top-14"][class*="left-0"][class*="w-64"]'])if(e=document.querySelector(t))break;if(!e)for(let t of document.querySelectorAll("div.fixed")){let n=t.getBoundingClientRect();if(256===n.width&&0===n.left&&n.top>=50){e=t;break}}if(e&&e instanceof HTMLElement){let t=r.getBoundingClientRect().top-56;e.style.setProperty("height","".concat(t,"px"),"important"),e.style.setProperty("max-height","".concat(t,"px"),"important")}}}let s=null==o?void 0:o.getTarget();s&&s instanceof HTMLElement&&(s.style.outline="3px solid #3b82f6",s.style.outlineOffset="2px",s.style.borderRadius="8px",s.style.position="relative",s.style.zIndex="9999",s.setAttribute("data-shepherd-highlighted","true"))},hide(){let e=document.querySelector('[data-shepherd-highlighted="true"]');e&&e instanceof HTMLElement&&(e.style.outline="",e.style.outlineOffset="",e.style.borderRadius="",e.style.boxShadow="",e.style.position="",e.style.zIndex="",e.removeAttribute("data-shepherd-highlighted")),document.documentElement.style.removeProperty("--shepherd-dialog-height");let t=document.querySelector(".fixed.top-14.left-0.w-64")||document.querySelector("div.fixed.w-64.bg-white.border-r")||document.querySelector(".fixed.w-64.transform")||document.querySelector('[class*="fixed"][class*="w-64"][class*="bg-white"]');t&&t instanceof HTMLElement&&(t.style.removeProperty("height"),t.style.removeProperty("max-height"))}}}});let e=document.createElement("style");e.id="shepherd-global-custom-style",e.textContent='\n .shepherd-element {\n /* Uniform 1px border using inner box-shadow so corners stay consistent */\n border: none !important;\n border-radius: 10px !important;\n z-index: 30000 !important;\n box-shadow: 0 0 0 1px #d1d5db inset, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;\n overflow: visible !important;\n background-clip: padding-box !important;\n }\n\n .shepherd-title {\n font-weight: bold;\n color: #111827;\n margin: 0;\n }\n\n .shepherd-element .shepherd-header {\n padding: 1rem 1rem 0.5rem 1rem;\n }\n\n .shepherd-element .shepherd-text {\n padding: 0.5rem 1rem 1rem 1rem;\n }\n\n /* Fix mobile menu gap when tour dialog is present */\n @media (max-width: 767px) {\n /* Very specific selector to override Tailwind\'s h-[calc(100vh-56px)] class */\n div.fixed.top-14.left-0.w-64.bg-white.border-r.shadow-lg.z-50.transform,\n .fixed.top-14.left-0.w-64.bg-white.shadow-lg.z-50,\n div[class*="fixed"][class*="top-14"][class*="left-0"][class*="w-64"][class*="bg-white"][class*="shadow-lg"][class*="z-50"] {\n height: calc(100vh - 56px - var(--shepherd-dialog-height, 200px)) !important;\n max-height: calc(100vh - 56px - var(--shepherd-dialog-height, 200px)) !important;\n }\n\n /* Target the mobile menu by its exact class combination from the HTML */\n .fixed.w-64.bg-white.border-r.border-gray-200.shadow-lg.z-50.transform,\n .fixed[class*="w-64"][class*="bg-white"][class*="border-r"][class*="shadow-lg"][class*="z-50"][class*="transform"] {\n height: calc(100vh - 56px - var(--shepherd-dialog-height, 200px)) !important;\n }\n\n /* Even more specific - target by multiple class combinations */\n .fixed.top-14.left-0[class*="w-64"],\n div.fixed[class*="top-14"][class*="left-0"][class*="w-64"] {\n height: calc(100vh - 56px - var(--shepherd-dialog-height, 200px)) !important;\n }\n\n /* Super aggressive approach - use high specificity to override Tailwind */\n body div.fixed.w-64:not(.shepherd-element),\n html body div.fixed.w-64:not(.shepherd-element) {\n height: calc(100vh - 56px - var(--shepherd-dialog-height, 200px)) !important;\n }\n\n /* Fallback selectors for other mobile menu patterns */\n nav[data-state="open"],\n .mobile-menu.open,\n [data-mobile-menu="true"] {\n height: calc(100vh - var(--shepherd-dialog-height, 200px)) !important;\n max-height: calc(100vh - var(--shepherd-dialog-height, 200px)) !important;\n }\n\n /* Ensure mobile menu content flows properly */\n .fixed.w-64 nav,\n .fixed[class*="w-64"] nav {\n height: 100% !important;\n overflow-y: auto !important;\n }\n }\n\n ',document.getElementById("shepherd-global-custom-style")||document.head.appendChild(e),n.current.on("complete",()=>{let e=document.querySelector('[data-shepherd-highlighted="true"]');e&&e instanceof HTMLElement&&(e.style.outline="",e.style.outlineOffset="",e.style.borderRadius="",e.style.boxShadow="",e.style.position="",e.style.zIndex="",e.removeAttribute("data-shepherd-highlighted"));let t=document.getElementById("shepherd-column-overlay");t&&t.remove();let n=document.getElementById("shepherd-column-anchor");n&&n.remove();let o=document.getElementById("shepherd-user-column-overlay");o&&o.remove();let r=document.getElementById("shepherd-user-column-anchor");r&&r.remove();let l=document.getElementById("shepherd-global-custom-style");l&&l.remove(),document.documentElement.style.removeProperty("--shepherd-dialog-height");let s=document.querySelector(".fixed.top-14.left-0.w-64")||document.querySelector("div.fixed.w-64.bg-white.border-r")||document.querySelector(".fixed.w-64.transform")||document.querySelector('[class*="fixed"][class*="w-64"][class*="bg-white"]');s&&s instanceof HTMLElement&&(s.style.removeProperty("height"),s.style.removeProperty("max-height")),h(!1),p(!1),i()}),n.current.on("cancel",()=>{let e=document.querySelector('[data-shepherd-highlighted="true"]');e&&e instanceof HTMLElement&&(e.style.outline="",e.style.outlineOffset="",e.style.borderRadius="",e.style.boxShadow="",e.style.position="",e.style.zIndex="",e.removeAttribute("data-shepherd-highlighted"));let t=document.getElementById("shepherd-column-overlay");t&&t.remove();let n=document.getElementById("shepherd-column-anchor");n&&n.remove();let o=document.getElementById("shepherd-user-column-overlay");o&&o.remove();let r=document.getElementById("shepherd-user-column-anchor");r&&r.remove();let l=document.getElementById("shepherd-global-custom-style");l&&l.remove(),document.documentElement.style.removeProperty("--shepherd-dialog-height");let s=document.querySelector(".fixed.top-14.left-0.w-64")||document.querySelector("div.fixed.w-64.bg-white.border-r")||document.querySelector(".fixed.w-64.transform")||document.querySelector('[class*="fixed"][class*="w-64"][class*="bg-white"]');s&&s instanceof HTMLElement&&(s.style.removeProperty("height"),s.style.removeProperty("max-height")),h(!1),p(!1),i()}),[{title:"\uD83D\uDC4B Welcome to SkyPilot!",text:"\n <p>SkyPilot is a system for managing AI workloads on any cluster and cloud infrastructure.</p>\n ",buttons:[{text:"Skip Tour",action(){this.cancel()},classes:"shepherd-button-secondary"},{text:"Start Tour",action(){this.next()}}]},{title:"Clusters",text:"\n <p>Spin up <strong>Sky Clusters</strong> on any infrastructure you have access to.</p>\n <p>Easily SSH into any node, connect an IDE, or queue development jobs.</p>\n ",attachTo:{element:'a[href="/dashboard/clusters"]',on:"bottom",offset:{skidding:0,distance:10}},beforeShowPromise:function(){return new Promise(e=>{let t=()=>{let t=window.innerWidth<768,n=document.querySelector('[data-testid="mobile-menu-button"], button[aria-label*="menu"], button[aria-label*="Menu"], .mobile-menu-button, [role="button"][aria-expanded]');if(t&&n&&!("true"===n.getAttribute("aria-expanded")||n.classList.contains("open")||document.querySelector('nav[data-state="open"], .mobile-menu.open, [data-mobile-menu="true"]'))){n instanceof HTMLElement&&n.click(),setTimeout(()=>{e()},300);return}e()};"/dashboard/clusters"!==o.pathname?(m.current=!0,o.push("/clusters").then(()=>{m.current=!1,setTimeout(t,200)})):t()})},when:{show(){var e,t,n;let o=null===(e=t1.activeTour)||void 0===e?void 0:e.getCurrentStep(),r=null==o?void 0:o.getElement(),i=null==r?void 0:r.querySelector(".shepherd-footer"),l=document.createElement("span");if(l.className="shepherd-progress",l.innerText="".concat((null===(t=t1.activeTour)||void 0===t?void 0:t.steps.indexOf(o))+1," of ").concat(null===(n=t1.activeTour)||void 0===n?void 0:n.steps.length),null==i||i.insertBefore(l,i.firstChild),r){let e=r.offsetHeight;if(document.documentElement.style.setProperty("--shepherd-dialog-height","".concat(e+20,"px")),window.innerWidth<768){let e=null;for(let t of[".fixed.top-14.left-0.w-64","div.fixed.w-64.bg-white.border-r",".fixed.w-64.transform",'[class*="fixed"][class*="w-64"][class*="bg-white"]','div[class*="fixed"][class*="top-14"][class*="left-0"][class*="w-64"]'])if(e=document.querySelector(t))break;if(!e)for(let t of document.querySelectorAll("div.fixed")){let n=t.getBoundingClientRect();if(256===n.width&&0===n.left&&n.top>=50){e=t;break}}if(e&&e instanceof HTMLElement){let t=r.getBoundingClientRect().top-56;e.style.setProperty("height","".concat(t,"px"),"important"),e.style.setProperty("max-height","".concat(t,"px"),"important")}}}let s=document.querySelector('a[href="/dashboard/clusters"]');s&&s instanceof HTMLElement&&(s.style.outline="3px solid #3b82f6",s.style.outlineOffset="2px",s.style.borderRadius="8px",s.style.position="relative",s.style.zIndex="9999",s.setAttribute("data-shepherd-highlighted","true"))},hide(){let e=document.querySelector('[data-shepherd-highlighted="true"]');e&&e instanceof HTMLElement&&(e.style.outline="",e.style.outlineOffset="",e.style.borderRadius="",e.style.boxShadow="",e.style.position="",e.style.zIndex="",e.removeAttribute("data-shepherd-highlighted")),document.documentElement.style.removeProperty("--shepherd-dialog-height");let t=document.querySelector(".fixed.top-14.left-0.w-64")||document.querySelector("div.fixed.w-64.bg-white.border-r")||document.querySelector(".fixed.w-64.transform")||document.querySelector('[class*="fixed"][class*="w-64"][class*="bg-white"]');t&&t instanceof HTMLElement&&(t.style.removeProperty("height"),t.style.removeProperty("max-height"))}},buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"SkyPilot is infra-agnostic",text:"\n <p>Run compute on any hyperscaler, neocloud, or Kubernetes cluster — all within a unified system.</p>\n ",attachTo:{element:function(){let e=document.getElementById("shepherd-column-anchor");if(e)return e;let t=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"Infra"===e.textContent.trim());if(t){let e=t.closest("table"),n=Array.from(t.parentElement.children).indexOf(t);if(e){let t=e.querySelectorAll("tbody tr"),o=null;for(let e=t.length-1;e>=0;e--){let r=t[e].children[n];if(r){o=r;break}}if(o)return o}return t}return document.querySelector("table")||"body"},on:"bottom",offset:{skidding:0,distance:15}},beforeShowPromise:function(){return new Promise(e=>{let t=()=>{let t=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"Infra"===e.textContent.trim());if(t&&t instanceof HTMLElement){let o=t.closest("table");if(o){let r=t.getBoundingClientRect(),i=window.innerWidth,l=o.closest('.overflow-x-auto, .overflow-auto, [style*="overflow"]')||o.parentElement;if((r.right>i||r.left<0)&&l&&l instanceof HTMLElement){let o=l.getBoundingClientRect(),i=t.offsetLeft-o.width/2+r.width/2;l.scrollTo({left:Math.max(0,i),behavior:"smooth"}),setTimeout(()=>{n(),e()},300);return}n()}}e()},n=()=>{let e=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"Infra"===e.textContent.trim());if(e&&e instanceof HTMLElement){let t=e.closest("table");if(t){let n=Array.from(e.parentElement.children).indexOf(e),o=e.getBoundingClientRect(),r=t.querySelectorAll("tbody tr"),i=o;r.forEach(e=>{let t=e.children[n];t&&(i=t.getBoundingClientRect())});let l=i.bottom+4,s=document.createElement("div");s.id="shepherd-column-anchor",s.style.position="fixed",s.style.left="".concat(o.left+o.width/2,"px"),s.style.top="".concat(l,"px"),s.style.width="1px",s.style.height="1px",s.style.zIndex="9999",s.style.pointerEvents="none",s.style.backgroundColor="transparent",s.style.transform="translate(-50%, -50%)",document.body.appendChild(s)}}};"/dashboard/clusters"!==window.location.pathname?(m.current=!0,o.push("/clusters").then(()=>{m.current=!1,setTimeout(t,200)})):t()})},when:{show(){var e,t,n;let o=null===(e=t1.activeTour)||void 0===e?void 0:e.getCurrentStep(),r=null==o?void 0:o.getElement(),i=null==r?void 0:r.querySelector(".shepherd-footer"),l=document.createElement("span");if(l.className="shepherd-progress",l.innerText="".concat((null===(t=t1.activeTour)||void 0===t?void 0:t.steps.indexOf(o))+1," of ").concat(null===(n=t1.activeTour)||void 0===n?void 0:n.steps.length),null==i||i.insertBefore(l,i.firstChild),r){let e=r.offsetHeight;if(document.documentElement.style.setProperty("--shepherd-dialog-height","".concat(e+20,"px")),window.innerWidth<768){let e=null;for(let t of[".fixed.top-14.left-0.w-64","div.fixed.w-64.bg-white.border-r",".fixed.w-64.transform",'[class*="fixed"][class*="w-64"][class*="bg-white"]','div[class*="fixed"][class*="top-14"][class*="left-0"][class*="w-64"]'])if(e=document.querySelector(t))break;if(!e)for(let t of document.querySelectorAll("div.fixed")){let n=t.getBoundingClientRect();if(256===n.width&&0===n.left&&n.top>=50){e=t;break}}if(e&&e instanceof HTMLElement){let t=r.getBoundingClientRect().top-56;e.style.setProperty("height","".concat(t,"px"),"important"),e.style.setProperty("max-height","".concat(t,"px"),"important")}}}setTimeout(()=>{let e=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"Infra"===e.textContent.trim());if(e&&e instanceof HTMLElement){let t=e.closest("table");if(t){let n=Array.from(e.parentElement.children).indexOf(e),o=e.getBoundingClientRect(),r=t.querySelectorAll("tbody tr"),i=o;r.forEach(e=>{let t=e.children[n];t&&(i=t.getBoundingClientRect())});let l=document.createElement("div");l.id="shepherd-column-overlay",l.style.position="fixed",l.style.left="".concat(o.left-4,"px"),l.style.top="".concat(o.top-4,"px"),l.style.width="".concat(o.width+8,"px"),l.style.height="".concat(i.bottom-o.top+8,"px"),l.style.outline="3px solid #3b82f6",l.style.outlineOffset="2px",l.style.borderRadius="8px",l.style.zIndex="9998",l.style.pointerEvents="none",l.style.backgroundColor="transparent",document.body.appendChild(l)}}},100)},hide(){let e=document.getElementById("shepherd-column-overlay");e&&e.remove();let t=document.getElementById("shepherd-column-anchor");t&&t.remove(),document.documentElement.style.removeProperty("--shepherd-dialog-height");let n=document.querySelector(".fixed.top-14.left-0.w-64")||document.querySelector("div.fixed.w-64.bg-white.border-r")||document.querySelector(".fixed.w-64.transform")||document.querySelector('[class*="fixed"][class*="w-64"][class*="bg-white"]');n&&n instanceof HTMLElement&&(n.style.removeProperty("height"),n.style.removeProperty("max-height"));let o=document.getElementById("shepherd-global-custom-style");o&&o.remove()}},buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"Multi-user support",text:"\n <p>SkyPilot supports multiple users in an organization.</p>\n <p>Each user can have their own clusters and jobs, with proper access controls.</p>\n ",attachTo:{element:function(){let e=document.getElementById("shepherd-user-column-anchor");if(e)return e;let t=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"User"===e.textContent.trim());if(t){let e=t.closest("table"),n=Array.from(t.parentElement.children).indexOf(t);if(e){let t=e.querySelectorAll("tbody tr"),o=null;for(let e=t.length-1;e>=0;e--){let r=t[e].children[n];if(r){o=r;break}}if(o)return o}return t}return document.querySelector("table")||"body"},on:"bottom",offset:{skidding:0,distance:15}},beforeShowPromise:function(){return new Promise(e=>{let t=()=>{let t=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"User"===e.textContent.trim());if(t&&t instanceof HTMLElement){let o=t.closest("table");if(o){let r=t.getBoundingClientRect(),i=window.innerWidth,l=o.closest('.overflow-x-auto, .overflow-auto, [style*="overflow"]')||o.parentElement;if((r.right>i||r.left<0)&&l&&l instanceof HTMLElement){let o=l.getBoundingClientRect(),i=t.offsetLeft-o.width/2+r.width/2;l.scrollTo({left:Math.max(0,i),behavior:"smooth"}),setTimeout(()=>{n(),e()},300);return}n()}}e()},n=()=>{let e=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"User"===e.textContent.trim());if(e&&e instanceof HTMLElement){let t=e.closest("table");if(t){let n=Array.from(e.parentElement.children).indexOf(e),o=e.getBoundingClientRect(),r=t.querySelectorAll("tbody tr"),i=o;r.forEach(e=>{let t=e.children[n];t&&(i=t.getBoundingClientRect())});let l=i.bottom+4,s=document.createElement("div");s.id="shepherd-user-column-anchor",s.style.position="fixed",s.style.left="".concat(o.left+o.width/2,"px"),s.style.top="".concat(l,"px"),s.style.width="1px",s.style.height="1px",s.style.zIndex="9999",s.style.pointerEvents="none",s.style.backgroundColor="transparent",s.style.transform="translate(-50%, -50%)",document.body.appendChild(s)}}};"/dashboard/clusters"!==window.location.pathname?(m.current=!0,o.push("/clusters").then(()=>{m.current=!1,setTimeout(t,200)})):t()})},when:{show(){var e,t,n;let o=null===(e=t1.activeTour)||void 0===e?void 0:e.getCurrentStep(),r=null==o?void 0:o.getElement(),i=null==r?void 0:r.querySelector(".shepherd-footer"),l=document.createElement("span");if(l.className="shepherd-progress",l.innerText="".concat((null===(t=t1.activeTour)||void 0===t?void 0:t.steps.indexOf(o))+1," of ").concat(null===(n=t1.activeTour)||void 0===n?void 0:n.steps.length),null==i||i.insertBefore(l,i.firstChild),r){let e=r.offsetHeight;if(document.documentElement.style.setProperty("--shepherd-dialog-height","".concat(e+20,"px")),window.innerWidth<768){let e=null;for(let t of[".fixed.top-14.left-0.w-64","div.fixed.w-64.bg-white.border-r",".fixed.w-64.transform",'[class*="fixed"][class*="w-64"][class*="bg-white"]','div[class*="fixed"][class*="top-14"][class*="left-0"][class*="w-64"]'])if(e=document.querySelector(t))break;if(!e)for(let t of document.querySelectorAll("div.fixed")){let n=t.getBoundingClientRect();if(256===n.width&&0===n.left&&n.top>=50){e=t;break}}if(e&&e instanceof HTMLElement){let t=r.getBoundingClientRect().top-56;e.style.setProperty("height","".concat(t,"px"),"important"),e.style.setProperty("max-height","".concat(t,"px"),"important")}}}setTimeout(()=>{let e=Array.from(document.querySelectorAll("thead th")).find(e=>e.textContent&&"User"===e.textContent.trim());if(e&&e instanceof HTMLElement){let t=e.closest("table");if(t){let n=Array.from(e.parentElement.children).indexOf(e),o=e.getBoundingClientRect(),r=t.querySelectorAll("tbody tr"),i=o;r.forEach(e=>{let t=e.children[n];t&&(i=t.getBoundingClientRect())});let l=document.createElement("div");l.id="shepherd-user-column-overlay",l.style.position="fixed",l.style.left="".concat(o.left-4,"px"),l.style.top="".concat(o.top-4,"px"),l.style.width="".concat(o.width+8,"px"),l.style.height="".concat(i.bottom-o.top+8,"px"),l.style.outline="3px solid #3b82f6",l.style.outlineOffset="2px",l.style.borderRadius="8px",l.style.zIndex="9998",l.style.pointerEvents="none",l.style.backgroundColor="transparent",document.body.appendChild(l)}}},100)},hide(){let e=document.getElementById("shepherd-user-column-overlay");e&&e.remove();let t=document.getElementById("shepherd-user-column-anchor");t&&t.remove(),document.documentElement.style.removeProperty("--shepherd-dialog-height");let n=document.querySelector(".fixed.top-14.left-0.w-64")||document.querySelector("div.fixed.w-64.bg-white.border-r")||document.querySelector(".fixed.w-64.transform")||document.querySelector('[class*="fixed"][class*="w-64"][class*="bg-white"]');n&&n instanceof HTMLElement&&(n.style.removeProperty("height"),n.style.removeProperty("max-height"));let o=document.getElementById("shepherd-global-custom-style");o&&o.remove()}},buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"Spin up compute in seconds",text:'\n <p>Spin up clusters using the Python SDK or the CLI.</p>\n <div class="space-y-2">\n <div class="rounded-lg border text-card-foreground shadow-sm p-3 bg-gray-50">\n <div class="flex items-center justify-between">\n <pre class="text-sm w-full whitespace-pre-wrap">\n <code class="block">sky launch</code>\n </pre>\n <button class="inline-flex items-center justify-center whitespace-nowrap 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 hover:bg-accent hover:text-accent-foreground h-8 w-8 rounded-full" onclick="copyDashboardCodeBlock(this)" title="Copy to clipboard">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy h-4 w-4">\n <rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>\n <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>\n </svg>\n </button>\n </div>\n </div>\n <div class="rounded-lg border text-card-foreground shadow-sm p-3 bg-gray-50">\n <div class="flex items-center justify-between">\n <pre class="text-sm w-full whitespace-pre-wrap">\n <code class="block">sky launch --gpus L4:8</code>\n </pre>\n <button class="inline-flex items-center justify-center whitespace-nowrap 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 hover:bg-accent hover:text-accent-foreground h-8 w-8 rounded-full" onclick="copyDashboardCodeBlock(this)" title="Copy to clipboard">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy h-4 w-4">\n <rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>\n <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>\n </svg>\n </button>\n </div>\n </div>\n <div class="rounded-lg border text-card-foreground shadow-sm p-3 bg-gray-50">\n <div class="flex items-center justify-between">\n <pre class="text-sm w-full whitespace-pre-wrap">\n <code class="block">sky launch --num-nodes 10 --cpus 32+</code>\n </pre>\n <button class="inline-flex items-center justify-center whitespace-nowrap 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 hover:bg-accent hover:text-accent-foreground h-8 w-8 rounded-full" onclick="copyDashboardCodeBlock(this)" title="Copy to clipboard">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-copy h-4 w-4">\n <rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>\n <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>\n </svg>\n </button>\n </div>\n </div>\n </div>\n ',buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"Jobs",text:"\n <p>Use <strong>Managed Jobs</strong> for long-running workloads.</p>\n <p>They provide automatic recovery against failures, such as recovering from preemptions or transient errors.</p>\n ",attachTo:{element:function(){return document.querySelector('a[href="/dashboard/jobs"]')||document.querySelector('a[href="/dashboard/jobs"]')||'a[href="/dashboard/jobs"]'},on:"bottom",offset:{skidding:0,distance:10}},beforeShowPromise:function(){return new Promise(e=>{(()=>{let t=window.innerWidth<768,n=document.querySelector('[data-testid="mobile-menu-button"], button[aria-label*="menu"], button[aria-label*="Menu"], .mobile-menu-button, [role="button"][aria-expanded]');if(t&&n&&!("true"===n.getAttribute("aria-expanded")||n.classList.contains("open")||document.querySelector('nav[data-state="open"], .mobile-menu.open, [data-mobile-menu="true"]'))){n instanceof HTMLElement&&n.click(),setTimeout(()=>{e()},300);return}e()})()})},buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"Bring one or many infrastructure",text:"\n <p>SkyPilot combines your Kubernetes clusters, cloud VMs, or on-premise nodes into a unified compute pool.</p>\n <p>You can monitor them in this page.</p>\n ",attachTo:{element:function(){return document.querySelector('a[href="/dashboard/infra"]')||document.querySelector('a[href="/dashboard/infra"]')||'a[href="/dashboard/infra"]'},on:"bottom",offset:{skidding:0,distance:10}},beforeShowPromise:function(){return new Promise(e=>{(()=>{let t=window.innerWidth<768,n=document.querySelector('[data-testid="mobile-menu-button"], button[aria-label*="menu"], button[aria-label*="Menu"], .mobile-menu-button, [role="button"][aria-expanded]');if(t&&n&&!("true"===n.getAttribute("aria-expanded")||n.classList.contains("open")||document.querySelector('nav[data-state="open"], .mobile-menu.open, [data-mobile-menu="true"]'))){n instanceof HTMLElement&&n.click(),setTimeout(()=>{e()},300);return}e()})()})},buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"Workspaces",text:"\n <p>For team deployments, admins can use Workspaces to manage teams or projects.</p>\n ",attachTo:{element:'a[href="/dashboard/workspaces"]',on:"bottom",offset:{skidding:0,distance:10}},beforeShowPromise:function(){return new Promise(e=>{(()=>{let t=window.innerWidth<768,n=document.querySelector('[data-testid="mobile-menu-button"], button[aria-label*="menu"], button[aria-label*="Menu"], .mobile-menu-button, [role="button"][aria-expanded]');if(t&&n&&!("true"===n.getAttribute("aria-expanded")||n.classList.contains("open")||document.querySelector('nav[data-state="open"], .mobile-menu.open, [data-mobile-menu="true"]'))){n instanceof HTMLElement&&n.click(),setTimeout(()=>{e()},300);return}e()})()})},buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"Users",text:"\n <p>SkyPilot provides user management with RBAC and SSO support. Admins can manage users in this page.</p>\n ",attachTo:{element:'a[href="/dashboard/users"]',on:"bottom",offset:{skidding:0,distance:10}},beforeShowPromise:function(){return new Promise(e=>{(()=>{let t=window.innerWidth<768,n=document.querySelector('[data-testid="mobile-menu-button"], button[aria-label*="menu"], button[aria-label*="Menu"], .mobile-menu-button, [role="button"][aria-expanded]');if(t&&n&&!("true"===n.getAttribute("aria-expanded")||n.classList.contains("open")||document.querySelector('nav[data-state="open"], .mobile-menu.open, [data-mobile-menu="true"]'))){n instanceof HTMLElement&&n.click(),setTimeout(()=>{e()},300);return}e()})()})},buttons:[{text:"Back",action(){this.back()},classes:"shepherd-button-secondary"},{text:"Next",action(){this.next()}}]},{title:"\uD83C\uDF89 Tour complete!",text:'\n <p>We invite you to to explore the rest of the dashboard.</p>\n <p>To get started with SkyPilot, refer to <a href="https://docs.skypilot.co/en/latest/getting-started/quickstart.html">Quickstart</a>. You can restart this tour by clicking the <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="inline-block h-4 w-4 align-middle"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><path d="M12 17h.01"></path></svg> icon in the bottom right corner.</p>\n <p>Have questions? Join Slack to directly chat with the SkyPilot team.</p>\n ',buttons:[{text:"Finish",action(){this.complete()},classes:"shepherd-button-secondary"},{text:"Join Slack",action(){window.open("https://slack.skypilot.co/","_blank"),this.complete()}}]}].forEach(e=>{n.current.addStep(e)})}return r&&!l&&(g(),u(!0)),()=>{n.current&&n.current.complete()}},[r]),(0,a.useEffect)(()=>{if(!d||f)return;let e=e=>{if(!m.current){if(window.confirm("The tour is currently in progress. Do you want to abort the tour and navigate away?\n\nYou can resume the tour by clicking the question mark on the bottom right."))n.current&&n.current.cancel();else throw o.events.emit("routeChangeError"),"Route change aborted by user during tour."}},t=e=>(e.preventDefault(),e.returnValue="The tour is currently in progress. Are you sure you want to leave?",e.returnValue);return o.events.on("routeChangeStart",e),window.addEventListener("beforeunload",t),()=>{o.events.off("routeChangeStart",e),window.removeEventListener("beforeunload",t)}},[d,f,o]);let y={startTour:g,completeTour:()=>{n.current&&n.current.complete(),p(!1)},tour:n.current};return(0,s.jsx)(t6.Provider,{value:y,children:t})}window.copyDashboardCodeBlock=function(e){let t=e.closest(".bg-gray-50").querySelector("pre").querySelector("code.block").textContent;navigator.clipboard.writeText(t).then(()=>{let t=e.innerHTML;e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check h-5 w-5 text-green-600"><path d="m9 12 2 2 4-4"/></svg>',setTimeout(()=>{e.innerHTML=t},2e3)})}},32586:function(e,t,n){"use strict";n.r(t);var o=n(85893),r=n(67294),i=n(5152),l=n.n(i),s=n(45697),a=n.n(s);n(36501);var c=n(93225),u=n(94849);let d=l()(()=>Promise.all([n.e(616),n.e(6130),n.e(7411),n.e(6989),n.e(3850),n.e(9353),n.e(2350)]).then(n.bind(n,9353)).then(e=>e.Layout),{loadableGenerated:{webpack:()=>[9353]},ssr:!1});function h(e){let{Component:t,pageProps:n}=e;return(0,r.useEffect)(()=>{let e=document.createElement("link");e.rel="icon",e.href="".concat(c.GW,"/favicon.ico"),document.head.appendChild(e)},[]),(0,o.jsx)(u.C,{children:(0,o.jsx)(d,{highlighted:n.highlighted,children:(0,o.jsx)(t,{...n})})})}h.propTypes={Component:a().elementType.isRequired,pageProps:a().object.isRequired},t.default=h},36501:function(){},77663:function(e){!function(){var t={229:function(e){var t,n,o,r=e.exports={};function i(){throw Error("setTimeout has not been defined")}function l(){throw Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:l}catch(e){n=l}}();var a=[],c=!1,u=-1;function d(){c&&o&&(c=!1,o.length?a=o.concat(a):u=-1,a.length&&h())}function h(){if(!c){var e=s(d);c=!0;for(var t=a.length;t;){for(o=a,a=[];++u<t;)o&&o[u].run();u=-1,t=a.length}o=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===l||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}r.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];a.push(new f(e,t)),1!==a.length||c||s(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(e){return[]},r.binding=function(e){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw Error("process.chdir is not supported")},r.umask=function(){return 0}}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}},l=!0;try{t[e](i,i.exports,o),l=!1}finally{l&&delete n[e]}return i.exports}o.ab="//";var r=o(229);e.exports=r}()},5152:function(e,t,n){e.exports=n(19606)},11163:function(e,t,n){e.exports=n(26036)},92703:function(e,t,n){"use strict";var o=n(50414);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,l){if(l!==o){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},45697:function(e,t,n){e.exports=n(92703)()},50414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[9774,179],function(){return t(91118),t(26036)}),_N_E=e.O()}]);
@@ -13,4 +13,4 @@
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */let a=(0,s(60998).Z)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},99307:function(e,t,s){"use strict";s.d(t,{Cl:function(){return l},OE:function(){return d}});var a=s(85893);s(67294);var r=s(55739),n=s(36989),c=s(53850);let l=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":case"IN_USE":case"READY":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":case"PENDING":case"UNKNOWN":default:return"bg-gray-100 text-gray-800";case"SUCCEEDED":case"PROVISIONING":case"CONTROLLER_INIT":case"REPLICA_INIT":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":return"bg-red-50 text-red-700";case"CANCELLED":case"CANCELLING":case"NOT_READY":return"bg-yellow-50 text-yellow-700";case"RECOVERING":case"SHUTTING_DOWN":return"bg-orange-50 text-orange-700";case"SUBMITTED":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700";case"PREEMPTED":case"NO_REPLICA":return"bg-purple-50 text-purple-700"}},o=e=>{switch(e){case"LAUNCHING":case"STARTING":case"PROVISIONING":case"SHUTTING_DOWN":return(0,a.jsx)(r.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":case"IN_USE":default:return(0,a.jsx)(c.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":case"PREEMPTED":return(0,a.jsx)(c.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":case"UNKNOWN":return(0,a.jsx)(c.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,a.jsx)(c.Ye,{className:"w-3 h-3 mr-1"});case"PENDING":case"RECOVERING":case"SUBMITTED":case"CANCELLING":case"FAILED_SETUP":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"READY":case"NOT_READY":case"CONTROLLER_INIT":case"REPLICA_INIT":case"NO_REPLICA":return(0,a.jsx)(c.J$,{className:"w-3 h-3 mr-1"})}},i=e=>{let t=l(e),s=o(e);return(0,a.jsxs)("span",{className:"".concat("inline-flex items-center px-2 py-1 rounded-full text-sm"," ").concat(t),children:[s,e]})},d=e=>{let{status:t}=e;return(0,a.jsx)(n.WH,{content:t,className:"text-muted-foreground text-sm",children:(0,a.jsx)("span",{children:i(t)})})}},20546:function(e,t,s){"use strict";s.d(t,{H:function(){return d}});var a=s(85893);s(67294);var r=s(41664),n=s.n(r),c=s(45697),l=s.n(c);function o(e){return!!e&&"string"==typeof e&&e.toLowerCase().startsWith("sa-")}let i=()=>(0,a.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium ml-1",children:"SA"}),d=e=>{let{username:t,userHash:s,className:r="flex items-center gap-1",linkClassName:c="text-gray-700 hover:text-blue-600 hover:underline",showBadge:l=!0}=e,d=o(s),u=o(s)?"/users?tab=service-accounts":"/users";return(0,a.jsxs)("div",{className:r,children:[(0,a.jsx)(n(),{href:u,className:c,children:t}),l&&d&&(0,a.jsx)(i,{})]})};d.propTypes={username:l().string.isRequired,userHash:l().string,className:l().string,linkClassName:l().string,showBadge:l().bool}},37673:function(e,t,s){"use strict";s.d(t,{Ol:function(){return i},Zb:function(){return o},aY:function(){return h},ll:function(){return d}});var a=s(85893),r=s(67294),n=s(45697),c=s.n(n),l=s(32350);let o=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",s),...n,children:r})});o.displayName="Card",o.propTypes={className:c().string,children:c().node};let i=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5 p-6",s),...n,children:r})});i.displayName="CardHeader",i.propTypes={className:c().string,children:c().node};let d=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("h3",{ref:t,className:(0,l.cn)("text-2xl font-semibold leading-none tracking-tight",s),...n,children:r})});d.displayName="CardTitle",d.propTypes={className:c().string,children:c().node};let u=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("p",{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",s),...n,children:r})});u.displayName="CardDescription",u.propTypes={className:c().string,children:c().node};let h=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("p-6 pt-0",s),...n,children:r})});h.displayName="CardContent",h.propTypes={className:c().string,children:c().node};let m=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("flex items-center p-6 pt-0",s),...n,children:r})});m.displayName="CardFooter",m.propTypes={className:c().string,children:c().node}},47145:function(e,t,s){"use strict";s.d(t,{x:function(){return r}});var a=s(93225);let r={fetch:async function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST",r=window.location.origin,n="".concat(r).concat(a.f4).concat(e),c=await fetch(n,{method:s,headers:"POST"===s?{"Content-Type":"application/json"}:{},body:"POST"===s?JSON.stringify(t):void 0}),l=c.headers.get("X-Skypilot-Request-ID")||c.headers.get("X-Request-ID"),o=await fetch("".concat(r).concat(a.f4,"/api/get?request_id=").concat(l)),i=await o.json();return i.return_value?JSON.parse(i.return_value):[]},post:async(e,t)=>{let s=window.location.origin,r="".concat(s).concat(a.f4).concat(e);return await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})},stream:async(e,t,s)=>{let a=(await r.post(e,t)).body.getReader();try{for(;;){let{done:e,value:t}=await a.read();if(e)break;let r=new TextDecoder().decode(t);s(r)}}catch(e){throw console.error("Error in stream:",e),e}},get:async e=>{let t=window.location.origin,s="".concat(t).concat(a.f4).concat(e);return await fetch(s)}}},23266:function(e,t,s){"use strict";s.d(t,{GH:function(){return h},QL:function(){return f},Sl:function(){return u},getClusters:function(){return i},uR:function(){return d}});var a=s(67294),r=s(15821),n=s(47145),c=s(93225),l=s(6378);let o={UP:"RUNNING",STOPPED:"STOPPED",INIT:"LAUNCHING",null:"TERMINATED"};async function i(){let{clusterNames:e=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return(await n.x.fetch("/status",{cluster_names:e,all_users:!0,include_credentials:!1,summary_response:null==e})).map(e=>{let t="",s=t=e.zone?e.zone:e.region;return t&&t.length>25&&(t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15;if(!e||e.length<=t)return e;if(t<=3)return"...";let s=Math.floor((t-3)/2),a=s+(t-3)%2;return 0===s?e.substring(0,a)+"...":e.substring(0,a)+"..."+e.substring(e.length-s)}(t,25)),{status:o[e.status],cluster:e.name,user:e.user_name,user_hash:e.user_hash,cluster_hash:e.cluster_hash,cloud:e.cloud,region:e.region,infra:t?e.cloud+" ("+t+")":e.cloud,full_infra:s?"".concat(e.cloud," (").concat(s,")"):e.cloud,cpus:e.cpus,mem:e.memory,gpus:e.accelerators,resources_str:e.resources_str,resources_str_full:e.resources_str_full,time:new Date(1e3*e.launched_at),num_nodes:e.nodes,workspace:e.workspace,autostop:e.autostop,last_event:e.last_event,to_down:e.to_down,cluster_name_on_cloud:e.cluster_name_on_cloud,jobs:[],command:e.last_creation_command||e.last_use,task_yaml:e.last_creation_yaml||"{}",events:[{time:new Date(1e3*e.launched_at),event:"Cluster created."}]}})}catch(e){return console.error("Error fetching clusters:",e),[]}}async function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;try{let s={days:t,dashboard_summary_response:!0};e&&(s.cluster_hashes=[e]);let a=await n.x.fetch("/cost_report",s);console.log("Raw cluster history data:",a);let r=a.map(e=>{let t="Unknown";e.cloud?t=e.cloud:e.resources&&e.resources.cloud&&(t=e.resources.cloud);let s=e.user_name||"-";return{status:e.status?o[e.status]:"TERMINATED",cluster:e.name,user:s,user_hash:e.user_hash,cluster_hash:e.cluster_hash,cloud:t,region:"",infra:t,full_infra:t,resources_str:e.resources_str,resources_str_full:e.resources_str_full,time:e.launched_at?new Date(1e3*e.launched_at):null,num_nodes:e.num_nodes||1,duration:e.duration,total_cost:e.total_cost,workspace:e.workspace||"default",autostop:-1,last_event:e.last_event,to_down:!1,cluster_name_on_cloud:null,usage_intervals:e.usage_intervals,command:e.last_creation_command||"",task_yaml:e.last_creation_yaml||"{}",events:[{time:e.launched_at?new Date(1e3*e.launched_at):new Date,event:"Cluster created."}]}});return console.log("Processed cluster history data:",r),r}catch(e){return console.error("Error fetching cluster history:",e),[]}}async function u(e){let{clusterName:t,jobId:s,onNewLog:a,workspace:c}=e;try{await n.x.stream("/logs",{follow:!1,cluster_name:t,job_id:s,tail:1e4,override_skypilot_config:{active_workspace:c||"default"}},a)}catch(e){console.error("Error in streamClusterJobLogs:",e),(0,r.C)("Error in streamClusterJobLogs: ".concat(e.message),"error")}}async function h(e){let{clusterName:t,jobIds:s=null,workspace:a}=e;try{let e=await n.x.fetch("/download_logs",{cluster_name:t,job_ids:s?s.map(String):null,override_skypilot_config:{active_workspace:a||"default"}}),l=Object.values(e||{});if(!l.length){(0,r.C)("No logs found to download.","warning");return}let o=window.location.origin,i="".concat(o).concat(c.f4,"/download"),d=await fetch("".concat(i,"?relative=items"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder_paths:l})});if(!d.ok){let e=await d.text();throw Error("Download failed: ".concat(d.status," ").concat(e))}let u=await d.blob(),h=window.URL.createObjectURL(u),m=document.createElement("a"),f=new Date().toISOString().replace(/[:.]/g,"-"),g=s&&1===s.length?"job-".concat(s[0]):"jobs";m.href=h,m.download="".concat(t,"-").concat(g,"-logs-").concat(f,".zip"),document.body.appendChild(m),m.click(),m.remove(),window.URL.revokeObjectURL(h)}catch(e){console.error("Error downloading logs:",e),(0,r.C)("Error downloading logs: ".concat(e.message),"error")}}async function m(e){let{clusterName:t,workspace:s}=e;try{return(await n.x.fetch("/queue",{cluster_name:t,all_users:!0,override_skypilot_config:{active_workspace:s}})).map(e=>{var a;let r=e.end_at?e.end_at:Date.now()/1e3,n=0,c=0;return e.submitted_at&&(n=r-e.submitted_at),e.start_at&&(c=r-e.start_at),{id:e.job_id,status:e.status,job:e.job_name,user:e.username,user_hash:e.user_hash,gpus:e.accelerators||{},submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,resources:e.resources,cluster:t,total_duration:n,job_duration:c,infra:"",logs:"",workspace:s||"default",git_commit:(null===(a=e.metadata)||void 0===a?void 0:a.git_commit)||"-"}})}catch(e){return console.error("Error fetching cluster jobs:",e),[]}}function f(e){let{cluster:t,job:s=null}=e,[r,n]=(0,a.useState)(null),[c,o]=(0,a.useState)(null),[d,u]=(0,a.useState)(!0),[h,f]=(0,a.useState)(!0),g=(0,a.useCallback)(async()=>{if(t)try{u(!0);let e=await l.default.get(i,[{clusterNames:[t]}]);return n(e[0]),e[0]}catch(e){console.error("Error fetching cluster data:",e)}finally{u(!1)}return null},[t]),x=(0,a.useCallback)(async e=>{if(t)try{f(!0);let s=await l.default.get(m,[{clusterName:t,workspace:e||"default"}]);o(s)}catch(e){console.error("Error fetching cluster job data:",e)}finally{f(!1)}},[t]),p=(0,a.useCallback)(async()=>{l.default.invalidate(i,[{clusterNames:[t]}]);let e=await g();e&&(l.default.invalidate(m,[{clusterName:t,workspace:e.workspace||"default"}]),await x(e.workspace))},[g,x,t]),N=(0,a.useCallback)(async()=>{r&&(l.default.invalidate(m,[{clusterName:t,workspace:r.workspace||"default"}]),await x(r.workspace))},[x,r,t]);return(0,a.useEffect)(()=>{(async()=>{let e=await g();e&&x(e.workspace)})()},[t,s,g,x]),{clusterData:r,clusterJobData:c,loading:d,clusterDetailsLoading:d,clusterJobsLoading:h,refreshData:p,refreshClusterJobsOnly:N}}},15821:function(e,t,s){"use strict";function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,a=document.getElementById("toast-container");a||((a=document.createElement("div")).id="toast-container",a.className="fixed top-0 right-0 p-4 z-[9999] flex flex-col items-end space-y-2",document.body.appendChild(a));let r=document.createElement("div");switch(r.className="rounded-md border-l-4 p-4 shadow-md flex items-center justify-between max-w-md w-full mb-2 pointer-events-auto",t){case"success":r.className+=" bg-green-100 border-green-500 text-green-800";break;case"error":r.className+=" bg-red-100 border-red-500 text-red-800";break;case"warning":r.className+=" bg-yellow-100 border-yellow-500 text-yellow-800";break;default:r.className+=" bg-blue-100 border-blue-500 text-blue-800"}return r.innerHTML='\n <div class="flex-1 mr-2">\n <p class="text-sm font-medium">'.concat(e,'</p>\n </div>\n <button class="text-gray-500 hover:text-gray-700 focus:outline-none" aria-label="Close toast">\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n </button>\n '),a.appendChild(r),r.querySelector("button").addEventListener("click",()=>{a.removeChild(r)}),setTimeout(()=>{a.contains(r)&&a.removeChild(r)},s),r}s.d(t,{C:function(){return a}})},6378:function(e,t,s){"use strict";s.r(t),s.d(t,{DashboardCache:function(){return n},dashboardCache:function(){return c}});let a=s(51214).ej.DEFAULT_TTL;function r(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s);return t>>>0}class n{setPreloader(e){this.preloader=e}async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=s.ttl||a,n=!1!==s.refreshOnAccess,c=this._generateKey(e,t),l=e.name||"anonymous",o=this.cache.get(c),i=Date.now();if(o&&i-o.lastUpdated<r){let s=Math.round((i-o.lastUpdated)/1e3);if(this._debug("Cache HIT for ".concat(l," (age: ").concat(s,"s, TTL: ").concat(Math.round(r/1e3),"s)")),n&&(this.cache.set(c,{data:o.data,lastUpdated:i}),this._debug("Cache TTL refreshed for ".concat(l))),!this.backgroundJobs.has(c)){var d;(null===(d=this.preloader)||void 0===d?void 0:d.wasRecentlyPreloaded(e,t))?this._debug("Skipping background refresh for ".concat(l," - recently preloaded")):this._refreshInBackground(e,t,c)}return o.data}if(this.pendingRequests.has(c))return this._debug("Request deduplication: Waiting for pending request for ".concat(l)),this.pendingRequests.get(c);let u=(async()=>{try{let s=await e(...t);if(s&&s.__skipCache){if(this._debug("Skip caching for ".concat(l," due to __skipCache flag on result")),o)return o.data;return s}return this.cache.set(c,{data:s,lastUpdated:Date.now()}),s}catch(e){if(o)return console.warn("Failed to fetch fresh data for ".concat(c,", returning stale data:"),e),o.data;throw e}finally{this.pendingRequests.delete(c)}})();return this.pendingRequests.set(c,u),u}invalidate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=this._generateKey(e,t);this.cache.delete(s),this.backgroundJobs.delete(s),this.pendingRequests.delete(s)}invalidateFunction(e){let t=r(e.toString()),s=[];for(let e of this.cache.keys())e.startsWith("".concat(t,"_"))&&s.push(e);s.forEach(e=>{this.cache.delete(e),this.backgroundJobs.delete(e),this.pendingRequests.delete(e)})}clear(){this.cache.clear(),this.backgroundJobs.clear(),this.pendingRequests.clear()}getStats(){return{cacheSize:this.cache.size,backgroundJobs:this.backgroundJobs.size,pendingRequests:this.pendingRequests.size,keys:Array.from(this.cache.keys())}}getDetailedStats(){let e=Date.now(),t=[];for(let[s,a]of this.cache.entries()){let r=e-a.lastUpdated;t.push({key:s,age:Math.round(r/1e3),lastUpdated:new Date(a.lastUpdated).toISOString(),hasBackgroundJob:this.backgroundJobs.has(s),hasPendingRequest:this.pendingRequests.has(s)})}return{cacheSize:this.cache.size,backgroundJobs:this.backgroundJobs.size,pendingRequests:this.pendingRequests.size,entries:t.sort((e,t)=>e.age-t.age)}}setDebugMode(e){this.debugMode=e}_debug(e){for(var t=arguments.length,s=Array(t>1?t-1:0),a=1;a<t;a++)s[a-1]=arguments[a];this.debugMode&&console.log("[DashboardCache] ".concat(e),...s)}_refreshInBackground(e,t,s){this.backgroundJobs.set(s,!0),e(...t).then(e=>{e&&e.__skipCache||this.cache.set(s,{data:e,lastUpdated:Date.now()})}).catch(e=>{console.warn("Background refresh failed for ".concat(s,":"),e)}).finally(()=>{this.backgroundJobs.delete(s)})}_generateKey(e,t){let s=r(e.toString()),a=t.length>0?JSON.stringify(t):"";return"".concat(s,"_").concat(a)}constructor(){this.cache=new Map,this.backgroundJobs=new Map,this.pendingRequests=new Map,this.debugMode=!1,this.preloader=null}}let c=new n;t.default=c},32350:function(e,t,s){"use strict";s.d(t,{cn:function(){return n}});var a=s(90512),r=s(98388);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,r.m6)((0,a.W)(t))}},50190:function(e,t,s){"use strict";s.r(t),s.d(t,{JobDetailPage:function(){return w}});var a=s(85893),r=s(67294);s(6135);var n=s(37673),c=s(41664),l=s.n(c),o=s(11163),i=s(23266),d=s(36989),u=s(13626),h=s(16826),m=s(55739),f=s(99307),g=s(23001),x=s(9008),p=s.n(x),N=s(20546),b=s(70282),_=s(27325);function y(e){let{cluster:t,job:s,jobData:r,onRefresh:n,isRefreshing:c,loading:o}=e,i=(0,g.X)();return(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,a.jsxs)("div",{className:"text-base flex items-center",children:[(0,a.jsx)(l(),{href:"/clusters",className:"text-sky-blue hover:underline",children:"Sky Clusters"}),(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,a.jsx)(l(),{href:"/clusters/".concat(t),className:"text-sky-blue hover:underline",children:t}),(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,a.jsxs)(l(),{href:"/clusters/".concat(t,"/").concat(s),className:"text-sky-blue hover:underline",children:[s,r.job&&"-"!=r.job?" (".concat(r.job,")"):""]})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[(o||c)&&(0,a.jsxs)("div",{className:"flex items-center mr-2",children:[(0,a.jsx)(m.Z,{size:15,className:"mt-0"}),(0,a.jsx)("span",{className:"text-sm ml-2 text-gray-500",children:"Loading..."})]}),(0,a.jsx)(d.WH,{content:"Refresh",className:"text-muted-foreground",children:(0,a.jsxs)("button",{onClick:n,disabled:o||c,className:"text-sm text-sky-blue hover:text-sky-blue-bright font-medium mx-2 flex items-center",children:[(0,a.jsx)(u.Z,{className:"w-4 h-4 mr-1.5"}),!i&&(0,a.jsx)("span",{children:"Refresh"})]})})]})]})}function w(){let e=(0,o.useRouter)(),{cluster:t,job:s}=e.query,{clusterData:c,clusterJobData:g,loading:x,refreshData:w}=(0,i.QL)({cluster:t}),[j,v]=(0,r.useState)(!1),[E,k]=(0,r.useState)(!0),[I,C]=(0,r.useState)(!1),[R,D]=(0,r.useState)(""),[L,T]=(0,r.useState)(!1),[S,O]=(0,r.useState)(!1),A=(0,r.useMemo)(()=>["INIT","PENDING","SETTING_UP"],[]),P=(0,r.useMemo)(()=>{if(!g||!s)return!0;let e=g.find(e=>e.id==s);return e&&A.includes(e.status)},[g,s,A]);r.useEffect(()=>{!x&&E&&k(!1)},[x,E]),(0,r.useEffect)(()=>{let e=!0;return t&&s&&!P?(C(!0),(0,i.Sl)({clusterName:t,jobId:s,onNewLog:t=>{e&&D(e=>{let s=t.split("\n").filter(e=>e.trim()),a=e;for(let e of s){let t=(0,d.Zn)(e);if(/\d+%\s*\|/.test(t)){let e=t.match(/^\(([^)]+)\)/);if(e&&a){let s=a.split("\n"),r=!1;for(let n=s.length-1;n>=0;n--){let c=s[n];if(/\d+%\s*\|/.test(c)){let l=c.match(/^\(([^)]+)\)/);if(l&&l[1]===e[1]){s[n]=t,a=s.join("\n"),r=!0;break}}}r||(a+=(a?"\n":"")+t)}else a+=(a?"\n":"")+t}else a+=(a?"\n":"")+t}return a})},workspace:null==c?void 0:c.workspace}).then(()=>{e&&C(!1)}).catch(t=>{e&&(console.error("Error streaming logs:",t),C(!1))})):C(!1),()=>{e=!1}},[t,s,L,P,c]);let U=async()=>{v(!0),T(e=>!e),D("");try{w&&await w()}catch(e){console.error("Error refreshing data:",e)}finally{v(!1)}};if(!e.isReady)return(0,a.jsx)("div",{children:"Loading..."});let J={id:s};if(c&&g){let e=g.find(e=>e.id==s);e&&(J={...e,infra:c.infra,cluster:c.cluster,user:c.user,user_hash:c.user_hash})}let q=t&&s?"Job: ".concat(s," @ ").concat(t," | SkyPilot Dashboard"):"Job Details | SkyPilot Dashboard";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p(),{children:(0,a.jsx)("title",{children:q})}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y,{cluster:t,job:s,jobData:J,onRefresh:U,isRefreshing:j,loading:x}),x&&E?(0,a.jsxs)("div",{className:"flex items-center justify-center h-64",children:[(0,a.jsx)(m.Z,{size:24,className:"mr-2"}),(0,a.jsx)("span",{children:"Loading..."})]}):(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsx)("div",{id:"details",children:(0,a.jsxs)(n.Zb,{children:[(0,a.jsx)("div",{className:"flex items-center justify-between px-4 pt-4",children:(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Details"})}),(0,a.jsx)("div",{className:"p-4",children:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Job ID"}),(0,a.jsx)("div",{className:"text-base mt-1",children:J.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Job Name"}),(0,a.jsx)("div",{className:"text-base mt-1",children:J.job})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Status"}),(0,a.jsx)("div",{className:"text-base mt-1",children:(0,a.jsx)(f.OE,{status:J.status})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"User"}),(0,a.jsx)("div",{className:"text-base mt-1",children:(0,a.jsx)(N.H,{username:J.user,userHash:J.user_hash})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Submitted"}),(0,a.jsx)("div",{className:"text-base mt-1",children:J.submitted_at?(0,d.xn)(J.submitted_at):"N/A"})]}),J.resources&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Requested Resources"}),(0,a.jsx)("div",{className:"text-base mt-1",children:J.resources||"N/A"})]}),J.cluster&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Cluster"}),(0,a.jsx)("div",{className:"text-base mt-1",children:(0,a.jsx)(l(),{href:"/clusters/".concat(J.cluster),className:"text-sky-blue hover:underline",children:J.cluster})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Git Commit"}),(0,a.jsx)("div",{className:"text-base mt-1 flex items-center",children:J.git_commit&&"-"!==J.git_commit?(0,a.jsxs)("span",{className:"flex items-center mr-2",children:[J.git_commit,(0,a.jsx)(d.WH,{content:S?"Copied!":"Copy commit",className:"text-muted-foreground",children:(0,a.jsx)("button",{onClick:async()=>{await navigator.clipboard.writeText(J.git_commit),O(!0),setTimeout(()=>O(!1),2e3)},className:"flex items-center text-gray-500 hover:text-gray-700 transition-colors duration-200 p-1 ml-2",children:S?(0,a.jsx)(b.Z,{className:"w-4 h-4 text-green-600"}):(0,a.jsx)(_.Z,{className:"w-4 h-4"})})})]}):(0,a.jsx)("span",{className:"text-gray-400",children:"-"})})]})]})})]})}),(0,a.jsx)("div",{id:"logs",className:"mt-6",children:(0,a.jsxs)(n.Zb,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 pt-4",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Logs"}),(0,a.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:"(Logs are not streaming; click refresh to fetch the latest logs.)"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,a.jsx)(d.WH,{content:"Download full logs",className:"text-muted-foreground",children:(0,a.jsx)("button",{onClick:()=>(0,i.GH)({clusterName:t,jobIds:s?[s]:null,workspace:null==c?void 0:c.workspace}),className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,a.jsx)(h.Z,{className:"w-4 h-4"})})}),(0,a.jsx)(d.WH,{content:"Refresh logs",className:"text-muted-foreground",children:(0,a.jsx)("button",{onClick:()=>{T(e=>!e),D("")},disabled:I,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,a.jsx)(u.Z,{className:"w-4 h-4 ".concat(I?"animate-spin":"")})})})]})]}),(0,a.jsx)("div",{className:"p-4",children:P?(0,a.jsx)("div",{className:"bg-[#f7f7f7] flex items-center justify-center py-4 text-gray-500",children:(0,a.jsx)("span",{children:"Waiting for the job to start; refresh in a few moments."})}):I?(0,a.jsxs)("div",{className:"flex items-center justify-center py-4",children:[(0,a.jsx)(m.Z,{size:20,className:"mr-2"}),(0,a.jsx)("span",{children:"Loading..."})]}):(0,a.jsx)("div",{className:"max-h-96 overflow-y-auto",children:(0,a.jsx)(d.$B,{logs:R})})})]})})]})]})]})}t.default=w},9008:function(e,t,s){e.exports=s(37219)}},function(e){e.O(0,[616,6130,5739,7411,6989,3850,6135,2888,9774,179],function(){return e(e.s=94966)}),_N_E=e.O()}]);
16
+ */let a=(0,s(60998).Z)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},99307:function(e,t,s){"use strict";s.d(t,{Cl:function(){return l},OE:function(){return d}});var a=s(85893);s(67294);var r=s(55739),n=s(36989),c=s(53850);let l=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":case"IN_USE":case"READY":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":case"PENDING":case"UNKNOWN":default:return"bg-gray-100 text-gray-800";case"SUCCEEDED":case"PROVISIONING":case"CONTROLLER_INIT":case"REPLICA_INIT":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":return"bg-red-50 text-red-700";case"CANCELLED":case"CANCELLING":case"NOT_READY":return"bg-yellow-50 text-yellow-700";case"RECOVERING":case"SHUTTING_DOWN":return"bg-orange-50 text-orange-700";case"SUBMITTED":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700";case"PREEMPTED":case"NO_REPLICA":return"bg-purple-50 text-purple-700"}},o=e=>{switch(e){case"LAUNCHING":case"STARTING":case"PROVISIONING":case"SHUTTING_DOWN":return(0,a.jsx)(r.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":case"IN_USE":default:return(0,a.jsx)(c.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":case"PREEMPTED":return(0,a.jsx)(c.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":case"FAILED_INITIAL_DELAY":case"FAILED_PROBING":case"FAILED_PROVISION":case"FAILED_CLEANUP":case"CONTROLLER_FAILED":case"UNKNOWN":return(0,a.jsx)(c.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,a.jsx)(c.Ye,{className:"w-3 h-3 mr-1"});case"PENDING":case"RECOVERING":case"SUBMITTED":case"CANCELLING":case"FAILED_SETUP":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"READY":case"NOT_READY":case"CONTROLLER_INIT":case"REPLICA_INIT":case"NO_REPLICA":return(0,a.jsx)(c.J$,{className:"w-3 h-3 mr-1"})}},i=e=>{let t=l(e),s=o(e);return(0,a.jsxs)("span",{className:"".concat("inline-flex items-center px-2 py-1 rounded-full text-sm"," ").concat(t),children:[s,e]})},d=e=>{let{status:t}=e;return(0,a.jsx)(n.WH,{content:t,className:"text-muted-foreground text-sm",children:(0,a.jsx)("span",{children:i(t)})})}},20546:function(e,t,s){"use strict";s.d(t,{H:function(){return d}});var a=s(85893);s(67294);var r=s(41664),n=s.n(r),c=s(45697),l=s.n(c);function o(e){return!!e&&"string"==typeof e&&e.toLowerCase().startsWith("sa-")}let i=()=>(0,a.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium ml-1",children:"SA"}),d=e=>{let{username:t,userHash:s,className:r="flex items-center gap-1",linkClassName:c="text-gray-700 hover:text-blue-600 hover:underline",showBadge:l=!0}=e,d=o(s),u=o(s)?"/users?tab=service-accounts":"/users";return(0,a.jsxs)("div",{className:r,children:[(0,a.jsx)(n(),{href:u,className:c,children:t}),l&&d&&(0,a.jsx)(i,{})]})};d.propTypes={username:l().string.isRequired,userHash:l().string,className:l().string,linkClassName:l().string,showBadge:l().bool}},37673:function(e,t,s){"use strict";s.d(t,{Ol:function(){return i},Zb:function(){return o},aY:function(){return h},ll:function(){return d}});var a=s(85893),r=s(67294),n=s(45697),c=s.n(n),l=s(32350);let o=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",s),...n,children:r})});o.displayName="Card",o.propTypes={className:c().string,children:c().node};let i=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5 p-6",s),...n,children:r})});i.displayName="CardHeader",i.propTypes={className:c().string,children:c().node};let d=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("h3",{ref:t,className:(0,l.cn)("text-2xl font-semibold leading-none tracking-tight",s),...n,children:r})});d.displayName="CardTitle",d.propTypes={className:c().string,children:c().node};let u=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("p",{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",s),...n,children:r})});u.displayName="CardDescription",u.propTypes={className:c().string,children:c().node};let h=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("p-6 pt-0",s),...n,children:r})});h.displayName="CardContent",h.propTypes={className:c().string,children:c().node};let m=r.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("flex items-center p-6 pt-0",s),...n,children:r})});m.displayName="CardFooter",m.propTypes={className:c().string,children:c().node}},47145:function(e,t,s){"use strict";s.d(t,{x:function(){return r}});var a=s(93225);let r={fetch:async function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST",r=window.location.origin,n="".concat(r).concat(a.f4).concat(e),c=await fetch(n,{method:s,headers:"POST"===s?{"Content-Type":"application/json"}:{},body:"POST"===s?JSON.stringify(t):void 0}),l=c.headers.get("X-Skypilot-Request-ID")||c.headers.get("X-Request-ID"),o=await fetch("".concat(r).concat(a.f4,"/api/get?request_id=").concat(l)),i=await o.json();return i.return_value?JSON.parse(i.return_value):[]},post:async(e,t)=>{let s=window.location.origin,r="".concat(s).concat(a.f4).concat(e);return await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})},stream:async(e,t,s)=>{let a=(await r.post(e,t)).body.getReader();try{for(;;){let{done:e,value:t}=await a.read();if(e)break;let r=new TextDecoder().decode(t);s(r)}}catch(e){throw console.error("Error in stream:",e),e}},get:async e=>{let t=window.location.origin,s="".concat(t).concat(a.f4).concat(e);return await fetch(s)}}},23266:function(e,t,s){"use strict";s.d(t,{GH:function(){return h},QL:function(){return f},Sl:function(){return u},getClusters:function(){return i},uR:function(){return d}});var a=s(67294),r=s(15821),n=s(47145),c=s(93225),l=s(6378);let o={UP:"RUNNING",STOPPED:"STOPPED",INIT:"LAUNCHING",null:"TERMINATED"};async function i(){let{clusterNames:e=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return(await n.x.fetch("/status",{cluster_names:e,all_users:!0,include_credentials:!1,summary_response:null==e})).map(e=>{let t="",s=t=e.zone?e.zone:e.region;return t&&t.length>25&&(t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15;if(!e||e.length<=t)return e;if(t<=3)return"...";let s=Math.floor((t-3)/2),a=s+(t-3)%2;return 0===s?e.substring(0,a)+"...":e.substring(0,a)+"..."+e.substring(e.length-s)}(t,25)),{status:o[e.status],cluster:e.name,user:e.user_name,user_hash:e.user_hash,cluster_hash:e.cluster_hash,cloud:e.cloud,region:e.region,infra:t?e.cloud+" ("+t+")":e.cloud,full_infra:s?"".concat(e.cloud," (").concat(s,")"):e.cloud,cpus:e.cpus,mem:e.memory,gpus:e.accelerators,resources_str:e.resources_str,resources_str_full:e.resources_str_full,time:new Date(1e3*e.launched_at),num_nodes:e.nodes,workspace:e.workspace,autostop:e.autostop,last_event:e.last_event,to_down:e.to_down,cluster_name_on_cloud:e.cluster_name_on_cloud,jobs:[],command:e.last_creation_command||e.last_use,task_yaml:e.last_creation_yaml||"{}",events:[{time:new Date(1e3*e.launched_at),event:"Cluster created."}]}})}catch(e){return console.error("Error fetching clusters:",e),[]}}async function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;try{let s={days:t,dashboard_summary_response:!0};e&&(s.cluster_hashes=[e]);let a=await n.x.fetch("/cost_report",s);console.log("Raw cluster history data:",a);let r=a.map(e=>{let t="Unknown";e.cloud?t=e.cloud:e.resources&&e.resources.cloud&&(t=e.resources.cloud);let s=e.user_name||"-";return{status:e.status?o[e.status]:"TERMINATED",cluster:e.name,user:s,user_hash:e.user_hash,cluster_hash:e.cluster_hash,cloud:t,region:"",infra:t,full_infra:t,resources_str:e.resources_str,resources_str_full:e.resources_str_full,time:e.launched_at?new Date(1e3*e.launched_at):null,num_nodes:e.num_nodes||1,duration:e.duration,total_cost:e.total_cost,workspace:e.workspace||"default",autostop:-1,last_event:e.last_event,to_down:!1,cluster_name_on_cloud:null,usage_intervals:e.usage_intervals,command:e.last_creation_command||"",task_yaml:e.last_creation_yaml||"{}",events:[{time:e.launched_at?new Date(1e3*e.launched_at):new Date,event:"Cluster created."}]}});return console.log("Processed cluster history data:",r),r}catch(e){return console.error("Error fetching cluster history:",e),[]}}async function u(e){let{clusterName:t,jobId:s,onNewLog:a,workspace:c}=e;try{await n.x.stream("/logs",{follow:!1,cluster_name:t,job_id:s,tail:1e4,override_skypilot_config:{active_workspace:c||"default"}},a)}catch(e){console.error("Error in streamClusterJobLogs:",e),(0,r.C)("Error in streamClusterJobLogs: ".concat(e.message),"error")}}async function h(e){let{clusterName:t,jobIds:s=null,workspace:a}=e;try{let e=await n.x.fetch("/download_logs",{cluster_name:t,job_ids:s?s.map(String):null,override_skypilot_config:{active_workspace:a||"default"}}),l=Object.values(e||{});if(!l.length){(0,r.C)("No logs found to download.","warning");return}let o=window.location.origin,i="".concat(o).concat(c.f4,"/download"),d=await fetch("".concat(i,"?relative=items"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder_paths:l})});if(!d.ok){let e=await d.text();throw Error("Download failed: ".concat(d.status," ").concat(e))}let u=await d.blob(),h=window.URL.createObjectURL(u),m=document.createElement("a"),f=new Date().toISOString().replace(/[:.]/g,"-"),g=s&&1===s.length?"job-".concat(s[0]):"jobs";m.href=h,m.download="".concat(t,"-").concat(g,"-logs-").concat(f,".zip"),document.body.appendChild(m),m.click(),m.remove(),window.URL.revokeObjectURL(h)}catch(e){console.error("Error downloading logs:",e),(0,r.C)("Error downloading logs: ".concat(e.message),"error")}}async function m(e){let{clusterName:t,workspace:s}=e;try{return(await n.x.fetch("/queue",{cluster_name:t,all_users:!0,override_skypilot_config:{active_workspace:s}})).map(e=>{var a;let r=e.end_at?e.end_at:Date.now()/1e3,n=0,c=0;return e.submitted_at&&(n=r-e.submitted_at),e.start_at&&(c=r-e.start_at),{id:e.job_id,status:e.status,job:e.job_name,user:e.username,user_hash:e.user_hash,gpus:e.accelerators||{},submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,resources:e.resources,cluster:t,total_duration:n,job_duration:c,infra:"",logs:"",workspace:s||"default",git_commit:(null===(a=e.metadata)||void 0===a?void 0:a.git_commit)||"-"}})}catch(e){return console.error("Error fetching cluster jobs:",e),[]}}function f(e){let{cluster:t,job:s=null}=e,[r,n]=(0,a.useState)(null),[c,o]=(0,a.useState)(null),[d,u]=(0,a.useState)(!0),[h,f]=(0,a.useState)(!0),g=(0,a.useCallback)(async()=>{if(t)try{u(!0);let e=await l.default.get(i,[{clusterNames:[t]}]);return n(e[0]),e[0]}catch(e){console.error("Error fetching cluster data:",e)}finally{u(!1)}return null},[t]),x=(0,a.useCallback)(async e=>{if(t)try{f(!0);let s=await l.default.get(m,[{clusterName:t,workspace:e||"default"}]);o(s)}catch(e){console.error("Error fetching cluster job data:",e)}finally{f(!1)}},[t]),p=(0,a.useCallback)(async()=>{l.default.invalidate(i,[{clusterNames:[t]}]);let e=await g();e&&(l.default.invalidate(m,[{clusterName:t,workspace:e.workspace||"default"}]),await x(e.workspace))},[g,x,t]),N=(0,a.useCallback)(async()=>{r&&(l.default.invalidate(m,[{clusterName:t,workspace:r.workspace||"default"}]),await x(r.workspace))},[x,r,t]);return(0,a.useEffect)(()=>{(async()=>{let e=await g();e&&x(e.workspace)})()},[t,s,g,x]),{clusterData:r,clusterJobData:c,loading:d,clusterDetailsLoading:d,clusterJobsLoading:h,refreshData:p,refreshClusterJobsOnly:N}}},15821:function(e,t,s){"use strict";function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,a=document.getElementById("toast-container");a||((a=document.createElement("div")).id="toast-container",a.className="fixed top-0 right-0 p-4 z-[9999] flex flex-col items-end space-y-2",document.body.appendChild(a));let r=document.createElement("div");switch(r.className="rounded-md border-l-4 p-4 shadow-md flex items-center justify-between max-w-md w-full mb-2 pointer-events-auto",t){case"success":r.className+=" bg-green-100 border-green-500 text-green-800";break;case"error":r.className+=" bg-red-100 border-red-500 text-red-800";break;case"warning":r.className+=" bg-yellow-100 border-yellow-500 text-yellow-800";break;default:r.className+=" bg-blue-100 border-blue-500 text-blue-800"}return r.innerHTML='\n <div class="flex-1 mr-2">\n <p class="text-sm font-medium">'.concat(e,'</p>\n </div>\n <button class="text-gray-500 hover:text-gray-700 focus:outline-none" aria-label="Close toast">\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n </button>\n '),a.appendChild(r),r.querySelector("button").addEventListener("click",()=>{a.removeChild(r)}),setTimeout(()=>{a.contains(r)&&a.removeChild(r)},s),r}s.d(t,{C:function(){return a}})},6378:function(e,t,s){"use strict";s.r(t),s.d(t,{DashboardCache:function(){return n},dashboardCache:function(){return c}});let a=s(51214).ej.DEFAULT_TTL;function r(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s);return t>>>0}class n{setPreloader(e){this.preloader=e}async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=s.ttl||a,n=!1!==s.refreshOnAccess,c=this._generateKey(e,t),l=e.name||"anonymous",o=this.cache.get(c),i=Date.now();if(o&&i-o.lastUpdated<r){let s=Math.round((i-o.lastUpdated)/1e3);if(this._debug("Cache HIT for ".concat(l," (age: ").concat(s,"s, TTL: ").concat(Math.round(r/1e3),"s)")),n&&(this.cache.set(c,{data:o.data,lastUpdated:i}),this._debug("Cache TTL refreshed for ".concat(l))),!this.backgroundJobs.has(c)){var d;(null===(d=this.preloader)||void 0===d?void 0:d.wasRecentlyPreloaded(e,t))?this._debug("Skipping background refresh for ".concat(l," - recently preloaded")):this._refreshInBackground(e,t,c)}return o.data}if(this.pendingRequests.has(c))return this._debug("Request deduplication: Waiting for pending request for ".concat(l)),this.pendingRequests.get(c);let u=(async()=>{try{let s=await e(...t);if(s&&s.__skipCache){if(this._debug("Skip caching for ".concat(l," due to __skipCache flag on result")),o)return o.data;return s}return this.cache.set(c,{data:s,lastUpdated:Date.now()}),s}catch(e){if(o)return console.warn("Failed to fetch fresh data for ".concat(c,", returning stale data:"),e),o.data;throw e}finally{this.pendingRequests.delete(c)}})();return this.pendingRequests.set(c,u),u}invalidate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=this._generateKey(e,t);this.cache.delete(s),this.backgroundJobs.delete(s),this.pendingRequests.delete(s)}invalidateFunction(e){let t=r(e.toString()),s=[];for(let e of this.cache.keys())e.startsWith("".concat(t,"_"))&&s.push(e);s.forEach(e=>{this.cache.delete(e),this.backgroundJobs.delete(e),this.pendingRequests.delete(e)})}clear(){this.cache.clear(),this.backgroundJobs.clear(),this.pendingRequests.clear()}getStats(){return{cacheSize:this.cache.size,backgroundJobs:this.backgroundJobs.size,pendingRequests:this.pendingRequests.size,keys:Array.from(this.cache.keys())}}getDetailedStats(){let e=Date.now(),t=[];for(let[s,a]of this.cache.entries()){let r=e-a.lastUpdated;t.push({key:s,age:Math.round(r/1e3),lastUpdated:new Date(a.lastUpdated).toISOString(),hasBackgroundJob:this.backgroundJobs.has(s),hasPendingRequest:this.pendingRequests.has(s)})}return{cacheSize:this.cache.size,backgroundJobs:this.backgroundJobs.size,pendingRequests:this.pendingRequests.size,entries:t.sort((e,t)=>e.age-t.age)}}setDebugMode(e){this.debugMode=e}_debug(e){for(var t=arguments.length,s=Array(t>1?t-1:0),a=1;a<t;a++)s[a-1]=arguments[a];this.debugMode&&console.log("[DashboardCache] ".concat(e),...s)}_refreshInBackground(e,t,s){this.backgroundJobs.set(s,!0),e(...t).then(e=>{e&&e.__skipCache||this.cache.set(s,{data:e,lastUpdated:Date.now()})}).catch(e=>{console.warn("Background refresh failed for ".concat(s,":"),e)}).finally(()=>{this.backgroundJobs.delete(s)})}_generateKey(e,t){let s=r(e.toString()),a=t.length>0?JSON.stringify(t):"";return"".concat(s,"_").concat(a)}constructor(){this.cache=new Map,this.backgroundJobs=new Map,this.pendingRequests=new Map,this.debugMode=!1,this.preloader=null}}let c=new n;t.default=c},32350:function(e,t,s){"use strict";s.d(t,{cn:function(){return n}});var a=s(90512),r=s(98388);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,r.m6)((0,a.W)(t))}},50190:function(e,t,s){"use strict";s.r(t),s.d(t,{JobDetailPage:function(){return w}});var a=s(85893),r=s(67294);s(9353);var n=s(37673),c=s(41664),l=s.n(c),o=s(11163),i=s(23266),d=s(36989),u=s(13626),h=s(16826),m=s(55739),f=s(99307),g=s(23001),x=s(9008),p=s.n(x),N=s(20546),b=s(70282),_=s(27325);function y(e){let{cluster:t,job:s,jobData:r,onRefresh:n,isRefreshing:c,loading:o}=e,i=(0,g.X)();return(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,a.jsxs)("div",{className:"text-base flex items-center",children:[(0,a.jsx)(l(),{href:"/clusters",className:"text-sky-blue hover:underline",children:"Sky Clusters"}),(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,a.jsx)(l(),{href:"/clusters/".concat(t),className:"text-sky-blue hover:underline",children:t}),(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,a.jsxs)(l(),{href:"/clusters/".concat(t,"/").concat(s),className:"text-sky-blue hover:underline",children:[s,r.job&&"-"!=r.job?" (".concat(r.job,")"):""]})]}),(0,a.jsxs)("div",{className:"flex items-center",children:[(o||c)&&(0,a.jsxs)("div",{className:"flex items-center mr-2",children:[(0,a.jsx)(m.Z,{size:15,className:"mt-0"}),(0,a.jsx)("span",{className:"text-sm ml-2 text-gray-500",children:"Loading..."})]}),(0,a.jsx)(d.WH,{content:"Refresh",className:"text-muted-foreground",children:(0,a.jsxs)("button",{onClick:n,disabled:o||c,className:"text-sm text-sky-blue hover:text-sky-blue-bright font-medium mx-2 flex items-center",children:[(0,a.jsx)(u.Z,{className:"w-4 h-4 mr-1.5"}),!i&&(0,a.jsx)("span",{children:"Refresh"})]})})]})]})}function w(){let e=(0,o.useRouter)(),{cluster:t,job:s}=e.query,{clusterData:c,clusterJobData:g,loading:x,refreshData:w}=(0,i.QL)({cluster:t}),[j,v]=(0,r.useState)(!1),[E,k]=(0,r.useState)(!0),[I,C]=(0,r.useState)(!1),[R,D]=(0,r.useState)(""),[L,T]=(0,r.useState)(!1),[S,O]=(0,r.useState)(!1),A=(0,r.useMemo)(()=>["INIT","PENDING","SETTING_UP"],[]),P=(0,r.useMemo)(()=>{if(!g||!s)return!0;let e=g.find(e=>e.id==s);return e&&A.includes(e.status)},[g,s,A]);r.useEffect(()=>{!x&&E&&k(!1)},[x,E]),(0,r.useEffect)(()=>{let e=!0;return t&&s&&!P?(C(!0),(0,i.Sl)({clusterName:t,jobId:s,onNewLog:t=>{e&&D(e=>{let s=t.split("\n").filter(e=>e.trim()),a=e;for(let e of s){let t=(0,d.Zn)(e);if(/\d+%\s*\|/.test(t)){let e=t.match(/^\(([^)]+)\)/);if(e&&a){let s=a.split("\n"),r=!1;for(let n=s.length-1;n>=0;n--){let c=s[n];if(/\d+%\s*\|/.test(c)){let l=c.match(/^\(([^)]+)\)/);if(l&&l[1]===e[1]){s[n]=t,a=s.join("\n"),r=!0;break}}}r||(a+=(a?"\n":"")+t)}else a+=(a?"\n":"")+t}else a+=(a?"\n":"")+t}return a})},workspace:null==c?void 0:c.workspace}).then(()=>{e&&C(!1)}).catch(t=>{e&&(console.error("Error streaming logs:",t),C(!1))})):C(!1),()=>{e=!1}},[t,s,L,P,c]);let U=async()=>{v(!0),T(e=>!e),D("");try{w&&await w()}catch(e){console.error("Error refreshing data:",e)}finally{v(!1)}};if(!e.isReady)return(0,a.jsx)("div",{children:"Loading..."});let J={id:s};if(c&&g){let e=g.find(e=>e.id==s);e&&(J={...e,infra:c.infra,cluster:c.cluster,user:c.user,user_hash:c.user_hash})}let q=t&&s?"Job: ".concat(s," @ ").concat(t," | SkyPilot Dashboard"):"Job Details | SkyPilot Dashboard";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p(),{children:(0,a.jsx)("title",{children:q})}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y,{cluster:t,job:s,jobData:J,onRefresh:U,isRefreshing:j,loading:x}),x&&E?(0,a.jsxs)("div",{className:"flex items-center justify-center h-64",children:[(0,a.jsx)(m.Z,{size:24,className:"mr-2"}),(0,a.jsx)("span",{children:"Loading..."})]}):(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsx)("div",{id:"details",children:(0,a.jsxs)(n.Zb,{children:[(0,a.jsx)("div",{className:"flex items-center justify-between px-4 pt-4",children:(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Details"})}),(0,a.jsx)("div",{className:"p-4",children:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Job ID"}),(0,a.jsx)("div",{className:"text-base mt-1",children:J.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Job Name"}),(0,a.jsx)("div",{className:"text-base mt-1",children:J.job})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Status"}),(0,a.jsx)("div",{className:"text-base mt-1",children:(0,a.jsx)(f.OE,{status:J.status})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"User"}),(0,a.jsx)("div",{className:"text-base mt-1",children:(0,a.jsx)(N.H,{username:J.user,userHash:J.user_hash})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Submitted"}),(0,a.jsx)("div",{className:"text-base mt-1",children:J.submitted_at?(0,d.xn)(J.submitted_at):"N/A"})]}),J.resources&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Requested Resources"}),(0,a.jsx)("div",{className:"text-base mt-1",children:J.resources||"N/A"})]}),J.cluster&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Cluster"}),(0,a.jsx)("div",{className:"text-base mt-1",children:(0,a.jsx)(l(),{href:"/clusters/".concat(J.cluster),className:"text-sky-blue hover:underline",children:J.cluster})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Git Commit"}),(0,a.jsx)("div",{className:"text-base mt-1 flex items-center",children:J.git_commit&&"-"!==J.git_commit?(0,a.jsxs)("span",{className:"flex items-center mr-2",children:[J.git_commit,(0,a.jsx)(d.WH,{content:S?"Copied!":"Copy commit",className:"text-muted-foreground",children:(0,a.jsx)("button",{onClick:async()=>{await navigator.clipboard.writeText(J.git_commit),O(!0),setTimeout(()=>O(!1),2e3)},className:"flex items-center text-gray-500 hover:text-gray-700 transition-colors duration-200 p-1 ml-2",children:S?(0,a.jsx)(b.Z,{className:"w-4 h-4 text-green-600"}):(0,a.jsx)(_.Z,{className:"w-4 h-4"})})})]}):(0,a.jsx)("span",{className:"text-gray-400",children:"-"})})]})]})})]})}),(0,a.jsx)("div",{id:"logs",className:"mt-6",children:(0,a.jsxs)(n.Zb,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 pt-4",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Logs"}),(0,a.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:"(Logs are not streaming; click refresh to fetch the latest logs.)"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,a.jsx)(d.WH,{content:"Download full logs",className:"text-muted-foreground",children:(0,a.jsx)("button",{onClick:()=>(0,i.GH)({clusterName:t,jobIds:s?[s]:null,workspace:null==c?void 0:c.workspace}),className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,a.jsx)(h.Z,{className:"w-4 h-4"})})}),(0,a.jsx)(d.WH,{content:"Refresh logs",className:"text-muted-foreground",children:(0,a.jsx)("button",{onClick:()=>{T(e=>!e),D("")},disabled:I,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,a.jsx)(u.Z,{className:"w-4 h-4 ".concat(I?"animate-spin":"")})})})]})]}),(0,a.jsx)("div",{className:"p-4",children:P?(0,a.jsx)("div",{className:"bg-[#f7f7f7] flex items-center justify-center py-4 text-gray-500",children:(0,a.jsx)("span",{children:"Waiting for the job to start; refresh in a few moments."})}):I?(0,a.jsxs)("div",{className:"flex items-center justify-center py-4",children:[(0,a.jsx)(m.Z,{size:20,className:"mr-2"}),(0,a.jsx)("span",{children:"Loading..."})]}):(0,a.jsx)("div",{className:"max-h-96 overflow-y-auto",children:(0,a.jsx)(d.$B,{logs:R})})})]})})]})]})]})}t.default=w},9008:function(e,t,s){e.exports=s(37219)}},function(e){e.O(0,[616,6130,5739,7411,6989,3850,9353,2888,9774,179],function(){return e(e.s=94966)}),_N_E=e.O()}]);