"use strict";(self.webpackChunka_jupyterlab_session=self.webpackChunka_jupyterlab_session||[]).push([[568],{568:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var i=a(980),n=a(250),o=a(571);const s={id:"a-jupyterlab-session:plugin",autoStart:!0,requires:[n.IContents],activate:(e,t)=>{const a=".sessions",n="requirements.txt";t.ready.then((async()=>{console.log("JupyterLite server extension a-jupyterlab-session is activated!");const s=await t.storage,r=new Date;await s.getItem(a)||await s.setItem(a,{name:a,path:a,last_modified:r.toISOString(),created:r.toISOString(),format:"json",mimetype:"",content:null,size:0,writable:!0,type:"directory"});const c=r.toLocaleDateString("en-us",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h24"}).replace(/\//g,".").replace(", ","-"),d=(0,o.v4)().slice(0,8),l=i.PathExt.join(a,`${c}-${d}`);await s.setItem(l,{name:i.PathExt.basename(l),path:l,last_modified:r.toISOString(),created:r.toISOString(),format:"json",mimetype:"",content:null,size:0,writable:!0,type:"directory"}),e.commands.commandChanged.connect(((t,{id:a,type:i})=>{"filebrowser:open-path"===a&&"added"===i&&e.commands.execute("filebrowser:open-path",{path:l}).catch((e=>console.warn(`Failed to navigate to the new session folder: ${e}`)))})),await t.copy(n,l).catch((e=>console.warn(`Failed to copy the ${n} file to the new session: ${e}`)))}))}}}}]);