efficient-shell 14.7.0 → 15.2.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 +3 -2
- package/dist/Browser-42QAXKYW.js +44 -0
- package/dist/Calculator-C7APPCLE.js +29 -0
- package/dist/CurrencyConverter-VFTDSYQ3.js +21 -0
- package/dist/{Files-EQBPHAUH.js → Files-OAVWF6EW.js} +68 -68
- package/dist/Notepad-LNNSVEFG.js +24 -0
- package/dist/PdfViewer-ADPTYOAO.js +1 -0
- package/dist/PomodoroTimer-AGSHX2JO.js +91 -0
- package/dist/{Preview-ZHZ4CEWF.js → Preview-GDNUQKGN.js} +40 -40
- package/dist/Sidebar-SWLVNJ6L.js +44 -0
- package/dist/{Stock-S3LKKT3K.js → Stock-NNDDNQBJ.js} +5 -5
- package/dist/{Weather-KEOJ3BBV.js → Weather-NGQALCXO.js} +19 -19
- package/dist/{WorldClock-GKMDG2KU.js → WorldClock-LX4BQPZJ.js} +7 -7
- package/dist/ai/index.js +118 -118
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/FlowChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/{chunk-P5J7G7OV.js → chunk-26I3OTGP.js} +1 -1
- package/dist/{chunk-RXCBSQA2.js → chunk-2M3KB4RH.js} +1 -1
- package/dist/chunk-2MUZFHZW.js +6 -0
- package/dist/{chunk-727NHWCZ.js → chunk-2QUACZ6O.js} +1 -1
- package/dist/{chunk-3ZJAQSFS.js → chunk-32HTOZFT.js} +3 -3
- package/dist/{chunk-OYQWBJ37.js → chunk-3CIJFWB4.js} +1 -1
- package/dist/chunk-3HPCQMYH.js +15 -0
- package/dist/{chunk-TBDILJ6G.js → chunk-3TVMQCYR.js} +1 -1
- package/dist/{chunk-MPC3CHAO.js → chunk-4H4HJIWI.js} +1 -1
- package/dist/chunk-52YTUQW3.js +2 -0
- package/dist/{chunk-DNPAYNNU.js → chunk-5JQCWXIQ.js} +1 -1
- package/dist/{chunk-5SQHRDFC.js → chunk-5R25GNE2.js} +2 -2
- package/dist/{chunk-T46I4YOI.js → chunk-6F3XQJR6.js} +1 -1
- package/dist/{chunk-G3TC2GIA.js → chunk-7FYTL6SD.js} +1 -1
- package/dist/{chunk-YX3JD6PA.js → chunk-7M7GKYHS.js} +5 -5
- package/dist/{chunk-HTBACICQ.js → chunk-7QFXUNFA.js} +6 -6
- package/dist/{chunk-XIX72C7K.js → chunk-7T6NWAPG.js} +1 -1
- package/dist/chunk-7YJBWOQG.js +2 -0
- package/dist/{chunk-WBUAO7T7.js → chunk-7ZJ7VK2N.js} +1 -1
- package/dist/{chunk-7WF6LFOJ.js → chunk-ABAUJLI4.js} +1 -1
- package/dist/{chunk-DBBOD5QW.js → chunk-ABRCV7DQ.js} +1 -1
- package/dist/{chunk-AH5MLH54.js → chunk-AVUH35GW.js} +1 -1
- package/dist/{chunk-GY7MJTIZ.js → chunk-BMZL5BHA.js} +1 -1
- package/dist/{chunk-QCLKRFL4.js → chunk-BN37AISA.js} +1 -1
- package/dist/{chunk-47BGAQWD.js → chunk-C5Q4AKXO.js} +1 -1
- package/dist/chunk-CIT4YPEO.js +8 -0
- package/dist/{chunk-JPVD3VS7.js → chunk-CMC25URA.js} +6 -6
- package/dist/{chunk-24BF22NF.js → chunk-D3L2QCGF.js} +1 -1
- package/dist/chunk-DTZDOXK3.js +19 -0
- package/dist/{chunk-UYUNREAL.js → chunk-DXTRHNP4.js} +3 -3
- package/dist/{chunk-ZA6ANC2D.js → chunk-ECZEJ6BE.js} +6 -6
- package/dist/chunk-EQDYCSUX.js +13 -0
- package/dist/{chunk-XNKNX5L3.js → chunk-FM5ASDVN.js} +1 -1
- package/dist/{chunk-RA5G4K3N.js → chunk-FYHUCRLU.js} +1 -1
- package/dist/{chunk-JU722M5V.js → chunk-FZZBBZXZ.js} +6 -6
- package/dist/{chunk-U75MSD4F.js → chunk-GBCLIWUQ.js} +1 -1
- package/dist/{chunk-NRX6JQV5.js → chunk-HBAATSUS.js} +1 -1
- package/dist/{chunk-EOYKUV2U.js → chunk-HKXP3JJ5.js} +1 -1
- package/dist/{chunk-6RU2PGQK.js → chunk-HMTZP7NJ.js} +1 -1
- package/dist/chunk-HVWRF7N4.js +23 -0
- package/dist/chunk-IBPJJO4N.js +28 -0
- package/dist/{chunk-7D2QZ6JA.js → chunk-IIUFCTT6.js} +1 -1
- package/dist/{chunk-EHNW3UNC.js → chunk-IJWRJPX6.js} +6 -6
- package/dist/{chunk-TFQC67XR.js → chunk-ILH7RDAD.js} +9 -9
- package/dist/{chunk-IVEM2BPC.js → chunk-J43RRDEP.js} +1 -1
- package/dist/{chunk-ION3XGLN.js → chunk-JE4BGFDJ.js} +1 -1
- package/dist/{chunk-P3XXFQG5.js → chunk-JFTLFF52.js} +3 -3
- package/dist/chunk-JHEHW5BE.js +5 -0
- package/dist/{chunk-EHPY3BFC.js → chunk-JJ5W4BRW.js} +1 -1
- package/dist/{chunk-U5OSLUDU.js → chunk-JVITCC65.js} +1 -1
- package/dist/{chunk-PTLVNC3V.js → chunk-K3OLOLFT.js} +6 -6
- package/dist/{chunk-I7WAOKU2.js → chunk-KKZXGWSX.js} +2 -2
- package/dist/chunk-KWBYE5MN.js +9 -0
- package/dist/{chunk-Y6FULJWJ.js → chunk-L664TIIV.js} +6 -6
- package/dist/{chunk-2RLWGWOU.js → chunk-LFGJUJRZ.js} +13 -13
- package/dist/{chunk-3L7BEEBW.js → chunk-LKNDLXL3.js} +1 -1
- package/dist/{chunk-EN3GYSCE.js → chunk-M4NT6HGJ.js} +1 -1
- package/dist/{chunk-NHALP3MW.js → chunk-M5JEYZ3A.js} +4 -4
- package/dist/chunk-M6ODRWTM.js +7 -0
- package/dist/chunk-M6T7N4SN.js +14 -0
- package/dist/{chunk-2TNG32QT.js → chunk-MDGM5NUO.js} +8 -8
- package/dist/chunk-MQERW3QR.js +3 -0
- package/dist/{chunk-LJS7UF3M.js → chunk-NBV3XK3Q.js} +2 -2
- package/dist/{chunk-2XDO7FZC.js → chunk-NJJG2VAW.js} +12 -12
- package/dist/chunk-NTVACRKD.js +4 -0
- package/dist/chunk-NXPIX7NO.js +2 -0
- package/dist/chunk-OCITNQGF.js +11 -0
- package/dist/{chunk-7OVMWXFM.js → chunk-OCKOZV46.js} +1 -1
- package/dist/{chunk-UGA5NGW4.js → chunk-OEZC5N6J.js} +1 -1
- package/dist/{chunk-EDRELF6L.js → chunk-PAD65HG7.js} +1 -1
- package/dist/{chunk-MKHOXO5O.js → chunk-PYGXSGXC.js} +1 -1
- package/dist/{chunk-BUUAALHH.js → chunk-QBR73AJX.js} +20 -20
- package/dist/{chunk-Y5RTVKMB.js → chunk-QI2LJ7OL.js} +9 -9
- package/dist/{chunk-DO6P6LYU.js → chunk-QIAJ3QNV.js} +1 -1
- package/dist/{chunk-4BRVZAIW.js → chunk-QJY52ZHG.js} +1 -1
- package/dist/{chunk-R36VZ35L.js → chunk-QMUW35QL.js} +6 -6
- package/dist/chunk-QQ6TGD7K.js +92 -0
- package/dist/chunk-QVGASI5H.js +9 -0
- package/dist/chunk-QZYV4TDD.js +1 -0
- package/dist/{chunk-XJK6VNXV.js → chunk-S3F2TY7X.js} +1 -1
- package/dist/chunk-S6IW2F4J.js +8 -0
- package/dist/chunk-SH7PJC4P.js +1 -0
- package/dist/{chunk-HAEZUUDT.js → chunk-SKPAIZSC.js} +3 -3
- package/dist/{chunk-Y5YVKUM4.js → chunk-SXNT73VT.js} +19 -19
- package/dist/chunk-T43ATI2N.js +6 -0
- package/dist/{chunk-4SFWQPOB.js → chunk-T65TAQLW.js} +7 -7
- package/dist/{chunk-DOJSWVBX.js → chunk-TB7BO2XS.js} +6 -6
- package/dist/{chunk-NC5FIFAY.js → chunk-TVMDDQJP.js} +1 -1
- package/dist/{chunk-GVAVIYE6.js → chunk-TWSROAS7.js} +1 -1
- package/dist/{chunk-EHSK43WG.js → chunk-UA7SWROJ.js} +8 -8
- package/dist/chunk-UMLXFQVC.js +1 -0
- package/dist/{chunk-6X32SWQI.js → chunk-VIBGF2HJ.js} +1 -1
- package/dist/{chunk-WYAKASF3.js → chunk-VNKLIWNQ.js} +1 -1
- package/dist/{chunk-2SOGTOUQ.js → chunk-VQ3OSYTA.js} +4 -4
- package/dist/{chunk-EEAOFYW5.js → chunk-VTYALYW4.js} +12 -12
- package/dist/chunk-WHHHECBC.js +2 -0
- package/dist/chunk-XQMVECQM.js +15 -0
- package/dist/{chunk-6AYAB5FN.js → chunk-YVI2XJCB.js} +5 -5
- package/dist/{chunk-ZEGCKIAL.js → chunk-YX4QGW7Z.js} +3 -3
- package/dist/chunk-Z2MP46QJ.js +1 -0
- package/dist/chunk-ZC2FZLYX.js +4 -0
- package/dist/{chunk-SP4S4HUJ.js → chunk-ZQWKVLSY.js} +13 -13
- package/dist/{chunk-5O4HMXPQ.js → chunk-ZS36DB4X.js} +2 -2
- package/dist/chunk-ZUQ72WER.js +7 -0
- package/dist/{chunk-IZ6D4KGR.js → chunk-ZYWLX5EK.js} +3 -3
- package/dist/{chunk-CXEELIRW.js → chunk-ZZKBCNK6.js} +9 -9
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Gantt.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ListToolbar.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/data/statusColumn.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/SearchInput.js +1 -1
- package/dist/forms/Segmented.d.ts +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/UnitMenu.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +662 -662
- package/dist/map/index.js +10 -10
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.d.ts +4 -5
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/FloatingBar.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.d.ts +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/tokens/spacing.d.ts +4 -3
- package/dist/tokens/spacing.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +6 -4
- package/dist/value-index.json +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Browser-HX3QY73A.js +0 -44
- package/dist/Calculator-TJDZOTG7.js +0 -29
- package/dist/CurrencyConverter-JL5JIVJG.js +0 -21
- package/dist/Notepad-5BQUYQNJ.js +0 -24
- package/dist/PdfViewer-FWGHFO4N.js +0 -1
- package/dist/PomodoroTimer-7W5ZHKUL.js +0 -91
- package/dist/Sidebar-2TYZENQL.js +0 -44
- package/dist/chunk-4DNPUG3T.js +0 -7
- package/dist/chunk-5IXCLPVZ.js +0 -1
- package/dist/chunk-A3VLZZHJ.js +0 -9
- package/dist/chunk-AJPQJ7TC.js +0 -6
- package/dist/chunk-ALZHFQRX.js +0 -4
- package/dist/chunk-AW7TOB6N.js +0 -1
- package/dist/chunk-CHDGSJLV.js +0 -8
- package/dist/chunk-DTFX624I.js +0 -8
- package/dist/chunk-EBODRYXS.js +0 -19
- package/dist/chunk-ERI63O4A.js +0 -28
- package/dist/chunk-FFPIT2LB.js +0 -3
- package/dist/chunk-GRZPIV2G.js +0 -14
- package/dist/chunk-HOPHOF2C.js +0 -2
- package/dist/chunk-HX5QSQ2C.js +0 -2
- package/dist/chunk-M5IZ7QLQ.js +0 -7
- package/dist/chunk-MEP6CZJ3.js +0 -2
- package/dist/chunk-MNZAAQLH.js +0 -15
- package/dist/chunk-MYH5H43C.js +0 -1
- package/dist/chunk-NDCS4COQ.js +0 -11
- package/dist/chunk-PWON7O3N.js +0 -9
- package/dist/chunk-RTK77DMP.js +0 -15
- package/dist/chunk-UZATF4OZ.js +0 -92
- package/dist/chunk-VUBDHFG5.js +0 -4
- package/dist/chunk-W4IH3BE3.js +0 -23
- package/dist/chunk-W6REY3SV.js +0 -5
- package/dist/chunk-Y7D2CZ4H.js +0 -13
- package/dist/chunk-ZSVU44OB.js +0 -6
- /package/dist/{chunk-5YTZBYG4.js → chunk-LPQQNPH5.js} +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import{computeMaximizedBox as e,isSidebarStripReserved as t,boxFillsWorkArea as n,readAlwaysMaximizedFlag as r,WORK_AREA_CHANGED_EVENT as o,scrollerIsFluid as i,growBoxToWidth as a,widthToFit as s,navIcons as l}from"./chunk-4LXCCZDM.js";import{reportBoundaryError as c}from"./chunk-KNUR2UEG.js";import{isStaleChunkError as u}from"./chunk-JDCM2VHG.js";import{Result as d}from"./chunk-PSVGB7KT.js";import{WindowInsetContext as h,NO_WINDOW_DRAG as m}from"./chunk-YI4T5I5D.js";import{CMD_Z as f,CMD_SHIFT_Z as p}from"./chunk-TTD2M6RF.js";import{CopyButton as w}from"./chunk-TJ5YMXVB.js";import{confirm as y}from"./chunk-NJJG2VAW.js";import{useModalDragAside as g}from"./chunk-EIFNESXS.js";import{ItemCount as v}from"./chunk-ABAUJLI4.js";import{isInOverlayOver as b}from"./chunk-CJ4OEY3T.js";import{dialogA11y as x}from"./chunk-VWGWZY7A.js";import{ColoredBadge as k}from"./chunk-VIBGF2HJ.js";import{ROW_HEIGHTS as E}from"./chunk-SH7PJC4P.js";import{parseOption as M}from"./chunk-YPXONNBV.js";import{LoadingSpinner as C}from"./chunk-4PJFL26P.js";import{useShellAuth as S}from"./chunk-2QY5BJLA.js";import{useIsMobile as N,useIsPhone as L}from"./chunk-UGTRSRIW.js";import{useShellPrefs as T}from"./chunk-POBVGDZP.js";import{activationOrder as z,activeListeners as A,ModalActionsContext as D,subscribeActive as P,getActiveModalId as I,KEY_ACTIVATED_SELECTOR as R}from"./chunk-F3ZOO23R.js";import{DropdownMenu as W}from"./chunk-M6ODRWTM.js";import{focusableIn as $}from"./chunk-DWGYC7OD.js";import{StatusBadge as O}from"./chunk-PAD65HG7.js";import{PopupMenu as K,PopupMenuItem as j,PopupMenuDivider as F,PopupMenuLabel as B}from"./chunk-3HPCQMYH.js";import{Button_default as H}from"./chunk-7YJBWOQG.js";import{Icon as Y}from"./chunk-ISVODSRP.js";import{LoadingSpinner as q}from"./chunk-R2VKEMZH.js";import{createShellPortal as U}from"./chunk-52YTUQW3.js";import{Z_LAYERS as X}from"./chunk-62LW225J.js";import{shellHttp as V,isShellHttpConfigured as J}from"./chunk-STKJA4PV.js";import{fitBoxScale as G,fitFrameStyle as _}from"./chunk-M6UKCZHT.js";import{buttonClasses as Q}from"./chunk-UQYNPYF4.js";import{runEscapeInterceptors as Z}from"./chunk-TWVUQUUD.js";import{useShellStrings as ee}from"./chunk-NRHG4R2Q.js";import{createContext as te,createElement as ne,useContext as re,Component as oe,useLayoutEffect as ie,useRef as ae,useEffect as se,useState as le,useSyncExternalStore as ce,useCallback as ue,isValidElement as de,Fragment as he,Children as me,cloneElement as fe,useMemo as pe,useId as we,useReducer as ye,Suspense as ge}from"react";import{jsxs as ve,jsx as be,Fragment as xe}from"react/jsx-runtime";import{useLocation as ke}from"react-router-dom";import{useQueryClient as Ee,useQuery as Me}from"@tanstack/react-query";function Ce(e){return"component"in e}function Se(e){return"endpoint"in e}var Ne={};function Le(e){Ne=e}var Te=new Proxy({},{get:(e,t)=>Ne[t],has:(e,t)=>t in Ne,ownKeys:()=>Object.keys(Ne),getOwnPropertyDescriptor(e,t){if(t in Ne)return{configurable:!0,enumerable:!0,value:Ne[t]}}});function ze(){return J()}var Ae=V,De=te({});function Pe({value:e,children:t}){return ne(De.Provider,{value:e},t)}function Ie(){return re(De)}var Re=te(null);function We(){return re(Re)?.pageSearch??""}var $e=null,Oe=/* @__PURE__ */new Set;function Ke(e){$e!==e&&($e=e,Oe.forEach(e=>e()))}function je(){return $e}function Fe(e){return Oe.add(e),()=>{Oe.delete(e)}}var Be=null;function He(e){Be=e}function Ye({error:e,onReload:t}){const n=u(e);/* @__PURE__ */
|
|
2
|
+
return ve("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 py-12 text-center",children:[
|
|
3
|
+
/* @__PURE__ */be(Y,{name:"warning",className:"h-8 w-8 text-amber-500",strokeWidth:1.5}),
|
|
4
|
+
/* @__PURE__ */ve("div",{className:"min-w-0",children:[
|
|
5
|
+
/* @__PURE__ */be("p",{className:"text-sm font-medium text-gray-700",children:n?"This window needs the latest version of the app":"This window crashed"}),
|
|
6
|
+
/* @__PURE__ */be("p",{className:"mt-1 text-xs text-gray-400 max-w-sm break-words",children:n?"A new version was deployed while this tab was open. Reload the page to pick it up.":e.message||String(e)})]}),
|
|
7
|
+
/* @__PURE__ */be("button",{type:"button",onClick:n?()=>window.location.reload():t,className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg",children:n?"Reload page":"Reload window"})]})}var qe=class extends oe{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:new Error(String(e))}}componentDidCatch(e,t){console.error("[efficient-shell] window content crashed:",e,t.componentStack),c(e)}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):/* @__PURE__ */be(Ye,{error:e,onReload:this.reset}):this.props.children}},Ue=te(null),Xe="text-xs text-gray-500 hover:text-gray-700 disabled:opacity-40 disabled:hover:text-gray-500 disabled:cursor-default";function Ve({className:e="",auto:t=!1}){const n=re(Ue),r=ee().undo,o=n?.claimOwnMount;if(ie(()=>{if(!t&&o)return o(!0),()=>o(!1)},[t,o]),!n||!n.enabled)return null;const{undo:i,redo:a,canUndo:s,canRedo:l,undoLabel:c,redoLabel:u}=n;/* @__PURE__ */
|
|
8
|
+
return ve("div",{className:`flex items-center gap-2 ${e}`,"data-undo-controls":t?"shell":"form",children:[
|
|
9
|
+
/* @__PURE__ */be("button",{type:"button",onClick:i,disabled:!s,title:s?r.undoStep(c??"",f):r.nothingToUndo,className:Xe,children:r.undo}),
|
|
10
|
+
/* @__PURE__ */be("button",{type:"button",onClick:a,disabled:!l,title:l?r.redoStep(u??"",p):r.nothingToRedo,className:Xe,children:r.redo})]})}var Je=/* @__PURE__ */new Set([408,429]);function Ge(e){const t=e?.response?.status;return"number"==typeof t?t:void 0}function _e(e){const t=Ge(e);return null!=t&&(t>=400&&t<500&&!Je.has(t))}function Qe(e,t){return!_e(t)&&e<3}function Ze(e){if("page"!==e.type)return!0;const t=e.route?Te[e.route]:void 0;if(!t||!Ce(t))return!0;const n=t;return!n.widget&&!n.utility}function et(e){const t=e.route?Te[e.route]:void 0;if(!t||!Ce(t))return;const n=t;return n.taskbarGroup?n.taskbarGroup:{key:e.route,label:n.label,icon:e.route}}var tt=(e,t)=>!!t&&"page"===e.type&&e.route===t;var nt="flex-1 min-h-0";function rt(){const e=ee().record;/* @__PURE__ */
|
|
11
|
+
return be(q,{label:e.loading,padding:"",className:nt})}function ot(e){return e??void 0}function it({isPending:e,isFetching:t,enabled:n=!0,error:r,onRetry:o}){const i=ee().record;if(t||e&&n)/* @__PURE__ */return be(rt,{});if(r){const e=Ge(r);if(401===e)/* @__PURE__ */
|
|
12
|
+
return be(d,{status:"warning",title:i.signInRequired,subTitle:i.signInBody,className:nt});if(403===e)/* @__PURE__ */
|
|
13
|
+
return be(d,{status:"403",className:nt});if(404===e||410===e)/* @__PURE__ */
|
|
14
|
+
return be(d,{status:"404",title:i.notFound,className:nt});const t=null==e||408===e||429===e||e>=500;/* @__PURE__ */
|
|
15
|
+
return be(d,{status:"500",title:i.loadFailed,subTitle:t?i.checkConnection:i.rejected,extra:t?/* @__PURE__ */be(H,{variant:"secondary",size:"sm",onClick:o,children:i.retry}):void 0,className:nt})}/* @__PURE__ */
|
|
16
|
+
return be(d,{status:"404",title:i.notFound,className:nt})}function at({entity:e,children:t,...n}){return null!=e?/* @__PURE__ */be(xe,{children:t(e)}):/* @__PURE__ */be(it,{...n})}var st=/^[a-z]+(?:-[a-z]+)*-\d{13}$/;function lt(e){return"string"==typeof e&&(e.startsWith("new-")||st.test(e))}function ct(e){if(lt(e.entityId))return!0;const t=e.entitySnapshot;return!(!t||"object"!=typeof t||!t._new&&!t._duplicate)}var ut=te({openWindows:[],openEntity:()=>{},openPage:()=>{},reorderWindows:()=>{},closeEntity:()=>{},minimize:()=>{},items:[],restore:()=>{},remove:()=>{},restoreIfMinimized:()=>!1,openItems:[]}),dt=te(null);function ht(e){const t=re(dt),n=ae(null);null===n.current&&(n.current=/* @__PURE__ */Symbol("window-dirty")),ie(()=>{if(t)return t(n.current,e)},[t,e]),se(()=>{if(!t||!e)return;const n=e=>{e.preventDefault(),e.returnValue=""};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t,e])}function mt(){const e=ae(/* @__PURE__ */new Map),[t,n]=le(!1);return{dirty:t,registerDirty:ue((t,r)=>{const o=()=>{const t=Array.from(e.current.values()).some(Boolean);n(e=>e===t?e:t)};return e.current.set(t,r),o(),()=>{e.current.delete(t),o()}},[])}}function ft(){return re(ut)}function pt(e){if("page"!==e.type&&ct(e))return null;const t="page"===e.type?"page":e.entityType||"",n="page"===e.type?e.route||"":e.entityId||"";return t&&n?{entityType:t,entityId:n,label:e.label}:null}function wt({item:e,onClose:t,accentRgb:n}){const{dirty:r,registerDirty:o}=mt(),i=Te[e.route];if(!i||!Ce(i))return null;const a=i,s=a.component;/* @__PURE__ */
|
|
17
|
+
return be(ho,{open:!0,onClose:t,icon:l[e.route],title:a.label,size:a.size||"2xl",dirty:r,allowPinOnTop:a.allowPinOnTop,initialPosition:a.initialPosition,widget:a.widget,compact:a.compact,appStyle:a.appStyle,flushBody:a.flushBody,autoHeight:a.autoHeight,autoMinHeight:a.autoMinHeight,autoWidth:a.autoWidth,dimensions:a.dimensions,windowKey:e.id,openedFromKey:e.openedFrom,accentRgb:n,children:/* @__PURE__ */be(dt.Provider,{value:o,children:/* @__PURE__ */be(ge,{fallback:/* @__PURE__ */be("div",{className:"flex items-center justify-center py-12",children:/* @__PURE__ */be(C,{})}),children:/* @__PURE__ */be(s,{})})})})}function yt({entityType:e,entityId:t,label:n}){const r=ee(),o=Ee(),{data:i}=Me({queryKey:["my-profile-sidebar"],enabled:ze(),queryFn:()=>Ae.get("/auth/me/").then(e=>e.data)}),a=(i?.preferences||{}).favorite_documents||[],s=a.some(n=>n.entityType===e&&n.entityId===t);/* @__PURE__ */
|
|
18
|
+
return be("button",{onClick:()=>{const r=s?a.filter(n=>!(n.entityType===e&&n.entityId===t)):[...a,{entityType:e,entityId:t,label:n}];Ae.patch("/auth/me/",{preferences:{favorite_documents:r}}).then(()=>{o.invalidateQueries({queryKey:["my-profile-sidebar"]})})},title:s?r.taskbar.removeFromDesktop:r.taskbar.addToDesktop,className:"shrink-0 transition-colors "+(s?"text-yellow-500 hover:text-yellow-600":"text-gray-300 hover:text-yellow-400"),children:/* @__PURE__ */be(Y,{name:"star",className:"h-4 w-4",fill:s?"currentColor":"none",strokeWidth:1.5})})}var gt=/* @__PURE__ */new Set,vt=()=>"hidden";function bt({item:e,onClose:t,onMinimize:n,accentRgb:r}){const o=Te[e.entityType];if(!o||!Se(o))return null;const i=o,[a,s]=le(!1),{dirty:c,registerDirty:u}=mt(),d=i.queryKey||i.endpoint.replace(/^\/|\/$/g,"").split("/").pop()||e.entityType,h=e.entitySnapshot?._duplicate,m=lt(e.entityId),f=Ie(),p=(w=e.id,ce(P,()=>{const e=Zn.get(w);return null!=e&&Xn.has(e)}));var w;const y=!i.selfFetching&&!h&&!m&&ze(),g=Me({queryKey:[d,e.entityId],queryFn:()=>{return Ae.get((t=i.endpoint,n=String(e.entityId),`${t}${encodeURIComponent(n)}/`)).then(e=>e.data);var t,n},initialData:ot(e.entitySnapshot),initialDataUpdatedAt:0,enabled:y,staleTime:0,refetchOnWindowFocus:()=>{return void 0===(e=f.entityRefetchOnWindowFocus)||("function"==typeof e?e():e);var e},refetchOnMount:"always",refetchInterval:e=>function(e,t={}){if(_e(e))return!1;if(t.minimized)return!1;const n=t.hostInterval;if(void 0===n)return 6e4;const r="function"==typeof n?n():n;return"number"==typeof r&&r>0&&r}(e.state.error,{minimized:p,hostInterval:f.entityRefetchInterval}),refetchIntervalInBackground:!1,retry:Qe}),v=g.data,b=g.refetch;se(()=>{var t;if(y)return t=t=>{t!==e.id||gt.has(t)||b({cancelRefetch:!1})},fr.add(t),()=>{fr.delete(t)}},[b,e.id,y]);const x=ue(()=>{a&&!c?s(!1):t()},[a,c,t]),k=(i.useEdit??vt)(v??null),E=!i.useEdit||m||h?void 0:{state:k,editing:a,onEdit:()=>s(!0),onDiscard:()=>s(!1)},M=i.selfFetching?e.label:v?i.title(v,a,s):e.label,S=i.icon,N=S?l[S]:null,L=M,T=!i.selfFetching&&v&&i.footer&&!h?i.footer(v):void 0;return i.rendersOwnModal?i.selfFetching?/* @__PURE__ */be(ge,{fallback:/* @__PURE__ */be(C,{}),children:i.render(v??e.entitySnapshot,t,e.entityId,a,s)}):null!=v?/* @__PURE__ */be(ge,{fallback:/* @__PURE__ */be(ho,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */be(rt,{})}),children:i.render(v,t,e.entityId,a,s)}):/* @__PURE__ */be(ho,{open:!0,onClose:t,title:e.label,size:i.size||"2xl",children:/* @__PURE__ */be(it,{isPending:g.isPending,isFetching:g.isFetching,enabled:y,error:g.error,onRetry:b})}):/* @__PURE__ */be(ho,{open:!0,onClose:x,onMinimize:n,initialBox:e.savedBox,icon:N,title:L,footer:T,copyText:e.label,windowKey:e.id,openedFromKey:e.openedFrom,size:i.size||"2xl",dirty:c,editing:a||m||h,edit:E,dimensions:i.dimensions,autoHeight:i.autoHeight,autoMinHeight:i.autoMinHeight,autoWidth:i.autoWidth,appStyle:i.appStyle,flushBody:i.flushBody,accentRgb:r,children:/* @__PURE__ */be(dt.Provider,{value:u,children:/* @__PURE__ */be(ge,{fallback:/* @__PURE__ */be(rt,{}),children:i.selfFetching?i.render(null,t,e.entityId,a,s):/* @__PURE__ */be(at,{entity:v,isPending:g.isPending,isFetching:g.isFetching,enabled:y,error:g.error,onRetry:b,children:n=>i.render(n,t,e.entityId,a,s)})})})})}function xt(e){return document.querySelector(`[data-modal-panel][data-window-key="${e}"]`)}function kt(e){return document.querySelector(`[data-modal-panel][data-window-root][data-window-owner="${e}"]`)}function Et(e){const t=xt(e),n=t??kt(e);if(!n)return;if(t&&!Tr(t))return r=e,void window.dispatchEvent(new CustomEvent("modal-reveal",{detail:{windowKey:r}}));var r;const o=n.getAttribute("data-modal-id");o&&pr(o)}function Mt(){const e=I();if(!e)return;const t=document.querySelector(`[data-modal-panel][data-modal-id="${e}"]`);return t?.getAttribute("data-window-key")??void 0}var Ct=/* @__PURE__ */new Map;function St(){const e=Mt();if(e)return Ct.get(e)}function Nt(e){const t=document.querySelectorAll("[data-modal-panel]");for(const n of Array.from(t)){const t=n.querySelector("[data-window-title]");if(t?.textContent?.includes(e))return n}return null}var Lt="rosh-peek-style",Tt=X.peek,zt=X.taskbarPreview;function At(e){"undefined"!=typeof document&&(!function(){if("undefined"==typeof document||document.getElementById(Lt))return;const e=document.createElement("style");e.id=Lt,e.textContent=`body.rosh-peeking [data-modal-panel]{transition:opacity .18s ease}body.rosh-peeking [data-modal-panel]:not([data-peek-focus]){opacity:.4}body.rosh-peeking [data-modal-panel][data-peek-focus]{opacity:1}body.rosh-peeking [data-modal-panel][data-peek-focus]:not([data-pinned-top]){z-index:${Tt}!important}html.rosh-reduce-transparency body.rosh-peeking [data-modal-panel]:not([data-peek-focus]){opacity:.92}@media (prefers-reduced-motion:reduce){body.rosh-peeking [data-modal-panel]{transition:none}}`,document.head.appendChild(e)}(),document.querySelectorAll("[data-modal-panel][data-peek-focus]").forEach(e=>e.removeAttribute("data-peek-focus")),e&&e.setAttribute("data-peek-focus",""),document.body.classList.toggle("rosh-peeking",!!e))}function Dt(){"undefined"!=typeof document&&(document.body.classList.remove("rosh-peeking"),document.querySelectorAll("[data-modal-panel][data-peek-focus]").forEach(e=>e.removeAttribute("data-peek-focus")))}function Pt({id:e,label:t,maxW:n,maxH:r,titleAbove:o=!1,onClick:i,onClose:a}){const s=ee(),l=ae(null),[c,u]=le({w:n,h:Math.round(.75*r)}),[d,h]=le(!1);return ie(()=>{const o=l.current;if(!o)return;const i=xt(e)??Nt(t);if(!i)return void h(!1);const a=i.getBoundingClientRect();if(0===a.width||0===a.height)return void h(!1);const s=G({width:n,height:r},a),c=Math.max(80,Math.round(a.width*s)),d=Math.max(60,Math.round(a.height*s));u({w:c,h:d}),h(!0);const m=i.cloneNode(!0);m.style.position="absolute",m.style.top="0",m.style.left="0",m.style.right="auto",m.style.bottom="auto",m.style.width=a.width+"px",m.style.height=a.height+"px";const f=_(a.width,s);return Object.assign(m.style,{transform:f.transform??"",transformOrigin:f.transformOrigin}),m.style.pointerEvents="none",m.style.animation="none",m.style.zIndex="auto",m.removeAttribute("data-modal-panel"),m.removeAttribute("data-modal-id"),m.removeAttribute("data-window-key"),m.removeAttribute("role"),m.removeAttribute("aria-labelledby"),m.removeAttribute("aria-label"),m.querySelectorAll('[role="dialog"], [data-portal]').forEach(e=>{e.style.display="none"}),o.innerHTML="",o.appendChild(m),()=>{o.innerHTML=""}},[e,t,n,r]),/* @__PURE__ */ve("div",{style:{width:c.w,height:c.h},className:"relative rounded-md overflow-hidden bg-white/95 border border-line-strong shadow-(--elevation-panel) cursor-pointer ring-2 ring-transparent group-hover:ring-blue-400 transition shrink-0",onClick:i,children:[
|
|
19
|
+
/* @__PURE__ */be("div",{ref:l,className:"absolute inset-0 z-0 overflow-hidden"}),!d&&/* @__PURE__ */ve("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-gray-400 bg-gray-50",children:[
|
|
20
|
+
/* @__PURE__ */be(Y,{name:"window",className:"h-6 w-6",strokeWidth:1.5}),
|
|
21
|
+
/* @__PURE__ */be("span",{className:"mt-1 text-3xs uppercase tracking-wide",children:"Hidden"})]}),!o&&/* @__PURE__ */be("div",{className:"absolute bottom-0 left-0 right-0 z-10 px-2 py-1 text-2xs font-medium text-on-accent bg-gradient-to-t from-black/80 to-transparent truncate pointer-events-none",children:t}),a&&/* @__PURE__ */be("button",{onClick:e=>{e.stopPropagation(),a()},className:"absolute top-1 right-1 z-20 h-5 w-5 rounded-full bg-gray-900/90 ring-1 ring-white/80 shadow-sm hover:bg-red-500 text-on-accent flex items-center justify-center",title:s.taskbar.closeWindow,children:/* @__PURE__ */be(Y,{name:"close",className:"h-3 w-3",strokeWidth:3})})]})}function It({items:e,anchorEl:t,onActivate:n,onClose:r,onMouseEnter:o,onMouseLeave:i}){const a=ee(),s=e.length>1,l=ae(null),[c,u]=le({left:-9999,top:-9999,ready:!1}),[d,h]=le(()=>"undefined"!=typeof document&&getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom");ie(()=>{const e=l.current;if(!e)return;const n=()=>{const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";h(o);let i,a=n.left+n.width/2-r.width/2;"top"===o?i=n.bottom+8:"left"===o?(a=n.right+8,i=n.top+n.height/2-r.height/2):"right"===o?(a=n.left-r.width-8,i=n.top+n.height/2-r.height/2):i=n.top-r.height-8,a=Math.max(8,Math.min(a,window.innerWidth-r.width-8)),i=Math.max(8,Math.min(i,window.innerHeight-r.height-8)),u({left:a,top:i,ready:!0})};n();const r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[t,e.length]),se(()=>Dt,[]);const m="top"===d,f=(m?"mt-1":"mb-1")+" max-w-[240px] truncate text-2xs font-medium text-ink-strongest bg-white/80 px-2 py-0.5 rounded shadow-sm ring-2 ring-transparent transition group-hover:ring-blue-400";return U(
|
|
22
|
+
/* @__PURE__ */be("div",{ref:l,"data-taskbar-preview":"",style:{position:"fixed",left:c.left,top:c.top,zIndex:zt,maxWidth:"calc(100vw - 16px)",opacity:c.ready?1:0},className:s?"flex gap-2 flex-wrap":"",onMouseEnter:o,onMouseLeave:()=>{Dt(),i()},children:e.map(e=>{const t=xt(e.id)??Nt(e.label),o=t?function(e){if(Tr(e))return null;const t=e.getBoundingClientRect(),n=br(),r=t.left+t.width/2-(n.x+n.w/2),o=t.top+t.height/2-(n.y+n.h/2);return 180*Math.atan2(o,r)/Math.PI}(t):null;/* @__PURE__ */
|
|
23
|
+
return ve("div",{className:"group flex flex-col items-center",onMouseEnter:()=>At(t),children:[!m&&/* @__PURE__ */be("span",{className:f,children:e.label}),
|
|
24
|
+
/* @__PURE__ */be(Pt,{id:e.id,label:e.label,maxW:240,maxH:160,titleAbove:!0,onClick:()=>n(e.id),onClose:()=>r(e.id)}),m&&/* @__PURE__ */be("span",{className:f,children:e.label}),null!==o&&/* @__PURE__ */ve("span",{title:a.taskbar.offscreenHint,className:"mt-1 inline-flex items-center gap-1 rounded bg-amber-500 px-2 py-0.5 text-2xs font-semibold text-on-accent shadow-sm",children:[
|
|
25
|
+
/* @__PURE__ */be(Y,{name:"arrow-right",className:"h-3 w-3",style:{transform:`rotate(${o}deg)`},strokeWidth:3}),"Off screen"]})]},e.id)})}),document.body)}function Rt(e,t){const n=getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim()||"bottom";return"top"===n?{left:Math.min(e,window.innerWidth-220),top:t+4}:"left"===n?{left:e+4,top:Math.min(t,window.innerHeight-160)}:"right"===n?{right:window.innerWidth-e+4,top:Math.min(t,window.innerHeight-160)}:{left:Math.min(e,window.innerWidth-220),bottom:window.innerHeight-t+4}}function Wt({openWindows:e,onRemove:t,onSplitView:n,onActivate:r,onActivateById:o}){const i=ee(),[a,s]=le(null);se(()=>{let e,t;const n=()=>{clearInterval(e),clearTimeout(t),e=void 0},r=()=>{const e=document.getElementById("taskbar-windows");return s(t=>t===e?t:e),!!e},o=()=>{n(),r()||(e=setInterval(()=>{r()&&n()},100),t=setTimeout(n,5e3))};return o(),window.addEventListener("react-os-shell:layout-mode-changed",o),()=>{n(),window.removeEventListener("react-os-shell:layout-mode-changed",o)}},[]);const c=ce(P,I),[,u]=le(0);se(()=>{const e=()=>u(e=>e+1);return window.addEventListener("modal-geometry",e),window.addEventListener("resize",e),()=>{window.removeEventListener("modal-geometry",e),window.removeEventListener("resize",e)}},[]);const[,d]=le(0);se(()=>{const e=()=>d(e=>e+1);return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[]);const h=e=>{const t=Nt(e),n=t?.querySelector("[data-window-title]");return n?.textContent?.trim()||e},[m,f]=le(null),[p,w]=le(null),[y,g]=le(null),b=ae(null),x=()=>{b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{f(null),w(null)},150)},k=e.filter(e=>!e.route||!Te[e.route]?.utility);if(!a||!a.isConnected||0===k.length)return null;const E=[],M=/* @__PURE__ */new Map;for(const e of k){const t=e.route?Te[e.route]:void 0,n=t?.taskbarGroup,r=n?.key??e.route??`entity:${e.id}`,o=M.get(r);if(void 0!==o)E[o].items.push(e);else{M.set(r,E.length);const o=n?.label??t?.label??e.label;E.push({key:r,route:n?.icon??e.route,label:o,items:[e]})}}return U(
|
|
26
|
+
/* @__PURE__ */ve(xe,{children:[E.map(e=>{const n=e.route?l[e.route]:null,r=e.items[e.items.length-1];let a=!1;if(c){const t=document.querySelector(`[data-modal-id="${c}"]`);if(t){const n=t.querySelector("[data-window-title]"),r=n?.textContent??"";a=e.items.some(e=>r.includes(e.label))}}const s=e.items.length>1,u=e.items.some(e=>{const t=xt(e.id)??Nt(e.label);return!!t&&!Tr(t)});/* @__PURE__ */
|
|
27
|
+
return ve("button",{onClick:()=>o(r.id),onMouseEnter:t=>{return n=e.items,r=t.currentTarget,void(y||(b.current&&(clearTimeout(b.current),b.current=null),b.current=setTimeout(()=>{f(n),w(r)},350)));var n,r},onMouseLeave:x,onDoubleClick:e=>{e.stopPropagation(),window.dispatchEvent(new CustomEvent("modal-center",{detail:{windowKey:r.id,label:r.label}}))},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),b.current&&(clearTimeout(b.current),b.current=null),f(null),w(null),s?g({x:t.clientX,y:t.clientY,items:e.items,label:e.label}):window.dispatchEvent(new CustomEvent("modal-context-menu",{detail:{windowKey:r.id,label:r.label,x:t.clientX,y:t.clientY}}))},style:{width:"var(--window-tab-width, 200px)",fontSize:"var(--window-tab-font-size, 12px)"},"data-tab-group":e.key,className:"group relative flex items-center gap-2 rounded-lg px-3 py-2 font-medium transition-all min-w-0 shrink "+(a?"bg-blue-100/60 border border-blue-400/60 text-blue-700":"bg-gray-50/40 border border-gray-200/40 text-gray-700 hover:bg-gray-200/40"),children:[n&&de(n)?fe(n,{className:"h-3.5 w-3.5 shrink-0"}):/* @__PURE__ */be(Y,{name:"expand",className:"h-3.5 w-3.5 shrink-0",strokeWidth:2}),
|
|
28
|
+
/* @__PURE__ */be("span",{className:"truncate flex-1",children:s?e.label:h(r.label)}),u&&/* @__PURE__ */be("span",{title:i.taskbar.offscreenDot,className:"shrink-0 h-1.5 w-1.5 rounded-full bg-amber-500"}),s&&/* @__PURE__ */be(v,{count:e.items.length,label:i.count.windows(e.items.length)}),!s&&/* @__PURE__ */be("span",{role:"button",onClick:e=>{e.stopPropagation(),t(r.id)},className:"ml-auto text-gray-400 hover:text-red-500 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:/* @__PURE__ */be(Y,{name:"close",className:"h-3 w-3",strokeWidth:2})})]},e.key)}),
|
|
29
|
+
/* @__PURE__ */be("div",{className:"flex-1"}),k.length>=2&&/* @__PURE__ */ve("button",{onClick:n,title:i.taskbar.expose,className:"flex items-center gap-1 rounded px-2 py-1 text-2xs font-medium text-blue-600 border border-blue-300 hover:bg-accent-tint transition-colors shrink-0",children:[
|
|
30
|
+
/* @__PURE__ */be(Y,{name:"grid",className:"h-3 w-3",strokeWidth:2}),"Exposé"]}),y&&/* @__PURE__ */ve(K,{portal:!0,minWidth:200,style:Rt(y.x,y.y),onClose:()=>g(null),children:[
|
|
31
|
+
/* @__PURE__ */be(B,{children:y.label}),
|
|
32
|
+
/* @__PURE__ */ve(j,{onClick:()=>{g(null),y.items.forEach(e=>function(e){const t=Zn.get(e);t&&wr(t)}(e.id))},children:[
|
|
33
|
+
/* @__PURE__ */be(Y,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),i.taskbar.minimizeAllWindows]}),
|
|
34
|
+
/* @__PURE__ */ve(j,{onClick:()=>{g(null),y.items.forEach(e=>o(e.id))},children:[
|
|
35
|
+
/* @__PURE__ */be("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */be("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75h6.5v6.5h-6.5zM13.75 8.75h6.5v6.5h-6.5z"})}),i.taskbar.restoreAllWindows]}),
|
|
36
|
+
/* @__PURE__ */be(F,{}),
|
|
37
|
+
/* @__PURE__ */ve(j,{danger:!0,onClick:()=>{g(null),y.items.forEach(e=>t(e.id))},children:[
|
|
38
|
+
/* @__PURE__ */be(Y,{name:"close",className:"h-4 w-4",strokeWidth:2}),`${i.taskbar.closeAllWindows} (${y.items.length})`]})]}),m&&p&&/* @__PURE__ */be(It,{items:m,anchorEl:p,onActivate:e=>{o(e),f(null),w(null)},onClose:e=>{t(e),f(null),w(null)},onMouseEnter:()=>{b.current&&(clearTimeout(b.current),b.current=null)},onMouseLeave:x})]}),a)}var $t=["/login","/forgot-password","/reset-password","/force-change-password"];function Ot({children:e,windowAccentForRoute:t}){const n=ke(),r=$t.some(e=>n.pathname.startsWith(e)),[o,i]=le([]),a=ae(o);ie(()=>{a.current=o},[o]);const s=ce(Fe,je,je),l=ae(/* @__PURE__ */new Map),c=e=>{const t=Ze(e),n=!!s&&"page"===e.type&&e.route===s,r=e.pageSearch||void 0,o=l.current.get(e.id);if(o&&o.tab===t&&o.home===n&&o.pageSearch===r)return o;const i={key:e.id,tab:t,home:n,...r?{pageSearch:r}:{}};return l.current.set(e.id,i),i};se(()=>{Ct.clear();for(const e of o)e.route&&Ct.set(e.id,e.route)},[o]);const u=ue(e=>{i(t=>t.filter(t=>t.id!==e))},[]),d=ue(e=>{var t;xt(e)||kt(e)?(t=e,window.dispatchEvent(new CustomEvent(Hr,{detail:{windowKey:t}}))):u(e)},[u]),h=(e,t=!1)=>{const n=Vn;t&>.add(e),setTimeout(()=>{const r=xt(e)??kt(e),o=r?.getAttribute("data-modal-id");var i,a;!o||(i=o,a=n,(Jn.get(i)??-1)>a)||pr(o),t&>.delete(e)},50)},m=(e,t,n)=>{const r=Be;if(n||!r)return[...e,t];const o=function(e,t,n){if(!Ze(t))return e.length;if(t.shellOwned&&tt(t,n.home))return 0;const r=tt(t,n.home)?void 0:et(t)?.key;if(r){let t=-1;if(e.forEach((e,o)=>{Ze(e)&&!tt(e,n.home)&&et(e)?.key===r&&(t=o)}),t>=0)return t+1}if("page"===t.type&&t.route&&!tt(t,n.home)&&n.favorites.includes(t.route))return e.length>0&&tt(e[0],n.home)?1:0;const o=t.openedFrom?e.findIndex(e=>e.id===t.openedFrom):-1;if(o>=0){const t=/* @__PURE__ */new Set([e[o].id]);let r=o+1;for(;r<e.length&&e[r].openedFrom&&t.has(e[r].openedFrom);)t.add(e[r].id),r++;const i=t=>Ze(e[t])&&!tt(e[t],n.home)?et(e[t])?.key:void 0;for(;r>0&&r<e.length&&void 0!==i(r)&&i(r)===i(r-1);)r++;return r}return e.length}(e,t,{home:je(),favorites:r.favorites});return[...e.slice(0,o),t,...e.slice(o)]},f=ue(e=>{i(t=>function(e,t){const n=new Set(t),r=new Map(e.map(e=>[e.id,e])),o=t.map(e=>r.get(e)).filter(e=>!!e);if(o.length!==n.size)return e;let i=0;const a=e.map(e=>n.has(e.id)?o[i++]:e);return a.every((t,n)=>t===e[n])?e:a}(t,e))},[]),p=ue((e,t,n,r,o,a={})=>{if(!Te[e]||!Se(Te[e]))return;const s=`${e}:${t}`,l=Mt();i(i=>{const c=i.find(n=>n.entityType===e&&String(n.entityId)===String(t));return c?(h(c.id),i):(h(s,!0),m(i,{id:s,type:"modal",label:r||t,route:o||window.location.pathname,entityType:e,entityId:t,entitySnapshot:ot(n),openedFrom:l},!!a.append))})},[]),w=ue((e,t={})=>{if(!Te[e]||!Ce(Te[e]))return;const n=Te[e],{reuse:r=!1,background:o=!1,shellOwned:s,search:l,append:c=!1}=t,u=e=>{var t;o?(t=e,or.add(t)):h(e)};if(n.widget){const t=a.current.find(t=>"page"===t.type&&t.route===e);if(t)return void d(t.id)}const f=Mt();i(t=>{if(n.multiInstance){const i=t.filter(t=>"page"===t.type&&t.route===e);if(s&&i.length>0)return t;if(r&&!l&&i.length>0)return o||h(i[i.length-1].id),t;const a=`page:${e}:${Math.random().toString(36).slice(2,8)}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom:f,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)}const i=t.find(t=>"page"===t.type&&t.route===e);if(i)return n.widget?t:(o||h(i.id),l&&i.pageSearch!==l?t.map(e=>e===i?{...e,pageSearch:l}:e):t);const a=`page:${e}`;return u(a),m(t,{id:a,type:"page",label:n.label,route:e,openedFrom:f,...s?{shellOwned:s}:{},...l?{pageSearch:l}:{}},c)})},[d]),y=ue(()=>{},[]),g=ue(()=>{},[]),v=d,b=d;/* @__PURE__ */
|
|
39
|
+
return ve(ut.Provider,{value:{openWindows:o,openEntity:p,openPage:w,reorderWindows:f,closeEntity:v,minimize:y,items:[],openItems:o,restore:g,remove:b,restoreIfMinimized:()=>!1},children:[e,
|
|
40
|
+
/* @__PURE__ */be(Wt,{openWindows:o,onRemove:d,onSplitView:co,onActivate:e=>{document.querySelectorAll("[data-modal-panel]").forEach(t=>{const n=t.querySelector("[data-window-title]");if(n?.textContent?.includes(e)){const e=t.getAttribute("data-modal-id");e&&pr(e)}})},onActivateById:Et}),
|
|
41
|
+
/* @__PURE__ */be(uo,{}),!r&&o.map(e=>{const n=e.route?t?.(e.route):void 0;
|
|
42
|
+
/* @__PURE__ */
|
|
43
|
+
return be(Re.Provider,{value:c(e),children:/* @__PURE__ */be(qe,{fallback:(t,n)=>/* @__PURE__ */be(ho,{open:!0,onClose:()=>u(e.id),title:e.label,size:"md",autoHeight:!0,windowKey:e.id,children:/* @__PURE__ */be(Ye,{error:t,onReload:n})}),children:/* @__PURE__ */be(pn,{spec:pt(e),children:/* @__PURE__ */be(vo,{windowId:e.id,children:"page"===e.type?/* @__PURE__ */be(wt,{item:e,onClose:()=>u(e.id),accentRgb:n}):/* @__PURE__ */be(bt,{item:e,onClose:()=>u(e.id),onMinimize:()=>{},accentRgb:n})})})})},e.id)})]})}var Kt=400;function jt({panelRef:e,bodyRef:t,open:n,widget:r,active:o,minimized:i}){const a=ae(null),s=ae(!1);n&&!s.current&&(a.current="undefined"==typeof document?null:document.activeElement),s.current=n;const l=ae(!1),c=ae(void 0),u=ae(i),d=u.current&&!i;u.current=i;const h=()=>{l.current=!0,clearTimeout(c.current),c.current=setTimeout(()=>{l.current=!1},Kt)};se(()=>{n&&!r&&h()},[n,r]),se(()=>{d&&n&&!r&&h()},[d]),se(()=>()=>clearTimeout(c.current),[]),se(()=>{if(!n||r||!o||i||!l.current)return;l.current=!1;const a=e.current;if(!a||a.contains(document.activeElement))return;if(document.activeElement?.closest('[aria-modal="true"]'))return;const s=t.current?$(t.current)[0]:void 0;s?s.focus():(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus())},[n,r,o,i,e,t]),ie(()=>{if(!n||r)return;const t=e.current;return()=>{const e=a.current,n=document.activeElement;(!n||n===document.body||!!t?.contains(n))&&e&&e.isConnected&&!t?.contains(e)&&e.focus?.()}},[n,r,e])}var Ft=null,Bt=/* @__PURE__ */new Set;function Ht(){return Ft}function Yt(e){if(Ft!==e){Ft=e;for(const e of Bt)e()}}function qt(e){return Bt.add(e),()=>{Bt.delete(e)}}var Ut=!1,Xt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},Vt=()=>{};function Jt(e){Ut=e,Xt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0}}function Gt(e,t){Ut&&("submenu"===e?Xt.submenus++:Xt.menus++,Xt.menuKey=t)}function _t(e){if(!Ut)return Vt;const t=performance.now();let n=!1;return()=>{if(n)return;if(n=!0,!Ut)return;const r=performance.now()-t;"move"===e?Xt.moveMs+=r:Xt.resizeMs+=r}}function Qt(){const e=Xt;return Xt={menus:0,submenus:0,menuKey:null,moveMs:0,resizeMs:0},e}var Zt=/* @__PURE__ */new Set([O,k]),en=e=>Zt.has(e)||"function"==typeof e&&"badge"===e.titleRole,tn=/* @__PURE__ */new Set(["button","a","input","select","textarea","kbd"]),nn=/* @__PURE__ */new Set(["svg"]);function rn(e){const t=[],n={text:"",accessories:[],badges:[],actions:[]};return on(e,n,t),n.text=t.join("").replace(/\s+/g," ").trim(),n}function on(e,t,n){if(null==e||"boolean"==typeof e)return;if("string"==typeof e||"number"==typeof e)return void n.push(String(e));if(Array.isArray(e))return void e.forEach(e=>on(e,t,n));if(!de(e))return;const r=e;if(r.type===w)return void(void 0===t.copy&&"string"==typeof r.props.text&&r.props.text&&(t.copy=r.props.text));if(r.type===he)return void me.toArray(r.props.children).forEach(e=>on(e,t,n));if("string"==typeof r.type){if(nn.has(r.type))return;if(!tn.has(r.type))return n.push(" "),me.toArray(r.props.children).forEach(e=>on(e,t,n)),void n.push(" ")}const o=fe(r,{key:`title-part-${t.accessories.length}`});t.accessories.push(o),(en(r.type)?t.badges:t.actions).push(o)}var an=/* @__PURE__ */new Map,sn=/* @__PURE__ */new Set,ln=0;function cn(){ln++,sn.forEach(e=>e())}function un(e){return an.get(e)}function dn(e){return sn.add(e),()=>{sn.delete(e)}}function hn(){return ln}var mn=te(""),fn=te(null);function pn({spec:e,children:t}){/* @__PURE__ */
|
|
44
|
+
return be(fn.Provider,{value:e,children:t})}var wn=/* @__PURE__ */new Set(["button","input","textarea","select","kbd","svg"]),yn='button[type="submit"], button[data-submit], button.btn-submit, button.bg-green-600, button.bg-blue-600';function gn(e){return vn(e).replace(/\s+/g," ").trim()}function vn(e){if(null==e||"boolean"==typeof e)return"";if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(Array.isArray(e))return e.map(vn).join("");if(de(e)){const t=e,n="string"==typeof t.type?t.type:"";return wn.has(n)?"":` ${vn(t.props?.children)} `}return""}function bn(e){const t=re(mn);se(()=>{if(!t)return;const n=n=>{n.detail===t&&e()};return window.addEventListener("widget-open-settings",n),()=>window.removeEventListener("widget-open-settings",n)},[e,t])}var xn={};function kn(e,t,n){const r=re(mn);se(()=>{if(!r)return;xn[r]||(xn[r]=[]);const o={label:e,icon:n,onClick:t};return xn[r].push(o),()=>{xn[r]=(xn[r]||[]).filter(e=>e!==o)}},[r,e,t,n])}function En({title:e}){const t=ae(null);return se(()=>{const n=setTimeout(()=>{const n=t.current?.closest("[data-modal-id]"),r=n?.getAttribute("data-modal-id");r&&window.dispatchEvent(new CustomEvent("window-title-update",{detail:{id:r,title:e}}))},0);return()=>clearTimeout(n)},[e]),/* @__PURE__ */be("span",{ref:t,style:{display:"none"},"aria-hidden":"true"})}function Mn(e){}function Cn(){return re(mn)}function Sn({className:e=""}){const t=re(D)?.setEditSlot,n=ue(e=>{t?.(e)},[t]);return t?/* @__PURE__ */be("span",{ref:n,"data-window-edit-slot":"",className:`inline-flex items-center empty:hidden ${e}`.trim()}):null}function Nn({items:e,label:t}){const n=ee().window.more;return 0===e.length?null:/* @__PURE__ */be(W,{side:"top",items:e,triggerClassName:Q({variant:"secondary",size:"sm"}),trigger:/* @__PURE__ */ve(xe,{children:[t??n,
|
|
45
|
+
/* @__PURE__ */be(Y,{name:"chevron-down",className:"size-3.5",strokeWidth:2,"aria-hidden":"true"})]})})}function Ln({children:e,position:t="right",quiet:n=!1}){const r=re(D),[o,i]=le(null);return se(()=>{if(!r)return;const e="left"===t?r.leftRef:r.rightRef,o=()=>!!e.current&&(i(e.current),n||r.notify(),!0);if(o())return;const a=setInterval(()=>{o()&&clearInterval(a)},50),s=setTimeout(()=>clearInterval(a),2e3);return()=>{clearInterval(a),clearTimeout(s)}},[r,t,n]),o?U(e,o):null}function Tn({onClick:e,children:t,className:n}){const r=re(D);/* @__PURE__ */
|
|
46
|
+
return be("button",{type:"button",onClick:async()=>{if(r?.isDirty){const{confirm:e}=await(import("./shell/ConfirmDialog.js"));if(!await e({title:"Discard changes?",message:"You have unsaved changes. Are you sure you want to cancel? All changes will be lost.",confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"}))return}e()},className:n||"bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50",children:t||"Cancel"})}var zn="erp_window_positions",An={};try{const e=localStorage.getItem(zn);e&&(An=JSON.parse(e))}catch{}var Dn=null;function Pn(){Dn&&clearTimeout(Dn),Dn=setTimeout(()=>{try{localStorage.setItem(zn,JSON.stringify(An))}catch{}},500)}var In="erp_activation_order",Rn=[];try{const e=localStorage.getItem(In),t=e?JSON.parse(e):null;Array.isArray(t)&&t.every(e=>"string"==typeof e)&&(Rn=t)}catch{}var Wn=null;function $n(){Wn&&clearTimeout(Wn),Wn=setTimeout(()=>{try{localStorage.setItem(In,JSON.stringify(Rn))}catch{}},500)}function On(e,t){An[e]||(An[e]=t,Pn())}function Kn(e){return An[e]?{...An[e]}:null}function jn(e,t){An[e]=t,Pn()}function Fn(){const r=e(),o=t();let i=!1;for(const e of Object.keys(An))n(An[e],r,o)&&(delete An[e],i=!0);i&&Pn()}var Bn={sm:384,md:512,lg:672,xl:896,"2xl":1152,"3xl":1408},Hn=4e3,Yn=["small","medium","large","maximized"],qn=()=>{if("undefined"==typeof document)return"large";const e=getComputedStyle(document.documentElement).getPropertyValue("--default-window-size")?.trim();return M(Yn,"large",e)},Un={small:.8,medium:1,large:1.25,maximized:1.25},Xn=/* @__PURE__ */new Set,Vn=0,Jn=/* @__PURE__ */new Map;var Gn=0;function _n(){return Gn}function Qn(){Gn++,A.forEach(e=>e())}var Zn=/* @__PURE__ */new Map,er=/* @__PURE__ */new Map,tr=/* @__PURE__ */new Map;function nr(){for(let e=z.length-1;e>=0;e--){const t=tr.get(z[e]);if(t?.tab)return t.owner}return null}function rr(){return ce(P,nr,()=>null)}var or=/* @__PURE__ */new Set;var ir=null;function ar(e){ir=null,pr(e)}function sr(e){ir=e;const t=Zn.get(e);t&&ar(t)}var lr=/* @__PURE__ */new Map;function cr(e){return lr.get(e)?.holdsChanges()??!1}function ur(e){const t=lr.get(e);return t?t.ask():Promise.resolve(!0)}function dr(e){ir===e&&(ir=null)}function hr(e,t,n){if(n&&tr.set(e,n),t)if(Zn.set(t,e),er.set(e,t),or.delete(t)){z.unshift(e);const n=Rn.indexOf(t);-1!==n&&Rn.splice(n,1),Rn.unshift(t),$n()}else!function(e,t){const n=Rn.indexOf(t);if(-1===n)return void z.push(e);let r=z.length;for(let e=0;e<z.length;e++){const t=er.get(z[e]);if(t&&Rn.indexOf(t)>n){r=e;break}}z.splice(r,0,e)}(e,t),-1===Rn.indexOf(t)&&(Rn.push(t),$n());else z.push(e);Qn(),window.dispatchEvent(new CustomEvent("modal-reorder")),t&&ir===t&&ar(e)}function mr(e){return e?tr.get(e)?.owner??er.get(e)??null:null}var fr=/* @__PURE__ */new Set;function pr(e){const t=mr(I()),n=z.indexOf(e);-1!==n&&z.splice(n,1),z.push(e);const r=tr.get(e);if(r?.root)for(const[e,t]of tr){if(t.root||t.owner!==r.owner||Xn.has(e))continue;const n=z.indexOf(e);-1!==n&&z.splice(n,1),z.push(e)}Xn.delete(e);const o=er.get(e);if(o){const e=Rn.indexOf(o);-1!==e&&Rn.splice(e,1),Rn.push(o),$n(),ir&&ir!==o&&(ir=null)}Qn(),window.dispatchEvent(new CustomEvent("modal-reorder"));const i=mr(I());i&&i!==t&&fr.forEach(e=>e(i))}function wr(e){const t=z.indexOf(e);-1!==t&&z.splice(t,1),Xn.add(e),Jn.set(e,++Vn);const n=er.get(e);if(n){const e=Rn.indexOf(n);-1!==e&&(Rn.splice(e,1),$n())}Qn(),window.dispatchEvent(new CustomEvent("modal-reorder"))}var yr=/* @__PURE__ */new Set;var gr=8,vr=32;function br(){return e()}var xr="flex size-6 shrink-0 items-center justify-center rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",kr="flex size-3 items-center justify-center rounded-full text-gray-900/70",Er="size-2 opacity-0 group-hover/controls:opacity-100 group-focus-within/controls:opacity-100",Mr=E.windowBar,Cr=80,Sr=384,Nr=400;function Lr(e,t=br()){const n=Math.min(Math.max(e.x,t.x+Cr-e.w),t.x+t.w-Cr),r=Math.min(Math.max(e.y,t.y),t.y+t.h-Mr);return n===e.x&&r===e.y?e:{...e,x:n,y:r}}function Tr(e){const t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!0;const n=br();return t.left>=n.x-1&&t.top>=n.y-1&&t.right<=n.x+n.w+1&&t.bottom<=n.y+n.h+1}function zr(e){const t=br(),n=Math.floor(t.w/2),r=Math.floor(t.h/2);switch(e){case"top":return{x:t.x,y:t.y,w:t.w,h:t.h};case"left":return{x:t.x,y:t.y,w:n,h:t.h};case"right":return{x:t.x+n,y:t.y,w:t.w-n,h:t.h};case"tl":return{x:t.x,y:t.y,w:n,h:r};case"tr":return{x:t.x+n,y:t.y,w:t.w-n,h:r};case"bl":return{x:t.x,y:t.y+r,w:n,h:t.h-r};case"br":return{x:t.x+n,y:t.y+r,w:t.w-n,h:t.h-r}}}var Ar=null;function Dr(e){const t=(Ar||((Ar=document.createElement("div")).style.cssText=["position: fixed","pointer-events: none",`z-index: ${X.snapPreview}`,"border-radius: 8px","background: rgba(59, 130, 246, 0.18)","border: 2px solid rgb(59, 130, 246)","transition: left 120ms ease, top 120ms ease, width 120ms ease, height 120ms ease, opacity 120ms ease","opacity: 0","display: none"].join(";"),document.body.appendChild(Ar)),Ar);t.style.display="block",t.style.left=`${e.x}px`,t.style.top=`${e.y}px`,t.style.width=`${e.w}px`,t.style.height=`${e.h}px`,t.style.opacity="1"}function Pr(){Ar&&(Ar.style.opacity="0",Ar.style.display="none")}var Ir=[{zone:"left",labelKey:"snapLeft",region:"inset-y-0 left-0 w-1/2"},{zone:"right",labelKey:"snapRight",region:"inset-y-0 right-0 w-1/2"},{zone:"tl",labelKey:"snapTopLeft",region:"top-0 left-0 h-1/2 w-1/2"},{zone:"tr",labelKey:"snapTopRight",region:"top-0 right-0 h-1/2 w-1/2"},{zone:"bl",labelKey:"snapBottomLeft",region:"bottom-0 left-0 h-1/2 w-1/2"},{zone:"br",labelKey:"snapBottomRight",region:"bottom-0 right-0 h-1/2 w-1/2"}],Rr=350,Wr=200;function $r({maximized:e,onToggleMax:t,onSnap:n,buttonClassName:r,strings:o,children:i}){const[a,s]=le(!1),l=ae(void 0),c=ae(void 0);se(()=>()=>{clearTimeout(l.current),clearTimeout(c.current)},[]);const u=()=>{clearTimeout(c.current),l.current=setTimeout(()=>s(!0),Rr)},d=()=>{clearTimeout(l.current),c.current=setTimeout(()=>s(!1),Wr)};/* @__PURE__ */
|
|
47
|
+
return ve("span",{className:"relative inline-flex",onMouseEnter:u,onMouseLeave:d,children:[
|
|
48
|
+
/* @__PURE__ */be("button",{onClick:t,onFocus:u,onBlur:d,"aria-label":e?o.windowed:o.maximize,title:e?o.windowed:o.maximize,className:r,children:i}),a&&/* @__PURE__ */be("div",{role:"group","aria-label":o.snapLayouts,onMouseEnter:()=>clearTimeout(c.current),onMouseLeave:d,className:"absolute left-0 top-full z-30 mt-1 grid w-max grid-cols-2 gap-1 rounded-lg border border-line bg-surface p-2 shadow-lg",children:Ir.map(({zone:e,labelKey:t,region:r})=>/* @__PURE__ */be("button",{type:"button","aria-label":o[t],title:o[t],onClick:()=>{s(!1),n(e)},onFocus:()=>clearTimeout(c.current),onBlur:d,className:"relative h-7 w-11 rounded border border-gray-300 bg-gray-50 hover:border-blue-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400",children:/* @__PURE__ */be("span",{"aria-hidden":"true",className:`absolute rounded-sm bg-blue-500/70 ${r}`,style:{margin:2}})},e))})]})}var Or="rosh-gesture-style";var Kr={se:"nwse-resize",nw:"nwse-resize",sw:"nesw-resize",ne:"nesw-resize",n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize"},jr=4;function Fr(e,t,n,r){!function(){if("undefined"==typeof document||document.getElementById(Or))return;const e=document.createElement("style");e.id=Or,e.textContent="body.rosh-gesturing [data-modal-panel]{will-change:transform}",document.head.appendChild(e)}();try{e.setPointerCapture(t)}catch{}document.body.classList.add("rosh-gesturing");const o=document.createElement("div");o.setAttribute("data-drag-shield",""),o.style.cssText=`position:fixed;inset:0;z-index:2147483647;cursor:${n};background:transparent;touch-action:none`,document.body.appendChild(o);const i=_t(r);let a=!1;return()=>{if(!a){a=!0,i();try{e.releasePointerCapture(t)}catch{}o.remove(),document.body.classList.remove("rosh-gesturing")}}}function Br(e){const t=z.indexOf(e);if(-1===t)return-1;const n=X.window+t*X.windowStep,r=tr.get(e);if(!r||r.root)return n;let o=-1;for(const[e,t]of tr){if(!t.root||t.owner!==r.owner)continue;const n=z.indexOf(e);-1!==n&&(o=Math.max(o,X.window+n*X.windowStep))}return o>=n?o+2+Math.min(t,7):n}"undefined"!=typeof window&&window.addEventListener("deactivate-all-modals",function(){for(let e=z.length-1;e>=0;e--)yr.has(z[e])||z.splice(e,1);Rn=Rn.filter(e=>{const t=Zn.get(e);return null!=t&&yr.has(t)}),$n(),Qn(),window.dispatchEvent(new CustomEvent("modal-reorder"))});var Hr="modal-close-request";function Yr(e){ce(P,_n);const t=re(D);if(z.length<=1)return!0;if(e){const t=Zn.get(e);if(null!=t)return I()===t}return t?.active??null!=I()}var qr=!1,Ur=/* @__PURE__ */new Set;function Xr(e){return Ur.add(e),()=>Ur.delete(e)}function Vr(){return qr}function Jr(e){qr!==e&&(qr=e,Ur.forEach(e=>e()))}function Gr(){Jr(!qr)}function _r(){Jr(!1)}var Qr=null,Zr=/* @__PURE__ */new Set;function eo(e){return Zr.add(e),()=>Zr.delete(e)}function to(){return Qr}function no(e){Qr!==e&&(Qr=e,Zr.forEach(e=>e()))}var ro=null,oo=/* @__PURE__ */new Set;function io(e){return oo.add(e),()=>oo.delete(e)}function ao(){return ro}function so(e){ro!==e&&(ro=e,oo.forEach(e=>e()))}function lo(){if(!ro)return void Jr(!1);no(ro),so(null),Jr(!1)}function co(){Jr(!qr),window.dispatchEvent(new CustomEvent("modal-split-view"))}function uo(){const e=ce(Xr,Vr),[t,n]=le(e),[r,o]=le(e);return se(()=>{if(e){n(!0);const e=requestAnimationFrame(()=>o(!0));return()=>cancelAnimationFrame(e)}o(!1);const t=setTimeout(()=>n(!1),280);return()=>clearTimeout(t)},[e]),t&&"undefined"!=typeof document?U(
|
|
49
|
+
/* @__PURE__ */be("div",{onMouseDown:e=>{e.stopPropagation(),Jr(!1)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:X.expose,cursor:"pointer",opacity:r?1:0,transition:"opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1)",pointerEvents:r?"auto":"none"}}),document.body):null}function ho({open:t,onClose:l,title:c,icon:u,copyText:d,size:f="lg",dirty:p=!1,onNext:w,onPrev:v,footer:k,bodyScroll:M,onMinimize:C,initialBox:S,actions:A,actionsLeft:W,editing:$=!1,edit:O,allowPinOnTop:B,initialPosition:q,widget:V,compact:J,appStyle:_,flushBody:Q,autoHeight:te,autoMinHeight:ne,autoWidth:oe,widgetMenu:de,dimensions:he,windowKey:me,openedFromKey:fe,accentRgb:ye,children:ge}){const[ke,Ee]=le(()=>r()),Me=N()&&!ke,Ce=L()&&!!V,[Se,Ne]=le(0),[Le,Te]=le(!1),ze=ae(null),Ae=ae(0);se(()=>{Ae.current=Se},[Se]);const De=ue(e=>{Me&&(ze.current={startX:e.clientX,startY:e.clientY,pointerId:e.pointerId},Te(!0),Yt(fe??null))},[Me,fe]),Pe=ce(qt,Ht);se(()=>{if(!Le)return;const e=e=>{if(!ze.current)return;const t=e.clientX-ze.current.startX;if(Math.abs(e.clientY-ze.current.startY)>Math.abs(t)+12)return ze.current=null,Te(!1),Ne(0),void Yt(null);Ne(Math.max(0,t))},t=()=>{if(!ze.current)return;const e=.3*window.innerWidth,t=Ae.current>e;ze.current=null,Te(!1),t?(Ne(window.innerWidth),setTimeout(()=>{l(),Ne(0),Yt(null)},180)):(Ne(0),Yt(null))};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[Le]);const[Ie,We]=le(c),$e=ee(),Oe=$e.window;se(()=>{We(c)},[c]);const Ke=pe(()=>gn(Ie).trim()||void 0,[Ie]),je=we(),[Fe,Be]=le(!1),He=ae(!1),[Ye,Xe]=le(!1),[Je,Ge]=le(null),_e=re(fn),Qe=re(Re),{prefs:Ze,save:et}=T(),tt=!!Ze.window_accent_stripe,nt=Ze.favorite_documents||[],rt=!!_e&&nt.some(e=>e.entityType===_e.entityType&&e.entityId===_e.entityId),ot=ue(()=>{if(!_e)return;const e=rt?nt.filter(e=>!(e.entityType===_e.entityType&&e.entityId===_e.entityId)):[...nt,{entityType:_e.entityType,entityId:_e.entityId,label:_e.label}];et({favorite_documents:e})},[_e,rt,nt,et]),[it,at]=le(null),[st,lt]=le("top-right"===q?"right":"left"),ct=ae(!1),ut=ae(null);ie(()=>{const e=ut.current;e&&(ye?e.style.setProperty("--window-accent-rgb",ye):e.style.removeProperty("--window-accent-rgb"))},[ye]);const dt=ae(!1),mt=ae(null),pt=ae(null),wt=ae(null),[yt,gt]=le(!1),vt=ae(null),bt=ae(null),xt=ae(null),[kt,Et]=le(!1);ie(()=>{const e=bt.current,t=xt.current;if(!e||!t)return;const n=()=>Et(function(e,t){return e.scrollWidth>t.clientWidth}(t,e));if(n(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[null!=k&&!1!==k]);const Mt=!!O&&!V&&!J&&!_&&(O.editing||"hidden"!==O.state),[Ct,St]=le(null),Nt=Mt&&(!!O?.editing||!Ct),Lt=!!(k||A||W)||yt||Nt,Tt=re(Ue),zt=""!==re(mn),At=ae(null);At.current=Qe?{owner:Qe.key,tab:Qe.tab,root:!zt}:null;const Dt=me||(Qe&&!zt?Qe.key:null),Pt=!!Tt&&!zt&&Tt.enabled&&Tt.hasState&&($||Tt.declaredEditable)&&!Tt.handMounted&&Lt&&!V&&!J&&!_&&!Me,It=40,{minimize:Rt,items:Wt,restoreIfMinimized:$t,openWindows:Ot}=ft(),Kt=ae(`modal-${Math.random().toString(36).slice(2,8)}`).current,Ft=g(Kt);se(()=>{if(V)return yr.add(Kt),()=>{yr.delete(Kt)}},[V,Kt]),se(()=>{const e=e=>{const t=e.detail;t?.id===Kt&&We(t.title)};return window.addEventListener("window-title-update",e),()=>window.removeEventListener("window-title-update",e)},[Kt]);const[Bt,Ut]=le(X.window),Xt=function(e){const t=ce(P,I);return z.length<=1||t===e}(Kt),Vt=ae(O);Vt.current=O;const Jt=!!O&&!O.editing&&"enabled"===O.state;se(()=>{if(!t||!Xt||!Jt)return;const e=e=>{("KeyE"===e.code||"E"===e.key||"e"===e.key)&&e.altKey&&e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(b(e.target,ut.current)||(e.preventDefault(),e.stopPropagation(),Vt.current?.onEdit()))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,Xt,Jt]);const Gt=function(e){return ce(P,()=>Xn.has(e))}(Kt);jt({panelRef:ut,bodyRef:mt,open:t,widget:!!V,active:Xt,minimized:Gt});const _t=ce(Xr,Vr),Qt=ce(eo,to),Zt=ce(io,ao),en=!B&&!V,tn=_t&&en,[nn,on]=le(!1),sn=tn&&Zt===Kt,[ln,un]=le(!1),dn=ln&&en&&Qt===Kt?"picked":null,hn=ae(tn);se(()=>{if(hn.current&&!tn){un(!0);const e=setTimeout(()=>{un(!1),Qr===Kt&&no(null)},700);return hn.current=tn,()=>clearTimeout(e)}hn.current=tn},[tn,Kt]),se(()=>{tn||on(!1)},[tn]),se(()=>{const e=pt.current,t=wt.current;if(!e&&!t)return;const n=e=>e?Array.from(e.children).filter(e=>"shell"!==e.dataset.undoControls).length:0,r=()=>gt(n(e)+n(t)>0);r();const o=new MutationObserver(r);return e&&o.observe(e,{childList:!0}),t&&o.observe(t,{childList:!0}),()=>o.disconnect()},[t]),se(()=>{const e=e=>{if(e.target.closest('button[type="submit"]')&&ut.current){const t=ut.current.querySelector("form");t&&(e.preventDefault(),t.requestSubmit())}},t=pt.current,n=wt.current;return t&&t.addEventListener("click",e),n&&n.addEventListener("click",e),()=>{t&&t.removeEventListener("click",e),n&&n.removeEventListener("click",e)}},[t]);const pn=ae(!1),wn=ue(e,[]),vn=ue(()=>{const t=e(),n=he?he[0]:Bn[f]||672,o=t.w-80,i=t.h-80,a=Math.min(n,o),s=Un[qn()],l=he?Math.min(he[1],i):(()=>{const e=("sm"===f?500:"md"===f?600:"lg"===f?700:"xl"===f?800:920)*s;return Math.max(320,Math.min(e,t.h-80))})(),c="cascade"!==(getComputedStyle(document.documentElement).getPropertyValue("--window-position")?.trim()||"cascade")||r()?0:30*(z.length-1),u=Math.max(It,(i-l)/2),d=(o-a)/2,h=t.h-It-l-u;return"top-right"===q?{x:t.x+t.w-a-It,y:t.y+It,w:a,h:l}:"top-left"===q?{x:t.x+It,y:t.y+It,w:a,h:l}:{x:t.x+Math.max(It,(o-a)/2+It)+Math.min(c,Math.max(0,d)),y:t.y+u+Math.min(c,Math.max(0,h)),w:a,h:l}},[f]),bn=ae(!1);t||(bn.current=!1);const kn=me||d||null;se(()=>{if(!t)return;hr(Kt,kn,At.current??void 0),me||pr(Kt),pn.current=!1,Ut(Br(Kt));const e=()=>{Ut(Br(Kt))},n=()=>{},r=e=>{if(!e)return!1;if(e.windowKey)return e.windowKey===me;if(!e.label)return!1;const t=ut.current?.querySelector("[data-window-title]");return!!t?.textContent?.includes(e.label)},o=e=>{if(!r(e.detail))return;if(pr(Kt),In.current)return;const t=br(),n=Math.min(jn.current.w,t.w-40),o=Math.min(jn.current.h,t.h-40),i=t.x+(t.w-n)/2,a=t.y+(t.h-o)/2;Cn({x:i,y:a,w:n,h:o}),Kn(!1)},i=e=>{const t=e.detail;r(t)&&(pr(Kt),Ge({x:t.x,y:t.y}))},a=e=>{if(e.detail?.windowKey!==me)return;pr(Kt);const t=jn.current,n=function(e,t=br()){const n=Math.min(e.w,t.w),r=Math.min(e.h,t.h);return{w:n,h:r,x:Math.min(Math.max(e.x,t.x),t.x+t.w-n),y:Math.min(Math.max(e.y,t.y),t.y+t.h-r)}}(t);if(n.x===t.x&&n.y===t.y&&n.w===t.w&&n.h===t.h)return;const r=ut.current,o="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(r&&!o){let e=!1;const t=()=>{e||(e=!0,r.style.transition="",window.dispatchEvent(new CustomEvent("modal-geometry")))};r.style.transition="left .28s ease, top .28s ease, width .28s ease, height .28s ease",r.addEventListener("transitionend",t,{once:!0}),window.setTimeout(t,400)}Cn(n)};return window.addEventListener("modal-reorder",e),window.addEventListener("modal-split-view",n),window.addEventListener("modal-center",o),window.addEventListener("modal-reveal",a),window.addEventListener("modal-context-menu",i),()=>{!function(e){const t=z.indexOf(e);-1!==t&&(z.splice(t,1),Qn()),Xn.delete(e),Jn.delete(e),tr.delete(e);const n=er.get(e);n&&(er.delete(e),Zn.delete(n))}(Kt),window.removeEventListener("modal-reorder",e),window.removeEventListener("modal-split-view",n),window.removeEventListener("modal-center",o),window.removeEventListener("modal-reveal",a),window.removeEventListener("modal-context-menu",i),window.dispatchEvent(new CustomEvent("modal-reorder"))}},[t,Kt,kn,wn]);const En=!V&&"maximized"===qn(),[Mn,Cn]=le(()=>{if(kn&&An[kn]){const e={...An[kn]};return he&&(e.w=he[0],te||(e.h=he[1])),Lr(e)}return S?{x:S.x,y:S.y,w:S.w,h:S.h}:En?wn():vn()}),[Sn,Nn]=le(()=>!te),Ln=ae(ke),Tn=ae(null);se(()=>{const e=()=>{const e=r();e!==Ln.current&&Tn.current?.(e),Ln.current=e,Ee(e),Ut(Br(Kt))};return window.addEventListener("react-os-shell:layout-mode-changed",e),()=>window.removeEventListener("react-os-shell:layout-mode-changed",e)},[Kt]);const zn=ke&&!!Qe?.tab&&!zt&&!V&&!Me,Dn=zn,In=ae(Dn);In.current=Dn;const Rn=rr(),Wn=ke&&!!Qe?.tab&&!V&&!Me&&!_t&&Rn!==Qe.key,$n=!!V&&ke&&!_t&&null!==Rn,[On,Kn]=le(()=>kn&&An[kn]||S?Dn:Dn||En),jn=ae(Mn);jn.current=Mn;const Fn=ae(On);ie(()=>{Fn.current=On},[On]),ie(()=>{if(Sn||zn)return;const e=ut.current,t=mt.current;if(!e||!t)return;const n=ne??(V?0:240),r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0;let o=0,i=null,a=null;const s=()=>{const c=t.firstElementChild;if(!c||e.offsetHeight<=0)return;c!==a&&(a&&l.unobserve(a),l.observe(c),a=c);const u=e.offsetHeight-t.offsetHeight,d=t.style.flex,h=t.style.overflowY,m=t.style.height;t.style.flex="0 0 auto",t.style.height="auto",t.style.overflowY="visible";const f=t.offsetHeight,p=c.offsetHeight;t.style.flex=d,t.style.height=m,t.style.overflowY=h;const w=c.offsetHeight>p+4,y=Math.max(n,window.innerHeight-r-Math.max(0,jn.current.y)-24),g=w?Math.min(jn.current.h,y):Math.min(Math.max(n,u+f),y),v=Math.abs(g-o)>1;v&&(o=g,Cn(e=>Math.abs(e.h-g)>1?{...e,h:g}:e)),V||(g<=n?i&&(clearTimeout(i),i=null):(v||null===i)&&(i&&clearTimeout(i),i=setTimeout(()=>{const e=o;s(),o===e&&Nn(!0)},160)))},l=new ResizeObserver(s);s(),vt.current&&l.observe(vt.current);const c=new MutationObserver(s);return c.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),c.disconnect(),i&&clearTimeout(i)}},[Sn,V,ne,Lt,zn]),ie(()=>{if(!te||!Sn||V||!t)return;const e=vt.current;if(!e)return;let n=e.offsetHeight;const r=new ResizeObserver(()=>{if(!e.isConnected)return;const t=e.offsetHeight,r=t-n,o=t>0!=n>0;if(n=t,!o||0===r||On)return;if(document.body.classList.contains("rosh-gesturing"))return;const i=ne??240,a=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height"))||0,s=Math.max(i,window.innerHeight-a-Math.max(0,jn.current.y)-24);Cn(e=>({...e,h:Math.min(Math.max(i,e.h+r),s)}))});return r.observe(e),()=>r.disconnect()},[te,Sn,V,t,On,ne]);const Yn=!1!==oe&&!V&&!_&&!Me,[Vn,Gn]=le(()=>!Yn);ie(()=>{if(Vn||!t)return;if(!Yn||On)return void Gn(!0);const n=ut.current,r=mt.current;if(!n||!r)return;const o=/* @__PURE__ */new WeakSet;let l=jn.current.w,c=0;const u=()=>Gn(!0),d=()=>{c=0;const t=jn.current;if(Math.abs(t.w-l)>1||document.body.classList.contains("rosh-gesturing"))return void u();const d=e(),h=d.w-80;if(t.w>=h)return void u();const m=[],f=[];for(const e of[r,...Array.from(r.querySelectorAll("*"))]){const t=e.scrollWidth-e.clientWidth;if(t<=4||o.has(e))continue;const n=getComputedStyle(e).overflowX;"auto"!==n&&"scroll"!==n||(m.push(e),f.push(t))}if(!m.length)return;const p=Math.min(h,t.w+Math.max(...f)),w=p-t.w,y=n.style.width;n.style.width=`${p}px`;const g=m.map((e,t)=>({over:f[t],residual:e.scrollWidth-e.clientWidth}));n.style.width=y,g.forEach((e,t)=>{i(e,w)||o.add(m[t])});const v=a(t,s(t.w,w,g),d,It);v!==t&&(l=v.w,Cn(v))};d();const h=new MutationObserver(()=>{c||(c=requestAnimationFrame(d))});h.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["style","class","hidden"]});const m=setTimeout(u,Hn);return()=>{h.disconnect(),c&&cancelAnimationFrame(c),clearTimeout(m)}},[Vn,t,Yn,On]);const _n=ae(null),nr=!(!Qe?.tab||zt||V||Me);Tn.current=t=>{if(!nr)return;if(t)return _n.current||(_n.current={box:{...jn.current},maximized:Fn.current}),void(Fn.current=!0);const r=_n.current;_n.current=null;const o=e();if(r?.maximized)return Fn.current=!0,Kn(!0),void Cn(o);const i=r?.box??(kn?An[kn]:void 0);if(Fn.current=!1,Kn(!1),i&&!n(i,o,!1)){const e={...i};he&&(e.w=he[0],te||(e.h=he[1])),Cn(Lr(e))}else Cn(vn())},se(()=>{Dn&&(Fn.current=!0,Kn(!0),Cn(wn()))},[Dn,wn]),se(()=>{if(V)return;const e=()=>{const e=kn?An[kn]:void 0;if(Fn.current=!1,Kn(!1),e){const t={...e};he&&(t.w=he[0],te||(t.h=he[1])),Cn(Lr(t))}else Cn(vn())};return window.addEventListener("react-os-shell:restore-windowed",e),()=>window.removeEventListener("react-os-shell:restore-windowed",e)},[V,vn,kn]),se(()=>{t&&kn&&!zn&&(An[kn]=Mn,Pn()),t&&window.dispatchEvent(new CustomEvent("modal-geometry"))},[Mn,t,kn,zn]),se(()=>{if(!t)return;const e=()=>{Fn.current?Cn(wn()):document.body.classList.contains("rosh-gesturing")||Cn(Lr)};window.addEventListener("resize",e),window.addEventListener(o,e);let n=null;return On&&(n=new MutationObserver(e),n.observe(document.body,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["class"]})),()=>{window.removeEventListener("resize",e),window.removeEventListener(o,e),n?.disconnect()}},[t,On,wn]),se(()=>{if(t&&(Be(!1),He.current=!1,ct.current=!1,Gn(!Yn),!In.current)){if(kn&&An[kn]){const e=An[kn];return void Cn(t=>Lr({...e,...te?{h:t.h}:{},...Yn?{x:t.x,w:t.w}:{}}))}S&&(Cn({x:S.x,y:S.y,w:S.w,h:S.h}),Kn(S.maximized))}},[t]),se(()=>{if(!t||"auto"!==p)return;let e;const n=t=>{ut.current?.contains(t.target)&&!He.current&&(He.current=!0,e=setTimeout(()=>Be(!0),0))};return document.addEventListener("input",n,!0),document.addEventListener("change",n,!0),()=>{clearTimeout(e),document.removeEventListener("input",n,!0),document.removeEventListener("change",n,!0)}},[t,p]);const or="auto"===p?Fe:!0===p,ir=Qe&&!zt?Qe.key:null,ar=pe(()=>rn(Ie),[Ie]),sr=ae({shortcutSpec:_e,isOnDesktop:rt,toggleDesktopShortcut:ot,taskbarStrings:$e.taskbar});ie(()=>{sr.current={shortcutSpec:_e,isOnDesktop:rt,toggleDesktopShortcut:ot,taskbarStrings:$e.taskbar}});const cr=ae(null);cr.current||(cr.current={open:(e,t)=>Ge({x:e,y:t}),items:()=>{const e=sr.current,t=[];e.shortcutSpec&&t.push({label:e.isOnDesktop?e.taskbarStrings.removeFromDesktop:e.taskbarStrings.addToDesktop,onSelect:e.toggleDesktopShortcut});for(const e of xn[Kt]||[])t.push({label:e.label,icon:e.icon,onSelect:e.onClick});return t}}),se(()=>{if(t&&ir)return()=>{return e=ir,void(an.delete(e)&&cn());var e}},[t,ir]),ht(!(me||!t)&&or);const ur=ue(()=>or||"auto"===p&&He.current,[or,p]),dr=ue(async e=>{if(ct.current)return!1;if(!ur())return!0;ct.current=!0;const t=Ke,n="close"===e?"Are you sure you want to close?":"discard"===e?"Are you sure you want to stop editing?":"Are you sure you want to continue?",r=await y({title:"Discard changes?",message:t?`“${t}” has unsaved changes. ${n} All changes will be lost.`:`You have unsaved changes. ${n} All changes will be lost.`,confirmLabel:"Discard",cancelLabel:"Keep Editing",variant:"warning"});return ct.current=!1,r},[ur,Ke]),mr=ue(()=>ct.current?Promise.resolve():ur()?dr("close").then(e=>{e&&l()}):(l(),Promise.resolve()),[ur,dr,l]),fr=ue(async()=>{await dr("discard")&&(He.current=!1,Be(!1),Vt.current?.onDiscard())},[dr]),Mr=ue(async()=>{const e=await dr("switch");return e&&(He.current=!1,Be(!1)),e},[dr]),Cr=ae(()=>!1);ie(()=>{Cr.current=ur}),ie(()=>{if(!t||!me)return;const e={holdsChanges:()=>Cr.current(),ask:Mr};return lr.set(me,e),()=>{lr.get(me)===e&&lr.delete(me)}},[t,me,Mr]),ie(()=>{if(!t||!Dt)return;const e=e=>{e.detail?.windowKey===Dt&&mr()};return window.addEventListener(Hr,e),()=>window.removeEventListener(Hr,e)},[t,Dt,mr]);const Tr=ae(null),Ar=ue(e=>{if(0!==e.button)return;if(e.target.closest("button, input, a, kbd, select, textarea"))return;if(Ge(null),pr(Kt),In.current)return void e.preventDefault();e.preventDefault();const t=e.currentTarget,n=e.pointerId;let r=null;const o=e.clientX,i=e.clientY,a=ut.current,s=a?.getBoundingClientRect();let l,c,u,d;if(Tr.current){const t=Tr.current;Tr.current=null,d=t.w,u=t.h;const n=s?Math.min(Math.max(20,e.clientX-s.left),t.w-20):t.w/2;l=e.clientX-n,c=e.clientY-12,a&&(a.style.width=`${d}px`,a.style.height=`${u}px`,a.style.left=`${l}px`,a.style.top=`${c}px`)}else l=s?s.left:jn.current.x,c=s?s.top:jn.current.y,u=s?s.height:jn.current.h,d=s?s.width:jn.current.w;Kn(!1),Cn(e=>({...e,x:l,y:c,w:d,h:u}));let h=null;const m=e=>{if(!r){if(Math.abs(e.clientX-o)<jr&&Math.abs(e.clientY-i)<jr)return;r=Fr(t,n,"move","move"),a&&(a.style.transition="none")}const s=l+e.clientX-o,u=Math.max(0,c+e.clientY-i);if(a&&(a.style.transform=`translate(${s-l}px, ${u-c}px)`),jn.current={...jn.current,x:s,y:u},!V){const t=function(e,t){const n=br(),r=e<=n.x+gr,o=e>=n.x+n.w-gr,i=t<=n.y+gr,a=t>=n.y+n.h-gr,s=e<=n.x+vr,l=e>=n.x+n.w-vr,c=t<=n.y+vr,u=t>=n.y+n.h-vr;return i&&s?"tl":i&&l?"tr":a&&s?"bl":a&&l?"br":c&&r?"tl":c&&o?"tr":u&&r?"bl":u&&o?"br":i?"top":r?"left":o?"right":null}(e.clientX,e.clientY);t!==h&&(h=t,t?Dr(zr(t)):Pr())}},f=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",f),r?.(),Pr();const e=Lr({...jn.current});if(jn.current=e,!V&&h){Tr.current={x:l,y:c,w:d,h:u};const e=zr(h);return a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.width=`${e.w}px`,a.style.height=`${e.h}px`,a.style.transform="",a.style.transition=""),void Cn(e)}if(V){const t=e.x+e.w/2,n=window.innerWidth/2;lt(t>n?"right":"left")}a&&(a.style.left=`${e.x}px`,a.style.top=`${e.y}px`,a.style.transform="",a.style.transition=""),Cn(e)};window.addEventListener("pointermove",m),window.addEventListener("pointerup",f)},[]),Ir=ue((e,t)=>{if(0!==e.button)return;e.preventDefault(),e.stopPropagation();const n=e.currentTarget,r=e.pointerId;let o=null;const i=e.clientX,a=e.clientY,s=ut.current,l=s?.getBoundingClientRect(),c=l?l.left:jn.current.x,u=l?l.top:jn.current.y,d=l?l.width:jn.current.w,h=l?l.height:jn.current.h,m="sw"===t||"nw"===t||"w"===t,f="ne"===t||"nw"===t||"n"===t,p="se"===t||"ne"===t||"e"===t,w="se"===t||"sw"===t||"s"===t;Kn(!1),Cn({x:c,y:u,w:d,h:h}),jn.current={x:c,y:u,w:d,h:h};let y=0,g=null;const v=()=>{if(y=0,!g)return;const e=g;g=null,jn.current=e,s&&(s.style.left=`${e.x}px`,s.style.top=`${e.y}px`,s.style.width=`${e.w}px`,s.style.height=`${e.h}px`)},b=e=>{if(!o){if(Math.abs(e.clientX-i)<jr&&Math.abs(e.clientY-a)<jr)return;o=Fr(n,r,Kr[t],"resize")}g=((e,t)=>{let n=c,r=u,o=d,i=h;if(p&&(o=Math.max(Sr,d+e)),w&&(i=Math.max(Nr,h+t)),m){const t=Math.max(Sr,d-e);n=c+d-t,o=t}if(f){const e=Math.max(Nr,h-t);r=u+h-e,i=e}return{x:n,y:r,w:o,h:i}})(e.clientX-i,e.clientY-a),y||(y=requestAnimationFrame(v))},x=()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",x),y&&cancelAnimationFrame(y),v(),o?.(),Cn({...jn.current})};window.addEventListener("pointermove",b),window.addEventListener("pointerup",x)},[]),Rr=ue(e=>{if(e.target.closest("button, input, a, kbd, select, textarea"))return;const t={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]}[e.key];if(!t&&"Enter"!==e.key)return;if(e.preventDefault(),e.stopPropagation(),pr(Kt),"Enter"===e.key)return void(On?(Kn(!1),Cn(vn())):(Kn(!0),Cn(wn())));const[n,r]=t;if(e.ctrlKey||e.metaKey){const e=()=>{Tr.current||(Tr.current={...jn.current})};if(r<0)return e(),Kn(!0),void Cn(wn());if(r>0){if(On)return Kn(!1),void Cn(vn());if(Tr.current){const e=Lr(Tr.current);return Tr.current=null,jn.current=e,void Cn(e)}return void wr(Kt)}e(),Kn(!1);const t=zr(n<0?"left":"right");return jn.current=t,void Cn(t)}if(On)return;const o=jn.current,i=e.shiftKey?{...o,w:Math.max(Sr,o.w+24*n),h:Math.max(Nr,o.h+24*r)}:Lr({...o,x:o.x+24*n,y:Math.max(0,o.y+24*r)});jn.current=i,Cn(i)},[Kt,On,vn,wn]),Wr=ue(e=>{Tr.current||(Tr.current={...jn.current}),Kn(!1);const t=zr(e);jn.current=t,Cn(t),pr(Kt)},[Kt]),Or=!V&&!zn&&!Me,[Yr,qr]=le(0),Ur=Or&&!J&&!_&&(!!A||!!W||yt||Nt||Pt),Gr=Or&&Yr>0,_r=ae(Gr);_r.current=Gr;const Zr=!!J||!!_,ro=Zr?"h-(--row-height-compact-bar)":"h-(--row-height-window-bar)",oo=ue(e=>{const t=e.closest("[data-window-body]");if(!t)return null;const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return Math.abs(n.left-r.left)>2||Math.abs(n.top-r.top)>2?null:(qr(e=>e+1),()=>qr(e=>Math.max(0,e-1)))},[]),so=pe(()=>Or?{compact:Zr,over:Gr,claim:oo}:null,[Or,Zr,Gr,oo]),lo=ue(e=>{if(tn)return;e.preventDefault(),e.stopPropagation();const t=0===e.clientX&&0===e.clientY,n=e.currentTarget.getBoundingClientRect();Ge(t?{x:n.left,y:n.bottom+4}:{x:e.clientX,y:e.clientY})},[tn]),co=!!ye&&tt&&!V&&!Me,uo=Dn||tn?{}:{tabIndex:0,role:"group","aria-label":Ke?`${Ke} — ${Oe.windowSuffix}`:Oe.windowSuffix,"aria-keyshortcuts":"ArrowUp ArrowDown ArrowLeft ArrowRight Shift+ArrowUp Shift+ArrowDown Shift+ArrowLeft Shift+ArrowRight Control+ArrowUp Control+ArrowDown Control+ArrowLeft Control+ArrowRight Enter",onKeyDown:Rr},ho=()=>{Kn(!0),Cn(wn())},mo=ue(()=>{const e=ut.current;if(!e)return;const t=e.querySelector("form");if(t)t.requestSubmit();else{const t=e.querySelector(yn);t&&!t.disabled&&t.click()}},[]);se(()=>{if(!t)return;if(V)return;const e=e=>{if(z[z.length-1]===Kt&&!b(e.target,ut.current)&&"Enter"===e.key){const t=e.target;if("TEXTAREA"===t.tagName||t.isContentEditable)return;if(e.metaKey||e.ctrlKey)e.preventDefault(),mo();else{if("INPUT"===t.tagName&&t.closest("form"))return;if(!(t instanceof Element&&ut.current?.contains(t)))return;if(t.closest(R))return;e.preventDefault()}}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,mo,Kt,V]),se(()=>{if(!t)return;const e=e=>{z[z.length-1]===Kt&&(b(e.target,ut.current)||((e.metaKey||e.ctrlKey)&&"s"===e.key?(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-save",{detail:{modalId:Kt}})),He.current=!1,Be(!1)):e.altKey&&e.shiftKey&&("KeyD"===e.code||"D"===e.key||"d"===e.key)&&(e.preventDefault(),document.dispatchEvent(new CustomEvent("modal-duplicate",{detail:{modalId:Kt}})))))};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]),se(()=>{if(!t)return;if(V)return;const e=e=>{if("Escape"===e.key&&z[z.length-1]===Kt){if(Z(e))return e.preventDefault(),void e.stopPropagation();if(zn&&!$)return;e.preventDefault(),e.stopPropagation(),mr()}};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t,mr,Kt,V,zn,$]);const fo=t&&(void 0!==w||void 0!==v),[po]=le(()=>{if("undefined"==typeof document)return null;const e=document.createElement("span");return e.className="flex shrink-0 items-center gap-2",e.setAttribute("data-tab-actions",""),e}),wo=zn&&!Qe?.home&&ar.actions.length>0;se(()=>{t&&ir&&function(e,t){const n=an.get(e);n&&n.title===t.title&&n.dirty===t.dirty&&n.copy===t.copy&&n.actions===t.actions&&n.menu===t.menu||(an.set(e,t),cn())}(ir,{title:ar.text||Ke,dirty:or,copy:ar.copy,actions:wo&&po?po:void 0,menu:cr.current??void 0})},[t,ir,Ke,or,ar.text,ar.copy,wo,po]);const yo=ue(e=>{const t=document.getElementById("nav-boundary-toast");t&&t.remove();const n="bottom"===e?["That's the last one, chief.","You've hit rock bottom... of the list.","End of the line, buddy.","Nothing left. Go outside.","Congratulations, you scrolled to the void.","There's no more. I checked.","You've reached the edge of the known universe.","Plot twist: there is no next one.","Even scrolling has limits. Unlike your ambition.","Last one. Time to touch grass."]:["Already at the top. Overachiever.","There is no item above this. Trust me.","You're #1. Literally.","Can't go higher. You've peaked.","This is it. The summit. The top.","First item. No VIP lounge above this.","Going up? Nope. Elevator's broken.","You want negative indexes? Bold.","Top of the list. Top of the world.","The only way is down from here."],r=n[Math.floor(Math.random()*n.length)],o=document.createElement("div");o.id="nav-boundary-toast",o.className="fixed bottom-6 left-1/2 -translate-x-1/2 z-(--z-toast) bg-gray-900 text-on-accent flex min-h-10 items-center px-5 py-3 rounded-lg shadow-lg text-sm font-medium transition-opacity duration-300",o.textContent=r,document.body.appendChild(o),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),300)},2e3)},[]);if(se(()=>{if(!t)return;const e=e=>{if(z[z.length-1]!==Kt)return;if(b(e.target,ut.current))return;const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.target.isContentEditable||("j"===e.key&&fo&&(e.preventDefault(),w?w():yo("bottom")),"k"===e.key&&fo&&(e.preventDefault(),v?v():yo("top"))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,w,v,fo,yo,Kt]),!t||bn.current)return null;const go=tn?function(e){if("undefined"==typeof document)return null;const t=Array.from(document.querySelectorAll("[data-modal-panel]")).filter(e=>{const t=e;return!t.hasAttribute("data-utility")&&!t.hasAttribute("data-widget")&&"none"!==t.style.display});t.sort((e,t)=>(e.getAttribute("data-modal-id")||"").localeCompare(t.getAttribute("data-modal-id")||""));const n=t.findIndex(t=>t.getAttribute("data-modal-id")===e),r=t.length;if(n<0||r<1)return null;const o=Math.ceil(Math.sqrt(r)),i=Math.ceil(r/o),a=Math.floor(n/o),s=n%o,l=r-o*(i-1),c=a===i-1&&l<o,u=br(),d=(u.w-20*(o+1))/o,h=(u.h-14*(i+1)-22*i)/i,m=c?(o-l)*(d+20)/2:0;return{x:u.x+20+s*(d+20)+m,y:u.y+14+a*(h+14+22),w:d,h:h}}(Kt):null,vo=tn&&go?G({width:go.w,height:go.h},{width:Mn.w,height:Mn.h}):1,bo=(()=>{if(tn&&go){const e=vo,t=Mn.w*e,n=Mn.h*e,r=go.x+(go.w-t)/2-Mn.x,o=go.y+(go.h-n)/2-Mn.y,i=nn||sn;return{transform:`translate(${r}px, ${o}px) scale(${e})`,transformOrigin:"top left",transition:"transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms",cursor:"pointer",zIndex:X.expose+(i?20:10),boxShadow:i?"0 24px 72px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,255,255,0.55), 0 0 36px 12px rgba(96,165,250,0.85), 0 0 96px 28px rgba(96,165,250,0.55)":"0 16px 48px rgba(0,0,0,0.55)",pointerEvents:"auto"}}if(ln&&en){const e="picked"===dn;return{transition:e?"transform 640ms cubic-bezier(0.34, 1.42, 0.64, 1), box-shadow 600ms":"transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 600ms",...e?{zIndex:X.expose+30}:{}}}return null})(),xo=x({modal:!1,titleId:!V&&(zn?!Qe?.home:!Me)?je:void 0,label:ar.text||Ke}),ko=Mt&&O&&!O.editing?"object"==typeof O.state?/* @__PURE__ */be(H,{variant:"secondary",size:"sm","data-modal-edit":"","aria-disabled":!0,disabledReason:O.state.disabledReason,children:Oe.edit}):/* @__PURE__ */be(H,{variant:"secondary",size:"sm","data-modal-edit":"",onClick:()=>O.onEdit(),children:Oe.edit}):null,Eo=/* @__PURE__ */ve("div",{children:[
|
|
50
|
+
/* @__PURE__ */ve("div",{ref:ut,"data-modal-panel":!0,"data-modal-id":Kt,"data-window-key":me||void 0,...B?{"data-utility":""}:{},...Ye?{"data-pinned-top":""}:{},...V?{"data-widget":""}:{},...Qe?{"data-window-owner":Qe.key}:{},...Qe&&!zt?{"data-window-root":""}:{},...zn?{"data-window-tab":""}:{},...xo,className:zn?"fixed flex flex-col overflow-hidden":"fixed rounded-(--radius-window) flex flex-col overflow-hidden "+(V?Xt?"shadow-xl":"shadow-lg":"border "+(Xt?"shadow-xl border-line":"shadow-lg border-line-strong")),onPointerDown:e=>{if(!_r.current||tn||0!==e.button)return;const t=e.target;if(t.closest("[data-modal-panel]")!==ut.current)return;if(t.closest("[data-window-chrome]"))return;if(t.closest("[data-sidebar-rail]"))return void(t.closest(m)||Ar(e));const n=e.currentTarget.getBoundingClientRect(),r=n.height/(e.currentTarget.offsetHeight||n.height),o=(Zr?E.compactBar:E.windowBar)*r;e.clientY-n.top>o||t.closest(m)||Ar(e)},onContextMenu:e=>{const t=e.target;t.closest("[data-window-strip]")&&t.closest("[data-modal-panel]")===ut.current&&lo(e)},onMouseDownCapture:e=>{if(dt.current=!1,tn){if(e.target.closest("[data-expose-close]"))return;return e.preventDefault(),e.stopPropagation(),no(Kt),Jr(!1),void pr(Kt)}if(!Xt&&!V&&!Ye&&0===e.button){const t=e.target;t.closest("[data-modal-panel]")===ut.current&&t.closest("button, input, a, select, textarea")&&!t.closest("[data-window-chrome]")&&(e.preventDefault(),e.stopPropagation(),dt.current=!0,Ge(null),pr(Kt),window.addEventListener("mouseup",()=>{setTimeout(()=>{dt.current=!1},0)},{once:!0}))}},onClickCapture:e=>{dt.current&&(dt.current=!1,e.preventDefault(),e.stopPropagation())},onMouseDown:e=>{if(tn)return;Ge(null);e.target.closest("[data-modal-panel]")===ut.current&&(e.target.closest("button, input, a, select, textarea")||pr(Kt))},style:Me?{zIndex:Bt+1,top:0,left:0,right:0,bottom:"var(--mobile-bottom-nav, 56px)",width:"auto",height:"auto",transform:`translateX(${Se}px)`,transition:Le?"none":"transform 180ms ease-out",...V?{display:"none"}:{},...Bt<0?{display:"none"}:{},...Xt||Ye||Pe&&me===Pe?{}:{display:"none"},...Ft?{visibility:"hidden",pointerEvents:"none"}:{}}:{zIndex:Ye?X.pinnedWindow:Bt+1,width:Mn.w,height:Mn.h,top:Mn.y,...V&&"right"===st?{right:window.innerWidth-Mn.x-Mn.w}:{left:Mn.x},...Bt<0&&!Ye?{display:"none"}:{},...Ce?{display:"none"}:{},...Wn||$n||Ft?{visibility:"hidden",pointerEvents:"none"}:{},...bo??{}},children:[Me&&!V&&/* @__PURE__ */be("div",{onPointerDown:De,className:"absolute top-0 bottom-0 left-0 w-[22px] z-[5]",style:{touchAction:"pan-y"},"aria-hidden":"true"}),
|
|
51
|
+
/* @__PURE__ */ve("div",{"data-window-surface":"",className:"flex min-h-0 flex-1 flex-col "+(Or?"backdrop-blur-sm":""),style:Or?{backgroundColor:Xt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"}:void 0,children:[V?null:zn?Qe?.home?null:/* @__PURE__ */ve(xe,{children:[
|
|
52
|
+
/* @__PURE__ */be("h2",{id:je,"data-window-title":!0,className:"sr-only",children:ar.text||Ke}),wo&&po&&U(
|
|
53
|
+
/* @__PURE__ */be(xe,{children:ar.actions}),po),ar.badges.length>0&&/* @__PURE__ */be("div",{"data-window-chrome":"","data-record-bar":"",className:"flex h-9 shrink-0 select-none items-center gap-2 overflow-hidden border-b border-gray-200 px-4",style:{backgroundColor:"rgb(var(--window-content-rgb))"},children:ar.badges})]}):Me?null:
|
|
54
|
+
/* @__PURE__ */ve("div",{onPointerDown:Ar,onContextMenu:lo,"data-window-chrome":"",...Gr?{"data-window-controls-over":""}:{},...uo,className:Gr?`absolute left-0 z-10 flex ${ro} items-center px-3 select-none focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400`:`flex items-center gap-3 ${ro} px-3 shrink-0 cursor-move select-none focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400`,style:{touchAction:"none",...Gr?{top:co?3:0}:{}},children:[!tn&&/* @__PURE__ */ve("div",{"data-window-controls":"",className:"group/controls flex shrink-0 items-center",children:[
|
|
55
|
+
/* @__PURE__ */be("button",{type:"button",onClick:mr,"aria-label":Oe.close,title:Oe.close,className:xr,children:/* @__PURE__ */be("span",{"aria-hidden":"true",className:`${kr} ${Xt?"bg-red-500":"bg-gray-300 group-hover/controls:bg-red-500"}`,children:/* @__PURE__ */be(Y,{name:"close",className:Er,strokeWidth:3})})}),!J&&/* @__PURE__ */be("button",{type:"button",onClick:()=>wr(Kt),"aria-label":Oe.minimize,title:Oe.minimize,className:xr,children:/* @__PURE__ */be("span",{"aria-hidden":"true",className:`${kr} ${Xt?"bg-amber-400":"bg-gray-300 group-hover/controls:bg-amber-400"}`,children:/* @__PURE__ */be("span",{className:"h-0.5 w-2 rounded-full bg-current opacity-0 group-hover/controls:opacity-100 group-focus-within/controls:opacity-100"})})}),!J&&/* @__PURE__ */be($r,{maximized:On,onToggleMax:()=>{On?(Kn(!1),Cn(vn())):ho()},onSnap:Wr,buttonClassName:xr,strings:Oe,children:/* @__PURE__ */be("span",{"aria-hidden":"true",className:`${kr} ${Xt?"bg-green-500":"bg-gray-300 group-hover/controls:bg-green-500"}`,children:/* @__PURE__ */be(Y,{name:On?"collapse":"expand",className:Er,strokeWidth:3})})}),B&&/* @__PURE__ */be("button",{type:"button",onClick:()=>Xe(e=>!e),"aria-label":Ye?Oe.unpin:Oe.pinOnTop,title:Ye?Oe.unpin:Oe.pinOnTop,className:"ml-1 p-0.5 rounded hover:bg-gray-200 "+(Ye?"text-blue-600":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */be(Y,{name:"bookmark-square",className:"h-3.5 w-3.5",fill:Ye?"currentColor":"none",strokeWidth:1.5})})]}),Gr?
|
|
56
|
+
/* @__PURE__ */be("h2",{id:je,"data-window-title":!0,className:"sr-only",children:ar.text||Ke}):/* @__PURE__ */be("div",{"data-window-title":!0,title:Ke,className:"text-sm font-medium min-w-0 flex-1 truncate flex items-center gap-2",style:{color:Xt?"var(--window-title-active, rgb(17 24 39))":"var(--window-title-inactive, rgb(156 163 175))"},children:/* @__PURE__ */be("span",{id:je,className:"truncate",children:tn?gn(Ie):Ie})})]}),co&&/* @__PURE__ */be("div",{"aria-hidden":"true",className:"h-[3px] shrink-0 pointer-events-none",style:{backgroundColor:`rgb(var(--window-accent-rgb) / ${Xt?.9:.55})`}}),
|
|
57
|
+
/* @__PURE__ */be(mn.Provider,{value:Kt,children:/* @__PURE__ */be(h.Provider,{value:so,children:/* @__PURE__ */be(D.Provider,{value:{rightRef:pt,leftRef:wt,notify:()=>gt(!0),setEditSlot:St,active:Xt,isDirty:or,footerOpen:Lt&&!V&&!J&&!_&&!Me},children:/* @__PURE__ */be("div",{ref:mt,"data-window-body":"",...V?{onPointerDown:Ar,onContextMenu:e=>{e.preventDefault(),at({x:e.clientX,y:e.clientY})}}:{},className:`flex-1 min-h-0 flex flex-col ${V?"p-0 cursor-move":_||Q?"p-0":J?"p-2":"p-4"} ${V||zn||Or?"":"backdrop-blur-sm"} ${!1===M||_||Q?"overflow-hidden":"overflow-y-auto overscroll-contain"+(Or?Ur?" mr-1":" mb-2 mr-1":"")} ${V?"rounded-2xl select-none":""}`,style:{...V?{touchAction:"none"}:{},backgroundColor:V||Or?"transparent":zn?"rgb(var(--window-content-rgb))":Xt?"rgb(var(--window-content-rgb) / var(--active-content-opacity, 0.9))":"rgb(var(--window-content-rgb) / var(--inactive-content-opacity, 0.8))"},children:/* @__PURE__ */be(qe,{children:ge})})})})}),V&&it&&/* @__PURE__ */ve(K,{minWidth:160,style:{left:it.x,top:it.y},onClose:()=>at(null),children:[
|
|
58
|
+
/* @__PURE__ */be(j,{onClick:()=>{at(null),window.dispatchEvent(new CustomEvent("widget-open-settings",{detail:Kt}))},children:"Settings"}),
|
|
59
|
+
/* @__PURE__ */be(F,{}),de&&/* @__PURE__ */ve(xe,{children:[de,
|
|
60
|
+
/* @__PURE__ */be(F,{})]}),
|
|
61
|
+
/* @__PURE__ */ve(j,{onClick:()=>{at(null),Xe(e=>!e)},children:[
|
|
62
|
+
/* @__PURE__ */be("span",{className:"flex-1",children:"Always on Top"}),Ye&&/* @__PURE__ */be(Y,{name:"check",className:"h-4 w-4 text-blue-600 shrink-0",strokeWidth:2})]}),
|
|
63
|
+
/* @__PURE__ */be(F,{}),
|
|
64
|
+
/* @__PURE__ */be(j,{onClick:()=>{at(null),mr()},children:"Close"})]}),
|
|
65
|
+
/* @__PURE__ */ve("div",{onPointerDown:Ar,ref:vt,"data-modal-footer":"",...Or?{"data-modal-footer-bare":""}:{},className:Or?"px-4 py-2 shrink-0 flex items-center justify-between text-xs select-none cursor-move"+(Ur?"":" hidden"):`px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none${zn?"":" cursor-move"}${Xt&&!zn?" backdrop-blur-sm":""}${V||J||_||Me||!Lt?" hidden":""}`,style:Or?{touchAction:"none"}:{touchAction:"none",backgroundColor:zn?"rgb(var(--window-footer-rgb))":Xt?"rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))":"rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))"},children:[
|
|
66
|
+
/* @__PURE__ */ve("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[Pt&&/* @__PURE__ */be(Ve,{auto:!0}),W,
|
|
67
|
+
/* @__PURE__ */be("div",{ref:wt,"data-modal-actions-left":!0,className:"flex items-center gap-2 shrink-0"}),null!=k&&!1!==k&&!Or&&
|
|
68
|
+
/* @__PURE__ */be("div",{ref:bt,"data-modal-footer-facts":"",className:"min-w-0 flex-1 overflow-hidden",children:/* @__PURE__ */be("div",{ref:xt,className:"inline-flex items-center gap-2 whitespace-nowrap"+(kt?" invisible":""),children:k})})]}),
|
|
69
|
+
/* @__PURE__ */ve("div",{"data-modal-footer-right":"",className:"flex items-center gap-2 ml-auto shrink-0",children:[Mt&&O&&(O.editing?/* @__PURE__ */be(H,{variant:"secondary",size:"sm","data-modal-discard":"",onClick:()=>{fr()},children:Oe.discard}):Ct?U(ko,Ct):ko),
|
|
70
|
+
/* @__PURE__ */be("div",{ref:pt,"data-modal-actions":!0,className:"flex items-center gap-2"}),A]})]})]}),!V&&!Me&&!tn&&Xt&&!Dn&&/* @__PURE__ */ve(xe,{children:[
|
|
71
|
+
/* @__PURE__ */be("div",{onPointerDown:e=>Ir(e,"se"),className:"absolute bottom-0 right-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
72
|
+
/* @__PURE__ */be("div",{onPointerDown:e=>Ir(e,"sw"),className:"absolute bottom-0 left-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
73
|
+
/* @__PURE__ */be("div",{onPointerDown:e=>Ir(e,"ne"),className:"absolute top-0 right-0 w-3 h-3 cursor-nesw-resize z-10"}),
|
|
74
|
+
/* @__PURE__ */be("div",{onPointerDown:e=>Ir(e,"nw"),className:"absolute top-0 left-0 w-3 h-3 cursor-nwse-resize z-10"}),
|
|
75
|
+
/* @__PURE__ */be("div",{onPointerDown:e=>Ir(e,"n"),className:"absolute top-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
76
|
+
/* @__PURE__ */be("div",{onPointerDown:e=>Ir(e,"s"),className:"absolute bottom-0 left-3 right-3 h-1 cursor-ns-resize"}),
|
|
77
|
+
/* @__PURE__ */be("div",{onPointerDown:e=>Ir(e,"e"),className:"absolute top-3 bottom-3 right-0 w-1 cursor-ew-resize"}),
|
|
78
|
+
/* @__PURE__ */be("div",{onPointerDown:e=>Ir(e,"w"),className:"absolute top-3 bottom-3 left-0 w-1 cursor-ew-resize"})]}),tn&&/* @__PURE__ */be("div",{className:"absolute inset-0",style:{zIndex:X.hint,cursor:"pointer",background:"transparent"},onMouseEnter:()=>on(!0),onMouseLeave:()=>on(!1),onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),pr(Kt),Jr(!1)},onClick:e=>{e.stopPropagation(),e.preventDefault()},children:nn&&/* @__PURE__ */be("button",{type:"button","data-expose-close":!0,"aria-label":$e.taskbar.closeWindow,title:"Close",className:"absolute flex items-center justify-center rounded-full bg-black/55 text-on-accent shadow-lg ring-1 ring-white/40 transition-colors hover:bg-red-500",style:{top:8,right:8,width:30,height:30,transform:`scale(${1/vo})`,transformOrigin:"top right",zIndex:X.raised},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onClick:e=>{e.stopPropagation(),e.preventDefault(),mr()},children:/* @__PURE__ */be(Y,{name:"close",className:"h-4 w-4",strokeWidth:2.2})})})]}),tn&&go&&/* @__PURE__ */be("div",{className:"fixed pointer-events-none select-none truncate text-center",style:{left:go.x,top:go.y+go.h+4,width:go.w,zIndex:X.expose+(nn?21:11),color:"white",fontSize:"var(--text-xs)",fontWeight:500,textShadow:"0 1px 2px rgba(0,0,0,0.6)"},children:gn(Ie)})]}),Mo=Je&&/* @__PURE__ */ve(K,{style:{left:Je.x,top:Je.y},onClose:()=>Ge(null),minWidth:160,children:[!V&&!J&&!zn&&/* @__PURE__ */ve(xe,{children:[
|
|
79
|
+
/* @__PURE__ */ve(j,{onClick:()=>{wr(Kt),Ge(null)},children:[
|
|
80
|
+
/* @__PURE__ */be(Y,{name:"remove",className:"h-4 w-4",strokeWidth:1.5}),Oe.minimize]}),!Dn&&/* @__PURE__ */ve(j,On?{onClick:()=>{Kn(!1),Cn(vn()),Ge(null)},children:[
|
|
81
|
+
/* @__PURE__ */be(Y,{name:"collapse",className:"h-4 w-4",strokeWidth:1.5}),Oe.windowed]}:{onClick:()=>{ho(),Ge(null)},children:[
|
|
82
|
+
/* @__PURE__ */be(Y,{name:"expand",className:"h-4 w-4",strokeWidth:1.5}),Oe.maximize]})]}),B&&!zn&&/* @__PURE__ */ve(j,{onClick:()=>{Xe(e=>!e),Ge(null)},children:[
|
|
83
|
+
/* @__PURE__ */be(Y,{name:"bookmark-square",className:"h-4 w-4 "+(Ye?"text-blue-600":""),fill:Ye?"currentColor":"none",strokeWidth:1.5}),Ye?Oe.unpin:Oe.pinOnTop]}),_e&&/* @__PURE__ */ve(j,{onClick:()=>{Ge(null),ot()},children:[
|
|
84
|
+
/* @__PURE__ */be(Y,{name:"star",className:"h-4 w-4",fill:rt?"currentColor":"none",strokeWidth:1.5}),rt?$e.taskbar.removeFromDesktop:$e.taskbar.addToDesktop]}),(xn[Kt]||[]).length>0&&/* @__PURE__ */be(xe,{children:(xn[Kt]||[]).map((e,t)=>/* @__PURE__ */ve(j,{onClick:()=>{Ge(null),e.onClick()},children:[e.icon,e.label]},t))}),!(zn&&Qe?.home)&&/* @__PURE__ */ve(xe,{children:[
|
|
85
|
+
/* @__PURE__ */be(F,{}),
|
|
86
|
+
/* @__PURE__ */ve(j,{danger:!0,onClick:()=>{Ge(null),mr()},children:[
|
|
87
|
+
/* @__PURE__ */be(Y,{name:"close",className:"h-4 w-4"}),Oe.close]})]})]}),Co=!!me&&Ot.some(e=>e.id===me),So=!Gt||Co||V?null:/* @__PURE__ */ve("div",{"data-modal-restore-tab":!0,"data-modal-id":Kt,className:"fixed left-1/2 z-(--z-restore-tab) flex -translate-x-1/2 items-center gap-1 rounded-lg border border-line-strong bg-surface px-2 py-1 shadow-lg",style:{bottom:"calc(var(--taskbar-height, 0px) + 12px)"},children:[
|
|
88
|
+
/* @__PURE__ */be("button",{type:"button",onClick:()=>pr(Kt),title:Oe.restore,className:"max-w-[16rem] truncate rounded px-2 py-0.5 text-sm font-medium text-gray-700 hover:bg-gray-100 hover:text-gray-900",children:Ke||Oe.windowSuffix}),
|
|
89
|
+
/* @__PURE__ */be("button",{type:"button",onClick:()=>pr(Kt),title:Oe.restore,"aria-label":Oe.restore,className:"rounded px-2 py-0.5 text-xs leading-none text-ink-faintest hover:bg-gray-100 hover:text-gray-600",children:"▴"}),
|
|
90
|
+
/* @__PURE__ */be("button",{type:"button",onClick:()=>{mr()},title:Oe.close,"aria-label":Oe.close,className:"rounded px-2 py-0.5 text-xs leading-none text-ink-faintest hover:bg-gray-100 hover:text-gray-600",children:"✕"})]});return U(
|
|
91
|
+
/* @__PURE__ */ve(fn.Provider,{value:null,children:[Eo,Mo,So]}),document.body)}"undefined"!=typeof window&&window.addEventListener("keydown",e=>{qr&&"Escape"===e.key&&(so(null),Jr(!1))});var mo=100,fo={past:[],future:[]};function po(e,t){switch(t.type){case"record":{const n=e.past[e.past.length-1];if(null!==t.step.coalesceKey&&n?.coalesceKey===t.step.coalesceKey)return 0===e.future.length?e:{...e,future:[]};const r=[...e.past,t.step];return{past:r.length>mo?r.slice(r.length-mo):r,future:[]}}case"undo":return 0===e.past.length?e:{past:e.past.slice(0,-1),future:[t.redoStep,...e.future]};case"redo":return 0===e.future.length?e:{past:[...e.past,t.undoStep],future:e.future.slice(1)};case"clear":return 0===e.past.length&&0===e.future.length?e:fo}}var wo=/* @__PURE__ */new Set(["INPUT","TEXTAREA","SELECT"]);var yo=500,go=250;function vo({children:e,canEdit:t=!0,perms:n,windowId:r}){const[o,i]=ye(po,fo),a=ae(/* @__PURE__ */new Map),[s,l]=le(0),c=s>0,[u,d]=le(0),[h,m]=le(0),f=h>0,{hasAnyPerm:p}=S(),w=t&&0===u&&(!(n&&n.length>0)||p(n)),y=ae(null),g=ae(!1),v=ue(()=>{const e={};for(const[t,n]of a.current)e[t]=n.getLast();return e},[]),b=ue((e,t)=>{a.current.has(e)||l(e=>e+1),a.current.set(e,t)},[]),x=ue(e=>{a.current.delete(e)&&l(e=>e-1)},[]),k=ue(e=>{d(t=>t+(e?1:-1))},[]),E=ue(e=>{m(t=>t+(e?1:-1))},[]),[M,C]=le(0),N=M>0,L=ue(e=>{C(t=>t+(e?1:-1))},[]),T=re(Ue),z=T?.claimReadOnly;se(()=>{if(z&&!w)return z(!0),()=>z(!1)},[z,w]);const A=T?.claimOwnMount;se(()=>{if(A&&N)return A(!0),()=>A(!1)},[A,N]);const P=ae({last:0,count:0,tripped:!1}),I=ae(!1),R=ue((e,t,n)=>{if(g.current)return void(n&&function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}(n.prev,n.next)||(I.current=!0));if(!w||y.current)return;const r=P.current;if(r.tripped)return;const o=Date.now();if(o-r.last>go&&(r.count=0),r.last=o,++r.count>yo)return r.tripped=!0,void console.error(`[efficient-shell] UndoProvider: "${e}" recorded ${yo} undo steps with no pause between them, which no user action can do. The value passed to useUndoable for this slice is almost certainly rebuilt on every render (a .map/.filter/object literal in the call) rather than held in state, so it reads as changed every time — and since recording a step re-renders the form, that is a loop. Undo recording is now off for this form to keep the tab responsive.`);y.current={values:v(),label:e,coalesceKey:t},queueMicrotask(()=>{const e=y.current;y.current=null,e&&i({type:"record",step:e})})},[w,v]),W=ue(e=>{for(const[t,n]of Object.entries(e)){const e=a.current.get(t);e&&(e.setLast(n),e.apply(n))}},[]),$=ue(()=>{const e=o.past[o.past.length-1];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};W(e.values),i({type:"undo",redoStep:t})},[o.past,v,W]),O=ue(()=>{const e=o.future[0];if(!e)return;const t={values:v(),label:e.label,coalesceKey:null};W(e.values),i({type:"redo",undoStep:t})},[o.future,v,W]),[K,j]=le(0),F=ae(0),B=ae(0),H=ae(!1),Y=ue(()=>{g.current=!0,I.current=!1,y.current=null,F.current+=1,B.current=F.current,j(F.current)},[]),q=ae(void 0),U=ue(e=>{void 0!==e&&(void 0!==q.current&&e!==q.current&&(H.current=!0),q.current=e),Y()},[Y]);se(()=>{g.current&&K===B.current&&(g.current=!1,y.current=null,(I.current||H.current)&&i({type:"clear"}),I.current=!1,H.current=!1)},[K]);const X=ue(()=>{H.current=!0,i({type:"clear"}),Y()},[Y]),V=w&&o.past.length>0,J=w&&o.future.length>0,G=Yr(r),_=ae({undo:$,redo:O,canUndo:V,canRedo:J});_.current={undo:$,redo:O,canUndo:V,canRedo:J},se(()=>{if(!G||!w)return;const e=e=>{const t=function(e){if(!e.metaKey&&!e.ctrlKey||e.altKey)return null;const t=e.key.toLowerCase(),n="z"===t?e.shiftKey?"redo":"undo":"y"!==t||!e.ctrlKey||e.metaKey||e.shiftKey?null:"redo";if(!n)return null;const r=e.target;return r?.isContentEditable||r?.tagName&&wo.has(r.tagName.toUpperCase())?null:n}(e);if(!t)return;const n=_.current;("undo"===t?n.canUndo:n.canRedo)&&(e.preventDefault(),"undo"===t?n.undo():n.redo())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[G,w]);const Q=pe(()=>({register:b,unregister:x,record:R,undo:$,redo:O,clear:X,baseline:U,canUndo:V,canRedo:J,enabled:w,hasState:c,handMounted:N,claimOwnMount:L,claimReadOnly:k,declaredEditable:f,claimEditable:E,undoLabel:V?o.past[o.past.length-1].label:null,redoLabel:J?o.future[0].label:null}),[b,x,R,$,O,X,U,V,J,w,c,N,L,k,f,E,o.past,o.future]),Z=""!==Cn(),ee=re(D)?.footerOpen??!1,te=Z&&w&&c&&!N&ⅇ/* @__PURE__ */
|
|
92
|
+
return ve(Ue.Provider,{value:Q,children:[te&&/* @__PURE__ */be(Ln,{position:"left",quiet:!0,children:/* @__PURE__ */be(Ve,{auto:!0})}),e]})}function bo(){const e=re(Ue),t=ue(()=>{},[]);return{undo:e?.undo??t,redo:e?.redo??t,clear:e?.clear??t,baseline:e?.baseline??t,canUndo:e?.canUndo??!1,canRedo:e?.canRedo??!1,undoLabel:e?.undoLabel??null,redoLabel:e?.redoLabel??null,enabled:e?.enabled??!1,hasState:e?.hasState??!1}}function xo(e){const t=re(Ue),n=t?.claimReadOnly,r=t?.claimEditable;se(()=>{const t=e?r:n;if(t)return t(!0),()=>t(!1)},[n,r,e])}function ko(e,t,n){const r=re(Ue),o=we(),i=ae(e),a=ae(t);a.current=t,se(()=>{if(r)return r.register(o,{getLast:()=>i.current,setLast:e=>{i.current=e},apply:e=>a.current(e)}),()=>r.unregister(o)},[r,o]);const{label:s,coalesceKey:l=null}=n,c=ae(r);c.current=r;const u=ae({label:s,coalesceKey:l});u.current={label:s,coalesceKey:l},se(()=>{const t=c.current;t&&(Object.is(e,i.current)||(t.record(u.current.label,u.current.coalesceKey,{prev:i.current,next:e}),i.current=e))},[e])}function Eo(e,t){const[n,r]=le(e);return ko(n,e=>r(()=>e),t),[n,r]}export{Tn as CancelButton,Pe as DesktopHostProvider,yt as DocFavStar,it as EntityWindowFallback,rt as EntityWindowLoading,at as EntityWindowState,yn as MODAL_SUBMIT_SELECTOR,ho as Modal,Ln as ModalActions,Nn as ModalMoreActions,Ve as UndoControls,vo as UndoProvider,Te as WINDOW_REGISTRY,Ye as WindowCrashedFallback,Sn as WindowEditSlot,qe as WindowErrorBoundary,Ot as WindowManagerProvider,En as WindowTitle,Et as activateWindowById,_t as beginWindowGesture,dr as cancelWindowFront,Ae as client_default,lo as commitExposeHighlight,ur as confirmWindowDiscard,Qt as drainPerfEvents,_r as exitExposeMode,Fn as forgetMaximizedWindowBoxes,St as getActiveWindowRoute,ao as getExposeHighlight,hn as getWindowChromeVersion,Kn as getWindowPosition,lt as isDraftEntityId,ct as isDraftEntityWindow,Se as isEntityEntry,Ce as isPageEntry,ze as isShellApiClientConfigured,Ze as isTabWindow,Gt as markMenuOpen,un as readWindowChrome,sr as requestWindowFront,so as setExposeHighlight,Jt as setPerfCollecting,Ke as setShellHomeRoute,He as setShellTabStrip,Le as setShellWindowRegistry,On as setWindowDefaultPosition,jn as setWindowPosition,rn as splitTitle,io as subscribeExposeHighlight,dn as subscribeWindowChrome,et as tabGroupOf,Gr as toggleExposeMode,rr as useCurrentTabKey,Ie as useDesktopHost,Cn as useEnclosingModalId,Yr as useIsActiveWindow,We as usePageSearch,bo as useUndo,xo as useUndoCanEdit,ko as useUndoable,Eo as useUndoableState,bn as useWidgetSettings,ht as useWindowDirty,ft as useWindowManager,kn as useWindowMenuItem,Mn as useWindowTitle,cr as windowHoldsChanges};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{AccessibleTable as e}from"./chunk-D3L2QCGF.js";import{bumpPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as n}from"./chunk-CNYAHYE6.js";import{ChartTooltip as o}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as l,CHART_INK as r}from"./chunk-TZFACUMR.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{useShellStrings as i,useShellLocale as s}from"./chunk-NRHG4R2Q.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as m}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function f({nodes:f,links:k,height:p=320,width:x,nodeWidth:g=14,nodePadding:y=12,formatValue:v,className:M,emptyLabel:w}){const b=i().charts,j=s(),N=v??(e=>h(e,j)),$=w??b.noFlows,F=c(null),C=a(F),E=x??C,[Q,A]=m(null),{highlighted:R}=n();if(0===f.length||0===k.length)/* @__PURE__ */
|
|
2
|
+
return d("div",{className:M,ref:F,children:/* @__PURE__ */d("p",{className:"py-8 text-center text-sm text-gray-500",children:$})});const z=[...new Set(f.map(e=>e.depth))].sort((e,t)=>e-t),H=e=>z.length<=1?0:z.indexOf(e)/(z.length-1)*(E-g-140)+70,L=new Map(f.map(e=>{const t=k.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=k.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(t,n,e.value??0)]})),O=/* @__PURE__ */new Map;for(const e of f)O.set(e.depth,[...O.get(e.depth)??[],e]);const U=Math.max(...[...O.values()].map(e=>e.reduce((e,t)=>e+(L.get(t.key)??0),0))),V=p-20,W=U>0?(V-y*(Math.max(...[...O.values()].map(e=>e.length))-1))/U:0,D=/* @__PURE__ */new Map;for(const[e,t]of O){const n=t.map(e=>Math.max(2,(L.get(e.key)??0)*W)),o=n.reduce((e,t)=>e+t,0)+y*(t.length-1),l=n.reduce((e,t)=>e+Math.max(0,t-2),0),r=o>V&&l>0?Math.max(0,1-(o-V)/l):1;let a=10;t.forEach((t,o)=>{const l=2+Math.max(0,n[o]-2)*r;D.set(t.key,{x:H(e),y:a,h:l,index:o}),a+=l+y})}const G=/* @__PURE__ */new Map,P=/* @__PURE__ */new Map,S=/* @__PURE__ */new Map,T=(e,t)=>e.from===t||e.to===t,Y="link"===Q?.kind?k[Q.index]:void 0,Z="node"===Q?.kind?f.find(e=>e.key===Q.key):void 0;/* @__PURE__ */
|
|
3
|
+
return u("div",{className:`relative ${M??""}`,ref:F,children:[
|
|
4
|
+
/* @__PURE__ */u("svg",{width:"100%",height:p,viewBox:`0 0 ${E} ${p}`,role:"img","aria-label":b.sankey(f.length,k.length),onMouseLeave:()=>A(null),children:[k.map((e,n)=>{const o=D.get(e.from),r=D.get(e.to);if(!o||!r)return null;const a=Math.max(1,e.value*W),i=o.y+(G.get(e.from)??0)+a/2,s=r.y+(P.get(e.to)??0)+a/2;G.set(e.from,(G.get(e.from)??0)+a),P.set(e.to,(P.get(e.to)??0)+a);const h=o.x+g,c=r.x,m=l(o.index,e.color),u=`${e.from}→${e.to}`,f=S.get(u)??0;S.set(u,f+1);const k=((e,t)=>Q?"link"===Q.kind?Q.index===t:T(e,Q.key):null!==R?T(e,R):null)(e,n);/* @__PURE__ */
|
|
5
|
+
return d("path",{d:t([[h,i],[c,s]]),fill:"none",stroke:m,strokeWidth:a,strokeOpacity:null===k||k?.42:.12,onMouseEnter:()=>A({kind:"link",index:n})},f?`${u}#${f}`:u)}),f.map(e=>{const t=D.get(e.key);if(!t)return null;const n=t.x>E/2,o=(a=e.key,Q?"node"===Q.kind?Q.key===a:T(k[Q.index],a):null!==R?R===a:null);var a;/* @__PURE__ */
|
|
6
|
+
return u("g",{opacity:null===o||o?1:.45,onMouseEnter:()=>A({kind:"node",key:e.key}),children:[
|
|
7
|
+
/* @__PURE__ */d("rect",{x:t.x,y:t.y,width:g,height:t.h,rx:2,fill:l(t.index,e.color,e.tone)}),
|
|
8
|
+
/* @__PURE__ */d("text",{x:n?t.x-8:t.x+g+8,y:t.y+t.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:r.label,children:e.label})]},e.key)})]}),Y&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:`${Y.from} → ${Y.to}`,rows:[{key:"value",label:b.flow,color:l(D.get(Y.from)?.index??0,Y.color),value:N(Y.value)}]})}),Z&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:Z.label,rows:[{key:"value",label:b.throughput,color:l(D.get(Z.key)?.index??0,Z.color,Z.tone),value:N(L.get(Z.key)??0)}]})}),
|
|
9
|
+
/* @__PURE__ */d(e,{caption:b.sankey(f.length,k.length),head:[b.tableFrom,b.tableTo,b.value],rows:k.map(e=>[e.from,e.to,N(e.value)])})]})}export{f as SankeyChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isAriaDisabled as e,swallowPress as r,describedByWith as i,OffWithReason as a}from"./chunk-J43RRDEP.js";import{useRowControlSize as s}from"./chunk-UMLXFQVC.js";import{iconButtonClasses as d}from"./chunk-UQYNPYF4.js";import{forwardRef as o,useId as n}from"react";import{jsx as t}from"react/jsx-runtime";var c=o(function({children:o,variant:c="ghost",size:l="md",type:m="button",className:p="",pressed:b,disabledReason:u,ink:f,disabled:h,onClick:k,"aria-disabled":v,"aria-describedby":j,...y},N){const C=s(l)??"md",R=n(),x=(Boolean(h)||e(v))&&null!=u&&""!==u,z=x||e(v),F=/* @__PURE__ */t("button",{ref:N,type:m,className:d({variant:c,size:C,pressed:b??(!0===y["aria-pressed"]||"true"===y["aria-pressed"]),ink:f,className:p}),...y,disabled:x?void 0:h,"aria-disabled":!!z||v,"aria-describedby":i(j,x?R:void 0),onClick:z?r:k,children:o});return x?/* @__PURE__ */t(a,{reason:u,id:R,children:F}):F});export{c as IconButton_default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ErrorPage as r}from"./chunk-6NXPOZ6X.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-
|
|
1
|
+
import{ErrorPage as r}from"./chunk-6NXPOZ6X.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-7YJBWOQG.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.js";import{Component as o}from"react";import{jsxs as i,jsx as a,Fragment as n}from"react/jsx-runtime";function c({pick:r}){/* @__PURE__ */
|
|
2
2
|
return a(n,{children:r(s().errors)})}var l=class extends o{state={error:null};static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,t){console.error("ErrorBoundary caught an error:",r,t),e(r),this.props.onError?.(r,t)}componentDidUpdate(r){if(!this.state.error)return;const e=r.resetKeys??[],t=this.props.resetKeys??[];(e.length!==t.length||e.some((r,e)=>!Object.is(r,t[e])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
|
|
3
3
|
/* @__PURE__ */i("div",{className:"flex h-full flex-col",children:[
|
|
4
4
|
/* @__PURE__ */a("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */a(r,{code:500,actions:/* @__PURE__ */i(n,{children:[
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as i,usePopupLevel as r,usePopupLevelBindings as t,windowScrimStyle as o,OverlayLayerProvider as n,scrimHasCorners as l,popupLayerStyle as a}from"./chunk-CJ4OEY3T.js";import{CloseButton as d}from"./chunk-AVUH35GW.js";import{useDiscardGuard as s}from"./chunk-LPQQNPH5.js";import{dialogA11y as c}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as m}from"./chunk-DBQNYJZ6.js";import{useFocusTrap as p,useScrollLock as u}from"./chunk-DWGYC7OD.js";import{HEADING_TEXT as h,DESCRIPTION_TEXT as f,PANEL_SURFACE as b}from"./chunk-BWJZTHZ6.js";import{createShellPortal as v}from"./chunk-52YTUQW3.js";import{useHydrated as y}from"./chunk-KEFNQEXZ.js";import{registerModalEscapeInterceptor as x}from"./chunk-TWVUQUUD.js";import{useRef as k,useId as N,useState as j,useEffect as w}from"react";import{jsxs as g,Fragment as C,jsx as W}from"react/jsx-runtime";function Q({open:Q,onClose:H,side:U="bottom",title:Y,description:Z,footer:B,children:D,blocking:E=!1,dirty:T=!1,initialFocus:$,"aria-label":G,"aria-labelledby":J,"aria-describedby":V,className:A=""}){const F=k(null),O=N(),P=N(),z=N(),I=e(y()),[K,L]=j(null),X=s({open:Q,dirty:T,onClose:H,title:Y,layer:K}),q=k(null),M=i(Q&&null!==I,q),R=r(Q&&null!==I,q),S=t(R,K),_=o(R),ee=null!==R.host;if(m(Q),p(F,Q&&null!==I,$,S),u(Q),w(()=>{if(Q)return x(()=>!S.current?.(document.activeElement)&&(E||X(),!0),()=>F.current)},[Q,E,X,S]),!Q||!I)return null;const ie={maxHeight:"85vh",...M?(re=M,{left:re.left,width:re.width,bottom:window.innerHeight-(re.top+re.height)}):{}};var re;/* @__PURE__ */
|
|
2
|
+
return g(C,{children:[/* @__PURE__ */W("span",{ref:q,hidden:!0,"data-popup-anchor":""}),v(
|
|
3
|
+
/* @__PURE__ */W(n,{value:K,children:/* @__PURE__ */g("div",{ref:L,className:ee?"fixed inset-0 pointer-events-none":"fixed inset-0",style:a(R),role:"presentation","data-overlay-layer":"",children:[
|
|
4
|
+
/* @__PURE__ */W("div",{className:"fixed bg-black/30 backdrop-blur-sm "+(ee?"pointer-events-auto"+(l(R)?" rounded-(--radius-window)":""):"inset-0"),style:_??void 0,hidden:ee&&!_,onClick:E?void 0:X,"aria-hidden":"true","data-popup-scrim":ee?"window":"system"}),
|
|
5
|
+
/* @__PURE__ */g("div",{ref:F,...c({modal:!0,titleId:Y?z:void 0,labelledBy:J,label:G}),"aria-describedby":V??(Z?P:D?O:void 0),"data-drawer-side":U,"data-popup-panel":"",style:ie,className:[`fixed flex flex-col ${b}`,ee?"pointer-events-auto":"",M?"":"inset-x-0 bottom-0","rounded-t-xl",A].filter(Boolean).join(" "),children:[Y?/* @__PURE__ */g("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
6
|
+
/* @__PURE__ */g("div",{className:"min-w-0",children:[
|
|
7
|
+
/* @__PURE__ */W("h2",{id:z,className:h,children:Y}),Z&&/* @__PURE__ */W("p",{id:P,className:`mt-0.5 ${f}`,children:Z})]}),!E&&/* @__PURE__ */W(d,{onClose:X})]}):!E&&/* @__PURE__ */W("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */W(d,{onClose:X})}),
|
|
8
|
+
/* @__PURE__ */g("div",{id:O,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[Z&&!Y&&/* @__PURE__ */W("p",{id:P,className:`mb-3 ${f} ${E?"":"pr-8"}`.trim(),children:Z}),D]}),B&&/* @__PURE__ */W("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:B})]})]})}),I)]})}export{Q as Drawer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=[2,4,8,12,16,20,24,32,40,48],o={iconGap:8,iconGapSm:4,controlXSm:8,controlX:12,controlXLg:16,cellX:12,label:4,toolbar:8,formRow:12,card:16,block:16,gutter:16,panelGroup:2,panelSub:4,panelLayer:8,panelRow:12,panelPad:16,panelPadNarrow:12,panelSetting:32},r={sm:24,md:32,lg:40},a={menu:36,windowBar:48,compactBar:32};function e(o){if("0"===o||"px"===o)return!0;const r=Number(o);return!!Number.isFinite(r)&&n.includes(4*r)}export{r as CONTROL_HEIGHTS,a as ROW_HEIGHTS,o as SPACING_ROLES,n as SPACING_SCALE,e as isSpacingStep};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-ISVODSRP.js";import{Tooltip as t}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-ISVODSRP.js";import{Tooltip as t}from"./chunk-2MUZFHZW.js";import{useShellStrings as n}from"./chunk-NRHG4R2Q.js";import{useId as i}from"react";import{jsx as a,jsxs as r}from"react/jsx-runtime";var l=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled]):not(.es-default-reset)",'[tabindex]:not([tabindex="-1"])'].join(", "),s=e=>l.split(", ").map(t=>`${e} ${t}`).join(", ");function o({label:o,onReset:d,changed:c=!0,view:u="desktop",detail:b,name:p,tip:m,defaultAction:h,disabled:f,className:k}){const j=n().settingView,y=i(),N=["es-default-reset"];if(c&&N.push("is-changed"),k&&N.push(k),!c&&h)return N.push("is-pressable"),/* @__PURE__ */a(t,{content:h.title,children:/* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":h.title,disabled:f,onClick:h.onPress,children:h.icon})});if(!c)/* @__PURE__ */return a("span",{className:N.join(" "),"aria-hidden":"true"});const x="desktop"===u,S=p??(x?j.resetName(o):j.inheritName(o)),g=b?j.backTo(b):x?j.backToDefault:j.backToAuto,R=m??(b?j.tip(S,g):S);
|
|
2
2
|
/* @__PURE__ */
|
|
3
|
-
return r(t,{content:
|
|
3
|
+
return r(t,{content:R,describe:!1,children:[
|
|
4
4
|
/* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":S,"aria-describedby":y,disabled:f,onClick:e=>{d(),function(e){const t=e.currentTarget,n=t.closest(".es-field");let i=n?.querySelector(s(".es-field-ctl"))??n?.querySelector(s(".es-field-head"))??null,a=n?null:t.parentElement;for(let e=0;!i&&a&&e<4;e+=1,a=a.parentElement)i=[...a.querySelectorAll(l)].find(e=>e!==t&&!e.closest('[aria-hidden="true"]'))??null;i?.focus()}(e)},children:/* @__PURE__ */a(e,{name:"revert",size:15,"aria-hidden":"true"})}),
|
|
5
|
-
/* @__PURE__ */a("span",{id:y,hidden:!0,children:
|
|
5
|
+
/* @__PURE__ */a("span",{id:y,hidden:!0,children:g})]})}export{o as SettingReset};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import{useCopyText as e,CopyGlyph as n}from"./chunk-TJ5YMXVB.js";import{ItemCount as t}from"./chunk-
|
|
1
|
+
import{useCopyText as e,CopyGlyph as n}from"./chunk-TJ5YMXVB.js";import{ItemCount as t}from"./chunk-ABAUJLI4.js";import{PopupMenu as r,PopupMenuItem as i,PopupMenuDivider as l}from"./chunk-3HPCQMYH.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{useShellStrings as a}from"./chunk-NRHG4R2Q.js";import{useState as s,useMemo as d,useEffect as c,useRef as u,Fragment as m,useLayoutEffect as f}from"react";import{jsxs as p,jsx as y,Fragment as g}from"react/jsx-runtime";function h(e){const n=[];let t=0;for(;t<e.length;){const r=e[t].group;let i=t;for(;void 0!==r&&i+1<e.length&&e[i+1].group===r;)i++;n.push(i>t?{group:r,start:t,end:i}:{start:t,end:t}),t=i+1}return n}function k(e,n){return e.find(e=>n>=e.start&&n<=e.end)}function b(e,n,t,r){const i=e.findIndex(e=>e.key===n.key);let l=e.findIndex(e=>e.key===t);if(i<0||l<0)return null;const o=h(e),a=k(o,i),s="group"===n.kind&&void 0!==a.group?e.slice(a.start,a.end+1).map(e=>e.key):[n.key];if(s.includes(t))return null;const d=k(o,l);if("tab"===n.kind&&void 0!==a.group){if(d!==a)return null}else void 0!==d.group&&(l="before"===r?d.start:d.end);return{key:e[l].key,side:r,moving:s}}function x(e,n,t,r){const i=b(e,n,t,r);if(!i)return null;const l=e.map(e=>e.key).filter(e=>!i.moving.includes(e)),o=l.indexOf(i.key)+("after"===i.side?1:0),a=[...l.slice(0,o),...i.moving,...l.slice(o)];return a.every((n,t)=>n===e[t].key)?null:a}var v="flex-[0_100_15rem] [contain-intrinsic-inline-size:15rem]",N=v,w="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500",C="pointer-events-none absolute bottom-0 size-2 [background:inherit]";function $(){/* @__PURE__ */
|
|
2
2
|
return p(g,{children:[
|
|
3
|
-
/* @__PURE__ */y("span",{"aria-hidden":"true",className:`${
|
|
4
|
-
/* @__PURE__ */y("span",{"aria-hidden":"true",className:`${
|
|
5
|
-
return y(o,{name:"close",look:"mini","aria-hidden":"true",className:"size-3.5"})}function
|
|
6
|
-
return y("button",{type:"button",tabIndex:-1,"aria-label":l?i:r,title:l?i:r,onClick:o,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__ */y(n,{copied:l,className:"size-3.5"})})}function _({node:e}){const n=u(null);return f(()=>{const t=n.current;if(t)return t.appendChild(e),()=>{e.parentNode===t&&t.removeChild(e)}},[e]),/* @__PURE__ */y("span",{ref:n,className:"ml-1 flex shrink-0 items-center"})}function j({tabs:e,activeKey:n,idFor:f,panelMounted:k,onActivate
|
|
3
|
+
/* @__PURE__ */y("span",{"aria-hidden":"true",className:`${C} -left-2 [mask-image:radial-gradient(circle_at_0_0,transparent_0.5rem,#000_calc(0.5rem+0.5px))]`}),
|
|
4
|
+
/* @__PURE__ */y("span",{"aria-hidden":"true",className:`${C} -right-2 [mask-image:radial-gradient(circle_at_100%_0,transparent_0.5rem,#000_calc(0.5rem+0.5px))]`})]})}function I(){/* @__PURE__ */
|
|
5
|
+
return y(o,{name:"close",look:"mini","aria-hidden":"true",className:"size-3.5"})}function z({text:t,label:r,copiedLabel:i}){const{copied:l,copy:o}=e(t);/* @__PURE__ */
|
|
6
|
+
return y("button",{type:"button",tabIndex:-1,"aria-label":l?i:r,title:l?i:r,onClick:o,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__ */y(n,{copied:l,className:"size-3.5"})})}function _({node:e}){const n=u(null);return f(()=>{const t=n.current;if(t)return t.appendChild(e),()=>{e.parentNode===t&&t.removeChild(e)}},[e]),/* @__PURE__ */y("span",{ref:n,className:"ml-1 flex shrink-0 items-center"})}function j({tabs:e,activeKey:n,idFor:f,panelMounted:k,onActivate:C,onClose:j,onCloseMany:D,label:T,className:A,activeClassName:M,end:R,afterPinned:B,onIconMenu:E,menuItems:O,sizing:G="even",tall:K=!1,onReorder:L,groupInfo:S}){const H=a().pageTabs,P=a().count,[V,X]=s(null),Y=K?"h-[34px]":"h-8",F=d(()=>e.map(e=>({key:e.key,group:S?e.group:void 0})),[e,S]),J=d(()=>h(F),[F]),Q=d(()=>{const t=e.findIndex(e=>e.key===n);return J.find(e=>void 0!==e.group&&t>=e.start&&t<=e.end)?.group},[J,e,n]),[W,U]=s(()=>Q??null),q=t=>{const r=J.find(e=>e.group===t);if(!r)return;const i=e.findIndex(e=>e.key===n),l=i>=r.start&&i<=r.end;if(W!==t)l||C(e[r.start].key),U(t);else{if(l){const n=e[r.end+1]??e[r.start-1];n&&C(n.key)}U(null)}};c(()=>{void 0!==Q&&U(Q)},[n]);const Z=d(()=>{const n=[];for(const t of J)for(let r=t.start;r<=t.end;r++)void 0!==t.group&&t.group!==W||n.push(e[r]);return n},[J,W,e]),ee=u(null),[ne,te]=s(null),re=(n,t)=>L?{draggable:!0,onDragStart:t=>{ee.current=n,t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.find(e=>e.key===n.key)?.title??"")},onDragOver:e=>{const r=ee.current;if(!r)return;const i=e.currentTarget.getBoundingClientRect(),l=t!==n.key||"tab"===n.kind?e.clientX<i.left+i.width/2?"before":"after":"before",o=x(F,r,t,l)?b(F,r,t,l):null;if(!o)return void(ne&&te(null));e.preventDefault(),e.dataTransfer.dropEffect="move";const a=e=>F.find(n=>n.key===e)?.group,s="tab"===r.kind&&void 0!==a(r.key)&&a(r.key)===a(o.key);ne?.key===o.key&&ne.side===o.side&&ne.inGroup===s||te({key:o.key,side:o.side,inGroup:s})},onDrop:e=>{const n=ee.current;if(!n||!ne)return;e.preventDefault();const t=x(F,n,ne.key,ne.side);ee.current=null,te(null),t&&L(t)},onDragEnd:()=>{ee.current=null,te(null)}}:{},ie=d(()=>new Set(J.filter(e=>void 0!==e.group&&S).map(n=>e[n.start].key)),[J,e,S]),le=e=>"pointer-events-none absolute inset-y-1 z-[3] w-0.5 rounded-full bg-blue-500 "+("before"===e?"-left-px":"-right-px"),oe=e=>ne?.key===e&&!("before"===ne.side&&ie.has(e)&&!ne.inGroup)&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:le(ne.side)}),ae=e.length;c(()=>{if(!n)return;const e=document.getElementById(f(n,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[f,n,ae]);const se=B?Z.findIndex(e=>!e.pinned):-1,de=Z.some(e=>e.key===n)?n:Z[0]?.key,ce=e=>{const n=Z[(e+Z.length)%Z.length];n&&document.getElementById(f(n.key,"tab"))?.focus()},ue=(e,n)=>{const t=Z[e+n];if(!L||!t)return;const r=x(F,{kind:"tab",key:Z[e].key},t.key,n<0?"before":"after");r&&(L(r),setTimeout(()=>document.getElementById(f(Z[e].key,"tab"))?.focus(),0))},me=V?e.find(e=>e.key===V.key):void 0,fe=me&&O?O(me.key):[],pe=me?e.indexOf(me):-1,ye=e=>e.some(e=>!e.pinned),ge=e=>()=>{X(null),e()},he=(e,t)=>!!t&&e.key!==n&&t.key!==n,ke=(e,t)=>{const r=e.key===n,i=e.pinned?"auto":r?"active-full"===G?"15rem":e.copy||E&&e.icon?"minmax(4.25rem,20rem)":"minmax(4.25rem,15rem)":"minmax(4rem,15rem)";return he(e,t)?["auto",i]:[i]},be=(e,t)=>{const r=e.key===n,i=!!e.dirty,l=e.icon,a=r?M??"z-[1] border-transparent bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",s=he(e,t),d={type:"button",role:"tab",id:f(e.key,"tab"),"aria-selected":r,"aria-controls":k?.(e.key)?f(e.key,"panel"):void 0,tabIndex:e.key===de?0:-1,title:e.title,onClick:()=>C(e.key)},c={onContextMenu:n=>((e,n)=>{e.preventDefault(),X({x:e.clientX,y:e.clientY,key:n.key})})(n,e),onAuxClick:n=>((e,n)=>{1!==e.button||n.pinned||(e.preventDefault(),j(n.key))})(n,e),onMouseDown:e=>{1===e.button&&e.preventDefault()}},u=l&&
|
|
7
7
|
/* @__PURE__ */p("span",{className:"relative flex size-4 shrink-0 items-center justify-center text-gray-500 [&>svg]:size-4","aria-hidden":"true",children:[l,i&&!r&&!e.pinned&&
|
|
8
|
-
/* @__PURE__ */y("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"})]}),g=r&&!!E&&!!l;return e.pinned?/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex flex-none items-center justify-center rounded-t-lg border border-b-0 transition-colors ${
|
|
8
|
+
/* @__PURE__ */y("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"})]}),g=r&&!!E&&!!l;return e.pinned?/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex flex-none items-center justify-center rounded-t-lg border border-b-0 transition-colors ${Y} ${l?"w-10":""} ${a}`,...c,...re({kind:"tab",key:e.key},e.key),children:[oe(e.key),r&&/* @__PURE__ */y($,{}),
|
|
9
9
|
/* @__PURE__ */p("button",{...d,className:`flex h-full items-center justify-center rounded-t-lg ${l?"w-full":"px-3"} ${w}`,children:[u,
|
|
10
10
|
/* @__PURE__ */y("span",{className:l?"sr-only":"whitespace-nowrap text-sm",children:e.title})]})]},e.key):/* @__PURE__ */p(m,{children:[s&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:"mb-3 h-4 w-px shrink-0 self-end border-l border-gray-300"}),
|
|
11
|
-
/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex items-center rounded-t-lg border border-b-0 text-sm transition-colors ${
|
|
12
|
-
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":
|
|
11
|
+
/* @__PURE__ */p("div",{role:"presentation",className:`group relative flex items-center rounded-t-lg border border-b-0 text-sm transition-colors ${Y} ${"active-full"===G&&r?"":"@container"} ${"active-full"===G?r?"flex-[0_0_15rem] min-w-0":N:r&&(e.copy||g)?"flex-[0_100_20rem]":v} ${r?"active-full"===G?"":"min-w-[4.25rem]":"min-w-[4rem]"} ${a}`,...c,...re({kind:"tab",key:e.key},e.key),children:[oe(e.key),r&&/* @__PURE__ */y($,{}),g&&
|
|
12
|
+
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-haspopup":"menu","aria-label":H.tabMenu,title:H.tabMenu,onClick:n=>{const t=n.currentTarget.getBoundingClientRect();E?.(e.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-2 ${w}`,children:u}),
|
|
13
13
|
/* @__PURE__ */p("button",{...d,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-lg pr-1 text-left ${g?"pl-2":"pl-3"} ${w} ${r?g?"":"@max-[5rem]:pl-3":"@max-[6.5rem]:pr-3 @max-[4.5rem]:justify-center @max-[4.5rem]:px-0 @max-[4.5rem]:group-hover:pl-2 @max-[4.5rem]:group-hover:pr-3"}`,children:[!g&&u,
|
|
14
|
-
/* @__PURE__ */p("span",{className:`min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] ${"active-full"===
|
|
15
|
-
/* @__PURE__ */y("span",{role:"img","aria-label":
|
|
16
|
-
/* @__PURE__ */p("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(r?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[i&&/* @__PURE__ */y("span",{role:"img","aria-label":
|
|
17
|
-
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-label":
|
|
14
|
+
/* @__PURE__ */p("span",{className:`min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] ${"active-full"===G&&r?"pr-4":""} ${l?r?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""}`,children:[e.title,e.favorite&&
|
|
15
|
+
/* @__PURE__ */y("span",{role:"img","aria-label":H.favorite,title:H.favorite,className:"ml-1 inline-flex align-[-0.125em] text-yellow-500",children:/* @__PURE__ */y(o,{name:"star","aria-hidden":"true",className:"size-3.5",fill:"currentColor",strokeWidth:1.5})})]})]}),r&&e.actions&&/* @__PURE__ */y(_,{node:e.actions}),r&&e.copy&&/* @__PURE__ */y(z,{text:e.copy,label:H.copy(e.copy),copiedLabel:H.copied}),
|
|
16
|
+
/* @__PURE__ */p("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(r?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[i&&/* @__PURE__ */y("span",{role:"img","aria-label":H.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
|
|
17
|
+
/* @__PURE__ */y("button",{type:"button",tabIndex:-1,"aria-label":H.closeTab?.(e.title)??`${H.close} ${e.title}`,onClick:()=>j(e.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":r?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */y(I,{})})]})]})]},e.key)},xe=[];let ve,Ne=0,we=!B;for(const r of J){const i=Z.filter(n=>{const t=e.indexOf(n);return t>=r.start&&t<=r.end});if(we||Ne!==se||(we=!0,xe.push(/* @__PURE__ */y(m,{children:B},"rosh-after-pinned")),ve=void 0),Ne+=i.length,void 0===r.group||!S){for(const e of i)xe.push(be(e,ve)),ve=e;continue}ve=void 0;const l=r.group,a=S(l),s=r.end-r.start+1,d=W===l,c=e[r.start].key,u=i.some(e=>e.key===n)?"shrink":"shrink-[100]",f=["auto",...i.flatMap((e,n)=>ke(e,n>0?i[n-1]:void 0))];xe.push(
|
|
18
18
|
/* @__PURE__ */p("div",{role:"group","aria-label":a.label,"data-tab-group":l,className:`relative mx-1 grid grid-flow-col items-end first:ml-0 ${u}`,style:{gridTemplateColumns:f.join(" ")},children:[
|
|
19
|
-
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-expanded":d,title:
|
|
19
|
+
/* @__PURE__ */p("button",{type:"button",tabIndex:-1,"aria-expanded":d,title:H.groupToggle(a.label,s),onClick:()=>q(l),...re({kind:"group",key:c},c),className:`relative mb-1 mr-1 flex h-6 shrink-0 items-center gap-1 rounded-full bg-blue-100 px-2 text-xs font-medium text-blue-700 hover:bg-blue-200 ${w}`,children:[
|
|
20
20
|
/* @__PURE__ */y(o,{name:d?"chevron-right":"chevron-down","aria-hidden":"true",className:"size-3",strokeWidth:2}),a.icon&&/* @__PURE__ */y("span",{className:"flex size-3.5 items-center justify-center [&>svg]:size-3.5","aria-hidden":"true",children:a.icon}),
|
|
21
21
|
/* @__PURE__ */y("span",{className:d?"sr-only":"max-w-[12rem] truncate",children:a.label}),
|
|
22
22
|
/* @__PURE__ */y(t,{count:s,label:P.tabs(s),active:!0})]}),ne?.key===c&&"before"===ne.side&&!ne.inGroup&&/* @__PURE__ */y("span",{"aria-hidden":"true",className:le("before")}),i.map((e,n)=>be(e,n>0?i[n-1]:void 0)),
|
|
23
|
-
/* @__PURE__ */y("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-0 h-0.5 bg-blue-500"})]},`rosh-group-${c}`))}return we||xe.push(/* @__PURE__ */y(m,{children:B},"rosh-after-pinned")),/* @__PURE__ */p("div",{className:
|
|
23
|
+
/* @__PURE__ */y("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 z-0 h-0.5 bg-blue-500"})]},`rosh-group-${c}`))}return we||xe.push(/* @__PURE__ */y(m,{children:B},"rosh-after-pinned")),/* @__PURE__ */p("div",{className:A??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
|
|
24
24
|
/* @__PURE__ */y("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
|
|
25
|
-
/* @__PURE__ */y("div",{role:"tablist","aria-label":T,onKeyDown:e=>{const n=Z.findIndex(n=>document.getElementById(f(n.key,"tab"))===e.target);if(n<0)return;const t=e.shiftKey&&(e.ctrlKey||e.metaKey);if(t&&"ArrowRight"===e.key)ue(n,1);else if(t&&"ArrowLeft"===e.key)ue(n,-1);else if("ArrowRight"===e.key)ce(n+1);else if("ArrowLeft"===e.key)ce(n-1);else if("Home"===e.key)ce(0);else if("End"===e.key)ce(Z.length-1);else{if("Delete"!==e.key||Z[n].pinned)return;j(Z[n].key)}e.preventDefault()},className:"flex min-w-0 flex-1 items-end -mx-2 px-2 scroll-px-2 overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:xe}),
|
|
25
|
+
/* @__PURE__ */y("div",{role:"tablist","aria-label":T,onKeyDown:e=>{const n=Z.findIndex(n=>document.getElementById(f(n.key,"tab"))===e.target);if(n<0)return;const t=e.shiftKey&&(e.ctrlKey||e.metaKey);if(t&&"ArrowRight"===e.key)ue(n,1);else if(t&&"ArrowLeft"===e.key)ue(n,-1);else if("ArrowRight"===e.key)ce(n+1);else if("ArrowLeft"===e.key)ce(n-1);else if("Home"===e.key)ce(0);else if("End"===e.key)ce(Z.length-1);else{if("Delete"!==e.key||Z[n].pinned)return;j(Z[n].key)}e.preventDefault()},className:"flex min-w-0 flex-1 items-end -mx-2 px-2 scroll-px-2 overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:xe}),R&&/* @__PURE__ */y("div",{className:"flex shrink-0 items-center gap-2 self-center",children:R}),V&&me&&/* @__PURE__ */p(r,{portal:!0,style:{left:V.x,top:V.y},onClose:()=>X(null),children:[fe.length>0&&/* @__PURE__ */p(g,{children:[fe.map((e,n)=>/* @__PURE__ */p(i,{onClick:ge(e.onSelect),children:[e.icon,e.label]},n)),
|
|
26
26
|
/* @__PURE__ */y(l,{})]}),
|
|
27
|
-
/* @__PURE__ */y(i,{disabled:me.pinned,onClick:ge(()=>j(me.key)),children:
|
|
27
|
+
/* @__PURE__ */y(i,{disabled:me.pinned,onClick:ge(()=>j(me.key)),children:H.close}),
|
|
28
28
|
/* @__PURE__ */y(l,{}),
|
|
29
|
-
/* @__PURE__ */y(i,{disabled:!ye(e.filter(e=>e.key!==me.key)),onClick:ge(()=>D("others",me.key)),children:
|
|
30
|
-
/* @__PURE__ */y(i,{disabled:!ye(e.slice(pe+1)),onClick:ge(()=>D("right",me.key)),children:
|
|
31
|
-
/* @__PURE__ */y(i,{disabled:!ye(e),onClick:ge(()=>D("all",null)),children:
|
|
29
|
+
/* @__PURE__ */y(i,{disabled:!ye(e.filter(e=>e.key!==me.key)),onClick:ge(()=>D("others",me.key)),children:H.closeOthers}),
|
|
30
|
+
/* @__PURE__ */y(i,{disabled:!ye(e.slice(pe+1)),onClick:ge(()=>D("right",me.key)),children:H.closeRight}),
|
|
31
|
+
/* @__PURE__ */y(i,{disabled:!ye(e),onClick:ge(()=>D("all",null)),children:H.closeAll})]})]})}export{j as TabStrip};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as l,usePopupLevel as t,usePopupLevelBindings as i,windowScrimStyle as a,OverlayLayerProvider as o,scrimHasCorners as n,popupLayerStyle as s,POPUP_GUTTER as d}from"./chunk-CJ4OEY3T.js";import{CloseButton as c}from"./chunk-AVUH35GW.js";import{useDiscardGuard as m}from"./chunk-LPQQNPH5.js";import{dialogA11y as p}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as u}from"./chunk-DBQNYJZ6.js";import{useFocusTrap as f,useScrollLock as h}from"./chunk-DWGYC7OD.js";import{HEADING_TEXT as x,DESCRIPTION_TEXT as v,PANEL_SURFACE as b}from"./chunk-BWJZTHZ6.js";import{createShellPortal as w}from"./chunk-52YTUQW3.js";import{useHydrated as y}from"./chunk-KEFNQEXZ.js";import{registerModalEscapeInterceptor as $}from"./chunk-TWVUQUUD.js";import{useShellStrings as g}from"./chunk-NRHG4R2Q.js";import{useRef as N,useId as j,useState as k,useEffect as C}from"react";import{jsxs as Q,Fragment as W,jsx as E}from"react/jsx-runtime";var H=`calc(100% - ${2*d}px)`,T="grid grid-cols-[minmax(0,1fr)_auto]",U="bg-black/30 backdrop-blur-sm",Y={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl",full:"max-w-none"};function Z({open:d,onClose:Z,title:B,description:D,role:G="dialog",children:A,footer:J,headerActions:V,blocking:_=!1,size:F="md",aside:O=!1,dirty:P=!1,initialFocus:R,"aria-label":z,"aria-labelledby":I,"aria-describedby":K,className:L=""}){const X=N(null),q=j(),M=j(),S=!_,ee="full"===F,re=ee||null!=V,le=Boolean(B||D),te=j();g().dialog;const ie=e(y()),[ae,oe]=k(null),ne=m({open:d,dirty:P,onClose:Z,title:B,layer:ae}),se=N(null),de=r(d&&null!==ie,se),ce=l(de,X),me=t(d&&null!==ie,se),pe=i(me,ae),ue=a(me),fe=null!==me.host;if(u(d),f(X,d&&null!==ie,R,pe),h(d),C(()=>{if(d)return $(()=>!pe.current?.(document.activeElement)&&(_||ne(),!0),()=>X.current)},[d,_,ne,pe]),!d||!ie)return null;/* @__PURE__ */
|
|
2
|
+
return Q(W,{children:[/* @__PURE__ */E("span",{ref:se,hidden:!0,"data-popup-anchor":""}),w(
|
|
3
|
+
/* @__PURE__ */E(o,{value:ae,children:/* @__PURE__ */Q("div",{ref:oe,className:"fixed inset-0"+(O?" pointer-events-none opacity-0":fe?" pointer-events-none":""),style:s(me),role:"presentation","data-overlay-layer":"","data-aside":O?"":void 0,children:[!fe&&/* @__PURE__ */E("div",{className:`fixed inset-0 ${U}`,"aria-hidden":"true","data-popup-scrim":"system"}),ue&&/* @__PURE__ */E("div",{className:`fixed ${U}${O?"":" pointer-events-auto"}${n(me)?" rounded-(--radius-window)":""}`,style:ue,onClick:_?void 0:ne,"aria-hidden":"true","data-popup-scrim":"window"}),
|
|
4
|
+
/* @__PURE__ */E("div",{className:de?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:_||fe?void 0:e=>{e.target===e.currentTarget&&ne()},children:/* @__PURE__ */Q("div",{ref:X,"data-popup-panel":"",style:de?{left:ce?.left??0,top:ce?.top??0,visibility:ce?void 0:"hidden",width:H,[ee?"height":"maxHeight"]:H}:void 0,...p({role:G,modal:!0,titleId:B?te:void 0,labelledBy:I,label:z}),"aria-describedby":K??(D?M:A?q:void 0),className:(ee?`${de?"absolute":"relative h-full w-full max-h-full"} ${Y[F]} ${T} grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden rounded-(--radius-popup) ${b}`:`${de?"absolute":"relative max-h-full w-full"} ${Y[F]}${re?` ${T} content-start gap-x-2`:""} overflow-y-auto overscroll-contain rounded-(--radius-card) ${b} p-6`)+`${fe&&!O?" pointer-events-auto":""} ${L}`.trimEnd(),children:[ee?le&&
|
|
5
|
+
/* @__PURE__ */Q("div",{className:"col-start-1 row-start-1 flex min-h-(--row-height-window-bar) flex-col justify-center border-b border-line py-2 pl-6 pr-4",children:[B&&/* @__PURE__ */E("h2",{id:te,className:x,children:B}),D&&/* @__PURE__ */E("p",{id:M,className:`${B?"mt-1 ":""}${v}`,children:D})]}):B&&/* @__PURE__ */E("h2",{id:te,className:`${re?"col-start-1 row-start-1 ":S?"pr-8 ":""}${x}`,children:B}),!ee&&D&&/* @__PURE__ */E("p",{id:M,className:`${re?"col-start-1 ":""}${B?"mt-1":S&&!re?"pr-8":""} ${v}`.trim(),children:D}),A&&/* @__PURE__ */E("div",{id:q,className:ee?"col-span-2 row-start-2 min-h-0 overflow-auto":(re?"col-span-2 ":"")+"mt-2 text-sm text-gray-600",children:A}),J&&/* @__PURE__ */E("div",{className:ee?"col-span-2 row-start-3 flex flex-wrap justify-end gap-3 border-t border-line px-6 py-4":(re?"col-span-2 ":"")+"mt-6 flex flex-wrap justify-end gap-3",children:J}),re?
|
|
6
|
+
/* @__PURE__ */Q("div",{className:"col-start-2 row-start-1 flex items-center gap-1 "+(ee?(le?"border-b border-line ":"")+"pr-3":"-mr-3 -mt-3 self-start"),children:[V,S&&/* @__PURE__ */E(c,{onClose:ne})]}):S&&/* @__PURE__ */E(c,{onClose:ne,className:"absolute right-3 top-3"})]})})]})}),ie)]})}export{Z as Dialog};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-XGEN76DG.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as n}from"./chunk-
|
|
1
|
+
import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-XGEN76DG.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as n}from"./chunk-7FYTL6SD.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:y,onSort:x,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,S]=c(!1),j=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:C,allColumns:_,onResizeStart:z,onDragStart:R,onDragOver:$,onDrop:G,onDragEnd:I,toggleColumn:L,resetColumns:P,draggedIdx:T,dropGap:E}=t(f,j),{hasAnyPerm:Y}=r(),A=i().columns,[F,O]=c(!1),[W,B]=c(!1),[H,J]=c(!1),K=m(null),Q=k.length>0&&Y(k);e(K,h(()=>{F&&O(!1)},[F]));const U=C.reduce((e,t)=>e+t.width,0),V=C.map(e=>`${e.width}px`),M={tableLayout:"fixed",width:U,minWidth:"100%"},X=m(null),q=h(e=>{const t=X.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),Z=d(()=>g.some(e=>"_select"===e.key),[g]);
|
|
2
2
|
/* @__PURE__ */
|
|
3
3
|
return u("div",{className:"flex flex-col flex-1 min-h-0",children:[
|
|
4
4
|
/* @__PURE__ */p("div",{ref:X,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:M,children:[
|
|
5
5
|
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:V[t]}},e.key))}),
|
|
6
6
|
/* @__PURE__ */p("thead",{className:"bg-gray-50",children:/* @__PURE__ */p("tr",{children:C.map((e,t)=>{const r=g.find(t=>t.key===e.key),o=r?.sortField??("_select"!==e.key?e.key:void 0),l=y&&o&&y.field===o,a="_select"===e.key;/* @__PURE__ */
|
|
7
|
-
return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${
|
|
7
|
+
return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${T===t?"bg-accent-tint":""}`,draggable:!a,onDragStart:a?void 0:()=>R(t),onDragOver:a?void 0:e=>$(t,e),onDrop:a?void 0:e=>G(t,e),onDragEnd:a?void 0:I,style:a?void 0:{cursor:"grab"},children:[
|
|
8
8
|
/* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&x?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&x?e=>{e.stopPropagation(),x(o)}:void 0,children:[e.headerNode??e.label,l&&/* @__PURE__ */p("span",{className:"ml-1",children:"asc"===y.direction?"▲":"▼"})]}),!a&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-4 cursor-col-resize flex items-center justify-center z-10",onMouseDown:e=>z(t,e),style:{marginRight:-8},children:/* @__PURE__ */p("div",{className:"w-0.5 h-full bg-gray-200 hover:bg-blue-500 transition-colors"})}),E===t&&/* @__PURE__ */p("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"}),t===C.length-1&&E===C.length&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"})]},e.key)})})})]})}),
|
|
9
9
|
/* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto overflow-x-auto min-h-0",onScroll:q,children:[
|
|
10
10
|
/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:M,children:[
|
|
11
11
|
/* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:V[t]}},e.key))}),N(C)]}),v]}),void 0!==b&&/* @__PURE__ */u("div",{className:"border-t border-gray-200 px-4 py-2 text-sm text-gray-500 shrink-0 flex items-center justify-between",children:[
|
|
12
12
|
/* @__PURE__ */p("span",{children:b}),
|
|
13
|
-
/* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:K,children:[w&&Z&&/* @__PURE__ */p("button",{onClick:()=>
|
|
14
|
-
/* @__PURE__ */p("button",{onClick:
|
|
15
|
-
/* @__PURE__ */p("button",{onClick:()=>
|
|
16
|
-
/* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:
|
|
17
|
-
/* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>
|
|
13
|
+
/* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:K,children:[w&&Z&&/* @__PURE__ */p("button",{onClick:()=>S(e=>!e),className:"text-2xs px-2 py-0.5 rounded "+(D?"bg-accent-fill text-on-accent":"text-ink-faint hover:text-ink border border-line-strong"),title:D?A.hideSelection:A.showSelection,children:D?A.selectDone:A.select}),
|
|
14
|
+
/* @__PURE__ */p("button",{onClick:P,className:"text-2xs text-ink-faintest hover:text-gray-600",children:A.reset}),
|
|
15
|
+
/* @__PURE__ */p("button",{onClick:()=>O(!F),className:"text-gray-400 hover:text-gray-600",title:A.choose,children:/* @__PURE__ */p(l,{name:"adjust",className:"w-4 h-4",strokeWidth:"1.5"})}),F&&/* @__PURE__ */u("div",{className:"absolute bottom-full right-0 mb-1 w-52 rounded-(--radius-popup) z-(--z-popup) py-1 max-h-80 overflow-y-auto",style:s(),children:[
|
|
16
|
+
/* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:A.heading}),_.filter(e=>"_select"!==e.key).map(e=>/* @__PURE__ */u("label",{className:"flex items-center gap-2 px-3 py-1 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer",children:[
|
|
17
|
+
/* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>L(e.key),className:"h-3.5 w-3.5 rounded border-gray-300 text-blue-600"}),e.label]},e.key)),Q&&/* @__PURE__ */p("div",{className:"border-t border-gray-100 mt-1 pt-1 px-3 pb-1",children:/* @__PURE__ */p("button",{onClick:async()=>{B(!0);const e=_.filter(e=>!e.hidden).map(e=>e.key),t=w?"mobile":"desktop",r={visible_columns:e};y&&(r.sort=y);try{await a.patch(`/auth/default-columns/${f}/`,r,{params:{viewport:t}}).catch(()=>a.post("/auth/default-columns/",{table_id:f,viewport:t,...r})),J(!0),setTimeout(()=>J(!1),2e3)}catch{}B(!1)},disabled:W,className:"text-2xs w-full text-center py-1 rounded "+(H?"text-green-600":"text-ink-faint hover:text-blue-600"),children:W?"...":H?A.savedDefault:A.saveDefault})})]})]})]})]})}export{f as ResizableTable};
|