efficient-shell 4.160.0 → 4.162.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 +22 -4
- package/dist/{Browser-3KOGROX7.js → Browser-TNUODLDN.js} +25 -25
- package/dist/Calculator-HHPPI72V.js +29 -0
- package/dist/ConfirmDialog-D46T6ZXW.js +1 -0
- package/dist/{CurrencyConverter-3GTKDKHH.js → CurrencyConverter-4XKRUO7Y.js} +6 -6
- package/dist/{Documents-FDGF7QBQ.js → Documents-VYDMJL37.js} +6 -6
- package/dist/{Files-TTSYOPVB.js → Files-D3D6JWSJ.js} +28 -28
- package/dist/{Notepad-ITHIATP2.js → Notepad-CBJIS3WA.js} +10 -10
- package/dist/PdfViewer-UEMING6A.js +1 -0
- package/dist/{PomodoroTimer-CRKL26PP.js → PomodoroTimer-PB6J2LMS.js} +18 -18
- package/dist/{Preview-GZTTEZWS.js → Preview-O2UZROZO.js} +17 -17
- package/dist/{Sidebar-ECJEQXFK.js → Sidebar-PPC3OK4H.js} +36 -36
- package/dist/Spreadsheet-AYV4CQP3.js +37 -0
- package/dist/{Stock-NAHSVLAJ.js → Stock-FGJ5HQ7H.js} +4 -4
- package/dist/{Weather-AY3QWBQT.js → Weather-FW3WWYCI.js} +21 -21
- package/dist/{WorldClock-AXNMA4PG.js → WorldClock-UC4CXE2N.js} +6 -6
- package/dist/apps/index.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-A6FPBD7W.js → chunk-2S73NE3L.js} +1 -1
- package/dist/{chunk-UPI2GKKD.js → chunk-4SQNYTO3.js} +12 -12
- package/dist/{chunk-XN76YBX3.js → chunk-4VMA4ALC.js} +8 -8
- package/dist/chunk-5A7MWTXX.js +1 -0
- package/dist/{chunk-HQTSPK5Q.js → chunk-5UNSI4UI.js} +1 -1
- package/dist/{chunk-LCB4IVEL.js → chunk-6CKRJ4YK.js} +250 -250
- package/dist/chunk-6KO2U66R.js +3 -0
- package/dist/chunk-6WLGERBO.js +27 -0
- package/dist/{chunk-26RS37FG.js → chunk-7EACKL5V.js} +1 -1
- package/dist/{chunk-HF4IZFFX.js → chunk-7ESGXPKN.js} +11 -11
- package/dist/{chunk-FHIF6IUV.js → chunk-A2FL26TE.js} +1 -1
- package/dist/{chunk-KZPQW6UL.js → chunk-C2A4PIGZ.js} +2 -2
- package/dist/chunk-DSSLOQDW.js +2 -0
- package/dist/{chunk-VNEH2Y6H.js → chunk-DYVN6C2E.js} +3 -3
- package/dist/{chunk-XPSADW6W.js → chunk-EU3AQ4B2.js} +1 -1
- package/dist/{chunk-B2TBCVHH.js → chunk-EYU4IAEZ.js} +1 -1
- package/dist/{chunk-PDTZTADH.js → chunk-GBL5KOGP.js} +17 -17
- package/dist/{chunk-T6MKFQRH.js → chunk-GTQJYE6M.js} +6 -6
- package/dist/chunk-HQLEQIMG.js +21 -0
- package/dist/{chunk-JGHRZYNV.js → chunk-ILTSTULF.js} +1 -1
- package/dist/chunk-LQVXGB7A.js +1 -0
- package/dist/{chunk-KASHUEJV.js → chunk-O46U4PVN.js} +4 -4
- package/dist/chunk-S2PS4IOT.js +2 -0
- package/dist/{chunk-ZJ66QFOH.js → chunk-S6ZIQSAF.js} +1 -1
- package/dist/{chunk-36QR65KW.js → chunk-STJVLCQU.js} +2 -2
- package/dist/chunk-UZUH5PVW.js +1 -0
- package/dist/chunk-ZWYKMIX7.js +112 -0
- package/dist/file-intake/index.js +1 -1
- package/dist/{index-Brl0XepS.d.ts → index-DYVoKNru.d.ts} +86 -3
- package/dist/index.d.ts +47 -10
- package/dist/index.js +645 -645
- package/dist/map/index.js +2 -2
- package/dist/page-tabs/index.d.ts +9 -1
- 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 +1 -1
- package/dist/Calculator-QLJJ3ICT.js +0 -29
- package/dist/ConfirmDialog-7Q2OOU4W.js +0 -1
- package/dist/PdfViewer-VIT7Y55M.js +0 -1
- package/dist/Spreadsheet-PFKZTLSI.js +0 -37
- package/dist/chunk-6UXY7MPY.js +0 -2
- package/dist/chunk-GF2XCISN.js +0 -1
- package/dist/chunk-JK3IIJN5.js +0 -22
- package/dist/chunk-VRW5JNMR.js +0 -18
- package/dist/chunk-VVI77XNV.js +0 -1
- package/dist/chunk-X6E6UULK.js +0 -113
- package/dist/chunk-YKZGKYVT.js +0 -2
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{useState as e,useRef as r,useEffect as t,useCallback as o}from"react";import{jsx as n}from"react/jsx-runtime";function i(n){const[i,a]=e(!1),c=r(void 0);t(()=>()=>clearTimeout(c.current),[]);return{copied:i,copy:o(e=>{e?.stopPropagation(),navigator.clipboard?.writeText(n).then(()=>{a(!0),clearTimeout(c.current),c.current=setTimeout(()=>a(!1),1500)},()=>{})},[n])}}function a({copied:e,className:r="w-4 h-4"}){/* @__PURE__ */
|
|
2
|
+
return n("svg",e?{className:`${r} text-green-600`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */n("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__ */n("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 c({text:e}){const{copied:r,copy:t}=i(e);/* @__PURE__ */
|
|
3
|
+
return n("button",{onClick:t,title:r?"Copied!":`Copy ${e}`,className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",children:/* @__PURE__ */n(a,{copied:r})})}export{c as CopyButton,a as CopyGlyph,i as useCopyText};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{navVisible as e,isReachable as t,visibleChildren as n,isSection as r}from"./chunk-5A7MWTXX.js";import{glassStyle as a}from"./chunk-DYVN6C2E.js";import{useDismissPopupsOnOpen as l,Z_LAYERS as o}from"./chunk-OSJ3ADF2.js";import{useShellStrings as s}from"./chunk-UZUH5PVW.js";import{useState as i,useEffect as c,useRef as d,useMemo as u,useId as p,useCallback as y}from"react";import{jsx as f,jsxs as m}from"react/jsx-runtime";import{createPortal as h}from"react-dom";var b={favicon:"h-8 w-8",compact:"h-10 w-10",wordmark:"h-10 w-40"};function g(e){return e.trim().charAt(0).toLocaleUpperCase()||"·"}function x(e,t,n){return!1===e?"framed":null==e||null==t?"plate-light":t?"light"===n?"plate-dark":"bare":"dark"===n?"plate-light":"bare"}var v={"plate-light":"bg-white shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]","plate-dark":"bg-neutral-900 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow-strong)]",framed:"border border-black/10 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]",bare:""};function k(e,t,n){return"bare"===e?{}:"framed"===e?{borderRadius:t}:{borderRadius:t,padding:n}}function w({src:e,fallbackSrc:t,fallbackHasAlpha:n=null,fallbackIsLight:r=null,fallbackAdaptive:a,alt:l,slot:o="compact",surface:s="light",size:d,width:u,height:p,decorative:y=!1,fallbackMode:m="monogram",adaptive:h=!1,hasAlpha:w=null,isLight:N=null,treatmentPadding:_=4,treatmentRadius:A=8,className:L="",style:C}){const[$,E]=i(e||t||"");c(()=>{E(e||t||"")},[e,t]);const T=Boolean(t&&$===t&&$!==e),I=(T?a??h:h)?x(T?n:w,T?r:N,s):"bare",S=["inline-flex shrink-0 items-center justify-center overflow-hidden",null==d&&null==u&&null==p?b[o]:"","dark"===s?"text-white":"text-gray-700",v[I],L].filter(Boolean).join(" "),j={...k(I,A,_),...null==d?{width:u,height:p}:{width:d,height:d},...C};return $?/* @__PURE__ */f("span",{className:S,"data-brand-treatment":I,style:j,children:/* @__PURE__ */f("img",{src:$,alt:y?"":l,"data-brand-slot":o,className:"block max-h-full max-w-full",style:{objectFit:"contain"},onError:()=>E(e=>t&&e!==t?t:"")})}):"none"===m?null:/* @__PURE__ */f("span",{"data-brand-fallback":!0,"data-brand-slot":o,"aria-label":y?void 0:l,"aria-hidden":y||void 0,role:y?void 0:"img",className:`${S} rounded-md bg-gray-100 font-semibold`,style:j,children:y?null:g(l)})}function N(n,r){return e(n,r)?n.items.filter(n=>e(n,r)&&t(n,r)):[]}function _(e,r){return n(e,r).filter(e=>t(e,r))}function A(n,a,l){const o=new Set(a.erp),s=new Set(a.system),i=new Set(a.footer??[]),c=n.filter(r),d=e=>c.filter(t=>e.has(t.label)&&N(t,l).length>0);return{topItems:n.filter(e=>!r(e)).filter(n=>e(n,l)&&t(n,l)),erpSections:d(o),systemSections:d(s),virtualSections:(a.virtual??[]).filter(e=>e.items.length>0),footerSections:d(i),footerItems:(a.footerItems??[]).filter(n=>e(n,l)&&t(n,l))}}function L(e,t,n){return!!t&&e.some(e=>e.to===t||L(_(e,n),t,n))}var C="__page__";function $(e){const t=e.indexOf("?");if(t<0)return{path:e,search:""};const n=new URLSearchParams(e.slice(t+1));return{path:e.slice(0,t),search:n.get("search")??""}}function E(e,t,n){const r=function(e,t){const n=[],r=e=>{const a=_(e,t);0===a.length?n.push(e):a.forEach(r)};e.topItems.forEach(r);for(const n of[...e.erpSections,...e.systemSections,...e.footerSections])N(n,t).forEach(r);for(const t of e.virtualSections)t.items.forEach(r);return e.footerItems.forEach(r),n}(e,t);return Object.assign(async e=>{const t=e.trim().toLowerCase();if(!t)return[];const a=/* @__PURE__ */new Set,l=[];for(const e of r){const r=e.menuLabel??e.label;a.has(e.to)||!e.label.toLowerCase().includes(t)&&!r.toLowerCase().includes(t)||(a.add(e.to),l.push({type:n,label:e.label,entity_type:C,entity_id:e.to}))}return l.slice(0,8)},{destinations:r})}function T(e,t){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(!r||"string"!=typeof r.entityType||"string"!=typeof r.entityId||"string"!=typeof r.label)continue;if("preview-file"===r.entityType)continue;const e="page"===r.entityType;n.push({type:e?t:"",label:r.label,entity_type:e?C:r.entityType,entity_id:r.entityId})}return n}var I="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z";function S(e,t,n){return 0===n.length?null:{key:e,title:t,rows:n.map((e,t)=>({kind:"action",key:`action:${t}:${e.label}`,label:e.label,icon:e.icon,action:e})),count:n.length}}function j(e,t,n,r){return{type:e,label:t,entity_type:C,entity_id:`${n}?search=${encodeURIComponent(r.trim())}`}}function M(e,t,n,r,a){const l=function(e){const t=/* @__PURE__ */new Map;for(const n of e){const e=t.get(n.type);e?e.push(n):t.set(n.type,[n])}return Array.from(t,([e,t])=>({type:e,results:t}))}(e).map(e=>{const t=e.results.map((t,n)=>({kind:"result",key:`result:${e.type}:${t.entity_type}:${t.entity_id}:${n}`,label:t.label,sub:t.sub,result:t})),r=!!a?.truncatedTypes?.includes(e.type),l=r?a?.listRoutes?.[e.type]:void 0;if(a&&l){const r=a.seeAllLabel(l.label);t.push({kind:"seeAll",key:`seeall:${e.type}`,label:r,result:j(e.type,r,l.path,n)})}return{key:`type:${e.type}`,title:e.type,rows:t,count:e.results.length,truncated:r}}),o=S("actions",r,function(e,t){const n=t.trim().toLowerCase();return e&&n?e.filter(e=>e.label.toLowerCase().includes(n)||(e.keywords??[]).some(e=>e.toLowerCase().includes(n))):[]}(t,n));return o?[...l,o]:l}function R(e,t,n){return 0===n?0:Math.min(Math.max(e+t,0),n-1)}var D=(e,t)=>e.entity_type===t.entity_type&&e.entity_id===t.entity_id;function K(e,t,n=8){return[t,...e.filter(e=>!D(e,t))].slice(0,n)}function P(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||"object"!=typeof n)continue;const e=n;if("string"!=typeof e.type||"string"!=typeof e.label||"string"!=typeof e.entity_type||"string"!=typeof e.entity_id)continue;const r={type:e.type,label:e.label,entity_type:e.entity_type,entity_id:e.entity_id};"string"==typeof e.sub&&(r.sub=e.sub),t.some(e=>D(e,r))||t.push(r)}return t.slice(0,8)}function B(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:n}=e;return{results:t,truncatedTypes:Array.isArray(n)?n:[]}}return{results:[],truncatedTypes:[]}}var U=[];function z(e,t,n){const[r,a]=i([]),[l,o]=i(U),[s,u]=i(!1),[p,f]=i("none"),m=d(function(){let e=0,t=null;const n=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{n();const r=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>r===e}},cancel:n}}());c(()=>{const r=m.current;if(e.length<n||!t||0===t.length)return r.cancel(),a(e=>0===e.length?e:[]),o(U),f("none"),void u(!1);u(!0);const l=setTimeout(async()=>{const n=r.begin(),l=await async function(e,t,n){const r=await Promise.all(e.map(async e=>{try{return{failed:!1,...B(await e(t,{signal:n}))}}catch(e){const t=n.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:n}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===n}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:r.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(r.flatMap(e=>e.truncatedTypes))),failed:r.filter(e=>e.failed).length}}(t,e,n.signal);n.isCurrent()&&(a(l.results),o(l.truncatedTypes),f(0===l.failed?"none":l.failed>=t.length?"all":"some"),u(!1))},250);return()=>{clearTimeout(l),r.cancel()}},[e,t,n]);return{results:r,truncatedTypes:l,loading:s,failure:p,reset:y(()=>{m.current.cancel(),a(e=>0===e.length?e:[]),o(U),f("none"),u(!1)},[])}}var H=(e,t)=>`${e}-opt-${t}`;function F(e,t){return"seeAll"===e.kind?"M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3":"action"===e.kind?e.icon??I:e.icon?e.icon:t?.[e.result.type]?t[e.result.type]:I}function W({sections:e,activeIdx:t,listId:n,label:r,typeIcons:a,groupCount:l,groupLabel:o,onHover:s,onPick:i}){let c=0;/* @__PURE__ */
|
|
2
|
+
return f("div",{id:n,role:"listbox","aria-label":r,className:"py-1",children:e.map(e=>/* @__PURE__ */m("div",{role:"group","aria-label":o(e.title,e.count,!!e.truncated),children:[
|
|
3
|
+
/* @__PURE__ */m("div",{"aria-hidden":"true",className:"flex items-center justify-between px-4 pt-2 pb-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:[
|
|
4
|
+
/* @__PURE__ */f("span",{children:e.title}),
|
|
5
|
+
/* @__PURE__ */f("span",{className:"font-medium normal-case tracking-normal",children:l(e.count,!!e.truncated)})]}),e.rows.map(e=>{const r=c++,l=r===t,o="action"===e.kind||"seeAll"===e.kind?void 0:e.badge,d="action"===e.kind||"seeAll"===e.kind?void 0:e.sub,u="seeAll"===e.kind;/* @__PURE__ */
|
|
6
|
+
return m("div",{id:H(n,r),role:"option","aria-selected":l,className:"flex items-center gap-3 w-full px-4 py-2.5 text-left cursor-pointer transition-colors "+(l?"bg-blue-50":"hover:bg-gray-50"),onMouseDown:e=>e.preventDefault(),onClick:()=>i(e),onMouseEnter:()=>s(r),children:[
|
|
7
|
+
/* @__PURE__ */f("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:F(e,a)})}),
|
|
8
|
+
/* @__PURE__ */m("div",{className:"flex-1 min-w-0",children:[
|
|
9
|
+
/* @__PURE__ */f("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */f("p",{className:"text-xs text-gray-400 truncate",children:d})]}),o&&/* @__PURE__ */f("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-[10px] font-medium text-gray-500",children:o})]},e.key)})]},e.key))})}var O="react-os-shell:open-global-search";function V(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(O))}function X({providers:e,typeIcons:t,listRoutes:n,placeholder:r,quickActions:b,onSelect:g,recent:x,onRecord:v,favorites:k}={}){const w=s().search,N=r??w.placeholder,[_,A]=i(!1),[L,C]=i(""),[$,E]=i(0),T=d(null),{results:j,truncatedTypes:D,loading:K,failure:P,reset:B}=z(L,e,2);c(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),A(e=>!e)),"Escape"===e.key&&_&&A(!1)},t=()=>A(!0);return window.addEventListener("keydown",e),window.addEventListener(O,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(O,t)}},[_]),l(_);const[U,F]=i(!1);_!==U&&(F(_),_&&(C(""),E(0),B())),c(()=>{_?setTimeout(()=>T.current?.focus(),50):C("")},[_]),c(()=>{E(0)},[j]);const V=L.length>=2,X=u(()=>V?M(j,b,L,w.actions,{truncatedTypes:D,listRoutes:n,seeAllLabel:w.seeAll}):function(e,t){const n=[];e.recent?.length&&n.push({key:"recent",title:t.recent,rows:e.recent.map((e,t)=>({kind:"recent",key:`recent:${e.entity_type}:${e.entity_id}:${t}`,label:e.label,sub:e.sub,badge:e.type,result:e})),count:e.recent.length}),e.favorites?.length&&n.push({key:"favorites",title:t.favorites,rows:e.favorites.map((e,t)=>({kind:"favorite",key:`favorite:${e.entity_type}:${e.entity_id}:${t}`,label:e.label,sub:e.sub,badge:e.type||void 0,icon:"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",result:e})),count:e.favorites.length});const r=S("actions",t.actions,e.actions??[]);return r&&n.push(r),n}({recent:x,favorites:k,actions:b},w),[V,j,D,n,b,L,x,k,w]),q=u(()=>function(e){return e.flatMap(e=>e.rows)}(X),[X]),G=Math.min($,Math.max(q.length-1,0)),J=p(),Y=q.length>0;c(()=>{_&&0!==q.length&&document.getElementById(H(J,G))?.scrollIntoView?.({block:"nearest"})},[_,G,q.length,J]);const Z=y(e=>{A(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||v?.(e.result),g?.(e.result)):e.action.onSelect()},[g,v]);return _?h(
|
|
10
|
+
/* @__PURE__ */m("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:o.overlay},onClick:()=>A(!1),children:[
|
|
11
|
+
/* @__PURE__ */f("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
|
|
12
|
+
/* @__PURE__ */m("div",{className:"relative z-10 w-full max-w-xl rounded-2xl overflow-hidden",onClick:e=>e.stopPropagation(),style:a(),children:[
|
|
13
|
+
/* @__PURE__ */m("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
|
|
14
|
+
/* @__PURE__ */f("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:I})}),
|
|
15
|
+
/* @__PURE__ */f("input",{ref:T,type:"text",value:L,onChange:e=>{C(e.target.value),E(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),E(R(G,1,q.length))):"ArrowUp"===e.key?(e.preventDefault(),E(R(G,-1,q.length))):"Tab"===e.key&&q.length>0?(e.preventDefault(),E(function(e,t,n){const r=e.length;if(0===r)return 0;const a=[];let l=0;for(const t of e)a.push(l),l+=t;let o=0;for(let e=0;e<r;e++)t>=a[e]&&(o=e);return a[(o+n+r)%r]}(X.map(e=>e.rows.length),G,e.shiftKey?-1:1))):"Enter"===e.key&&q[G]&&Z(q[G])},placeholder:N,role:"combobox","aria-expanded":Y,"aria-controls":Y?J:void 0,"aria-activedescendant":Y?H(J,G):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),K&&/* @__PURE__ */f("span",{"data-global-search-spinner":"",role:"status","aria-label":w.searching,className:"h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-gray-300 border-t-gray-500"}),
|
|
16
|
+
/* @__PURE__ */f("kbd",{className:"hidden sm:inline-flex items-center rounded border border-gray-300 px-1.5 py-0.5 text-[10px] font-medium text-gray-400",children:w.escBadge})]}),
|
|
17
|
+
/* @__PURE__ */m("div",{className:"max-h-[50vh] overflow-y-auto",children:[K&&0===q.length&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.searching}),!K&&"all"===P&&V&&/* @__PURE__ */f("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:w.searchFailed}),!K&&V&&0===q.length&&"all"!==P&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.noResults}),Y&&/* @__PURE__ */f(W,{sections:X,activeIdx:G,listId:J,label:w.listLabel,typeIcons:t,groupCount:w.groupCount,groupLabel:w.groupLabel,onHover:E,onPick:Z}),!K&&"some"===P&&V&&/* @__PURE__ */f("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:w.partialFailure}),!K&&!V&&0===q.length&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.minChars(2)})]}),
|
|
18
|
+
/* @__PURE__ */m("div",{className:"flex items-center justify-between px-4 py-2 border-t border-gray-100 bg-gray-50 text-[11px] text-gray-400",children:[
|
|
19
|
+
/* @__PURE__ */m("div",{className:"flex items-center gap-3",children:[
|
|
20
|
+
/* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
|
|
21
|
+
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↑"}),
|
|
22
|
+
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↓"}),` ${w.navigate}`]}),
|
|
23
|
+
/* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
|
|
24
|
+
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:w.enterKey}),` ${w.open}`]}),X.length>1&&/* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
|
|
25
|
+
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:w.tabKey}),` ${w.nextGroup}`]})]}),
|
|
26
|
+
/* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
|
|
27
|
+
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:w.escKey}),` ${w.close}`]})]})]})]}),document.body):null}export{w as BrandMark,X as GlobalSearch,C as PAGE_RESULT_ENTITY,T as favoritesToResults,E as navPagesProvider,V as openGlobalSearch,$ as parsePageResultTarget,A as partitionNav,K as pushRecent,x as resolveBrandMarkTreatment,L as rowsContainRoute,P as sanitizeRecent,_ as visibleNavChildren,N as visibleSectionItems};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellStrings as e}from"./chunk-
|
|
1
|
+
import{useShellStrings as e}from"./chunk-UZUH5PVW.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
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
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
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,
|
|
@@ -1,23 +1,23 @@
|
|
|
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),[_
|
|
1
|
+
import{toast_default as e}from"./chunk-EYU4IAEZ.js";import{useShellStrings as t}from"./chunk-UZUH5PVW.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||!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 $="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:()=>{_(!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: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:$}),!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:H,children:/* @__PURE__ */c("span",{"aria-hidden":"true",children:"+"})}),
|
|
13
|
+
/* @__PURE__ */c("button",{type:"button",onClick:()=>_(!0),"aria-pressed":P,className:H+(P?" 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
|
-
/* @__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:
|
|
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]}),
|
|
17
|
-
/* @__PURE__ */d("button",{type:"button",onClick:u??(()=>{const e=document.createElement("a");e.href=n,e.download=r,e.click()}),className:
|
|
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:
|
|
17
|
+
/* @__PURE__ */d("button",{type:"button",onClick:u??(()=>{const e=document.createElement("a");e.href=n,e.download=r,e.click()}),className:H,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:H,children:[
|
|
19
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:
|
|
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:W?/* @__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
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
22
|
/* @__PURE__ */d("div",{className:"relative shadow-lg rounded",children:[
|
|
23
23
|
/* @__PURE__ */c("canvas",{ref:b,className:"block rounded"}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-
|
|
1
|
+
import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-UZUH5PVW.js";import{useRef as r,useState as n,useCallback as s}from"react";import{jsx as a}from"react/jsx-runtime";function o(e,t){const r=(t??"").split(",").map(e=>e.trim().toLocaleLowerCase()).filter(Boolean);if(0===r.length||r.includes("*")||r.includes("*/*"))return!0;const n=e.name.toLocaleLowerCase(),s=e.type.toLocaleLowerCase();return r.some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?s.startsWith(e.slice(0,-1)):s===e)}var l=(t,r=e.files)=>t<1024?r.bytes(t):t<1048576?r.kilobytes(Math.round(t/1024)):r.megabytes(t/1048576),i=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function c({onAccept:e,accept:a,maxSizeBytes:c,maxFiles:u,multiple:f=!0,currentCount:p=0,acceptHint:m,disabled:d=!1}){const h=t().files,g=r(null),[y,x]=n(!1),[v,D]=n([]),L=r(0),b="string"==typeof m?m:"",A=s(t=>{if(d||!t)return;const r=Array.from(t);if(0===r.length)return;const n=[],s=[];for(const e of f?r:r.slice(0,1))o(e,a)?null!=c&&e.size>c?s.push({file:e,reason:"size",message:h.tooLarge(e.name,l(e.size,h),l(c,h))}):f&&null!=u&&p+n.length>=u?s.push({file:e,reason:"count",message:h.tooMany(e.name,u)}):n.push(e):s.push({file:e,reason:"type",message:h.notAccepted(e.name,b)});D(s),n.length&&e(n),g.current&&(g.current.value="")},[d,f,a,b,c,u,p,e,h]),j=s(()=>{d||g.current?.click()},[d]),k=s(()=>D([]),[]);return{inputRef:g,inputProps:{ref:g,type:"file",accept:a||void 0,multiple:f,disabled:d,tabIndex:-1,"aria-hidden":!0,className:"hidden",onChange:e=>A(e.target.files)},zoneProps:d?{}:{onDragEnter:e=>{i(e)&&(e.preventDefault(),L.current+=1,x(!0))},onDragOver:e=>{i(e)&&(e.preventDefault(),y||x(!0))},onDragLeave:e=>{i(e)&&(L.current=Math.max(0,L.current-1),0===L.current&&x(!1))},onDrop:e=>{i(e)&&(e.preventDefault(),L.current=0,x(!1),A(e.dataTransfer.files))}},pasteProps:d?{}:{onPaste:e=>{const t=function(e){const t=e.clipboardData;if(!t)return[];if(t.files&&t.files.length>0)return Array.from(t.files);const r=[];for(const e of Array.from(t.items??[]))if("file"===e.kind){const t=e.getAsFile();t&&r.push(t)}return r}(e);0!==t.length&&(e.preventDefault(),A(t))}},open:j,take:A,dragOver:y,rejections:v,clearRejections:k}}function u({rejections:e,className:t="mt-2"}){return 0===e.length?null:/* @__PURE__ */a("ul",{role:"alert",className:`${t} flex flex-col gap-0.5`,children:e.map(({file:e,message:t},r)=>/* @__PURE__ */a("li",{className:"text-xs text-red-600",children:t},`${e.name}-${r}`))})}export{u as FileIntakeAlert,o as acceptsFile,l as humanSize,c as useFileIntake};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{navIcons as e}from"./chunk-
|
|
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
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
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
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__ */
|
|
@@ -10,4 +10,4 @@ return o("div",{className:"w-12 h-12 relative flex items-center justify-center "
|
|
|
10
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
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
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
|
|
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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createContext as t,useContext as e}from"react";import{jsx as r}from"react/jsx-runtime";var n={},o=new Proxy(n,{get:(t,e)=>n[e],has:(t,e)=>e in n,ownKeys:()=>Object.keys(n),getOwnPropertyDescriptor(t,e){if(e in n)return{configurable:!0,enumerable:!0,value:n[e]}}});function a(t){for(const t of Object.keys(n))delete n[t];Object.assign(n,t)}var u={},i=[],c={erp:[],system:[],virtual:[],footer:[]},s=t({hasAnyPerm:()=>!0});function d({value:t,children:e}){/* @__PURE__ */
|
|
2
|
+
return r(s.Provider,{value:t,children:e})}function m(){return e(s)}var l=240,h=68,f=52,p="react-os-shell:work-area-changed";function w(){const t=getComputedStyle(document.documentElement),e=parseInt(t.getPropertyValue("--taskbar-height"))||0,r=parseInt(t.getPropertyValue("--taskbar-width"))||0,n=t.getPropertyValue("--taskbar-position")?.trim()||"bottom",o=parseInt(t.getPropertyValue("--sidebar-width"))||0;return{x:("left"===n?r:0)+o,y:"top"===n?e:0,w:window.innerWidth-("left"===n||"right"===n?r:0)-o,h:window.innerHeight-("top"===n||"bottom"===n?e:0)}}function y(t,e,r){const n=r?e.w+280:e.w-280,o=Math.abs(t.w-e.w)<=4||Math.abs(t.w-n)<=4;return Math.abs(t.h-e.h)<=4&&o}function g({over:t,residual:e},r){return e<=1||t-e>=r-2}function b(t,e,r){let n=t;for(const o of r)g(o,e)&&(n=Math.max(n,t+o.over));return Math.ceil(n)}function v(t,e,r,n){const o=Math.min(e,r.w-2*n);if(o<=t.w+1)return t;const a=r.x+n,u=r.x+r.w-n-o,i=Math.min(Math.max(t.x-(o-t.w)/2,a),u);return{...t,x:Math.round(i),w:Math.round(o)}}function x(){return(parseInt(getComputedStyle(document.documentElement).getPropertyValue("--sidebar-width"))||0)>0}function M(){return"undefined"!=typeof document&&"sidebar"===getComputedStyle(document.documentElement).getPropertyValue("--layout-mode")?.trim()}export{h as RAIL_COLLAPSED_W,l as RAIL_W,d as ShellAuthProvider,f as TAB_STRIP_H,p as WORK_AREA_CHANGED_EVENT,y as boxFillsWorkArea,w as computeMaximizedBox,v as growBoxToWidth,x as isSidebarStripReserved,o as navIcons,i as navSections,M as readAlwaysMaximizedFlag,g as scrollerIsFluid,u as sectionIcons,a as setShellNavIcons,c as startMenuCategories,m as useShellAuth,b as widthToFit};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return g("button",{ref:c,id:s,role:i,tabIndex:a,onClick:()=>{e?.(),d&&d.depth>0&&d.closeTree()},onMouseEnter:()=>{d?.scheduleClose(d.depth),u?.()},disabled:o,className:p.className,style:p.style,children:t})}),U=/* @__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 J(e){let
|
|
1
|
+
import{useHydrated as e,useBrowserLayoutEffect as t}from"./chunk-D65T4H6J.js";import{onOverlayOpen as n,Z_LAYERS as r,registerModalEscapeInterceptor as o}from"./chunk-OSJ3ADF2.js";import{rootIsDark as i}from"./chunk-MAIHBBWT.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=i;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"]),B="data-native-context-menu";function E(e,t){return e&&"function"==typeof e.closest?e.closest(t):null}function T(e){const t=e;if(!t||"function"!=typeof t.closest)return!1;if(E(t,`[${B}]`))return!0;if(E(t,"textarea"))return!0;if(E(t,"img, picture, canvas, video, audio"))return!0;const n=E(t,"input");if(n){const e=(n.type||"text").toLowerCase();if(L.has(e))return!0}const r=E(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=E(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,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function S(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 P(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var I=a(null);function j({children:t,style:o,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=e(),k=m(()=>{const e=()=>clearTimeout(w.current);return{id:y,depth:0,path:b,open:(t,n)=>{e(),x(e=>F(e,t,n))},scheduleClose:t=>{e(),w.current=setTimeout(()=>x(e=>S(e,t)),200)},closeBelow:t=>{e(),x(e=>S(e,t))},cancelClose:e,closeTree:()=>{e(),x([]),a?.()},root:h}},[y,b,a]);p(()=>{if(!a)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${y}"]`)||h.current&&!h.current.contains(e.target)&&a()},t=e=>{"Escape"===e.key&&a()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const r=n(a);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),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 $=P(),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=>{T(e.target)||e.preventDefault()},style:{...M?{}:{zIndex:r.menu},minWidth:s,animation:"popup-in 0.12s ease-out",...C(),...o},children:/* @__PURE__ */g(I.Provider,{value:k,children:t})});return l?v?f(N,document.body):null:N}function z(e,t,n,r=!1){const o=P(),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 q=s(function({onClick:e,children:t,className:n="",danger:r,disabled:o,role:i,tabIndex:a,id:s,onMouseEnter:u},c){const d=l(I),p=z(r,o,n);/* @__PURE__ */
|
|
2
|
+
return g("button",{ref:c,id:s,role:i,tabIndex:a,onClick:()=>{e?.(),d&&d.depth>0&&d.closeTree()},onMouseEnter:()=>{d?.scheduleClose(d.depth),u?.()},disabled:o,className:p.className,style:p.style,children:t})}),U=/* @__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 J(e){let t=r.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 K(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function O({label:e,icon:n,children:r,disabled:i,className:a="",minWidth:s=180,maxHeight:d}){const x=l(I),w=c(),v=u(null),k=u(null),$=u(),M=u(!1),N=`${w}-menu`;p(()=>()=>clearTimeout($.current),[]);const L=x?.depth??0,B=x?.path[L],E=!!B&&B.key===w&&!i,W=h(e=>{if(!x||i||!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,o=L>0&&(x.path[L-1]?.flipped??!1),a=H(r.left,r.right,s,window.innerWidth,4,o);x.open(L,{key:w,y:t.top,...a})},[x,i,L,w,s]),A=e=>{x?.closeBelow(L),v.current?.focus()};p(()=>{if(E)return o(e=>"Escape"===e.key&&(!(x&&x.path.length>L+1)&&(A(),!0)))}),t(()=>{if(!E||!B)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(()=>{E&&M.current&&(M.current=!1,K(k.current)[0]?.focus())},[E]);const F=m(()=>x&&{...x,depth:L+1},[x,L]);if(!x)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const S=z(!1,i,a,E),R=P();/* @__PURE__ */
|
|
3
3
|
return y(b,{children:[
|
|
4
|
-
/* @__PURE__ */y("button",{ref:v,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":E,"aria-controls":E?N:void 0,disabled:
|
|
4
|
+
/* @__PURE__ */y("button",{ref:v,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":E,"aria-controls":E?N:void 0,disabled:i,"data-popup-submenu-row":!0,className:S.className,style:S.style,onClick:e=>{const t=0===e.detail;E?t&&K(k.current)[0]?.focus():W(t)},onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),W(!0))},onMouseEnter:()=>{i||(x.cancelClose(),E?x.closeBelow(L+1):(clearTimeout($.current),$.current=setTimeout(()=>W(!1),120)))},onMouseLeave:()=>{clearTimeout($.current),x.scheduleClose(L)},children:[n,
|
|
5
5
|
/* @__PURE__ */g("span",{className:"min-w-0 flex-1 truncate",children:e}),U]}),E&&f(
|
|
6
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"===R?"py-1":"large"===R?"py-2":"py-1.5"),style:{left:B.left,top:B.y,minWidth:s,maxHeight:void 0===d?"calc(100vh - 16px)":`min(${"number"==typeof d?`${d}px`:d}, calc(100vh - 16px))`,zIndex:J(x.root.current)+L+1,animation:(B.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=K(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=>{T(e.target)||e.preventDefault()},children:/* @__PURE__ */g(I.Provider,{value:F,children:r})}),document.body)]})}function V(){const e=P();/* @__PURE__ */
|
|
7
7
|
return g("div",{className:`border-t ${M} ${"tight"===e?"my-0.5":"large"===e?"my-1.5":"my-1"} mx-3`})}function G({children:e}){const t=P(),n="tight"===t?"0.125rem":"large"===t?"0.375rem":"0.25rem";/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-ZWYKMIX7.js";import{keepsNativeMenu as a}from"./chunk-DYVN6C2E.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"}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{currentShellStrings as t}from"./chunk-
|
|
1
|
+
import{currentShellStrings as t}from"./chunk-UZUH5PVW.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,20 +1,20 @@
|
|
|
1
|
-
import{useDismissPopupsOnOpen as e,registerModalEscapeInterceptor as t,Z_LAYERS as n}from"./chunk-OSJ3ADF2.js";import{useShellStrings as r,splitAround as o}from"./chunk-
|
|
1
|
+
import{useDismissPopupsOnOpen as e,registerModalEscapeInterceptor as t,Z_LAYERS as n}from"./chunk-OSJ3ADF2.js";import{useShellStrings as r,splitAround as o}from"./chunk-UZUH5PVW.js";import{createContext as l,useEffect as i,useRef as a,useId as s,useContext as c,useState as d,useCallback as u}from"react";import{jsxs as m,jsx as f,Fragment as h}from"react/jsx-runtime";var b=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function g(e){return Array.from(e.querySelectorAll(b)).filter(e=>null!==e.offsetParent||e===document.activeElement)}var p=[];function v(e){const t=p.findIndex(t=>t!==e&&e.contains(t));-1===t?p.push(e):p.splice(t,0,e)}function x(e){const t=p.lastIndexOf(e);-1!==t&&p.splice(t,1)}var y=/* @__PURE__ */new WeakSet;function w(e){return g(e)}function N(e,t){i(()=>{if(!t)return;const n=e.current;return n?(y.add(n),v(n),()=>{x(n),y.delete(n)}):void 0},[e,t])}function k(e,t){const n=p.lastIndexOf(t),r=n>0?p[n-1]:-1===n?p[p.length-1]??null:null,o=g(r??e.ownerDocument.body).filter(n=>!t.contains(n)&&!e.contains(n)),l=o.find(t=>0!==(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING));return l||(r&&!y.has(r)?o[0]??null:null)}function C(e,t,n){i(()=>{if(!t)return;const r=e.current;if(!r)return;const o=document.activeElement,l=n?.current??g(r)[0]??r;l!==r||r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),l.focus();const i=e=>{if("Tab"!==e.key)return;if(p[p.length-1]!==r)return;const t=g(r);if(0===t.length)return void e.preventDefault();const n=t[0],o=t[t.length-1],l=document.activeElement;!e.shiftKey||l!==n&&r.contains(l)?e.shiftKey||l!==o&&r.contains(l)||(e.preventDefault(),n.focus()):(e.preventDefault(),o.focus())};return v(r),document.addEventListener("keydown",i,!0),()=>{x(r),document.removeEventListener("keydown",i,!0),(r.contains(document.activeElement)||document.activeElement===document.body)&&o?.focus?.()}},[e,t,n])}var L=0,E=null;function P(e){i(()=>{if(!e)return;const t=document.body;if(0===L){E={overflow:t.style.overflow,paddingRight:t.style.paddingRight};const e=window.innerWidth-document.documentElement.clientWidth;t.style.overflow="hidden",e>0&&(t.style.paddingRight=`${e}px`)}return L+=1,()=>{0===(L-=1)&&E&&(t.style.overflow=E.overflow,t.style.paddingRight=E.paddingRight,E=null)}},[e])}var j={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function D({open:o,onClose:l,title:c,description:d,role:u="dialog",children:h,footer:b,blocking:g=!1,size:p="md",initialFocus:v,"aria-label":x,"aria-labelledby":y,"aria-describedby":w,className:N=""}){const k=a(null),L=s(),E=s(),D=!g&&!b,W=s(),F=r().dialog;return e(o),C(k,o,v),P(o),i(()=>{if(o)return t(()=>(g||l(),!0))},[o,g,l]),o?/* @__PURE__ */m("div",{className:"fixed inset-0",style:{zIndex:n.overlay},role:"presentation",children:[
|
|
2
2
|
/* @__PURE__ */f("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
|
|
3
|
-
/* @__PURE__ */f("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:g?void 0:e=>{e.target===e.currentTarget&&l()},children:/* @__PURE__ */m("div",{ref:k,role:u,"aria-modal":"true","aria-labelledby":c?
|
|
3
|
+
/* @__PURE__ */f("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:g?void 0:e=>{e.target===e.currentTarget&&l()},children:/* @__PURE__ */m("div",{ref:k,role:u,"aria-modal":"true","aria-labelledby":c?W:y,"aria-label":c||y?void 0:x,"aria-describedby":w??(d?E:h?L:void 0),className:`relative max-h-full w-full ${j[p]} overflow-y-auto overscroll-contain rounded-lg bg-white p-6 shadow-xl ${N}`.trim(),children:[c&&/* @__PURE__ */f("h2",{id:W,className:(D?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:c}),d&&/* @__PURE__ */f("p",{id:E,className:((c?"mt-1":D?"pr-8":"")+" text-sm text-gray-500").trim(),children:d}),h&&/* @__PURE__ */f("div",{id:L,className:"mt-2 text-sm text-gray-600",children:h}),b&&/* @__PURE__ */f("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:b}),D&&/* @__PURE__ */f("button",{type:"button",onClick:l,"aria-label":F.close,className:"absolute right-3 top-3 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */f("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */f("path",{d:"M6 6l8 8M14 6l-8 8"})})})]})})]}):null}var W=l(()=>Promise.resolve(!1)),F=()=>c(W),O=()=>Promise.resolve(!1),T=e=>O(e),I=()=>Promise.resolve(!1),M=e=>I(e),$=()=>Promise.resolve(null),A=e=>$(e),R={danger:{icon:"text-red-600 bg-red-100",button:"bg-red-600 hover:bg-red-700 text-white"},warning:{icon:"text-yellow-600 bg-yellow-100",button:"bg-yellow-600 hover:bg-yellow-700 text-white"},info:{icon:"text-blue-600 bg-blue-100",button:"bg-blue-600 hover:bg-blue-700 text-white"}},z="bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50";function K(){/* @__PURE__ */
|
|
4
4
|
return f("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */f("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"})})}function S(){/* @__PURE__ */
|
|
5
|
-
return f("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}function
|
|
6
|
-
return m(
|
|
7
|
-
/* @__PURE__ */f(D,{open:t,onClose:()=>
|
|
8
|
-
/* @__PURE__ */f("button",{ref:y,type:"button",onClick:()=>
|
|
9
|
-
/* @__PURE__ */f("button",{type:"button",onClick:()=>
|
|
10
|
-
/* @__PURE__ */f("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${
|
|
5
|
+
return f("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}function B({children:e}){const[t,n]=d(!1),[l,s]=d({message:""}),[c,b]=d(0),g=a(),p=a(null),v=a(0),x=a([]),y=a(null),w=a(null),N=u(e=>{p.current=e.id,g.current=e.resolve,b(e.id),s(e.options),n(!0)},[]),k=u(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++v.current,options:t,resolve:e};null===p.current?N(n):x.current.push(n)})},[N]),[C,L]=d(!1),[E,P]=d({message:""}),[j,F]=d(""),T=a(),M=u(e=>(P(e),F(""),L(!0),new Promise(e=>{T.current=e})),[]),[A,B]=d(!1),[U,H]=d({}),[V,_]=d(""),q=a(),G=u(e=>{const t="string"==typeof e?{message:e}:e;return H(t),_(t.defaultValue??""),B(!0),new Promise(e=>{q.current=e})},[]);i(()=>{O=k,I=M,$=G},[k,M,G]);const J=(e,t)=>{if(p.current!==e)return;const r=g.current,o=x.current.shift();o?N(o):(p.current=null,g.current=void 0,n(!1)),r?.(t)},Z=e=>{L(!1),F(""),T.current?.(e)},Q=e=>{if(e){const e=V.trim();if(!e&&!U.allowEmpty)return B(!1),void q.current?.(null);B(!1),q.current?.(e)}else B(!1),q.current?.(null)},X=l.variant||(l.confirmLabel?.toLowerCase().includes("delete")||l.message.toLowerCase().includes("delete")?"danger":"info"),Y=R[X],ee=R["warning"===E.variant?"warning":"danger"],te=E.confirmWord,ne=null==te||j===te,re=r().dialog,[oe,le]=o(re.typeToConfirm);/* @__PURE__ */
|
|
6
|
+
return m(W.Provider,{value:k,children:[e,
|
|
7
|
+
/* @__PURE__ */f(D,{open:t,onClose:()=>J(c,!1),initialFocus:y,footer:/* @__PURE__ */m(h,{children:[
|
|
8
|
+
/* @__PURE__ */f("button",{ref:y,type:"button",onClick:()=>J(c,!1),className:z,children:l.cancelLabel||re.cancel}),
|
|
9
|
+
/* @__PURE__ */f("button",{type:"button",onClick:()=>J(c,!0),className:`px-4 py-2 text-sm font-medium rounded-lg ${Y.button}`,children:l.confirmLabel||re.ok})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
10
|
+
/* @__PURE__ */f("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${Y.icon}`,children:/* @__PURE__ */f(K,{})}),
|
|
11
11
|
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
12
12
|
/* @__PURE__ */f("h2",{className:"text-base font-semibold text-gray-900",children:l.title||re.confirmTitle}),
|
|
13
13
|
/* @__PURE__ */f("p",{className:"mt-2 text-sm text-gray-600",children:l.message})]})]})}),
|
|
14
|
-
/* @__PURE__ */m(D,{open:C,onClose:()=>
|
|
15
|
-
/* @__PURE__ */f("button",{ref:w,type:"button",onClick:()=>
|
|
16
|
-
/* @__PURE__ */f("button",{type:"button",onClick:()=>
|
|
17
|
-
/* @__PURE__ */f("button",{type:"button",onClick:()=>
|
|
14
|
+
/* @__PURE__ */m(D,{open:C,onClose:()=>Z(!1),initialFocus:null!=te?void 0:w,footer:/* @__PURE__ */m(h,{children:[
|
|
15
|
+
/* @__PURE__ */f("button",{ref:w,type:"button",onClick:()=>Z(!1),className:z,children:E.cancelLabel||re.destructiveCancel}),
|
|
16
|
+
/* @__PURE__ */f("button",{type:"button",onClick:()=>Z(!0),disabled:!ne,className:`px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40 ${ee.button}`,children:te??E.confirmLabel??re.destructiveConfirm})]}),children:[
|
|
17
|
+
/* @__PURE__ */f("button",{type:"button",onClick:()=>Z(!1),"aria-label":re.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */f(S,{})}),
|
|
18
18
|
/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
19
19
|
/* @__PURE__ */f("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ee.icon}`,children:/* @__PURE__ */f(K,{})}),
|
|
20
20
|
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
@@ -22,8 +22,8 @@ return m(F.Provider,{value:k,children:[e,
|
|
|
22
22
|
/* @__PURE__ */f("p",{className:"mt-2 text-sm text-gray-600",children:E.message}),null!=te&&/* @__PURE__ */m(h,{children:[
|
|
23
23
|
/* @__PURE__ */m("p",{className:"mt-3 text-sm text-gray-700",children:[oe,
|
|
24
24
|
/* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 bg-gray-50 px-1.5 py-0.5 text-xs font-bold text-red-600 font-mono",children:te}),le]}),
|
|
25
|
-
/* @__PURE__ */f("input",{autoFocus:!0,type:"text",value:j,onChange:e=>
|
|
26
|
-
/* @__PURE__ */m(D,{open:A,onClose:()=>Q(!1),title:
|
|
27
|
-
/* @__PURE__ */f("button",{type:"button",onClick:()=>Q(!1),className:z,children:
|
|
28
|
-
/* @__PURE__ */f("button",{type:"button",onClick:()=>Q(!0),disabled:!
|
|
29
|
-
/* @__PURE__ */f("input",{autoFocus:!0,type:"text",value:
|
|
25
|
+
/* @__PURE__ */f("input",{autoFocus:!0,type:"text",value:j,onChange:e=>F(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j===te&&Z(!0)},placeholder:te,className:"mt-2 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-red-500"})]})]})]})]}),
|
|
26
|
+
/* @__PURE__ */m(D,{open:A,onClose:()=>Q(!1),title:U.title||re.promptTitle,footer:/* @__PURE__ */m(h,{children:[
|
|
27
|
+
/* @__PURE__ */f("button",{type:"button",onClick:()=>Q(!1),className:z,children:U.cancelLabel||re.cancel}),
|
|
28
|
+
/* @__PURE__ */f("button",{type:"button",onClick:()=>Q(!0),disabled:!U.allowEmpty&&!V.trim(),className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40",children:U.confirmLabel||re.ok})]}),children:[U.message&&/* @__PURE__ */f("p",{className:"text-sm text-gray-600",children:U.message}),
|
|
29
|
+
/* @__PURE__ */f("input",{autoFocus:!0,type:"text",value:V,onChange:e=>_(e.target.value),onKeyDown:e=>{"Enter"===e.key?Q(!0):"Escape"===e.key&&Q(!1)},onFocus:e=>e.target.select(),placeholder:U.placeholder,className:"mt-3 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})]})}export{B as ConfirmProvider,D as Dialog,T as confirm,M as confirmDestructive,w as focusableIn,A as prompt,k as stopAfter,F as useConfirm,C as useFocusTrap,P as useScrollLock,N as useTabLayer};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{useHydrated as e,useBrowserState as t}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-UZUH5PVW.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
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
3
|
return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})});case"warning":/* @__PURE__ */
|
|
4
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:
|
|
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
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
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:
|
|
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,
|
|
10
|
-
return c("kbd",{className:[
|
|
11
|
-
return c(
|
|
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[_],j=M.CMD_Z[_],H=M.CMD_SHIFT_Z[_],I=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 P(t){return e()?t:z.get(t)??t}var O="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 U({keys:e,size:t="md",className:r=""}){const n=P(e);/* @__PURE__ */
|
|
10
|
+
return c("kbd",{className:[O,$[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 J(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 W={prefs:{},save:()=>{}};function B(){return a(K)??W}function V(){const{prefs:e,save:t}=B(),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,I 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,H as CMD_SHIFT_Z,j as CMD_Z,S as ENTER,U 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,J as useLocalStoragePrefs,V as useShellPrefs,B as useShellPrefsAdapter,P as useShortcutLabel};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{useCopyText as e,CopyGlyph as t}from"./chunk-6KO2U66R.js";import{PopupMenu as n,PopupMenuItem as r,PopupMenuDivider as l}from"./chunk-DYVN6C2E.js";import{useShellStrings as i}from"./chunk-UZUH5PVW.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:n,label:r,copiedLabel:l}){const{copied:i,copy:a}=e(n);/* @__PURE__ */
|
|
3
|
+
return d("button",{type:"button",tabIndex:-1,"aria-label":i?l:r,title:i?l:r,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:$}){const j=i().pageTabs,[z,I]=a(null),D=e.length;o(()=>{if(!t)return;const e=document.getElementById(h(t,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[h,t,D]);const M=e.some(e=>e.key===t)?t:e[0]?.key,L=t=>{const n=e[(t+e.length)%e.length];n&&document.getElementById(h(n.key,"tab"))?.focus()},_=z?e.find(e=>e.key===z.key):void 0,A=_&&$?$(_.key):[],B=_?e.indexOf(_):-1,E=e=>e.some(e=>!e.pinned),R=e=>()=>{I(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 n=e.findIndex(e=>document.getElementById(h(e.key,"tab"))===t.target);if(!(n<0)){if("ArrowRight"===t.key)L(n+1);else if("ArrowLeft"===t.key)L(n-1);else if("Home"===t.key)L(0);else if("End"===t.key)L(e.length-1);else{if("Delete"!==t.key||e[n].pinned)return;g(e[n].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((n,r)=>{const l=n.key===t,i=!!n.dirty,a=n.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=r>0&&!l&&e[r-1].key!==t,x={type:"button",role:"tab",id:h(n.key,"tab"),"aria-selected":l,"aria-controls":b?.(n.key)?h(n.key,"panel"):void 0,tabIndex:n.key===M?0:-1,title:n.title,onClick:()=>f(n.key)},k={onContextMenu:e=>((e,t)=>{e.preventDefault(),I({x:e.clientX,y:e.clientY,key:t.key})})(e,n),onAuxClick:e=>((e,t)=>{1!==e.button||t.pinned||(e.preventDefault(),g(t.key))})(e,n),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&&!n.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 n.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:n.title})]})},n.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&&(n.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":j.tabMenu??"Window menu",title:j.tabMenu??"Window menu",onClick:e=>{const t=e.currentTarget.getBoundingClientRect();C?.(n.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:n.title})]}),l&&n.copy&&/* @__PURE__ */d(y,{text:n.copy,label:j.copy?.(n.copy)??`Copy ${n.copy}`,copiedLabel:j.copied??"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":j.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
|
|
15
|
+
/* @__PURE__ */d("button",{type:"button",tabIndex:-1,"aria-label":j.closeTab?.(n.title)??`${j.close} ${n.title}`,onClick:()=>g(n.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,{})})]})]})]},n.key)})}),N&&/* @__PURE__ */d("div",{className:"flex shrink-0 items-center gap-2 self-center",children:N}),z&&_&&/* @__PURE__ */c(n,{portal:!0,style:{left:z.x,top:z.y},onClose:()=>I(null),children:[A.length>0&&/* @__PURE__ */c(m,{children:[A.map((e,t)=>/* @__PURE__ */c(r,{onClick:R(e.onSelect),children:[e.icon,e.label]},t)),
|
|
16
|
+
/* @__PURE__ */d(l,{})]}),
|
|
17
|
+
/* @__PURE__ */d(r,{disabled:_.pinned,onClick:R(()=>g(_.key)),children:j.close}),
|
|
18
|
+
/* @__PURE__ */d(l,{}),
|
|
19
|
+
/* @__PURE__ */d(r,{disabled:!E(e.filter(e=>e.key!==_.key)),onClick:R(()=>x("others",_.key)),children:j.closeOthers}),
|
|
20
|
+
/* @__PURE__ */d(r,{disabled:!E(e.slice(B+1)),onClick:R(()=>x("right",_.key)),children:j.closeRight}),
|
|
21
|
+
/* @__PURE__ */d(r,{disabled:!E(e),onClick:R(()=>x("all",null)),children:j.closeAll})]})]})}export{h as TabStrip};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{requestFilesTrashView as n}from"./chunk-
|
|
1
|
+
import{requestFilesTrashView as n}from"./chunk-C2A4PIGZ.js";var o=null;function r(n){o=n}function t(){return o}function u(){n()}export{t as getFilesDemoTree,u as openFilesInTrashMode,r as setFilesDemoTree};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="4.162.0",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
/* @__PURE__ */i("div",{className:`flex h-full flex-col ${
|
|
3
|
-
/* @__PURE__ */l("div",{onPointerDown
|
|
4
|
-
return l("div",{className:`flex h-full w-full overflow-hidden ${b}`,children:/* @__PURE__ */i(s,N?{children:[S
|
|
1
|
+
import{useBrowserState as e}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-UZUH5PVW.js";import{useRef as t,useCallback as o,useEffect as n}from"react";import{jsxs as i,jsx as l,Fragment as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(Math.max(e,r),t);function d({sidebar:d,sidebarTop:c,sidebarBottom:u,children:m,side:h="left",storageKey:v,defaultWidth:w=256,minWidth:f=180,maxWidth:p=480,className:b="",sidebarClassName:y=("right"===h?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:g="bg-white"}){const N="right"===h,x=r().sidebar,[z,k]=e(()=>{if(v){let e=null;try{e=window.localStorage.getItem(v)}catch{}const r=e?parseInt(e,10):NaN;if(!Number.isNaN(r))return a(r,f,p)}return a(w,f,p)},a(w,f,p)),E=t(null),L=o(e=>{const r=E.current;if(!r)return;const t=(e.clientX-r.startX)*(N?-1:1);k(a(r.startWidth+t,f,p))},[f,p,N]),W=o(()=>{E.current=null,window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",W),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[L]),$=o(e=>{e.preventDefault(),E.current={startX:e.clientX,startWidth:z},window.addEventListener("pointermove",L),window.addEventListener("pointerup",W),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[z,L,W]);n(()=>{if(!v)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(v,String(Math.round(z)))}catch{}},200);return()=>window.clearTimeout(e)},[z,v]),n(()=>()=>{window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",W)},[L,W]);const D=N?"left-0":"right-0",P=null!=c||null!=u,S=/* @__PURE__ */i("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:z},children:[
|
|
2
|
+
/* @__PURE__ */i("div",{className:`flex h-full flex-col ${P?"overflow-hidden":"overflow-y-auto"} ${y}`,children:[null!=c&&/* @__PURE__ */l("div",{className:"shrink-0 px-2 pt-3 pb-2",children:c}),P?/* @__PURE__ */l("div",{className:"min-h-0 flex-1 overflow-y-auto",children:d}):d,null!=u&&/* @__PURE__ */l("div",{className:"mt-auto shrink-0 border-t border-gray-200 px-2 py-3",children:u})]}),
|
|
3
|
+
/* @__PURE__ */l("div",{onPointerDown:$,onDoubleClick:()=>k(a(w,f,p)),title:x.resize,className:`group/resize absolute inset-y-0 ${D} z-10 w-2 cursor-col-resize`,children:/* @__PURE__ */l("div",{className:`absolute inset-y-0 ${D} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})]}),T=/* @__PURE__ */l("div",{className:`flex min-w-0 flex-1 flex-col ${g}`,children:m});/* @__PURE__ */
|
|
4
|
+
return l("div",{className:`flex h-full w-full overflow-hidden ${b}`,children:/* @__PURE__ */i(s,N?{children:[T,S]}:{children:[S,T]})})}export{d as SidebarLayout};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useShellAuth as e}from"./chunk-DSSLOQDW.js";var t={};function r(e){t=e}function n(){const{hasAnyPerm:r}=e();return{user:t.user,logout:t.logout??(()=>{}),hasAnyPerm:r}}var o="react-os-shell:sidebar-collapsed",c="react-os-shell:sidebar-open-sections";function s(e,t){return"true"===e||"false"!==e&&t<1024}function a(e){if(!e)/* @__PURE__ */return new Set;try{const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e))return new Set(t)}catch{}/* @__PURE__ */
|
|
2
|
+
return new Set}function u(e,t){const r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r}function l(e){try{return localStorage.getItem(e)}catch{return null}}function i(e,t){try{localStorage.setItem(e,t)}catch{}}export{o as RAIL_COLLAPSED_KEY,c as RAIL_OPEN_SECTIONS_KEY,s as initialRailCollapsed,a as parseOpenSections,l as readStored,r as setShellAuthBridge,u as toggleOpenSection,n as useAuth,i as writeStored};
|