efficient-shell 4.162.0 → 4.163.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.
- package/README.md +152 -0
- package/dist/{Browser-TNUODLDN.js → Browser-2I27OQFE.js} +14 -14
- package/dist/Calculator-2EB2RAT7.js +29 -0
- package/dist/ConfirmDialog-4LZXI6FM.js +1 -0
- package/dist/{CurrencyConverter-4XKRUO7Y.js → CurrencyConverter-4EEIPAVX.js} +5 -5
- package/dist/{Documents-VYDMJL37.js → Documents-24YAA5UU.js} +7 -7
- package/dist/{Files-D3D6JWSJ.js → Files-BU7FY2VD.js} +24 -24
- package/dist/{Notepad-CBJIS3WA.js → Notepad-3D4L3K5W.js} +7 -7
- package/dist/PdfViewer-5VBKCPCM.js +1 -0
- package/dist/{PomodoroTimer-PB6J2LMS.js → PomodoroTimer-B4OPUTJL.js} +26 -26
- package/dist/{Preview-O2UZROZO.js → Preview-VZSNH76G.js} +10 -10
- package/dist/{Sidebar-PPC3OK4H.js → Sidebar-7AY5WJZC.js} +27 -27
- package/dist/{Spreadsheet-AYV4CQP3.js → Spreadsheet-TAJ24BQS.js} +14 -14
- package/dist/{Stock-FGJ5HQ7H.js → Stock-VEPDDIMJ.js} +3 -3
- package/dist/{Weather-FW3WWYCI.js → Weather-KGZF4DDW.js} +19 -19
- package/dist/{WorldClock-UC4CXE2N.js → WorldClock-UGADOCFW.js} +5 -5
- package/dist/apps/index.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-HQLEQIMG.js → chunk-2FZGALCU.js} +7 -7
- package/dist/{chunk-2S73NE3L.js → chunk-4GOHPACN.js} +1 -1
- package/dist/{chunk-GTQJYE6M.js → chunk-6A7BN7EN.js} +6 -6
- package/dist/chunk-A6O4Y63A.js +1 -0
- package/dist/{chunk-GBL5KOGP.js → chunk-E4JWTNG5.js} +18 -18
- package/dist/{chunk-STJVLCQU.js → chunk-FWY5IRGL.js} +2 -2
- package/dist/{chunk-4SQNYTO3.js → chunk-GSBX7KIS.js} +17 -17
- package/dist/{chunk-4VMA4ALC.js → chunk-IJ3V2YOS.js} +8 -8
- package/dist/{chunk-7ESGXPKN.js → chunk-J5HNLMGZ.js} +7 -7
- package/dist/chunk-L7ZMDZAB.js +9 -0
- package/dist/{chunk-5UNSI4UI.js → chunk-MAMJHPFN.js} +1 -1
- package/dist/{chunk-EYU4IAEZ.js → chunk-NLASNJNY.js} +1 -1
- package/dist/{chunk-EU3AQ4B2.js → chunk-PX435JG4.js} +1 -1
- package/dist/chunk-QRJ2ERKR.js +9 -0
- package/dist/{chunk-ZWYKMIX7.js → chunk-TBM3ZIAN.js} +14 -14
- package/dist/{chunk-6WLGERBO.js → chunk-TZ2EFTST.js} +8 -8
- package/dist/{chunk-7EACKL5V.js → chunk-UMOVLVTC.js} +1 -1
- package/dist/chunk-VWTYRICQ.js +963 -0
- package/dist/{chunk-A2FL26TE.js → chunk-WURTAA2S.js} +1 -1
- package/dist/chunk-YJX2IWHB.js +1 -0
- package/dist/{chunk-S6ZIQSAF.js → chunk-ZAJPQAGP.js} +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/{index-DYVoKNru.d.ts → index-JQXMH_km.d.ts} +540 -69
- package/dist/index.d.ts +3 -42
- package/dist/index.js +645 -645
- package/dist/map/index.js +2 -2
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/package.json +3 -2
- package/dist/Calculator-HHPPI72V.js +0 -29
- package/dist/ConfirmDialog-D46T6ZXW.js +0 -1
- package/dist/PdfViewer-UEMING6A.js +0 -1
- package/dist/chunk-6CKRJ4YK.js +0 -942
- package/dist/chunk-DYVN6C2E.js +0 -9
- package/dist/chunk-LQVXGB7A.js +0 -1
- package/dist/chunk-O46U4PVN.js +0 -4
- package/dist/chunk-UZUH5PVW.js +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{toast_default as e}from"./chunk-
|
|
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
|
|
1
|
+
import{toast_default as e}from"./chunk-NLASNJNY.js";import{useShellStrings as t}from"./chunk-YJX2IWHB.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),[W,D]=o(!0),S=a(y.loadFailed);S.current=y.loadFailed,i(()=>{let t=!1;return D(!0),M(1),p&&(s.GlobalWorkerOptions.workerSrc=p),s.getDocument({url:n,...g(f)}).promise.then(e=>{t||(L(e),E(e.numPages),D(!1))}).catch(()=>{t||(e.error(S.current),D(!1))}),()=>{t=!0}},[n,p,f]),i(()=>{if(!C||!_||!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,_,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 $="page"===l?y.fitPage:y.fitWidth,H="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
|
|
3
3
|
return d("div",{className:"flex flex-col h-full",children:[
|
|
4
4
|
/* @__PURE__ */d(m,{children:[
|
|
5
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
6
|
/* @__PURE__ */c("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:y.pageOf(N,j)}),
|
|
7
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
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:()=>{
|
|
10
|
-
/* @__PURE__ */d("select",{value:
|
|
11
|
-
/* @__PURE__ */c("option",{value:"fit",children:$}),!
|
|
12
|
-
/* @__PURE__ */c("button",{type:"button","aria-label":y.zoomIn,title:y.zoomIn,onClick:()=>{
|
|
13
|
-
/* @__PURE__ */c("button",{type:"button",onClick:()=>
|
|
9
|
+
/* @__PURE__ */c("button",{type:"button","aria-label":y.zoomOut,title:y.zoomOut,onClick:()=>{P(!1),A(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:H,children:/* @__PURE__ */c("span",{"aria-hidden":"true",children:"−"})}),
|
|
10
|
+
/* @__PURE__ */d("select",{value:_?"fit":w.includes(Math.round(100*z))?Math.round(100*z):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(P(!1),A(Number(t)/100)):P(!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:$}),!_&&!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:()=>{P(!1),A(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:H,children:/* @__PURE__ */c("span",{"aria-hidden":"true",children:"+"})}),
|
|
13
|
+
/* @__PURE__ */c("button",{type:"button",onClick:()=>P(!0),"aria-pressed":_,className:H+(_?" bg-gray-200 text-gray-900":""),title:y.fitHint,children:y.fit}),
|
|
14
14
|
/* @__PURE__ */c("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
15
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=>({"&":"&","<":"<",">":">",'"':"""}[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:H,children:[
|
|
16
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]}),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{onOverlayOpen as e,Z_LAYERS as t,registerModalEscapeInterceptor as n}from"./chunk-OSJ3ADF2.js";import{rootIsDark as r}from"./chunk-MAIHBBWT.js";import{useHydrated as o,useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{createContext as a,forwardRef as s,useContext as l,useRef as u,useId as c,useState as d,useEffect as p,useMemo as m,useCallback as h}from"react";import{createPortal as f}from"react-dom";import{jsx as g,jsxs as y,Fragment as b}from"react/jsx-runtime";function x(){try{const e=getComputedStyle(document.documentElement).getPropertyValue("--menu-opacity")?.trim();if(e)return parseFloat(e)}catch{}return.95}var w=r;function v(){try{return document.documentElement.classList.contains("rosh-reduce-transparency")}catch{return!1}}function k(e,t){return`color-mix(in srgb, ${e} ${+(Math.round(255*Math.min(1,Math.max(0,t)))/255*100).toFixed(4)}%, transparent)`}function C(e,t={}){const n=e??x();if(v()&&"light"===t.ink)return{background:"var(--rosh-glass-light-ink-surface)",border:"1px solid var(--rosh-glass-light-ink-solid-border)",boxShadow:"var(--rosh-glass-solid-shadow)"};if(v())return{background:"var(--rosh-glass-surface)",border:"1px solid var(--rosh-glass-solid-border)",boxShadow:"var(--rosh-glass-solid-shadow)"};const r="var(--rosh-glass-surface)",o="var(--rosh-glass-surface-mid)";return w()?{background:`linear-gradient(135deg in srgb, ${k(r,.85*n)} 0%, ${k(o,.75*n)} 50%, ${k(r,.85*n)} 100%)`,backdropFilter:"blur(40px) saturate(1.6)",WebkitBackdropFilter:"blur(40px) saturate(1.6)",border:"1px solid var(--rosh-glass-border)",boxShadow:"var(--rosh-glass-shadow)"}:{background:`linear-gradient(135deg in srgb, ${k(r,.85*n)} 0%, ${k(o,.65*n)} 50%, ${k(r,.75*n)} 100%)`,backdropFilter:"blur(40px) saturate(1.8)",WebkitBackdropFilter:"blur(40px) saturate(1.8)",border:"1px solid var(--rosh-glass-border)",boxShadow:"var(--rosh-glass-shadow)"}}function $(e){return v()?"var(--rosh-glass-surface)":k("var(--rosh-glass-surface)",.85*(e??x()))}var M="border-white/20",N="glass-input-bg",L=/* @__PURE__ */new Set(["text","search","url","tel","email","password","number","date","datetime-local","month","week","time"]),T="data-native-context-menu";function B(e,t){return e&&"function"==typeof e.closest?e.closest(t):null}function E(e){const t=e;if(!t||"function"!=typeof t.closest)return!1;if(B(t,`[${T}]`))return!0;if(B(t,"textarea"))return!0;if(B(t,"img, picture, canvas, video, audio"))return!0;const n=B(t,"input");if(n){const e=(n.type||"text").toLowerCase();if(L.has(e))return!0}const r=B(t,"[contenteditable]");if(r){const e=(r.getAttribute("contenteditable")||"").toLowerCase();if(""===e||"true"===e||"plaintext-only"===e)return!0}return!1}var W=/* @__PURE__ */new Set(["http:","https:","mailto:","tel:","blob:"]);function A(e,t,n){const r=B(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 W.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 F(e){if(e.defaultPrevented)return!0;if(e.shiftKey)return!0;if("touch"===e.pointerType)return!0;return E(("function"==typeof e.composedPath?e.composedPath()[0]:void 0)??e.target)}function S(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function P(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function R(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 D(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 H(e,t,n,r,o,i=!1,a=8){const s=t+o,l=e-o-n,u=l>=a;return i&&u?{left:l,flipped:!0}:s+n<=r-a?{left:s,flipped:!1}:u?{left:l,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function I(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var j=a(null),z=a(!1);function q({children:n,style:r,className:i="",onClose:a,minWidth:s=180,portal:l=!1}){const h=u(null),y=c(),[b,x]=d([]),w=u();p(()=>()=>clearTimeout(w.current),[]);const v=o(),k=m(()=>{const e=()=>clearTimeout(w.current);return{id:y,depth:0,path:b,open:(t,n)=>{e(),x(e=>S(e,t,n))},scheduleClose:t=>{e(),w.current=setTimeout(()=>x(e=>P(e,t)),200)},closeBelow:t=>{e(),x(e=>P(e,t))},cancelClose:e,closeTree:()=>{e(),x([]),a?.()},root:h}},[y,b,a]);p(()=>{if(!a)return;const t=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${y}"]`)||h.current&&!h.current.contains(e.target)&&a()},n=e=>{"Escape"===e.key&&a()};window.addEventListener("pointerdown",t),window.addEventListener("keydown",n);const r=e(a);return()=>{window.removeEventListener("pointerdown",t),window.removeEventListener("keydown",n),r()}},[a,y]),p(()=>{const e=h.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 $=I(),M=/(^|[\s:])!?z-/.test(i),N=/* @__PURE__ */g("div",{ref:h,"data-popup-menu-tree":y,className:`fixed rounded-2xl ${"tight"===$?"py-1":"large"===$?"py-2":"py-1.5"} ${i}`,onContextMenu:e=>{E(e.target)||e.preventDefault()},style:{...M?{}:{zIndex:t.menu},minWidth:s,animation:"popup-in 0.12s ease-out",...C(),...r},children:/* @__PURE__ */g(j.Provider,{value:k,children:n})});return l?v?f(N,document.body):null:N}function U(e,t,n,r=!1){const o=I(),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 K=s(function({onClick:e,children:t,className:n="",danger:r,disabled:o,role:i,tabIndex:a,id:s,onMouseEnter:u},c){const d=l(j),p=l(z),m=U(r,o,n);/* @__PURE__ */
|
|
2
|
+
return g("button",{ref:c,id:s,role:i??(p?"menuitem":void 0),tabIndex:a,onClick:()=>{e?.(),d&&d.depth>0&&d.closeTree()},onMouseEnter:()=>{d?.scheduleClose(d.depth),u?.()},disabled:o,className:m.className,style:m.style,children:t})}),J=/* @__PURE__ */g("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__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})});function O(e){let n=t.menu;for(let t=e;t&&t!==document.body;t=t.parentElement){const e=parseInt(getComputedStyle(t).zIndex,10);Number.isNaN(e)||(n=e)}return n}function V(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function G({label:e,icon:t,children:r,disabled:o,className:a="",minWidth:s=180,maxHeight:d}){const x=l(j),w=c(),v=u(null),k=u(null),$=u(),M=u(!1),N=`${w}-menu`;p(()=>()=>clearTimeout($.current),[]);const L=x?.depth??0,T=x?.path[L],B=!!T&&T.key===w&&!o,W=h(e=>{if(!x||o||!v.current)return;clearTimeout($.current),M.current=e;const t=v.current.getBoundingClientRect(),n=v.current.closest("[data-popup-submenu-panel]")??v.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,i=L>0&&(x.path[L-1]?.flipped??!1),a=H(r.left,r.right,s,window.innerWidth,4,i);x.open(L,{key:w,y:t.top,...a})},[x,o,L,w,s]),A=e=>{x?.closeBelow(L),v.current?.focus()};p(()=>{if(B)return n(e=>"Escape"===e.key&&(!(x&&x.path.length>L+1)&&(A(),!0)))}),i(()=>{if(!B||!T)return;const e=()=>{const e=k.current;if(!e||!v.current)return;const t=v.current.closest("[data-popup-submenu-panel]")??v.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??v.current.getBoundingClientRect(),r=L>0&&(x?.path[L-1]?.flipped??!1),o=e.offsetWidth||s,i=H(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=D(v.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)}}),p(()=>{B&&M.current&&(M.current=!1,V(k.current)[0]?.focus())},[B]);const F=m(()=>x&&{...x,depth:L+1},[x,L]);if(!x)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const S=U(!1,o,a,B),P=I();/* @__PURE__ */
|
|
3
|
+
return y(b,{children:[
|
|
4
|
+
/* @__PURE__ */y("button",{ref:v,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":B,"aria-controls":B?N:void 0,disabled:o,"data-popup-submenu-row":!0,className:S.className,style:S.style,onClick:e=>{const t=0===e.detail;B?t&&V(k.current)[0]?.focus():W(t)},onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),W(!0))},onMouseEnter:()=>{o||(x.cancelClose(),B?x.closeBelow(L+1):(clearTimeout($.current),$.current=setTimeout(()=>W(!1),120)))},onMouseLeave:()=>{clearTimeout($.current),x.scheduleClose(L)},children:[t,
|
|
5
|
+
/* @__PURE__ */g("span",{className:"min-w-0 flex-1 truncate",children:e}),J]}),B&&f(
|
|
6
|
+
/* @__PURE__ */g("div",{ref:k,id:N,role:"menu","data-popup-menu-tree":x.id,"data-popup-submenu-panel":!0,className:"fixed rounded-2xl overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===P?"py-1":"large"===P?"py-2":"py-1.5"),style:{left:T.left,top:T.y,minWidth:s,maxHeight:void 0===d?"calc(100vh - 16px)":`min(${"number"==typeof d?`${d}px`:d}, calc(100vh - 16px))`,zIndex:O(x.root.current)+L+1,animation:(T.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...C()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=V(k.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(),A())},onMouseEnter:()=>{x.cancelClose(),clearTimeout($.current)},onMouseLeave:()=>x.scheduleClose(L+1),onContextMenu:e=>{E(e.target)||e.preventDefault()},children:/* @__PURE__ */g(j.Provider,{value:F,children:r})}),document.body)]})}function Q(){const e=I();/* @__PURE__ */
|
|
7
|
+
return g("div",{className:`border-t ${M} ${"tight"===e?"my-0.5":"large"===e?"my-1.5":"my-1"} mx-3`})}function X({children:e}){const t=I(),n="tight"===t?"0.125rem":"large"===t?"0.375rem":"0.25rem";/* @__PURE__ */
|
|
8
|
+
return g("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 Y({d:e,className:t="h-4 w-4 text-gray-400"}){/* @__PURE__ */
|
|
9
|
+
return g("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */g("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{M as GLASS_DIVIDER,N as GLASS_INPUT_BG,Y as MenuIcon,z as MenuSemanticsContext,T as NATIVE_MENU_ATTR,q as PopupMenu,Q as PopupMenuDivider,K as PopupMenuItem,X as PopupMenuLabel,G as PopupSubmenu,D as clampMenuTop,P as closeMenuBelow,A as describeContextTarget,$ as glassFill,C as glassStyle,U as itemLook,E as keepsNativeMenu,F as leavesContextMenuAlone,H as menuPanelLeft,S as openMenuLevel,R as resolveMenuLevels};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{client_default as a}from"./chunk-
|
|
1
|
+
import{client_default as a}from"./chunk-TBM3ZIAN.js";var e=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),t="uploaded:wallpaper";function r(a,e){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===t?e||"":a}var p=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=e=>{const t=new FormData;return t.append("wallpaper",e),a.post("/auth/me/wallpaper/",t).then(a=>a.data)},l=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function s(a){const e=a?.response?.status,t=a?.response?.data,r=Array.isArray(t?.wallpaper)?t.wallpaper[0]:void 0;return r||(413===e?"That picture is too large to use as a wallpaper.":415===e?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{t as WALLPAPER_PREF_TOKEN,l as deleteWallpaper,e as getNumberingConfigs,p as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,s as wallpaperUploadError};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{currentShellStrings as t}from"./chunk-
|
|
1
|
+
import{currentShellStrings as t}from"./chunk-YJX2IWHB.js";var e="http://www.w3.org/2000/svg",n={},o=/* @__PURE__ */new Map;function s(t,e){let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className=e,document.body.appendChild(n)),n}var r={success:"M5 13l4 4L19 7",error:"M6 18L18 6M6 6l12 12",warning:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",loading:"M12 3a9 9 0 019 9",bell:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"};function i(t,n){const o=document.createElementNS(e,"svg");o.setAttribute("class",n),o.setAttribute("fill","none"),o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","2");const s=document.createElementNS(e,"path");return s.setAttribute("stroke-linecap","round"),"loading"!==t&&s.setAttribute("stroke-linejoin","round"),s.setAttribute("d",r[t]),o.appendChild(s),o}function a(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.textContent=e),n}function c(t,e,r){const c={...n,...r},l=c.placement??"top",d=c.sticky??!1,u=`${l}|${t}|${e}`;if(c.dedupe){const t=o.get(u);if(t)return t.restart(),{dismiss:t.dismiss}}"loading"!==t&&!1!==c.sound&&import("./sounds-OMHXVVQ4.js").then(e=>{"success"===t?e.playSuccess():"error"===t?e.playError():e.playNotification()}).catch(()=>{});const m="bottom"===l?s("toast-container-bottom","fixed bottom-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col-reverse gap-2 items-center pointer-events-none"):s("toast-container","fixed top-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col gap-2 items-center pointer-events-none"),p="bottom"===l?"translateY(10px)":"translateY(-10px)",f=a("pointer-events-auto cursor-pointer rosh-toast");f.style.opacity="0",f.style.transform=`${p} scale(0.95)`,f.setAttribute("role","error"===t?"alert":"status"),f.setAttribute("aria-atomic","true"),f.appendChild(i(t,`h-4 w-4 rosh-tone-${t}${"loading"===t?" animate-spin":""}`));const h=document.createElement("span");let y;h.textContent=e,f.appendChild(h),m.appendChild(f),requestAnimationFrame(()=>{f.style.opacity="1",f.style.transform="translateY(0) scale(1)"});let v=!1;const g=()=>{v||(v=!0,y&&clearTimeout(y),o.delete(u),f.style.opacity="0",f.style.transform=`${p} scale(0.95)`,setTimeout(()=>f.remove(),300))},b=c.duration??("info"===t?4500:3e3),x=()=>{y&&clearTimeout(y),d||(y=setTimeout(g,b))};return x(),f.addEventListener("mouseenter",()=>{y&&clearTimeout(y)}),f.addEventListener("mouseleave",()=>{v||x()}),f.addEventListener("click",g),o.set(u,{el:f,restart:x,dismiss:g}),{dismiss:g}}var l={success:(t,e)=>c("success",t,e),error:(t,e)=>c("error",t,e),warning:(t,e)=>c("warning",t,e),info:(t,e)=>c("info",t,e),notify:(e,o)=>function(e,o){!1!==(o?.sound??n.sound)&&import("./sounds-OMHXVVQ4.js").then(t=>t.playNotification()).catch(()=>{});const r=s("notif-container","fixed top-4 right-4 z-[9999] flex flex-col gap-3 items-end pointer-events-none"),c=a("pointer-events-auto cursor-pointer rosh-notif");c.style.opacity="0",c.style.transform="translateX(30px) scale(0.95)";const l=a("rosh-notif-badge");l.appendChild(i("bell","h-5 w-5"));const d=a("rosh-notif-body");d.append(a("rosh-notif-title",t().toast.notification),a("notif-msg rosh-notif-msg",e));const u=document.createElement("button");u.className="rosh-notif-close",u.textContent="×",c.append(l,d,u);const m=()=>{c.style.opacity="0",c.style.transform="translateX(30px) scale(0.95)",setTimeout(()=>c.remove(),300)};u.addEventListener("click",t=>{t.stopPropagation(),m()}),c.addEventListener("click",m),r.appendChild(c),requestAnimationFrame(()=>{c.style.opacity="1",c.style.transform="translateX(0) scale(1)"}),setTimeout(m,o?.duration??1e4)}(e,o),promise:(t,e,n)=>{const o=c("loading",e.loading,{...n,sticky:!0});return t.then(t=>{o.dismiss(),c("success","function"==typeof e.success?e.success(t):e.success,n)},t=>{o.dismiss(),c("error","function"==typeof e.error?e.error(t):e.error,n)}),t},configure:t=>{n={...t}}};export{l as toast_default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-TBM3ZIAN.js";import{keepsNativeMenu as a}from"./chunk-L7ZMDZAB.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
|
|
2
2
|
return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
|
|
3
3
|
/* @__PURE__ */n("div",{children:[
|
|
4
4
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{glassStyle as t,glassFill as e}from"./chunk-L7ZMDZAB.js";import{registerModalEscapeInterceptor as o,Z_LAYERS as r}from"./chunk-OSJ3ADF2.js";import{useShellStrings as i}from"./chunk-YJX2IWHB.js";import{useBrowserLayoutEffect as n,useBrowserState as a}from"./chunk-D65T4H6J.js";import{useState as l,useRef as h,useId as s,useEffect as d,isValidElement as c,cloneElement as m,useCallback as u}from"react";import{createPortal as f}from"react-dom";import{jsxs as g,jsx as p,Fragment as b}from"react/jsx-runtime";var x=448,w=240,v=8,y=()=>({left:0,right:window.innerWidth,top:0,bottom:window.innerHeight});function M(t){const e=y(),o=t?.closest?.("[data-modal-panel]");if(!o)return e;const r=o.getBoundingClientRect();return r.width<=0||r.height<=0?e:{left:Math.max(e.left,r.left),right:Math.min(e.right,r.right),top:Math.max(e.top,r.top),bottom:Math.min(e.bottom,r.bottom)}}var N=/* @__PURE__ */new Set(["hidden","clip","auto","scroll"]);var W={top:"bottom",bottom:"top",left:"right",right:"left"},z={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function k(t,e,o){return{top:t.top-o-(e.top+8),bottom:e.bottom-8-(t.bottom+o),left:t.left-o-(e.left+8),right:e.right-8-(t.right+o)}}var C=(t,e,o)=>Math.max(e,Math.min(t,o));function H(t,e,o){let r=NaN,i=NaN,n=NaN,a=NaN,l=NaN;const h=()=>{const e=t()?.getBoundingClientRect();if(!e)return!1;const h=o?o():NaN,s=e.left!==r||e.top!==i||e.right!==n||e.bottom!==a||h!==l&&!(Number.isNaN(h)&&Number.isNaN(l));return r=e.left,i=e.top,n=e.right,a=e.bottom,l=h,s};h();const s=()=>{h(),e()};let d=requestAnimationFrame(function t(){h()&&e(),d=requestAnimationFrame(t)});return window.addEventListener("scroll",s,!0),window.addEventListener("resize",s),()=>{cancelAnimationFrame(d),window.removeEventListener("scroll",s,!0),window.removeEventListener("resize",s)}}function R({trigger:t,menu:e,bounds:o,align:r,side:i}){const n=k(t,o,4),a="bottom"===i?"top":"bottom",l=e.height>n[i]&&(e.height<=n[a]||n[a]>n[i])?a:i,h=Math.max(Math.min(e.height,96),n[l]),s=Math.min(e.height,h),d=C("bottom"===l?t.bottom+4:t.top-4-s,o.top+8,o.bottom-8-s),c=Math.max(0,o.right-o.left-16),m=Math.min(e.width,c);return{left:C("start"===r?t.left:t.right-m,o.left+8,o.right-8-m),top:d,side:l,maxHeight:h,maxWidth:c}}function B(t,e,o={}){const{matchTriggerWidth:r=!1,preferredMaxWidth:i=x,preferredMaxHeight:a=w,popupRef:h}=o,[s,d]=l(null);return n(()=>{if(!e)return void d(null);const o=()=>{const e=t.current,o=e?.getBoundingClientRect();if(!o)return;const n=M(e),l=n.bottom-o.bottom-4-8,s=o.top-n.top-4-8,c=l<Math.min(a,160)&&s>l,m=Math.max(96,Math.min(a,c?s:l)),u=Math.max(0,n.right-n.left-16),f={minWidth:o.width,maxWidth:Math.min(i,u),maxHeight:m};if(r){const t=Math.min(o.width,u);f.width=t,f.maxWidth=t,f.left=Math.min(Math.max(n.left+8,o.left),n.right-8-t)}else if(h&&n.right-8-o.left<f.maxWidth&&Math.min(o.right,n.right-8)-n.left-8<f.maxWidth){const t=h.current?.offsetWidth??0,e=t>0?Math.min(t,f.maxWidth):f.maxWidth;f.left=Math.max(n.left+8,Math.min(o.left,n.right-8-e))}else if(n.right-8-o.left<f.maxWidth){const t=Math.min(o.right,n.right-8);f.right=window.innerWidth-t,f.maxWidth=Math.min(f.maxWidth,Math.max(0,t-n.left-8))}else f.left=Math.max(n.left+8,o.left);c?f.bottom=window.innerHeight-o.top+4:f.top=o.bottom+4,d(f)};return o(),H(()=>t.current,o,h?()=>h.current?.offsetWidth??NaN:void 0)},[e,t,r,i,a,h]),s}function E({point:t,menu:e,bounds:o}){const r={left:t.x,right:t.x,top:t.y,bottom:t.y},i=o.right-8-t.x,n=t.x-(o.left+8);return R({trigger:r,menu:e,bounds:o,align:e.width<=i||i>=n?"start":"end",side:"bottom"})}var T={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function P({content:i,side:a="top",delay:u=200,children:b,className:x="relative inline-flex"}){const[w,v]=l(!1),[R,B]=l(null),E=h(void 0),P=h(null),$=h(null),D=s(),I=()=>{E.current=window.setTimeout(()=>v(!0),u)},L=()=>{window.clearTimeout(E.current),v(!1)};d(()=>()=>window.clearTimeout(E.current),[]),n(()=>{if(!w)return void B(null);const t=()=>{const t=P.current,e=$.current;if(!t||!e)return;const o=M(t),r=Math.max(0,o.right-o.left-16),i=Math.max(0,o.bottom-o.top-16);e.style.maxWidth=`${r}px`,e.style.maxHeight=`${i}px`;const n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return;const l=t.getBoundingClientRect();if(!function(t){const e=t.getBoundingClientRect();if(e.width<=0&&e.height<=0&&0===e.left&&0===e.top)return null;const o=y(),r={left:Math.max(o.left,e.left),right:Math.min(o.right,e.right),top:Math.max(o.top,e.top),bottom:Math.min(o.bottom,e.bottom)};let i=getComputedStyle(t).position;for(let e=t.parentElement;e&&e!==document.documentElement&&"fixed"!==i;e=e.parentElement){const t=getComputedStyle(e);if("absolute"===i&&"static"===t.position)continue;i=t.position;const o=N.has(t.overflowX),n=N.has(t.overflowY);if(!o&&!n)continue;const a=e.getBoundingClientRect();a.width<=0&&a.height<=0||(o&&(r.left=Math.max(r.left,a.left),r.right=Math.min(r.right,a.right)),n&&(r.top=Math.max(r.top,a.top),r.bottom=Math.min(r.bottom,a.bottom)))}return r.right>=r.left&&r.bottom>=r.top?r:null}(t))return void L();const h=function(t,e,o,r,i){const n=k(t,r,i),a=t=>n[t]-("top"===t||"bottom"===t?e.height:e.width),l=[o,W[o],...z[o]],h=l.find(t=>a(t)>=0)??l.reduce((t,e)=>a(e)>a(t)?e:t),s=(t.left+t.right)/2,d=(t.top+t.bottom)/2;let c,m;switch(h){case"top":c=s-e.width/2,m=t.top-i-e.height;break;case"bottom":c=s-e.width/2,m=t.bottom+i;break;case"left":c=t.left-i-e.width,m=d-e.height/2;break;case"right":c=t.right+i,m=d-e.height/2}return{side:h,left:C(c,r.left+8,r.right-8-e.width),top:C(m,r.top+8,r.bottom-8-e.height)}}(l,n,a,o,12),s=function(t,e,o,r,i){const{side:n,left:a,top:l}=e,h=a+o.width,s=l+o.height;if({top:t.top-s,bottom:l-t.bottom,left:t.left-h,right:a-t.right}[n]<i)return null;const d=(t,e,o)=>o<2*r?e+o/2:Math.max(e+r,Math.min(t,e+o-r)),c=(t.left+t.right)/2,m=(t.top+t.bottom)/2;switch(n){case"top":return{side:n,x:d(c,a,o.width),y:s};case"bottom":return{side:n,x:d(c,a,o.width),y:l};case"left":return{side:n,x:h,y:d(m,l,o.height)};case"right":return{side:n,x:a,y:d(m,l,o.height)}}}(l,h,n,16,6),d={anchor:{left:l.left,top:l.top,width:l.width,height:l.height},left:h.left-l.left,top:h.top-l.top,maxWidth:r,maxHeight:i,side:h.side,arrow:s&&{left:s.x-l.left,top:s.y-l.top}};B(t=>{return t&&(o=d,(e=t).anchor.left===o.anchor.left&&e.anchor.top===o.anchor.top&&e.anchor.width===o.anchor.width&&e.anchor.height===o.anchor.height&&e.left===o.left&&e.top===o.top&&e.maxWidth===o.maxWidth&&e.maxHeight===o.maxHeight&&e.side===o.side&&e.arrow?.left===o.arrow?.left&&e.arrow?.top===o.arrow?.top)?t:d;var e,o})};return t(),H(()=>P.current,t)},[w,a,i]),d(()=>{if(w)return o(t=>"Escape"===t.key&&(L(),!0))},[w]);const S=w?D:void 0,A=c(b)?m(b,{"aria-describedby":[b.props["aria-describedby"],S].filter(Boolean).join(" ")||void 0}):b,j=w?t():void 0,F=w?e():void 0;/* @__PURE__ */
|
|
2
|
+
return g("span",{ref:P,className:x,"aria-describedby":c(b)?void 0:S,onMouseEnter:I,onMouseLeave:L,onFocus:I,onBlur:L,children:[A,w&&f(
|
|
3
|
+
/* @__PURE__ */g("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:r.popup,...R?.anchor},children:[
|
|
4
|
+
/* @__PURE__ */p("span",{ref:$,id:D,role:"tooltip",className:`pointer-events-none absolute z-[300] box-border w-max overflow-hidden whitespace-normal break-words text-start rounded-md px-2 py-1 text-xs text-gray-800 ${R?"":T[a]}`,style:{...j,...R&&{left:R.left,top:R.top,maxWidth:R.maxWidth,maxHeight:R.maxHeight}},children:i}),(!R||R.arrow)&&
|
|
5
|
+
/* @__PURE__ */p("span",{"aria-hidden":"true",className:"rosh-tooltip-arrow","data-side":R?.side??a,style:{background:F,"--rosh-tooltip-edge":j?.border,...R?.arrow&&{left:R.arrow.left,top:R.arrow.top}}})]}),document.body)]})}var $=(t,e,o)=>Math.min(o,Math.max(e,t));function D(t,e,o,r,i){return Math.round($("left"===o?t+e:t-e,r,i))}function I(t,e,o){let r=null;try{r=window.localStorage.getItem(t)}catch{return null}const i=r?parseInt(r,10):NaN;return Number.isNaN(i)?null:$(i,e,o)}function L({width:t,onResize:e,side:o,min:r,max:a,defaultWidth:l=r,step:s=16,storageKey:c,label:m,hint:f,controls:g,className:b=""}){const x=i().resizeHandle,w=h(null),v=h({onResize:e,min:r,max:a,side:o});v.current={onResize:e,min:r,max:a,side:o},n(()=>{if(!c)return;const o=I(c,r,a);null!==o&&o!==t&&e(o)},[c]),d(()=>{if(!c)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(c,String(Math.round(t)))}catch{}},200);return()=>window.clearTimeout(e)},[t,c]);const y=u(()=>{w.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);d(()=>y,[y]);const M=t=>{w.current&&(t.currentTarget.hasPointerCapture?.(w.current.pointer)&&t.currentTarget.releasePointerCapture(w.current.pointer),y())},N="left"===o?"right-0":"left-0";/* @__PURE__ */
|
|
6
|
+
return p(P,{content:f??x.hint,side:"left"===o?"right":"left",delay:600,className:`absolute inset-y-0 ${N} z-10 flex w-2 ${b}`.trim(),children:/* @__PURE__ */p("div",{role:"separator",tabIndex:0,"aria-orientation":"vertical","aria-label":m??x.label,"aria-valuenow":Math.round(t),"aria-valuemin":r,"aria-valuemax":a,"aria-controls":g,"data-resize-handle":o,onPointerDown:e=>{0===e.button&&(e.preventDefault(),w.current={x:e.clientX,width:t,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},onPointerMove:t=>{const e=w.current;if(!e)return;if(0===t.buttons)return void y();const o=t.clientX-e.x;if(!e.moved){if(Math.abs(o)<3)return;e.moved=!0}const{onResize:r,min:i,max:n,side:a}=v.current;r(D(e.width,o,a,i,n))},onPointerUp:M,onPointerCancel:M,onLostPointerCapture:()=>{w.current&&y()},onDoubleClick:()=>e($(l,r,a)),onKeyDown:i=>{const n="ArrowRight"===i.key?s:"ArrowLeft"===i.key?-s:null,h=null!==n?D(t,n,o,r,a):"Home"===i.key?r:"End"===i.key?a:"Enter"===i.key?$(l,r,a):null;null!==h&&(i.preventDefault(),h!==t&&e(h))},className:"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */p("div",{"aria-hidden":"true",className:`absolute inset-y-0 ${N} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}var S=(t,e,o)=>Math.min(Math.max(t,e),o);function A({sidebar:t,sidebarTop:e,sidebarBottom:o,children:r,side:n="left",storageKey:l,defaultWidth:h=256,minWidth:s=180,maxWidth:d=480,className:c="",sidebarClassName:m=("right"===n?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:u="bg-white"}){const f="right"===n,x=i().sidebar,[w,v]=a(()=>(l?I(l,s,d):null)??S(h,s,d),S(h,s,d)),y=null!=e||null!=o,M=/* @__PURE__ */g("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:w},children:[
|
|
7
|
+
/* @__PURE__ */g("div",{className:`flex h-full flex-col ${y?"overflow-hidden":"overflow-y-auto"} ${m}`,children:[null!=e&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:e}),y?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t}):t,null!=o&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:o})]}),
|
|
8
|
+
/* @__PURE__ */p(L,{side:n,width:w,onResize:v,min:s,max:d,defaultWidth:S(h,s,d),storageKey:l,hint:x.resize})]}),N=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${u}`,children:r});/* @__PURE__ */
|
|
9
|
+
return p("div",{className:`flex h-full w-full overflow-hidden ${c}`,children:/* @__PURE__ */g(b,f?{children:[N,M]}:{children:[M,N]})})}export{w as MENU_MAX_HEIGHT,x as POPUP_MAX_WIDTH,L as ResizeHandle,A as SidebarLayout,P as Tooltip,v as VIEWPORT_MARGIN,H as followAnchor,E as placeAtPoint,R as placeMenu,M as popupBounds,B as useDropdownPosition};
|