var e=`mc-window-selected-project`,t=`mc-window-terminal-focus`;function n(){return typeof window<`u`&&window.sessionStorage!==void 0}function r(t){if(n())try{if(t==null){window.sessionStorage.removeItem(e);return}window.sessionStorage.setItem(e,JSON.stringify(t))}catch{}}function i(){if(!n())return null;try{let t=window.sessionStorage.getItem(e);if(t==null)return null;let n=JSON.parse(t);return typeof n==`string`?n:null}catch{return null}}function a(e){if(!e)return null;let{prefetchedScrollback:t,initialInput:n,...r}=e;return r}function o(e){if(n())try{let n={isOpen:e.isOpen,request:a(e.request),updatedAt:new Date().toISOString()};window.sessionStorage.setItem(t,JSON.stringify(n))}catch{}}function s(){if(!n())return null;try{let e=window.sessionStorage.getItem(t);if(!e)return null;let n=JSON.parse(e);if(typeof n?.isOpen!=`boolean`)return null;let r=n.request&&typeof n.request==`object`&&typeof n.request.cwd==`string`?a(n.request):null;return{isOpen:n.isOpen,request:n.isOpen?r:null,updatedAt:typeof n.updatedAt==`string`?n.updatedAt:new Date().toISOString()}}catch{return null}}var c=[`isVisible`,`activeTabKey`,`activeWindowId`,`activeGroupId`,`activeIsSplit`,`activeTabs`];function l(e){let t={...e};for(let e of c)delete t[e];return t}export{o as a,r as i,s as n,l as r,i as t};