efficient-shell 7.28.0 → 7.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/{Browser-CUAQCAZ2.js → Browser-5DWPCWSB.js} +14 -14
  2. package/dist/Calculator-756J7AGT.js +29 -0
  3. package/dist/ConfirmDialog-GY3PLMAD.js +1 -0
  4. package/dist/{CurrencyConverter-ZIERKELA.js → CurrencyConverter-TVIYMDYE.js} +9 -9
  5. package/dist/{Documents-GOOHQYBQ.js → Documents-ZHENRDK2.js} +4 -4
  6. package/dist/Files-YKUTWABM.js +87 -0
  7. package/dist/{Notepad-YV4JDSRK.js → Notepad-7MXZE6S4.js} +10 -10
  8. package/dist/PdfViewer-T6SP6R6J.js +1 -0
  9. package/dist/{PomodoroTimer-GYLJIAWS.js → PomodoroTimer-IUPEDDQV.js} +6 -6
  10. package/dist/{Preview-K4QOB3J2.js → Preview-6XGCKFXK.js} +23 -23
  11. package/dist/Sidebar-P3WJQSY5.js +44 -0
  12. package/dist/{Spreadsheet-7WU4NDJP.js → Spreadsheet-POFCH3DZ.js} +12 -12
  13. package/dist/{Stock-7AOF4PKL.js → Stock-MKUCNEAH.js} +6 -6
  14. package/dist/{Weather-23SUCMNL.js → Weather-6Q7DSJR4.js} +15 -15
  15. package/dist/{WorldClock-ENURKJG6.js → WorldClock-LTJJP4SS.js} +4 -4
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/ui-check.js +1 -1
  18. package/dist/{chunk-IUBESHKK.js → chunk-2ECESCBH.js} +1 -1
  19. package/dist/{chunk-EZ73LTEI.js → chunk-2PNYIWIN.js} +1 -1
  20. package/dist/{chunk-KROUETJQ.js → chunk-4EMCPU7W.js} +18 -18
  21. package/dist/{chunk-A22D3FXG.js → chunk-BDXFODVC.js} +2 -2
  22. package/dist/chunk-BTLM7W6P.js +1 -0
  23. package/dist/{chunk-ITW5DB2J.js → chunk-C4QIJNW3.js} +12 -12
  24. package/dist/{chunk-4MSDABE3.js → chunk-DFCTQOIL.js} +1 -1
  25. package/dist/{chunk-5TFUQOEM.js → chunk-DFEO2CGF.js} +1 -1
  26. package/dist/{chunk-FHKJQU3U.js → chunk-EFYGUYEZ.js} +8 -8
  27. package/dist/{chunk-7776CT23.js → chunk-GPHWFPXA.js} +1 -1
  28. package/dist/{chunk-HCQ7SIGC.js → chunk-H3ODY2XB.js} +1 -1
  29. package/dist/{chunk-AHBO5PKR.js → chunk-IIIUHK3J.js} +8 -8
  30. package/dist/{chunk-BJN6DNDM.js → chunk-JIHKEOLY.js} +1 -1
  31. package/dist/{chunk-MQUGCJRS.js → chunk-LKFJPLTO.js} +208 -208
  32. package/dist/{chunk-QHL3LL5F.js → chunk-LU7X6LLY.js} +28 -28
  33. package/dist/{chunk-I4GL7BVS.js → chunk-OD3MT6SF.js} +2 -2
  34. package/dist/{chunk-XTAGVLZJ.js → chunk-RAFTWZF5.js} +1 -1
  35. package/dist/{chunk-QJ4YAH34.js → chunk-REZ2UWJT.js} +41 -41
  36. package/dist/{chunk-ABXVRYKR.js → chunk-T3UAIICC.js} +1 -1
  37. package/dist/chunk-V5MNUKAJ.js +1 -0
  38. package/dist/{chunk-76VZ67RK.js → chunk-X6ALQ2S6.js} +3 -3
  39. package/dist/{chunk-SUXBGACL.js → chunk-YO4FRA7Y.js} +6 -6
  40. package/dist/{chunk-EBTCC5N3.js → chunk-Z756FAL6.js} +9 -9
  41. package/dist/file-intake/index.js +1 -1
  42. package/dist/i18n/index.d.ts +1 -1
  43. package/dist/{index-HJwNWiNU.d.ts → index-CLkh3Bps.d.ts} +42 -2
  44. package/dist/index.d.ts +3 -3
  45. package/dist/index.js +56 -56
  46. package/dist/locales/zh-Hans.d.ts +1 -1
  47. package/dist/locales/zh-Hans.js +1 -1
  48. package/dist/map/index.js +7 -7
  49. package/dist/page-tabs/index.js +4 -4
  50. package/dist/pdf/index.js +1 -1
  51. package/dist/{strings-BuYlsGKG.d.ts → strings-DzmlWMRe.d.ts} +2 -0
  52. package/dist/telemetry/index.js +1 -1
  53. package/dist/ui/index.d.ts +2 -2
  54. package/dist/ui/index.js +1 -1
  55. package/package.json +1 -1
  56. package/dist/Calculator-YQS2NTUZ.js +0 -29
  57. package/dist/ConfirmDialog-YZCM3HJP.js +0 -1
  58. package/dist/Files-R4Z3BYJL.js +0 -87
  59. package/dist/PdfViewer-JLIMTMVK.js +0 -1
  60. package/dist/Sidebar-4RJEWBBN.js +0 -44
  61. package/dist/chunk-3VYANOTN.js +0 -1
  62. package/dist/chunk-KWW5PPQN.js +0 -1
