efficient-shell 4.165.0 → 4.166.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +75 -2
  2. package/dist/{Browser-ZX5GWPSM.js → Browser-2MBG34IR.js} +14 -14
  3. package/dist/Calculator-R3WJTNZ6.js +29 -0
  4. package/dist/ConfirmDialog-ZDVMT74Y.js +1 -0
  5. package/dist/{CurrencyConverter-7OPRFA5D.js → CurrencyConverter-PEXSQQUK.js} +7 -7
  6. package/dist/{Documents-QV63346J.js → Documents-YL4RIOZO.js} +15 -15
  7. package/dist/{Files-BU5V56YF.js → Files-3ZRUTRSB.js} +22 -22
  8. package/dist/Notepad-3ZM2FR6C.js +25 -0
  9. package/dist/{PomodoroTimer-FJV6MGE3.js → PomodoroTimer-5QHA5UOY.js} +14 -14
  10. package/dist/{Preview-PMQKG6FH.js → Preview-32F4DTCK.js} +9 -9
  11. package/dist/{Sidebar-E6GLVCJL.js → Sidebar-QQSRLMJG.js} +22 -22
  12. package/dist/Spreadsheet-GOZI7I4L.js +37 -0
  13. package/dist/{Stock-SSNUY34E.js → Stock-XJFITZZA.js} +4 -4
  14. package/dist/{Weather-T5WM66B2.js → Weather-BDC633GV.js} +16 -16
  15. package/dist/{WorldClock-C3GT27AV.js → WorldClock-ROOVRRCJ.js} +7 -7
  16. package/dist/apps/index.js +1 -1
  17. package/dist/brand.css +1 -1
  18. package/dist/{chunk-QTPVA26D.js → chunk-7TQ7NMT3.js} +1 -1
  19. package/dist/{chunk-PLX2N4N6.js → chunk-7YFAFXQG.js} +2 -2
  20. package/dist/chunk-AFYQTVZO.js +1 -0
  21. package/dist/chunk-BKDE67DB.js +12 -0
  22. package/dist/{chunk-A7Q4BCPI.js → chunk-CRI4UFBU.js} +5 -5
  23. package/dist/{chunk-DJ6UVHAZ.js → chunk-DTRXR6JQ.js} +11 -11
  24. package/dist/chunk-G5J6YSN5.js +5 -0
  25. package/dist/{chunk-YWXYBJ5Y.js → chunk-HA2WG27U.js} +2 -2
  26. package/dist/{chunk-D7EJSASN.js → chunk-HGG5M5AB.js} +1 -1
  27. package/dist/chunk-HZZNJHRH.js +1 -0
  28. package/dist/chunk-JKVDTKBE.js +988 -0
  29. package/dist/chunk-M4DB7UBZ.js +29 -0
  30. package/dist/{chunk-RKEHUV7U.js → chunk-QASZIYLG.js} +1 -1
  31. package/dist/chunk-SOI4LR67.js +27 -0
  32. package/dist/chunk-UVZIPXIA.js +10 -0
  33. package/dist/chunk-VRHUY4P4.js +1 -0
  34. package/dist/{chunk-ZLJCWBDF.js → chunk-VXBJNMAA.js} +60 -60
  35. package/dist/chunk-X4FJ54PP.js +1 -0
  36. package/dist/{index-DRkpyISn.d.ts → index-DcLqfJX3.d.ts} +182 -13
  37. package/dist/index.d.ts +3 -13
  38. package/dist/index.js +83 -83
  39. package/dist/map/index.js +3 -3
  40. package/dist/page-tabs/index.js +5 -5
  41. package/dist/ui/index.d.ts +1 -1
  42. package/dist/ui/index.js +1 -1
  43. package/package.json +1 -1
  44. package/dist/Calculator-NZH4FVRW.js +0 -29
  45. package/dist/ConfirmDialog-WEVZTFLU.js +0 -1
  46. package/dist/Notepad-KZIJ5ZTF.js +0 -25
  47. package/dist/Spreadsheet-DE5HPVE2.js +0 -37
  48. package/dist/chunk-4UCRT4ST.js +0 -5
  49. package/dist/chunk-ELSUXC3N.js +0 -1
  50. package/dist/chunk-FGPWGHNT.js +0 -27
  51. package/dist/chunk-KRTZFHYW.js +0 -29
  52. package/dist/chunk-MAIHBBWT.js +0 -1
  53. package/dist/chunk-SHVGZW2J.js +0 -1
  54. package/dist/chunk-SQ7BPUZG.js +0 -9
  55. package/dist/chunk-VDL2RLZG.js +0 -10
  56. package/dist/chunk-XYITV4EC.js +0 -983
