efficient-shell 4.180.0 → 4.181.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 (65) hide show
  1. package/README.md +12 -0
  2. package/dist/Browser-QYHW6I6J.js +43 -0
  3. package/dist/Calculator-4K53PFBL.js +29 -0
  4. package/dist/ConfirmDialog-X2DPOYWO.js +1 -0
  5. package/dist/{CurrencyConverter-AMXUOQR2.js → CurrencyConverter-QEG6RFAS.js} +9 -9
  6. package/dist/Documents-SFNMDRYU.js +52 -0
  7. package/dist/Files-OX2UBSQQ.js +87 -0
  8. package/dist/Notepad-CNZEWFCR.js +25 -0
  9. package/dist/PdfViewer-UZGDE4HD.js +1 -0
  10. package/dist/PomodoroTimer-T6YAQFIE.js +91 -0
  11. package/dist/Preview-OOVIIQQG.js +182 -0
  12. package/dist/Sidebar-3NZRIL7F.js +44 -0
  13. package/dist/Spreadsheet-7NUDGOSX.js +37 -0
  14. package/dist/{Stock-GWVG2INU.js → Stock-BZFC2ROU.js} +6 -6
  15. package/dist/{Weather-APBCG4TO.js → Weather-S3N5OWYF.js} +17 -17
  16. package/dist/{WorldClock-2LMZYKWR.js → WorldClock-ACC3S6OA.js} +4 -4
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/{chunk-FORN7LG7.js → chunk-2DX65GOO.js} +1 -1
  20. package/dist/{chunk-6CFBF543.js → chunk-5IWSOLLY.js} +2 -2
  21. package/dist/chunk-FOEVG7RT.js +21 -0
  22. package/dist/chunk-GMMTTWHB.js +3 -0
  23. package/dist/chunk-LMIQV3NB.js +13 -0
  24. package/dist/{chunk-SVO3ES2E.js → chunk-MIAJQGWE.js} +1 -1
  25. package/dist/chunk-MSIN5HKX.js +9 -0
  26. package/dist/chunk-OD5KLVU5.js +1 -0
  27. package/dist/{chunk-ILTSTULF.js → chunk-P4SGJTK3.js} +1 -1
  28. package/dist/chunk-PQLVWCUI.js +11 -0
  29. package/dist/chunk-QRV7RNQX.js +24 -0
  30. package/dist/chunk-R3PCJLQF.js +993 -0
  31. package/dist/chunk-SBDIHKLU.js +108 -0
  32. package/dist/chunk-VJP3R52B.js +6 -0
  33. package/dist/chunk-XUF7VW4U.js +136 -0
  34. package/dist/chunk-ZDF5AR5W.js +10 -0
  35. package/dist/chunk-ZZKIKW62.js +29 -0
  36. package/dist/index.js +639 -656
  37. package/dist/map/index.js +22 -22
  38. package/dist/markdown/index.js +6 -6
  39. package/dist/page-tabs/index.js +5 -5
  40. package/dist/pdf/index.js +1 -1
  41. package/dist/ui/index.js +1 -1
  42. package/package.json +1 -1
  43. package/dist/Browser-RZFOKBSF.js +0 -43
  44. package/dist/Calculator-R5OEHQ67.js +0 -29
  45. package/dist/ConfirmDialog-CMNQZQA3.js +0 -1
  46. package/dist/Documents-VD32HWDQ.js +0 -52
  47. package/dist/Files-NAY3WK6O.js +0 -89
  48. package/dist/Notepad-AHRPMF57.js +0 -25
  49. package/dist/PdfViewer-3SC3LE4U.js +0 -1
  50. package/dist/PomodoroTimer-LE6J2KUU.js +0 -99
  51. package/dist/Preview-OKR5QRQP.js +0 -188
  52. package/dist/Sidebar-BQ4P5LBI.js +0 -44
  53. package/dist/Spreadsheet-RME4IQ43.js +0 -37
  54. package/dist/chunk-4VTHXNGZ.js +0 -1003
  55. package/dist/chunk-5ZDM6WIC.js +0 -24
  56. package/dist/chunk-7WZEFHPS.js +0 -6
  57. package/dist/chunk-AA4TMQOS.js +0 -10
  58. package/dist/chunk-BSJIBRWC.js +0 -1
  59. package/dist/chunk-C2A4PIGZ.js +0 -13
  60. package/dist/chunk-CIXQKCFA.js +0 -11
  61. package/dist/chunk-KVOFUFPP.js +0 -3
  62. package/dist/chunk-N6STBYXR.js +0 -112
  63. package/dist/chunk-RQOP5JAJ.js +0 -9
  64. package/dist/chunk-UAIVAA5X.js +0 -21
  65. package/dist/chunk-ZAE6ROV7.js +0 -29
