efficient-shell 13.14.0 → 13.16.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 +21 -2
- package/dist/Browser-4KWGT3FG.js +44 -0
- package/dist/Calculator-VURS4NAT.js +29 -0
- package/dist/CurrencyConverter-X5ENBDLK.js +21 -0
- package/dist/{Files-XLDCJ7DO.js → Files-NT76VUHQ.js} +64 -64
- package/dist/Notepad-6AMNAYQQ.js +24 -0
- package/dist/PomodoroTimer-KDXH5M3Q.js +91 -0
- package/dist/{Preview-24XTJDIR.js → Preview-QNJD5PVD.js} +27 -27
- package/dist/Sidebar-UCCVJFSY.js +44 -0
- package/dist/Stock-JR77FPOD.js +16 -0
- package/dist/{Weather-IWM5XTE5.js → Weather-MGSDU3M5.js} +18 -18
- package/dist/{WorldClock-35TNXAJM.js → WorldClock-GGAYPYIO.js} +7 -7
- package/dist/ai/index.js +44 -44
- 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/ChartFrame.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/FlowChart.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.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/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/{chunk-UGEA3C5C.js → chunk-23LK4PLJ.js} +5 -5
- package/dist/{chunk-JNSRDEB6.js → chunk-2J3C2RR4.js} +10 -10
- package/dist/{chunk-PT4GMPUB.js → chunk-3SIRRK3F.js} +3 -3
- package/dist/{chunk-36UB4MJX.js → chunk-4G7PJ325.js} +1 -1
- package/dist/chunk-5URXJCNC.js +2 -0
- package/dist/{chunk-HVHIXX6O.js → chunk-6OGX7V7L.js} +10 -10
- package/dist/{chunk-WP43XYL6.js → chunk-6QH7I2V5.js} +2 -2
- package/dist/chunk-74SCWPQF.js +1 -0
- package/dist/{chunk-QTVE3OSD.js → chunk-75R3EKWZ.js} +7 -7
- package/dist/{chunk-G53Y6EPJ.js → chunk-7CBWSLCW.js} +13 -13
- package/dist/{chunk-DVVB2CY5.js → chunk-7I5RJPY7.js} +1 -1
- package/dist/{chunk-22N3KA7A.js → chunk-7IXU4YT4.js} +4 -4
- package/dist/{chunk-XEPA5J6K.js → chunk-A7VNKVZO.js} +4 -4
- package/dist/{chunk-JPKNVTTK.js → chunk-BNPWUCZX.js} +1 -1
- package/dist/{chunk-M5K4AX4E.js → chunk-BUFAJJDZ.js} +1 -1
- package/dist/{chunk-ALHYNNE2.js → chunk-BVX7LUAW.js} +6 -6
- package/dist/chunk-BWJZTHZ6.js +1 -0
- package/dist/chunk-BWQHABH7.js +4 -0
- package/dist/{chunk-G4D2WM3J.js → chunk-BZRFD4DK.js} +3 -3
- package/dist/{chunk-U6DRRCCG.js → chunk-C5OPAULN.js} +1 -1
- package/dist/{chunk-MEF4JVXP.js → chunk-CCLK2RPQ.js} +14 -14
- package/dist/{chunk-KC3EX26K.js → chunk-DPFEQQQU.js} +1 -1
- package/dist/{chunk-ZYU5HAIC.js → chunk-E7BQZL7X.js} +1 -1
- package/dist/{chunk-YM2Z4LZ2.js → chunk-EFVQQF6F.js} +17 -17
- package/dist/{chunk-GO2TZ35U.js → chunk-EJOKROMB.js} +1 -1
- package/dist/{chunk-4IYHQNKZ.js → chunk-ENDYHUUR.js} +1 -1
- package/dist/{chunk-4F3SUYN5.js → chunk-ETQ45TBW.js} +1 -1
- package/dist/chunk-EX3DARI3.js +7 -0
- package/dist/{chunk-JPCPO4MX.js → chunk-EZYXY67W.js} +8 -8
- package/dist/chunk-F2RAIGCG.js +6 -0
- package/dist/{chunk-ZDMZM7HD.js → chunk-FBZUEZK7.js} +2 -2
- package/dist/{chunk-GURY4WS5.js → chunk-FFRJ6QZK.js} +1 -1
- package/dist/{chunk-F5B5WOQ7.js → chunk-FKMARSJZ.js} +2 -2
- package/dist/chunk-FMLUQCFB.js +2 -0
- package/dist/{chunk-AWWNMSDN.js → chunk-FXSGIT53.js} +10 -10
- package/dist/{chunk-YMHCLK3F.js → chunk-FZYUTZEV.js} +10 -10
- package/dist/chunk-G2JPTPRS.js +13 -0
- package/dist/chunk-G5UGCAWN.js +17 -0
- package/dist/{chunk-DEYVAMJQ.js → chunk-GEITUFYK.js} +13 -13
- package/dist/chunk-GMLOMLCS.js +24 -0
- package/dist/{chunk-QNQLKGBC.js → chunk-GNXAVDZD.js} +1 -1
- package/dist/{chunk-6LS6Q77E.js → chunk-GUSENWAH.js} +1 -1
- package/dist/{chunk-YDQBELHJ.js → chunk-H5PSCQJ2.js} +6 -6
- package/dist/{chunk-LXPDURUL.js → chunk-HMOKKMIV.js} +2 -2
- package/dist/{chunk-RFR2K7JO.js → chunk-HPHDLN6E.js} +2 -2
- package/dist/{chunk-FUP2J2OX.js → chunk-IG3K6AGW.js} +1 -1
- package/dist/{chunk-I5EVMLPB.js → chunk-IJ4JX6WP.js} +4 -4
- package/dist/{chunk-RT77WNRB.js → chunk-IJJNJJ6I.js} +1 -1
- package/dist/chunk-IUQJGFEO.js +11 -0
- package/dist/{chunk-64PPKUJG.js → chunk-J4CVYOY3.js} +13 -13
- package/dist/{chunk-HTANBHNV.js → chunk-J4KPBR5B.js} +1 -1
- package/dist/{chunk-CUZQVBPC.js → chunk-JDLJ7DHV.js} +1 -1
- package/dist/{chunk-775K6APE.js → chunk-JFOMAXD2.js} +67 -67
- package/dist/chunk-JPE4TYRQ.js +14 -0
- package/dist/{chunk-4Q2CZ4US.js → chunk-JPSWWIBW.js} +6 -6
- package/dist/{chunk-XOQGBU25.js → chunk-K2FVP22A.js} +1 -1
- package/dist/{chunk-7RGHV3J5.js → chunk-KGAYYSFE.js} +6 -6
- package/dist/{chunk-KLUCEASW.js → chunk-KQCJWK55.js} +6 -6
- package/dist/{chunk-YNVH2EIE.js → chunk-L4ZQY4ZG.js} +3 -3
- package/dist/{chunk-PALWXHBQ.js → chunk-LKAGXURQ.js} +20 -20
- package/dist/chunk-LQCNIQ3I.js +8 -0
- package/dist/{chunk-RZJ63ZM4.js → chunk-MHQW6NAE.js} +11 -11
- package/dist/{chunk-VCR3RADH.js → chunk-MVOYVN3S.js} +1 -1
- package/dist/{chunk-N2FX4O3H.js → chunk-MZ3JADHG.js} +1 -1
- package/dist/chunk-N5KJLHYI.js +9 -0
- package/dist/{chunk-YBYJUBWE.js → chunk-NW5NSV7N.js} +2 -2
- package/dist/{chunk-SV5RRBVA.js → chunk-NWS5G7FE.js} +1 -1
- package/dist/{chunk-UXGNF3OG.js → chunk-OF5X4HKC.js} +1 -1
- package/dist/{chunk-YY7OFUT2.js → chunk-OIEFMLYI.js} +3 -3
- package/dist/{chunk-FMERX3PG.js → chunk-OLSA36VX.js} +2 -2
- package/dist/chunk-OMOAD5LL.js +1 -0
- package/dist/chunk-OXWBSZL2.js +23 -0
- package/dist/chunk-PBSCF2ML.js +15 -0
- package/dist/{chunk-2YK6ZB7C.js → chunk-PPLPDP6D.js} +1 -1
- package/dist/{chunk-GTT7LIWK.js → chunk-PY4DTB6Y.js} +1 -1
- package/dist/{chunk-QIPO4EVJ.js → chunk-Q4MOT7TY.js} +1 -1
- package/dist/chunk-QAAHFU2I.js +1 -0
- package/dist/{chunk-OYXA7SWV.js → chunk-QE2JX7D4.js} +1 -1
- package/dist/{chunk-7NO4IENQ.js → chunk-R5WBDXI2.js} +1 -1
- package/dist/{chunk-WIFK6TLB.js → chunk-RDETBXMP.js} +1 -1
- package/dist/{chunk-I6QVXM2M.js → chunk-RDVC32EV.js} +15 -15
- package/dist/chunk-RJVIKGHJ.js +4 -0
- package/dist/chunk-S25KELFW.js +11 -0
- package/dist/chunk-SF4IIV5Z.js +2 -0
- package/dist/{chunk-ZDYIVU5R.js → chunk-SHHRC5XK.js} +8 -8
- package/dist/{chunk-OBZZLLMQ.js → chunk-SLEA47VA.js} +1 -1
- package/dist/{chunk-F6UJLCMI.js → chunk-SUSJFGXN.js} +9 -9
- package/dist/{chunk-FTKLODQK.js → chunk-SXHV5OLA.js} +1 -1
- package/dist/{chunk-65FZQ572.js → chunk-SZFULV7I.js} +6 -6
- package/dist/{chunk-HZ7TUMNL.js → chunk-TB2ARUE2.js} +1 -1
- package/dist/{chunk-G67CJAQ2.js → chunk-TD3ZQD5R.js} +1 -1
- package/dist/chunk-THAPVKEJ.js +15 -0
- package/dist/{chunk-HNIIDDLJ.js → chunk-TNALBYLY.js} +1 -1
- package/dist/{chunk-6CDWPEND.js → chunk-TPKNHQIE.js} +8 -8
- package/dist/{chunk-EHM3ZVVT.js → chunk-UC5IC3AM.js} +4 -4
- package/dist/{chunk-VADWTS7H.js → chunk-UFWBPTCM.js} +5 -5
- package/dist/{chunk-EVYD6UFQ.js → chunk-UTISUEO4.js} +2 -2
- package/dist/chunk-UTQN5AIO.js +6 -0
- package/dist/chunk-UVHXVSB2.js +1 -0
- package/dist/{chunk-QMBMK6PP.js → chunk-VKZC3NPM.js} +2 -2
- package/dist/{chunk-UZFFSZFI.js → chunk-VQBKRBBR.js} +1 -1
- package/dist/{chunk-GLUJS42B.js → chunk-VY3UA6AR.js} +1 -1
- package/dist/{chunk-G3MJO3A6.js → chunk-W6NGPSMM.js} +13 -13
- package/dist/chunk-WCCS4VFE.js +1 -0
- package/dist/{chunk-JWLOERV5.js → chunk-WLBWACKP.js} +2 -2
- package/dist/{chunk-WLG7BE55.js → chunk-WRV6QKJN.js} +1 -1
- package/dist/{chunk-LHHJHTWP.js → chunk-WZWSFYXJ.js} +1 -1
- package/dist/{chunk-S6YEPA4I.js → chunk-X4E4RPFE.js} +5 -5
- package/dist/{chunk-M7W63T6H.js → chunk-XAT2MKNU.js} +8 -8
- package/dist/{chunk-QOYKBINM.js → chunk-XQVGBVHC.js} +1 -1
- package/dist/{chunk-E6FDUFPH.js → chunk-XVMCSUAV.js} +1 -1
- package/dist/chunk-XXTAMF3O.js +28 -0
- package/dist/{chunk-6HYO2W3O.js → chunk-YCXQDUTW.js} +5 -5
- package/dist/{chunk-WU2ZA6J2.js → chunk-YDJ5IZOU.js} +1 -1
- package/dist/{chunk-KBQNMQCK.js → chunk-YQ5JHHLE.js} +1 -1
- package/dist/{chunk-2GMYO6ET.js → chunk-YT5HMLC7.js} +1 -1
- package/dist/chunk-YTDMCUL7.js +14 -0
- package/dist/{chunk-G4PPHQ23.js → chunk-YWMCW5BN.js} +1 -1
- package/dist/{chunk-WF4A2HSB.js → chunk-ZCN5BU4U.js} +1 -1
- package/dist/{chunk-HY6CBG4M.js → chunk-ZDFMYAQB.js} +1 -1
- package/dist/chunk-ZDXRSY2Y.js +1 -0
- package/dist/chunk-ZISKHQZY.js +3 -0
- package/dist/{chunk-DVHRL3G6.js → chunk-ZVDYRXNP.js} +6 -6
- package/dist/{chunk-3DWVSQIJ.js → chunk-ZYKY4Z7R.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Gantt.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/data/statusColumn.js +1 -1
- package/dist/data/useColumnConfig.js +1 -1
- package/dist/data/useSort.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/Calendar.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/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/forms/dropdownPosition.js +1 -1
- package/dist/hooks/index.d.ts +29 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/useTheme.js +1 -1
- package/dist/icons/brands.node.js +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +3 -40
- package/dist/index.js +514 -514
- package/dist/map/index.js +7 -7
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Card.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.d.ts +14 -4
- package/dist/shell/Dialog.js +1 -1
- 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/Kbd.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.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/SettingRow.js +1 -1
- package/dist/shell/ShellPrefs.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/TimelineTrack.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.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +4 -1
- package/dist/version.js +1 -1
- package/package.json +6 -1
- package/dist/Browser-FJSOZLWR.js +0 -44
- package/dist/Calculator-ZHINQHFI.js +0 -29
- package/dist/CurrencyConverter-AAXS7RPC.js +0 -21
- package/dist/Notepad-NENKOSXJ.js +0 -24
- package/dist/PomodoroTimer-XKSYNHS7.js +0 -91
- package/dist/Sidebar-GYGYAXS2.js +0 -44
- package/dist/Stock-TCQSVSSY.js +0 -16
- package/dist/chunk-3DSGJIC7.js +0 -7
- package/dist/chunk-47UTEV3P.js +0 -23
- package/dist/chunk-4S3E3VJH.js +0 -11
- package/dist/chunk-64RHGJXK.js +0 -4
- package/dist/chunk-6AUQWWUA.js +0 -17
- package/dist/chunk-7KWYVQMX.js +0 -2
- package/dist/chunk-7QSDPSXP.js +0 -1
- package/dist/chunk-A7ZYFJ6V.js +0 -28
- package/dist/chunk-ASDYAASN.js +0 -3
- package/dist/chunk-D65T4H6J.js +0 -1
- package/dist/chunk-DQTYV6AC.js +0 -9
- package/dist/chunk-EV5BEEVO.js +0 -1
- package/dist/chunk-FHNQC2MA.js +0 -1
- package/dist/chunk-FQD6P6EZ.js +0 -4
- package/dist/chunk-GOAFMGUI.js +0 -15
- package/dist/chunk-IQDHVQAQ.js +0 -14
- package/dist/chunk-JGKDWDVM.js +0 -27
- package/dist/chunk-KY3KGRGC.js +0 -1
- package/dist/chunk-MHCNQKEK.js +0 -4
- package/dist/chunk-RDGXSAOD.js +0 -2
- package/dist/chunk-RIG5FEVS.js +0 -1
- package/dist/chunk-SNHBDP4X.js +0 -15
- package/dist/chunk-SOZCWT6I.js +0 -6
- package/dist/chunk-WWCAVO3R.js +0 -14
- package/dist/chunk-XMFJDT6Y.js +0 -13
- package/dist/chunk-XSHDPG45.js +0 -9
- package/dist/chunk-YUDBB7VC.js +0 -11
- /package/dist/{chunk-JR2HHKVP.js → chunk-FRCTA5FS.js} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-
|
|
1
|
+
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-YWMCW5BN.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as a}from"./chunk-UVHXVSB2.js";import{useFocusTrap as l,useScrollLock as i}from"./chunk-DWGYC7OD.js";import{Button_default as c}from"./chunk-UTISUEO4.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{Z_LAYERS as m}from"./chunk-62LW225J.js";import{useHydrated as u}from"./chunk-WCCS4VFE.js";import{buttonClasses as d}from"./chunk-UQYNPYF4.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as h}from"./chunk-IUVGHHR3.js";import{useRef as p,useState as x,useCallback as b,useEffect as k}from"react";import{createPortal as g}from"react-dom";import{jsx as v,jsxs as w,Fragment as N}from"react/jsx-runtime";var y=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function j(e){return e.kind?e.kind:r(e.url)?"video":y.test(e.url)?"file":"image"}var C="flex items-center justify-center rounded-full bg-black/60 text-on-accent hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",U=e=>e.stopPropagation();function W({images:r,startIndex:y=0,onClose:W,onIndexChange:I,onOpenFile:V}){const $=h().lightbox,z=u(),D=p(null),F=p(null),[O,S]=x(y),Y=r.length,A=z&&Y>0,E=b(e=>{if(Y<2)return;const t=((O+e)%Y+Y)%Y;S(t),I?.(t)},[O,Y,I]);if(a(A),l(D,A,F),i(A),k(()=>{if(A)return f(()=>(W(),!0),()=>D.current)},[A,W]),k(()=>{if(!A)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),E("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[A,E]),!A)return null;const G=r[Math.min(O,Y-1)],L=j(G),R=G.caption||n(G.url);let B;return B="video"===L?/* @__PURE__ */v("video",{src:G.url,controls:!0,playsInline:!0,"aria-label":R,onClick:U,className:`${e} rounded-lg bg-black`}):"file"===L?/* @__PURE__ */w("div",{onClick:U,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-surface px-10 py-8 text-center text-ink-faint",children:[
|
|
2
2
|
/* @__PURE__ */v(s,{name:"document","aria-hidden":"true",className:"h-10 w-10"}),
|
|
3
|
-
/* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:
|
|
4
|
-
/* @__PURE__ */w("div",{ref:
|
|
5
|
-
/* @__PURE__ */w("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:
|
|
6
|
-
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:$.counter(
|
|
7
|
-
/* @__PURE__ */v("button",{ref:
|
|
8
|
-
/* @__PURE__ */v("button",{type:"button",onClick:e=>{
|
|
9
|
-
/* @__PURE__ */v("button",{type:"button",onClick:e=>{
|
|
10
|
-
/* @__PURE__ */w("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:
|
|
11
|
-
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:
|
|
3
|
+
/* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:R}),V?/* @__PURE__ */v(c,{size:"sm",onClick:()=>V(G),children:$.openFile}):/* @__PURE__ */v("a",{href:G.url,target:"_blank",rel:"noopener noreferrer",className:d({size:"sm"}),children:$.openFile})]}):/* @__PURE__ */v(t,{src:G.url,alt:R,className:`${e} object-contain`,frameClassName:"rounded-lg"}),g(
|
|
4
|
+
/* @__PURE__ */w("div",{ref:D,...o({role:"dialog",modal:!0,label:$.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:m.overlay},onClick:W,children:[B,
|
|
5
|
+
/* @__PURE__ */w("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:U,children:[
|
|
6
|
+
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:$.counter(O+1,Y)}),
|
|
7
|
+
/* @__PURE__ */v("button",{ref:F,type:"button",onClick:W,"aria-label":$.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */v(s,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),Y>1&&/* @__PURE__ */w(N,{children:[
|
|
8
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{U(e),E(-1)},"aria-label":$.previous,className:`${C} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(s,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
|
|
9
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{U(e),E(1)},"aria-label":$.next,className:`${C} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(s,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
|
|
10
|
+
/* @__PURE__ */w("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:U,children:[
|
|
11
|
+
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:R}),"file"!==L&&/* @__PURE__ */v("a",{href:G.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-on-accent/70 underline decoration-on-accent/30 underline-offset-2 hover:text-on-accent",children:$.openOriginal})]})]}),document.body)}export{W as ImageLightbox,j as lightboxKind};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{calendarNames as e,firstDayOfWeek as r,userToday as t}from"./chunk-NHKT5IH6.js";import{fromDateKey as a,toMonthKey as n,toDateKey as o,fromMonthKey as l,addMonths as i}from"./chunk-JRQMX4PK.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{useBrowserValue as c}from"./chunk-
|
|
1
|
+
import{calendarNames as e,firstDayOfWeek as r,userToday as t}from"./chunk-NHKT5IH6.js";import{fromDateKey as a,toMonthKey as n,toDateKey as o,fromMonthKey as l,addMonths as i}from"./chunk-JRQMX4PK.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{useBrowserValue as c}from"./chunk-WCCS4VFE.js";import{useShellStrings as u,useShellLocale as g}from"./chunk-IUVGHHR3.js";import{useMemo as d,useState as h,useRef as m,useEffect as f}from"react";import{jsxs as b,jsx as y,Fragment as v}from"react/jsx-runtime";var p="grid grid-cols-[repeat(7,minmax(0,40px))] sm:grid-cols-[repeat(7,minmax(0,32px))] justify-center gap-1";var x=()=>t();var w=(e,r)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+r);function N({value:t,endValue:N,mode:k="single",onSelect:M,min:Y,max:D,month:F,defaultMonth:j,onMonthChange:C,weekStartsOn:A,quickJump:S=!0,markedDates:P,readOnly:H=!1,"aria-label":K,className:q=""}){const I=d(()=>new Set(P??[]),[P]),R=a(t),V=c(x,null),E=a(V),O=u().calendar,U=g(),W=e(U),$=c(()=>r(U),0),J=A??$,B=()=>{if(!E)return null;const e=n(E);return Y&&e<Y.slice(0,7)?Y.slice(0,7):D&&e>D.slice(0,7)?D.slice(0,7):e},[G,L]=h(()=>j||(R?n(R):B())),Q=F??G??B(),T=null===Q?null:function(e,r){return l(e)??r}(Q,E),[X,z]=h(()=>t??V),Z=m(null),_=m(!1),[ee,re]=h("days"),te=d(()=>T?function(e,r){const t=new Date(e.getFullYear(),e.getMonth(),1),a=(t.getDay()-r+7)%7,n=new Date(t.getFullYear(),t.getMonth(),1-a);return Array.from({length:42},(e,r)=>new Date(n.getFullYear(),n.getMonth(),n.getDate()+r))}(T,J):[],[Q,J]),ae=e=>!!Y&&e<Y||!!D&&e>D,ne=X??V,oe=te.some(e=>o(e)===ne),le=T?te.find(e=>e.getMonth()===T.getMonth())??te[0]:null,ie=oe&&ne?ne:le?o(le):"";if(f(()=>{_.current&&(_.current=!1,Z.current?.querySelector('[data-active="true"]')?.focus())},[ie,Q]),!T)/* @__PURE__ */
|
|
2
2
|
return b("div",{className:q,"aria-hidden":"true","data-calendar-pending":"",children:[
|
|
3
3
|
/* @__PURE__ */y("div",{className:"mb-2 h-6"}),
|
|
4
|
-
/* @__PURE__ */y("div",{className:"space-y-1",children:Array.from({length:7},(e,r)=>/* @__PURE__ */y("div",0===r?{className:"py-1 text-xs",children:" "}:{className:p,children:/* @__PURE__ */y("span",{className:"aspect-square"})},r))})]});const se=e=>"years"===ee?new Date(
|
|
4
|
+
/* @__PURE__ */y("div",{className:"space-y-1",children:Array.from({length:7},(e,r)=>/* @__PURE__ */y("div",0===r?{className:"py-1 text-xs",children:" "}:{className:p,children:/* @__PURE__ */y("span",{className:"aspect-square"})},r))})]});const se=e=>"years"===ee?new Date(T.getFullYear()+12*e,T.getMonth(),1):"months"===ee?new Date(T.getFullYear()+e,T.getMonth(),1):i(T,e),ce=e=>{const r=n(e);void 0===F&&L(r),C?.(r)},ue=K??W.monthYear(T.getFullYear(),T.getMonth());/* @__PURE__ */
|
|
5
5
|
return b("div",{className:q,children:[
|
|
6
6
|
/* @__PURE__ */b("div",{className:"mb-2 flex items-center justify-between px-1",children:[
|
|
7
|
-
/* @__PURE__ */y("button",{type:"button","aria-label":"years"===ee?
|
|
8
|
-
/* @__PURE__ */y("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:S?/* @__PURE__ */b(v,{children:["years"!==ee&&/* @__PURE__ */y("button",{type:"button","aria-label":
|
|
9
|
-
/* @__PURE__ */y("button",{type:"button","aria-label":
|
|
10
|
-
/* @__PURE__ */y("button",{type:"button","aria-label":"years"===ee?
|
|
11
|
-
/* @__PURE__ */b("div",{ref:Z,role:"grid","aria-label":ue,className:"space-y-1","aria-readonly":
|
|
12
|
-
/* @__PURE__ */y("div",{role:"row",className:`${p} text-center text-xs font-medium text-ink-faint`,children:Array.from({length:7},(e,r)=>(r+
|
|
13
|
-
/* @__PURE__ */y("div",{role:"columnheader","aria-label"
|
|
14
|
-
return y("div",{role:"gridcell","aria-selected":n,"aria-label":
|
|
7
|
+
/* @__PURE__ */y("button",{type:"button","aria-label":"years"===ee?O.previousYears:"months"===ee?O.previousYear:O.previousMonth,onClick:()=>ce(se(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */y(s,{name:"chevron-left",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})}),
|
|
8
|
+
/* @__PURE__ */y("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:S?/* @__PURE__ */b(v,{children:["years"!==ee&&/* @__PURE__ */y("button",{type:"button","aria-label":O.chooseMonth(W.months[T.getMonth()]),onClick:()=>re(e=>"months"===e?"days":"months"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:W.months[T.getMonth()]}),
|
|
9
|
+
/* @__PURE__ */y("button",{type:"button","aria-label":O.chooseYear(T.getFullYear()),onClick:()=>re(e=>"years"===e?"days":"years"),className:"rounded-md px-2 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:T.getFullYear()})]}):/* @__PURE__ */y("span",{children:W.monthYear(T.getFullYear(),T.getMonth())})}),
|
|
10
|
+
/* @__PURE__ */y("button",{type:"button","aria-label":"years"===ee?O.nextYears:"months"===ee?O.nextYear:O.nextMonth,onClick:()=>ce(se(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */y(s,{name:"chevron-right",className:"h-4 w-4",strokeWidth:"2","aria-hidden":"true"})})]}),"months"===ee&&/* @__PURE__ */y("div",{role:"group","aria-label":O.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:W.monthsShort.map((e,r)=>/* @__PURE__ */y("button",{type:"button","aria-pressed":r===T.getMonth(),onClick:()=>{ce(new Date(T.getFullYear(),r,1)),re("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",r===T.getMonth()?"bg-blue-600 font-semibold text-white":E&&r===E.getMonth()&&T.getFullYear()===E.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===ee&&/* @__PURE__ */y("div",{role:"group","aria-label":O.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,r)=>{return t=T.getFullYear(),12*Math.floor(t/12)+r;var t}).map(e=>/* @__PURE__ */y("button",{type:"button","aria-pressed":e===T.getFullYear(),onClick:()=>{ce(new Date(e,T.getMonth(),1)),re("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===T.getFullYear()?"bg-blue-600 font-semibold text-white":e===E?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
|
|
11
|
+
/* @__PURE__ */b("div",{ref:Z,role:"grid","aria-label":ue,className:"space-y-1","aria-readonly":H||void 0,onKeyDown:e=>{const r=a(ie)??E??T,t={ArrowLeft:()=>w(r,-1),ArrowRight:()=>w(r,1),ArrowUp:()=>w(r,-7),ArrowDown:()=>w(r,7),Home:()=>w(r,-(r.getDay()-J+7)%7),End:()=>w(r,6-(r.getDay()-J+7)%7),PageUp:()=>i(r,e.shiftKey?-12:-1),PageDown:()=>i(r,e.shiftKey?12:1)};if(t[e.key])return e.preventDefault(),l=t[e.key](),_.current=!0,z(o(l)),void(n(l)!==Q&&ce(l));var l;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),H||ae(ie)||M(ie))},hidden:"days"!==ee,children:[
|
|
12
|
+
/* @__PURE__ */y("div",{role:"row",className:`${p} text-center text-xs font-medium text-ink-faint`,children:Array.from({length:7},(e,r)=>(r+J)%7).map(e=>
|
|
13
|
+
/* @__PURE__ */y("div",{role:"columnheader","aria-label":W.weekdays[e],className:"py-1",children:/* @__PURE__ */y("abbr",{title:W.weekdays[e],className:"no-underline",children:W.weekdaysShort[e]})},e))}),Array.from({length:6},(e,r)=>/* @__PURE__ */y("div",{role:"row",className:`${p} text-center text-sm`,children:te.slice(7*r,7*r+7).map(e=>{const r=o(e),a=e.getMonth()!==T.getMonth(),n=r===t||"range"===k&&r===N,l=(e=>!("range"!==k||!t||!N)&&e>t&&e<N)(r),i=ae(r),s=W.longDate(e.getFullYear(),e.getMonth(),e.getDate()),c=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",i?"cursor-not-allowed text-gray-300":n?"bg-accent-fill font-semibold text-on-accent":l?"bg-accent-tint-strong text-blue-800":a?"text-ink-faint"+(e?" hover:bg-gray-100":""):"text-ink"+(e?" hover:bg-gray-100":""),r!==V||n?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),u=I.has(r)&&/* @__PURE__ */y("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(n?"bg-surface":a?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
|
|
14
|
+
return y("div",{role:"gridcell","aria-selected":n,"aria-label":H?s:void 0,children:H?/* @__PURE__ */b("span",{"aria-hidden":"true",className:`grid place-items-center ${c(!1)}`,children:[e.getDate(),u]}):/* @__PURE__ */b("button",{type:"button","data-active":r===ie,tabIndex:r===ie?0:-1,disabled:i,"aria-label":s,"aria-current":r===V?"date":void 0,onClick:()=>{z(r),M(r)},className:c(!0),children:[e.getDate(),u]})},r)})},r))]})]})}export{N as Calendar};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as i}from"./chunk-K5YT5PMJ.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as s,InputEndActionButton as c}from"./chunk-3SIRRK3F.js";import{INPUT_BASE_ON as u,INPUT_BASE as d}from"./chunk-AYZY3YNC.js";import{Button_default as h}from"./chunk-UTISUEO4.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{LoadingSpinner as m}from"./chunk-R2VKEMZH.js";import{Tooltip as f}from"./chunk-F2RAIGCG.js";import{onOverlayOpen as b}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as g}from"./chunk-62LW225J.js";import{useDropdownPosition as v,MENU_MAX_HEIGHT as w}from"./chunk-VY3UA6AR.js";import{useBrowserLayoutEffect as y}from"./chunk-ZDXRSY2Y.js";import{registerModalEscapeInterceptor as x}from"./chunk-TWVUQUUD.js";import{GLASS_DIVIDER as k,glassStyle as j}from"./chunk-5FYDNH4Y.js";import{useShellStrings as $}from"./chunk-IUVGHHR3.js";import{useState as N,useId as D,useRef as S,useMemo as C,useEffect as R}from"react";import{createPortal as W}from"react-dom";import{jsxs as F,jsx as M}from"react/jsx-runtime";function A(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}var E=["right-2","right-8","right-16"],I=[8,32,64];function T(T){const{options:Y,placeholder:z,emptyOptionLabel:O,className:U="",disabled:L,id:H,filter:V=!1,allowFreeText:G=!1,freeTextOption:K,onSearchChange:B,loading:P=!1,error:Z,onRetry:J,rightAdornment:X,endAction:Q,renderOption:q,clearable:_=!0,"aria-label":ee,"aria-labelledby":te,"aria-describedby":ne}=T,re=!0===T.multiple,le=T.multiple?T.value:T.value?[T.value]:[],oe=T.multiple?"":T.value,ie=e=>{T.multiple?T.onChange(e):T.onChange(e[0]??"")},ae=le.length>0,se=V&&ae&&!L,ce=re||V,ue=null!=K,de=G||ue,[he,pe]=N(!1),[me,fe]=N(-1),be=D(),ge=H??`${be}-input`,ve=`${be}-listbox`,we=e=>`${be}-opt-${e}`,[ye,xe]=N(""),ke=$(),je=O??ke.select.none,$e=e=>{xe(e),fe(-1),B?.(e)},Ne=S(null),De=S(null),Se=S(null),Ce=S(null),Re=S(he);Re.current=he;const We=S(!1),Fe=e=>{Re.current&&(Re.current=!1,e&&G&&!ue&&et&&(re?le.includes(et)||ie([...le,et]):et!==oe&&ie([et])),pe(!1),$e(""))},Me=(e,t)=>{if(!e.disabled){if(re)return ie(le.includes(e.value)?le.filter(t=>t!==e.value):[...le,e.value]),void(e===tt?$e(""):fe(t));ie([e.value]),Fe(!1)}},[Ae,Ee]=N(null);y(()=>{if(!X||he)return void Ee(null);const e=Ce.current?.offsetWidth??0;Ee(e?e+I[Le]+6:null)});const Ie=v(De,he,ce?{popupRef:Se}:{matchTriggerWidth:!0}),Te=C(()=>t(Y),[Y]),Ye=le.join("\0"),ze=C(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of Te)le.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(de)for(const n of le)t.has(n)||e.push(n);return e},[Te,Ye,de]),Oe=ze.join(", "),Ue=_&&ae&&!L,Le=(Ue?1:0)+(Q?1:0),[He,Ve]=N(null),Ge=S(null),Ke=S(""),Be=S(()=>{});Be.current=()=>{const e=De.current,t=Ge.current;if(!re||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${ze.join("\0")}`;if(o===Ke.current)return;Ke.current=o;let i=null;r>0&&ze.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,i=A(ze,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),Ve(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},y(()=>{Be.current()}),R(()=>{const e=De.current;if(!re||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Be.current());return t.observe(e),()=>t.disconnect()},[re]);const Pe=ze.length,Ze=!re||!He||He.shown>=Pe?Oe:0===He.shown?ke.select.selectedCount(Pe):`${ze.slice(0,He.shown).join(", ")} +${Pe-He.shown}`,Je=re&&null!==He&&(He.shown<Pe||He.cut),Xe=he&&ae&&ce;R(()=>{if(!he)return;const e=e=>{const t=e.target;Ne.current?.contains(t)||Se.current?.contains(t)||Fe(!0)};document.addEventListener("mousedown",e);const t=b(()=>Fe(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[he,G,ye,Ye,T.onChange]),R(()=>{if(he)return x(e=>!("Escape"!==e.key||!Re.current)&&(Fe(!1),De.current?.blur(),!0),()=>Se.current)},[he]);const Qe=C(()=>{const e=/* @__PURE__ */new Set;return n(Y,t=>!e.has(t.value)&&(e.add(t.value),!0))},[Y]),qe=C(()=>{if(B)return Qe;const e=ye.trim().toLowerCase();return e?n(Qe,t=>r(t,e)):Qe},[Qe,ye,B]),_e=C(()=>t(qe),[qe]),et=ye.trim(),tt=C(()=>ue&&et?Te.some(e=>e.label===et)||le.includes(et)?null:{value:et,label:et}:null,[ue,et,Te,Ye]),nt=C(()=>tt?[..._e,tt]:_e,[_e,tt]);/* @__PURE__ */
|
|
2
|
+
return F("div",{ref:Ne,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(Ne.current?.contains(t)||Se.current?.contains(t))||We.current||document.activeElement!==De.current&&Fe(!0)},children:[(rt=/* @__PURE__ */M("input",{id:ge,ref:De,type:"text",autoComplete:"off",role:"combobox","aria-expanded":he,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":he?ve:void 0,"aria-activedescendant":he&&me>=0&&me<nt.length?we(me):void 0,"aria-label":te?void 0:ee,"aria-labelledby":te,"aria-describedby":ne,value:he?ye:Ze,onChange:e=>{$e(e.target.value),pe(!0)},onFocus:()=>{L||($e(""),pe(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(L)return;if(t.preventDefault(),!he)return void pe(!0);if(0===nt.length)return;const n="ArrowDown"===t.key?1:-1;return void fe(t=>e(nt,t,n))}"Enter"===t.key?(t.preventDefault(),he&&me>=0&&me<nt.length?Me(nt[me],me):1!==_e.length||_e[0].disabled?G&&!ue&&et&&(re?(le.includes(et)||ie([...le,et]),$e("")):(ie([et]),Fe(!1),De.current?.blur())):Me(_e[0],0)):"Escape"===t.key?(Fe(!1),De.current?.blur()):"Tab"===t.key&&Fe(!0)},placeholder:Xe?Ze:z||je,className:`${se?u:d} ${U} ${a[Le]}${L?"bg-surface-sunken text-ink-faintest cursor-not-allowed":""} truncate${Xe?" rosh-field-shows-choice":""}`,style:Ae?{paddingRight:Ae}:void 0,disabled:L}),re?/* @__PURE__ */M(f,{content:!he&&Je?Oe:null,className:"block",children:rt}):rt),re&&
|
|
3
|
+
/* @__PURE__ */M("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */M("span",{ref:Ge,className:"whitespace-pre"})}),Le>0&&
|
|
4
|
+
/* @__PURE__ */F(s,{children:[Ue&&
|
|
5
|
+
/* @__PURE__ */M("span",{onMouseDown:e=>e.preventDefault(),className:"flex opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",children:/* @__PURE__ */M(c,{action:{label:ke.select.clear,icon:/* @__PURE__ */M(p,{name:"close"}),onClick:()=>{ie([]),Fe(!1)}}})}),Q&&/* @__PURE__ */M("span",{onMouseDown:e=>e.preventDefault(),className:"flex",children:/* @__PURE__ */M(c,{action:Q})})]}),X&&!he&&/* @__PURE__ */M("div",{ref:Ce,className:`absolute top-1/2 -translate-y-1/2 ${E[Le]} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:X}),he&&W(
|
|
6
|
+
/* @__PURE__ */F("div",{ref:Se,onMouseDownCapture:()=>{We.current=!0,setTimeout(()=>{We.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:g.popup,left:Ie?.left,right:Ie?.right,top:Ie?.top,bottom:Ie?.bottom,minWidth:Ie?.minWidth,width:Ie?.width,...ce&&{maxWidth:Ie?.maxWidth},visibility:Ie?void 0:"hidden",...j()},children:[re&&ae&&_&&!L&&
|
|
7
|
+
/* @__PURE__ */M("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ie([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-row-hover border-b ${k}`,children:ke.select.clearAll}),P?
|
|
8
|
+
/* @__PURE__ */M(m,{size:"sm",padding:"py-2",label:ke.search.searching}):Z?/* @__PURE__ */F("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
|
|
9
|
+
/* @__PURE__ */M("span",{className:"min-w-0 flex-1",children:Z}),J&&/* @__PURE__ */M(h,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:J,className:"shrink-0",children:ke.list.retry})]}):null,
|
|
10
|
+
/* @__PURE__ */F("div",{id:ve,role:nt.length?"listbox":void 0,"aria-labelledby":nt.length?te??(ee?void 0:ge):void 0,"aria-label":nt.length&&!te?ee:void 0,"aria-multiselectable":!(!nt.length||!re)||void 0,className:"overflow-y-auto",style:{maxHeight:Ie?.maxHeight??w},children:[0===nt.length?P||Z?null:/* @__PURE__ */M("p",{className:"px-3 py-3 text-sm text-ink-faintest text-center",children:ke.select.noMatches}):0===_e.length?null:l(qe,(e,t)=>{const n=le.includes(e.value);/* @__PURE__ */
|
|
11
|
+
return F("button",{id:we(t),type:"button",role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:n=>{(e.disabled||re)&&n.preventDefault(),Me(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${n?"text-blue-600 font-medium":"text-gray-700"} ${t===me?"bg-gray-100":n?"bg-blue-50/50":""}`),children:[re&&/* @__PURE__ */M(o,{selected:n}),
|
|
12
|
+
/* @__PURE__ */M("span",{className:`min-w-0 ${ce?"flex-auto":"flex-1"} truncate`,children:q?q(e,{selected:n,active:t===me}):e.label}),e.sublabel&&/* @__PURE__ */M(i,{grows:ce,children:e.sublabel})]},e.value)},be),tt&&K&&
|
|
13
|
+
/* @__PURE__ */M("button",{id:we(_e.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{re&&e.preventDefault(),Me(tt,_e.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-ink hover:bg-row-hover ${_e.length?`border-t ${k}`:""} ${me===_e.length?"bg-gray-100":""}`,children:/* @__PURE__ */M("span",{className:"min-w-0 flex-1 truncate",children:K(tt.value)})},`${be}-typed`)]})]}),document.body)]});var rt}export{T as SearchableSelect,A as fitChoice};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{ChartSkeleton as e}from"./chunk-ZNV75GAG.js";import{ChartHighlightProvider as r,useHighlight as a}from"./chunk-CNYAHYE6.js";import{HEADING_TEXT as s,DESCRIPTION_TEXT as t}from"./chunk-BWJZTHZ6.js";import{CHART_INK as l,resolveSeriesColor as n}from"./chunk-TZFACUMR.js";import{useShellStrings as o}from"./chunk-IUVGHHR3.js";import{jsx as c,jsxs as i,Fragment as d}from"react/jsx-runtime";function u({shape:e,colour:r}){const a="shrink-0";switch(e){case"circle":/* @__PURE__ */
|
|
2
|
+
return c("span",{className:`${a} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:r}});case"circle-outline":/* @__PURE__ */
|
|
3
|
+
return c("span",{className:`${a} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:r}});case"rounded-square-outline":/* @__PURE__ */
|
|
4
|
+
return c("span",{className:`${a} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:r}});case"square":/* @__PURE__ */
|
|
5
|
+
return c("span",{className:`${a} h-2.5 w-2.5`,style:{backgroundColor:r}});case"bar":/* @__PURE__ */
|
|
6
|
+
return c("span",{className:`${a} h-1 w-4 rounded-full`,style:{backgroundColor:r}});case"bar-vertical":/* @__PURE__ */
|
|
7
|
+
return c("span",{className:`${a} h-3.5 w-1 rounded-full`,style:{backgroundColor:r}});default:/* @__PURE__ */
|
|
8
|
+
return c("span",{className:`${a} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:r}})}}function h({entries:e,interactive:r,fallbackSwatch:s,onClick:t}){const{highlighted:l,setHighlighted:o}=a();/* @__PURE__ */
|
|
9
|
+
return c("ul",{className:"m-0 flex flex-wrap items-center gap-x-4 gap-y-1 p-0",children:e.map((e,a)=>{const h=r&&null!==l&&l!==e.key,m=/* @__PURE__ */i(d,{children:[
|
|
10
|
+
/* @__PURE__ */c(u,{shape:e.swatch??s,colour:n(a,e.color,e.tone)}),e.label]});/* @__PURE__ */
|
|
11
|
+
return c("li",{className:"list-none",children:r||t?/* @__PURE__ */c("button",{type:"button",onClick:t?()=>t(e.key):void 0,"aria-pressed":t?Boolean(e.pressed):void 0,onMouseEnter:r?()=>o(e.key):void 0,onMouseLeave:r?()=>o(null):void 0,onFocus:r?()=>o(e.key):void 0,onBlur:r?()=>o(null):void 0,className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(h?"opacity-40":""),children:m}):/* @__PURE__ */c("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:m})},e.key)})})}function m({title:a,subtitle:n,legend:d,table:u,tableLabel:m,busy:p=!1,loading:b=!1,skeletonVariant:g="area",skeletonHeight:y,interactiveLegend:f=!0,legendSwatch:k="rounded-square",onLegendClick:N,actions:w,children:x,className:v}){const C=o().charts;/* @__PURE__ */
|
|
12
|
+
return c(r,{children:/* @__PURE__ */i("section",{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-gray-200 bg-white p-5 ${v??""}`,"aria-busy":p||b||void 0,children:[
|
|
13
|
+
/* @__PURE__ */i("header",{className:"flex items-start justify-between gap-4",children:[
|
|
14
|
+
/* @__PURE__ */i("div",{className:"min-w-0",children:[
|
|
15
|
+
/* @__PURE__ */c("h3",{className:s,children:a}),n&&/* @__PURE__ */c("p",{className:`mt-0.5 ${t}`,children:n})]}),w&&/* @__PURE__ */c("div",{className:"shrink-0",children:w})]}),b?/* @__PURE__ */c(e,{variant:g,height:y}):/* @__PURE__ */c("div",{className:p?"opacity-60 transition-opacity":"transition-opacity",children:x}),!b&&d&&d.length>1&&/* @__PURE__ */c(h,{entries:d,interactive:f,fallbackSwatch:k,onClick:N}),!b&&u&&/* @__PURE__ */i("details",{className:"border-t border-gray-100 pt-3",children:[
|
|
16
|
+
/* @__PURE__ */c("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 rosh-focus-outline",children:m??C.showTable}),
|
|
17
|
+
/* @__PURE__ */c("div",{className:"mt-3 overflow-x-auto",style:{color:l.label},children:u})]})]})})}export{m as ChartFrame};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-K5YT5PMJ.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-ISVODSRP.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-
|
|
2
|
-
/* @__PURE__ */C(
|
|
3
|
-
/* @__PURE__ */C("span",{id:
|
|
4
|
-
return C(E,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */C("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var
|
|
1
|
+
import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-K5YT5PMJ.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-ISVODSRP.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-VY3UA6AR.js";import{useBrowserLayoutEffect as g}from"./chunk-ZDXRSY2Y.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{solidSurfaceStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as k}from"./chunk-IUVGHHR3.js";import{forwardRef as N,useId as w,useState as $,useRef as D,useMemo as j,useCallback as S,useEffect as H}from"react";import{createPortal as T}from"react-dom";import{jsxs as I,jsx as C,Fragment as E}from"react/jsx-runtime";var O=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,R=N(function({value:e,onChange:t,options:r,placeholder:i,invalid:n,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},x){const N=t,$=k(),D=d(),j=f??D,S=w(),H=/* @__PURE__ */I("select",{ref:x,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":n||void 0,"aria-describedby":[g,j?S:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */C("option",{value:"",disabled:!0,children:i}),
|
|
2
|
+
/* @__PURE__ */C(z,{items:r})]});return j?/* @__PURE__ */I(E,{children:[H,
|
|
3
|
+
/* @__PURE__ */C("span",{id:S,hidden:!0,children:$.settingView.auto})]}):H});function z({items:e}){const t=e=>/* @__PURE__ */C("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
4
|
+
return C(E,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */C("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var A=N(function({value:l,onChange:u,options:N,placeholder:R,invalid:A,className:V="",id:Y,disabled:U,size:K,touchSize:P,title:B,multiple:M,renderOption:W,renderValue:F,valueText:G,readOnly:L=!1,footer:X,changed:q=!1,auto:J,"aria-describedby":Z,"aria-label":Q,"aria-labelledby":_,...ee},te){const[re,ie]=$(!1),[ne,ae]=$(-1),le=D(null),oe=D(null),de=D(null),se=D(null),ce=D([]),ue=()=>se.current??de.current,pe=!!X?.length,me="sm"===K,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=$(null),ge=k(),ye=D(re);ye.current=re;const xe=D({buffer:"",timer:null}),ke=w(),Ne=`${ke}-listbox`,we=Y??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,je=d(),Se=J??je,He=`${ke}-auto`,Te=[Z,q?De:void 0,Se?He:void 0].filter(Boolean).join(" ")||void 0,Ie=j(()=>n(N),[N]),Ce=M?l:[],Ee=u,Oe=f(oe,re,{matchTriggerWidth:!0,...X?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),Re=`${re}|${Oe?.top}|${Oe?.bottom}|${Oe?.maxHeight}|${N.length}`;g(()=>{be(null)},[Re]),g(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const i=e.getBoundingClientRect().top;let n=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-i+e.scrollTop;if(!(r<=e.clientHeight+.5))break;n=r}n>r&&be(Math.floor(n))},[re,fe,Re]);const ze=M?Ie.findIndex(e=>Ce.includes(e.value)):Ie.findIndex(e=>e.value===l),Ae=M?Ie.filter(e=>Ce.includes(e.value)).map(e=>e.label).join(", ")||void 0:ze>=0?Ie[ze].label:void 0,Ve=!M&&ze>=0?Ie[ze].lang:void 0,Ye=M?Ie.filter(e=>Ce.includes(e.value)):ze>=0?[Ie[ze]]:[],Ue=F&&Ye.length?F(Ye):void 0,Ke=void 0!==Ue&&G?G(Ye):void 0,Pe=S((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Be=S(()=>{U||L||(ae(ze>=0?ze:e(Ie)),ie(!0))},[U,L,Ie,ze]),Me=S(e=>{const t=Ie[e];if(t&&!t.disabled){if(M){const r=l;return Ee(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ee(t.value),Pe()}},[Ie,M,l,Ee,Pe]);H(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Pe(),!0),ue)},[re,Pe]),H(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Pe(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Pe(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Pe]),H(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const We=S(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const i=re?ne:ze,n=t(Ie,r.buffer,i);n<0||(re?ae(n):M?(ae(n),ie(!0)):Me(n))},[re,ne,ze,Ie,Me,M]),Fe=re?a(N,(e,t)=>{const r=(i=e.value,M?Ce.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
|
|
5
5
|
return I("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||W?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>Me(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${M?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":n?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[M&&/* @__PURE__ */C(o,{selected:r}),W?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1 truncate",children:W(e,{selected:r,active:n})}):M?/* @__PURE__ */I("span",{className:"block min-w-0 flex-1",children:[
|
|
6
6
|
/* @__PURE__ */C("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */C("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
|
|
7
7
|
/* @__PURE__ */I(E,{children:[
|
|
8
|
-
/* @__PURE__ */C("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */C("span",{className:he,children:e.description})]}):e.label]},e.value)},ke,"mx-1"):null,Ge=void 0!==
|
|
8
|
+
/* @__PURE__ */C("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */C("span",{className:he,children:e.description})]}):e.label]},e.value)},ke,"mx-1"):null,Ge=void 0!==Ue?
|
|
9
9
|
/* @__PURE__ */I("span",{className:"relative block min-w-0 truncate",children:[
|
|
10
|
-
/* @__PURE__ */C("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:
|
|
11
|
-
/* @__PURE__ */C("span",{lang:void 0===
|
|
12
|
-
/* @__PURE__ */C("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:
|
|
13
|
-
/* @__PURE__ */C("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):
|
|
10
|
+
/* @__PURE__ */C("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Ue}),
|
|
11
|
+
/* @__PURE__ */C("span",{lang:void 0===Ke?Ve:void 0,className:"sr-only",children:Ke??Ae})]}):/* @__PURE__ */C("span",{lang:Ve,className:`block truncate ${void 0===Ae?c:""}`,children:Ae??R??" "}),Le={zIndex:h.popup,left:Oe?.left,top:Oe?.top,bottom:Oe?.bottom,width:Oe?.width,maxHeight:Oe?.maxHeight??b,visibility:Oe?void 0:"hidden",...x()},Xe=/* @__PURE__ */C("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Q?void 0:we),"aria-label":_?void 0:Q,"aria-multiselectable":M||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Le,maxHeight:fe}:Le,children:Fe}),qe=pe?/* @__PURE__ */I("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Le,children:[Xe,
|
|
12
|
+
/* @__PURE__ */C("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:X.map((e,t)=>/* @__PURE__ */I("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Pe(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(X?.length??0)-1,i=t=>{e.preventDefault(),ce.current[t]?.focus()},n=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void i(Math.min(t+1,r));case"ArrowUp":return void(0===t?n():i(t-1));case"Home":return void i(0);case"End":return void i(r);case"Tab":return e.shiftKey?void(0===t?n():i(t-1)):t<r?void i(t+1):(e.preventDefault(),void Pe());case"Escape":return e.preventDefault(),e.stopPropagation(),void Pe()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */C(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
13
|
+
/* @__PURE__ */C("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Xe;/* @__PURE__ */
|
|
14
14
|
return I("div",{ref:le,className:"relative",children:[
|
|
15
|
-
/* @__PURE__ */C("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?Ne:void 0,"aria-activedescendant":re&&ne>=0?$e(ne):void 0,"aria-invalid":
|
|
15
|
+
/* @__PURE__ */C("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?Ne:void 0,"aria-activedescendant":re&&ne>=0?$e(ne):void 0,"aria-invalid":A||void 0,"aria-describedby":Te,"aria-label":Q,"aria-labelledby":_,title:B,disabled:U,"aria-readonly":L||void 0,onClick:()=>re?Pe():Be(),onKeyDown:t=>{if(!U&&!L)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>i(Ie,e,1)):Be());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>i(Ie,e,-1)):Be());case"Home":return void(re&&(t.preventDefault(),ae(e(Ie))));case"End":return void(re&&(t.preventDefault(),ae(r(Ie))));case"Enter":return void(re&&(t.preventDefault(),Me(ne)));case" ":return t.preventDefault(),void(re?Me(ne):Be());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Pe()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Pe(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),We(t.key))}},className:s({invalid:A,size:K,readOnly:L,auto:Se,className:`${L?"":"pr-8 "}text-left ${V}`.trim()}),children:q?
|
|
16
16
|
/* @__PURE__ */I("span",{className:"flex min-w-0 items-center gap-1",children:[Ge,
|
|
17
|
-
/* @__PURE__ */C("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Ge}),q&&/* @__PURE__ */C("span",{id:De,hidden:!0,children:ge.select.changed}),
|
|
18
|
-
/* @__PURE__ */I("select",{ref:te,value:l,multiple:M||void 0,onChange:e=>Ee(M?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:
|
|
19
|
-
/* @__PURE__ */C(
|
|
17
|
+
/* @__PURE__ */C("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Ge}),q&&/* @__PURE__ */C("span",{id:De,hidden:!0,children:ge.select.changed}),Se&&/* @__PURE__ */C("span",{id:He,hidden:!0,children:ge.settingView.auto}),!L&&/* @__PURE__ */C(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
|
|
18
|
+
/* @__PURE__ */I("select",{ref:te,value:l,multiple:M||void 0,onChange:e=>Ee(M?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:U,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==R&&!M&&/* @__PURE__ */C("option",{value:"",disabled:!0,children:R}),
|
|
19
|
+
/* @__PURE__ */C(z,{items:N})]}),re&&T(qe,document.body)]})}),V=N(function({touchSize:e,...t},r){const i=u(),n=e??"touch";return!i||void 0===t.footer&&void 0===t.changed||t.readOnly?i&&!t.readOnly?/* @__PURE__ */C(R,{ref:r,...t,size:n}):/* @__PURE__ */C(A,{ref:r,...t}):/* @__PURE__ */C(A,{ref:r,...t,size:n})});export{R as NativeSelect,V as Select_default};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{Dialog as e}from"./chunk-UTQN5AIO.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{HEADING_TEXT as n}from"./chunk-BWJZTHZ6.js";import{buttonClasses as t}from"./chunk-UQYNPYF4.js";import{useShellStrings as o,splitAround as l}from"./chunk-IUVGHHR3.js";import{createContext as i,useContext as s,useState as c,useRef as a,useCallback as u,useEffect as d}from"react";import{jsxs as m,jsx as h,Fragment as f}from"react/jsx-runtime";var p=i(()=>Promise.resolve(!1)),g=()=>s(p),b=()=>Promise.resolve(!1),v=e=>b(e),y=()=>Promise.resolve(!1),x=e=>y(e),N=()=>Promise.resolve(null),k=e=>N(e),w={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-accent-tint-strong",button:t({variant:"primary"})}},C=t({variant:"secondary"}),P=t({variant:"primary"}),L="w-full rounded-md border border-line-strong h-8 px-3 text-sm";function j(){/* @__PURE__ */
|
|
2
|
+
return h(r,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function F({children:r}){const[t,i]=c(!1),[s,g]=c({message:""}),[v,x]=c(0),k=a(),F=a(null),T=a(0),E=a([]),$=a(null),D=a(null),H=u(e=>{F.current=e.id,k.current=e.resolve,x(e.id),g(e.options),i(!0)},[]),I=u(e=>{const r="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++T.current,options:r,resolve:e};null===F.current?H(n):E.current.push(n)})},[H]),[U,V]=c(!1),[W,K]=c({message:""}),[O,Q]=c(""),R=a(),S=u(e=>(K(e),Q(""),V(!0),new Promise(e=>{R.current=e})),[]),[Y,Z]=c(!1),[A,B]=c({}),[G,J]=c(""),q=a(),z=u(e=>{const r="string"==typeof e?{message:e}:e;return B(r),J(r.defaultValue??""),Z(!0),new Promise(e=>{q.current=e})},[]);d(()=>{b=I,y=S,N=z},[I,S,z]);const M=(e,r)=>{if(F.current!==e)return;const n=k.current,t=E.current.shift();t?H(t):(F.current=null,k.current=void 0,i(!1)),n?.(r)},X=e=>{V(!1),Q(""),R.current?.(e)},_=e=>{if(e){const e=G.trim();if(!e&&!A.allowEmpty)return Z(!1),void q.current?.(null);Z(!1),q.current?.(e)}else Z(!1),q.current?.(null)},ee=s.variant||(s.confirmLabel?.toLowerCase().includes("delete")||s.message.toLowerCase().includes("delete")?"danger":"info"),re=w[ee],ne=w["warning"===W.variant?"warning":"danger"],te=W.confirmWord,oe=null==te||O===te,le=o().dialog,[ie,se]=l(le.typeToConfirm);/* @__PURE__ */
|
|
3
|
+
return m(p.Provider,{value:I,children:[r,
|
|
4
|
+
/* @__PURE__ */h(e,{open:t,onClose:()=>M(v,!1),initialFocus:$,footer:/* @__PURE__ */m(f,{children:[
|
|
5
|
+
/* @__PURE__ */h("button",{ref:$,type:"button",onClick:()=>M(v,!1),className:C,children:s.cancelLabel||le.cancel}),
|
|
6
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>M(v,!0),className:re.button,children:s.confirmLabel||le.ok})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
7
|
+
/* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${re.icon}`,children:/* @__PURE__ */h(j,{})}),
|
|
8
|
+
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
9
|
+
/* @__PURE__ */h("h2",{className:n,children:s.title||le.confirmTitle}),
|
|
10
|
+
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:s.message})]})]})}),
|
|
11
|
+
/* @__PURE__ */h(e,{open:U,onClose:()=>X(!1),initialFocus:null!=te?void 0:D,footer:/* @__PURE__ */m(f,{children:[
|
|
12
|
+
/* @__PURE__ */h("button",{ref:D,type:"button",onClick:()=>X(!1),className:C,children:W.cancelLabel||le.destructiveCancel}),
|
|
13
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>X(!0),disabled:!oe,className:ne.button,children:te??W.confirmLabel??le.destructiveConfirm})]}),children:/* @__PURE__ */m("div",{className:"flex gap-4",children:[
|
|
14
|
+
/* @__PURE__ */h("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ne.icon}`,children:/* @__PURE__ */h(j,{})}),
|
|
15
|
+
/* @__PURE__ */m("div",{className:"flex-1",children:[
|
|
16
|
+
/* @__PURE__ */h("h2",{className:`${n} pr-6`,children:W.title||le.destructiveTitle}),
|
|
17
|
+
/* @__PURE__ */h("p",{className:"mt-2 text-sm text-gray-600",children:W.message}),null!=te&&/* @__PURE__ */m(f,{children:[
|
|
18
|
+
/* @__PURE__ */m("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
|
|
19
|
+
/* @__PURE__ */h("kbd",{className:"rounded border border-line-strong bg-surface-sunken px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:te}),se]}),
|
|
20
|
+
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:O,onChange:e=>Q(e.target.value),onKeyDown:e=>{"Enter"===e.key&&O===te&&X(!0)},placeholder:te,className:`mt-2 ${L} focus:border-red-500`})]})]})]})}),
|
|
21
|
+
/* @__PURE__ */m(e,{open:Y,onClose:()=>_(!1),title:A.title||le.promptTitle,footer:/* @__PURE__ */m(f,{children:[
|
|
22
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!1),className:C,children:A.cancelLabel||le.cancel}),
|
|
23
|
+
/* @__PURE__ */h("button",{type:"button",onClick:()=>_(!0),disabled:!A.allowEmpty&&!G.trim(),className:P,children:A.confirmLabel||le.ok})]}),children:[A.message&&/* @__PURE__ */h("p",{className:"text-sm text-gray-600",children:A.message}),
|
|
24
|
+
/* @__PURE__ */h("input",{autoFocus:!0,type:"text",value:G,onChange:e=>J(e.target.value),onKeyDown:e=>{"Enter"===e.key?_(!0):"Escape"===e.key&&_(!1)},onFocus:e=>e.target.select(),placeholder:A.placeholder,className:`mt-3 ${L} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{F as ConfirmProvider,v as confirm,x as confirmDestructive,k as prompt,g as useConfirm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-KY3KGRGC.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},R=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},Z=[200,500],F=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,Z,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{R(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,Z,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],B=[800,1800],N=e=>{document.prerendering?E(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};var U=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var K=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},q=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,J=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,G=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,V=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,W=/\d{4,}/g,D=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Y=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,Q=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function X(e,t,n){const i=e.replace(Y,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=Q.exec(n.trim()),i=e&&X(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Y,"").split(/[?#]/,1)[0].replace(D,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&U.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;R(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),F(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);N(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new K({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(q,"[redacted]").replace(J,"[redacted]").replace(G,"[url]").replace(V,"[id]").replace(W,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
|
|
1
|
+
import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-QAAHFU2I.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],A=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},P=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},F=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},Z=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,Z,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{F(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,Z,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],U=[800,1800],B=e=>{document.prerendering?E(()=>B(e)):"complete"!==document.readyState?addEventListener("load",()=>B(e),!0):setTimeout(e)};var N=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,H=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,O=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,V=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,W=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,D=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Q=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,X=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(Q,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=X.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&H.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&N.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;F(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),R(e),((e,t={})=>{const n=h();A(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,P,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,P,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),A(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,U,t.reportAllChanges);B(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,U,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,U,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&O.test(e.app),n="string"==typeof e.release&&O.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:O.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(V,"[url]").replace(W,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{GROUP_COLORS as e}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e}from"./chunk-YDJ5IZOU.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{Tooltip as n}from"./chunk-F2RAIGCG.js";import{useShellStrings as l}from"./chunk-IUVGHHR3.js";import{jsx as t,jsxs as i,Fragment as a}from"react/jsx-runtime";var s="inline-flex items-center gap-1 whitespace-nowrap rounded-md border border-current/20 py-0.5 pl-2 pr-1 text-2xs font-medium";function o({label:e,glyph:r,onClick:l}){/* @__PURE__ */
|
|
2
2
|
return t(n,{content:e,describe:!1,children:/* @__PURE__ */t("button",{type:"button",onClick:l,"aria-label":e,className:"flex h-4 w-4 items-center justify-center rounded-full leading-none hover:bg-current/10 rosh-focus-ring focus-visible:ring-2",children:/* @__PURE__ */t("span",{"aria-hidden":"true",children:r})})})}function c({state:n,label:c,verb:u,subject:m,pct:p,onCancel:d,onRetry:h,onDismiss:f,className:b=""}){const g=l().transfer;if("idle"===n)return null==c?null:/* @__PURE__ */t("span",{className:`${s} ${e.neutral} pr-2 ${b}`.trim(),children:c});if("error"===n)/* @__PURE__ */
|
|
3
3
|
return i("span",{role:"status",className:`${s} ${e.danger} ${b}`.trim(),children:[
|
|
4
4
|
/* @__PURE__ */t("span",{children:g.error}),h&&/* @__PURE__ */t(o,{label:g.retry,glyph:"↻",onClick:h}),f&&/* @__PURE__ */t(o,{label:g.dismiss,glyph:"×",onClick:f})]});const y=u??g.uploading,$=null==p||Number.isNaN(p)?null:Math.max(0,Math.min(100,Math.round(p))),k="string"==typeof y?g.cancelVerb(y.toLowerCase()):g.cancel,N=e=>[e,m,null==$?"":`${$}%`].filter(Boolean).join(" ");/* @__PURE__ */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as r,COLUMN_SHARE_MIN as t,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-
|
|
2
|
-
return f("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":
|
|
3
|
-
/* @__PURE__ */f("div",{ref:
|
|
4
|
-
/* @__PURE__ */m("div",{ref:
|
|
5
|
-
/* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),
|
|
6
|
-
return m("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */m(i,{content:ie,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */m(o,{appearance:"bare",value:e,display:()=>(e=>
|
|
1
|
+
import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as r,COLUMN_SHARE_MIN as t,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-FKMARSJZ.js";import{textWidth as l}from"./chunk-UVCMV2TL.js";import{Tooltip as i}from"./chunk-F2RAIGCG.js";import{useShellStrings as a}from"./chunk-IUVGHHR3.js";import{useId as s,useRef as c,useState as u,useEffect as d,Fragment as h}from"react";import{jsxs as f,jsx as m}from"react/jsx-runtime";var p=(e,r,t)=>Math.min(t,Math.max(r,e)),g=e=>e.reduce((e,r)=>e+r,0),v=(e,r)=>e.length===r.length&&e.every((e,t)=>e===r[t]);var b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:M=!1,className:R=""}){const j=a().widths,A=s(),z=p(Math.round(x)||1,1,n),S=e($,z),B=S??[...r[z]??[]],K=[...B,100-g(B)],D=P||M,G=c(null),H=c({onChange:k,shown:B,locked:D,n:z,stored:S});H.current={onChange:k,shown:B,locked:D,n:z,stored:S};const I=r=>{const{onChange:t,shown:n,locked:o,n:l}=H.current;if(o)return!1;const i=e(r,l);return!(!i||v(i,n))&&(t(i),!0)},O=(e,r,n)=>{const o=e[r]+e[r+1],l=[...e];l[r]=p(Math.round(n),t,o-t),l[r+1]=o-l[r],I(l.slice(0,-1))&&(ne.current=null)},T=e=>r=>{if(r.altKey||r.ctrlKey||r.metaKey)return;const n=r.shiftKey?10:1,o=K[e]+K[e+1],l="ArrowRight"===r.key?K[e]+n:"ArrowLeft"===r.key?K[e]-n:"PageUp"===r.key?K[e]+10:"PageDown"===r.key?K[e]-10:"Home"===r.key?t:"End"===r.key?o-t:null;null!==l&&(r.preventDefault(),O(K,e,l))},F=c(null),[L,U]=u(null),V=()=>{F.current=null,U(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};d(()=>V,[]);const E=e=>r=>{if(0!==r.button||D)return;r.preventDefault();const t=G.current?.getBoundingClientRect().width??0;t<=0||(F.current={i:e,x:r.clientX,width:t,from:K,moved:!1,pointer:r.pointerId},U(e),r.currentTarget.setPointerCapture?.(r.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},J=e=>{const r=F.current;if(!r)return;if(0===e.buttons)return void V();const t=e.clientX-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}O(r.from,r.i,r.from[r.i]+t/r.width*100)},W=e=>{const r=F.current;r&&(e.currentTarget.hasPointerCapture?.(r.pointer)&&e.currentTarget.releasePointerCapture(r.pointer),V())},X=(e,r)=>{const{shown:n}=H.current,o=function(e,r,n){const o=e.length,l=[...e];if(o<2)return l;const i=p(Math.round(n),t,100-(o-1)*t);let a=i-l[r];l[r]=i;const s=[...Array.from({length:o-1-r},(e,t)=>r+1+t),...Array.from({length:r},(e,t)=>r-1-t)];if(a<0)return l[s[0]]-=a,l;for(const e of s){if(a<=0)break;const r=Math.min(a,l[e]-t);l[e]-=r,a-=r}return l}([...n,100-g(n)],e,r);return I(o.slice(0,-1))?o:null},[q,Z]=u(0);d(()=>{const e=G.current;if(!e||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(()=>Z(e.getBoundingClientRect().width));return r.observe(e),()=>r.disconnect()},[]);const Q=c(null),[Y,_]=u(null),[ee,re]=u([]),te=(e,r)=>_(t=>r?e:t===e?null:t),ne=c(null),oe=(e,r)=>{const t=ne.current;if(!t||t.column!==e||t.share!==r)return!1;const{onChange:n,locked:o,stored:l}=H.current;var i,a;return o||(i=l,a=t.stored,void 0===i||void 0===a?i===a:v(i,a))||n(t.stored),!0},le=K.join(",");d(()=>{const e=null===Y?[]:function(e,r){if(!e)return[];const t=Array.from(e.querySelectorAll("input[data-widths-label]")),n=t[r]?.getBoundingClientRect();return n&&0!==n.width?null===l("","12px sans-serif")?[]:t.flatMap((e,t)=>{if(t===r)return[];const o=e.getBoundingClientRect(),i=getComputedStyle(e),a=(l(e.value,`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`)??0)/2,s=(o.left+o.right)/2;return s+a>n.left&&s-a<n.right?[t]:[]}):[]}(Q.current,Y);re(r=>v(r,e)?r:e)},[Y,le,q]);const ie=j.hint(z,t),ae=K.slice(0,-1).map((e,r)=>g(K.slice(0,r+1)));/* @__PURE__ */
|
|
2
|
+
return f("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":z>1?A:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${R}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */f("div",{ref:Q,"data-widths-bar":"",className:"relative h-8",children:[
|
|
4
|
+
/* @__PURE__ */m("div",{ref:G,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:K.map((e,r)=>/* @__PURE__ */m("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[r%2]} ${r%2==0?"bg-accent-tint":""}`,children:1===z&&/* @__PURE__ */m("span",{"data-widths-label":"",children:`${e}%`})},r))}),
|
|
5
|
+
/* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),z>1&&K.map((e,r)=>/* @__PURE__ */f(h,{children:[(()=>{const n=Y===r,l=g(K.slice(0,r)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
|
|
6
|
+
return m("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */m(i,{content:ie,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */m(o,{appearance:"bare",value:e,display:()=>(e=>q>0&&q*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:t,max:100-(z-1)*t,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":j.column(r+1),"aria-describedby":A,"data-widths-label":"",onChange:e=>{null===e||oe(r,e)||X(r,e)},onRevert:e=>((e,r)=>{H.current.locked||null===r||oe(e,r)||X(e,r)})(r,e),onFocus:()=>{ne.current={column:r,share:e,stored:H.current.stored},te(r,!0)},onBlur:()=>te(r,!1),className:`absolute inset-0 text-xs font-medium ${w[r%2]} ${ee.includes(r)&&!n?"opacity-0":""}`})})})})(),r<z-1&&/* @__PURE__ */m("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[r]}%`},children:/* @__PURE__ */m(i,{content:j.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */m("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":j.divider(r+1,r+2),"aria-valuenow":K[r],"aria-valuemin":t,"aria-valuemax":K[r]+K[r+1]-t,"aria-valuetext":j.dividerValue(r+1,K[r],r+2,K[r+1]),"aria-disabled":D||void 0,onKeyDown:D?void 0:T(r),onPointerDown:E(r),onPointerMove:J,onPointerUp:W,onPointerCancel:W,onLostPointerCapture:()=>{F.current&&V()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(D?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */m("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(D?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${L===r?"w-1":y}`)})})})})]},r))]}),z>1&&/* @__PURE__ */m("span",{id:A,className:"sr-only",children:ie})]})}export{x as WidthsBar};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Tooltip as e}from"./chunk-
|
|
2
|
-
return s(e,{content:z??k.hint,side:
|
|
1
|
+
import{Tooltip as e}from"./chunk-F2RAIGCG.js";import{useBrowserLayoutEffect as r}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as t}from"./chunk-IUVGHHR3.js";import{useRef as o,useEffect as n,useCallback as i}from"react";import{jsx as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(t,Math.max(r,e));function l(e,r,t,o,n){return Math.round(a("left"===t||"top"===t?e+r:e-r,o,n))}function u(e,r,t){let o=null;try{o=window.localStorage.getItem(e)}catch{return null}const n=o?parseInt(o,10):NaN;return Number.isNaN(n)?null:a(n,r,t)}function c({width:c,onResize:d,orientation:h="vertical",side:m,min:f,max:p,defaultWidth:v=f,step:g=16,storageKey:b,label:w,hint:z,controls:y,className:x=""}){const P="horizontal"===h,k=t().resizeHandle,N=o(null),I=o({onResize:d,min:f,max:p,side:m});I.current={onResize:d,min:f,max:p,side:m},r(()=>{if(!b)return;const e=u(b,f,p);null!==e&&e!==c&&d(e)},[b]),n(()=>{if(!b)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(b,String(Math.round(c)))}catch{}},200);return()=>window.clearTimeout(e)},[c,b]);const R=i(()=>{N.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);n(()=>R,[R]);const C=e=>{N.current&&(e.currentTarget.hasPointerCapture?.(N.current.pointer)&&e.currentTarget.releasePointerCapture(N.current.pointer),R())},D="left"===m?"right-0":"right"===m?"left-0":"top"===m?"bottom-0":"top-0",M="left"===m?"right":"right"===m?"left":"top"===m?"bottom":"top",$=P?`absolute inset-x-0 ${D} z-10 flex h-2`:`absolute inset-y-0 ${D} z-10 flex w-2`;/* @__PURE__ */
|
|
2
|
+
return s(e,{content:z??k.hint,side:M,delay:600,className:`${$} ${x}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":h,"aria-label":w??k.label,"aria-valuenow":Math.round(c),"aria-valuemin":f,"aria-valuemax":p,"aria-controls":y,"data-resize-handle":m,onPointerDown:e=>{0===e.button&&(e.preventDefault(),N.current={x:P?e.clientY:e.clientX,width:c,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor=P?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=N.current;if(!r)return;if(0===e.buttons)return void R();const t=(P?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:o,min:n,max:i,side:s}=I.current;o(l(r.width,t,s,n,i))},onPointerUp:C,onPointerCancel:C,onLostPointerCapture:()=>{N.current&&R()},onDoubleClick:()=>d(a(v,f,p)),onKeyDown:e=>{const r=P?"ArrowDown":"ArrowRight",t=P?"ArrowUp":"ArrowLeft",o=e.key===r?g:e.key===t?-g:null,n=null!==o?l(c,o,m,f,p):"Home"===e.key?f:"End"===e.key?p:"Enter"===e.key?a(v,f,p):null;null!==n&&(e.preventDefault(),n!==c&&d(n))},className:P?"group/resize relative h-full w-full cursor-row-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */s("div",{"aria-hidden":"true",className:P?`absolute inset-x-0 ${D} h-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:h-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`:`absolute inset-y-0 ${D} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}export{c as ResizeHandle,u as readStoredWidth,l as resizedWidth};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{userToday as t}from"./chunk-NHKT5IH6.js";import{useShellPrefs as e}from"./chunk-
|
|
2
|
-
return(new Date).toISOString()}var W=null
|
|
1
|
+
import{userToday as t}from"./chunk-NHKT5IH6.js";import{useShellPrefs as e}from"./chunk-DPFEQQQU.js";import{toast_default as n}from"./chunk-VQ35LXDC.js";import{useSyncExternalStore as o,useCallback as a,useMemo as r}from"react";var i=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],c=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}];function l(e=/* @__PURE__ */new Date){return t(e)??""}function s(t=/* @__PURE__ */new Date){return`pomodoro-day-${l(t)}`}var u={focus:1500,short:300,long:900},d="bell",f=100,m=1,h="none",g=50,p={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},k={running:!1,remaining:u.focus,mode:"focus",total:u.focus,streak:0,count:"undefined"!=typeof localStorage?function(t=/* @__PURE__ */new Date){const e=l(t);if(!e)return 0;try{const n=localStorage.getItem(s(t)),o=null===n?localStorage.getItem(`pomodoro-${e}`):null;return parseInt(n??o??"0",10)||0}catch{return 0}}():0},w=null,M=/* @__PURE__ */new Set,S=t=>{k={...k,...t},M.forEach(t=>t())};function b(){return k}function y(t){return M.add(t),()=>{M.delete(t)}}function v(t){u=t,k.running||k.remaining!==k.total||S({remaining:t[k.mode],total:t[k.mode]})}function T(t){d=t}function A(t,e){f=Math.max(0,Math.min(100,Math.round(t))),m=Math.max(1,Math.min(5,Math.round(e)))}function I(t){p={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function x(t,e){h=t,g=Math.max(0,Math.min(100,Math.round(e))),k.running&&"focus"===k.mode?(V(),R()):"none"!==t&&0!==g||V()}function B(){k.running||(S({running:!0}),w=setInterval(N,1e3),"focus"===k.mode&&R())}function C(){(k.running||null!==w)&&(null!==w&&(clearInterval(w),w=null),S({running:!1}),V())}function D(t){C(),S({mode:t,remaining:u[t],total:u[t]})}function N(){k.remaining<=1?function(){null!==w&&(clearInterval(w),w=null);V(),P(d,{volume:f,repeat:m});const t="focus"===k.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(t)}catch{}try{n.info(t)}catch{}if("focus"===k.mode){const t=k.streak+1,e=k.count+1;(t=>{try{l()&&localStorage.setItem(s(),String(t))}catch{}})(e);const n=t%p.longBreakInterval===0?"long":"short";S({running:!1,streak:t,count:e,mode:n,remaining:u[n],total:u[n]}),p.autoStartBreaks&&setTimeout(()=>B(),50)}else S({running:!1,mode:"focus",remaining:u.focus,total:u.focus}),p.autoStartPomodoros&&setTimeout(()=>B(),50)}():S({remaining:k.remaining-1})}function P(t=d,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>_(t,n),2500*e)}function _(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var F=null,O={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function Q(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function R(){if(!F&&"none"!==h&&0!==g)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=Q(e,h);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=g/100*O[h],o.connect(a).connect(e.destination),o.start(),F={ctx:e,src:o,gain:a}}catch{}}function V(){if(F){try{F.src.stop()}catch{}try{F.ctx.close()}catch{}F=null}}function j(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=Q(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*O[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var G="pomodoro_tasks",E="pomodoro_tasks_migrated";function H(){return Math.random().toString(36).slice(2,11)}function L(){/* @__PURE__ */
|
|
2
|
+
return(new Date).toISOString()}var W=null,$=[],q=!1,J=null,K=/* @__PURE__ */new Set;function U(){for(const t of K)t()}function X(t){$=t,U()}function z(){const t=W;return t?J=t.list().then(e=>{W===t&&($=e,q=!0,U())}).catch(()=>{W===t&&(q=!0,U())}).finally(()=>{J=null}):($=[],q=!0,U(),Promise.resolve())}function Y(t){W=t,$=[],q=!1,t?z():U()}function Z(t){return K.add(t),!W||q||J||z(),()=>{K.delete(t)}}function tt(){return $}function et(){const t=function(){const{prefs:t,save:n}=e(),o=r(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=a(t=>{n({todo_tasks:t})},[n]),c=a(t=>{const e=H(),n=L(),a={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...o,a]),e},[o,i]),l=a((t,e)=>{i(o.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:L()}:n))},[o,i]),s=a(t=>{i(o.filter(e=>e.id!==t))},[o,i]),u=a(t=>{const e=o.find(e=>e.id===t);e&&l(t,{done:!e.done})},[o,l]);return{tasks:o,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),n=o(Z,tt,tt),i=a(e=>{const n=W;if(!n)return t.addTask(e);const o="tmp-"+H(),a=L(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return X([...$,r]),n.create({...e,name:e.name.trim()}).then(t=>X($.map(e=>e.id===o?{...r,...t}:e))).catch(()=>X($.filter(t=>t.id!==o))),o},[t]),c=a((e,n)=>{const o=W;if(!o)return t.updateTask(e,n);X($.map(t=>t.id===e?{...t,...n,id:e,updatedAt:L()}:t)),o.update(e,n).catch(()=>{z()})},[t]),l=a(e=>{const n=W;if(!n)return t.removeTask(e);const o=$;X($.filter(t=>t.id!==e)),n.remove(e).catch(()=>X(o))},[t]),s=a(e=>{if(!W)return t.toggleDone(e);const n=$.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=a(e=>{W||t.setAllTasks(e)},[t]);return null===W?t:{tasks:n,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function nt(t,e){try{if(localStorage.getItem(E))return;const n=localStorage.getItem(G);if(!n)return void localStorage.setItem(E,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(G),void localStorage.setItem(E,"1");const a=L(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||H(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(G),localStorage.setItem(E,"1")}catch{try{localStorage.setItem(E,"1")}catch{}}}export{i as ALARM_OPTIONS,c as FOCUS_SOUND_OPTIONS,b as getPomoSnapshot,nt as migratePomodoroTasksOnce,P as playAlarm,C as pomoPause,B as pomoStart,D as pomoSwitchMode,l as pomodoroToday,j as previewFocusSound,T as setPomoAlarm,A as setPomoAlarmConfig,I as setPomoBehaviour,v as setPomoDurations,x as setPomoFocusSound,Y as setShellTodoProvider,y as subscribePomo,et as useTodoTasks};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-YTDMCUL7.js";import{Avatar as t}from"./chunk-W2TPXKCV.js";import{Input_default as a}from"./chunk-3SIRRK3F.js";import{Button_default as i}from"./chunk-UTISUEO4.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full",children:/* @__PURE__ */n(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */n("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */l("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
|
|
3
3
|
/* @__PURE__ */n(t,{name:e.name,status:e.status}),
|
|
4
4
|
/* @__PURE__ */l("div",{className:"min-w-0 flex-1",children:[
|