@@ -0,0 +1,29 @@
1
+ import{useDismissPopupsOnOpen as e}from"./chunk-AFYQTVZO.js";import{registerModalEscapeInterceptor as t,Z_LAYERS as n}from"./chunk-X4FJ54PP.js";import{useShellStrings as r,splitAround as o}from"./chunk-NCQLGQYR.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 F({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(),F=!g&&!b,T=s(),D=r().dialog;return e(o),C(k,o,v),P(o),i(()=>{if(o)return t(()=>(g||l(),!0),()=>k.current)},[o,g,l]),o?/* @__PURE__ */m("div",{className:"fixed inset-0",style:{zIndex:n.overlay},role:"presentation",children:[
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?T: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:T,className:(F?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:c}),d&&/* @__PURE__ */f("p",{id:E,className:((c?"mt-1":F?"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}),F&&/* @__PURE__ */f("button",{type:"button",onClick:l,"aria-label":D.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 T=l(()=>Promise.resolve(!1)),D=()=>c(T),O=()=>Promise.resolve(!1),W=e=>O(e),I=()=>Promise.resolve(!1),M=e=>I(e),$=()=>Promise.resolve(null),R=e=>$(e),A={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
+ 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 B(){/* @__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 Q({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,D]=d(""),W=a(),M=u(e=>(P(e),D(""),L(!0),new Promise(e=>{W.current=e})),[]),[R,Q]=d(!1),[S,G]=d({}),[V,Y]=d(""),_=a(),q=u(e=>{const t="string"==typeof e?{message:e}:e;return G(t),Y(t.defaultValue??""),Q(!0),new Promise(e=>{_.current=e})},[]);i(()=>{O=k,I=M,$=q},[k,M,q]);const H=(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)},J=e=>{L(!1),D(""),W.current?.(e)},U=e=>{if(e){const e=V.trim();if(!e&&!S.allowEmpty)return Q(!1),void _.current?.(null);Q(!1),_.current?.(e)}else Q(!1),_.current?.(null)},X=l.variant||(l.confirmLabel?.toLowerCase().includes("delete")||l.message.toLowerCase().includes("delete")?"danger":"info"),Z=A[X],ee=A["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(T.Provider,{value:k,children:[e,
7
+ /* @__PURE__ */f(F,{open:t,onClose:()=>H(c,!1),initialFocus:y,footer:/* @__PURE__ */m(h,{children:[
8
+ /* @__PURE__ */f("button",{ref:y,type:"button",onClick:()=>H(c,!1),className:z,children:l.cancelLabel||re.cancel}),
9
+ /* @__PURE__ */f("button",{type:"button",onClick:()=>H(c,!0),className:`px-4 py-2 text-sm font-medium rounded-lg ${Z.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 ${Z.icon}`,children:/* @__PURE__ */f(K,{})}),
11
+ /* @__PURE__ */m("div",{className:"flex-1",children:[
12
+ /* @__PURE__ */f("h2",{className:"text-base font-semibold text-gray-900",children:l.title||re.confirmTitle}),
13
+ /* @__PURE__ */f("p",{className:"mt-2 text-sm text-gray-600",children:l.message})]})]})}),
14
+ /* @__PURE__ */m(F,{open:C,onClose:()=>J(!1),initialFocus:null!=te?void 0:w,footer:/* @__PURE__ */m(h,{children:[
15
+ /* @__PURE__ */f("button",{ref:w,type:"button",onClick:()=>J(!1),className:z,children:E.cancelLabel||re.destructiveCancel}),
16
+ /* @__PURE__ */f("button",{type:"button",onClick:()=>J(!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:()=>J(!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(B,{})}),
18
+ /* @__PURE__ */m("div",{className:"flex gap-4",children:[
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
+ /* @__PURE__ */m("div",{className:"flex-1",children:[
21
+ /* @__PURE__ */f("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:E.title||re.destructiveTitle}),
22
+ /* @__PURE__ */f("p",{className:"mt-2 text-sm text-gray-600",children:E.message}),null!=te&&/* @__PURE__ */m(h,{children:[
23
+ /* @__PURE__ */m("p",{className:"mt-3 text-sm text-gray-700",children:[oe,
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=>D(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j===te&&J(!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(F,{open:R,onClose:()=>U(!1),title:S.title||re.promptTitle,footer:/* @__PURE__ */m(h,{children:[
27
+ /* @__PURE__ */f("button",{type:"button",onClick:()=>U(!1),className:z,children:S.cancelLabel||re.cancel}),
28
+ /* @__PURE__ */f("button",{type:"button",onClick:()=>U(!0),disabled:!S.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:S.confirmLabel||re.ok})]}),children:[S.message&&/* @__PURE__ */f("p",{className:"text-sm text-gray-600",children:S.message}),
29
+ /* @__PURE__ */f("input",{autoFocus:!0,type:"text",value:V,onChange:e=>Y(e.target.value),onKeyDown:e=>{"Enter"===e.key?U(!0):"Escape"===e.key&&U(!1)},onFocus:e=>e.target.select(),placeholder:S.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{Q as ConfirmProvider,F as Dialog,W as confirm,M as confirmDestructive,w as focusableIn,R as prompt,k as stopAfter,D as useConfirm,C as useFocusTrap,P as useScrollLock,N as useTabLayer};
@@ -1,4 +1,4 @@
1
- import{Modal as e}from"./chunk-ZLJCWBDF.js";import{keepsNativeMenu as a}from"./chunk-VDL2RLZG.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__ */
1
+ import{Modal as e}from"./chunk-VXBJNMAA.js";import{keepsNativeMenu as a}from"./chunk-UVZIPXIA.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
2
2
  return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
3
3
  /* @__PURE__ */n("div",{children:[
4
4
  /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
@@ -0,0 +1,27 @@
1
+ import{navVisible as e,isReachable as t,visibleChildren as n,isSection as r}from"./chunk-5A7MWTXX.js";import{useDismissPopupsOnOpen as a}from"./chunk-AFYQTVZO.js";import{glassStyle as l}from"./chunk-HZZNJHRH.js";import{Z_LAYERS as o}from"./chunk-X4FJ54PP.js";import{useShellStrings as s}from"./chunk-NCQLGQYR.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[$,T]=i(e||t||"");c(()=>{T(e||t||"")},[e,t]);const E=Boolean(t&&$===t&&$!==e),I=(E?a??h:h)?x(E?n:w,E?r:N,s):"bare",j=["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(" "),S={...k(I,A,_),...null==d?{width:u,height:p}:{width:d,height:d},...C};return $?/* @__PURE__ */f("span",{className:j,"data-brand-treatment":I,style:S,children:/* @__PURE__ */f("img",{src:$,alt:y?"":l,"data-brand-slot":o,className:"block max-h-full max-w-full",style:{objectFit:"contain"},onError:()=>T(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:`${j} rounded-md bg-gray-100 font-semibold`,style:S,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 T(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 E(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 j(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 S(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:S(e.type,r,l.path,n)})}return{key:`type:${e.type}`,title:e.type,rows:t,count:e.results.length,truncated:r}}),o=j("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 P(e,t,n=8){return[t,...e.filter(e=>!D(e,t))].slice(0,n)}function H(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 K(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 B=[];function z(e,t,n){const[r,a]=i([]),[l,o]=i(B),[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(B),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,...K(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(B),f("none"),u(!1)},[])}}var F=(e,t)=>`${e}-opt-${t}`;function U(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 O({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:F(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:U(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 Q="react-os-shell:open-global-search";function W(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(Q))}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(""),[$,T]=i(0),E=d(null),{results:S,truncatedTypes:D,loading:P,failure:H,reset:K}=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(Q,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(Q,t)}},[_]),a(_);const[B,U]=i(!1);_!==B&&(U(_),_&&(C(""),T(0),K())),c(()=>{_?setTimeout(()=>E.current?.focus(),50):C("")},[_]),c(()=>{T(0)},[S]);const W=L.length>=2,X=u(()=>W?M(S,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=j("actions",t.actions,e.actions??[]);return r&&n.push(r),n}({recent:x,favorites:k,actions:b},w),[W,S,D,n,b,L,x,k,w]),Z=u(()=>function(e){return e.flatMap(e=>e.rows)}(X),[X]),G=Math.min($,Math.max(Z.length-1,0)),J=p(),V=Z.length>0;c(()=>{_&&0!==Z.length&&document.getElementById(F(J,G))?.scrollIntoView?.({block:"nearest"})},[_,G,Z.length,J]);const Y=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:l(),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:E,type:"text",value:L,onChange:e=>{C(e.target.value),T(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),T(R(G,1,Z.length))):"ArrowUp"===e.key?(e.preventDefault(),T(R(G,-1,Z.length))):"Tab"===e.key&&Z.length>0?(e.preventDefault(),T(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&&Z[G]&&Y(Z[G])},placeholder:N,role:"combobox","aria-expanded":V,"aria-controls":V?J:void 0,"aria-activedescendant":V?F(J,G):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),P&&/* @__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:[P&&0===Z.length&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.searching}),!P&&"all"===H&&W&&/* @__PURE__ */f("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:w.searchFailed}),!P&&W&&0===Z.length&&"all"!==H&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.noResults}),V&&/* @__PURE__ */f(O,{sections:X,activeIdx:G,listId:J,label:w.listLabel,typeIcons:t,groupCount:w.groupCount,groupLabel:w.groupLabel,onHover:T,onPick:Y}),!P&&"some"===H&&W&&/* @__PURE__ */f("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:w.partialFailure}),!P&&!W&&0===Z.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,E as favoritesToResults,T as navPagesProvider,W as openGlobalSearch,$ as parsePageResultTarget,A as partitionNav,P as pushRecent,x as resolveBrandMarkTreatment,L as rowsContainRoute,H as sanitizeRecent,_ as visibleNavChildren,N as visibleSectionItems};
@@ -0,0 +1,10 @@
1
+ import{glassStyle as e,GLASS_DIVIDER as t}from"./chunk-HZZNJHRH.js";import{useHydrated as n,useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{onOverlayOpen as o,registerModalEscapeInterceptor as i,Z_LAYERS as l}from"./chunk-X4FJ54PP.js";import{createContext as a,forwardRef as u,useContext as c,useRef as s,useId as d,useState as p,useEffect as m,useMemo as h,useCallback as f}from"react";import{createPortal as g}from"react-dom";import{jsxs as y,jsx as x,Fragment as w}from"react/jsx-runtime";var b=/* @__PURE__ */new Set(["text","search","url","tel","email","password","number","date","datetime-local","month","week","time"]),v="data-native-context-menu";function k(e,t){return e&&"function"==typeof e.closest?e.closest(t):null}function C(e){const t=e;if(!t||"function"!=typeof t.closest)return!1;if(k(t,`[${v}]`))return!0;if(k(t,"textarea"))return!0;if(k(t,"img, picture, canvas, video, audio"))return!0;const n=k(t,"input");if(n){const e=(n.type||"text").toLowerCase();if(b.has(e))return!0}const r=k(t,"[contenteditable]");if(r){const e=(r.getAttribute("contenteditable")||"").toLowerCase();if(""===e||"true"===e||"plaintext-only"===e)return!0}return!1}var N=/* @__PURE__ */new Set(["http:","https:","mailto:","tel:","blob:"]);function L(e,t,n){const r=k(e,"a[href]"),o=(t||"").trim(),i=function(e,t){if(e&&"#"!==e)try{const n=new URL(e,t??("undefined"!=typeof document?document.baseURI:void 0));return N.has(n.protocol)?n.href:void 0}catch{return}}(r?.getAttribute("href"),n);return{kind:o?"selection":i?"link":"default",...o?{selectionText:o}:{},...i?{linkUrl:i}:{}}}function T(e){if(e.defaultPrevented)return!0;if(e.shiftKey)return!0;if("touch"===e.pointerType)return!0;return C(("function"==typeof e.composedPath?e.composedPath()[0]:void 0)??e.target)}function M(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function E(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function B(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function $(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),l=e-i/2;return l<n?n:l+i>r?Math.max(n,r-i):l}function P(e,t,n,r,o,i=!1,l=8){const a=t+o,u=e-o-n,c=u>=l;return i&&c?{left:u,flipped:!0}:a+n<=r-l?{left:a,flipped:!1}:c?{left:u,flipped:!0}:i?{left:l,flipped:!0}:{left:Math.max(l,r-l-n),flipped:!1}}function R(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var W=a(null),A=a(!1);function H({children:t,style:r,className:a="",onClose:u,minWidth:c=180,portal:f=!1}){const y=s(null),w=d(),[b,v]=p([]),k=s();m(()=>()=>clearTimeout(k.current),[]);const N=n(),L=h(()=>{const e=()=>clearTimeout(k.current);return{id:w,depth:0,path:b,open:(t,n)=>{e(),v(e=>M(e,t,n))},scheduleClose:t=>{e(),k.current=setTimeout(()=>v(e=>E(e,t)),200)},closeBelow:t=>{e(),v(e=>E(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),u?.()},root:y}},[w,b,u]);m(()=>{if(!u)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${w}"]`)||y.current&&!y.current.contains(e.target)&&u()},t=e=>{"Escape"===e.key&&u()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const n=o(u),r=i(()=>!1,()=>y.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),n(),r()}},[u,w]),m(()=>{const e=y.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const T=R(),B=/(^|[\s:])!?z-/.test(a),$=/* @__PURE__ */x("div",{ref:y,"data-popup-menu-tree":w,className:`fixed rounded-2xl ${"tight"===T?"py-1":"large"===T?"py-2":"py-1.5"} ${a}`,onContextMenu:e=>{C(e.target)||e.preventDefault()},style:{...B?{}:{zIndex:l.menu},minWidth:c,animation:"popup-in 0.12s ease-out",...e(),...r},children:/* @__PURE__ */x(W.Provider,{value:L,children:t})});return f?N?g($,document.body):null:$}function j(e,t,n,r=!1){const o=R(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":"max(0.25rem, calc(var(--menu-padding-y, 0.5rem) - 0.1rem))";return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 hover:bg-red-50":r?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-blue-50 hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:i,paddingBottom:i}}}var D=/* @__PURE__ */x("svg",{"aria-hidden":!0,className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */x("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});function F({kind:e,checked:t}){/* @__PURE__ */
2
+ return x("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&D}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&D})}var S=u(function({onClick:e,children:t,className:n="",danger:r,disabled:o,role:i,checked:l,tabIndex:a,id:u,onMouseEnter:s},d){const p=c(W),m=c(A),h=j(r,o,n),f=void 0===l?null:"menuitemradio"===i?"radio":"checkbox";/* @__PURE__ */
3
+ return y("button",{ref:d,id:u,role:"radio"===f?"menuitemradio":"checkbox"===f?"menuitemcheckbox":i??(m?"menuitem":void 0),"aria-checked":f?l:void 0,tabIndex:a,onClick:()=>{e?.(),p&&p.depth>0&&"checkbox"!==f&&p.closeTree()},onMouseEnter:()=>{p?.scheduleClose(p.depth),s?.()},disabled:o,className:h.className,style:h.style,children:[f&&/* @__PURE__ */x(F,{kind:f,checked:!!l}),t]})}),I=/* @__PURE__ */x("svg",{"aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */x("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})});function z(e){let t=l.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function q(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function U({label:t,icon:n,children:o,disabled:l,className:a="",minWidth:u=180,maxHeight:p}){const b=c(W),v=d(),k=s(null),N=s(null),L=s(),T=s(!1),M=`${v}-menu`;m(()=>()=>clearTimeout(L.current),[]);const E=b?.depth??0,B=b?.path[E],A=!!B&&B.key===v&&!l,H=f(e=>{if(!b||l||!k.current)return;clearTimeout(L.current),T.current=e;const t=k.current.getBoundingClientRect(),n=k.current.closest("[data-popup-submenu-panel]")??k.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,o=E>0&&(b.path[E-1]?.flipped??!1),i=P(r.left,r.right,u,window.innerWidth,4,o);b.open(E,{key:v,y:t.top,...i})},[b,l,E,v,u]),D=e=>{b?.closeBelow(E),k.current?.focus()};m(()=>{if(A)return i(e=>"Escape"===e.key&&(!(b&&b.path.length>E+1)&&(D(),!0)),()=>N.current)}),r(()=>{if(!A||!B)return;const e=()=>{const e=N.current;if(!e||!k.current)return;const t=k.current.closest("[data-popup-submenu-panel]")??k.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??k.current.getBoundingClientRect(),r=E>0&&(b?.path[E-1]?.flipped??!1),o=e.offsetWidth||u,i=P(n.left,n.right,o,window.innerWidth,4,r,8),l=e.offsetHeight,a=$(k.current.getBoundingClientRect().top+l/2,l,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${a}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),m(()=>{A&&T.current&&(T.current=!1,q(N.current)[0]?.focus())},[A]);const F=h(()=>b&&{...b,depth:E+1},[b,E]);if(!b)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const S=j(!1,l,a,A),U=R();/* @__PURE__ */
4
+ return y(w,{children:[
5
+ /* @__PURE__ */y("button",{ref:k,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":A,"aria-controls":A?M:void 0,disabled:l,"data-popup-submenu-row":!0,className:S.className,style:S.style,onClick:e=>{const t=0===e.detail;A?t&&q(N.current)[0]?.focus():H(t)},onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),H(!0))},onMouseEnter:()=>{l||(b.cancelClose(),A?b.closeBelow(E+1):(clearTimeout(L.current),L.current=setTimeout(()=>H(!1),120)))},onMouseLeave:()=>{clearTimeout(L.current),b.scheduleClose(E)},children:[n,
6
+ /* @__PURE__ */x("span",{className:"min-w-0 flex-1 truncate",children:t}),I]}),A&&g(
7
+ /* @__PURE__ */x("div",{ref:N,id:M,role:"menu","data-popup-menu-tree":b.id,"data-popup-submenu-panel":!0,className:"fixed rounded-2xl overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===U?"py-1":"large"===U?"py-2":"py-1.5"),style:{left:B.left,top:B.y,minWidth:u,maxHeight:void 0===p?"calc(100vh - 16px)":`min(${"number"==typeof p?`${p}px`:p}, calc(100vh - 16px))`,zIndex:z(b.root.current)+E+1,animation:(B.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...e()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=q(N.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),D())},onMouseEnter:()=>{b.cancelClose(),clearTimeout(L.current)},onMouseLeave:()=>b.scheduleClose(E+1),onContextMenu:e=>{C(e.target)||e.preventDefault()},children:/* @__PURE__ */x(W.Provider,{value:F,children:o})}),document.body)]})}function J(){const e=R();/* @__PURE__ */
8
+ return x("div",{className:`border-t ${t} ${"tight"===e?"my-0.5":"large"===e?"my-1.5":"my-1"} mx-3`})}function K({children:e}){const t=R(),n="tight"===t?"0.125rem":"large"===t?"0.375rem":"0.25rem";/* @__PURE__ */
9
+ return x("div",{className:"text-xs font-medium uppercase tracking-wide",style:{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:n,paddingBottom:n},children:e})}function Z({d:e,className:t="h-4 w-4 text-gray-400"}){/* @__PURE__ */
10
+ return x("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */x("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{F as MenuCheckMark,Z as MenuIcon,A as MenuSemanticsContext,v as NATIVE_MENU_ATTR,H as PopupMenu,J as PopupMenuDivider,S as PopupMenuItem,K as PopupMenuLabel,U as PopupSubmenu,$ as clampMenuTop,E as closeMenuBelow,L as describeContextTarget,j as itemLook,C as keepsNativeMenu,T as leavesContextMenuAlone,P as menuPanelLeft,M as openMenuLevel,B as resolveMenuLevels};
@@ -0,0 +1 @@
1
+ var r="4.166.0",a=r;export{a as APP_VERSION,r as VERSION};