@@ -1,29 +0,0 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-7776CT23.js";import{useWidgetSettings as n}from"./chunk-QJ4YAH34.js";import"./chunk-DSSLOQDW.js";import"./chunk-HCQ7SIGC.js";import"./chunk-SUXBGACL.js";import"./chunk-5A7MWTXX.js";import"./chunk-NVFKXL52.js";import"./chunk-XZXMVACA.js";import"./chunk-WOZ36LPR.js";import"./chunk-KROUETJQ.js";import"./chunk-GNW45MGV.js";import"./chunk-UVBK6YSR.js";import"./chunk-7IQ3B77H.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import"./chunk-D65T4H6J.js";import"./chunk-KNUR2UEG.js";import"./chunk-EZ73LTEI.js";import"./chunk-C3QOHMR6.js";import{Icon as r}from"./chunk-B427NVDP.js";import{useState as l,useRef as c,useCallback as i,useEffect as a}from"react";import{jsxs as o,Fragment as s,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function d(){const[d,m]=l("0"),[k,b]=l(null),[p,g]=l(null),[N,y]=l(!1),[x,f]=l(""),[v,C]=l([]),[$,j]=l(!1),[E,w]=l(()=>e(h)),[S,T]=l(!1),[A,W]=l(E),B=c(null);n(i(()=>{W({...E}),T(!0)},[E]));const L=i(e=>{f(""),m(t=>N||"0"===t?(y(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[N]),X=i(()=>{m("0"),b(null),g(null),y(!1)},[]),F=i((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),O=i(e=>{const t=parseFloat(d);if(null!==k&&p&&!N){const e=F(k,t,p);m(String(e)),b(e),C(n=>[`${k} ${p} ${t} = ${e}`,...n].slice(0,20))}else b(t);g(e),y(!0)},[d,k,p,N,F]),Q=i(()=>{if(null===k||!p)return;const e=parseFloat(d),t=F(k,e,p),n=`${k} ${p} ${e} =`;C(e=>[`${n} ${t}`,...e].slice(0,20)),f(n),m(String(t)),b(null),g(null),y(!0)},[d,k,p,F]),D=i(()=>{m(e=>String(parseFloat(e)/100))},[]),G=i(()=>{m(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);a(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?L(e.key):"."===e.key?L("."):"+"===e.key?O("+"):"-"===e.key?O("-"):"*"===e.key?O("×"):"/"===e.key?(e.preventDefault(),O("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&B.current?.contains(e.target)&&e.preventDefault(),Q()):"Escape"===e.key?X():"Backspace"===e.key?m(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&D())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[L,O,Q,X,D]);const I="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",R=`${I} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,U=`${I} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,H=`${I} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,J=`${I} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
- return o(s,{children:[
3
- /* @__PURE__ */o("div",{ref:B,className:"flex flex-col h-full",style:{opacity:E.activeOpacity/100,backdropFilter:E.activeBlur>0?`blur(${E.activeBlur}px)`:void 0},children:[
4
- /* @__PURE__ */o("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
5
- /* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:v.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(x||p&&null!==k)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:x||`${k} ${p} ${N?"":d}`}),
6
- /* @__PURE__ */o("div",{className:"flex items-center gap-2",children:[
7
- /* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(d),j(!0),setTimeout(()=>j(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,$?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
8
- /* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(d)})]})]}),
9
- /* @__PURE__ */o("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
10
- /* @__PURE__ */u("button",{onClick:X,className:H,children:"AC"}),
11
- /* @__PURE__ */u("button",{onClick:G,className:H,children:"+/−"}),
12
- /* @__PURE__ */u("button",{onClick:D,className:H,children:"%"}),
13
- /* @__PURE__ */u("button",{onClick:()=>O("÷"),className:`${U} ${"÷"===p?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
- /* @__PURE__ */u("button",{onClick:()=>L("7"),className:R,children:"7"}),
15
- /* @__PURE__ */u("button",{onClick:()=>L("8"),className:R,children:"8"}),
16
- /* @__PURE__ */u("button",{onClick:()=>L("9"),className:R,children:"9"}),
17
- /* @__PURE__ */u("button",{onClick:()=>O("×"),className:`${U} ${"×"===p?"ring-2 ring-blue-400":""}`,children:"×"}),
18
- /* @__PURE__ */u("button",{onClick:()=>L("4"),className:R,children:"4"}),
19
- /* @__PURE__ */u("button",{onClick:()=>L("5"),className:R,children:"5"}),
20
- /* @__PURE__ */u("button",{onClick:()=>L("6"),className:R,children:"6"}),
21
- /* @__PURE__ */u("button",{onClick:()=>O("-"),className:`${U} ${"-"===p?"ring-2 ring-blue-400":""}`,children:"−"}),
22
- /* @__PURE__ */u("button",{onClick:()=>L("1"),className:R,children:"1"}),
23
- /* @__PURE__ */u("button",{onClick:()=>L("2"),className:R,children:"2"}),
24
- /* @__PURE__ */u("button",{onClick:()=>L("3"),className:R,children:"3"}),
25
- /* @__PURE__ */u("button",{onClick:()=>O("+"),className:`${U} ${"+"===p?"ring-2 ring-blue-400":""}`,children:"+"}),
26
- /* @__PURE__ */u("button",{onClick:()=>L("0"),className:`${R} col-span-2`,children:"0"}),
27
- /* @__PURE__ */u("button",{onClick:()=>L("."),className:R,children:"."}),
28
- /* @__PURE__ */u("button",{onClick:Q,className:J,children:"="})]})]}),
29
- /* @__PURE__ */u(t,{open:S,onClose:()=>T(!1),title:"Calculator Settings",appearance:A,onAppearanceChange:W,onSave:()=>{w(A),localStorage.setItem(h,JSON.stringify(A)),T(!1)}})]})}export{d as default};
@@ -1 +0,0 @@
1
- export{ConfirmProvider,confirm,confirmDestructive,prompt,useConfirm}from"./chunk-KROUETJQ.js";import"./chunk-UVBK6YSR.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import"./chunk-EZ73LTEI.js";import"./chunk-C3QOHMR6.js";import"./chunk-B427NVDP.js";
@@ -1,87 +0,0 @@
1
- import{openPreviewFile as e}from"./chunk-XTAGVLZJ.js";import{Breadcrumbs as t}from"./chunk-ABXVRYKR.js";import{SidebarLayout as a}from"./chunk-A22D3FXG.js";import{TH_ONE_LINE as r}from"./chunk-RYBDLJJV.js";import{getFilesDemoTree as n}from"./chunk-MZHH3MC7.js";import{AboutApp as s}from"./chunk-76VZ67RK.js";import{peekFilesViewRequest as i,consumeFilesViewRequest as l,FILES_SHOW_TRASH_EVENT as o,FILES_OPEN_DESKTOP_FOLDER_EVENT as d,subscribeDesktopFolders as c,getDesktopFoldersSnapshot as m,FolderGlyph as h,DesktopItemMiniIcon as p,desktopItemTypeLabel as u}from"./chunk-Y6UUDJNU.js";import"./chunk-ESL5TDNA.js";import"./chunk-VTVSMRFX.js";import{useWindowManager as f,WindowTitle as x}from"./chunk-QJ4YAH34.js";import"./chunk-DSSLOQDW.js";import"./chunk-HCQ7SIGC.js";import{toast_default as g}from"./chunk-3VYANOTN.js";import"./chunk-SUXBGACL.js";import"./chunk-5A7MWTXX.js";import{LoadingSpinner as y}from"./chunk-NVFKXL52.js";import"./chunk-XZXMVACA.js";import"./chunk-WOZ36LPR.js";import{confirm as b,prompt as k}from"./chunk-KROUETJQ.js";import"./chunk-GNW45MGV.js";import"./chunk-UVBK6YSR.js";import"./chunk-7IQ3B77H.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import"./chunk-D65T4H6J.js";import"./chunk-KWW5PPQN.js";import"./chunk-KNUR2UEG.js";import"./chunk-EZ73LTEI.js";import"./chunk-C3QOHMR6.js";import{formatBytes as N}from"./chunk-W32SKK3D.js";import{Icon as w}from"./chunk-B427NVDP.js";import{useState as v,useEffect as $,useSyncExternalStore as j,useRef as C,useCallback as L}from"react";import{jsxs as D,jsx as E,Fragment as T}from"react/jsx-runtime";var R="undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000",S={pdf:"pdf",dxf:"dxf",csv:"csv",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",avif:"image",bmp:"image",stp:"3d",step:"3d",stl:"3d",obj:"3d",gltf:"3d",glb:"3d","3mf":"3d",iges:"3d",igs:"3d",ply:"3d",fbx:"3d"};function A(e,t){return"/"===e||""===e?"/"+t:e.replace(/\/$/,"")+"/"+t}function P(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?"—":t.toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return e}}function W(){const W=R.replace(/\/$/,""),F=null!==n(),[I,O]=v("/"),[U,M]=v([]),[V,B]=v([]),[K,z]=v(null),[H,J]=v(!0),[X,Q]=v(!1),[G,_]=v(null),[Y,Z]=v(!1),[q,ee]=v(()=>{const e=i();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"});$(()=>{l()},[]);const[te,ae]=v([]);$(()=>{const e=()=>{l(),ee("trash")},t=e=>{l();const t=e.detail?.folderId;t&&ee({desktopFolderId:t})};return window.addEventListener(o,e),window.addEventListener(d,t),()=>{window.removeEventListener(o,e),window.removeEventListener(d,t)}},[]);const re=j(c,m,m),ne="object"==typeof q?q.desktopFolderId:null,se=ne?re?.folders.find(e=>e.id===ne)??null:null,ie=ne&&re?.itemsByFolder[ne]||[];$(()=>{ne&&re&&!re.folders.some(e=>e.id===ne)&&ee("files")},[ne,re]);const le=C(0),oe=C(null),{openPage:de,openEntity:ce}=f(),me=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>de(e)}):"page"===t.entityType?de(t.entityId):ce(t.entityType,t.entityId,null,t.label)},he=L((e,t={})=>fetch(e,{...t,credentials:"include"}),[]),pe=L(async()=>{try{const e=await he(`${W}/api/quota`);if(e.ok){const t=await e.json();_({used:t.used,limit:t.limit})}}catch{}},[he,W]),ue=L(async e=>{if(z(null),F){const t=function(e){const t=n();if(!t)return[];let a=t;for(const t of e.split("/").filter(Boolean)){const e=a.find(e=>"folder"===e.kind&&e.name===t);if(!e||!e.children)return[];a=e.children}return a.map(e=>({name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}(e);return M(t),O(e),Q(!1),J(!1),void("/"===e&&B(t.filter(e=>"folder"===e.kind).map(e=>e.name)))}J(!0);try{const t=await he(`${W}/api/files?path=${encodeURIComponent(e)}`);if(!t.ok){const e=await t.json().catch(()=>({}));return void g.error(e.error||`Failed to list (${t.status})`)}const a=await t.json(),r=a.entries||[];M(r),O(a.path||e),Q(!1),"/"===(a.path||e)&&B(r.filter(e=>"folder"===e.kind).map(e=>e.name))}catch(e){Q(!0)}finally{J(!1)}pe()},[he,W,pe,F]),fe=L(async()=>{if(F)return ae([]),void J(!1);J(!0),z(null);try{const e=await he(`${W}/api/trash`);if(!e.ok){const t=await e.json().catch(()=>({}));return void g.error(t.error||`Failed to list trash (${e.status})`)}const t=await e.json();ae(t.entries||[]),Q(!1)}catch{Q(!0)}finally{J(!1)}pe()},[he,W,pe,F]);$(()=>{"files"===q?ue(I):"trash"===q&&fe()},[I,q]);const xe=async e=>{const t=A(I,e.name);try{const a=await he(`${W}/api/file?path=${encodeURIComponent(t)}`);if(!a.ok)return void g.error(`Download failed (${a.status})`);const r=await a.blob(),n=URL.createObjectURL(r),s=document.createElement("a");s.href=n,s.download=e.name,s.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}catch(e){g.error(e?.message||"Download failed")}},ge=async e=>{const t=Array.from(e);for(const e of t){const t=new FormData;t.append("file",e);try{const a=await he(`${W}/api/upload?path=${encodeURIComponent(I)}`,{method:"POST",body:t});if(!a.ok){const t=await a.json().catch(()=>({}));if(413===a.status){const a=Math.max(0,(t.limit||0)-(t.used||0));g.error(`Quota exceeded — ${N(a)} free, ${e.name} is ${N(t.attempted||e.size)}`)}else g.error(`Upload ${e.name}: ${t.error||a.status}`)}}catch(t){g.error(`Upload ${e.name}: ${t?.message||"failed"}`)}}ue(I)},ye=()=>{le.current=0,Z(!1)};if($(()=>{const e=()=>ye();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]),X)/* @__PURE__ */
2
- return D("div",{className:"flex flex-col h-full bg-white",children:[
3
- /* @__PURE__ */E(x,{title:"Files - offline"}),
4
- /* @__PURE__ */E("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */D("div",{className:"max-w-md",children:[
5
- /* @__PURE__ */E(w,{name:"close-circle",className:"h-12 w-12 mx-auto text-gray-300 mb-3",strokeWidth:1.4}),
6
- /* @__PURE__ */E("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:"Can't reach the file server"}),
7
- /* @__PURE__ */D("p",{className:"text-sm text-gray-500 mb-3",children:["No response from ",
8
- /* @__PURE__ */E("span",{className:"font-mono",children:W}),". Make sure the server is running — see ",
9
- /* @__PURE__ */E("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]}),
10
- /* @__PURE__ */E("button",{onClick:()=>ue(I),className:"px-3 h-8 text-sm bg-blue-500 text-white rounded hover:bg-blue-600",children:"Retry"})]})})]});const be="/"===I?[]:I.split("/").filter(Boolean),ke=G&&G.limit>0?Math.min(100,Math.round(G.used/G.limit*100)):0,Ne=ke>90?"bg-red-500":ke>75?"bg-amber-500":"bg-blue-500",we=[{label:"My files",onClick:()=>O("/")},...be.map((e,t)=>({label:e,onClick:()=>O("/"+be.slice(0,t+1).join("/"))}))],ve=e=>"flex w-full items-center gap-2 rounded-md px-3 min-h-(--row-height-menu) py-2 text-left text-sm transition-colors "+(e?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),$e=e=>/* @__PURE__ */E("svg",{className:"h-4 w-4 shrink-0 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.6,children:/* @__PURE__ */E("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),je=/* @__PURE__ */D("nav",{className:"p-2",children:[
11
- /* @__PURE__ */E("div",{className:"px-2 py-2 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:"Locations"}),
12
- /* @__PURE__ */D("button",{onClick:()=>{ee("files"),O("/")},className:ve("files"===q&&"/"===I),children:[$e("M2.25 12l8.954-8.955a1.5 1.5 0 012.122 0L21.75 12M4.5 9.75v9.75a.75.75 0 00.75.75H9V15a.75.75 0 01.75-.75h4.5A.75.75 0 0115 15v5.25h3.75a.75.75 0 00.75-.75V9.75"),"My files"]}),V.map(e=>/* @__PURE__ */D("button",{onClick:()=>{ee("files"),O("/"+e)},className:ve("files"===q&&I==="/"+e),children:[$e("M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"),
13
- /* @__PURE__ */E("span",{className:"truncate",children:e})]},e)),!F&&/* @__PURE__ */D("button",{onClick:()=>ee("trash"),className:ve("trash"===q),children:[$e("M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79"),"Trash"]}),re&&re.folders.length>0&&/* @__PURE__ */D(T,{children:[
14
- /* @__PURE__ */E("div",{className:"px-2 pt-3 pb-2 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:"Desktop"}),re.folders.map(e=>/* @__PURE__ */D("button",{onClick:()=>ee({desktopFolderId:e.id}),className:ve(ne===e.id),children:[
15
- /* @__PURE__ */E(h,{className:"h-4 w-4 shrink-0 text-amber-500"}),
16
- /* @__PURE__ */E("span",{className:"truncate",children:e.name}),e.itemCount>0&&/* @__PURE__ */E("span",{className:"ml-auto text-2xs text-gray-400 tabular-nums",children:e.itemCount})]},e.id))]})]});/* @__PURE__ */
17
- return D("div",{className:"relative flex flex-col h-full bg-white",onDragEnter:e=>{F||"object"==typeof q||e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),le.current++,Y||Z(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{le.current>0&&le.current--,0===le.current&&Z(!1)},onDrop:e=>{e.preventDefault(),ye(),F||"object"==typeof q||e.dataTransfer.files?.length&&ge(e.dataTransfer.files)},children:[
18
- /* @__PURE__ */E(x,{title:se?`Files - ${se.name}`:"Files"+("/"===I?"":" - "+I)}),
19
- /* @__PURE__ */E(s,{app:"files"}),
20
- /* @__PURE__ */E("input",{ref:oe,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&ge(e.target.files),oe.current&&(oe.current.value="")}}),
21
- /* @__PURE__ */E("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */E(a,{sidebar:je,storageKey:"files.sidebarWidth",defaultWidth:200,minWidth:150,maxWidth:320,children:/* @__PURE__ */D("div",{className:"flex h-full min-w-0 flex-col",children:[
22
- /* @__PURE__ */D("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-gray-200 bg-gray-50 shrink-0 text-xs",children:[/* @__PURE__ */D(T,"files"===q?{children:[
23
- /* @__PURE__ */E("button",{onClick:()=>O(function(e){if("/"===e||""===e)return"/";const t=e.replace(/\/$/,""),a=t.lastIndexOf("/");return a<=0?"/":t.slice(0,a)}(I)),disabled:"/"===I,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",title:"Parent folder",children:/* @__PURE__ */E(w,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
24
- /* @__PURE__ */E("div",{className:"flex-1 min-w-0",children:/* @__PURE__ */E(t,{items:we,maxItems:5})}),
25
- /* @__PURE__ */E("button",{onClick:()=>ue(I),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */E(w,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),!F&&/* @__PURE__ */D(T,{children:[
26
- /* @__PURE__ */D("button",{onClick:()=>ee("trash"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",title:"Open trash",children:[
27
- /* @__PURE__ */E(w,{name:"trash",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Trash"]}),
28
- /* @__PURE__ */D("button",{onClick:async()=>{const e=await k({title:"New folder",placeholder:"Folder name",confirmLabel:"Create"});if(!e)return;if(/[\\/]/.test(e))return void g.error("Folder names cannot contain slashes");const t=A(I,e),a=await he(`${W}/api/folder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})});if(!a.ok){const e=await a.json().catch(()=>({}));return void g.error(e.error||`Create folder failed (${a.status})`)}ue(I)},className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",children:[
29
- /* @__PURE__ */E(w,{name:"folder-plus",className:"h-3.5 w-3.5",strokeWidth:1.5}),"New Folder"]}),
30
- /* @__PURE__ */D("button",{onClick:()=>oe.current?.click(),className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 flex items-center gap-1",children:[
31
- /* @__PURE__ */E(w,{name:"upload",className:"h-3.5 w-3.5",strokeWidth:1.8}),"Upload"]})]})]}:"trash"===q?{children:[
32
- /* @__PURE__ */E("button",{onClick:()=>ee("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */E(w,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
33
- /* @__PURE__ */E("span",{className:"flex-1 text-gray-700 font-medium px-2",children:"Trash"}),
34
- /* @__PURE__ */E("button",{onClick:fe,className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */E(w,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),
35
- /* @__PURE__ */E("button",{onClick:async()=>{if(0===te.length)return;if(!await b({title:"Empty trash",message:`${te.length} item${1===te.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"}))return;const e=await he(`${W}/api/trash`,{method:"DELETE"});if(!e.ok){const t=await e.json().catch(()=>({}));return void g.error(t.error||`Empty trash failed (${e.status})`)}fe()},disabled:0===te.length,className:"px-2 py-1 rounded text-red-600 hover:bg-red-50 disabled:opacity-30 flex items-center gap-1",children:"Empty trash"})]}:{children:[
36
- /* @__PURE__ */E("button",{onClick:()=>ee("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */E(w,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
37
- /* @__PURE__ */E(h,{className:"h-4 w-4 text-amber-500 ml-1"}),
38
- /* @__PURE__ */E("span",{className:"flex-1 text-gray-700 font-medium px-1 truncate",children:se?.name??"Desktop folder"}),
39
- /* @__PURE__ */E("span",{className:"text-2xs text-gray-400 px-2",children:"Desktop shortcuts"})]}),G&&/* @__PURE__ */D(T,{children:[
40
- /* @__PURE__ */E("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
41
- /* @__PURE__ */D("div",{className:"flex items-center gap-2",title:`${N(G.used)} of ${N(G.limit)} used`,children:[
42
- /* @__PURE__ */E("div",{className:"w-20 h-1.5 rounded-full bg-gray-200 overflow-hidden",children:/* @__PURE__ */E("div",{className:`h-full ${Ne} transition-all`,style:{width:`${ke}%`}})}),
43
- /* @__PURE__ */D("span",{className:"text-2xs text-gray-500 tabular-nums whitespace-nowrap",children:[N(G.used)," / ",N(G.limit)]})]})]})]}),
44
- /* @__PURE__ */E("div",{className:"flex-1 overflow-auto",children:"object"==typeof q?0===ie.length?/* @__PURE__ */E("div",{className:"p-10 text-center text-sm text-gray-400",children:"This desktop folder is empty. Drag shortcuts onto it on the desktop."}):/* @__PURE__ */D("table",{className:"w-full text-sm",children:[
45
- /* @__PURE__ */E("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */D("tr",{children:[
46
- /* @__PURE__ */E("th",{className:`${r} text-left font-medium px-3 h-8`,children:"Name"}),
47
- /* @__PURE__ */E("th",{className:`${r} text-left font-medium px-3 h-8 w-28`,children:"Type"}),
48
- /* @__PURE__ */E("th",{className:`${r} w-56`})]})}),
49
- /* @__PURE__ */E("tbody",{children:ie.map(e=>{const t=`${e.entityType}|${e.entityId}`;/* @__PURE__ */
50
- return D("tr",{onClick:()=>z(t),onDoubleClick:()=>me(e),className:"cursor-default border-b border-gray-100 "+(K===t?"bg-blue-50":"hover:bg-gray-50"),children:[
51
- /* @__PURE__ */D("td",{className:"px-3 h-8 flex items-center gap-2",children:[
52
- /* @__PURE__ */E(p,{item:e}),
53
- /* @__PURE__ */E("span",{className:"truncate",title:e.label,children:e.label})]}),
54
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-xs text-gray-500",children:u(e)}),
55
- /* @__PURE__ */D("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
56
- /* @__PURE__ */E("button",{onClick:t=>{t.stopPropagation(),me(e)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Open"}),
57
- /* @__PURE__ */E("button",{onClick:t=>{t.stopPropagation(),re?.moveToDesktop([e])},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs ml-1",children:"Move to desktop"}),
58
- /* @__PURE__ */E("button",{onClick:t=>{t.stopPropagation(),re?.removeShortcuts([e])},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Remove"})]})]},t)})})]}):"trash"===q?H&&0===te.length?/* @__PURE__ */E(y,{size:"sm",padding:"p-6",label:"Loading"}):0===te.length?/* @__PURE__ */E("div",{className:"p-10 text-center text-sm text-gray-400",children:"Trash is empty."}):/* @__PURE__ */D("table",{className:"w-full text-sm",children:[
59
- /* @__PURE__ */E("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */D("tr",{children:[
60
- /* @__PURE__ */E("th",{className:`${r} text-left font-medium px-3 h-8`,children:"Name"}),
61
- /* @__PURE__ */E("th",{className:`${r} text-left font-medium px-3 h-8`,children:"Original location"}),
62
- /* @__PURE__ */E("th",{className:`${r} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
63
- /* @__PURE__ */E("th",{className:`${r} text-right font-medium px-3 h-8 w-40`,children:"Deleted"}),
64
- /* @__PURE__ */E("th",{className:`${r} w-44`})]})}),
65
- /* @__PURE__ */E("tbody",{children:te.map(e=>/* @__PURE__ */D("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:[
66
- /* @__PURE__ */D("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===e.kind?/* @__PURE__ */E(w,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */E(w,{name:"page",className:"h-4 w-4 text-gray-400 shrink-0",strokeWidth:1.5}),
67
- /* @__PURE__ */E("span",{className:"truncate",title:e.name,children:e.name})]}),
68
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-gray-500 text-xs font-mono truncate",title:e.originalPath,children:e.originalPath||"—"}),
69
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-right tabular-nums text-gray-500",children:N(e.size)}),
70
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:e.deletedAt?P(e.deletedAt):"—"}),
71
- /* @__PURE__ */D("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
72
- /* @__PURE__ */E("button",{onClick:()=>(async e=>{const t=await he(`${W}/api/trash/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id})});if(!t.ok){const e=await t.json().catch(()=>({}));return void g.error(e.error||`Restore failed (${t.status})`)}g.success(`Restored "${e.name}"`),fe()})(e),className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Restore"}),
73
- /* @__PURE__ */E("button",{onClick:()=>(async e=>{if(!await b({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"}))return;const t=await he(`${W}/api/trash/${encodeURIComponent(e.id)}`,{method:"DELETE"});if(!t.ok){const e=await t.json().catch(()=>({}));return void g.error(e.error||`Delete failed (${t.status})`)}fe()})(e),className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete forever"})]})]},e.id))})]}):H&&0===U.length?/* @__PURE__ */E(y,{size:"sm",padding:"p-6",label:"Loading"}):0===U.length?/* @__PURE__ */D("div",{className:"p-10 text-center text-sm text-gray-400",children:["Empty folder.",!F&&/* @__PURE__ */D(T,{children:[" Drop files here or click ",
74
- /* @__PURE__ */E("span",{className:"font-medium",children:"Upload"}),"."]})]}):/* @__PURE__ */D("table",{className:"w-full text-sm",children:[
75
- /* @__PURE__ */E("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */D("tr",{children:[
76
- /* @__PURE__ */E("th",{className:`${r} text-left font-medium px-3 h-8`,children:"Name"}),
77
- /* @__PURE__ */E("th",{className:`${r} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
78
- /* @__PURE__ */E("th",{className:`${r} text-right font-medium px-3 h-8 w-40`,children:"Modified"}),
79
- /* @__PURE__ */E("th",{className:`${r} w-32`})]})}),
80
- /* @__PURE__ */E("tbody",{children:U.map(t=>/* @__PURE__ */D("tr",{onClick:()=>z(t.name),onDoubleClick:()=>{"folder"===t.kind?O(A(I,t.name)):(async t=>{if(F)return;const a=A(I,t.name),r=(t.name.split(".").pop()||"").toLowerCase(),n=S[r];n?await e({filePath:a,filename:t.name,kind:n,onStaged:e=>de(e)}):xe(t)})(t)},className:"cursor-default border-b border-gray-100 "+(K===t.name?"bg-blue-50":"hover:bg-gray-50"),children:[
81
- /* @__PURE__ */D("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===t.kind?/* @__PURE__ */E(w,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */E(w,{name:"page",className:"h-4 w-4 text-gray-400 shrink-0",strokeWidth:1.5}),
82
- /* @__PURE__ */E("span",{className:"truncate",title:t.name,children:t.name})]}),
83
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-right tabular-nums text-gray-500",children:"folder"===t.kind?"—":N(t.size)}),
84
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:P(t.modifiedAt)}),
85
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:!F&&/* @__PURE__ */D(T,{children:["file"===t.kind&&/* @__PURE__ */E("button",{onClick:e=>{e.stopPropagation(),xe(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs",children:"Download"}),
86
- /* @__PURE__ */E("button",{onClick:e=>{e.stopPropagation(),(async e=>{const t=await k({title:`Rename ${e.kind}`,defaultValue:e.name,confirmLabel:"Rename"});if(!t||t===e.name)return;if(/[\\/]/.test(t))return void g.error("Names cannot contain slashes");const a=A(I,e.name),r=A(I,t),n=await he(`${W}/api/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:a,to:r})});if(!n.ok){const e=await n.json().catch(()=>({}));return void g.error(e.error||`Rename failed (${n.status})`)}ue(I)})(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs ml-1",children:"Rename"}),
87
- /* @__PURE__ */E("button",{onClick:e=>{e.stopPropagation(),(async e=>{if(!await b({title:`Delete ${e.kind}`,message:`"${e.name}"${"folder"===e.kind?" and everything inside":""} will be permanently removed.`,confirmLabel:"Delete",variant:"danger"}))return;const t=A(I,e.name),a=await he(`${W}/api/files?path=${encodeURIComponent(t)}`,{method:"DELETE"});if(!a.ok){const e=await a.json().catch(()=>({}));return void g.error(e.error||`Delete failed (${a.status})`)}ue(I)})(t)},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete"})]})})]},t.name))})]})})]})})}),Y&&/* @__PURE__ */E("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */E("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop to upload"})})]})}export{W as default};
@@ -1 +0,0 @@
1
- export{PdfViewer as default,fitScale,pdfWasmParams}from"./chunk-ITW5DB2J.js";import"./chunk-3VYANOTN.js";import"./chunk-NVFKXL52.js";import"./chunk-K7PQXJO7.js";import"./chunk-EZ73LTEI.js";import"./chunk-C3QOHMR6.js";import"./chunk-B427NVDP.js";
@@ -1,44 +0,0 @@
1
- import{useAuth as e,parseOpenSections as t,readStored as a,RAIL_OPEN_SECTIONS_KEY as r,toggleOpenSection as n,writeStored as i}from"./chunk-S2PS4IOT.js";import{partitionNav as l,BrandMark as s,IconButton_default as o,openGlobalSearch as c,visibleNavChildren as d,visibleSectionItems as m,rowsContainRoute as h}from"./chunk-FHKJQU3U.js";import{navSections as u,startMenuCategories as p,TAB_STRIP_H as b,navIcons as g,sectionIcons as f}from"./chunk-DSSLOQDW.js";import"./chunk-5A7MWTXX.js";import"./chunk-NVFKXL52.js";import"./chunk-WOZ36LPR.js";import{PopupMenu as y,PopupMenuItem as x,PopupMenuDivider as N}from"./chunk-GNW45MGV.js";import"./chunk-UVBK6YSR.js";import"./chunk-7IQ3B77H.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import"./chunk-D65T4H6J.js";import{useShellStrings as v}from"./chunk-EZ73LTEI.js";import"./chunk-C3QOHMR6.js";import{Icon as k}from"./chunk-B427NVDP.js";import{useMemo as w,useState as C,useRef as j,useEffect as S,isValidElement as L,cloneElement as z}from"react";import{jsx as A,jsxs as W,Fragment as $}from"react/jsx-runtime";var I="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform),K=(e,t)=>["flex h-(--row-height-menu) w-full items-center gap-3 rounded-md px-3 text-left text-sm font-medium transition-colors",t?"justify-center px-0":"",e?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-100 hover:text-gray-900"].join(" "),M="flex size-[18px] shrink-0 items-center justify-center [&>svg]:size-[18px]";function T({open:e}){/* @__PURE__ */
2
- return A(k,{name:"chevron-down",className:"size-4 shrink-0 transition-transform "+(e?"rotate-180":""),strokeWidth:2,"aria-hidden":"true"})}function B({dir:e}){/* @__PURE__ */
3
- return A(k,"left"===e?{name:"chevron-double-left",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"}:{name:"chevron-double-right",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"})}function O({className:e}){/* @__PURE__ */
4
- return A(k,{name:"search",className:e,strokeWidth:2,"aria-hidden":"true"})}function R({width:R,collapsed:H,onToggleCollapsed:P,onOpen:D,activeRoute:_,profile:Q,user:J,onLogout:U,onSwitchToDesktop:V,onReportBug:X,onClose:E,navSections:F=u,navIcons:G=g,sectionIcons:Z=f,categories:Y=p,productName:q,productIcon:ee,tagline:te,adaptiveLogo:ae=!1,logoHasAlpha:re=null,logoIsLight:ne=null}){const ie=v().layout,{hasAnyPerm:le}=e(),se=w(()=>l(F,Y,le),[F,Y,le]),[oe,ce]=C(()=>t(a(r))),de=e=>ce(t=>{const a=n(t,e);return i(r,JSON.stringify([...a])),a}),[me,he]=C(null),[ue,pe]=C(!1),be=j(null);S(()=>{H||he(null)},[H]);const ge=(e,t)=>{he(null),e.onSelect?e.onSelect():D(e.to,!!t&&(e=>e.metaKey||e.ctrlKey||1===e.button)(t))},fe=(e,t)=>{const a=t[e];/* @__PURE__ */
5
- return A("span",{className:M,"aria-hidden":"true",children:a&&L(a)?z(a,{className:"size-[18px]"}):a})},ye=(e,t)=>{const a=d(e,le),r=e.menuLabel??e.label;if(a.length>0){const n=`child:${e.to}`,i=oe.has(n),l=!i&&h(a,_,le);/* @__PURE__ */
6
- return W("div",{children:[
7
- /* @__PURE__ */W("button",{type:"button",onClick:()=>de(n),"aria-expanded":i,className:K(l,!1),style:t>0?{paddingLeft:.75+1.75*t+"rem"}:void 0,children:[0===t&&fe(e.to,G),
8
- /* @__PURE__ */A("span",{className:"min-w-0 flex-1 truncate",children:r}),
9
- /* @__PURE__ */A(T,{open:i})]}),i&&/* @__PURE__ */A("div",{className:"space-y-0.5 pt-0.5",children:a.map(e=>ye(e,t+1))}),e.dividerAfter&&/* @__PURE__ */A("div",{className:"mx-2 my-2 border-t border-gray-200","aria-hidden":"true"})]},e.to)}const n=e.to===_;/* @__PURE__ */
10
- return W("div",{children:[
11
- /* @__PURE__ */W("button",{type:"button",onClick:t=>ge(e,t),onAuxClick:t=>{1===t.button&&ge(e,t)},"aria-current":n?"page":void 0,className:K(n,!1),style:t>0?{paddingLeft:.75+1.75*t+"rem"}:void 0,children:[0===t&&fe(e.to,G),
12
- /* @__PURE__ */A("span",{className:"min-w-0 flex-1 truncate",children:r})]}),e.dividerAfter&&/* @__PURE__ */A("div",{className:"mx-2 my-2 border-t border-gray-200","aria-hidden":"true"})]},e.to)},xe=(e,t)=>{const a=t?e.items:m(e,le);if(0===a.length)return null;const r="icon"in e&&e.icon?/* @__PURE__ */A("span",{className:M,"aria-hidden":"true",children:e.icon}):fe(e.label,Z),n=e.menuLabel??e.label,i=h(a,_,le),l="dividerAfter"in e&&e.dividerAfter;if(H)/* @__PURE__ */
13
- return W("div",{children:[
14
- /* @__PURE__ */A("button",{type:"button",title:n,"aria-label":n,"aria-haspopup":"menu","aria-expanded":me?.label===e.label,onClick:t=>{const r=t.currentTarget.getBoundingClientRect();he(t=>t?.label===e.label?null:{label:e.label,items:a,top:r.top})},className:K(i||me?.label===e.label,!0),children:r}),l&&/* @__PURE__ */A("div",{className:"mx-2 my-2 border-t border-gray-200","aria-hidden":"true"})]},e.label);const s=oe.has(e.label),o=`rosh-rail-${e.label.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}`;/* @__PURE__ */
15
- return W("div",{children:[
16
- /* @__PURE__ */W("button",{type:"button",onClick:()=>de(e.label),"aria-expanded":s,"aria-controls":o,className:K(!s&&i,!1),children:[r,
17
- /* @__PURE__ */A("span",{className:"min-w-0 flex-1 truncate",children:n}),
18
- /* @__PURE__ */A(T,{open:s})]}),
19
- /* @__PURE__ */A("div",{id:o,role:"group","aria-label":n,hidden:!s,className:"space-y-0.5 pt-0.5",children:s&&a.map(e=>ye(e,1))}),l&&/* @__PURE__ */A("div",{className:"mx-2 my-2 border-t border-gray-200","aria-hidden":"true"})]},e.label)},Ne=Q?.first_name?`${Q.first_name} ${Q.last_name||""}`.trim():J?.email||"",ve=(Q?.first_name?.charAt(0)||J?.email?.charAt(0)||"?").toUpperCase(),ke=Q?.avatar_url?/* @__PURE__ */A("img",{src:Q.avatar_url,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):/* @__PURE__ */A("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-blue-600 text-xs font-semibold text-white",children:ve}),we=ue?be.current?.getBoundingClientRect():void 0,Ce="px-3",je=se.erpSections.length>0||se.systemSections.length>0||se.virtualSections.length>0;/* @__PURE__ */
20
- return W("aside",{"aria-label":ie.navLabel,className:"fixed left-0 top-0 z-(--z-sidebar) flex h-dvh flex-col border-r border-gray-200 bg-white text-gray-800",style:{width:R},children:[
21
- /* @__PURE__ */W("div",{className:"flex shrink-0 items-center border-b border-gray-200 "+(H?"justify-center":"justify-between gap-2 pl-4 pr-2"),style:{height:b},children:[
22
- /* @__PURE__ */W("span",{className:"flex min-w-0 items-center gap-2",children:[ee&&/* @__PURE__ */A(s,{src:ee,alt:"",slot:"compact",surface:"light",adaptive:ae,hasAlpha:re,isLight:ne,size:28,decorative:!0}),!H&&/* @__PURE__ */W("span",{className:"min-w-0 leading-tight",children:[
23
- /* @__PURE__ */A("span",{className:"block truncate text-base font-bold tracking-wide text-gray-900",children:q??"Apps"}),te&&/* @__PURE__ */A("span",{className:"block truncate text-2xs font-medium text-gray-500",children:te})]})]}),E?/* @__PURE__ */A(o,{onClick:E,"aria-label":ie.closeMenu,children:/* @__PURE__ */A(k,{name:"close",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"})}):!H&&/* @__PURE__ */A("button",{type:"button",onClick:P,"aria-label":ie.collapseSidebar,title:`${ie.collapseSidebar} (${I?"⌘":"Ctrl"} .)`,className:"flex size-8 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900",children:/* @__PURE__ */A(B,{dir:"left"})})]}),
24
- /* @__PURE__ */A("div",{className:`shrink-0 pt-3 ${Ce}`,children:H?/* @__PURE__ */A("button",{type:"button",onClick:c,"aria-label":ie.search,title:`${ie.search} (${I?"⌘K":"Ctrl K"})`,className:K(!1,!0),children:/* @__PURE__ */A(O,{className:"size-[18px]"})}):/* @__PURE__ */W("button",{type:"button",onClick:c,className:"flex h-(--row-height-menu) w-full items-center gap-2 rounded-md border border-gray-200 bg-white px-3 text-left transition-colors hover:bg-gray-100",children:[
25
- /* @__PURE__ */A(O,{className:"size-3.5 text-gray-500"}),
26
- /* @__PURE__ */A("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-500",children:ie.search}),
27
- /* @__PURE__ */A("kbd",{className:"rounded border border-gray-200 bg-gray-100 px-2 py-0.5 font-mono text-2xs font-semibold text-gray-500",children:I?"⌘K":"Ctrl K"})]})}),
28
- /* @__PURE__ */W("nav",{"aria-label":ie.navLabel,className:`min-h-0 flex-1 overflow-y-auto pb-4 pt-3 ${Ce} ${H?"space-y-1":"space-y-0.5"}`,children:[H&&/* @__PURE__ */A("button",{type:"button",onClick:P,"aria-label":ie.expandSidebar,title:`${ie.expandSidebar} (${I?"⌘":"Ctrl"} .)`,className:`${K(!1,!0)} mb-3`,children:/* @__PURE__ */A(B,{dir:"right"})}),se.topItems.map(e=>{if(!H)return ye(e,0);const t=d(e,le),a=e.to===_||h(t,_,le),r=e.menuLabel??e.label;/* @__PURE__ */
29
- return W("div",{children:[
30
- /* @__PURE__ */A("button",{type:"button",title:r,"aria-label":r,onClick:a=>{if(0===t.length)return void ge(e,a);const r=a.currentTarget.getBoundingClientRect();he(a=>a?.label===e.to?null:{label:e.to,items:t,top:r.top})},className:K(a,!0),children:fe(e.to,G)}),e.dividerAfter&&/* @__PURE__ */A("div",{className:"mx-2 my-2 border-t border-gray-200","aria-hidden":"true"})]},e.to)}),se.topItems.length>0&&je&&!se.topItems[se.topItems.length-1].dividerAfter&&/* @__PURE__ */A("div",{className:"mx-2 my-2 border-t border-gray-200","aria-hidden":"true"}),se.erpSections.map(e=>xe(e,!1)),se.systemSections.map(e=>xe(e,!1)),se.virtualSections.map(e=>xe(e,!0)),se.footerSections.length>0&&/* @__PURE__ */A("div",{className:"mx-2 my-2 border-t border-gray-200","aria-hidden":"true"}),se.footerSections.map(e=>xe(e,!1))]}),
31
- /* @__PURE__ */A("div",{className:`shrink-0 border-t border-gray-200 py-2 ${Ce}`,children:/* @__PURE__ */W("button",{ref:be,type:"button",onClick:()=>pe(e=>!e),"aria-haspopup":"menu","aria-expanded":ue,"aria-label":H?ie.accountMenu(Ne):void 0,className:"flex w-full items-center gap-3 rounded-md hover:bg-gray-100 "+(H?"justify-center py-2":"px-2 py-2"),children:[ke,!H&&/* @__PURE__ */W("span",{className:"min-w-0 flex-1 text-left",children:[
32
- /* @__PURE__ */A("span",{className:"block truncate text-sm font-semibold text-gray-800",children:Ne}),J?.email&&Ne!==J.email&&/* @__PURE__ */A("span",{className:"block truncate text-2xs text-gray-500",children:J.email})]})]})}),ue&&we&&/* @__PURE__ */W(y,{portal:!0,minWidth:224,onClose:()=>pe(!1),style:{left:we.left,bottom:window.innerHeight-we.top+8},children:[H&&/* @__PURE__ */W("div",{className:"border-b border-gray-200 px-3 py-3",children:[
33
- /* @__PURE__ */A("p",{className:"truncate text-sm font-semibold text-gray-800",children:Ne}),J?.email&&/* @__PURE__ */A("p",{className:"truncate text-xs text-gray-500",children:J.email})]}),
34
- /* @__PURE__ */W(x,{onClick:()=>{pe(!1),D("/profile",!1)},children:[
35
- /* @__PURE__ */A(k,{name:"account",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),ie.profile]}),se.footerItems.map(e=>/* @__PURE__ */W(x,{onClick:()=>{pe(!1),ge(e)},children:[
36
- /* @__PURE__ */A("span",{className:"h-4 w-4 [&>svg]:size-4","aria-hidden":"true",children:G[e.to]}),e.menuLabel??e.label]},e.to)),X&&/* @__PURE__ */W(x,{onClick:()=>{pe(!1),X()},children:[
37
- /* @__PURE__ */A(k,{name:"error",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),ie.reportIssue]}),
38
- /* @__PURE__ */A(N,{}),V&&/* @__PURE__ */W($,{children:[
39
- /* @__PURE__ */W(x,{onClick:()=>{pe(!1),V()},children:[
40
- /* @__PURE__ */A(k,{name:"desktop",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),ie.switchToDesktop]}),
41
- /* @__PURE__ */A(N,{})]}),
42
- /* @__PURE__ */W(x,{danger:!0,onClick:()=>{pe(!1),U()},children:[
43
- /* @__PURE__ */A(k,{name:"logout",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),ie.signOut]})]}),me&&H&&/* @__PURE__ */A(y,{portal:!0,minWidth:220,onClose:()=>he(null),style:{left:R+6,top:Math.min(me.top,window.innerHeight-48*Math.min(me.items.length,10)-16)},children:me.items.flatMap(e=>{const t=d(e,le);return(t.length>0?t:[e]).map(e=>/* @__PURE__ */W(x,{onClick:()=>ge(e),children:[fe(e.to,G),
44
- /* @__PURE__ */A("span",{className:e.to===_?"font-semibold":"",children:e.menuLabel??e.label})]},e.to))})})]})}export{R as default};
@@ -1 +0,0 @@
1
- import{buttonClasses as t}from"./chunk-K7PQXJO7.js";import{currentShellStrings as e}from"./chunk-EZ73LTEI.js";var n="http://www.w3.org/2000/svg",o={},s=/* @__PURE__ */new Map;function r(t,e){let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className=e,document.body.appendChild(n)),n}var i={success:"M5 13l4 4L19 7",error:"M6 18L18 6M6 6l12 12",warning:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",loading:"M12 3a9 9 0 019 9",bell:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"};function a(t,e){const o=document.createElementNS(n,"svg");o.setAttribute("class",e),o.setAttribute("fill","none"),o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","2");const s=document.createElementNS(n,"path");return s.setAttribute("stroke-linecap","round"),"loading"!==t&&s.setAttribute("stroke-linejoin","round"),s.setAttribute("d",i[t]),o.appendChild(s),o}function c(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.textContent=e),n}function l(e,n,i){const l={...o,...i},d=l.placement??"top",u=l.sticky??!1,m=`${d}|${e}|${n}`;if(l.dedupe){const t=s.get(m);if(t)return t.restart(),{dismiss:t.dismiss}}"loading"!==e&&!1!==l.sound&&import("./sounds-FO772MN2.js").then(t=>{"success"===e?t.playSuccess():"error"===e?t.playError():t.playNotification()}).catch(()=>{});const p="bottom"===d?r("toast-container-bottom","fixed bottom-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col-reverse gap-2 items-center pointer-events-none"):r("toast-container","fixed top-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col gap-2 items-center pointer-events-none"),f="bottom"===d?"translateY(10px)":"translateY(-10px)",h=c("pointer-events-auto cursor-pointer rosh-toast");h.style.opacity="0",h.style.transform=`${f} scale(0.95)`,h.setAttribute("role","error"===e?"alert":"status"),h.setAttribute("aria-atomic","true"),h.appendChild(a(e,`h-4 w-4 rosh-tone-${e}${"loading"===e?" animate-spin":""}`));const v=document.createElement("span");if(v.textContent=n,h.appendChild(v),l.action){const{label:e,onClick:n}=l.action,o=document.createElement("button");o.type="button",o.className=t({variant:"link",size:"sm"}),o.textContent=e,o.addEventListener("click",t=>{t.stopPropagation(),g||(n(),b("action"))}),h.appendChild(o)}let y;p.appendChild(h),requestAnimationFrame(()=>{h.style.opacity="1",h.style.transform="translateY(0) scale(1)"});let g=!1;const b=t=>{g||(g=!0,y&&clearTimeout(y),s.delete(m),h.style.opacity="0",h.style.transform=`${f} scale(0.95)`,setTimeout(()=>h.remove(),300),l.onClose?.(t))},x=()=>b("dismissed"),E=l.duration??("info"===e?4500:3e3),C=()=>{y&&clearTimeout(y),u||(y=setTimeout(()=>b("timeout"),E))};return C(),h.addEventListener("mouseenter",()=>{y&&clearTimeout(y)}),h.addEventListener("mouseleave",()=>{g||C()}),h.addEventListener("click",x),s.set(m,{el:h,restart:C,dismiss:x}),{dismiss:x}}var d={success:(t,e)=>l("success",t,e),error:(t,e)=>l("error",t,e),warning:(t,e)=>l("warning",t,e),info:(t,e)=>l("info",t,e),notify:(t,n)=>function(t,n){!1!==(n?.sound??o.sound)&&import("./sounds-FO772MN2.js").then(t=>t.playNotification()).catch(()=>{});const s=r("notif-container","fixed top-4 right-4 z-(--z-toast) flex flex-col gap-3 items-end pointer-events-none"),i=c("pointer-events-auto cursor-pointer rosh-notif");i.style.opacity="0",i.style.transform="translateX(30px) scale(0.95)";const l=c("rosh-notif-badge");l.appendChild(a("bell","h-5 w-5"));const d=c("rosh-notif-body");d.append(c("rosh-notif-title",e().toast.notification),c("notif-msg rosh-notif-msg",t));const u=document.createElement("button");u.className="rosh-notif-close",u.textContent="×",i.append(l,d,u);const m=()=>{i.style.opacity="0",i.style.transform="translateX(30px) scale(0.95)",setTimeout(()=>i.remove(),300)};u.addEventListener("click",t=>{t.stopPropagation(),m()}),i.addEventListener("click",m),s.appendChild(i),requestAnimationFrame(()=>{i.style.opacity="1",i.style.transform="translateX(0) scale(1)"}),setTimeout(m,n?.duration??1e4)}(t,n),promise:(t,e,n)=>{const o=l("loading",e.loading,{...n,sticky:!0});return t.then(t=>{o.dismiss(),l("success","function"==typeof e.success?e.success(t):e.success,n)},t=>{o.dismiss(),l("error","function"==typeof e.error?e.error(t):e.error,n)}),t},configure:t=>{o={...t}}};export{d as toast_default};
@@ -1 +0,0 @@
1
- var r="7.28.0",a=r;export{a as APP_VERSION,r as VERSION};