@@ -1,24 +0,0 @@
1
- import{toast_default as e}from"./chunk-3DGTIWZP.js";import{useShellStrings as t}from"./chunk-J3LIIIHJ.js";import{createContext as n,useContext as r,useRef as a,useState as o,useEffect as i}from"react";import*as s from"pdfjs-dist";import{createPortal as l}from"react-dom";import{jsx as c,jsxs as d}from"react/jsx-runtime";function u(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var h=n(null);function m({children:e}){const t=r(h);return t?l(e,t):
2
- /* @__PURE__ */c("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||s.GlobalWorkerOptions.workerSrc||(s.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${s.version}/build/pdf.worker.min.mjs`);var p={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},f=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=p[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw u(n,t,a);return a}};function g(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:f}}var w=[50,75,100,125,150,200,300,400];function v(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function y({url:n,filename:r,fit:l="width",onDownload:u,onEmail:h,workerSrc:p,wasmUrl:f}){const y=t().pdf,b=a(null),x=a(null),k=a(null),[C,L]=o(null),[N,M]=o(1),[j,E]=o(0),[z,A]=o(1),[P,_]=o(!0),[D,W]=o(!0),S=a(y.loadFailed);S.current=y.loadFailed,i(()=>{let t=!1;return W(!0),M(1),p&&(s.GlobalWorkerOptions.workerSrc=p),s.getDocument({url:n,...g(f)}).promise.then(e=>{t||(L(e),E(e.numPages),W(!1))}).catch(()=>{t||(e.error(S.current),W(!1))}),()=>{t=!0}},[n,p,f]),i(()=>{if(!C||!P||!k.current)return;const e=()=>{const e=k.current;e&&C.getPage(N).then(t=>{if(!k.current)return;const n=t.getViewport({scale:1}),r=v(l,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});A(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(k.current),()=>t.disconnect()},[C,N,P,l]),i(()=>{if(!C||!b.current)return;let e=!1,t=null,n=null;return C.getPage(N).then(r=>{if(e||!b.current)return;const a=r.getViewport({scale:z}),o=b.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const l=x.current;l&&(l.replaceChildren(),l.style.setProperty("--total-scale-factor",String(a.scale)),n=new s.TextLayer({textContentSource:r.streamTextContent(),container:l,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",l.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[C,N,z]),i(()=>{const e=()=>x.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const T="page"===l?y.fitPage:y.fitWidth,$="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
3
- return d("div",{className:"flex flex-col h-full",children:[
4
- /* @__PURE__ */d(m,{children:[
5
- /* @__PURE__ */c("button",{type:"button","aria-label":y.previousPage,onClick:()=>M(e=>Math.max(1,e-1)),disabled:N<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})})}),
6
- /* @__PURE__ */c("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:y.pageOf(N,j)}),
7
- /* @__PURE__ */c("button",{type:"button","aria-label":y.nextPage,onClick:()=>M(e=>Math.min(j,e+1)),disabled:N>=j,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})}),
8
- /* @__PURE__ */c("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
9
- /* @__PURE__ */c("button",{type:"button","aria-label":y.zoomOut,title:y.zoomOut,onClick:()=>{_(!1),A(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:$,children:/* @__PURE__ */c("span",{"aria-hidden":"true",children:"−"})}),
10
- /* @__PURE__ */d("select",{value:P?"fit":w.includes(Math.round(100*z))?Math.round(100*z):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(_(!1),A(Number(t)/100)):_(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":y.zoom,title:y.zoom,children:[
11
- /* @__PURE__ */c("option",{value:"fit",children:T}),!P&&!w.includes(Math.round(100*z))&&/* @__PURE__ */d("option",{value:"custom",children:[Math.round(100*z),"%"]}),w.map(e=>/* @__PURE__ */d("option",{value:e,children:[e,"%"]},e))]}),
12
- /* @__PURE__ */c("button",{type:"button","aria-label":y.zoomIn,title:y.zoomIn,onClick:()=>{_(!1),A(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:$,children:/* @__PURE__ */c("span",{"aria-hidden":"true",children:"+"})}),
13
- /* @__PURE__ */c("button",{type:"button",onClick:()=>_(!0),"aria-pressed":P,className:$+(P?" bg-gray-200 text-gray-900":""),title:y.fitHint,children:y.fit}),
14
- /* @__PURE__ */c("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
15
- /* @__PURE__ */d("button",{type:"button",onClick:()=>{if(!C)return;const t=window.open("","_blank");if(!t)return void e.error(y.allowPopups);const n=[];for(let e=1;e<=j;e++)n.push(C.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(n).then(e=>{var n;t.document.write(`<html><head><title>${n=r,n.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),t.document.write(e.map(e=>`<img src="${e}"/>`).join("")),t.document.write("</body></html>"),t.document.close(),setTimeout(()=>{t.print(),t.close()},300)})},className:$,children:[
16
- /* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.72 13.829c-.24.03-.48.062-.72.096m.72-.096a42.415 42.415 0 0110.56 0m-10.56 0L6.34 18m10.94-4.171c.24.03.48.062.72.096m-.72-.096L17.66 18m0 0l.229 2.523a1.125 1.125 0 01-1.12 1.227H7.231c-.662 0-1.18-.568-1.12-1.227L6.34 18m11.318 0h1.091A2.25 2.25 0 0021 15.75V9.456c0-1.081-.768-2.015-1.837-2.175a48.055 48.055 0 00-1.913-.247M6.34 18H5.25A2.25 2.25 0 013 15.75V9.456c0-1.081.768-2.015 1.837-2.175a48.041 48.041 0 011.913-.247m10.5 0a48.536 48.536 0 00-10.5 0m10.5 0V3.375c0-.621-.504-1.125-1.125-1.125h-8.25c-.621 0-1.125.504-1.125 1.125v3.659M18 10.5h.008v.008H18V10.5zm-3 0h.008v.008H15V10.5z"})}),y.print]}),
17
- /* @__PURE__ */d("button",{type:"button",onClick:u??(()=>{const e=document.createElement("a");e.href=n,e.download=r,e.click()}),className:$,children:[
18
- /* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),y.download]}),h&&/* @__PURE__ */d("button",{type:"button",onClick:h,className:$,children:[
19
- /* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75"})}),y.email]})]}),
20
- /* @__PURE__ */c("div",{ref:k,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!C)return;if(e.ctrlKey||e.metaKey)return;const t=k.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&N<j?(e.preventDefault(),M(e=>Math.min(j,e+1)),requestAnimationFrame(()=>{k.current&&(k.current.scrollTop=0)})):e.deltaY<0&&n&&N>1&&(e.preventDefault(),M(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)}))},onKeyDown:e=>{if(!C)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?N<j&&(e.preventDefault(),M(e=>Math.min(j,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?N>1&&(e.preventDefault(),M(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),M(1)):"End"===e.key&&(e.preventDefault(),M(j)))},children:D?/* @__PURE__ */c("div",{className:"flex items-center justify-center h-full text-gray-500 text-sm",role:"status",children:y.loading}):/* @__PURE__ */d("div",{className:"min-h-full flex items-center justify-center p-4",children:[
21
- /* @__PURE__ */c("style",{children:'\n.preview-pdf-textlayer {\n position: absolute;\n inset: 0;\n overflow: clip;\n line-height: 1;\n text-align: initial;\n text-size-adjust: none;\n forced-color-adjust: none;\n transform-origin: 0 0;\n caret-color: CanvasText;\n --min-font-size: 1;\n --text-scale-factor: calc(var(--total-scale-factor, 1) * var(--min-font-size));\n --min-font-size-inv: calc(1 / var(--min-font-size));\n}\n.preview-pdf-textlayer :is(span, br) {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n transform-origin: 0% 0%;\n}\n.preview-pdf-textlayer > :not(.markedContent),\n.preview-pdf-textlayer .markedContent span:not(.markedContent) {\n z-index: 1;\n --font-height: 0;\n font-size: calc(var(--text-scale-factor) * var(--font-height));\n --scale-x: 1;\n --rotate: 0deg;\n transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));\n}\n.preview-pdf-textlayer .markedContent {\n display: contents;\n}\n.preview-pdf-textlayer span[role="img"] {\n user-select: none;\n cursor: default;\n}\n.preview-pdf-textlayer ::selection {\n background: rgba(0, 80, 255, 0.25);\n}\n.preview-pdf-textlayer br::selection {\n background: transparent;\n}\n.preview-pdf-textlayer .endOfContent {\n display: block;\n position: absolute;\n inset: 100% 0 0;\n z-index: 0;\n cursor: default;\n user-select: none;\n}\n.preview-pdf-textlayer.selecting .endOfContent {\n top: 0;\n}\n'}),
22
- /* @__PURE__ */d("div",{className:"relative shadow-lg rounded",children:[
23
- /* @__PURE__ */c("canvas",{ref:b,className:"block rounded"}),
24
- /* @__PURE__ */c("div",{ref:x,className:"preview-pdf-textlayer",onPointerDown:e=>e.currentTarget.classList.add("selecting")})]})]})})]})}export{m as PanelActions,y as PdfViewer,h as ToolbarSlotContext,v as fitScale,g as pdfWasmParams};
@@ -1,6 +0,0 @@
1
- import{useShellStrings as e}from"./chunk-J3LIIIHJ.js";import{Fragment as i}from"react";import{jsx as t,jsxs as a}from"react/jsx-runtime";var n=/* @__PURE__ */t("svg",{className:"h-3.5 w-3.5 shrink-0 text-gray-300",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 0 1 .02-1.06L11.168 10 7.23 6.29a.75.75 0 1 1 1.04-1.08l4.5 4.25a.75.75 0 0 1 0 1.08l-4.5 4.25a.75.75 0 0 1-1.06-.02Z",clipRule:"evenodd"})}),l="inline-flex min-w-0 items-center gap-1 truncate rounded px-1 -mx-1 text-gray-500 transition-colors hover:text-gray-900 hover:underline rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]";function s({items:s,separator:r,maxItems:c=0,className:m}){const o=e().breadcrumbs;if(0===s.length)return null;const h=r??n,d=[],u=s.length-1;if(c>0&&s.length>c&&c>=2){const e=Math.max(1,c-1);d.push({kind:"item",item:s[0],isLast:!1}),d.push({kind:"ellipsis"});for(let i=s.length-e;i<=u;i++)d.push({kind:"item",item:s[i],isLast:i===u})}else s.forEach((e,i)=>d.push({kind:"item",item:e,isLast:i===u}));/* @__PURE__ */
2
- return t("nav",{"aria-label":o.label,className:`min-w-0 ${m??""}`,children:/* @__PURE__ */t("ol",{className:"flex items-center gap-1.5 text-sm",children:d.map((e,n)=>/* @__PURE__ */a(i,{children:[n>0&&/* @__PURE__ */t("li",{"aria-hidden":!0,className:"flex items-center",children:h}),
3
- /* @__PURE__ */t("li",{className:"flex min-w-0 items-center",children:"ellipsis"===e.kind?/* @__PURE__ */t("span",{className:"px-0.5 text-gray-400 select-none","aria-label":o.hidden,children:"…"}):e.isLast||!e.item.href&&!e.item.onClick?/* @__PURE__ */a("span",{"aria-current":e.isLast?"page":void 0,className:"inline-flex min-w-0 items-center gap-1 truncate "+(e.isLast?"font-medium text-gray-900":"text-gray-500"),children:[e.item.icon,
4
- /* @__PURE__ */t("span",{className:"truncate",children:e.item.label})]}):e.item.href?/* @__PURE__ */a("a",{href:e.item.href,onClick:e.item.onClick,className:l,children:[e.item.icon,
5
- /* @__PURE__ */t("span",{className:"truncate",children:e.item.label})]}):/* @__PURE__ */a("button",{type:"button",onClick:e.item.onClick,className:l,children:[e.item.icon,
6
- /* @__PURE__ */t("span",{className:"truncate",children:e.item.label})]})})]},n))})})}export{s as Breadcrumbs};
@@ -1,10 +0,0 @@
1
- import{glassStyle as e,GLASS_DIVIDER as t}from"./chunk-HZZNJHRH.js";import{onOverlayOpen as n,registerModalEscapeInterceptor as r,Z_LAYERS as o}from"./chunk-X4FJ54PP.js";import{useHydrated as i,useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as l,forwardRef as u,useContext as c,useRef as s,useId as d,useState as p,useEffect as m,useMemo as h,useCallback as f}from"react";import{createPortal as g}from"react-dom";import{jsxs as y,jsx as x,Fragment as w}from"react/jsx-runtime";var b=/* @__PURE__ */new Set(["text","search","url","tel","email","password","number","date","datetime-local","month","week","time"]),v="data-native-context-menu";function k(e,t){return e&&"function"==typeof e.closest?e.closest(t):null}function C(e){const t=e;if(!t||"function"!=typeof t.closest)return!1;if(k(t,`[${v}]`))return!0;if(k(t,"textarea"))return!0;if(k(t,"img, picture, canvas, video, audio"))return!0;const n=k(t,"input");if(n){const e=(n.type||"text").toLowerCase();if(b.has(e))return!0}const r=k(t,"[contenteditable]");if(r){const e=(r.getAttribute("contenteditable")||"").toLowerCase();if(""===e||"true"===e||"plaintext-only"===e)return!0}return!1}var N=/* @__PURE__ */new Set(["http:","https:","mailto:","tel:","blob:"]);function L(e,t,n){const r=k(e,"a[href]"),o=(t||"").trim(),i=function(e,t){if(e&&"#"!==e)try{const n=new URL(e,t??("undefined"!=typeof document?document.baseURI:void 0));return N.has(n.protocol)?n.href:void 0}catch{return}}(r?.getAttribute("href"),n);return{kind:o?"selection":i?"link":"default",...o?{selectionText:o}:{},...i?{linkUrl:i}:{}}}function T(e){if(e.defaultPrevented)return!0;if(e.shiftKey)return!0;if("touch"===e.pointerType)return!0;return C(("function"==typeof e.composedPath?e.composedPath()[0]:void 0)??e.target)}function M(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function E(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function B(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function $(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),a=e-i/2;return a<n?n:a+i>r?Math.max(n,r-i):a}function P(e,t,n,r,o,i=!1,a=8){const l=t+o,u=e-o-n,c=u>=a;return i&&c?{left:u,flipped:!0}:l+n<=r-a?{left:l,flipped:!1}:c?{left:u,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function R(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var W=l(null),A=l(!1);function H({children:t,style:a,className:l="",onClose:u,minWidth:c=180,portal:f=!1}){const y=s(null),w=d(),[b,v]=p([]),k=s();m(()=>()=>clearTimeout(k.current),[]);const N=i(),L=h(()=>{const e=()=>clearTimeout(k.current);return{id:w,depth:0,path:b,open:(t,n)=>{e(),v(e=>M(e,t,n))},scheduleClose:t=>{e(),k.current=setTimeout(()=>v(e=>E(e,t)),200)},closeBelow:t=>{e(),v(e=>E(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),u?.()},root:y}},[w,b,u]);m(()=>{if(!u)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${w}"]`)||y.current&&!y.current.contains(e.target)&&u()},t=e=>{"Escape"===e.key&&u()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const o=n(u),i=r(()=>!1,()=>y.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),o(),i()}},[u,w]),m(()=>{const e=y.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const T=R(),B=/(^|[\s:])!?z-/.test(l),$=/* @__PURE__ */x("div",{ref:y,"data-popup-menu-tree":w,className:`fixed rounded-(--radius-popup) ${"tight"===T?"py-1":"large"===T?"py-2":"py-1.5"} ${l}`,onContextMenu:e=>{C(e.target)||e.preventDefault()},style:{...B?{}:{zIndex:o.menu},minWidth:c,animation:"popup-in 0.12s ease-out",...e(),...a},children:/* @__PURE__ */x(W.Provider,{value:L,children:t})});return f?N?g($,document.body):null:$}function j(e,t,n,r=!1){const o=R(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":"max(0.25rem, calc(var(--menu-padding-y, 0.5rem) - 0.1rem))";return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 hover:bg-red-50":r?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-blue-50 hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:i,paddingBottom:i}}}var D=/* @__PURE__ */x("svg",{"aria-hidden":!0,className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */x("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});function F({kind:e,checked:t}){/* @__PURE__ */
2
- return x("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&D}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&D})}var S=u(function({onClick:e,children:t,className:n="",danger:r,disabled:o,role:i,checked:a,tabIndex:l,id:u,onMouseEnter:s},d){const p=c(W),m=c(A),h=j(r,o,n),f=void 0===a?null:"menuitemradio"===i?"radio":"checkbox";/* @__PURE__ */
3
- return y("button",{ref:d,id:u,role:"radio"===f?"menuitemradio":"checkbox"===f?"menuitemcheckbox":i??(m?"menuitem":void 0),"aria-checked":f?a:void 0,tabIndex:l,onClick:()=>{e?.(),p&&p.depth>0&&"checkbox"!==f&&p.closeTree()},onMouseEnter:()=>{p?.scheduleClose(p.depth),s?.()},disabled:o,className:h.className,style:h.style,children:[f&&/* @__PURE__ */x(F,{kind:f,checked:!!a}),t]})}),I=/* @__PURE__ */x("svg",{"aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */x("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})});function z(e){let t=o.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function q(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function U({label:t,icon:n,children:o,disabled:i,className:l="",minWidth:u=180,maxHeight:p}){const b=c(W),v=d(),k=s(null),N=s(null),L=s(),T=s(!1),M=`${v}-menu`;m(()=>()=>clearTimeout(L.current),[]);const E=b?.depth??0,B=b?.path[E],A=!!B&&B.key===v&&!i,H=f(e=>{if(!b||i||!k.current)return;clearTimeout(L.current),T.current=e;const t=k.current.getBoundingClientRect(),n=k.current.closest("[data-popup-submenu-panel]")??k.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,o=E>0&&(b.path[E-1]?.flipped??!1),a=P(r.left,r.right,u,window.innerWidth,4,o);b.open(E,{key:v,y:t.top,...a})},[b,i,E,v,u]),D=e=>{b?.closeBelow(E),k.current?.focus()};m(()=>{if(A)return r(e=>"Escape"===e.key&&(!(b&&b.path.length>E+1)&&(D(),!0)),()=>N.current)}),a(()=>{if(!A||!B)return;const e=()=>{const e=N.current;if(!e||!k.current)return;const t=k.current.closest("[data-popup-submenu-panel]")??k.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??k.current.getBoundingClientRect(),r=E>0&&(b?.path[E-1]?.flipped??!1),o=e.offsetWidth||u,i=P(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=$(k.current.getBoundingClientRect().top+a/2,a,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${l}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),m(()=>{A&&T.current&&(T.current=!1,q(N.current)[0]?.focus())},[A]);const F=h(()=>b&&{...b,depth:E+1},[b,E]);if(!b)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const S=j(!1,i,l,A),U=R();/* @__PURE__ */
4
- return y(w,{children:[
5
- /* @__PURE__ */y("button",{ref:k,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":A,"aria-controls":A?M:void 0,disabled:i,"data-popup-submenu-row":!0,className:S.className,style:S.style,onClick:e=>{const t=0===e.detail;A?t&&q(N.current)[0]?.focus():H(t)},onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),H(!0))},onMouseEnter:()=>{i||(b.cancelClose(),A?b.closeBelow(E+1):(clearTimeout(L.current),L.current=setTimeout(()=>H(!1),120)))},onMouseLeave:()=>{clearTimeout(L.current),b.scheduleClose(E)},children:[n,
6
- /* @__PURE__ */x("span",{className:"min-w-0 flex-1 truncate",children:t}),I]}),A&&g(
7
- /* @__PURE__ */x("div",{ref:N,id:M,role:"menu","data-popup-menu-tree":b.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===U?"py-1":"large"===U?"py-2":"py-1.5"),style:{left:B.left,top:B.y,minWidth:u,maxHeight:void 0===p?"calc(100vh - 16px)":`min(${"number"==typeof p?`${p}px`:p}, calc(100vh - 16px))`,zIndex:z(b.root.current)+E+1,animation:(B.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...e()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=q(N.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),D())},onMouseEnter:()=>{b.cancelClose(),clearTimeout(L.current)},onMouseLeave:()=>b.scheduleClose(E+1),onContextMenu:e=>{C(e.target)||e.preventDefault()},children:/* @__PURE__ */x(W.Provider,{value:F,children:o})}),document.body)]})}function J(){const e=R();/* @__PURE__ */
8
- return x("div",{className:`border-t ${t} ${"tight"===e?"my-0.5":"large"===e?"my-1.5":"my-1"} mx-3`})}function K({children:e}){const t=R(),n="tight"===t?"0.125rem":"large"===t?"0.375rem":"0.25rem";/* @__PURE__ */
9
- return x("div",{className:"text-xs font-medium uppercase tracking-wide",style:{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:n,paddingBottom:n},children:e})}function Z({d:e,className:t="h-4 w-4 text-gray-400"}){/* @__PURE__ */
10
- return x("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */x("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{F as MenuCheckMark,Z as MenuIcon,A as MenuSemanticsContext,v as NATIVE_MENU_ATTR,H as PopupMenu,J as PopupMenuDivider,S as PopupMenuItem,K as PopupMenuLabel,U as PopupSubmenu,$ as clampMenuTop,E as closeMenuBelow,L as describeContextTarget,j as itemLook,C as keepsNativeMenu,T as leavesContextMenuAlone,P as menuPanelLeft,M as openMenuLevel,B as resolveMenuLevels};
@@ -1 +0,0 @@
1
- var r="4.180.0",a=r;export{a as APP_VERSION,r as VERSION};
@@ -1,13 +0,0 @@
1
- import{navIcons as e}from"./chunk-DSSLOQDW.js";import{isValidElement as t,cloneElement as r}from"react";import{jsx as n,jsxs as o}from"react/jsx-runtime";var i=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function l(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r);return i[Math.abs(t)%i.length]}var a={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},d={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},s={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},c={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function p({className:e}){/* @__PURE__ */
2
- return n("svg",{className:e,fill:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */n("path",{d:"M2.25 7.125A2.25 2.25 0 014.5 4.875h4.504c.61 0 1.193.243 1.624.673l1.494 1.494a.75.75 0 00.53.22h7.098A2.25 2.25 0 0122 9.51v8.366A2.25 2.25 0 0119.75 20.125H4.25A2.25 2.25 0 012 17.875V7.125z"})})}function f(t,r){return r&&e[r]||(t?e[t]:void 0)}var u=/* @__PURE__ */n("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */n("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function h({entityType:e,isSelected:i,entityId:h,label:m,fileKind:w}){const g="preview-file"===e&&w,x=g?c[w]:null,y=g?s[w]:null;if("folder"===e)/* @__PURE__ */
3
- return n("div",{className:"w-12 h-12 flex items-center justify-center "+(i?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */n(p,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=f(h,m),o=l(h||m||"page");/* @__PURE__ */
4
- return n("div",{className:"w-12 h-12 flex items-center justify-center "+(i?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */n("span",{className:`h-11 w-11 rounded-xl bg-gradient-to-br ${o} flex items-center justify-center text-white border border-white/30 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]`,children:e&&t(e)?r(e,{className:"h-7 w-7 text-white"}):u})})}/* @__PURE__ */
5
- return o("div",{className:"w-12 h-12 relative flex items-center justify-center "+(i?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:[
6
- /* @__PURE__ */o("svg",{className:`w-10 h-12 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)] ${x??a[e]??"text-gray-500"}`,viewBox:"0 0 40 48",fill:"none",children:[
7
- /* @__PURE__ */n("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",fill:"white",fillOpacity:"0.92"}),
8
- /* @__PURE__ */n("path",{d:"M26 0l10 10H30a4 4 0 01-4-4V0z",fill:"currentColor",fillOpacity:"0.2"}),
9
- /* @__PURE__ */n("path",{d:"M4 0h22l10 10v34a4 4 0 01-4 4H4a4 4 0 01-4-4V4a4 4 0 014-4z",stroke:"currentColor",strokeWidth:"1.5",strokeOpacity:"0.5"})]}),
10
- /* @__PURE__ */n("span",{className:`absolute inset-0 flex items-center justify-center text-[9px] font-bold pt-2 ${x??a[e]??"text-gray-600"}`,children:y??d[e]??e.slice(0,3).toUpperCase()})]})}function m({item:e}){if("folder"===e.entityType)/* @__PURE__ */
11
- return n(p,{className:"h-4 w-4 shrink-0 text-amber-500"});if("page"===e.entityType){const o=f(e.entityId,e.label);/* @__PURE__ */
12
- return n("span",{className:`h-4 w-4 rounded bg-gradient-to-br ${l(e.entityId||e.label||"page")} flex items-center justify-center text-white shrink-0`,children:o&&t(o)?r(o,{className:"h-3 w-3 text-white"}):/* @__PURE__ */n("span",{className:"h-1.5 w-1.5 rounded-[2px] border border-white/80"})})}const o=("preview-file"===e.entityType&&e.fileKind?c[e.fileKind]:a[e.entityType])??"text-gray-400";/* @__PURE__ */
13
- return n("svg",{className:`h-4 w-4 shrink-0 ${o}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */n("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})}function w(e){return"preview-file"===e.entityType&&e.fileKind?s[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":d[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var g=null,x=/* @__PURE__ */new Set;function y(e){g=e,x.forEach(e=>e())}function v(e){return x.add(e),()=>{x.delete(e)}}function b(){return g}var _="__REACT_OS_SHELL_FILES_VIEW__",k="react-os-shell:files-show-trash",N="react-os-shell:files-open-desktop-folder";function C(){"undefined"!=typeof window&&(window[_]="trash",window.dispatchEvent(new CustomEvent(k)))}function j(e){"undefined"!=typeof window&&(window[_]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(N,{detail:{folderId:e}})))}function S(){if("undefined"==typeof window)return null;const e=window[_];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function I(){const e=S();return"undefined"!=typeof window&&(window[_]=null),e}export{m as DesktopItemMiniIcon,N as FILES_OPEN_DESKTOP_FOLDER_EVENT,k as FILES_SHOW_TRASH_EVENT,h as FileIconTile,p as FolderGlyph,I as consumeFilesViewRequest,w as desktopItemTypeLabel,b as getDesktopFoldersSnapshot,S as peekFilesViewRequest,y as publishDesktopFolders,j as requestFilesDesktopFolderView,C as requestFilesTrashView,v as subscribeDesktopFolders};
@@ -1,11 +0,0 @@
1
- import{useHydrated as e,useBrowserState as t}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-J3LIIIHJ.js";import{createContext as n,useSyncExternalStore as o,useCallback as i,useContext as a,useMemo as s}from"react";import{jsxs as l,jsx as c}from"react/jsx-runtime";var d="(max-width: 767px), (pointer: coarse)";function u(){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(d).matches}function f(){return!1}function m(e){if("undefined"==typeof window||!window.matchMedia)return()=>{};const t=window.matchMedia(d);return t.addEventListener?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):(t.addListener(e),()=>t.removeListener(e))}function h(){return o(m,u,f)}var w={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},p={success:"text-green-600 bg-green-100",error:"text-red-600 bg-red-100",warning:"text-amber-600 bg-amber-100",info:"text-blue-600 bg-blue-100"},g={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function v({tone:e}){const t={className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
2
- return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});case"error":/* @__PURE__ */
3
- return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})});case"warning":/* @__PURE__ */
4
- return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"})});default:/* @__PURE__ */
5
- return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"})})}}function y({status:e="info",title:t,subTitle:n,extra:o,icon:i,children:a,className:s=""}){const d=w[e],u=r().errors;/* @__PURE__ */
6
- return l("div",{role:"error"===d?"alert":void 0,className:`flex flex-col items-center justify-center px-6 py-12 text-center ${s}`.trim(),children:[
7
- /* @__PURE__ */c("div",{className:`flex h-14 w-14 items-center justify-center rounded-full ${p[d]}`,children:i??/* @__PURE__ */c(v,{tone:d})}),
8
- /* @__PURE__ */c("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:t??g[e]?.(u)??""}),n&&/* @__PURE__ */c("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:n}),a&&/* @__PURE__ */c("div",{className:"mt-4 w-full max-w-md text-left",children:a}),o&&/* @__PURE__ */c("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:o})]})}function x({size:e="md",padding:t="py-12",label:r,className:n=""}){const o=/* @__PURE__ */c("div",{className:`${"sm"===e?"h-5 w-5":"lg"===e?"h-12 w-12":"h-8 w-8"} animate-spin rounded-full border-2 border-gray-200 border-t-blue-600`});return null==r?/* @__PURE__ */c("div",{className:`flex items-center justify-center ${t} ${n}`,children:o}):/* @__PURE__ */l("div",{role:"status",className:`flex flex-col items-center justify-center gap-3 ${t} ${n}`,children:[o,
9
- /* @__PURE__ */c("p",{className:"text-sm text-gray-500",children:r})]})}var L="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),M={MOD:["⌘","Ctrl"],ALT:["⌥","Alt"],CMD_ENTER:["⌘⏎","Ctrl⏎"],CMD_S:["⌘S","Ctrl+S"],CMD_K:["⌘K","Ctrl+K"],CMD_DOT:["⌘.","Ctrl+."],CMD_A:["⌘A","Ctrl+A"],CMD_Z:["⌘Z","Ctrl+Z"],CMD_SHIFT_Z:["⌘⇧Z","Ctrl+Shift+Z"],ALT_SHIFT_D:["⌥⇧D","Alt+Shift+D"],ALT_SHIFT_E:["⌥⇧E","Alt+Shift+E"],ALT_SHIFT_N:["⌥⇧N","Alt+Shift+N"]},_=L?0:1,b=M.MOD[_],C=M.ALT[_],N="⇧",S="⏎",D=M.CMD_ENTER[_],E=M.CMD_S[_],T=M.CMD_K[_],k=M.CMD_DOT[_],A=M.CMD_A[_],I=M.CMD_Z[_],j=M.CMD_SHIFT_Z[_],H=M.ALT_SHIFT_D[_],F=M.ALT_SHIFT_E[_],z=M.ALT_SHIFT_N[_],Z=new Map(L?Object.values(M).map(([e,t])=>[e,t]):[]);function O(t){return e()?t:Z.get(t)??t}var P="inline-flex items-center justify-center rounded border border-gray-200 bg-gray-50 font-medium text-gray-500",$={sm:"px-1 py-0.5 text-[10px]",md:"px-1.5 py-0.5 text-[11px]"};function J({keys:e,size:t="md",className:r=""}){const n=O(e);/* @__PURE__ */
10
- return c("kbd",{className:[P,$[t],r].filter(Boolean).join(" "),children:n})}var K=n(null);function R({value:e,children:t}){/* @__PURE__ */
11
- return c(K.Provider,{value:e,children:t})}function U(e="react-os-shell:prefs",r){const[n,o]=t(()=>{try{const t=JSON.parse(localStorage.getItem(e)||"{}");return{...r??{},...t}}catch{return{...r??{}}}},{...r??{}});return{prefs:n,save:i(t=>{o(r=>{const n={...r,...t};try{localStorage.setItem(e,JSON.stringify(n))}catch{}return n})},[e])}}var B={prefs:{},save:()=>{}};function W(){return a(K)??B}function V(){const{prefs:e,save:t}=W(),r=i(e=>{const r=t(e);return r&&"function"==typeof r.then?r.catch(()=>{}):r},[t]);return s(()=>({prefs:e,save:r}),[e,r])}var q="react-os-shell:stale-chunk-reload-at",G=3e4,Q="vite:preloadError",X="/_next/static/",Y=/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;function ee(e){if(e instanceof Error&&"ChunkLoadError"===e.name)return!0;const t=e instanceof Error?e.message:"string"==typeof e?e:"";return Y.test(t)}function te(e={}){if("undefined"==typeof window)return()=>{};const t=e.cooldownMs??3e4,r=e.reload??(()=>window.location.reload()),n=e.now??Date.now,o=void 0===e.storage?function(){try{const e=window.sessionStorage;return e.getItem(q),e}catch{return null}}():e.storage,i=void 0===e.chunkPathPrefix?X:e.chunkPathPrefix,a=e=>{const r=n(),i=function(e){if(!e)return null;try{const t=e.getItem(q),r=null===t?NaN:Number(t);return Number.isFinite(r)?r:null}catch{return null}}(o);return null!==i&&r-i<t?(console.error("[efficient-shell] a lazy chunk is still missing after a reload; letting the failure through:",e),!1):(function(e,t){if(e)try{e.setItem(q,String(t))}catch{}}(o,r),console.warn("[efficient-shell] a lazy chunk is no longer on the server (new deploy?); reloading onto the current build:",e),!0)},s=e=>{const t=e.payload;ee(t)&&a(t)&&(e.preventDefault(),r())};let l=!0,c=!1;const d=/* @__PURE__ */new Set,u=null===i?null:e=>{const t=function(e,t){const r=e.target;let n="";if(r instanceof window.HTMLScriptElement?n=r.src:r instanceof window.HTMLLinkElement&&function(e){const t=e.rel.toLowerCase().split(/\s+/);if(t.includes("stylesheet")||t.includes("modulepreload"))return!0;const r=(e.getAttribute("as")??"").toLowerCase();return t.includes("preload")&&("script"===r||"style"===r)}(r)?n=r.href:e instanceof window.ErrorEvent&&"SyntaxError"===e.error?.name&&(n=e.filename),!n)return null;try{const e=new URL(t,window.location.origin).href,r=new URL(n,window.location.href).href;return r.startsWith(e)?r:null}catch{return null}}(e,i);!t||c||d.has(t)||(d.add(t),async function(e){try{const t=await fetch(e,{method:"HEAD",cache:"no-store"});return 404===t.status||410===t.status||t.ok&&/\btext\/html\b/i.test(t.headers.get("content-type")??"")}catch{return!1}}(t).then(e=>{d.delete(t),e&&l&&!c&&a(t)&&(c=!0,r())}))};return window.addEventListener(Q,s),u&&window.addEventListener("error",u,!0),()=>{l=!1,window.removeEventListener(Q,s),u&&window.removeEventListener("error",u,!0)}}export{C as ALT,H as ALT_SHIFT_D,F as ALT_SHIFT_E,z as ALT_SHIFT_N,A as CMD_A,k as CMD_DOT,D as CMD_ENTER,T as CMD_K,E as CMD_S,j as CMD_SHIFT_Z,I as CMD_Z,S as ENTER,J as Kbd,x as LoadingSpinner,b as MOD,X as NEXT_CHUNK_PATH_PREFIX,y as Result,N as SHIFT,G as STALE_CHUNK_RELOAD_COOLDOWN_MS,q as STALE_CHUNK_RELOAD_KEY,R as ShellPrefsProvider,Q as VITE_PRELOAD_ERROR_EVENT,te as installStaleChunkReload,L as isMac,ee as isStaleChunkError,h as useIsMobile,U as useLocalStoragePrefs,V as useShellPrefs,W as useShellPrefsAdapter,O as useShortcutLabel};
@@ -1,3 +0,0 @@
1
- import{useShellStrings as e}from"./chunk-J3LIIIHJ.js";import{useState as r,useRef as o,useEffect as t,useCallback as n}from"react";import{jsx as i}from"react/jsx-runtime";function a(e){const[i,a]=r(!1),c=o(void 0);t(()=>()=>clearTimeout(c.current),[]);return{copied:i,copy:n(r=>{r?.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{a(!0),clearTimeout(c.current),c.current=setTimeout(()=>a(!1),1500)},()=>{})},[e])}}function c({copied:e,className:r="w-4 h-4"}){/* @__PURE__ */
2
- return i("svg",e?{className:`${r} text-green-600`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */i("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}:{className:r,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */i("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function s({text:r}){const{copied:o,copy:t}=a(r),n=e().copy;/* @__PURE__ */
3
- return i("button",{onClick:t,title:o?n.copiedValue:n.copyValue(r),className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",children:/* @__PURE__ */i(c,{copied:o})})}export{s as CopyButton,c as CopyGlyph,a as useCopyText};
@@ -1,112 +0,0 @@
1
- import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,useShellAuth as i,scrollerIsFluid as a,growBoxToWidth as l,widthToFit as s,navIcons as c}from"./chunk-DSSLOQDW.js";import{CopyButton as d}from"./chunk-KVOFUFPP.js";import{isStaleChunkError as u,CMD_Z as h,CMD_SHIFT_Z as m,LoadingSpinner as p,Result as f,useIsMobile as w,useShellPrefs as y}from"./chunk-CIXQKCFA.js";import{Button_default as g}from"./chunk-OGXU7QFW.js";import{confirm as v}from"./chunk-ZAE6ROV7.js";import{PopupMenu as b,PopupMenuItem as x,PopupMenuDivider as k,PopupMenuLabel as E}from"./chunk-AA4TMQOS.js";import{Z_LAYERS as M,runEscapeInterceptors as L}from"./chunk-X4FJ54PP.js";import{useShellStrings as C}from"./chunk-J3LIIIHJ.js";import{Icon as N}from"./chunk-YKZHOXI4.js";import{createContext as S,useContext as A,Component as T,useLayoutEffect as z,useRef as D,useEffect as I,useState as P,useSyncExternalStore as K,useCallback as O,isValidElement as W,Fragment as $,Children as R,cloneElement as j,useMemo as B,useReducer as F,useId as H,Suspense as q}from"react";import{jsxs as V,jsx as Y,Fragment as X}from"react/jsx-runtime";import{createPortal as U}from"react-dom";import{XMarkIcon as _}from"@heroicons/react/24/outline";import{useLocation as J}from"react-router-dom";import{useQueryClient as Q,useQuery as G}from"@tanstack/react-query";function Z(e){return"component"in e}function ee(e){return"endpoint"in e}var te={};function ne(e){te=e}var re=new Proxy({},{get:(e,t)=>te[t],has:(e,t)=>t in te,ownKeys:()=>Object.keys(te),getOwnPropertyDescriptor(e,t){if(t in te)return{configurable:!0,enumerable:!0,value:te[t]}}}),oe=null;function ie(e){oe=e}function ae(){return null!==oe}var le=/* @__PURE__ */new Set(["get","post","put","patch","delete","head","options","request"]),se=new Proxy({},{get:(e,t)=>oe?oe[t]:"string"==typeof t&&le.has(t)?()=>Promise.resolve({data:null,status:0,statusText:"",headers:{},config:{}}):void 0}),ce=S(null);function de(){return A(ce)?.pageSearch??""}var ue=null,he=/* @__PURE__ */new Set;function me(e){ue!==e&&(ue=e,he.forEach(e=>e()))}function pe(){return ue}function fe(e){return he.add(e),()=>{he.delete(e)}}function we({error:e,onReload:t}){const n=u(e);/* @__PURE__ */
2
- return V("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
3
- /* @__PURE__ */Y("svg",{className:"h-8 w-8 text-amber-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"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"})}),
4
- /* @__PURE__ */V("div",{className:"min-w-0",children:[
5
- /* @__PURE__ */Y("p",{className:"text-sm font-medium text-gray-700",children:n?"This window needs the latest version of the app":"This window crashed"}),
6
- /* @__PURE__ */Y("p",{className:"mt-1 text-xs text-gray-400 max-w-sm break-words",children:n?"A new version was deployed while this tab was open. Reload the page to pick it up.":e.message||String(e)})]}),
7
- /* @__PURE__ */Y("button",{type:"button",onClick:n?()=>window.location.reload():t,className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg",children:n?"Reload page":"Reload window"})]})}var ye=class extends T{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){console.error("[efficient-shell] window content crashed:",e,t.componentStack)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */Y(we,{error:e,onReload:this.reset}):this.props.children}},ge=S(null),ve="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function be({className:e="",auto:t=!1}){const n=A(ge),r=C().undo,o=n?.claimOwnMount;if(z(()=>{if(!t&&o)return o(!0),()=>o(!1)},[t,o]),!n||!n.enabled)return null;const{undo:i,redo:a,canUndo:l,canRedo:s,undoLabel:c,redoLabel:d}=n;/* @__PURE__ */
8
- return V("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
9
- /* @__PURE__ */Y("button",{type:"button",onClick:i,disabled:!l,title:l?r.undoStep(c??"",h):r.nothingToUndo,className:ve,children:r.undo}),
10
- /* @__PURE__ */Y("button",{type:"button",onClick:a,disabled:!s,title:s?r.redoStep(d??"",m):r.nothingToRedo,className:ve,children:r.redo})]})}var xe=/* @__PURE__ */new Set([408,429]);function ke(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function Ee(e){const t=ke(e);return null!=t&&(t>=400&&t<500&&!xe.has(t))}function Me(e,t){return!Ee(t)&&e<3}function Le(){const e=C().loading;/* @__PURE__ */
11
- return Y("div",{className:"flex items-center justify-center p-8 text-sm text-gray-400",children:e.label})}var Ce="flex-1 min-h-0";function Ne(){const e=C().record;/* @__PURE__ */
12
- return Y(p,{label:e.loading,padding:"",className:Ce})}function Se(e){return e??void 0}function Ae({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=C().record;if(t||e&&n)/* @__PURE__ */return Y(Ne,{});if(r){const e=ke(r);if(401===e)/* @__PURE__ */
13
- return Y(f,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:Ce});if(403===e)/* @__PURE__ */
14
- return Y(f,{status:"403",className:Ce});if(404===e||410===e)/* @__PURE__ */
15
- return Y(f,{status:"404",title:i.notFound,className:Ce});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
16
- return Y(f,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */Y(g,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:Ce})}/* @__PURE__ */
17
- return Y(f,{status:"404",title:i.notFound,className:Ce})}function Te({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */Y(X,{children:t(e)}):/* @__PURE__ */Y(Ae,{...n})}var ze=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function De(e){return"string"==typeof e&&(e.startsWith("new-")||ze.test(e))}function Ie(e){if(De(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var Pe=S({openWindows:[],openEntity:()=>{},openPage:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),Ke=S(null);function Oe(e){const t=A(Ke),n=D(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),z(()=>{if(t)return t(n.current,e)},[t,e]),I(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function We(){const e=D(/* @__PURE__ */new Map),[t,n]=P(!1);return{dirty:t,registerDirty:O((t,r)=>{const o=()=>{const t=Array.from(e.current.values()).some(Boolean);n(e=>e===t?e:t)};return e.current.set(t,r),o(),()=>{e.current.delete(t),o()}},[])}}function $e(){return A(Pe)}function Re(e){if("page"!==e.type&&Ie(e))return null;const t="page"===e.type?"page":e.entityType||"",n="page"===e.type?e.route||"":e.entityId||"";return t&&n?{entityType:t,entityId:n,label:e.label}:null}function je({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=We(),i=re[e.route];if(!i||!Z(i))return null;const a=i,l=a.component;/* @__PURE__ */
18
- return Y(Nr,{open:!0,onClose:t,icon:c[e.route],title:a.label,size:a.size||"2xl",dirty:r,allowPinOnTop:a.allowPinOnTop,initialPosition:a.initialPosition,widget:a.widget,compact:a.compact,appStyle:a.appStyle,flushBody:a.flushBody,autoHeight:a.autoHeight,autoMinHeight:a.autoMinHeight,autoWidth:a.autoWidth,dimensions:a.dimensions,windowKey:e.id,openedFromKey:e.openedFrom,accentRgb:n,children:/* @__PURE__ */Y(Ke.Provider,{value:o,children:/* @__PURE__ */Y(q,{fallback:/* @__PURE__ */Y("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */Y(Le,{})}),children:/* @__PURE__ */Y(l,{})})})})}function Be({entityType:e,entityId:t,label:n}){const r=C(),o=Q(),{data:i}=G({queryKey:["my-profile-sidebar"],enabled:ae(),queryFn:()=>se.get("/auth/me/").then(e=>e.data)}),a=(i?.preferences||{}).favorite_documents||[],l=a.some(n=>n.entityType===e&&n.entityId===t);/* @__PURE__ */
19
- return Y("button",{onClick:()=>{const r=l?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];se.patch("/auth/me/",{preferences:{favorite_documents:r}}).then(()=>{o.invalidateQueries({queryKey:["my-profile-sidebar"]})})},title:l?r.taskbar.removeFromDesktop:r.taskbar.addToDesktop,className:"shrink-0 transition-colors "+(l?"text-yellow-500 hover:text-yellow-600":"text-gray-300 hover:text-yellow-400"),children:/* @__PURE__ */Y("svg",{className:"h-4 w-4",fill:l?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})})})}var Fe=/* @__PURE__ */new Set;function He({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=re[e.entityType];if(!o||!ee(o))return null;const i=o,[a,l]=P(!1),{dirty:s,registerDirty:d}=We(),u=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=De(e.entityId),p=!i.selfFetching&&!h&&!m&&ae(),f=G({queryKey:[u,e.entityId],queryFn:()=>{return se.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:Se(e.entitySnapshot),initialDataUpdatedAt:0,enabled:p,staleTime:0,refetchOnWindowFocus:!0,refetchOnMount:"always",refetchInterval:e=>!Ee(e.state.error)&&6e4,refetchIntervalInBackground:!1,retry:Me}),w=f.data,y=f.refetch;I(()=>{var t;if(p)return t=t=>{t!==e.id||Fe.has(t)||y({cancelRefetch:!1})},zn.add(t),()=>{zn.delete(t)}},[y,e.id,p]);const g=O(()=>{a&&!s?l(!1):t()},[a,s,t]),v=i.selfFetching?e.label:w?i.title(w,a,l):e.label,b=i.icon,x=b?c[b]:null,k=v,E=!i.selfFetching&&w&&i.footer&&!h?i.footer(w):void 0;return i.rendersOwnModal?i.selfFetching?/* @__PURE__ */Y(q,{fallback:/* @__PURE__ */Y(Le,{}),children:i.render(w??e.entitySnapshot,t,e.entityId,a,l)}):null!=w?/* @__PURE__ */Y(q,{fallback:/* @__PURE__ */Y(Nr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */Y(Ne,{})}),children:i.render(w,t,e.entityId,a,l)}):/* @__PURE__ */Y(Nr,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */Y(Ae,{isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y})}):/* @__PURE__ */Y(Nr,{open:!0,onClose:g,onMinimize:n,initialBox:e.savedBox,icon:x,title:k,footer:E,copyText:e.label,windowKey:e.id,openedFromKey:e.openedFrom,size:i.size||"2xl",dirty:s,editing:a||m||h,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */Y(Ke.Provider,{value:d,children:/* @__PURE__ */Y(q,{fallback:/* @__PURE__ */Y(Ne,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,l):/* @__PURE__ */Y(Te,{entity:w,isPending:f.isPending,isFetching:f.isFetching,enabled:p,error:f.error,onRetry:y,children:n=>i.render(n,t,e.entityId,a,l)})})})})}function qe(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function Ve(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function Ye(e){const t=qe(e),n=t??Ve(e);if(!n)return;if(t&&!Hn(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&Dn(o)}function Xe(e){if("page"!==e.type)return!0;const t=e.route?re[e.route]:void 0;if(!t||!Z(t))return!0;const n=t;return!n.widget&&!n.utility}function Ue(){const e=rr();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var _e=/* @__PURE__ */new Map;function Je(){const e=Ue();if(e)return _e.get(e)}function Qe(e){const t=document.querySelectorAll("[data-modal-panel]");for(const n of Array.from(t)){const t=n.querySelector("[data-window-title]");if(t?.textContent?.includes(e))return n}return null}var Ge="rosh-peek-style";function Ze(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(Ge))return;const e=document.createElement("style");e.id=Ge,e.textContent="body.rosh-peeking [data-modal-panel]{transition:opacity .18s ease}body.rosh-peeking [data-modal-panel]:not([data-peek-focus]){opacity:.4}body.rosh-peeking [data-modal-panel][data-peek-focus]{opacity:1}body.rosh-peeking [data-modal-panel][data-peek-focus]:not([data-pinned-top]){z-index:249!important}html.rosh-reduce-transparency body.rosh-peeking [data-modal-panel]:not([data-peek-focus]){opacity:.92}@media (prefers-reduced-motion:reduce){body.rosh-peeking [data-modal-panel]{transition:none}}",document.head.appendChild(e)}(),document.querySelectorAll("[data-modal-panel][data-peek-focus]").forEach(e=>e.removeAttribute("data-peek-focus")),e&&e.setAttribute("data-peek-focus",""),document.body.classList.toggle("rosh-peeking",!!e))}function et(){"undefined"!=typeof document&&(document.body.classList.remove("rosh-peeking"),document.querySelectorAll("[data-modal-panel][data-peek-focus]").forEach(e=>e.removeAttribute("data-peek-focus")))}function tt({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const l=C(),s=D(null),[c,d]=P({w:n,h:Math.round(.75*r)}),[u,h]=P(!1);return z(()=>{const o=s.current;if(!o)return;const i=qe(e)??Qe(t);if(!i)return void h(!1);const a=i.getBoundingClientRect();if(0===a.width||0===a.height)return void h(!1);const l=Math.min(n/a.width,r/a.height),c=Math.max(80,Math.round(a.width*l)),u=Math.max(60,Math.round(a.height*l));d({w:c,h:u}),h(!0);const m=i.cloneNode(!0);return m.style.position="absolute",m.style.top="0",m.style.left="0",m.style.right="auto",m.style.bottom="auto",m.style.width=a.width+"px",m.style.height=a.height+"px",m.style.transform=`scale(${l})`,m.style.transformOrigin="top left",m.style.pointerEvents="none",m.style.animation="none",m.style.zIndex="auto",m.removeAttribute("data-modal-panel"),m.removeAttribute("data-modal-id"),m.removeAttribute("data-window-key"),m.querySelectorAll('[role="dialog"], [data-portal]').forEach(e=>{e.style.display="none"}),o.innerHTML="",o.appendChild(m),()=>{o.innerHTML=""}},[e,t,n,r]),/* @__PURE__ */V("div",{style:{width:c.w,height:c.h},className:"relative rounded-md overflow-hidden bg-white/95 border border-gray-300 shadow-md cursor-pointer ring-2 ring-transparent group-hover:ring-blue-400 transition shrink-0",onClick:i,children:[
20
- /* @__PURE__ */Y("div",{ref:s,className:"absolute inset-0 z-0 overflow-hidden"}),!u&&/* @__PURE__ */V("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
21
- /* @__PURE__ */Y("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75A2.25 2.25 0 016 4.5h12a2.25 2.25 0 012.25 2.25v10.5A2.25 2.25 0 0118 19.5H6a2.25 2.25 0 01-2.25-2.25V6.75z M3.75 9h16.5"})}),
22
- /* @__PURE__ */Y("span",{className:"mt-1 text-[10px] uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */Y("div",{className:"absolute bottom-0 left-0 right-0 z-10 px-2 py-1 text-[10px] font-medium text-white bg-gradient-to-t from-black/80 to-transparent truncate pointer-events-none",children:t}),a&&/* @__PURE__ */Y("button",{onClick:e=>{e.stopPropagation(),a()},className:"absolute top-1 right-1 z-20 h-5 w-5 rounded-full bg-gray-900/90 ring-1 ring-white/80 shadow-sm hover:bg-red-500 text-white flex items-center justify-center",title:l.taskbar.closeWindow,children:/* @__PURE__ */Y("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})}function nt({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=C(),l=e.length>1,s=D(null),[c,d]=P({left:-9999,top:-9999,ready:!1}),[u,h]=P(()=>"undefined"!=typeof document&&getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom");z(()=>{const e=s.current;if(!e)return;const n=()=>{const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";h(o);let i,a=n.left+n.width/2-r.width/2;"top"===o?i=n.bottom+8:"left"===o?(a=n.right+8,i=n.top+n.height/2-r.height/2):"right"===o?(a=n.left-r.width-8,i=n.top+n.height/2-r.height/2):i=n.top-r.height-8,a=Math.max(8,Math.min(a,window.innerWidth-r.width-8)),i=Math.max(8,Math.min(i,window.innerHeight-r.height-8)),d({left:a,top:i,ready:!0})};n();const r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t,e.length]),I(()=>et,[]);const m="top"===u,p=(m?"mt-1":"mb-1")+" max-w-[240px] truncate text-[11px] font-medium text-gray-900 bg-white/80 px-2 py-0.5 rounded shadow-sm ring-2 ring-transparent transition group-hover:ring-blue-400";return U(
23
- /* @__PURE__ */Y("div",{ref:s,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:300,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:l?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{et(),i()},children:e.map(e=>{const t=qe(e.id)??Qe(e.label),o=t?function(e){if(Hn(e))return null;const t=e.getBoundingClientRect(),n=Wn(),r=t.left+t.width/2-(n.x+n.w/2),o=t.top+t.height/2-(n.y+n.h/2);return 180*Math.atan2(o,r)/Math.PI}(t):null;/* @__PURE__ */
24
- return V("div",{className:"group flex flex-col items-center",onMouseEnter:()=>Ze(t),children:[!m&&/* @__PURE__ */Y("span",{className:p,children:e.label}),
25
- /* @__PURE__ */Y(tt,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),m&&/* @__PURE__ */Y("span",{className:p,children:e.label}),null!==o&&/* @__PURE__ */V("span",{title:a.taskbar.offscreenHint,className:"mt-1 inline-flex items-center gap-1 rounded bg-amber-500 px-1.5 py-0.5 text-[10px] font-semibold text-white shadow-sm",children:[
26
- /* @__PURE__ */Y("svg",{className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14m0 0l-5-5m5 5l-5 5"})}),"Off screen"]})]},e.id)})}),document.body)}function rt(e,t){const n=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";return"top"===n?{left:Math.min(e,window.innerWidth-220),top:t+4}:"left"===n?{left:e+4,top:Math.min(t,window.innerHeight-160)}:"right"===n?{right:window.innerWidth-e+4,top:Math.min(t,window.innerHeight-160)}:{left:Math.min(e,window.innerWidth-220),bottom:window.innerHeight-t+4}}function ot({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=C(),[a,l]=P(null);I(()=>{let e,t;const n=()=>{clearInterval(e),clearTimeout(t),e=void 0},r=()=>{const e=document.getElementById("taskbar-windows");return l(t=>t===e?t:e),!!e},o=()=>{n(),r()||(e=setInterval(()=>{r()&&n()},100),t=setTimeout(n,5e3))};return o(),window.addEventListener("react-os-shell:layout-mode-changed",o),()=>{n(),window.removeEventListener("react-os-shell:layout-mode-changed",o)}},[]);const s=K(or,rr),[,d]=P(0);I(()=>{const e=()=>d(e=>e+1);return window.addEventListener("modal-geometry",e),window.addEventListener("resize",e),()=>{window.removeEventListener("modal-geometry",e),window.removeEventListener("resize",e)}},[]);const[,u]=P(0);I(()=>{const e=()=>u(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const h=e=>{const t=Qe(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[m,p]=P(null),[f,w]=P(null),[y,g]=P(null),v=D(null),M=()=>{v.current&&(clearTimeout(v.current),v.current=null),v.current=setTimeout(()=>{p(null),w(null)},150)},L=e.filter(e=>!e.route||!re[e.route]?.utility);if(!a||!a.isConnected||0===L.length)return null;const N=[],S=/* @__PURE__ */new Map;for(const e of L){const t=e.route?re[e.route]:void 0,n=t?.taskbarGroup,r=n?.key??e.route??`entity:${e.id}`,o=S.get(r);if(void 0!==o)N[o].items.push(e);else{S.set(r,N.length);const o=n?.label??t?.label??e.label;N.push({key:r,route:n?.icon??e.route,label:o,items:[e]})}}return U(
27
- /* @__PURE__ */V(X,{children:[N.map(e=>{const n=e.route?c[e.route]:null,r=e.items[e.items.length-1];let a=!1;if(s){const t=document.querySelector(`[data-modal-id="${s}"]`);if(t){const n=t.querySelector("[data-window-title]"),r=n?.textContent??"";a=e.items.some(e=>r.includes(e.label))}}const l=e.items.length>1,d=e.items.some(e=>{const t=qe(e.id)??Qe(e.label);return!!t&&!Hn(t)});/* @__PURE__ */
28
- return V("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.currentTarget,void(y||(v.current&&(clearTimeout(v.current),v.current=null),v.current=setTimeout(()=>{p(n),w(r)},350)));var n,r},onMouseLeave:M,onDoubleClick:e=>{e.stopPropagation(),window.dispatchEvent(new CustomEvent("modal-center",{detail:{windowKey:r.id,label:r.label}}))},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),v.current&&(clearTimeout(v.current),v.current=null),p(null),w(null),l?g({x:t.clientX,y:t.clientY,items:e.items,label:e.label}):window.dispatchEvent(new CustomEvent("modal-context-menu",{detail:{windowKey:r.id,label:r.label,x:t.clientX,y:t.clientY}}))},style:{width:"var(--window-tab-width, 200px)",fontSize:"var(--window-tab-font-size, 12px)"},"data-tab-group":e.key,className:"group relative flex items-center gap-1.5 rounded-lg px-3 py-2 font-medium transition-all min-w-0 shrink "+(a?"bg-blue-100/60 border border-blue-400/60 text-blue-700":"bg-gray-50/40 border border-gray-200/40 text-gray-700 hover:bg-gray-200/40"),children:[n&&W(n)?j(n,{className:"h-3.5 w-3.5 shrink-0 "+(a?"text-blue-600":"text-gray-400")}):/* @__PURE__ */Y("svg",{className:"h-3.5 w-3.5 shrink-0 "+(a?"text-blue-600":"text-gray-400"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})}),
29
- /* @__PURE__ */Y("span",{className:"truncate flex-1",children:l?e.label:h(r.label)}),d&&/* @__PURE__ */Y("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),l&&/* @__PURE__ */Y("span",{className:"shrink-0 px-1.5 py-0.5 rounded-full bg-blue-500/80 text-white text-[10px] font-bold leading-none",children:e.items.length}),!l&&/* @__PURE__ */Y("span",{role:"button",onClick:e=>{e.stopPropagation(),t(r.id)},className:"ml-auto text-gray-400 hover:text-red-500 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:/* @__PURE__ */Y("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]},e.key)}),
30
- /* @__PURE__ */Y("div",{className:"flex-1"}),L.length>=2&&/* @__PURE__ */V("button",{onClick:n,title:i.taskbar.expose,className:"flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium text-blue-600 border border-blue-300 hover:bg-blue-50 transition-colors shrink-0",children:[
31
- /* @__PURE__ */V("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[
32
- /* @__PURE__ */Y("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1"}),
33
- /* @__PURE__ */Y("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1"}),
34
- /* @__PURE__ */Y("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1"}),
35
- /* @__PURE__ */Y("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1"})]}),"Exposé"]}),y&&/* @__PURE__ */V(b,{portal:!0,minWidth:200,style:rt(y.x,y.y),onClose:()=>g(null),children:[
36
- /* @__PURE__ */Y(E,{children:y.label}),
37
- /* @__PURE__ */V(x,{onClick:()=>{g(null),y.items.forEach(e=>function(e){const t=vn.get(e);t&&In(t)}(e.id))},children:[
38
- /* @__PURE__ */Y("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 12h-15"})}),i.taskbar.minimizeAllWindows]}),
39
- /* @__PURE__ */V(x,{onClick:()=>{g(null),y.items.forEach(e=>o(e.id))},children:[
40
- /* @__PURE__ */Y("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75h6.5v6.5h-6.5zM13.75 8.75h6.5v6.5h-6.5z"})}),i.taskbar.restoreAllWindows]}),
41
- /* @__PURE__ */Y(k,{}),
42
- /* @__PURE__ */V(x,{danger:!0,onClick:()=>{g(null),y.items.forEach(e=>t(e.id))},children:[
43
- /* @__PURE__ */Y("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),`${i.taskbar.closeAllWindows} (${y.items.length})`]})]}),m&&f&&/* @__PURE__ */Y(nt,{items:m,anchorEl:f,onActivate:e=>{o(e),p(null),w(null)},onClose:e=>{t(e),p(null),w(null)},onMouseEnter:()=>{v.current&&(clearTimeout(v.current),v.current=null)},onMouseLeave:M})]}),a)}var it=["/login","/forgot-password","/reset-password","/force-change-password"];function at({children:e,windowAccentForRoute:t}){const n=J(),r=it.some(e=>n.pathname.startsWith(e)),[o,i]=P([]),a=D(o);z(()=>{a.current=o},[o]);const l=K(fe,pe,pe),s=D(/* @__PURE__ */new Map),c=e=>{const t=Xe(e),n=!!l&&"page"===e.type&&e.route===l,r=e.pageSearch||void 0,o=s.current.get(e.id);if(o&&o.tab===t&&o.home===n&&o.pageSearch===r)return o;const i={key:e.id,tab:t,home:n,...r?{pageSearch:r}:{}};return s.current.set(e.id,i),i};I(()=>{_e.clear();for(const e of o)e.route&&_e.set(e.id,e.route)},[o]);const d=O(e=>{i(t=>t.filter(t=>t.id!==e))},[]),u=O(e=>{var t;qe(e)||Ve(e)?(t=e,window.dispatchEvent(new CustomEvent(ir,{detail:{windowKey:t}}))):d(e)},[d]),h=(e,t=!1)=>{const n=pn;t&&Fe.add(e),setTimeout(()=>{const r=document.querySelector(`[data-modal-panel][data-window-key="${e}"]`),o=r?.getAttribute("data-modal-id");var i,a;!o||(i=o,a=n,(fn.get(i)??-1)>a)||Dn(o),t&&Fe.delete(e)},50)},m=O((e,t,n,r,o)=>{if(!re[e]||!ee(re[e]))return;const a=`${e}:${t}`,l=Ue();i(i=>{const s=i.find(n=>n.entityType===e&&String(n.entityId)===String(t));return s?(h(s.id),i):(h(a,!0),[...i,{id:a,type:"modal",label:r||t,route:o||window.location.pathname,entityType:e,entityId:t,entitySnapshot:Se(n),openedFrom:l}])})},[]),p=O((e,t={})=>{if(!re[e]||!Z(re[e]))return;const n=re[e],{reuse:r=!1,background:o=!1,shellOwned:l,search:s}=t,c=e=>{var t;o?(t=e,Mn.add(t)):h(e)};if(n.widget){const t=a.current.find(t=>"page"===t.type&&t.route===e);if(t)return void u(t.id)}const d=Ue();i(t=>{if(n.multiInstance){const i=t.filter(t=>"page"===t.type&&t.route===e);if(r&&!s&&i.length>0)return o||h(i[i.length-1].id),t;const a=`page:${e}:${Math.random().toString(36).slice(2,8)}`;return c(a),[...t,{id:a,type:"page",label:n.label,route:e,openedFrom:d,...l?{shellOwned:l}:{},...s?{pageSearch:s}:{}}]}const i=t.find(t=>"page"===t.type&&t.route===e);if(i)return n.widget?t:(o||h(i.id),s&&i.pageSearch!==s?t.map(e=>e===i?{...e,pageSearch:s}:e):t);const a=`page:${e}`;return c(a),[...t,{id:a,type:"page",label:n.label,route:e,openedFrom:d,...l?{shellOwned:l}:{},...s?{pageSearch:s}:{}}]})},[u]),f=O(()=>{},[]),w=O(()=>{},[]),y=u,g=u;/* @__PURE__ */
44
- return V(Pe.Provider,{value:{openWindows:o,openEntity:m,openPage:p,closeEntity:y,minimize:f,items:[],openItems:o,restore:w,remove:g,restoreIfMinimized:()=>!1},children:[e,
45
- /* @__PURE__ */Y(ot,{openWindows:o,onRemove:u,onSplitView:Lr,onActivate:e=>{document.querySelectorAll("[data-modal-panel]").forEach(t=>{const n=t.querySelector("[data-window-title]");if(n?.textContent?.includes(e)){const e=t.getAttribute("data-modal-id");e&&Dn(e)}})},onActivateById:Ye}),
46
- /* @__PURE__ */Y(Cr,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
47
- /* @__PURE__ */
48
- return Y(ce.Provider,{value:c(e),children:/* @__PURE__ */Y(ye,{fallback:(t,n)=>/* @__PURE__ */Y(Nr,{open:!0,onClose:()=>d(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */Y(we,{error:t,onReload:n})}),children:/* @__PURE__ */Y(Dt,{spec:Re(e),children:/* @__PURE__ */Y(Pr,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */Y(je,{item:e,onClose:()=>d(e.id),accentRgb:n}):/* @__PURE__ */Y(He,{item:e,onClose:()=>d(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var lt=null,st=/* @__PURE__ */new Set;function ct(){return lt}function dt(e){if(lt!==e){lt=e;for(const e of st)e()}}function ut(e){return st.add(e),()=>{st.delete(e)}}var ht=!1,mt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},pt=()=>{};function ft(e){ht=e,mt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function wt(e,t){ht&&("submenu"===e?mt.submenus++:mt.menus++,mt.menuKey=t)}function yt(e){if(!ht)return pt;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!ht)return;const r=performance.now()-t;"move"===e?mt.moveMs+=r:mt.resizeMs+=r}}function gt(){const e=mt;return mt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var vt=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),bt=/* @__PURE__ */new Set(["svg"]);function xt(e){const t=[],n={text:"",accessories:[]};return kt(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function kt(e,t,n){if(null==e||"boolean"==typeof e)return;if("string"==typeof e||"number"==typeof e)return void n.push(String(e));if(Array.isArray(e))return void e.forEach(e=>kt(e,t,n));if(!W(e))return;const r=e;if(r.type!==d)if(r.type!==$){if("string"==typeof r.type){if(bt.has(r.type))return;if(!vt.has(r.type))return n.push(" "),R.toArray(r.props.children).forEach(e=>kt(e,t,n)),void n.push(" ")}t.accessories.push(j(r,{key:`title-part-${t.accessories.length}`}))}else R.toArray(r.props.children).forEach(e=>kt(e,t,n));else void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text)}var Et=/* @__PURE__ */new Map,Mt=/* @__PURE__ */new Set,Lt=0;function Ct(){Lt++,Mt.forEach(e=>e())}function Nt(e){return Et.get(e)}function St(e){return Mt.add(e),()=>{Mt.delete(e)}}function At(){return Lt}var Tt=S(""),zt=S(null);function Dt({spec:e,children:t}){/* @__PURE__ */
49
- return Y(zt.Provider,{value:e,children:t})}var It=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),Pt='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600',Kt='button, a[href], summary, [role="button"], [role="link"], [role="menuitem"], select';function Ot(e){return Wt(e).replace(/\s+/g," ").trim()}function Wt(e){if(null==e||"boolean"==typeof e)return"";if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(Array.isArray(e))return e.map(Wt).join("");if(W(e)){const t=e,n="string"==typeof t.type?t.type:"";return It.has(n)?"":` ${Wt(t.props?.children)} `}return""}function $t(e){const t=A(Tt);I(()=>{if(!t)return;const n=n=>{n.detail===t&&e()};return window.addEventListener("widget-open-settings",n),()=>window.removeEventListener("widget-open-settings",n)},[e,t])}var Rt={};function jt(e,t,n){const r=A(Tt);I(()=>{if(!r)return;Rt[r]||(Rt[r]=[]);const o={label:e,icon:n,onClick:t};return Rt[r].push(o),()=>{Rt[r]=(Rt[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function Bt({title:e}){const t=D(null);return I(()=>{const n=setTimeout(()=>{const n=t.current?.closest("[data-modal-id]"),r=n?.getAttribute("data-modal-id");r&&window.dispatchEvent(new CustomEvent("window-title-update",{detail:{id:r,title:e}}))},0);return()=>clearTimeout(n)},[e]),/* @__PURE__ */Y("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function Ft(e){}var Ht=S(null);function qt(){return A(Tt)}function Vt(){const e=K(or,rr),t=A(Ht);return t?.active??(un.length<=1||null!=e)}function Yt({children:e,position:t="right",quiet:n=!1}){const r=A(Ht),[o,i]=P(null);return I(()=>{if(!r)return;const e="left"===t?r.leftRef:r.rightRef,o=()=>!!e.current&&(i(e.current),n||r.notify(),!0);if(o())return;const a=setInterval(()=>{o()&&clearInterval(a)},50),l=setTimeout(()=>clearInterval(a),2e3);return()=>{clearInterval(a),clearTimeout(l)}},[r,t,n]),o?U(e,o):null}function Xt({onClick:e,children:t,className:n}){const r=A(Ht);/* @__PURE__ */
50
- return Y("button",{type:"button",onClick:async()=>{if(r?.isDirty){const{confirm:e}=await(import("./ConfirmDialog-CMNQZQA3.js"));if(!await e({title:"Discard changes?",message:"You have unsaved changes. Are you sure you want to cancel? All changes will be lost.",confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"}))return}e()},className:n||"bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50",children:t||"Cancel"})}var Ut="erp_window_positions",_t={};try{const e=localStorage.getItem(Ut);e&&(_t=JSON.parse(e))}catch{}var Jt=null;function Qt(){Jt&&clearTimeout(Jt),Jt=setTimeout(()=>{try{localStorage.setItem(Ut,JSON.stringify(_t))}catch{}},500)}var Gt="erp_activation_order",Zt=[];try{const e=localStorage.getItem(Gt),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(Zt=t)}catch{}var en=null;function tn(){en&&clearTimeout(en),en=setTimeout(()=>{try{localStorage.setItem(Gt,JSON.stringify(Zt))}catch{}},500)}function nn(e,t){_t[e]||(_t[e]=t,Qt())}function rn(e){return _t[e]?{..._t[e]}:null}function on(e,t){_t[e]=t,Qt()}function an(){const r=e(),o=t();let i=!1;for(const e of Object.keys(_t))n(_t[e],r,o)&&(delete _t[e],i=!0);i&&Qt()}var ln={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},sn=4e3,cn=()=>{if("undefined"==typeof document)return"large";const e=getComputedStyle(document.documentElement).getPropertyValue("--default-window-size")?.trim();return"small"===e||"medium"===e||"maximized"===e?e:"large"},dn={small:.8,medium:1,large:1.25,maximized:1.25},un=[],hn=/* @__PURE__ */new Set,mn=/* @__PURE__ */new Set,pn=0,fn=/* @__PURE__ */new Map;var wn=0;function yn(){return wn}function gn(){wn++,hn.forEach(e=>e())}var vn=/* @__PURE__ */new Map,bn=/* @__PURE__ */new Map,xn=/* @__PURE__ */new Map;function kn(){for(let e=un.length-1;e>=0;e--){const t=xn.get(un[e]);if(t?.tab)return t.owner}return null}function En(){return K(or,kn,()=>null)}var Mn=/* @__PURE__ */new Set;var Ln=null;function Cn(e){Ln=null,Dn(e)}function Nn(e){Ln=e;const t=vn.get(e);t&&Cn(t)}function Sn(e){Ln===e&&(Ln=null)}function An(e,t,n){if(n&&xn.set(e,n),t)if(vn.set(t,e),bn.set(e,t),Mn.delete(t)){un.unshift(e);const n=Zt.indexOf(t);-1!==n&&Zt.splice(n,1),Zt.unshift(t),tn()}else!function(e,t){const n=Zt.indexOf(t);if(-1===n)return void un.push(e);let r=un.length;for(let e=0;e<un.length;e++){const t=bn.get(un[e]);if(t&&Zt.indexOf(t)>n){r=e;break}}un.splice(r,0,e)}(e,t),-1===Zt.indexOf(t)&&(Zt.push(t),tn());else un.push(e);gn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&Ln===t&&Cn(e)}function Tn(e){return e?xn.get(e)?.owner??bn.get(e)??null:null}var zn=/* @__PURE__ */new Set;function Dn(e){const t=Tn(rr()),n=un.indexOf(e);-1!==n&&un.splice(n,1),un.push(e);const o=xn.get(e);if(o?.root&&o.tab&&r()){const e=un.filter(e=>{const t=xn.get(e);return!!t&&!t.root&&t.owner===o.owner});for(const t of e)un.splice(un.indexOf(t),1),un.push(t)}mn.delete(e);const i=bn.get(e);if(i){const e=Zt.indexOf(i);-1!==e&&Zt.splice(e,1),Zt.push(i),tn(),Ln&&Ln!==i&&(Ln=null)}gn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const a=Tn(rr());a&&a!==t&&zn.forEach(e=>e(a))}function In(e){const t=un.indexOf(e);-1!==t&&un.splice(t,1),mn.add(e),fn.set(e,++pn);const n=bn.get(e);if(n){const e=Zt.indexOf(n);-1!==e&&(Zt.splice(e,1),tn())}gn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var Pn=/* @__PURE__ */new Set;var Kn=8,On=32;function Wn(){return e()}var $n=40,Rn=80,jn=384,Bn=400;function Fn(e,t=Wn()){const n=Math.min(Math.max(e.x,t.x+Rn-e.w),t.x+t.w-Rn),r=Math.min(Math.max(e.y,t.y),t.y+t.h-$n);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function Hn(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=Wn();return t.left>=n.x-1&&t.top>=n.y-1&&t.right<=n.x+n.w+1&&t.bottom<=n.y+n.h+1}function qn(e){const t=Wn(),n=Math.floor(t.w/2),r=Math.floor(t.h/2);switch(e){case"top":return{x:t.x,y:t.y,w:t.w,h:t.h};case"left":return{x:t.x,y:t.y,w:n,h:t.h};case"right":return{x:t.x+n,y:t.y,w:t.w-n,h:t.h};case"tl":return{x:t.x,y:t.y,w:n,h:r};case"tr":return{x:t.x+n,y:t.y,w:t.w-n,h:r};case"bl":return{x:t.x,y:t.y+r,w:n,h:t.h-r};case"br":return{x:t.x+n,y:t.y+r,w:t.w-n,h:t.h-r}}}var Vn=null;function Yn(e){const t=(Vn||((Vn=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none","z-index: 40","border-radius: 8px","background: rgba(59, 130, 246, 0.18)","border: 2px solid rgb(59, 130, 246)","transition: left 120ms ease, top 120ms ease, width 120ms ease, height 120ms ease, opacity 120ms ease","opacity: 0","display: none"].join(";"),document.body.appendChild(Vn)),Vn);t.style.display="block",t.style.left=`${e.x}px`,t.style.top=`${e.y}px`,t.style.width=`${e.w}px`,t.style.height=`${e.h}px`,t.style.opacity="1"}function Xn(){Vn&&(Vn.style.opacity="0",Vn.style.display="none")}var Un=[{zone:"left",labelKey:"snapLeft",region:"inset-y-0 left-0 w-1/2"},{zone:"right",labelKey:"snapRight",region:"inset-y-0 right-0 w-1/2"},{zone:"tl",labelKey:"snapTopLeft",region:"top-0 left-0 h-1/2 w-1/2"},{zone:"tr",labelKey:"snapTopRight",region:"top-0 right-0 h-1/2 w-1/2"},{zone:"bl",labelKey:"snapBottomLeft",region:"bottom-0 left-0 h-1/2 w-1/2"},{zone:"br",labelKey:"snapBottomRight",region:"bottom-0 right-0 h-1/2 w-1/2"}],_n=350,Jn=200;function Qn({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o}){const[i,a]=P(!1),l=D(void 0),s=D(void 0);I(()=>()=>{clearTimeout(l.current),clearTimeout(s.current)},[]);const c=()=>{clearTimeout(s.current),l.current=setTimeout(()=>a(!0),_n)},d=()=>{clearTimeout(l.current),s.current=setTimeout(()=>a(!1),Jn)};/* @__PURE__ */
51
- return V("span",{className:"relative inline-flex",onMouseEnter:c,onMouseLeave:d,children:[
52
- /* @__PURE__ */Y("button",{onClick:t,onFocus:c,onBlur:d,title:e?o.windowed:o.maximize,className:r,children:e?"❐":"⤢"}),i&&/* @__PURE__ */Y("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(s.current),onMouseLeave:d,className:"absolute right-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-gray-200 bg-white p-1.5 shadow-lg",children:Un.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */Y("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{a(!1),n(e)},onFocus:()=>clearTimeout(s.current),onBlur:d,className:"relative h-7 w-11 rounded border border-gray-300 bg-gray-50 hover:border-blue-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",children:/* @__PURE__ */Y("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var Gn="rosh-gesture-style";var Zn={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},er=4;function tr(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(Gn))return;const e=document.createElement("style");e.id=Gn,e.textContent="body.rosh-gesturing [data-modal-panel]{will-change:transform}",document.head.appendChild(e)}();try{e.setPointerCapture(t)}catch{}document.body.classList.add("rosh-gesturing");const o=document.createElement("div");o.setAttribute("data-drag-shield",""),o.style.cssText=`position:fixed;inset:0;z-index:2147483647;cursor:${n};background:transparent;touch-action:none`,document.body.appendChild(o);const i=yt(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function nr(e){const t=un.indexOf(e);if(-1===t)return-1;const n=M.window+t*M.windowStep,o=xn.get(e);if(!o||o.root||!o.tab||!r())return n;let i=-1;for(const[e,t]of xn){if(!t.root||t.owner!==o.owner)continue;const n=un.indexOf(e);-1!==n&&(i=Math.max(i,M.window+n*M.windowStep))}return i>=n?i+2+Math.min(t,7):n}function rr(){return un[un.length-1]||null}function or(e){return hn.add(e),()=>{hn.delete(e)}}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=un.length-1;e>=0;e--)Pn.has(un[e])||un.splice(e,1);Zt=Zt.filter(e=>{const t=vn.get(e);return null!=t&&Pn.has(t)}),tn(),gn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var ir="modal-close-request";function ar(e){K(or,yn);const t=A(Ht);if(un.length<=1)return!0;if(e){const t=vn.get(e);if(null!=t)return rr()===t}return t?.active??null!=rr()}var lr=!1,sr=/* @__PURE__ */new Set;function cr(e){return sr.add(e),()=>sr.delete(e)}function dr(){return lr}function ur(e){lr!==e&&(lr=e,sr.forEach(e=>e()))}function hr(){ur(!lr)}function mr(){ur(!1)}var pr=null,fr=/* @__PURE__ */new Set;function wr(e){return fr.add(e),()=>fr.delete(e)}function yr(){return pr}function gr(e){pr!==e&&(pr=e,fr.forEach(e=>e()))}var vr=null,br=/* @__PURE__ */new Set;function xr(e){return br.add(e),()=>br.delete(e)}function kr(){return vr}function Er(e){vr!==e&&(vr=e,br.forEach(e=>e()))}function Mr(){if(!vr)return void ur(!1);gr(vr),Er(null),ur(!1)}function Lr(){ur(!lr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function Cr(){const e=K(cr,dr),[t,n]=P(e),[r,o]=P(e);return I(()=>{if(e){n(!0);const e=requestAnimationFrame(()=>o(!0));return()=>cancelAnimationFrame(e)}o(!1);const t=setTimeout(()=>n(!1),280);return()=>clearTimeout(t)},[e]),t&&"undefined"!=typeof document?U(
53
- /* @__PURE__ */Y("div",{onMouseDown:e=>{e.stopPropagation(),ur(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:2e3,cursor:"pointer",opacity:r?1:0,transition:"opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",pointerEvents:r?"auto":"none"}}),document.body):null}function Nr({open:t,onClose:i,title:c,icon:d,copyText:u,size:h="lg",dirty:m=!1,onNext:p,onPrev:f,footer:g,bodyScroll:E,onMinimize:S,initialBox:T,actions:$,actionsLeft:R,editing:F=!1,allowPinOnTop:H,initialPosition:q,widget:J,compact:Q,appStyle:G,flushBody:Z,autoHeight:ee,autoMinHeight:te,autoWidth:ne,widgetMenu:re,dimensions:oe,windowKey:ie,openedFromKey:ae,accentRgb:le,children:se}){const de=w(),[ue,he]=P(0),[me,pe]=P(!1),fe=D(null),we=D(0);I(()=>{we.current=ue},[ue]);const ve=O(e=>{de&&(fe.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},pe(!0),dt(ae??null))},[de,ae]),xe=K(ut,ct);I(()=>{if(!me)return;const e=e=>{if(!fe.current)return;const t=e.clientX-fe.current.startX;if(Math.abs(e.clientY-fe.current.startY)>Math.abs(t)+12)return fe.current=null,pe(!1),he(0),void dt(null);he(Math.max(0,t))},t=()=>{if(!fe.current)return;const e=.3*window.innerWidth,t=we.current>e;fe.current=null,pe(!1),t?(he(window.innerWidth),setTimeout(()=>{i(),he(0),dt(null)},180)):(he(0),dt(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[me]);const[ke,Ee]=P(c),Me=C(),Le=Me.window;I(()=>{Ee(c)},[c]);const Ce=B(()=>Ot(ke).trim()||void 0,[ke]),[Ne,Se]=P(!1),Ae=D(!1),[Te,ze]=P(!1),[De,Ie]=P(null),Pe=A(zt),Ke=A(ce),{prefs:We,save:Re}=y(),je=!!We.window_accent_stripe,Be=We.favorite_documents||[],Fe=!!Pe&&Be.some(e=>e.entityType===Pe.entityType&&e.entityId===Pe.entityId),He=O(()=>{if(!Pe)return;const e=Fe?Be.filter(e=>!(e.entityType===Pe.entityType&&e.entityId===Pe.entityId)):[...Be,{entityType:Pe.entityType,entityId:Pe.entityId,label:Pe.label}];Re({favorite_documents:e})},[Pe,Fe,Be,Re]),[qe,Ve]=P(null),[Ye,Xe]=P("top-right"===q?"right":"left"),Ue=D(!1),_e=D(null);z(()=>{const e=_e.current;e&&(le?e.style.setProperty("--window-accent-rgb",le):e.style.removeProperty("--window-accent-rgb"))},[le]);const Je=D(!1),Qe=D(null),Ge=D(null),Ze=D(null),[et,tt]=P(!1),nt=D(null),rt=!!(g||$||R)||et,ot=A(ge),it=""!==A(Tt),at=D(null);at.current=Ke?{owner:Ke.key,tab:Ke.tab,root:!it}:null;const lt=ie||(Ke&&!it?Ke.key:null),st=!!ot&&!it&&ot.enabled&&ot.hasState&&(F||ot.declaredEditable)&&!ot.handMounted&&rt&&!J&&!Q&&!G&&!de,ht=/* @__PURE__ */Y("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75A2.25 2.25 0 016 4.5h12a2.25 2.25 0 012.25 2.25v10.5A2.25 2.25 0 0118 19.5H6a2.25 2.25 0 01-2.25-2.25V6.75z M3.75 9h16.5"})}),mt=d&&W(d)?j(d,{className:`h-4 w-4 ${d.props?.className??""}`.trim()}):d??ht,pt=()=>/* @__PURE__ */Y("button",{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();const t=e.currentTarget.getBoundingClientRect();Ie(e=>e?null:{x:t.left,y:t.bottom+4})},className:"shrink-0 p-0.5 rounded hover:bg-gray-200/50 transition-colors",title:"Window menu",children:mt}),ft=40,{minimize:wt,items:yt,restoreIfMinimized:gt,openWindows:vt}=$e(),bt=D(`modal-${Math.random().toString(36).slice(2,8)}`).current;I(()=>{if(J)return Pn.add(bt),()=>{Pn.delete(bt)}},[J,bt]),I(()=>{const e=e=>{const t=e.detail;t?.id===bt&&Ee(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[bt]);const[kt,Mt]=P(M.window),Lt=function(e){const t=K(or,rr);return un.length<=1||t===e}(bt),Nt=function(e){return K(or,()=>mn.has(e))}(bt),St=K(cr,dr),At=K(wr,yr),Dt=K(xr,kr),It=!H&&!J,Wt=St&&It,[$t,jt]=P(!1),Bt=Wt&&Dt===bt,[Ft,qt]=P(!1),Vt=Ft&&It&&At===bt?"picked":null,Yt=D(Wt);I(()=>{if(Yt.current&&!Wt){qt(!0);const e=setTimeout(()=>{qt(!1),pr===bt&&gr(null)},700);return Yt.current=Wt,()=>clearTimeout(e)}Yt.current=Wt},[Wt,bt]),I(()=>{Wt||jt(!1)},[Wt]),I(()=>{const e=Ge.current,t=Ze.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>tt(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),I(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&_e.current){const t=_e.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=Ge.current,n=Ze.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const Xt=D(!1),Ut=O(e,[]),Jt=O(()=>{const t=e(),n=oe?oe[0]:ln[h]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),l=dn[cn()],s=oe?Math.min(oe[1],i):(()=>{const e=("sm"===h?500:"md"===h?600:"lg"===h?700:"xl"===h?800:920)*l;return Math.max(320,Math.min(e,t.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||r()?0:30*(un.length-1),d=Math.max(ft,(i-s)/2),u=(o-a)/2,m=t.h-ft-s-d;return"top-right"===q?{x:t.x+t.w-a-ft,y:t.y+ft,w:a,h:s}:"top-left"===q?{x:t.x+ft,y:t.y+ft,w:a,h:s}:{x:t.x+Math.max(ft,(o-a)/2+ft)+Math.min(c,Math.max(0,u)),y:t.y+d+Math.min(c,Math.max(0,m)),w:a,h:s}},[h]),Gt=D(!1);t||(Gt.current=!1);const Zt=ie||u||null;I(()=>{if(!t)return;An(bt,Zt,at.current??void 0),ie||Dn(bt),Xt.current=!1,Mt(nr(bt));const e=()=>{Mt(nr(bt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===ie;if(!e.label)return!1;const t=_e.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(Dn(bt),Mn.current)return;const t=Wn(),n=Math.min(Tn.current.w,t.w-40),o=Math.min(Tn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;nn({x:i,y:a,w:n,h:o}),Sn(!1)},i=e=>{const t=e.detail;r(t)&&(Dn(bt),Ie({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==ie)return;Dn(bt);const t=Tn.current,n=function(e,t=Wn()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=_e.current,o="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(r&&!o){let e=!1;const t=()=>{e||(e=!0,r.style.transition="",window.dispatchEvent(new CustomEvent("modal-geometry")))};r.style.transition="left .28s ease, top .28s ease, width .28s ease, height .28s ease",r.addEventListener("transitionend",t,{once:!0}),window.setTimeout(t,400)}nn(n)};return window.addEventListener("modal-reorder",e),window.addEventListener("modal-split-view",n),window.addEventListener("modal-center",o),window.addEventListener("modal-reveal",a),window.addEventListener("modal-context-menu",i),()=>{!function(e){const t=un.indexOf(e);-1!==t&&(un.splice(t,1),gn()),mn.delete(e),fn.delete(e),xn.delete(e);const n=bn.get(e);n&&(bn.delete(e),vn.delete(n))}(bt),window.removeEventListener("modal-reorder",e),window.removeEventListener("modal-split-view",n),window.removeEventListener("modal-center",o),window.removeEventListener("modal-reveal",a),window.removeEventListener("modal-context-menu",i),window.dispatchEvent(new CustomEvent("modal-reorder"))}},[t,bt,Zt,Ut]);const en=!J&&"maximized"===cn(),[tn,nn]=P(()=>{if(Zt&&_t[Zt]){const e={..._t[Zt]};return oe&&(e.w=oe[0],ee||(e.h=oe[1])),Fn(e)}return T?{x:T.x,y:T.y,w:T.w,h:T.h}:en?Ut():Jt()}),[rn,on]=P(()=>!ee),[an,hn]=P(()=>r()),pn=D(an),wn=D(null);I(()=>{const e=()=>{const e=r();e!==pn.current&&wn.current?.(e),pn.current=e,hn(e),Mt(nr(bt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[bt]);const yn=an&&!!Ke?.tab&&!it&&!J&&!de,kn=yn,Mn=D(kn);Mn.current=kn;const Ln=En(),Cn=an&&!!Ke?.tab&&!J&&!de&&!St&&Ln!==Ke.key,[Nn,Sn]=P(()=>Zt&&_t[Zt]||T?kn:kn||en),Tn=D(tn);Tn.current=tn;const zn=D(Nn);z(()=>{zn.current=Nn},[Nn]),z(()=>{if(rn||yn)return;const e=_e.current,t=Qe.current;if(!e||!t)return;const n=te??(J?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const l=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&s.unobserve(a),s.observe(c),a=c);const d=e.offsetHeight-t.offsetHeight,u=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const p=t.offsetHeight,f=c.offsetHeight;t.style.flex=u,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>f+4,y=Math.max(n,window.innerHeight-r-Math.max(0,Tn.current.y)-24),g=w?Math.min(Tn.current.h,y):Math.min(Math.max(n,d+p),y),v=Math.abs(g-o)>1;v&&(o=g,nn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),J||(g<=n?i&&(clearTimeout(i),i=null):(v||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;l(),o===e&&on(!0)},160)))},s=new ResizeObserver(l);l(),nt.current&&s.observe(nt.current);const c=new MutationObserver(l);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{s.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[rn,J,te,rt,yn]),z(()=>{if(!ee||!rn||J||!t)return;const e=nt.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||Nn)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=te??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,l=Math.max(i,window.innerHeight-a-Math.max(0,Tn.current.y)-24);nn(e=>({...e,h:Math.min(Math.max(i,e.h+r),l)}))});return r.observe(e),()=>r.disconnect()},[ee,rn,J,t,Nn,te]);const $n=!1!==ne&&!J&&!G&&!de,[Rn,Hn]=P(()=>!$n);z(()=>{if(Rn||!t)return;if(!$n||Nn)return void Hn(!0);const n=_e.current,r=Qe.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let i=Tn.current.w,c=0;const d=()=>Hn(!0),u=()=>{c=0;const t=Tn.current;if(Math.abs(t.w-i)>1||document.body.classList.contains("rosh-gesturing"))return void d();const u=e(),h=u.w-80;if(t.w>=h)return void d();const m=[],p=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(m.push(e),p.push(t))}if(!m.length)return;const f=Math.min(h,t.w+Math.max(...p)),w=f-t.w,y=n.style.width;n.style.width=`${f}px`;const g=m.map((e,t)=>({over:p[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{a(e,w)||o.add(m[t])});const v=l(t,s(t.w,w,g),u,ft);v!==t&&(i=v.w,nn(v))};u();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(u))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(d,sn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Rn,t,$n,Nn]);const Vn=D(null),Un=!(!Ke?.tab||it||J||de);wn.current=t=>{if(!Un)return;if(t)return Vn.current||(Vn.current={box:{...Tn.current},maximized:zn.current}),void(zn.current=!0);const r=Vn.current;Vn.current=null;const o=e();if(r?.maximized)return zn.current=!0,Sn(!0),void nn(o);const i=r?.box??(Zt?_t[Zt]:void 0);if(zn.current=!1,Sn(!1),i&&!n(i,o,!1)){const e={...i};oe&&(e.w=oe[0],ee||(e.h=oe[1])),nn(Fn(e))}else nn(Jt())},I(()=>{kn&&(zn.current=!0,Sn(!0),nn(Ut()))},[kn,Ut]),I(()=>{if(J)return;const e=()=>{const e=Zt?_t[Zt]:void 0;if(zn.current=!1,Sn(!1),e){const t={...e};oe&&(t.w=oe[0],ee||(t.h=oe[1])),nn(Fn(t))}else nn(Jt())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[J,Jt,Zt]),I(()=>{t&&Zt&&!yn&&(_t[Zt]=tn,Qt()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[tn,t,Zt,yn]),I(()=>{if(!t)return;const e=()=>{zn.current?nn(Ut()):document.body.classList.contains("rosh-gesturing")||nn(Fn)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return Nn&&(n=new MutationObserver(e),n.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["class"]})),()=>{window.removeEventListener("resize",e),window.removeEventListener(o,e),n?.disconnect()}},[t,Nn,Ut]),I(()=>{if(t&&(Se(!1),Ae.current=!1,Ue.current=!1,Hn(!$n),!Mn.current)){if(Zt&&_t[Zt]){const e=_t[Zt];return void nn(t=>Fn({...e,...ee?{h:t.h}:{},...$n?{x:t.x,w:t.w}:{}}))}T&&(nn({x:T.x,y:T.y,w:T.w,h:T.h}),Sn(T.maximized))}},[t]),I(()=>{if(!t||"auto"!==m)return;let e;const n=t=>{_e.current?.contains(t.target)&&!Ae.current&&(Ae.current=!0,e=setTimeout(()=>Se(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(e),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[t,m]);const _n="auto"===m?Ne:!0===m,Jn=Ke&&!it?Ke.key:null,Gn=B(()=>xt(ke),[ke]),ar=D({shortcutSpec:Pe,isOnDesktop:Fe,toggleDesktopShortcut:He,taskbarStrings:Me.taskbar});z(()=>{ar.current={shortcutSpec:Pe,isOnDesktop:Fe,toggleDesktopShortcut:He,taskbarStrings:Me.taskbar}});const lr=D(null);lr.current||(lr.current={open:(e,t)=>Ie({x:e,y:t}),items:()=>{const e=ar.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of Rt[bt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),I(()=>{t&&Jn&&function(e,t){const n=Et.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.menu===t.menu||(Et.set(e,t),Ct())}(Jn,{title:Gn.text||Ce,dirty:_n,copy:Gn.copy,menu:lr.current??void 0})},[t,Jn,Ce,_n,Gn.text,Gn.copy]),I(()=>{if(t&&Jn)return()=>{return e=Jn,void(Et.delete(e)&&Ct());var e}},[t,Jn]),Oe(!(ie||!t)&&_n);const sr=O(async()=>{if(!Ue.current){if(_n||"auto"===m&&Ae.current){Ue.current=!0;const e=Ce,t=await v({title:"Discard changes?",message:e?`“${e}” has unsaved changes. Are you sure you want to close? All changes will be lost.`:"You have unsaved changes. Are you sure you want to close? All changes will be lost.",confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});if(Ue.current=!1,!t)return}i()}},[_n,m,i,Ce]);z(()=>{if(!t||!lt)return;const e=e=>{e.detail?.windowKey===lt&&sr()};return window.addEventListener(ir,e),()=>window.removeEventListener(ir,e)},[t,lt,sr]);const hr=D(null),mr=O(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Ie(null),Dn(bt),Mn.current)return void e.preventDefault();e.preventDefault();const t=e.currentTarget,n=e.pointerId;let r=null;const o=e.clientX,i=e.clientY,a=_e.current,l=a?.getBoundingClientRect();let s,c,d,u;if(hr.current){const t=hr.current;hr.current=null,u=t.w,d=t.h;const n=l?Math.min(Math.max(20,e.clientX-l.left),t.w-20):t.w/2;s=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${u}px`,a.style.height=`${d}px`,a.style.left=`${s}px`,a.style.top=`${c}px`)}else s=l?l.left:Tn.current.x,c=l?l.top:Tn.current.y,d=l?l.height:Tn.current.h,u=l?l.width:Tn.current.w;Sn(!1),nn(e=>({...e,x:s,y:c,w:u,h:d}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<er&&Math.abs(e.clientY-i)<er)return;r=tr(t,n,"move","move"),a&&(a.style.transition="none")}const l=s+e.clientX-o,d=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${l-s}px, ${d-c}px)`),Tn.current={...Tn.current,x:l,y:d},!J){const t=function(e,t){const n=Wn(),r=e<=n.x+Kn,o=e>=n.x+n.w-Kn,i=t<=n.y+Kn,a=t>=n.y+n.h-Kn,l=e<=n.x+On,s=e>=n.x+n.w-On,c=t<=n.y+On,d=t>=n.y+n.h-On;return i&&l?"tl":i&&s?"tr":a&&l?"bl":a&&s?"br":c&&r?"tl":c&&o?"tr":d&&r?"bl":d&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==h&&(h=t,t?Yn(qn(t)):Xn())}},p=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",p),r?.(),Xn();const e=Fn({...Tn.current});if(Tn.current=e,!J&&h){hr.current={x:s,y:c,w:u,h:d};const e=qn(h);return a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.width=`${e.w}px`,a.style.height=`${e.h}px`,a.style.transform="",a.style.transition=""),void nn(e)}if(J){const t=e.x+e.w/2,n=window.innerWidth/2;Xe(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),nn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",p)},[]),fr=O((e,t)=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation();const n=e.currentTarget,r=e.pointerId;let o=null;const i=e.clientX,a=e.clientY,l=_e.current,s=l?.getBoundingClientRect(),c=s?s.left:Tn.current.x,d=s?s.top:Tn.current.y,u=s?s.width:Tn.current.w,h=s?s.height:Tn.current.h,m="sw"===t||"nw"===t||"w"===t,p="ne"===t||"nw"===t||"n"===t,f="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;Sn(!1),nn({x:c,y:d,w:u,h:h}),Tn.current={x:c,y:d,w:u,h:h};let y=0,g=null;const v=()=>{if(y=0,!g)return;const e=g;g=null,Tn.current=e,l&&(l.style.left=`${e.x}px`,l.style.top=`${e.y}px`,l.style.width=`${e.w}px`,l.style.height=`${e.h}px`)},b=e=>{if(!o){if(Math.abs(e.clientX-i)<er&&Math.abs(e.clientY-a)<er)return;o=tr(n,r,Zn[t],"resize")}g=((e,t)=>{let n=c,r=d,o=u,i=h;if(f&&(o=Math.max(jn,u+e)),w&&(i=Math.max(Bn,h+t)),m){const t=Math.max(jn,u-e);n=c+u-t,o=t}if(p){const e=Math.max(Bn,h-t);r=d+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(v))},x=()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),v(),o?.(),nn({...Tn.current})};window.addEventListener("pointermove",b),window.addEventListener("pointerup",x)},[]),vr=O(e=>{if(e.target.closest("button, input, a, kbd, select, textarea"))return;const t={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!t&&"Enter"!==e.key)return;if(e.preventDefault(),e.stopPropagation(),Dn(bt),"Enter"===e.key)return void(Nn?(Sn(!1),nn(Jt())):(Sn(!0),nn(Ut())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{hr.current||(hr.current={...Tn.current})};if(r<0)return e(),Sn(!0),void nn(Ut());if(r>0){if(Nn)return Sn(!1),void nn(Jt());if(hr.current){const e=Fn(hr.current);return hr.current=null,Tn.current=e,void nn(e)}return void In(bt)}e(),Sn(!1);const t=qn(n<0?"left":"right");return Tn.current=t,void nn(t)}if(Nn)return;const o=Tn.current,i=e.shiftKey?{...o,w:Math.max(jn,o.w+24*n),h:Math.max(Bn,o.h+24*r)}:Fn({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});Tn.current=i,nn(i)},[bt,Nn,Jt,Ut]),br=O(e=>{hr.current||(hr.current={...Tn.current}),Sn(!1);const t=qn(e);Tn.current=t,nn(t),Dn(bt)},[bt]),Er=kn||Wt?{}:{tabIndex:0,role:"group","aria-label":Ce?`${Ce} — ${Le.windowSuffix}`:Le.windowSuffix,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+ArrowRight Control+ArrowUp Control+ArrowDown Control+ArrowLeft Control+ArrowRight Enter",onKeyDown:vr},Mr=()=>{Sn(!0),nn(Ut())},Lr=O(()=>{const e=_e.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(Pt);t&&!t.disabled&&t.click()}},[]);I(()=>{if(!t)return;if(J)return;const e=e=>{if(un[un.length-1]===bt&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),Lr();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&_e.current?.contains(t)))return;if(t.closest(Kt))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Lr,bt,J]),I(()=>{if(!t)return;const e=e=>{un[un.length-1]===bt&&((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:bt}})),Ae.current=!1,Se(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:bt}}))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),I(()=>{if(!t)return;if(J)return;const e=e=>{if("Escape"===e.key&&un[un.length-1]===bt){if(L(e))return e.preventDefault(),void e.stopPropagation();if(yn&&!F)return;e.preventDefault(),e.stopPropagation(),sr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,sr,bt,J,yn,F]);const Cr=t&&(void 0!==p||void 0!==f),Nr=O(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-[9999] bg-gray-900 text-white px-5 py-2.5 rounded-lg shadow-lg text-sm font-medium transition-opacity duration-300",o.textContent=r,document.body.appendChild(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),300)},2e3)},[]);if(I(()=>{if(!t)return;const e=e=>{if(un[un.length-1]!==bt)return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&Cr&&(e.preventDefault(),p?p():Nr("bottom")),"k"===e.key&&Cr&&(e.preventDefault(),f?f():Nr("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,p,f,Cr,Nr,bt]),!t||Gt.current)return null;const Sr=Wt?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),l=n%o,s=r-o*(i-1),c=a===i-1&&s<o,d=Wn(),u=(d.w-20*(o+1))/o,h=(d.h-14*(i+1)-22*i)/i,m=c?(o-s)*(u+20)/2:0;return{x:d.x+20+l*(u+20)+m,y:d.y+14+a*(h+14+22),w:u,h:h}}(bt):null,Ar=Wt&&Sr?Math.min(Sr.w/tn.w,Sr.h/tn.h):1,Tr=(()=>{if(Wt&&Sr){const e=Ar,t=tn.w*e,n=tn.h*e,r=Sr.x+(Sr.w-t)/2-tn.x,o=Sr.y+(Sr.h-n)/2-tn.y,i=$t||Bt;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:i?2020:2010,boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(Ft&&It){const e="picked"===Vt;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:2030}:{}}}return null})(),zr=/* @__PURE__ */V("div",{children:[
54
- /* @__PURE__ */V("div",{ref:_e,"data-modal-panel":!0,"data-modal-id":bt,"data-window-key":ie||void 0,...H?{"data-utility":""}:{},...Te?{"data-pinned-top":""}:{},...J?{"data-widget":""}:{},...Ke?{"data-window-owner":Ke.key}:{},...Ke&&!it?{"data-window-root":""}:{},...yn?{"data-window-tab":""}:{},className:yn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(J?Lt?"shadow-2xl":"shadow-lg":"border "+(Lt?"shadow-2xl border-gray-200":"shadow-lg border-gray-300")),onMouseDownCapture:e=>{if(Je.current=!1,Wt){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),gr(bt),ur(!1),void Dn(bt)}if(!Lt&&!J&&!Te&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===_e.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),Je.current=!0,Ie(null),Dn(bt),window.addEventListener("mouseup",()=>{setTimeout(()=>{Je.current=!1},0)},{once:!0}))}},onClickCapture:e=>{Je.current&&(Je.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(Wt)return;Ie(null);e.target.closest("[data-modal-panel]")===_e.current&&(e.target.closest("button, input, a, select, textarea")||Dn(bt))},style:de?{zIndex:kt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${ue}px)`,transition:me?"none":"transform 180ms ease-out",...J?{display:"none"}:{},...kt<0?{display:"none"}:{},...Lt||Te||xe&&ie===xe?{}:{display:"none"}}:{zIndex:Te?M.pinnedWindow:kt+1,width:tn.w,height:tn.h,top:tn.y,...J&&"right"===Ye?{right:window.innerWidth-tn.x-tn.w}:{left:tn.x},...kt<0&&!Te?{display:"none"}:{},...Cn?{visibility:"hidden",pointerEvents:"none"}:{},...Tr??{}},children:[de&&!J&&/* @__PURE__ */Y("div",{onPointerDown:ve,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),J?null:yn?Ke?.home?null:/* @__PURE__ */V(X,{children:[
55
- /* @__PURE__ */Y("h2",{"data-window-title":!0,className:"sr-only",children:Gn.text||Ce}),(Gn.accessories.length>0||Cr)&&/* @__PURE__ */V("div",{"data-window-chrome":"","data-record-bar":"",className:"flex h-9 shrink-0 select-none items-center gap-3 border-b border-gray-200 px-4",style:{backgroundColor:"rgb(var(--window-content-rgb))"},children:[
56
- /* @__PURE__ */Y("div",{className:"flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:Gn.accessories}),Cr&&/* @__PURE__ */V("span",{className:"flex items-center gap-1 shrink-0 text-[10px] text-gray-400",children:[
57
- /* @__PURE__ */Y("kbd",{className:"rounded border border-gray-300 bg-gray-100 px-1.5 py-0.5 font-medium text-gray-500",children:"K"}),
58
- /* @__PURE__ */Y("span",{children:Le.prev}),
59
- /* @__PURE__ */Y("kbd",{className:"rounded border border-gray-300 bg-gray-100 px-1.5 py-0.5 font-medium ml-1 text-gray-500",children:"J"}),
60
- /* @__PURE__ */Y("span",{children:Le.next})]})]})]}):de?null:
61
- /* @__PURE__ */V("div",Q?{onPointerDown:mr,"data-window-chrome":"",...Er,className:"flex items-center justify-between px-3 py-1.5 border-b border-gray-200 shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(Lt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Lt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
62
- /* @__PURE__ */V("div",{"data-window-title":!0,title:Ce,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-1.5",style:{color:Lt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Wt&&pt(),
63
- /* @__PURE__ */Y("span",{className:"truncate",children:Wt?Ot(ke):ke})]}),!Wt&&/* @__PURE__ */V("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[H&&/* @__PURE__ */Y("button",{onClick:()=>ze(e=>!e),title:Te?Le.unpin:Le.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(Te?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Y("svg",{className:"h-3 w-3",fill:Te?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 3.75V16.5L12 14.25 7.5 16.5V3.75m9 0H18A2.25 2.25 0 0120.25 6v12A2.25 2.25 0 0118 20.25H6A2.25 2.25 0 013.75 18V6A2.25 2.25 0 016 3.75h1.5m9 0h-9"})})}),
64
- /* @__PURE__ */Y("button",{type:"button",onClick:sr,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */Y(N,{name:"close",fallback:_,className:"h-4 w-4"})})]})]}:G?{onPointerDown:mr,"data-window-chrome":"",...Er,className:"flex items-center justify-between px-3 py-1.5 border-b border-gray-200 shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(Lt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Lt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
65
- /* @__PURE__ */V("div",{"data-window-title":!0,title:Ce,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-1.5",style:{color:Lt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Wt&&pt(),
66
- /* @__PURE__ */Y("span",{className:"truncate",children:Wt?Ot(ke):ke})]}),!Wt&&/* @__PURE__ */V("div",{className:"flex items-center gap-0.5 shrink-0 ml-2",children:[H&&/* @__PURE__ */Y("button",{onClick:()=>ze(e=>!e),title:Te?Le.unpin:Le.pinOnTop,className:"p-0.5 rounded hover:bg-gray-200 "+(Te?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Y("svg",{className:"h-3 w-3",fill:Te?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 3.75V16.5L12 14.25 7.5 16.5V3.75m9 0H18A2.25 2.25 0 0120.25 6v12A2.25 2.25 0 0118 20.25H6A2.25 2.25 0 013.75 18V6A2.25 2.25 0 016 3.75h1.5m9 0h-9"})})}),
67
- /* @__PURE__ */Y("button",{onClick:()=>In(bt),title:Le.minimize,className:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",children:"─"}),!kn&&/* @__PURE__ */Y(Qn,{maximized:Nn,onToggleMax:()=>{Nn?(Sn(!1),nn(Jt())):Mr()},onSnap:br,buttonClassName:"text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none",strings:Le}),
68
- /* @__PURE__ */Y("button",{type:"button",onClick:sr,className:"rounded p-0.5 text-gray-400 hover:text-gray-600 hover:bg-gray-200",children:/* @__PURE__ */Y(N,{name:"close",fallback:_,className:"h-4 w-4"})})]})]}:{onPointerDown:mr,"data-window-chrome":"",...Er,className:"flex items-center justify-between px-4 py-2.5 border-b border-gray-200 shrink-0 cursor-move select-none rounded-t-(--radius-window) focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 "+(Lt?"backdrop-blur-sm":""),style:{touchAction:"none",backgroundColor:Lt?"rgb(var(--window-header-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-header-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
69
- /* @__PURE__ */V("div",{"data-window-title":!0,title:Ce,className:"text-base font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Lt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:[!Wt&&pt(),
70
- /* @__PURE__ */Y("span",{className:"truncate",children:Wt?Ot(ke):ke})]}),!Wt&&/* @__PURE__ */V("div",{className:"flex items-center gap-1.5 shrink-0 ml-4",children:[Cr&&/* @__PURE__ */V("span",{className:"flex items-center gap-1 mr-1 text-[10px] text-gray-400",children:[
71
- /* @__PURE__ */Y("kbd",{className:"rounded border border-gray-300 bg-gray-200 px-1.5 py-0.5 font-medium text-gray-500",children:"K"}),
72
- /* @__PURE__ */Y("span",{children:Le.prev}),
73
- /* @__PURE__ */Y("kbd",{className:"rounded border border-gray-300 bg-gray-200 px-1.5 py-0.5 font-medium ml-1 text-gray-500",children:"J"}),
74
- /* @__PURE__ */Y("span",{children:Le.next})]}),H&&/* @__PURE__ */Y("button",{onClick:()=>ze(e=>!e),title:Te?Le.unpin:Le.pinOnTop,className:"text-xs px-2 py-1 rounded hover:bg-gray-200 "+(Te?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Y("svg",{className:"h-3.5 w-3.5",fill:Te?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 3.75V16.5L12 14.25 7.5 16.5V3.75m9 0H18A2.25 2.25 0 0120.25 6v12A2.25 2.25 0 0118 20.25H6A2.25 2.25 0 013.75 18V6A2.25 2.25 0 016 3.75h1.5m9 0h-9"})})}),
75
- /* @__PURE__ */Y("button",{onClick:()=>In(bt),title:Le.minimize,className:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",children:"─"}),!kn&&/* @__PURE__ */Y(Qn,{maximized:Nn,onToggleMax:()=>{Nn?(Sn(!1),nn(Jt())):Mr()},onSnap:br,buttonClassName:"text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200",strings:Le}),
76
- /* @__PURE__ */Y("kbd",{className:"rounded border border-gray-300 bg-gray-200 px-1.5 py-0.5 text-[10px] font-medium text-gray-400",children:"ESC"}),
77
- /* @__PURE__ */Y("button",{type:"button",onClick:sr,className:"rounded-(--radius-control) text-gray-400 hover:text-gray-600",children:/* @__PURE__ */Y(N,{name:"close",fallback:_,className:"h-5 w-5"})})]})]}),le&&je&&!J&&!de&&/* @__PURE__ */Y("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${Lt?.9:.55})`}}),
78
- /* @__PURE__ */Y(Tt.Provider,{value:bt,children:/* @__PURE__ */Y(Ht.Provider,{value:{rightRef:Ge,leftRef:Ze,notify:()=>tt(!0),active:Lt,isDirty:_n,footerOpen:rt&&!J&&!Q&&!G&&!de},children:/* @__PURE__ */Y("div",{ref:Qe,...J?{onPointerDown:mr,onContextMenu:e=>{e.preventDefault(),Ve({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${J?"p-0 cursor-move":G||Z?"p-0":Q?"p-2":"p-4"} ${J||yn?"":"backdrop-blur-sm"} ${!1===E||G||Z?"overflow-hidden":"overflow-y-auto overscroll-contain"} ${J?"rounded-2xl select-none":""}`,style:{...J?{touchAction:"none"}:{},backgroundColor:J?"transparent":yn?"rgb(var(--window-content-rgb))":Lt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */Y(ye,{children:se})})})}),J&&qe&&/* @__PURE__ */V(b,{minWidth:160,style:{left:qe.x,top:qe.y},onClose:()=>Ve(null),children:[
79
- /* @__PURE__ */Y(x,{onClick:()=>{Ve(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:bt}))},children:"Settings"}),
80
- /* @__PURE__ */Y(k,{}),re&&/* @__PURE__ */V(X,{children:[re,
81
- /* @__PURE__ */Y(k,{})]}),
82
- /* @__PURE__ */V(x,{onClick:()=>{Ve(null),ze(e=>!e)},children:[
83
- /* @__PURE__ */Y("span",{className:"flex-1",children:"Always on Top"}),Te&&/* @__PURE__ */Y("svg",{className:"h-4 w-4 text-blue-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]}),
84
- /* @__PURE__ */Y(k,{}),
85
- /* @__PURE__ */Y(x,{onClick:()=>{Ve(null),sr()},children:"Close"})]}),
86
- /* @__PURE__ */V("div",{onPointerDown:mr,ref:nt,className:`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${yn?"":" cursor-move"}${Lt&&!yn?" backdrop-blur-sm":""}${J||Q||G||de||!rt?" hidden":""}`,style:{touchAction:"none",backgroundColor:yn?"rgb(var(--window-footer-rgb))":Lt?"rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
87
- /* @__PURE__ */V("div",{className:"flex items-center gap-2 min-w-0",children:[st&&/* @__PURE__ */Y(be,{auto:!0}),R,
88
- /* @__PURE__ */Y("div",{ref:Ze,"data-modal-actions-left":!0,className:"flex items-center gap-2"}),g]}),
89
- /* @__PURE__ */V("div",{className:"flex items-center gap-2 ml-auto",children:[
90
- /* @__PURE__ */Y("div",{ref:Ge,"data-modal-actions":!0,className:"flex items-center gap-2"}),$]})]}),!J&&!de&&!Wt&&Lt&&!kn&&/* @__PURE__ */V(X,{children:[
91
- /* @__PURE__ */Y("div",{onPointerDown:e=>fr(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
92
- /* @__PURE__ */Y("div",{onPointerDown:e=>fr(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
93
- /* @__PURE__ */Y("div",{onPointerDown:e=>fr(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
94
- /* @__PURE__ */Y("div",{onPointerDown:e=>fr(e,"nw"),className:"absolute top-0 left-0 w-3 h-3 cursor-nwse-resize z-10"}),
95
- /* @__PURE__ */Y("div",{onPointerDown:e=>fr(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
96
- /* @__PURE__ */Y("div",{onPointerDown:e=>fr(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
97
- /* @__PURE__ */Y("div",{onPointerDown:e=>fr(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
98
- /* @__PURE__ */Y("div",{onPointerDown:e=>fr(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),Wt&&/* @__PURE__ */Y("div",{className:"absolute inset-0",style:{zIndex:9999,cursor:"pointer",background:"transparent"},onMouseEnter:()=>jt(!0),onMouseLeave:()=>jt(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),Dn(bt),ur(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:$t&&/* @__PURE__ */Y("button",{type:"button","data-expose-close":!0,"aria-label":Me.taskbar.closeWindow,title:"Close",className:"absolute flex items-center justify-center rounded-full bg-black/55 text-white shadow-lg ring-1 ring-white/40 transition-colors hover:bg-red-500",style:{top:8,right:8,width:30,height:30,transform:`scale(${1/Ar})`,transformOrigin:"top right",zIndex:1e4},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),sr()},children:/* @__PURE__ */Y("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.2,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})})]}),Wt&&Sr&&/* @__PURE__ */Y("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:Sr.x,top:Sr.y+Sr.h+4,width:Sr.w,zIndex:$t?2021:2011,color:"white",fontSize:12,fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:Ot(ke)})]}),Dr=De&&/* @__PURE__ */V(b,{style:{left:De.x,top:De.y},onClose:()=>Ie(null),minWidth:160,children:[!J&&!Q&&!yn&&/* @__PURE__ */V(X,{children:[
99
- /* @__PURE__ */V(x,{onClick:()=>{In(bt),Ie(null)},children:[
100
- /* @__PURE__ */Y("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 12h-15"})}),Le.minimize]}),!kn&&/* @__PURE__ */V(x,Nn?{onClick:()=>{Sn(!1),nn(Jt()),Ie(null)},children:[
101
- /* @__PURE__ */Y("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 4.5v15m6-15v15M4.5 9h15M4.5 15h15"})}),Le.windowed]}:{onClick:()=>{Mr(),Ie(null)},children:[
102
- /* @__PURE__ */Y("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),Le.maximize]})]}),H&&!yn&&/* @__PURE__ */V(x,{onClick:()=>{ze(e=>!e),Ie(null)},children:[
103
- /* @__PURE__ */Y("svg",{className:"h-4 w-4 "+(Te?"text-blue-600":"text-gray-400"),fill:Te?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 3.75V16.5L12 14.25 7.5 16.5V3.75m9 0H18A2.25 2.25 0 0120.25 6v12A2.25 2.25 0 0118 20.25H6A2.25 2.25 0 013.75 18V6A2.25 2.25 0 016 3.75h1.5m9 0h-9"})}),Te?Le.unpin:Le.pinOnTop]}),Pe&&/* @__PURE__ */V(x,{onClick:()=>{Ie(null),He()},children:[
104
- /* @__PURE__ */Y("svg",{className:"h-4 w-4 "+(Fe?"text-yellow-500":"text-gray-400"),fill:Fe?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */Y("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})}),Fe?Me.taskbar.removeFromDesktop:Me.taskbar.addToDesktop]}),(Rt[bt]||[]).length>0&&/* @__PURE__ */Y(X,{children:(Rt[bt]||[]).map((e,t)=>/* @__PURE__ */V(x,{onClick:()=>{Ie(null),e.onClick()},children:[e.icon,e.label]},t))}),!(yn&&Ke?.home)&&/* @__PURE__ */V(X,{children:[
105
- /* @__PURE__ */Y(k,{}),
106
- /* @__PURE__ */V(x,{danger:!0,onClick:()=>{Ie(null),sr()},children:[
107
- /* @__PURE__ */Y(N,{name:"close",fallback:_,className:"h-4 w-4"}),Le.close]})]})]}),Ir=!!ie&&vt.some(e=>e.id===ie),Pr=!Nt||Ir||J?null:/* @__PURE__ */V("div",{"data-modal-restore-tab":!0,"data-modal-id":bt,className:"fixed left-1/2 z-[1200] flex -translate-x-1/2 items-center gap-1 rounded-lg border border-gray-300 bg-white px-1.5 py-1 shadow-lg",style:{bottom:"calc(var(--taskbar-height, 0px) + 12px)"},children:[
108
- /* @__PURE__ */Y("button",{type:"button",onClick:()=>Dn(bt),title:Le.restore,className:"max-w-[16rem] truncate rounded px-2 py-0.5 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900",children:Ce||Le.windowSuffix}),
109
- /* @__PURE__ */Y("button",{type:"button",onClick:()=>Dn(bt),title:Le.restore,"aria-label":Le.restore,className:"rounded px-1.5 py-0.5 text-xs leading-none text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
110
- /* @__PURE__ */Y("button",{type:"button",onClick:()=>{sr()},title:Le.close,"aria-label":Le.close,className:"rounded px-1.5 py-0.5 text-xs leading-none text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:"✕"})]});return U(
111
- /* @__PURE__ */V(zt.Provider,{value:null,children:[zr,Dr,Pr]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{lr&&"Escape"===e.key&&(Er(null),ur(!1))});var Sr=100,Ar={past:[],future:[]};function Tr(e,t){switch(t.type){case"record":{const n=e.past[e.past.length-1];if(null!==t.step.coalesceKey&&n?.coalesceKey===t.step.coalesceKey)return 0===e.future.length?e:{...e,future:[]};const r=[...e.past,t.step];return{past:r.length>Sr?r.slice(r.length-Sr):r,future:[]}}case"undo":return 0===e.past.length?e:{past:e.past.slice(0,-1),future:[t.redoStep,...e.future]};case"redo":return 0===e.future.length?e:{past:[...e.past,t.undoStep],future:e.future.slice(1)};case"clear":return 0===e.past.length&&0===e.future.length?e:Ar}}var zr=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var Dr=500,Ir=250;function Pr({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,a]=F(Tr,Ar),l=D(/* @__PURE__ */new Map),[s,c]=P(0),d=s>0,[u,h]=P(0),[m,p]=P(0),f=m>0,{hasAnyPerm:w}=i(),y=t&&0===u&&(!(n&&n.length>0)||w(n)),g=D(null),v=D(!1),b=O(()=>{const e={};for(const[t,n]of l.current)e[t]=n.getLast();return e},[]),x=O((e,t)=>{l.current.has(e)||c(e=>e+1),l.current.set(e,t)},[]),k=O(e=>{l.current.delete(e)&&c(e=>e-1)},[]),E=O(e=>{h(t=>t+(e?1:-1))},[]),M=O(e=>{p(t=>t+(e?1:-1))},[]),[L,C]=P(0),N=L>0,S=O(e=>{C(t=>t+(e?1:-1))},[]),T=A(ge),z=T?.claimReadOnly;I(()=>{if(z&&!y)return z(!0),()=>z(!1)},[z,y]);const K=T?.claimOwnMount;I(()=>{if(K&&N)return K(!0),()=>K(!1)},[K,N]);const W=D({last:0,count:0,tripped:!1}),$=D(!1),R=O((e,t,n)=>{if(v.current)return void(n&&function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}(n.prev,n.next)||($.current=!0));if(!y||g.current)return;const r=W.current;if(r.tripped)return;const o=Date.now();if(o-r.last>Ir&&(r.count=0),r.last=o,++r.count>Dr)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${Dr} undo steps with no pause between them, which no user action can do. The value passed to useUndoable for this slice is almost certainly rebuilt on every render (a .map/.filter/object literal in the call) rather than held in state, so it reads as changed every time — and since recording a step re-renders the form, that is a loop. Undo recording is now off for this form to keep the tab responsive.`);g.current={values:b(),label:e,coalesceKey:t},queueMicrotask(()=>{const e=g.current;g.current=null,e&&a({type:"record",step:e})})},[y,b]),j=O(e=>{for(const[t,n]of Object.entries(e)){const e=l.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),H=O(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:b(),label:e.label,coalesceKey:null};j(e.values),a({type:"undo",redoStep:t})},[o.past,b,j]),q=O(()=>{const e=o.future[0];if(!e)return;const t={values:b(),label:e.label,coalesceKey:null};j(e.values),a({type:"redo",undoStep:t})},[o.future,b,j]),[X,U]=P(0),_=D(0),J=D(0),Q=D(!1),G=O(()=>{v.current=!0,$.current=!1,g.current=null,_.current+=1,J.current=_.current,U(_.current)},[]),Z=D(void 0),ee=O(e=>{void 0!==e&&(void 0!==Z.current&&e!==Z.current&&(Q.current=!0),Z.current=e),G()},[G]);I(()=>{v.current&&X===J.current&&(v.current=!1,g.current=null,($.current||Q.current)&&a({type:"clear"}),$.current=!1,Q.current=!1)},[X]);const te=O(()=>{Q.current=!0,a({type:"clear"}),G()},[G]),ne=y&&o.past.length>0,re=y&&o.future.length>0,oe=ar(r),ie=D({undo:H,redo:q,canUndo:ne,canRedo:re});ie.current={undo:H,redo:q,canUndo:ne,canRedo:re},I(()=>{if(!oe||!y)return;const e=e=>{const t=function(e){if(!e.metaKey&&!e.ctrlKey||e.altKey)return null;const t=e.key.toLowerCase(),n="z"===t?e.shiftKey?"redo":"undo":"y"!==t||!e.ctrlKey||e.metaKey||e.shiftKey?null:"redo";if(!n)return null;const r=e.target;return r?.isContentEditable||r?.tagName&&zr.has(r.tagName.toUpperCase())?null:n}(e);if(!t)return;const n=ie.current;("undo"===t?n.canUndo:n.canRedo)&&(e.preventDefault(),"undo"===t?n.undo():n.redo())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[oe,y]);const ae=B(()=>({register:x,unregister:k,record:R,undo:H,redo:q,clear:te,baseline:ee,canUndo:ne,canRedo:re,enabled:y,hasState:d,handMounted:N,claimOwnMount:S,claimReadOnly:E,declaredEditable:f,claimEditable:M,undoLabel:ne?o.past[o.past.length-1].label:null,redoLabel:re?o.future[0].label:null}),[x,k,R,H,q,te,ee,ne,re,y,d,N,S,E,f,M,o.past,o.future]),le=""!==qt(),se=A(Ht)?.footerOpen??!1,ce=le&&y&&d&&!N&&se;/* @__PURE__ */
112
- return V(ge.Provider,{value:ae,children:[ce&&/* @__PURE__ */Y(Yt,{position:"left",quiet:!0,children:/* @__PURE__ */Y(be,{auto:!0})}),e]})}function Kr(){const e=A(ge),t=O(()=>{},[]);return{undo:e?.undo??t,redo:e?.redo??t,clear:e?.clear??t,baseline:e?.baseline??t,canUndo:e?.canUndo??!1,canRedo:e?.canRedo??!1,undoLabel:e?.undoLabel??null,redoLabel:e?.redoLabel??null,enabled:e?.enabled??!1,hasState:e?.hasState??!1}}function Or(e){const t=A(ge),n=t?.claimReadOnly,r=t?.claimEditable;I(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function Wr(e,t,n){const r=A(ge),o=H(),i=D(e),a=D(t);a.current=t,I(()=>{if(r)return r.register(o,{getLast:()=>i.current,setLast:e=>{i.current=e},apply:e=>a.current(e)}),()=>r.unregister(o)},[r,o]);const{label:l,coalesceKey:s=null}=n,c=D(r);c.current=r;const d=D({label:l,coalesceKey:s});d.current={label:l,coalesceKey:s},I(()=>{const t=c.current;t&&(Object.is(e,i.current)||(t.record(d.current.label,d.current.coalesceKey,{prev:i.current,next:e}),i.current=e))},[e])}function $r(e,t){const[n,r]=P(e);return Wr(n,e=>r(()=>e),t),[n,r]}export{Xt as CancelButton,Be as DocFavStar,Ae as EntityWindowFallback,Ne as EntityWindowLoading,Te as EntityWindowState,Kt as KEY_ACTIVATED_SELECTOR,Le as LoadingSpinner,Pt as MODAL_SUBMIT_SELECTOR,Nr as Modal,Yt as ModalActions,be as UndoControls,Pr as UndoProvider,re as WINDOW_REGISTRY,we as WindowCrashedFallback,ye as WindowErrorBoundary,at as WindowManagerProvider,Bt as WindowTitle,Ye as activateWindowById,yt as beginWindowGesture,Sn as cancelWindowFront,se as client_default,Mr as commitExposeHighlight,gt as drainPerfEvents,mr as exitExposeMode,an as forgetMaximizedWindowBoxes,rr as getActiveModalId,Je as getActiveWindowRoute,kr as getExposeHighlight,At as getWindowChromeVersion,rn as getWindowPosition,De as isDraftEntityId,Ie as isDraftEntityWindow,ee as isEntityEntry,Z as isPageEntry,ae as isShellApiClientConfigured,Xe as isTabWindow,wt as markMenuOpen,Nt as readWindowChrome,Nn as requestWindowFront,Er as setExposeHighlight,ft as setPerfCollecting,ie as setShellApiClient,me as setShellHomeRoute,ne as setShellWindowRegistry,nn as setWindowDefaultPosition,on as setWindowPosition,xt as splitTitle,xr as subscribeExposeHighlight,St as subscribeWindowChrome,hr as toggleExposeMode,En as useCurrentTabKey,qt as useEnclosingModalId,ar as useIsActiveWindow,Vt as useModalActive,de as usePageSearch,Kr as useUndo,Or as useUndoCanEdit,Wr as useUndoable,$r as useUndoableState,$t as useWidgetSettings,Oe as useWindowDirty,$e as useWindowManager,jt as useWindowMenuItem,Ft as useWindowTitle};
@@ -1,9 +0,0 @@
1
- import{useWindowMenuItem as e,Modal as r}from"./chunk-N6STBYXR.js";import{navIcons as t}from"./chunk-DSSLOQDW.js";import{VERSION as o}from"./chunk-BSJIBRWC.js";import{DEFAULT_SHELL_STRINGS as n,useShellStrings as s,splitAround as i}from"./chunk-J3LIIIHJ.js";import{useState as a,useCallback as l,isValidElement as c,cloneElement as m}from"react";import{jsx as d,jsxs as p}from"react/jsx-runtime";var h=n.aboutApp,u={spreadsheet:{name:"Spreadsheets",version:"1.1.3",route:"/spreadsheet",description:h.spreadsheet},notepad:{name:"Notepad",version:"1.0.1",route:"/notepad",description:h.notepad},documents:{name:"Documents",version:"1.1.0",route:"/documents",description:h.documents},preview:{name:"Preview",version:"1.4.2",route:"/preview",description:h.preview},files:{name:"Files",version:"1.1.1",route:"/files",description:h.files},browser:{name:"Browser",version:"1.0.1",route:"/browser",description:h.browser}},x=/* @__PURE__ */d("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */d("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"})}),f=/* @__PURE__ */d("svg",{className:"h-9 w-9",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */d("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75A2.25 2.25 0 016 4.5h12a2.25 2.25 0 012.25 2.25v10.5A2.25 2.25 0 0118 19.5H6a2.25 2.25 0 01-2.25-2.25V6.75z M3.75 9h16.5"})});function v({app:n}){const h=u[n],[v,g]=a(!1),w=l(()=>g(!0),[]),N=s().aboutApp,k=N.title(h.name);if(e(k,w,x),!v)return null;const y=t[h.route],b=c(y)?m(y,{className:"h-9 w-9"}):f,[j,B]=i(N.partOf);/* @__PURE__ */
2
- return d(r,{open:!0,onClose:()=>g(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */p("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
3
- /* @__PURE__ */d("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:b}),
4
- /* @__PURE__ */d("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:h.name}),
5
- /* @__PURE__ */d("p",{className:"text-[11px] font-mono text-gray-400",children:N.version(h.version)}),
6
- /* @__PURE__ */d("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:N[n]}),
7
- /* @__PURE__ */p("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
8
- /* @__PURE__ */p("p",{className:"text-[11px] text-gray-500",children:[j,
9
- /* @__PURE__ */d("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),B]}),o&&/* @__PURE__ */d("p",{className:"mt-0.5 text-[10px] font-mono text-gray-400",children:N.shellVersion(o)})]})]})})}export{v as AboutApp,u as BUILTIN_APP_INFO};
@@ -1,21 +0,0 @@
1
- import{useCopyText as e,CopyGlyph as t}from"./chunk-KVOFUFPP.js";import{PopupMenu as r,PopupMenuItem as n,PopupMenuDivider as l}from"./chunk-AA4TMQOS.js";import{useShellStrings as i}from"./chunk-J3LIIIHJ.js";import{useState as a,useEffect as o,Fragment as s}from"react";import{jsxs as c,jsx as d,Fragment as m}from"react/jsx-runtime";var u="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function p(){/* @__PURE__ */
2
- return d("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:"size-3.5",children:/* @__PURE__ */d("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})}function y({text:r,label:n,copiedLabel:l}){const{copied:i,copy:a}=e(r);/* @__PURE__ */
3
- return d("button",{type:"button",tabIndex:-1,"aria-label":i?l:n,title:i?l:n,onClick:a,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */d(t,{copied:i,className:"size-3.5"})})}function h({tabs:e,activeKey:t,idFor:h,panelMounted:b,onActivate:f,onClose:g,onCloseMany:x,label:k,className:v,activeClassName:w,end:N,onIconMenu:C,menuItems:I}){const $=i().pageTabs,[j,z]=a(null),M=e.length;o(()=>{if(!t)return;const e=document.getElementById(h(t,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[h,t,M]);const L=e.some(e=>e.key===t)?t:e[0]?.key,A=t=>{const r=e[(t+e.length)%e.length];r&&document.getElementById(h(r.key,"tab"))?.focus()},D=j?e.find(e=>e.key===j.key):void 0,_=D&&I?I(D.key):[],B=D?e.indexOf(D):-1,E=e=>e.some(e=>!e.pinned),F=e=>()=>{z(null),e()};/* @__PURE__ */
4
- return c("div",{className:v??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
5
- /* @__PURE__ */d("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
6
- /* @__PURE__ */d("div",{role:"tablist","aria-label":k,onKeyDown:t=>{const r=e.findIndex(e=>document.getElementById(h(e.key,"tab"))===t.target);if(!(r<0)){if("ArrowRight"===t.key)A(r+1);else if("ArrowLeft"===t.key)A(r-1);else if("Home"===t.key)A(0);else if("End"===t.key)A(e.length-1);else{if("Delete"!==t.key||e[r].pinned)return;g(e[r].key)}t.preventDefault()}},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:e.map((r,n)=>{const l=r.key===t,i=!!r.dirty,a=r.icon,o=l?w??"z-[1] border-gray-200 bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",m=n>0&&!l&&e[n-1].key!==t,x={type:"button",role:"tab",id:h(r.key,"tab"),"aria-selected":l,"aria-controls":b?.(r.key)?h(r.key,"panel"):void 0,tabIndex:r.key===L?0:-1,title:r.title,onClick:()=>f(r.key)},k={onContextMenu:e=>((e,t)=>{e.preventDefault(),z({x:e.clientX,y:e.clientY,key:t.key})})(e,r),onAuxClick:e=>((e,t)=>{1!==e.button||t.pinned||(e.preventDefault(),g(t.key))})(e,r),onMouseDown:e=>{1===e.button&&e.preventDefault()}},v=a&&
7
- /* @__PURE__ */c("span",{className:"relative flex size-4 shrink-0 items-center justify-center text-gray-500 [&>svg]:size-4","aria-hidden":"true",children:[a,i&&!l&&!r.pinned&&
8
- /* @__PURE__ */d("span",{className:"absolute -right-1 -top-1 hidden size-2 rounded-full bg-gray-500 ring-2 ring-gray-100 @max-[6.5rem]:block @max-[6.5rem]:group-hover:hidden"})]}),N=l&&!!C&&!!a;return r.pinned?/* @__PURE__ */d("div",{role:"presentation",className:`group relative flex h-9 flex-none items-center justify-center rounded-t-md border border-b-0 transition-colors ${a?"w-10":""} ${o}`,...k,children:/* @__PURE__ */c("button",{...x,className:`flex h-full items-center justify-center rounded-t-md ${a?"w-full":"px-3"} ${u}`,children:[v,
9
- /* @__PURE__ */d("span",{className:a?"sr-only":"whitespace-nowrap text-[13px]",children:r.title})]})},r.key):/* @__PURE__ */c(s,{children:[m&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"mb-2.5 h-4 w-px shrink-0 self-end border-l border-gray-300"}),
10
- /* @__PURE__ */c("div",{role:"presentation",className:`group @container relative flex h-9 items-center rounded-t-md border border-b-0 text-[13px] transition-colors ${l&&(r.copy||N)?"flex-[0_1_20rem]":"flex-[0_1_15rem]"} ${l?"min-w-[4.25rem]":"min-w-[2.75rem]"} ${o}`,...k,children:[N&&
11
- /* @__PURE__ */d("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":$.tabMenu,title:$.tabMenu,onClick:e=>{const t=e.currentTarget.getBoundingClientRect();C?.(r.key,t.left,t.bottom+4)},className:`ml-2 flex size-6 shrink-0 items-center justify-center rounded hover:bg-gray-200 @max-[5rem]:ml-1.5 ${u}`,children:v}),
12
- /* @__PURE__ */c("button",{...x,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-md pr-1 text-left ${N?"pl-1.5":"pl-3"} ${u} ${l?N?"":"@max-[5rem]:pl-2.5":"@max-[6.5rem]:pr-3 @max-[6.5rem]:group-hover:pr-1 @max-[4.5rem]:justify-center @max-[4.5rem]:px-0 @max-[4.5rem]:group-hover:pl-1.5"}`,children:[!N&&v,
13
- /* @__PURE__ */d("span",{className:"min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] "+(a?l?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""),children:r.title})]}),l&&r.copy&&/* @__PURE__ */d(y,{text:r.copy,label:$.copy(r.copy),copiedLabel:$.copied}),
14
- /* @__PURE__ */c("span",{className:"mr-1.5 flex size-5 shrink-0 items-center justify-center "+(l?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[i&&/* @__PURE__ */d("span",{role:"img","aria-label":$.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
15
- /* @__PURE__ */d("button",{type:"button",tabIndex:-1,"aria-label":$.closeTab?.(r.title)??`${$.close} ${r.title}`,onClick:()=>g(r.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(i?"hidden group-hover:flex":l?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */d(p,{})})]})]})]},r.key)})}),N&&/* @__PURE__ */d("div",{className:"flex shrink-0 items-center gap-2 self-center",children:N}),j&&D&&/* @__PURE__ */c(r,{portal:!0,style:{left:j.x,top:j.y},onClose:()=>z(null),children:[_.length>0&&/* @__PURE__ */c(m,{children:[_.map((e,t)=>/* @__PURE__ */c(n,{onClick:F(e.onSelect),children:[e.icon,e.label]},t)),
16
- /* @__PURE__ */d(l,{})]}),
17
- /* @__PURE__ */d(n,{disabled:D.pinned,onClick:F(()=>g(D.key)),children:$.close}),
18
- /* @__PURE__ */d(l,{}),
19
- /* @__PURE__ */d(n,{disabled:!E(e.filter(e=>e.key!==D.key)),onClick:F(()=>x("others",D.key)),children:$.closeOthers}),
20
- /* @__PURE__ */d(n,{disabled:!E(e.slice(B+1)),onClick:F(()=>x("right",D.key)),children:$.closeRight}),
21
- /* @__PURE__ */d(n,{disabled:!E(e),onClick:F(()=>x("all",null)),children:$.closeAll})]})]})}export{h as TabStrip};