@daisforge/ui 1.13.0 → 1.14.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/chunks/{AnalyticalWidget-29tSeB0C.cjs → AnalyticalWidget-B6czTLSw.cjs} +1 -1
- package/chunks/{AnalyticalWidget-DnHHyjnv.mjs → AnalyticalWidget-BWggL9xa.mjs} +1 -1
- package/chunks/{ApprovalCenter-BRUYlLoC.cjs → ApprovalCenter-DG3YvEkY.cjs} +1 -1
- package/chunks/{ApprovalCenter-BREfTiqK.mjs → ApprovalCenter-XCXGHaEP.mjs} +2 -2
- package/chunks/{BlockTitle-CCvkcUe_.cjs → BlockTitle-3YmyxJHJ.cjs} +1 -1
- package/chunks/{BlockTitle-BNm60_dx.mjs → BlockTitle-DDWF1ZeV.mjs} +2 -2
- package/chunks/{Container-CV4sT-bB.mjs → Container-BlAaXm8V.mjs} +1 -1
- package/chunks/{Container-D8Bcg69e.cjs → Container-CJX4h6tb.cjs} +1 -1
- package/chunks/{EmptyState-Bct6Wrxv.mjs → EmptyState-BB3duGQw.mjs} +1 -1
- package/chunks/{EmptyState-BD6Ic-OX.cjs → EmptyState-Du-RIjie.cjs} +1 -1
- package/chunks/{FiltersActions-Be9uBM67.mjs → FiltersActions-C38x0y5T.mjs} +4 -4
- package/chunks/{FiltersActions-49uNOjLq.cjs → FiltersActions-CvAwGV9F.cjs} +1 -1
- package/chunks/{FormSegmentGroup-C8kROjlQ.mjs → FormSegmentGroup-9b3w4_KU.mjs} +1 -1
- package/chunks/{FormSegmentGroup-DIaBZRWv.cjs → FormSegmentGroup-DcOPPn3M.cjs} +1 -1
- package/chunks/{GridDND-rY1o5ItA.mjs → GridDND-BnK1dEhJ.mjs} +2 -2
- package/chunks/{GridDND-BAHGzR5e.cjs → GridDND-CVAlpElj.cjs} +1 -1
- package/chunks/{LeftPanel-CgexykUg.cjs → LeftPanel-Ciehaz28.cjs} +1 -1
- package/chunks/{LeftPanel-bKmeEOHx.mjs → LeftPanel-DuIinlBm.mjs} +1 -1
- package/chunks/{ListOfFilters-DRrawM8s.mjs → ListOfFilters-Cji5UH2J.mjs} +3 -3
- package/chunks/{ListOfFilters-BQyYeGQG.cjs → ListOfFilters-DNzfSG-p.cjs} +1 -1
- package/chunks/{MassActions-ByZr-Wjd.mjs → MassActions-BOG04zip.mjs} +3 -3
- package/chunks/{MassActions-CxF6wvlS.cjs → MassActions-DCk9APKP.cjs} +1 -1
- package/chunks/{PageTitle-j-pmmoZ9.cjs → PageTitle-BIllremL.cjs} +1 -1
- package/chunks/{PageTitle-BLBN06Xe.mjs → PageTitle-CQ_6jZ0x.mjs} +2 -2
- package/chunks/{SplitView-OUGciQ51.cjs → SplitView-DdLshcIk.cjs} +1 -1
- package/chunks/{SplitView-C8de8YKV.mjs → SplitView-Dm62AAZj.mjs} +1 -1
- package/chunks/{Stories-COpgkk_M.mjs → Stories-dFpUqS5T.mjs} +3 -3
- package/chunks/{Stories-CO4lXbo6.cjs → Stories-e_CX_1CS.cjs} +1 -1
- package/chunks/{Table-JFzBB9zK.cjs → Table-CrJFfavU.cjs} +1 -1
- package/chunks/{Table-XpsCe-vS.mjs → Table-f0CmcIhI.mjs} +6 -6
- package/chunks/{TableCanvas-BnwR-C1X.mjs → TableCanvas-1bi1WWeP.mjs} +7 -7
- package/chunks/{TableCanvas-AwmzU0Jc.cjs → TableCanvas-DqF5YxEY.cjs} +1 -1
- package/chunks/{TableGlide-BAH73oGi.cjs → TableGlide-CGAh5x3Q.cjs} +1 -1
- package/chunks/{TableGlide-o9aqEk4d.mjs → TableGlide-DGKw3w0G.mjs} +1 -1
- package/chunks/{styles-Dd4uEa27.mjs → styles-BMXAIiBk.mjs} +1 -1
- package/chunks/{styles-kPI9R7DO.cjs → styles-DwCVRGsC.cjs} +1 -1
- package/chunks/{utils-C5SQhoON.mjs → utils-D4eJY8pa.mjs} +81 -74
- package/chunks/utils-DvDFSlCG.cjs +25 -0
- package/components/AiAgentPopover/index.cjs +1 -1
- package/components/AiAgentPopover/index.mjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetChips/index.cjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetChips/index.mjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetHeader/index.cjs +1 -1
- package/components/AnalyticalWidget/components/AnalyticalWidgetHeader/index.mjs +1 -1
- package/components/AnalyticalWidget/index.cjs +1 -1
- package/components/AnalyticalWidget/index.mjs +1 -1
- package/components/ApprovalCenter/components/index.cjs +1 -1
- package/components/ApprovalCenter/components/index.mjs +1 -1
- package/components/ApprovalCenter/index.cjs +1 -1
- package/components/ApprovalCenter/index.mjs +1 -1
- package/components/AutocompleteSearch/index.cjs +1 -1
- package/components/AutocompleteSearch/index.mjs +2 -2
- package/components/BlockGradientScroll/index.cjs +1 -1
- package/components/BlockGradientScroll/index.mjs +1 -1
- package/components/BlockTitle/index.cjs +1 -1
- package/components/BlockTitle/index.mjs +1 -1
- package/components/BlockTitle/utils/index.cjs +1 -1
- package/components/BlockTitle/utils/index.mjs +1 -1
- package/components/Collapse/index.cjs +1 -1
- package/components/Collapse/index.mjs +1 -1
- package/components/Combobox/index.cjs +1 -1
- package/components/Combobox/index.mjs +1 -1
- package/components/EmptyState/components/index.cjs +1 -1
- package/components/EmptyState/components/index.mjs +1 -1
- package/components/EmptyState/index.cjs +1 -1
- package/components/EmptyState/index.mjs +1 -1
- package/components/GridDND/index.cjs +1 -1
- package/components/GridDND/index.mjs +1 -1
- package/components/GridDND/utils/index.cjs +1 -1
- package/components/GridDND/utils/index.mjs +1 -1
- package/components/IconButton/index.cjs +1 -1
- package/components/IconButton/index.mjs +1 -1
- package/components/LeftPanel/components/index.cjs +1 -1
- package/components/LeftPanel/components/index.mjs +1 -1
- package/components/LeftPanel/hooks/index.cjs +1 -1
- package/components/LeftPanel/hooks/index.mjs +1 -1
- package/components/LeftPanel/index.cjs +1 -1
- package/components/LeftPanel/index.mjs +1 -1
- package/components/LeftPanel/utils/index.cjs +1 -1
- package/components/LeftPanel/utils/index.mjs +1 -1
- package/components/ListOfFilters/index.cjs +1 -1
- package/components/ListOfFilters/index.mjs +1 -1
- package/components/MassActions/hooks/index.cjs +1 -1
- package/components/MassActions/hooks/index.mjs +1 -1
- package/components/MassActions/index.cjs +1 -1
- package/components/MassActions/index.mjs +1 -1
- package/components/ModalDF/index.cjs +1 -1
- package/components/ModalDF/index.mjs +1 -1
- package/components/Notification/index.cjs +1 -1
- package/components/Notification/index.mjs +2 -2
- package/components/PageTitle/index.cjs +1 -1
- package/components/PageTitle/index.mjs +1 -1
- package/components/PageTitle/utils/index.cjs +1 -1
- package/components/PageTitle/utils/index.mjs +1 -1
- package/components/PopoverDF/index.cjs +1 -1
- package/components/PopoverDF/index.mjs +1 -1
- package/components/PopupDF/index.cjs +1 -1
- package/components/PopupDF/index.mjs +1 -1
- package/components/SplitView/index.cjs +1 -1
- package/components/SplitView/index.mjs +1 -1
- package/components/SplitView/utils/index.cjs +1 -1
- package/components/SplitView/utils/index.mjs +1 -1
- package/components/Stories/components/StoriesBanner/index.cjs +1 -1
- package/components/Stories/components/StoriesBanner/index.mjs +1 -1
- package/components/Stories/components/StoriesContent/index.cjs +1 -1
- package/components/Stories/components/StoriesContent/index.mjs +1 -1
- package/components/Stories/components/StoriesPreview/index.cjs +1 -1
- package/components/Stories/components/StoriesPreview/index.mjs +1 -1
- package/components/Stories/components/StoriesProgress/index.cjs +1 -1
- package/components/Stories/components/StoriesProgress/index.mjs +1 -1
- package/components/Stories/components/StoriesViewer/index.cjs +1 -1
- package/components/Stories/components/StoriesViewer/index.mjs +1 -1
- package/components/Stories/index.cjs +1 -1
- package/components/Stories/index.mjs +1 -1
- package/components/Table/components/TableDropdown/index.cjs +1 -1
- package/components/Table/components/TableDropdown/index.mjs +1 -1
- package/components/Table/feature-collapse-table/index.cjs +1 -1
- package/components/Table/feature-collapse-table/index.mjs +1 -1
- package/components/Table/feature-column-control/ColumnsList/index.cjs +1 -1
- package/components/Table/feature-column-control/ColumnsList/index.mjs +1 -1
- package/components/Table/feature-column-control/index.cjs +1 -1
- package/components/Table/feature-column-control/index.mjs +1 -1
- package/components/Table/feature-columns-grouping/index.cjs +1 -1
- package/components/Table/feature-columns-grouping/index.mjs +1 -1
- package/components/Table/feature-context-menu/index.cjs +1 -1
- package/components/Table/feature-context-menu/index.mjs +1 -1
- package/components/Table/feature-edit/index.cjs +1 -1
- package/components/Table/feature-edit/index.mjs +1 -1
- package/components/Table/feature-filtering/combobox/index.cjs +1 -1
- package/components/Table/feature-filtering/combobox/index.mjs +1 -1
- package/components/Table/feature-filtering/filter-list-block/index.cjs +1 -1
- package/components/Table/feature-filtering/filter-list-block/index.mjs +1 -1
- package/components/Table/feature-filtering/header-filter-button/index.cjs +1 -1
- package/components/Table/feature-filtering/header-filter-button/index.mjs +1 -1
- package/components/Table/feature-filtering/index.cjs +1 -1
- package/components/Table/feature-filtering/index.mjs +1 -1
- package/components/Table/feature-filtering/sidebar-filter-block/index.cjs +1 -1
- package/components/Table/feature-filtering/sidebar-filter-block/index.mjs +1 -1
- package/components/Table/feature-infinity-scroll/index.cjs +1 -1
- package/components/Table/feature-infinity-scroll/index.mjs +1 -1
- package/components/Table/feature-key-text/index.cjs +1 -1
- package/components/Table/feature-key-text/index.mjs +1 -1
- package/components/Table/feature-pagination/index.cjs +1 -1
- package/components/Table/feature-pagination/index.mjs +1 -1
- package/components/Table/feature-right-sidebar/index.cjs +1 -1
- package/components/Table/feature-right-sidebar/index.mjs +1 -1
- package/components/Table/feature-row-detail/index.cjs +1 -1
- package/components/Table/feature-row-detail/index.mjs +1 -1
- package/components/Table/feature-row-instruments/index.cjs +1 -1
- package/components/Table/feature-row-instruments/index.mjs +1 -1
- package/components/Table/feature-row-size/index.cjs +1 -1
- package/components/Table/feature-row-size/index.mjs +1 -1
- package/components/Table/feature-rows-grouping/index.cjs +1 -1
- package/components/Table/feature-rows-grouping/index.mjs +1 -1
- package/components/Table/feature-searching/index.cjs +1 -1
- package/components/Table/feature-searching/index.mjs +1 -1
- package/components/Table/feature-select-row/index.cjs +1 -1
- package/components/Table/feature-select-row/index.mjs +1 -1
- package/components/Table/feature-sorting/index.cjs +1 -1
- package/components/Table/feature-sorting/index.mjs +1 -1
- package/components/Table/feature-table-settings/index.cjs +1 -1
- package/components/Table/feature-table-settings/index.mjs +1 -1
- package/components/Table/feature-tree/index.cjs +1 -1
- package/components/Table/feature-tree/index.mjs +1 -1
- package/components/Table/index.cjs +1 -1
- package/components/Table/index.mjs +1 -1
- package/components/Table/renders/formatCell/index.cjs +1 -1
- package/components/Table/renders/formatCell/index.mjs +1 -1
- package/components/Table/styles/index.cjs +1 -1
- package/components/Table/styles/index.mjs +1 -1
- package/components/Table/table-hooks/index.cjs +1 -1
- package/components/Table/table-hooks/index.mjs +1 -1
- package/components/Table/types/index.cjs +1 -1
- package/components/Table/types/index.mjs +1 -1
- package/components/Table/utils/index.cjs +1 -1
- package/components/Table/utils/index.mjs +1 -1
- package/components/Table/widgets/control-block/index.cjs +1 -1
- package/components/Table/widgets/control-block/index.mjs +1 -1
- package/components/Table/widgets/control-block/right-side/index.cjs +1 -1
- package/components/Table/widgets/control-block/right-side/index.mjs +1 -1
- package/components/Table/widgets/index.cjs +1 -1
- package/components/Table/widgets/index.mjs +1 -1
- package/components/Table/widgets/mass-actions/index.cjs +1 -1
- package/components/Table/widgets/mass-actions/index.mjs +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/column/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/column/index.mjs +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/adapters/index.mjs +1 -1
- package/components/TableCanvas/TableGlideInstance/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/index.mjs +2 -2
- package/components/TableCanvas/TableGlideInstance/utils/column/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/utils/column/index.mjs +1 -1
- package/components/TableCanvas/TableGlideInstance/utils/index.cjs +1 -1
- package/components/TableCanvas/TableGlideInstance/utils/index.mjs +1 -1
- package/components/TableCanvas/components/SplitIconButton/index.cjs +1 -1
- package/components/TableCanvas/components/SplitIconButton/index.mjs +1 -1
- package/components/TableCanvas/components/TableDropdown/index.cjs +1 -1
- package/components/TableCanvas/components/TableDropdown/index.mjs +1 -1
- package/components/TableCanvas/feature-cell-transfer/index.cjs +1 -1
- package/components/TableCanvas/feature-cell-transfer/index.mjs +1 -1
- package/components/TableCanvas/feature-collapse-table/index.cjs +1 -1
- package/components/TableCanvas/feature-collapse-table/index.mjs +1 -1
- package/components/TableCanvas/feature-column-control/ColumnsList/index.cjs +1 -1
- package/components/TableCanvas/feature-column-control/ColumnsList/index.mjs +1 -1
- package/components/TableCanvas/feature-column-control/index.cjs +1 -1
- package/components/TableCanvas/feature-column-control/index.mjs +1 -1
- package/components/TableCanvas/feature-columns-grouping/index.cjs +1 -1
- package/components/TableCanvas/feature-columns-grouping/index.mjs +1 -1
- package/components/TableCanvas/feature-content-state/index.cjs +1 -1
- package/components/TableCanvas/feature-content-state/index.mjs +1 -1
- package/components/TableCanvas/feature-context-menu/index.cjs +1 -1
- package/components/TableCanvas/feature-context-menu/index.mjs +1 -1
- package/components/TableCanvas/feature-edit/index.cjs +1 -1
- package/components/TableCanvas/feature-edit/index.mjs +1 -1
- package/components/TableCanvas/feature-filtering/combobox/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/combobox/index.mjs +1 -1
- package/components/TableCanvas/feature-filtering/filter-list-block/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/filter-list-block/index.mjs +1 -1
- package/components/TableCanvas/feature-filtering/header-filter-button/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/header-filter-button/index.mjs +1 -1
- package/components/TableCanvas/feature-filtering/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/index.mjs +1 -1
- package/components/TableCanvas/feature-filtering/sidebar-filter-block/index.cjs +1 -1
- package/components/TableCanvas/feature-filtering/sidebar-filter-block/index.mjs +1 -1
- package/components/TableCanvas/feature-infinity-scroll/index.cjs +1 -1
- package/components/TableCanvas/feature-infinity-scroll/index.mjs +1 -1
- package/components/TableCanvas/feature-key-text/index.cjs +1 -1
- package/components/TableCanvas/feature-key-text/index.mjs +1 -1
- package/components/TableCanvas/feature-notifications/index.cjs +1 -1
- package/components/TableCanvas/feature-notifications/index.mjs +1 -1
- package/components/TableCanvas/feature-pagination/index.cjs +1 -1
- package/components/TableCanvas/feature-pagination/index.mjs +1 -1
- package/components/TableCanvas/feature-popover-table/context/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/context/index.mjs +1 -1
- package/components/TableCanvas/feature-popover-table/hooks/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/hooks/index.mjs +1 -1
- package/components/TableCanvas/feature-popover-table/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/index.mjs +1 -1
- package/components/TableCanvas/feature-popover-table/utils/index.cjs +1 -1
- package/components/TableCanvas/feature-popover-table/utils/index.mjs +1 -1
- package/components/TableCanvas/feature-right-sidebar/index.cjs +1 -1
- package/components/TableCanvas/feature-right-sidebar/index.mjs +1 -1
- package/components/TableCanvas/feature-row-detail/index.cjs +1 -1
- package/components/TableCanvas/feature-row-detail/index.mjs +1 -1
- package/components/TableCanvas/feature-row-instruments/index.cjs +1 -1
- package/components/TableCanvas/feature-row-instruments/index.mjs +1 -1
- package/components/TableCanvas/feature-row-markers/index.cjs +1 -1
- package/components/TableCanvas/feature-row-markers/index.mjs +1 -1
- package/components/TableCanvas/feature-row-size/index.cjs +1 -1
- package/components/TableCanvas/feature-row-size/index.mjs +1 -1
- package/components/TableCanvas/feature-rows-grouping/index.cjs +1 -1
- package/components/TableCanvas/feature-rows-grouping/index.mjs +1 -1
- package/components/TableCanvas/feature-searching/index.cjs +1 -1
- package/components/TableCanvas/feature-searching/index.mjs +1 -1
- package/components/TableCanvas/feature-select-row/index.cjs +1 -1
- package/components/TableCanvas/feature-select-row/index.mjs +1 -1
- package/components/TableCanvas/feature-sorting/index.cjs +1 -1
- package/components/TableCanvas/feature-sorting/index.mjs +1 -1
- package/components/TableCanvas/feature-table-settings/index.cjs +1 -1
- package/components/TableCanvas/feature-table-settings/index.mjs +1 -1
- package/components/TableCanvas/feature-tooltip/index.cjs +1 -1
- package/components/TableCanvas/feature-tooltip/index.mjs +1 -1
- package/components/TableCanvas/feature-tooltip/utils/index.cjs +1 -1
- package/components/TableCanvas/feature-tooltip/utils/index.mjs +1 -1
- package/components/TableCanvas/feature-tree/index.cjs +1 -1
- package/components/TableCanvas/feature-tree/index.mjs +1 -1
- package/components/TableCanvas/index.cjs +1 -1
- package/components/TableCanvas/index.mjs +2 -2
- package/components/TableCanvas/renders/formatCell/index.cjs +1 -1
- package/components/TableCanvas/renders/formatCell/index.mjs +1 -1
- package/components/TableCanvas/styles/index.cjs +1 -1
- package/components/TableCanvas/styles/index.mjs +1 -1
- package/components/TableCanvas/table-hooks/index.cjs +1 -1
- package/components/TableCanvas/table-hooks/index.mjs +1 -1
- package/components/TableCanvas/types/index.cjs +1 -1
- package/components/TableCanvas/types/index.mjs +1 -1
- package/components/TableCanvas/utils/index.cjs +1 -1
- package/components/TableCanvas/utils/index.mjs +2 -2
- package/components/TableCanvas/widgets/control-block/compression/index.cjs +1 -1
- package/components/TableCanvas/widgets/control-block/compression/index.mjs +1 -1
- package/components/TableCanvas/widgets/control-block/index.cjs +1 -1
- package/components/TableCanvas/widgets/control-block/index.mjs +1 -1
- package/components/TableCanvas/widgets/control-block/right-side/index.cjs +1 -1
- package/components/TableCanvas/widgets/control-block/right-side/index.mjs +1 -1
- package/components/TableCanvas/widgets/index.cjs +1 -1
- package/components/TableCanvas/widgets/index.mjs +1 -1
- package/components/TableCanvas/widgets/mass-actions/hooks/index.cjs +1 -1
- package/components/TableCanvas/widgets/mass-actions/hooks/index.mjs +1 -1
- package/components/TableCanvas/widgets/mass-actions/index.cjs +1 -1
- package/components/TableCanvas/widgets/mass-actions/index.mjs +1 -1
- package/components/TableContract/index.cjs +1 -1
- package/components/TableContract/index.mjs +2 -2
- package/components/TableGlide/hooks/selection/index.cjs +1 -1
- package/components/TableGlide/hooks/selection/index.mjs +1 -1
- package/components/TableGlide/index.cjs +1 -1
- package/components/TableGlide/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/cells/buttons/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/buttons/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/cells/iconSprites/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/iconSprites/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/cells/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/cells/renderer/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/cells/renderer/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/core/helpers/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/core/helpers/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/core/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/core/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/hooks/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/hooks/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/miniflex/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/miniflex/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/primitives/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/primitives/index.mjs +1 -1
- package/components/TableGlide/lib/canvas/utils/index.cjs +1 -1
- package/components/TableGlide/lib/canvas/utils/index.mjs +1 -1
- package/components/TableGlide/theming/index.cjs +1 -1
- package/components/TableGlide/theming/index.mjs +1 -1
- package/components/TableTabs/index.cjs +1 -1
- package/components/TableTabs/index.mjs +1 -1
- package/components/Tooltip/index.cjs +1 -1
- package/components/Tooltip/index.mjs +1 -1
- package/components/TourWidget/index.cjs +1 -1
- package/components/TourWidget/index.mjs +2 -2
- package/components/Typography/index.cjs +1 -1
- package/components/Typography/index.mjs +1 -1
- package/components/Widget/index.cjs +1 -1
- package/components/Widget/index.mjs +2 -2
- package/formComponents/FormCombobox/index.cjs +1 -1
- package/formComponents/FormCombobox/index.mjs +1 -1
- package/formComponents/FormRadioGroupBox/index.cjs +1 -1
- package/formComponents/FormRadioGroupBox/index.mjs +1 -1
- package/formComponents/FormSegments/index.cjs +1 -1
- package/formComponents/FormSegments/index.mjs +1 -1
- package/formComponents/FormSwitch/index.cjs +1 -1
- package/formComponents/FormSwitch/index.mjs +1 -1
- package/index.cjs +1 -1
- package/index.mjs +137 -136
- package/layouts/Container/index.cjs +1 -1
- package/layouts/Container/index.mjs +1 -1
- package/layouts/Container/lib/utils/index.cjs +1 -1
- package/layouts/Container/lib/utils/index.mjs +1 -1
- package/layouts/ErrorPage/index.cjs +1 -1
- package/layouts/ErrorPage/index.mjs +1 -1
- package/layouts/FiltersActions/hooks/index.cjs +1 -1
- package/layouts/FiltersActions/hooks/index.mjs +1 -1
- package/layouts/FiltersActions/index.cjs +1 -1
- package/layouts/FiltersActions/index.mjs +1 -1
- package/layouts/Layout/index.cjs +1 -1
- package/layouts/Layout/index.mjs +1 -1
- package/layouts/PageLayout/index.cjs +1 -1
- package/layouts/PageLayout/index.mjs +1 -1
- package/mcp-data/component-index.json +45769 -0
- package/mixins/index.cjs +1 -1
- package/mixins/index.mjs +1 -1
- package/package.json +1 -1
- package/styles/index.cjs +1 -1
- package/styles/index.mjs +1 -1
- package/utils/breakpoint/index.cjs +1 -1
- package/utils/breakpoint/index.mjs +1 -1
- package/utils/clickStream/index.cjs +1 -1
- package/utils/clickStream/index.d.ts +2 -2
- package/utils/clickStream/index.mjs +6 -5
- package/utils/clickStream/types.d.ts +14 -1
- package/utils/clickStream/utils.d.ts +2 -1
- package/utils/eventBus/index.cjs +1 -1
- package/utils/eventBus/index.mjs +1 -1
- package/utils/hooks/index.cjs +1 -1
- package/utils/hooks/index.mjs +1 -1
- package/utils/index.cjs +1 -1
- package/utils/index.mjs +26 -25
- package/utils/styles/index.cjs +1 -1
- package/utils/styles/index.mjs +1 -1
- package/chunks/utils-DKi1rqLX.cjs +0 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const L=require("@glideappsfinal/glide-data-grid"),gi=require("@salutejs/sdds-themes/tokens/sdds_finai"),Vs=require("canvas-hypertxt"),m=require("react"),Ys=require("react-dom/server"),Ft=require("react/jsx-runtime");require("@glideappsfinal/glide-data-grid/dist/index.css");const Kt=require("./utils-DKi1rqLX.cjs"),_e=require("react-dom"),xr=require("styled-components"),Z={small:{rowHeight:20,cellVerticalPadding:4,cellHorizontalPadding:4,textfieldSize:"xs"},medium:{rowHeight:32,cellVerticalPadding:7,cellHorizontalPadding:8,textfieldSize:"s"},big:{rowHeight:48,cellVerticalPadding:12,cellHorizontalPadding:16,textfieldSize:"s"}},Re=o=>Z[o].rowHeight,Ci=o=>Z[o].textfieldSize,Ar={small:Z.small.rowHeight,medium:Z.medium.rowHeight,big:Z.big.rowHeight},qs={kind:L.GridCellKind.Text,data:"",displayData:"",allowOverlay:!0,readonly:!0},Er={big:{cellVerticalPadding:Z.big.cellVerticalPadding,cellHorizontalPadding:Z.big.cellHorizontalPadding,textfieldSize:Z.big.textfieldSize},medium:{cellVerticalPadding:Z.medium.cellVerticalPadding,cellHorizontalPadding:Z.medium.cellHorizontalPadding,textfieldSize:Z.medium.textfieldSize},small:{cellVerticalPadding:Z.small.cellVerticalPadding,cellHorizontalPadding:Z.small.cellHorizontalPadding,textfieldSize:Z.small.textfieldSize}},vi={"padding-block":"0px","padding-inline":"0px"},$t=o=>`${o}px`,Ks={small:{rowHeight:Re("small"),cell:{"padding-block":$t(Z.small.cellVerticalPadding),"padding-inline":$t(Z.small.cellHorizontalPadding)},editorCell:vi,input:Ci("small"),icon:"xs",combobox:"s",checkboxOfCombobox:"s",switch:"s",font:()=>gi.bodyXXS},medium:{rowHeight:Re("medium"),cell:{"padding-block":$t(Z.medium.cellVerticalPadding),"padding-inline":$t(Z.medium.cellHorizontalPadding)},editorCell:vi,input:Ci("medium"),icon:"s",combobox:"m",checkboxOfCombobox:"m",switch:"s",font:()=>gi.bodyS},big:{rowHeight:Re("big"),cell:{"padding-block":$t(Z.big.cellVerticalPadding),"padding-inline":$t(Z.big.cellHorizontalPadding)},editorCell:vi,input:Ci("big"),icon:"m",combobox:"l",checkboxOfCombobox:"l",switch:"l",font:()=>gi.bodyM}},Oe=33,Zs={bodyM:{"font-size":"1rem","font-weight":400,"line-height":"1.25rem","bold-font-size":"1rem","bold-font-weight":600,"bold-line-height":"1.25rem"},bodyS:{"font-size":"0.875rem","font-weight":400,"line-height":"1.125rem","bold-font-size":"0.875rem","bold-font-weight":600,"bold-line-height":"1.125rem"},bodyXS:{"font-size":"0.75rem","font-weight":400,"line-height":"0.875rem","bold-font-size":"0.75rem","bold-font-weight":600,"bold-line-height":"0.875rem"},bodyXXS:{"font-size":"0.625rem","font-weight":400,"line-height":"0.75rem","bold-font-size":"0.625rem","bold-font-weight":600,"bold-line-height":"0.75rem"}},js=16;function $o(o,t=js){const e=parseFloat(o);return Number.isFinite(e)?o.endsWith("rem")?e*t:e:0}const Js=(o,t=!1)=>{const e=t?o["bold-font-weight"]:o["font-weight"],i=t?o["bold-font-size"]:o["font-size"],r=t?o["bold-line-height"]:o["line-height"];return`${e} normal ${i}/${r}`},Qs=(o,t=!1)=>{const e=t?o["bold-font-size"]:o["font-size"],i=t?o["bold-line-height"]:o["line-height"];return{fontSize:$o(e),lineHeightPx:$o(i)}},Tr=o=>Object.entries(Zs).reduce((t,[e,i])=>{const r=e;return t.push([r,o(i)],[`${r}Bold`,o(i,!0)]),t},[]),Ne=Object.fromEntries(Tr(Js)),Dr=Object.fromEntries(Tr(Qs)),tl={flexGrow:0,flexShrink:1,flexBasis:0,alignSelf:"auto",width:void 0,height:void 0,crossAxisSizing:"auto"},el={top:0,right:0,bottom:0,left:0};class Ir{constructor(t=tl){this.size={width:0,height:0},this.position={x:0,y:0},this.style={flexGrow:t.flexGrow??0,flexShrink:t.flexShrink??1,flexBasis:t.flexBasis??0,alignSelf:t.alignSelf??"auto",width:t.width,height:t.height,crossAxisSizing:t.crossAxisSizing??"auto",id:t.id,metadata:t.metadata},this.id=t.id,this.metadata=t.metadata}}class Hr extends Ir{build(){}}class xt extends Ir{constructor(t,e,i={}){super({}),this.children=[],this.direction="row",this.wrap="nowrap",this.columnGap=0,this.rowGap=0,this.justifyContent="flex-start",this.alignItems="stretch",this.alignContent="stretch",this.padding={top:0,right:0,bottom:0,left:0},this.size.width=t,this.size.height=e,this.id=i.id,i.direction!==void 0&&(this.direction=i.direction),i.wrap!==void 0&&(this.wrap=i.wrap),i.columnGap!==void 0&&(this.columnGap=i.columnGap),i.rowGap!==void 0&&(this.rowGap=i.rowGap),i.justifyContent!==void 0&&(this.justifyContent=i.justifyContent),i.alignItems!==void 0&&(this.alignItems=i.alignItems),i.alignContent!==void 0&&(this.alignContent=i.alignContent),this.padding=Lr(i.padding)}addChild(t,e){if(t instanceof xt){const r=t;if(e){const n=r.style;n.flexGrow=e.flexGrow??0,n.flexShrink=e.flexShrink??1,n.flexBasis=e.flexBasis??0,n.alignSelf=e.alignSelf??"auto",n.width=e.width,n.height=e.height,n.crossAxisSizing=e.crossAxisSizing??"auto"}return this.children.push(r),r}const i=new Hr(t);return this.children.push(i),i}getContainerMetrics(){const t=this.direction==="row"||this.direction==="row-reverse",{left:e,right:i,top:r,bottom:n}=this.padding,{width:s,height:l}=this.size;return t?{main:s-e-i,cross:l-r-n,mainGap:this.columnGap,crossGap:this.rowGap}:{main:l-r-n,cross:s-e-i,mainGap:this.rowGap,crossGap:this.columnGap}}buildFlexLines(t,e){if(this.wrap==="nowrap")return[t];const i=[];let r=[],n=0;for(const s of t){const l=s.style.flexBasis,c=r.length>0?e.mainGap:0;r.length>0&&n+c+l>e.main&&(i.push(r),r=[],n=0),r.push(s),n+=(r.length>1?e.mainGap:0)+l}return r.length>0&&i.push(r),this.wrap==="wrap-reverse"&&i.reverse(),i}measureLineCrossSizes(t,e){const i=[];for(const r of t){let n=0;for(const s of r){if(this.isDeferredCrossAxisPercentChild(s,e))continue;const l=e?s.style.height:s.style.width,c=l!==void 0?l:e?s.size.height:s.size.width;c>n&&(n=c)}i.push(n)}return i}isDeferredCrossAxisPercentChild(t,e){const i=e?t.style.height:t.style.width;return(t.style.alignSelf!=="auto"?t.style.alignSelf:this.alignItems)==="stretch"&&i===void 0&&t.style.crossAxisSizing==="deferred-percent-stretch"}resolveCrossAxisLayout(t,e){const i=t.length,r=t.reduce((u,d)=>u+d,0),n=e.crossGap*(i>1?i-1:0),s=e.cross-r-n;let l=0,c=e.crossGap;if(this.wrap==="nowrap"&&i===1)t[0]=e.cross;else if(this.wrap!=="nowrap"){const{crossStart:u,crossBetween:d}=this.calculateAlignContent(s,i,e.crossGap);if(l=u,c=d,this.alignContent==="stretch"&&s>0){const a=s/i;for(let h=0;h<i;h++)t[h]+=a}}return{crossStart:l,crossBetween:c}}calculateAlignContent(t,e,i){let r=0,n=i;switch(this.alignContent){case"flex-end":r=t;break;case"center":r=t/2;break;case"space-between":n=e>1?i+t/(e-1):0;break;case"space-around":n=i+t/e,r=n/2;break;case"space-evenly":n=i+t/(e+1),r=n;break}return{crossStart:r,crossBetween:n}}distributeMainAxisSizes(t,e,i){let r=0,n=0,s=0;for(const d of t){const a=d.style.flexBasis;r+=a,n+=d.style.flexGrow,s+=d.style.flexShrink*a}const l=t.length>1?e.mainGap*(t.length-1):0,c=e.main-r-l;let u=0;for(const d of t){const{style:a}=d;let h=a.flexBasis;c>0&&n>0?h+=c*a.flexGrow/n:c<0&&s>0&&(h+=c*a.flexShrink*h/s),h<0&&(h=0),i?d.size.width=h:d.size.height=h,u+=h}return{lineMainUsed:u,totalGrow:n}}calculateJustifySpacing(t,e,i,r){let n=0,s=i.mainGap;if(r===0){const l=t>1?i.mainGap*(t-1):0;let c=i.main-e-l;switch(c<0&&(c=0),this.justifyContent){case"flex-end":n=c;break;case"center":n=c/2;break;case"space-between":s=t>1?i.mainGap+c/(t-1):0;break;case"space-around":s=i.mainGap+c/t,n=s/2;break;case"space-evenly":s=i.mainGap+c/(t+1),n=s;break}}return{leading:n,between:s}}getFinalLineHeight(t,e,i){if(this.wrap!=="nowrap")return e;let r=e;for(const n of t){if(this.isDeferredCrossAxisPercentChild(n,i))continue;const s=i?n.style.height:n.style.width,l=s!==void 0?s:i?n.size.height:n.size.width;l>r&&(r=l)}return r}getCrossSize(t,e,i){const r=i?t.style.height:t.style.width,n=t.style.alignSelf!=="auto"?t.style.alignSelf:this.alignItems;return r!==void 0?(i?t.size.height=r:t.size.width=r,r):n==="stretch"?(i?t.size.height=e:t.size.width=e,e):i?t.size.height:t.size.width}positionChildren(t,e,i,r,n,s,l,c,u){const d=this.direction==="row-reverse"||this.direction==="column-reverse",a=d?t.length-1:0,h=d?-1:t.length,f=d?-1:1;let g=n;for(let v=a;v!==h;v+=f){const C=t[v];if(C!==void 0){const x=C.style,y=C.size,w=C.position;if(i){const P=this.direction==="row"?g:e.main-g-y.width;w.x=l+P}else{const P=this.direction==="column"?g:e.main-g-y.height;w.y=c+P}const F=x.alignSelf!=="auto"?x.alignSelf:this.alignItems,E=this.getCrossSize(C,r,i);let b=0;F==="flex-end"?b=r-E:F==="center"&&(b=(r-E)*.5),i?(w.y=c+u+b,g+=y.width+s):(w.x=l+u+b,g+=y.height+s)}}}build(){const{children:t}=this;if(t.length===0)return;const e=this.direction==="row"||this.direction==="row-reverse",i=this.getContainerMetrics(),r=this.buildFlexLines(t,i);if(r.length===0)return;const n=this.measureLineCrossSizes(r,e),{crossStart:s,crossBetween:l}=this.resolveCrossAxisLayout(n,i),c=this.padding.left,u=this.padding.top;let d=s;for(let a=0;a<r.length;a++){const h=r[a];if(h===void 0||h.length===0)continue;const{lineMainUsed:f,totalGrow:g}=this.distributeMainAxisSizes(h,i,e),{leading:v,between:C}=this.calculateJustifySpacing(h.length,f,i,g),x=this.getFinalLineHeight(h,n[a],e);this.positionChildren(h,i,e,x,v,C,c,u,d),d+=x+l}for(const a of t)a instanceof xt&&a.build()}}function Lr(o){return o===void 0?el:typeof o=="number"?{top:o,right:o,bottom:o,left:o}:{top:o.top??0,right:o.right??0,bottom:o.bottom??0,left:o.left??0}}class Yi extends xt{constructor(t,e,i={}){super(t,e,i)}getLayout(){this.build();const t={};return this._collectLayout(this,t,{counter:0}),t}_collectLayout(t,e,i){for(const r of t.children){const n=r.id??`_$$${i.counter++}`;e[n]={position:r.position,size:r.size},r instanceof xt&&this._collectLayout(r,e,i)}}}const ne={direction:"row",columnGap:0,rowGap:0,justifyContent:"flex-start",alignItems:"stretch"};function Pr(o){const t=o;return{id:o.id,direction:t.direction??ne.direction,columnGap:t.columnGap??ne.columnGap,rowGap:t.rowGap??ne.rowGap,justifyContent:t.justifyContent??ne.justifyContent,alignItems:t.alignItems??ne.alignItems}}function Br(o,t){if(t!=null&&t.length)for(const e of t)if(e.children&&e.children.length>0){const i=new xt(e.width??0,e.height??0,Pr(e));o.addChild(i,e),Br(i,e.children)}else o.addChild(e)}const il=o=>{const t=o.width??0,e=o.height??0,i=Pr(o),r=new Yi(t,e,i);return Br(r,o.children),r.getLayout()},Ye=class Ye{constructor(t){this.debugColor="magenta",this.parent=null,this.children=[],this.rect={x:0,y:0,width:0,height:0},this.zIndex=0,this._intrinsicWidth=0,this._intrinsicHeight=0,this._layoutDirty=!0,this._measureDirty=!0,this._style={flexGrow:0,flexShrink:1,flexBasis:0,alignSelf:"auto"},this._position="static",this.backgroundColor="transparent",this.borderColor="transparent",this.borderWidth=0,this.portalHoverEnabled=!1,this.id=t}get style(){return this._style}set style(t){this._style=t,this.markLayoutDirty()}get position(){return this._position}set position(t){this._position!==t&&(this._position=t,this.markLayoutDirty())}get left(){return this._left}set left(t){this._left!==t&&(this._left=t,this.markLayoutDirty())}get top(){return this._top}set top(t){this._top!==t&&(this._top=t,this.markLayoutDirty())}get right(){return this._right}set right(t){this._right!==t&&(this._right=t,this.markLayoutDirty())}get bottom(){return this._bottom}set bottom(t){this._bottom!==t&&(this._bottom=t,this.markLayoutDirty())}isAbsolute(){return this._position==="absolute"}isPositioningContext(){return this._position!=="static"}markLayoutDirty(){var t;this._layoutDirty||(this._layoutDirty=!0,(t=this.parent)==null||t.markLayoutDirty())}markMeasureDirty(){this._measureDirty||(this._measureDirty=!0,this.markLayoutDirty())}isLayoutDirty(){return this._layoutDirty}isMeasureDirty(){return this._measureDirty}clearLayoutDirty(){this._layoutDirty=!1}clearMeasureDirty(){this._measureDirty=!1}addChild(t){this.attachChild(t,(e,i)=>e.push(i))}addChildStart(t){this.attachChild(t,(e,i)=>e.unshift(i))}removeChild(t){const e=this.children.indexOf(t);e!==-1&&(this.children.splice(e,1),t.parent=null,this.markLayoutDirty())}getTooltip(){return this.tooltip}paint(t,e){const i=t.getZIndex();t.setZIndex(i+this.zIndex),this.onPaint(t,e),Ye.DEBUG&&t.strokeRect(this.rect.x,this.rect.y,this.rect.width,this.rect.height,this.debugColor,1),t.setZIndex(i)}hitTest(t,e){const i=[];return this.collectHitCandidates(t,e,0,{value:0},i),i.sort((r,n)=>n.cumulativeZIndex-r.cumulativeZIndex||n.order-r.order),i.map(({node:r})=>r)}requestLayout(){this.parent&&this.parent.requestLayout()}requestPaint(){this.parent&&this.parent.requestPaint()}onClick(t){}onMouseDown(t){}onMouseUp(t){}onMouseEnter(t){}onMouseLeave(t){}onMouseMove(t){}onDoubleClick(t){}attachChild(t,e){t.parent=this,e(this.children,t),this.markLayoutDirty()}collectHitCandidates(t,e,i,r,n){if(!this.containsHitPoint(t,e))return;const s=i+this.zIndex;n.push({node:this,cumulativeZIndex:s,order:r.value}),r.value+=1;for(const l of this.children)l.collectHitCandidates(t,e,s,r,n)}containsHitPoint(t,e){return t>=this.rect.x&&t<=this.rect.x+this.rect.width&&e>=this.rect.y&&e<=this.rect.y+this.rect.height}};Ye.DEBUG=!1;let _t=Ye;class _r{constructor(){this.defaultFlexStyle={flexGrow:0,flexShrink:1,flexBasis:0,alignSelf:"auto",width:void 0,height:void 0,crossAxisSizing:"auto"}}build(t,e,i){const r=i??t.children.filter(c=>!c.isAbsolute()),n=r.length,s=e.direction,l=s==="row"||s==="row-reverse";for(let c=0;c<n;c+=1){const u=r[c],d=u.style,a=this.extractChildFlexProperties(u,d);this.handlePercentageDimensions(a,d.width,d.height,l,u.rect),this.defaultFlexStyle.flexGrow=a.flexGrow,this.defaultFlexStyle.flexShrink=a.flexShrink,this.defaultFlexStyle.flexBasis=a.flexBasis,this.defaultFlexStyle.alignSelf=a.alignSelf,this.defaultFlexStyle.width=a.width,this.defaultFlexStyle.height=a.height,this.defaultFlexStyle.crossAxisSizing=a.crossAxisSizing,this.isContainer(u)?this.addContainerChild(u,e):this.addLeafChild(u,e)}}extractChildFlexProperties(t,e){const i=e.flexGrow??0,r=e.flexShrink??1,n=e.flexBasis??0;return{width:typeof e.width=="number"?e.width:void 0,height:typeof e.height=="number"?e.height:void 0,flexGrow:i,flexShrink:r,flexBasis:n,alignSelf:e.alignSelf??"auto",crossAxisSizing:"auto"}}handlePercentageDimensions(t,e,i,r,n){e==="100%"&&(r?(t.width=void 0,t.flexGrow===0&&(t.flexGrow=1)):(t.width=void 0,t.alignSelf="stretch",t.crossAxisSizing="deferred-percent-stretch")),i==="100%"&&(r?(t.height=void 0,t.alignSelf="stretch",t.crossAxisSizing="deferred-percent-stretch"):(t.height=void 0,t.flexGrow===0&&(t.flexGrow=1))),t.flexBasis===0&&(t.flexBasis=r?n.width:n.height)}isContainer(t){return"flexOptions"in t}addContainerChild(t,e){const i=new xt(0,0,t.flexOptions);i.size.width=t.rect.width,i.size.height=t.rect.height,e.addChild(i,this.defaultFlexStyle),this.build(t,i)}addLeafChild(t,e){const i=e.addChild(this.defaultFlexStyle);i.size.width=t.rect.width,i.size.height=t.rect.height}}const De=.5;class Rr{constructor(t){this.positionResolver=t}reconcile(t,e,i,r,n,s=!1){let l=!1;const{parent:c}=e,u=c!==null?c.rect:n;l=this.updateNodePosition(e,i,u??e.rect);const d=r??e.children.filter(h=>!h.isAbsolute()),a=d.length>0;if(a&&i instanceof xt){const h=this.reconcileChildLayouts(t,d,i,n);if(l=l||h,this.isContainer(e)&&!s){const f=this.updateContainerFromContent(e,i);l=l||f}}else if(!a){const h=this.remeasureAndUpdateLeaf(t,e,i);l=l||h}return this.positionNestedAbsoluteChildren(t,e),l}updateNodePosition(t,e,i){const r=t.rect,n=e.position,s=e.size;r.x=i.x+n.x,r.y=i.y+n.y;const l=r.width!==s.width,c=r.height!==s.height;return r.width=s.width,r.height=s.height,l||c}reconcileChildLayouts(t,e,i,r){let n=!1;const s=i.children,l=e.length;for(let c=0;c<l;c+=1){const u=this.reconcile(t,e[c],s[c],void 0,r);n=n||u}return n}updateContainerFromContent(t,e){const i=this.getContainerCachedIsRow(t),r=this.getContainerCachedPadding(t),n=e.children,s=n.length;let l=0;if(i){for(let h=0;h<s;h+=1){const f=n[h],g=f.position.y+f.size.height;g>l&&(l=g)}const c=l>0?l+r.bottom:0,u=t.style.height;if(u==="100%")return!1;const d=typeof u=="number"?u:0,a=c>d?c:d;if(a>t.rect.height+De)return t.rect.height=a,this.syncFlexNodeSizeFromRect(t,e,!1,!0),!0}else{let c=0;for(let C=0;C<s;C+=1){const x=n[C],y=x.position.x+x.size.width,w=x.position.y+x.size.height;y>l&&(l=y),w>c&&(c=w)}const u=l>0?l+r.right:0,d=t.style.width;let a=!1,h=!1,f=!1;if(d!=="100%"){const C=typeof d=="number"?d:0,x=u>C?u:C;x>t.rect.width+De&&(t.rect.width=x,a=!0,h=!0)}const g=c>0?c+r.bottom:0,v=t.style.height;if(v!=="100%"){const C=typeof v=="number"?v:0,x=g>C?g:C;x>t.rect.height+De&&(t.rect.height=x,a=!0,f=!0)}return a&&this.syncFlexNodeSizeFromRect(t,e,h,f),a}return!1}syncFlexNodeSizeFromRect(t,e,i,r){i&&(e.size.width=t.rect.width),r&&(e.size.height=t.rect.height),this.syncAutoMainAxisFlexBasis(t,e,i,r)}syncAutoMainAxisFlexBasis(t,e,i,r){const n=t.parent;if(n===null||!this.isContainer(n)||t.style.flexBasis!==void 0&&t.style.flexBasis!==0)return;const s=this.getContainerCachedIsRow(n);s&&i?e.style.flexBasis=t.rect.width:!s&&r&&(e.style.flexBasis=t.rect.height)}remeasureAndUpdateLeaf(t,e,i){const r=e.rect.height,n=e.rect.width;e.measure(t),e.rect.width=n;const s=e.rect.height-r;return Math.abs(s)>De?(this.syncFlexNodeSizeFromRect(e,i,!1,!0),!0):!1}positionNestedAbsoluteChildren(t,e){if(!this.isContainer(e)||!e.isPositioningContext())return;const i=e,n=i.children.filter(l=>l.isAbsolute());if(n.length===0)return;const s=this.getContainerCachedPadding(i);this.positionResolver.positionAbsoluteChildren(i.rect,s,n,l=>l.measure(t),l=>this.layoutAbsoluteChildSubtree(t,l))}layoutAbsoluteChildSubtree(t,e){if(!this.isContainer(e))return;const i=e.parent;e.parent=null;try{e.performLayout(t,!0)}finally{e.parent=i}}isContainer(t){return"flexOptions"in t}getContainerCachedIsRow(t){return t.cachedIsRow??!0}getContainerCachedPadding(t){return t.cachedPadding??{top:0,right:0,bottom:0,left:0}}}class St{static resolvePositionValue(t,e){if(t!==void 0){if(typeof t=="number")return t;if(typeof t=="string"&&t.endsWith("%"))return parseFloat(t)/100*e}}static applyAxisPositioning(t,e,i,r,n){const s=n?e.x:e.y,l=s+(n?e.width:e.height),c=n?e.width:e.height;if(i!==void 0&&r!==void 0){const u=Math.max(0,c-i-r);n?(t.x=s+i,t.width=u):(t.y=s+i,t.height=u)}else i!==void 0&&(n?t.x=s+i:t.y=s+i);r!==void 0&&i===void 0?n?t.x=l-t.width-r:t.y=l-t.height-r:r===void 0&&i===void 0&&(n?t.x=s:t.y=s)}applyAbsolutePositioning(t,e){const i=St.resolvePositionValue(t.left,e.width),r=St.resolvePositionValue(t.right,e.width),n=St.resolvePositionValue(t.top,e.height),s=St.resolvePositionValue(t.bottom,e.height),l=t.rect;St.applyAxisPositioning(l,e,i,r,!0),St.applyAxisPositioning(l,e,n,s,!1)}positionAbsoluteChildren(t,e,i,r,n){const s={x:t.x+e.left,y:t.y+e.top,width:t.width-e.left-e.right,height:t.height-e.top-e.bottom};for(const l of i)r(l),this.applyAbsolutePositioning(l,s),n==null||n(l)}}class qe{constructor(){this.width=0,this.height=0,this.maxCrossSize=0,this.childCount=0,this.isRow=!0}reset(){this.width=0,this.height=0,this.maxCrossSize=0,this.childCount=0,this.isRow=!0}accumulate(t,e){this.isRow=e,e?(this.width+=t.width,this.maxCrossSize=Math.max(this.maxCrossSize,t.height)):(this.height+=t.height,this.maxCrossSize=Math.max(this.maxCrossSize,t.width)),this.childCount+=1}addGap(t,e){if(this.childCount>1){const i=t*(this.childCount-1);e?this.width+=i:this.height+=i}}getSize(){return this.isRow?{width:this.width,height:this.maxCrossSize}:{width:this.maxCrossSize,height:this.height}}static computeIntrinsicSize(t,e,i){const r=new qe;for(const n of t)r.accumulate(n,e);return r.addGap(i,e),r.getSize()}}const ol=3,kr={top:0,right:0,bottom:0,left:0},rl=o=>o===void 0||o==="row"||o==="row-reverse",Mr=o=>o===void 0?kr:typeof o=="number"?{top:o,right:o,bottom:o,left:o}:{top:o.top??0,right:o.right??0,bottom:o.bottom??0,left:o.left??0};class gt extends _t{constructor(t,e={},i="transparent"){super(t),this.cachedPadding=kr,this.cachedIsRow=!0,this.cachedGap=0,this.optionsCacheValid=!1,this.flexOptionsValue=e,this.positionResolver=new St,this.flexTreeBuilder=new _r,this.layoutReconciler=new Rr(this.positionResolver),this.invalidateOptionsCache(),this.backgroundColor=i}get flexOptions(){return this.flexOptionsValue}set flexOptions(t){this.flexOptionsValue=t,this.invalidateOptionsCache(),this.markLayoutDirty()}setFlexOptions(t){Object.assign(this.flexOptionsValue,t),this.invalidateOptionsCache(),this.markLayoutDirty()}invalidateOptionsCache(){this.optionsCacheValid=!1}ensureOptionsCache(){if(this.optionsCacheValid)return;const t=this.flexOptionsValue;this.cachedIsRow=rl(t.direction),this.cachedGap=this.cachedIsRow?t.columnGap??0:t.rowGap??0,this.cachedPadding=Mr(t.padding),this.optionsCacheValid=!0}measure(t){this.measureChildren(t),this.computeIntrinsicSize(),this.applySizeConstraints(),this.clearMeasureDirty()}measureChildren(t){const{children:e}=this;for(let i=0;i<e.length;i+=1)e[i].measure(t)}computeIntrinsicSize(){this.ensureOptionsCache();const{layoutChildren:t}=this.separateChildrenByLayoutMode(),e=t.map(s=>s.rect),{width:i,height:r}=qe.computeIntrinsicSize(e,this.cachedIsRow,this.cachedGap),n=this.cachedPadding;this._intrinsicWidth=i+n.left+n.right,this._intrinsicHeight=r+n.top+n.bottom}applySizeConstraints(){const{style:t}=this,e=this.resolveStyleDimension(t.width,"width"),i=this.resolveStyleDimension(t.height,"height");this.rect.width=e??this._intrinsicWidth,this.rect.height=i??this._intrinsicHeight,e===void 0&&this.clampWidthToParent()}resolveStyleDimension(t,e){if(typeof t=="number")return t;if(t!=="100%")return;const i=this.resolveParentContentSize(e);return i!==void 0?i:this.rect[e]>0?this.rect[e]:void 0}resolveParentContentSize(t){const{parent:e}=this;if(!(e instanceof gt))return e!=null&&e.rect[t]&&e.rect[t]>0?e.rect[t]:void 0;e.ensureOptionsCache();const i=e.cachedPadding,r=t==="width"?i.left+i.right:i.top+i.bottom,n=e.rect[t]-r;return n>0?n:void 0}performLayout(t,e=!1){if(e?(this.measureChildren(t),this.clearMeasureDirty()):this.measure(t),this.children.length===0){this.clearLayoutDirty();return}const{layoutChildren:i,absoluteChildren:r}=this.separateChildrenByLayoutMode();i.length>0&&this.layoutPhase1Flexbox(t,i,e),r.length>0&&this.isPositioningContext()&&this.layoutPhase2Absolute(t,r),this.clearLayoutDirty()}layoutPhase1Flexbox(t,e,i=!1){const r=new Yi(this.rect.width,this.rect.height,this.flexOptionsValue);this.flexTreeBuilder.build(this,r,e);let n=0,s;do r.build(),s=this.layoutReconciler.reconcile(t,this,r,e,this.rect,i),n+=1;while(s&&n<ol)}layoutPhase2Absolute(t,e){this.ensureOptionsCache(),this.positionResolver.positionAbsoluteChildren(this.rect,this.cachedPadding,e,i=>i.measure(t),i=>this.layoutAbsoluteChildSubtree(t,i))}layoutAbsoluteChildSubtree(t,e){if(!(e instanceof gt))return;const i=e.parent;e.parent=null;try{e.performLayout(t,!0)}finally{e.parent=i}}clampWidthToParent(){const{parent:t}=this;if(t===null||t.rect.width<=0)return;let e=t.rect.width;t instanceof gt&&(t.ensureOptionsCache(),e-=t.cachedPadding.left+t.cachedPadding.right),e=Math.max(0,e),this.rect.width>e&&(this.rect.width=e)}separateChildrenByLayoutMode(){const t=[],e=[];for(const i of this.children)i.isAbsolute()?e.push(i):t.push(i);return{layoutChildren:t,absoluteChildren:e}}onPaint(t,e){this.backgroundColor!=="transparent"&&t.fillRect(this.rect.x,this.rect.y,this.rect.width,this.rect.height,this.backgroundColor);for(const i of this.children)i.paint(t,e)}}const nl={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},sl=(o,t)=>({minX:Math.min(o.minX,t.rect.x),minY:Math.min(o.minY,t.rect.y),maxX:Math.max(o.maxX,t.rect.x+t.rect.width),maxY:Math.max(o.maxY,t.rect.y+t.rect.height)}),ll=o=>o.minX===1/0||o.maxX===-1/0;class cl extends gt{performLayout(t){const e=this.layoutChildren(t);if(!e){this.clearLayoutDirty();return}this.expandToFitBounds(e),this.clearLayoutDirty()}layoutChildren(t){let e={...nl};return this.children.forEach(i=>{i instanceof gt?i.performLayout(t):i.measure(t),e=sl(e,i)}),ll(e)?null:e}expandToFitBounds(t){const e=t.maxX-this.rect.x,i=t.maxY-this.rect.y;e>this.rect.width&&(this.rect.width=e),i>this.rect.height&&(this.rect.height=i)}onPaint(t,e){this.backgroundColor&&this.backgroundColor!=="transparent"&&t.fillRect(this.rect.x,this.rect.y,this.rect.width,this.rect.height,this.backgroundColor),this.borderWidth>0&&this.borderColor&&this.borderColor!=="transparent"&&t.strokeRect(this.rect.x+this.borderWidth/2,this.rect.y+this.borderWidth/2,this.rect.width-this.borderWidth,this.rect.height-this.borderWidth,this.borderColor,this.borderWidth),super.onPaint(t,e)}}class qi{constructor(t={}){this.options=t,this.hoveredNode=null,this.activePortalNode=null,this.currentCursor="default",this.bounds=null}setAbsoluteBounds(t){this.bounds=t?{...t}:null}handlePointerMove(t,e){this.transitionHover(t[0],e),this.updateCursor(t)}handlePointerLeave(){this.transitionHover(void 0,null),this.updateCursor([])}handlePortalReset(){this.activePortalNode&&this.dispatchPortalHover({visible:!1,x:0,y:0,width:0,height:0,originId:this.activePortalNode.id,source:this.options.portalSource}),this.activePortalNode=null}computeCursor(t,e,i){var n;const r=i.hitTest(t,e);for(const s of r){const l=(n=s.style)==null?void 0:n.cursor;if(l)return l}return"default"}getCurrentCursor(){return this.currentCursor}transitionHover(t,e){if(this.hoveredNode===t){this.updatePortalHover(t,e);return}this.hoveredNode&&this.hoveredNode.onMouseLeave(this.buildEvent("mouseleave",this.hoveredNode,e)),t&&t.onMouseEnter(this.buildEvent("mouseenter",t,e)),this.hoveredNode=t??null,this.updatePortalHover(t,e)}buildEvent(t,e,i){return i?{...i,type:t,target:e,currentTarget:e}:{type:t,x:0,y:0,originalEvent:{},stopPropagation:()=>{},preventDefault:()=>{},target:e,currentTarget:e}}updateCursor(t){var i,r,n;let e="default";for(const s of t){const l=(i=s.style)==null?void 0:i.cursor;if(l){e=l;break}}e!==this.currentCursor&&(this.currentCursor=e,(n=(r=this.options).onCursorChange)==null||n.call(r,e))}findPortalTarget(t){let e=t;for(;e;){if(e.portalHoverEnabled)return e;e=e.parent}return null}updatePortalHover(t,e=null){var l,c,u,d,a,h;const i=this.findPortalTarget(t),r=i?{...i.rect}:null,n=this.activePortalNode,s=i&&r?{id:i.id,rect:r}:null;if(i&&(n==null?void 0:n.id)===i.id){(c=(l=this.options).onPortalTargetChange)==null||c.call(l,i,e);return}if(this.activePortalNode=s,(d=(u=this.options).onPortalTargetChange)==null||d.call(u,i??null,e),!!this.options.portalHoverDispatch)if(i&&r&&this.bounds){const f=((h=(a=this.options).getTooltipContext)==null?void 0:h.call(a))??void 0;this.dispatchPortalHover({visible:!0,x:this.bounds.x+r.x,y:this.bounds.y+r.y,width:r.width,height:r.height,nodeId:i.id,originId:i.id,source:this.options.portalSource,tooltipContext:f,tooltipFromNode:i.getTooltip(),priority:1})}else n&&this.dispatchPortalHover({visible:!1,x:0,y:0,width:0,height:0,originId:n.id,source:this.options.portalSource})}dispatchPortalHover(t){var i,r,n,s;const e=((r=(i=this.options).getPortalEventTarget)==null?void 0:r.call(i))??null;(s=(n=this.options).portalHoverDispatch)==null||s.call(n,t,e)}}class bt extends _t{addChild(){throw new Error("CanvasLeaf cannot have children")}}const ce={selection:"normal",cellClick:"normal",editor:"normal",contextMenu:"normal"};function al(o){return o.selection!==void 0||o.cellClick!==void 0||o.editor!==void 0||o.contextMenu!==void 0}function zr(o){if(!o||!al(o))return;const t={selection:o.selection??ce.selection,cellClick:o.cellClick??ce.cellClick,editor:o.editor??ce.editor,contextMenu:o.contextMenu??ce.contextMenu};return t.editor==="open-on-click"&&t.selection==="keep"&&(console.warn('[TableCanvas interaction] `editor: "open-on-click"` требует обычного selection. Editor не будет открыт, чтобы не менять выделение неожиданно.'),t.editor="normal"),t.editor==="open-on-click"&&t.cellClick==="stop"&&(console.warn('[TableCanvas interaction] `editor: "open-on-click"` требует обычного cellClick, потому что editor открывается через click pipeline таблицы. Editor не будет открыт.'),t.editor="normal"),t}function Or(){return{...ce}}class Nr{constructor(){this.nodes=new Map,this.listeners=new Set}register(t,e){this.nodes.set(t,e),this.notify(t)}unregister(t){this.nodes.delete(t)}get(t){return this.nodes.get(t)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(t){this.listeners.forEach(e=>e(t))}}function ul(o,t){return o.zIndex!==t.zIndex?o.zIndex-t.zIndex:o.order-t.order}const Uo=typeof Path2D<"u"&&typeof CanvasRenderingContext2D.prototype.roundRect=="function";class Ke{constructor(){this.commands=[],this.orderCounter=0,this.currentZIndex=0}setAnimationContext(t){return this.animationContext=t,this}getAnimationContext(){return this.animationContext}setZIndex(t){return this.currentZIndex=t,this}getZIndex(){return this.currentZIndex}pushZIndex(t=1){return this.currentZIndex+=t,this}popZIndex(t=1){return this.currentZIndex-=t,this}fillRect(t,e,i,r,n){return this.commands.push({type:"fillRect",x:t,y:e,width:i,height:r,fillStyle:n,zIndex:this.currentZIndex,order:this.orderCounter++}),this}strokeRect(t,e,i,r,n,s=1){return this.commands.push({type:"strokeRect",x:t,y:e,width:i,height:r,strokeStyle:n,lineWidth:s,zIndex:this.currentZIndex,order:this.orderCounter++}),this}fillText(t,e,i,r,n,s="middle",l){return this.commands.push({type:"fillText",text:t,x:e,y:i,font:r,fillStyle:n,textBaseline:s,textAlign:l,zIndex:this.currentZIndex,order:this.orderCounter++}),this}fillTextClipped(t,e,i,r,n,s,l="middle",c){return this.commands.push({type:"fillTextClipped",text:t,x:e,y:i,font:r,fillStyle:n,textBaseline:l,textAlign:c,clipX:s.x,clipY:s.y,clipWidth:s.width,clipHeight:s.height,zIndex:this.currentZIndex,order:this.orderCounter++}),this}drawImage(t,e,i,r,n){return this.commands.push({type:"drawImage",image:t,x:e,y:i,width:r,height:n,zIndex:this.currentZIndex,order:this.orderCounter++}),this}roundedRect(t,e,i,r,n,s){return this.commands.push({type:"roundedRect",x:t,y:e,width:i,height:r,radius:n,fillStyle:s==null?void 0:s.fillStyle,strokeStyle:s==null?void 0:s.strokeStyle,lineWidth:s==null?void 0:s.lineWidth,zIndex:this.currentZIndex,order:this.orderCounter++}),this}linearGradientRect(t,e,i,r,n,s,l=90){return this.commands.push({type:"linearGradientRect",x:t,y:e,width:i,height:r,radius:n,gradientStops:s,angle:l,zIndex:this.currentZIndex,order:this.orderCounter++}),this}custom(t){return this.commands.push({type:"custom",fn:t,zIndex:this.currentZIndex,order:this.orderCounter++}),this}clear(){return this.commands.length=0,this.orderCounter=0,this.currentZIndex=0,this.animationContext=void 0,this}get commandCount(){return this.commands.length}flush(t){const{commands:e}=this,i=e.length;if(i===0)return;e.sort(ul);let r="",n="",s=-1,l="",c="",u="";for(let d=0;d<i;d++){const a=e[d];if(a!==void 0)switch(a.type){case"fillRect":r!==a.fillStyle&&(t.fillStyle=a.fillStyle,r=a.fillStyle),t.fillRect(a.x,a.y,a.width,a.height);break;case"strokeRect":n!==a.strokeStyle&&(t.strokeStyle=a.strokeStyle,n=a.strokeStyle),s!==a.lineWidth&&(t.lineWidth=a.lineWidth,s=a.lineWidth),t.strokeRect(a.x,a.y,a.width,a.height);break;case"fillText":l!==a.font&&(t.font=a.font,l=a.font),r!==a.fillStyle&&(t.fillStyle=a.fillStyle,r=a.fillStyle),c!==a.textBaseline&&(t.textBaseline=a.textBaseline,c=a.textBaseline),a.textAlign&&u!==a.textAlign&&(t.textAlign=a.textAlign,u=a.textAlign),t.fillText(a.text,a.x,a.y);break;case"fillTextClipped":l!==a.font&&(t.font=a.font,l=a.font),r!==a.fillStyle&&(t.fillStyle=a.fillStyle,r=a.fillStyle),c!==a.textBaseline&&(t.textBaseline=a.textBaseline,c=a.textBaseline),a.textAlign&&u!==a.textAlign&&(t.textAlign=a.textAlign,u=a.textAlign),this.executeFillTextClipped(t,a);break;case"drawImage":t.drawImage(a.image,a.x,a.y,a.width,a.height);break;case"roundedRect":this.executeRoundedRect(t,a),a.fillStyle&&(r=a.fillStyle),a.strokeStyle&&(n=a.strokeStyle),a.lineWidth!==void 0&&(s=a.lineWidth);break;case"linearGradientRect":this.executeLinearGradientRect(t,a);break;case"custom":a.fn(t),r="",n="",s=-1,l="",c="",u="";break}}this.clear()}executeLinearGradientRect(t,e){const{x:i,y:r,width:n,height:s,radius:l,gradientStops:c,angle:u}=e,d=(u-90)*Math.PI/180,a=Math.cos(d),h=Math.sin(d),f=n/2,g=s/2,v=i+f,C=r+g,y=(Math.abs(a*n)+Math.abs(h*s))/2,w=v-a*y,F=C-h*y,E=v+a*y,b=C+h*y,P=t.createLinearGradient(w,F,E,b);for(const T of c)P.addColorStop(T.offset,T.color);if(t.fillStyle=P,l>0)if(Uo)t.beginPath(),t.roundRect(i,r,n,s,l),t.fill();else{const T=l,B=i+n,O=r+s;t.beginPath(),t.moveTo(i+T,r),t.lineTo(B-T,r),t.quadraticCurveTo(B,r,B,r+T),t.lineTo(B,O-T),t.quadraticCurveTo(B,O,B-T,O),t.lineTo(i+T,O),t.quadraticCurveTo(i,O,i,O-T),t.lineTo(i,r+T),t.quadraticCurveTo(i,r,i+T,r),t.closePath(),t.fill()}else t.fillRect(i,r,n,s)}executeFillTextClipped(t,e){e.clipWidth<=0||e.clipHeight<=0||e.text.length===0||(t.save(),t.beginPath(),t.rect(e.clipX,e.clipY,e.clipWidth,e.clipHeight),t.clip(),t.fillText(e.text,e.x,e.y),t.restore())}executeRoundedRect(t,e){const{x:i,y:r,width:n,height:s,radius:l,fillStyle:c,strokeStyle:u,lineWidth:d}=e;if(Uo)t.beginPath(),t.roundRect(i,r,n,s,l);else{const a=l,h=i+n,f=r+s;t.beginPath(),t.moveTo(i+a,r),t.lineTo(h-a,r),t.quadraticCurveTo(h,r,h,r+a),t.lineTo(h,f-a),t.quadraticCurveTo(h,f,h-a,f),t.lineTo(i+a,f),t.quadraticCurveTo(i,f,i,f-a),t.lineTo(i,r+a),t.quadraticCurveTo(i,r,i+a,r),t.closePath()}c&&(t.fillStyle=c,t.fill()),u&&(t.strokeStyle=u,d!==void 0&&(t.lineWidth=d),t.stroke())}}const hl=new Ke;class dl{constructor(t,e){this.eventHandlers=new Map,this.batcher=new Ke,this.canvas=t,this.ctx=t.getContext("2d",{alpha:!1}),this.rootNode=e,this.hoverController=new qi({onCursorChange:i=>{var r;return(r=this.onCursorChange)==null?void 0:r.call(this,i)},onPortalTargetChange:(i,r)=>{var n;return(n=this.onPortalHoverTargetChange)==null?void 0:n.call(this,i,r)}}),this.setupEvents()}setupEvents(){["click","mousedown","mouseup","mousemove","dblclick"].forEach(e=>{const i=r=>this.dispatchPointerEvent(r,e);this.eventHandlers.set(e,i),this.canvas.addEventListener(e,i)})}destroy(){this.eventHandlers.forEach((t,e)=>{this.canvas.removeEventListener(e,t)}),this.eventHandlers.clear()}dispatchPointerEvent(t,e){const{x:i,y:r}=this.getEventCoords(t),n=this.rootNode.hitTest(i,r),s=n[0];let l=!1;const c={type:e,x:i,y:r,originalEvent:t,target:s,stopPropagation:()=>{l=!0},preventDefault:()=>t.preventDefault()};this.bubbleEvent(n,c,e,()=>l),e==="mousemove"&&(this.dispatchMouseMove(n,c,()=>l),this.hoverController.handlePointerMove(n,c))}getEventCoords(t){const e=this.canvas.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}bubbleEvent(t,e,i,r){t.length!==0&&this.dispatchToNodes(t,e,(n,s)=>this.invokePointerHandler(n,i,s),r)}dispatchMouseMove(t,e,i){this.dispatchToNodes(t,e,(r,n)=>r.onMouseMove(n),i)}dispatchToNodes(t,e,i,r){for(const n of t){if(r())break;i(n,{...e,currentTarget:n})}}invokePointerHandler(t,e,i){switch(e){case"click":t.onClick(i);break;case"mousedown":t.onMouseDown(i);break;case"mouseup":t.onMouseUp(i);break;case"dblclick":t.onDoubleClick(i);break}}render(){const t=window.devicePixelRatio||1,e=this.canvas.getBoundingClientRect();this.clearCanvas(),this.applyResolutionScale(t),this.updateRootRect(e),this.layoutRoot(),this.batcher.clear(),this.rootNode.paint(this.batcher,this.ctx),this.batcher.flush(this.ctx)}clearCanvas(){this.ctx.fillStyle="#ffffff",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)}applyResolutionScale(t){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.scale(t,t)}updateRootRect(t){this.rootNode.rect.width=t.width,this.rootNode.rect.height=t.height,this.rootNode.rect.x=0,this.rootNode.rect.y=0}layoutRoot(){this.rootNode instanceof gt?this.rootNode.performLayout(this.ctx):this.rootNode.measure(this.ctx)}}const it={xs:{height:24,fontSize:12,borderRadius:4,paddingX:8,iconSize:14},s:{height:32,fontSize:13,borderRadius:6,paddingX:12,iconSize:16},m:{height:40,fontSize:14,borderRadius:8,paddingX:16,iconSize:18},l:{height:48,fontSize:16,borderRadius:10,paddingX:20,iconSize:20}};function Wr(o){return{default:{bgColor:o.surfaceSolidDefault,bgColorHover:o.surfaceSolidDefault,borderColor:o.surfaceSolidDefault,textColor:o.inverseTextPrimary,iconColor:o.inverseTextPrimary},primary:{bgColor:o.surfaceSolidDefault,bgColorHover:o.surfaceSolidDefault,borderColor:o.surfaceSolidDefault,textColor:o.inverseTextPrimary,iconColor:o.inverseTextPrimary},accent:{bgColor:o.surfaceAccent,bgColorHover:o.surfaceAccentHover,borderColor:o.surfaceAccent,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},secondary:{bgColor:o.surfaceTransparentSecondary,bgColorHover:o.surfaceTransparentSecondaryHover,borderColor:"transparent",textColor:o.textPrimary,iconColor:o.textPrimary},clear:{bgColor:o.surfaceClear,bgColorHover:o.surfaceTransparentSecondaryHover,borderColor:"transparent",textColor:o.textPrimary,iconColor:o.textPrimary},success:{bgColor:o.surfacePositive,bgColorHover:o.surfacePositiveHover,borderColor:o.surfacePositive,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},warning:{bgColor:o.surfaceWarning,bgColorHover:o.surfaceWarningHover,borderColor:o.surfaceWarning,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},critical:{bgColor:o.surfaceNegative,bgColorHover:o.surfaceNegativeHover,borderColor:o.surfaceNegative,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},dark:{bgColor:o.onLightSurfaceTransparentDeep,bgColorHover:o.onLightSurfaceTransparentDeep,borderColor:o.onLightSurfaceTransparentDeep,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},black:{bgColor:o.onLightSurfaceSolidDefault,bgColorHover:o.onLightSurfaceSolidDefault,borderColor:o.onLightSurfaceSolidDefault,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},white:{bgColor:o.onDarkSurfaceSolidDefault,bgColorHover:o.onDarkSurfaceSolidDefault,borderColor:o.onDarkSurfaceSolidDefault,textColor:o.onLightTextPrimary,iconColor:o.onLightTextPrimary}}}const Xo={bgColor:"#060A0C",bgColorHover:"#13181B",borderColor:"transparent",textColor:"#FFFFFF",textColorHover:"#F2F5F893",iconColor:"#FFFFFF",iconColorHover:"#F2F5F893"},Ze={default:Xo,primary:{bgColor:"#060A0C",bgColorHover:"#111C22",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},accent:{bgColor:"#118CDF",bgColorHover:"#1798EE",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},secondary:{bgColor:"#ADB9C238",bgColorHover:"#ADB9C247",borderColor:"transparent",textColor:"#060A0C",iconColor:"#060A0C"},clear:{bgColor:"transparent",bgColorHover:"rgba(6, 10, 12, 0.08)",borderColor:"transparent",textColor:"#060A0C",iconColor:"#060A0C"},success:{bgColor:"#1A9E32",bgColorHover:"#1EB83A",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},warning:{bgColor:"#FA5F05",bgColorHover:"#FB782D",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},critical:{bgColor:"#FF293E",bgColorHover:"#FF5263",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},dark:{bgColor:"#30373CC7",bgColorHover:"#30373CC7",borderColor:"transparent",textColor:"#FFFFFF",textColorHover:"#F2F5F893",iconColor:"#FFFFFF",iconColorHover:"#F2F5F893"},black:Xo,white:{bgColor:"#FFFFFF",bgColorHover:"#FFFFFF",borderColor:"transparent",textColor:"#060A0C",textColorHover:"#13181B93",iconColor:"#060A0C",iconColorHover:"#13181B93"}},Qt=4,te=4,Gr=16,Ki=20,Zi=4,At=1,ji=6,fl=4,je="s",Je="default",Ji="#d32f2f",ge="#ffffff",$r="rgba(30, 136, 229, 0.08)",Ai="#ffffff",Ur="#E8EEF2",Xr="#D5DFE6",Ei="#8A959D",Qi="|",Vr="#",Yr=35,to=15,Ti=new Map,Di=new Map;function eo(o,t){if(o.charCodeAt(0)===Yr){const e=parseInt(o.slice(1),16),i=Math.min(255,(e>>16&255)+t),r=Math.min(255,(e>>8&255)+t),n=Math.min(255,(e&255)+t);return`${Vr}${(i<<16|r<<8|n).toString(16).padStart(6,"0")}`}return o}function Vo(o,t){const e=Math.min(1,Math.max(0,t));if(o.charCodeAt(0)!==35)throw new Error("Only HEX color format is supported");let i=o.slice(1),r,n,s;if((i.length===3||i.length===4)&&(i=i.split("").map(l=>l+l).join("")),i.length===6)r=parseInt(i.slice(0,2),16),n=parseInt(i.slice(2,4),16),s=parseInt(i.slice(4,6),16);else if(i.length===8)r=parseInt(i.slice(0,2),16),n=parseInt(i.slice(2,4),16),s=parseInt(i.slice(4,6),16);else throw new Error(`Invalid HEX color format: ${o}`);return`rgba(${r}, ${n}, ${s}, ${e})`}function qr(o,t){const e=`${o}${Qi}${t}`;let i=Ti.get(e);return i===void 0&&(i=eo(o,t),Ti.set(e,i)),i}function io(o,t,e){const i=`${e}${Qi}${t}`;let r=Di.get(i);return r===void 0&&(o.font=e,r=o.measureText(t).width,Di.set(i,r)),r}function oo(o,t,e,i,r,n){if(o!=="auto")return o;let s=0;return r&&(s+=e+i),n&&(s+=e+i),t+s+4}function ro(o,t,e,i,r){let n=o;return i&&(n+=t+e),r&&(n+=t+e),n}function gl(){Ti.clear(),Di.clear()}const Cl=eo(Ji,to);function no(o,t,e,i){if(e)return{bgColor:o.bgCell,borderColor:o.borderColor,textColor:o.textLight,iconColor:o.textLight};switch(t){case"primary":return Ii(o,i);case"secondary":return Kr(o,i);case"danger":return Zr(i);default:return Ii(o,i)}}function vl(o,t,e,i,r){const{accentColor:n}=o,s=o.accentFg||ge,l=o.accentFg||ge,c=.4;if(t||e){const h=r?Vo(n,c):n;return{bgColor:h,borderColor:h,textColor:s,iconColor:l}}const u="#485056B0",d="white",a=r?Vo(u,c):u;return{bgColor:d,borderColor:a,textColor:s,iconColor:l}}function Ii(o,t){const{accentColor:e}=o,i=t?qr(e,to):e;return{bgColor:i,borderColor:i,textColor:o.accentFg||ge,iconColor:o.accentFg||ge}}function Kr(o,t){return{bgColor:t?o.accentLight||$r:o.bgCell,borderColor:o.accentColor,textColor:o.accentColor,iconColor:o.accentColor}}function Zr(o){const t=o?Cl:Ji;return{bgColor:t,borderColor:t,textColor:Ai,iconColor:Ai}}function so(o,t,e){return t?{bgColor:Ur,borderColor:Xr,textColor:Ei,iconColor:Ei}:{bgColor:e?o.bgColorHover:o.bgColor,borderColor:o.borderColor,textColor:e&&o.textColorHover?o.textColorHover:o.textColor,iconColor:e&&o.iconColorHover?o.iconColorHover:o.iconColor}}const Yt=-1,Yo=0,ct={colIndex:Yt,rowIndex:Yt},J={x:Yo,y:Yo},ml=2;function ke(o){const{location:t}=o;if(Array.isArray(t)&&t.length>=ml)return ct.colIndex=t[0]??Yt,ct.rowIndex=t[1]??Yt,ct;const{col:e}=o,{row:i}=o;if(typeof e=="number"&&typeof i=="number")return ct.colIndex=e,ct.rowIndex=i,ct;const{colIndex:r}=o,{rowIndex:n}=o;return typeof r=="number"&&typeof n=="number"?(ct.colIndex=r,ct.rowIndex=n,ct):(ct.colIndex=Yt,ct.rowIndex=Yt,ct)}const Ie="-",qo=0;function Zt(o,t){const{colIndex:e,rowIndex:i}=o;return e>=qo&&i>=qo?`${e}${Ie}${i}`:`${t.x}${Ie}${t.y}${Ie}${t.width}${Ie}${t.height}`}function Hi(o){const{posX:t}=o,{posY:e}=o;if(typeof t=="number"&&typeof e=="number"&&t===t&&e===e)return J.x=t,J.y=e,J;const{x:i}=o,{y:r}=o;if(typeof i=="number"&&typeof r=="number"&&i===i&&r===r)return J.x=i,J.y=r,J;const{location:n}=o;if(Array.isArray(n)&&n.length>=2){const s=n[0],l=n[1];if(typeof s=="number"&&typeof l=="number")return J.x=s,J.y=l,J}return null}function Li(o,t){const e=o.x,i=o.y,r=t.x,n=t.y;return e>=r&&e<=r+t.width&&i>=n&&i<=n+t.height?(J.x=e-r,J.y=i-n,J):o}function jr(o,t,e){if(typeof o!="number"||typeof t!="number")return;const i=e.width,r=e.height,n=e.x,s=e.y;if(o>=-1&&o<=i+1&&t>=-1&&t<=r+1)return J.x=o,J.y=t,J;if(o>=n-1&&o<=n+i+1&&t>=s-1&&t<=s+r+1)return J.x=o-n,J.y=t-s,J}function lo(o,t,e){const i=e.x,r=e.y;return o>=i&&o<=i+e.width&&t>=r&&t<=r+e.height}function Rt(o,t){if(typeof o=="object"&&o){const{hoverX:e}=o,{hoverY:i}=o,{rectX:r}=o,{rectY:n}=o;if(typeof e=="number"&&typeof i=="number"&&typeof r=="number"&&typeof n=="number"){const s=t.x-r,l=t.y-n;return e>=s&&e<=s+t.width&&i>=l&&i<=l+t.height}}return!!o}function Me(){return typeof window<"u"?Math.ceil(window.devicePixelRatio):1}function Jr(o){let t=0;for(let e=0;e<o.length;e++)t=(t<<5)-t+o.charCodeAt(e),t|=0;return t.toString(36)}function Pi(o,t){let e=o;return t&&(e=e.replace(/currentColor/g,t),!e.includes("fill=")&&!e.includes("stroke=")&&(e=e.replace("<svg",`<svg fill="${t}"`))),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}class Qr{constructor(){this.iconRegistry=new Map,this.svgDataUrlCache=new Map,this.spriteCache=new Map,this.pendingLoads=new Set,this.loadListeners=new Set,this.inFlightCount=0,this.stats={requests:0,hits:0,misses:0,cacheSize:0,inFlight:0}}onLoad(t){return this.loadListeners.add(t),()=>this.loadListeners.delete(t)}register(t,e={}){const i=Array.isArray(t)?t:Object.entries(t).map(([r,n])=>({name:r,svg:n}));for(const{name:r,svg:n}of i)r&&n&&(e.overwrite||!this.iconRegistry.has(r))&&this.iconRegistry.set(r,n);return this}getSprite(t,e,i){const r=this.resolveKey(t,e,i);if(!r)return null;this.stats.requests++;const n=this.spriteCache.get(r.key);return n?(this.stats.hits++,n):(this.stats.misses++,this.loadSprite(r.key,r.url,e,!0),null)}preload(t,e){const i=Array.isArray(t)?t:[t];for(const r of i){const n=this.resolveKey(r,e.size,e.color);n&&this.loadSprite(n.key,n.url,e.size,!1)}return this}draw(t,e,i,r,n,s){const l=this.getSprite(e,n,s);if(l){const c=n*Me();t.drawImage(l,0,0,c,c,i,r,n,n)}}getImageDirect(t){return t&&t instanceof HTMLImageElement&&t.complete&&t.naturalHeight!==0?t:null}getStats(){return{...this.stats}}reset(){return this.spriteCache.clear(),this.svgDataUrlCache.clear(),this.pendingLoads.clear(),this.stats={requests:0,hits:0,misses:0,cacheSize:0,inFlight:0},this}clearSpriteCache(){return this.spriteCache.clear(),this.pendingLoads.clear(),this.stats.cacheSize=0,this}has(t){return this.iconRegistry.has(t)}getSvg(t){return this.iconRegistry.get(t)}resolveKey(t,e,i){if(!t||e<=0)return null;const r=e*Me();if(typeof t=="string"){const{key:n,url:s}=this.resolveIconUrl(t,i);return{key:`${n}@${r}`,url:s}}return t instanceof HTMLImageElement?{key:`img:${t.src}:${i??""}@${r}`,url:t.src}:null}resolveIconUrl(t,e){const i=e??"",r=this.iconRegistry.get(t);if(r){const s=`r:${t}:${i}`;return this.svgDataUrlCache.has(s)||this.svgDataUrlCache.set(s,Pi(r,e)),{key:s,url:this.svgDataUrlCache.get(s)}}const n=t.trimStart();if(n.startsWith("<svg")){const s=`s:${Jr(n)}:${i}`;return this.svgDataUrlCache.has(s)||this.svgDataUrlCache.set(s,Pi(n,e)),{key:s,url:this.svgDataUrlCache.get(s)}}return{key:`u:${t}:${i}`,url:t}}loadSprite(t,e,i,r){var l;if(this.spriteCache.has(t)||this.pendingLoads.has(t))return;this.pendingLoads.add(t),this.inFlightCount++,this.stats.inFlight=this.inFlightCount;const n=new Image;n.src=e;const s=i*Me();(l=n.decode)==null||l.call(n).then(()=>{const c=document.createElement("canvas");c.width=s,c.height=s;const u=c.getContext("2d");u&&(u.drawImage(n,0,0,s,s),this.spriteCache.set(t,c),this.stats.cacheSize=this.spriteCache.size),r&&this.notifyListeners()}).catch(()=>{}).finally(()=>{this.pendingLoads.delete(t),this.inFlightCount--,this.stats.inFlight=this.inFlightCount,!r&&this.inFlightCount===0&&this.notifyListeners()})}notifyListeners(){this.loadListeners.forEach(t=>t())}}const Et=new Qr;function tn(o){return Et.onLoad(o)}function pl(o,t={}){Et.register(o,t)}function en(o,t,e){return Et.getSprite(o,t,e)}function on(o,t){Et.preload(o,t)}function rn(o,t,e,i,r,n){Et.draw(o,t,e,i,r,n)}function nn(o,t){return Et.getImageDirect(o)}function yl(){return Et.getStats()}function bl(){Et.clearSpriteCache()}const Fl=rn;function ut(o,t,e,i,r,n){if(!t||r<=0)return;const s=en(t,r,n);if(s){o.drawImage(s,e,i,r,r);return}const l=nn(t);l&&o.drawImage(l,e,i,r,r)}function sn(o,t,e,i,r,n,s,l="primary",c=!1,u=!1,d,a,h,f=ji){const g=Qt,v=r-g*2,C=Math.min(v-te,Gr),x=s.baseFontFull,y=h?io(h,n,x):0,w=oo(i,y,C,f,d,a),F=e+g,E=Rt(u,{x:t,y:e,width:w,height:r}),b=no(s,l,c,E),P=t+w*.5,T=F+v*.5;o.roundedRect(t,F,w,v,Zi,{fillStyle:b.bgColor,strokeStyle:b.borderColor,lineWidth:At});const B=ro(y,C,f,d,a);let O=P-B*.5;if(d){const rt=T-C*.5;ut(o,d,O,rt,C,b.textColor),O+=C+f}if(o.fillText(n,O,T,x,b.textColor,"middle","left"),a){const rt=O+y+f,G=T-C*.5;ut(o,a,rt,G,C,b.textColor)}return{x:t,y:F,width:w,height:v,actualWidth:w}}function ln(o,t,e,i,r,n=Je,s=je,l=!1,c=!1,u,d,a,h=ji,f){const g=it[s],v=f?f[n]:Ze[n],C=`${g.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,x=a?io(a,r,C):0,y=oo(i,x,g.iconSize,h,u,d),w=Rt(c,{x:t,y:e,width:y,height:g.height}),F=so(v,l,w),E=t+y*.5,b=e+g.height*.5;F.bgColor!=="transparent"?o.roundedRect(t,e,y,g.height,g.borderRadius,{fillStyle:F.bgColor,strokeStyle:F.borderColor!=="transparent"?F.borderColor:void 0,lineWidth:F.borderColor!=="transparent"?At:0}):F.borderColor!=="transparent"&&o.roundedRect(t,e,y,g.height,g.borderRadius,{fillStyle:F.bgColor,strokeStyle:F.borderColor,lineWidth:At});const P=ro(x,g.iconSize,h,u,d);let T=E-P*.5;if(u){const B=b-g.iconSize*.5;ut(o,u,T,B,g.iconSize,F.textColor),T+=g.iconSize+h}if(o.fillText(r,T,b,C,F.textColor,"middle","left"),d){const B=T+x+h,O=b-g.iconSize*.5;ut(o,d,B,O,g.iconSize,F.textColor)}return{x:t,y:e,width:y,height:g.height,actualWidth:y}}const Sl={100:"FF",90:"E6",80:"CC",75:"BF",70:"B3",60:"99",50:"80",40:"66",30:"4D",25:"40",20:"33",10:"1A",0:"00"},wl=(o,t)=>o.length!==6?o:o.slice(0,4)+Sl[t],Ut="transparent",xl=Object.fromEntries(Object.entries(Ze).map(([o,t])=>o==="secondary"?[o,{bgColor:Ut,borderColor:Ut,textColor:"#485056B0",bgColorHover:Ut,iconColor:"#485056B0",iconColorHovered:"#485056FF"}]:[o,{bgColor:Ut,borderColor:Ut,textColor:t.bgColor,bgColorHover:Ut,iconColor:t.bgColor,iconColorHovered:t.bgColorHover}]));function cn(o,t,e,i,r=Je,n=je,s=!1,l=!1,c){const u=it[n],d=xl[r],a=(c==null?void 0:c.overrideSquareSize)??u.height,h=(c==null?void 0:c.overrideIconSize)??u.iconSize,f=Rt(l,{x:t,y:e,width:a,height:a}),g=d,v=t+a*.5,C=e+a*.5,x=v-h*.5,y=C-h*.5;g.bgColor!=="transparent"?o.roundedRect(t,e,a,a,u.borderRadius,{fillStyle:g.bgColor,strokeStyle:g.borderColor!=="transparent"?g.borderColor:void 0,lineWidth:g.borderColor!=="transparent"?At:0}):g.borderColor!=="transparent"&&o.roundedRect(t,e,a,a,u.borderRadius,{fillStyle:g.bgColor,strokeStyle:g.borderColor,lineWidth:At});const w=(c==null?void 0:c.iconColor)??g.iconColor,F=(c==null?void 0:c.iconColorHovered)??(c==null?void 0:c.iconColor)??g.iconColorHovered,E=s?wl(w,40):f?F:w;return ut(o,i,x,y,h,E),{x:t,y:e,width:a,height:a}}function co(o,t,e,i,r,n,s,l="primary",c=!1,u=!1){const d=Qt,a=r-d*2,h=Math.min(a-te,Ki),f=i==="auto"?h:i,g=e+d,v=Rt(u,{x:t,y:e,width:f,height:r}),C=no(s,l,c,v),x=t+f*.5,y=g+a*.5,w=x-h*.5,F=y-h*.5;return o.roundedRect(t,g,f,a,Zi,{fillStyle:C.bgColor,strokeStyle:C.borderColor,lineWidth:At}),ut(o,n,w,F,h,C.iconColor),{x:t,y:g,width:f,height:a}}function an(o,t,e,i,r=Je,n=je,s=!1,l=!1){const c=it[n],u=Ze[r],d=c.height,a=Rt(l,{x:t,y:e,width:d,height:d}),h=so(u,s,a),f=t+d*.5,g=e+d*.5,v=f-c.iconSize*.5,C=g-c.iconSize*.5;return h.bgColor!=="transparent"?o.roundedRect(t,e,d,d,c.borderRadius,{fillStyle:h.bgColor,strokeStyle:h.borderColor!=="transparent"?h.borderColor:void 0,lineWidth:h.borderColor!=="transparent"?At:0}):h.borderColor!=="transparent"&&o.roundedRect(t,e,d,d,c.borderRadius,{fillStyle:h.bgColor,strokeStyle:h.borderColor,lineWidth:At}),ut(o,i,v,C,c.iconSize,h.iconColor),{x:t,y:e,width:d,height:d}}const Ko={xs:{height:16,fontSize:10,paddingX:4,borderRadius:4},s:{height:20,fontSize:11,paddingX:6,borderRadius:5},m:{height:24,fontSize:12,paddingX:8,borderRadius:6},l:{height:28,fontSize:13,paddingX:10,borderRadius:7}};function Al(o){return{default:{bgColor:o.surfaceSolidDefault,bgColorTransparent:o.surfaceTransparentSecondary,textColor:o.inverseTextPrimary,textColorOnTransparent:o.textPrimary},accent:{bgColor:o.surfaceAccent,bgColorTransparent:o.surfaceTransparentAccent,textColor:o.onDarkTextPrimary,textColorOnTransparent:o.textAccent},positive:{bgColor:o.surfacePositive,bgColorTransparent:o.surfaceTransparentPositive,textColor:o.onDarkTextPrimary,textColorOnTransparent:o.textPositive},warning:{bgColor:o.surfaceWarning,bgColorTransparent:o.surfaceTransparentWarning,textColor:o.onDarkTextPrimary,textColorOnTransparent:o.textWarning},negative:{bgColor:o.surfaceNegative,bgColorTransparent:o.surfaceTransparentNegative,textColor:o.onDarkTextPrimary,textColorOnTransparent:o.textNegative},dark:{bgColor:o.onLightSurfaceSolidDefault,bgColorTransparent:o.onLightSurfaceTransparentDeep,textColor:o.onDarkTextPrimary,textColorOnTransparent:o.onLightTextPrimary},light:{bgColor:o.onDarkSurfaceSolidDefault,bgColorTransparent:o.onDarkSurfaceTransparentCard,textColor:o.onLightTextPrimary,textColorOnTransparent:o.onDarkTextPrimary}}}const El="|",He=6,Zo=new Map,jo={xs:10,s:12,m:14,l:16};class un extends bt{constructor(t,e,i){var r;super(t),this.view="default",this.size="s",this.transparent=!1,this.clear=!1,this.pilled=!1,this.viewColors={},this.text=e,i&&(i.view!==void 0&&(this.view=i.view),i.size!==void 0&&(this.size=i.size),i.transparent!==void 0&&(this.transparent=i.transparent),i.clear!==void 0&&(this.clear=i.clear),i.pilled!==void 0&&(this.pilled=i.pilled),this.leftIcon=i.leftIcon,this.rightIcon=i.rightIcon,this.customColor=i.customColor,this.customBackgroundColor=i.customBackgroundColor,(r=i.theme)!=null&&r.tokens&&(this.viewColors=Al(i.theme.tokens)))}measure(t){const e=Ko[this.size],i=jo[this.size],r=`${e.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,n=Jo(t,r,this.text);let s=0;this.leftIcon&&(s+=i+He),this.rightIcon&&(s+=i+He),this.rect.width=n+s+e.paddingX*2,this.rect.height=e.height}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect,l=Ko[this.size],c=jo[this.size],u=this.viewColors[this.view];if(!u)return;const d=`${l.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`;let a,h;if(this.clear?(a="transparent",h=this.customColor??u.textColorOnTransparent):this.transparent?(a=this.customBackgroundColor??u.bgColorTransparent,h=this.customColor??u.textColorOnTransparent):(a=this.customBackgroundColor??u.bgColor,h=this.customColor??u.textColor),!this.clear){const v=this.pilled?s/2:l.borderRadius;t.roundedRect(i,r,n,s,v,{fillStyle:a})}const f=r+s/2;let g=i+l.paddingX;if(this.leftIcon){const v=f-c/2;ut(t,this.leftIcon,g,v,c,h),g+=c+He}if(t.fillText(this.text,g,f,d,h,"middle"),this.rightIcon){const v=Jo(e,d,this.text),C=g+v+He,x=f-c/2;ut(t,this.rightIcon,C,x,c,h)}}}function Jo(o,t,e){const i=`${t}${El}${e}`;let r=Zo.get(i);return r===void 0&&(o.font=t,r=o.measureText(e).width,Zo.set(i,r)),r}const Tl="default",Dl="s",mi="pointer",Le=8,Il={accentColor:"#1e88e5",accentLight:"rgba(30, 136, 229, 0.16)",accentFg:"#ffffff",bgCell:"#ffffff",borderColor:"#e0e0e0",textLight:"#9e9e9e",baseFontFull:"13px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},Qo=new Map;class hn extends bt{constructor(t,e,i){var r;super(t),this.variant="primary",this.view=Tl,this.size=Dl,this.disabled=!1,this.isHovered=!1,this.useNewApi=!1,this.text=e,super.style={...super.style,cursor:mi},i&&(i.view!==void 0?(this.view=i.view,this.useNewApi=!0):i.variant!==void 0&&(this.variant=i.variant),i.size!==void 0&&(this.size=i.size,this.useNewApi=!0),this.leftIcon=i.leftIcon,this.rightIcon=i.rightIcon,i.disabled!==void 0&&(this.disabled=i.disabled),i.onClick&&(this.onClick=i.onClick),(r=i.theme)!=null&&r.tokens&&(this.viewColors=Wr(i.theme.tokens)))}set style(t){super.style={...super.style,cursor:mi,...t}}get style(){const t=super.style;return t.cursor||(t.cursor=mi),t}measure(t){const e=it[this.size],i=`${e.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,r=Hl(t,this.text,i);let n=0;this.leftIcon&&(n+=e.iconSize+Le),this.rightIcon&&(n+=e.iconSize+Le),this.rect.width=r+n+e.paddingX*2,this.rect.height=e.height}onPaint(t,e){const{x:i,y:r,width:n}=this.rect;if(this.useNewApi)ln(t,i,r,n,this.text,this.view,this.size,this.disabled,this.isHovered,this.leftIcon,this.rightIcon,e,Le,this.viewColors);else{const s=it[this.size];sn(t,i,r,n,s.height,this.text,Il,this.variant,this.disabled,this.isHovered,this.leftIcon,this.rightIcon,e,Le)}}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}}function Hl(o,t,e){const i=`${e}|${t}`;let r=Qo.get(i);return r===void 0&&(o.font=e,r=o.measureText(t).width,Qo.set(i,r)),r}const tr=16,er="black",ir=0,Ll=Math.PI/2,Pl=1.8,Xt={startX:-3.5,startY:-4.25,middleX:2.75,middleY:0,endX:-3.5,endY:4.25};class Bl extends bt{constructor(t,e={}){super(t),this.rotation=ir,this.color=er,this.rotation=e.rotation??ir,this.color=e.color??er,this.rect.width=tr,this.rect.height=tr}measure(t){}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect,l=i+n/2,c=r+s/2,u=this.rotation*Ll;t.custom(d=>{d.save(),d.translate(l,c),d.rotate(u),d.strokeStyle=this.color,d.lineWidth=Pl,d.lineCap="round",d.lineJoin="round",d.beginPath(),d.moveTo(Xt.startX,Xt.startY),d.lineTo(Xt.middleX,Xt.middleY),d.lineTo(Xt.endX,Xt.endY),d.stroke(),d.restore()})}}const _l=28,Rl="default",kl="s",Ml="pointer",zl=20,Ol={accentColor:"#1e88e5",accentLight:"rgba(30, 136, 229, 0.16)",accentFg:"#ffffff",bgCell:"#ffffff",borderColor:"#e0e0e0",textLight:"#9e9e9e"};class Bi extends bt{constructor(t,e,i){super(t),this.view=Rl,this.buttonSize=kl,this.isHovered=!1,this.useNewApi=!1,this.getDisabled=()=>this.disabled?"default":Ml,this.icon=e,this.size=(i==null?void 0:i.size)??"auto",this.variant=(i==null?void 0:i.variant)??"primary",this.disabled=(i==null?void 0:i.disabled)??!1,super.style={...super.style,cursor:this.getDisabled()},(i==null?void 0:i.view)!==void 0&&(this.view=i.view,this.useNewApi=!0),(i==null?void 0:i.buttonSize)!==void 0&&(this.buttonSize=i.buttonSize,this.useNewApi=!0),(i==null?void 0:i.overrideSquareSize)!==void 0&&(this.overrideSquareSize=i.overrideSquareSize),(i==null?void 0:i.overrideIconSize)!==void 0&&(this.overrideIconSize=i.overrideIconSize),(i==null?void 0:i.iconColor)!==void 0&&(this.iconColor=i.iconColor),(i==null?void 0:i.iconColorHovered)!==void 0&&(this.iconColorHovered=i.iconColorHovered),i!=null&&i.onClick&&(this.onClick=r=>{var n;return(n=i.onClick)==null?void 0:n.call(i,r)})}set style(t){super.style={...super.style,cursor:this.getDisabled(),...t}}get style(){const t=super.style;return t.cursor||(t.cursor=this.getDisabled()),t}measure(t){if(this.useNewApi){const e=it[this.buttonSize],i=this.overrideSquareSize??e.height;this.rect.height=i,this.rect.width=i}else{const e=or(this.size);this.rect.height=e.height,this.rect.width=e.width}}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect;if(this.useNewApi){const l=this.overrideSquareSize!==void 0||this.overrideIconSize!==void 0||this.iconColor!==void 0||this.iconColorHovered!==void 0?{overrideSquareSize:this.overrideSquareSize,overrideIconSize:this.overrideIconSize,iconColor:this.iconColor,iconColorHovered:this.iconColorHovered}:void 0;if(cn(t,i,r,this.icon,this.view,this.buttonSize,this.disabled,this.isHovered,l),_t.DEBUG){const c=it[this.buttonSize],u=this.overrideSquareSize??c.height,d=this.overrideIconSize??c.iconSize,a=i+(u-d)*.5,h=r+(u-d)*.5;t.strokeRect(a,h,d,d,"cyan",1)}}else co(t,i,r,n,s,this.icon,Ol,this.variant,this.disabled,this.isHovered)}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}containsHitPoint(t,e){if(this.useNewApi){const n=it[this.buttonSize],s=this.overrideSquareSize??n.height,l={x:this.rect.x,y:this.rect.y,width:s,height:s};return rr(t,e,l)}const i=or(this.size,this.rect.height),r=Nl(this.rect.x,this.rect.y,i);return rr(t,e,r)}}function or(o,t){const e=typeof o=="number"?o:t??_l,i=0,r=Qt,n=Math.min(e-r*2-te,zl),s=typeof o=="number"?o:n+i*2;return{height:e,width:s,paddingX:i,paddingY:r,iconSize:n}}function Nl(o,t,e){return{x:o+e.paddingX,y:t+e.paddingY,width:e.width-e.paddingX*2,height:e.height-e.paddingY*2}}function rr(o,t,e){return o>=e.x&&o<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}const Wl=16,Gl="transparent";class dn extends bt{constructor(t,e,i){super(t),this.icon=e,this.size=(i==null?void 0:i.size)??Wl,this.color=i==null?void 0:i.color}measure(t){this.rect.width=this.size,this.rect.height=this.size}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect;this.backgroundColor&&this.backgroundColor!==Gl&&t.fillRect(i,r,n,s,this.backgroundColor),ut(t,this.icon,i,r,this.size,this.color)}}const $l=28,Ul="default",Xl="s",pi="pointer",Vl=20,Yl={accentColor:"#1e88e5",accentLight:"rgba(30, 136, 229, 0.16)",accentFg:"#ffffff",bgCell:"#ffffff",borderColor:"#e0e0e0",textLight:"#9e9e9e"};class fn extends bt{constructor(t,e,i){super(t),this.view=Ul,this.buttonSize=Xl,this.isHovered=!1,this.useNewApi=!1,this.icon=e,this.size=(i==null?void 0:i.size)??"auto",this.variant=(i==null?void 0:i.variant)??"primary",this.disabled=(i==null?void 0:i.disabled)??!1,super.style={...super.style,cursor:pi},(i==null?void 0:i.view)!==void 0&&(this.view=i.view,this.useNewApi=!0),(i==null?void 0:i.buttonSize)!==void 0&&(this.buttonSize=i.buttonSize,this.useNewApi=!0),i!=null&&i.onClick&&(this.onClick=r=>{var n;return(n=i.onClick)==null?void 0:n.call(i,r)})}set style(t){super.style={...super.style,cursor:pi,...t}}get style(){const t=super.style;return t.cursor||(t.cursor=pi),t}measure(t){if(this.useNewApi){const e=it[this.buttonSize];this.rect.height=e.height,this.rect.width=e.height}else{const e=nr(this.size);this.rect.height=e.height,this.rect.width=e.width}}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect;this.useNewApi?an(t,i,r,this.icon,this.view,this.buttonSize,this.disabled,this.isHovered):co(t,i,r,n,s,this.icon,Yl,this.variant,this.disabled,this.isHovered)}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}containsHitPoint(t,e){if(this.useNewApi){const n=it[this.buttonSize],s={x:this.rect.x,y:this.rect.y,width:n.height,height:n.height};return sr(t,e,s)}const i=nr(this.size,this.rect.height),r=ql(this.rect.x,this.rect.y,i);return sr(t,e,r)}}function nr(o,t){const e=typeof o=="number"?o:t??$l,i=0,r=Qt,n=Math.min(e-r*2-te,Vl),s=typeof o=="number"?o:n+i*2;return{height:e,width:s,paddingX:i,paddingY:r,iconSize:n}}function ql(o,t,e){return{x:o+e.paddingX,y:t+e.paddingY,width:e.width-e.paddingX*2,height:e.height-e.paddingY*2}}function sr(o,t,e){return o>=e.x&&o<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}const se="transparent",Kl=0;class gn extends bt{constructor(t,e=se){super(t),this.color=se,this.borderColor=se,this.borderWidth=Kl,this.color=e}measure(t){const{style:e,rect:i}=this;typeof e.width=="number"&&(i.width=e.width),typeof e.height=="number"&&(i.height=e.height)}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect;if(this.color!==se&&t.fillRect(i,r,n,s,this.color),this.borderWidth>0&&this.borderColor!==se){const l=this.borderWidth/2;t.strokeRect(i+l,r+l,n-this.borderWidth,s-this.borderWidth,this.borderColor,this.borderWidth)}}}const Cn="|",Zl=2,jl=1e4,_i=new Map,Ri=new Map;function vn(o,t,e){o.size>=jl&&o.clear(),o.set(t,e)}function Jl(o,t){return`${o}${Cn}${t}`}function Ql({text:o,font:t,maxWidth:e,textOverflow:i,ellipsis:r,forceEllipsis:n}){return[t,o,e.toFixed(Zl),i,r,n?"force":"normal"].join(Cn)}function ki(o,t,e){const i=Jl(e,t);let r=_i.get(i);return r===void 0&&(o.font=e,r=o.measureText(t).width,vn(_i,i,r)),r}function tc(o){const t=typeof Intl<"u"?Intl.Segmenter:void 0;if(typeof t=="function"){const e=new t(void 0,{granularity:"grapheme"});return Array.from(e.segment(o),({segment:i})=>i)}return Array.from(o)}function ec(o,t,e,i,r){const n=ki(o,r,e);if(n>i)return{text:"",didTruncate:!0,width:0};const s=tc(t);let l=0,c=s.length,u=r,d=n;for(;l<=c;){const a=Math.floor((l+c)/2),h=`${s.slice(0,a).join("")}${r}`,f=ki(o,h,e);f<=i?(u=h,d=f,l=a+1):c=a-1}return{text:u,didTruncate:!0,width:d}}function Mi(o){const{ctx:t,text:e,font:i,maxWidth:r,textOverflow:n,ellipsis:s,forceEllipsis:l=!1}=o,c=Math.max(0,r);if(c<=0||e.length===0&&!(l&&n==="ellipsis"))return{text:"",didTruncate:e.length>0,width:0};const u=Ql({text:e,font:i,maxWidth:c,textOverflow:n,ellipsis:s,forceEllipsis:l}),d=Ri.get(u);if(d)return d;const a=ki(t,e,i);let h;return a<=c&&!l?h={text:e,didTruncate:!1,width:a}:n==="clip"?h={text:e,didTruncate:!0,width:a}:h=ec(t,e,i,c,s),vn(Ri,u,h),h}function lr({ctx:o,lines:t,font:e,maxWidth:i,maxLines:r,textOverflow:n,ellipsis:s}){const l=Math.max(0,Math.floor(r)),c=Math.min(t.length,l),u=t.slice(0,c),d=t.length>c;if(n==="ellipsis"&&u.length>0){const a=u.length-1,h=u[a]??"";u[a]=Mi({ctx:o,text:h,font:e,maxWidth:i,textOverflow:n,ellipsis:s,forceEllipsis:d}).text}return{lines:u,didClamp:d}}function ic(){_i.clear(),Ri.clear()}const oc="14px sans-serif",rc="black",nc=1,sc=14,lc="visible",cc="clip",ac="…",uc=/(\d*\.?\d+)px/,pt="|",hc=30,dc=`${pt}precise-wrap`,fc=1e4,gc=5e3,Cc=/[\u0300-\u036F\u1AB0-\u1AFF\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F\u200D\uFE0E\uFE0F\u2600-\u27BF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/,zi=new Map,Oi=new Map,Ni=new Map;let yi=null;function vc(){return yi===null&&typeof document<"u"&&(yi=document.createElement("canvas").getContext("2d")),yi}function mn(o,t,e,i){o.size>=i&&o.clear(),o.set(t,e)}function mc(o,t,e,i){return`${o}${pt}${t}${pt}${e??""}${pt}${i??""}`}function pc(o,t){return`${o}${pt}${t}`}function yc(o,t,e){return`${o}${pt}${t}${pt}${e}`}function pn(o,t,e,i){return`${o}${pt}${t}${pt}${e}${pt}${i}`}class ao extends _t{constructor(t,e,i){super(t),this.font=oc,this.color=rc,this.wordWrap=!1,this.lineHeight=nc,this.overflow=lc,this.textOverflow=cc,this.ellipsis=ac,this.lastMeasureKey="",this.cachedLines=null,this.cachedLinesKey="",this.lastPaintedTextWidth=0,this.text=e,i&&(i.font&&(this.font=i.font),i.fontSize!==void 0&&(this.fontSize=i.fontSize),i.lineHeightPx!==void 0&&(this.lineHeightPx=i.lineHeightPx),i.color&&(this.color=i.color),i.wordWrap!==void 0&&(this.wordWrap=i.wordWrap),i.lineHeight!==void 0&&(this.lineHeight=i.lineHeight,this.lineHeightPx=void 0),i.overflow!==void 0&&(this.overflow=i.overflow),i.textOverflow!==void 0&&(this.textOverflow=i.textOverflow),i.ellipsis!==void 0&&(this.ellipsis=i.ellipsis),i.maxLines!==void 0&&(this.maxLines=i.maxLines),i.autoTooltip!==void 0&&(this.autoTooltip=i.autoTooltip))}measure(t){const{font:e,text:i,wordWrap:r,lineHeight:n,rect:s,fontSize:l}=this,{lineHeightPx:c}=cr(e,n,l,this.lineHeightPx);this.isSingleLineClampEnabled()?this.measureSingleLineClamp(t,e,i,c,s):r?this.measureWordWrap(t,e,i,c,s):this.measureSingleLine(t,e,i,c,s)}measureWordWrap(t,e,i,r,n){const s=ar(this.style.width,n.width);if(s>0){const l=this.getResolvedMaxLines(),u=!(this.overflow==="hidden"&&l!==void 0&&l>1&&Fc(i)),d=pn(e,i,s,u);(d!==this.cachedLinesKey||this.cachedLines===null)&&(this.cachedLines=bc(t,i,e,s,u),this.cachedLinesKey=d),n.width=s;const a=l!==void 0&&this.overflow==="hidden"?Math.min(this.cachedLines.length,l):this.cachedLines.length;n.height=a*r}else n.width=Pe(t,i,e),n.height=r,this.cachedLines=null}measureSingleLineClamp(t,e,i,r,n){const s=ar(this.style.width,n.width);s>0?(n.width=s,n.height=r):(n.width=Pe(t,i,e),n.height=r),this.cachedLines=null}measureSingleLine(t,e,i,r,n){const s=yc(e,i,r);s!==this.lastMeasureKey&&(this.lastMeasureKey=s,n.width=Pe(t,i,e),n.height=r),this.cachedLines=null}getLastPaintedTextWidth(){return this.lastPaintedTextWidth}getTooltip(){if(this.tooltip)return this.tooltip;const t=this.autoTooltip;if(!t)return;const e=typeof t=="object"?t:void 0;if(!(e?e.enabled!==!1:t===!0)||!this.computeIsTruncated())return;let r=this.text;if(e&&typeof e.text=="function"?r=e.text(this.text):e&&typeof e.text=="string"&&(r=e.text),r===null||r==="")return;if(!e)return r;const{enabled:n,text:s,...l}=e;return{...l,text:r}}computeIsTruncated(){if(this.overflow!=="hidden"||this.textOverflow!=="ellipsis")return!1;const t=vc();if(!t)return!1;const e=this.cachedLines;if(e!==null&&e.length>0){const i=this.getResolvedMaxLines();return i===void 0?!1:lr({ctx:t,lines:e,font:this.font,maxWidth:this.rect.width,maxLines:i,textOverflow:this.textOverflow,ellipsis:this.ellipsis}).didClamp}return Mi({ctx:t,text:this.text,font:this.font,maxWidth:this.rect.width,textOverflow:this.textOverflow,ellipsis:this.ellipsis}).didTruncate}getResolvedMaxLines(){if(this.maxLines===void 0||!Number.isFinite(this.maxLines)||this.maxLines<=0)return;const t=Math.floor(this.maxLines);return t>0?t:void 0}isSingleLineClampEnabled(){return this.wordWrap&&this.overflow==="hidden"&&this.getResolvedMaxLines()===1}isMultilineClampEnabled(){return this.wordWrap&&this.overflow==="hidden"&&this.getResolvedMaxLines()!==void 0}onPaint(t,e){const{font:i,text:r,rect:n,color:s}=this,l=this.cachedLines;l!==null&&l.length>0?this.paintMultiline(t,e,i,s,l,n):this.paintSingleLine(t,e,r,i,s,n)}paintMultiline(t,e,i,r,n,s){const{lineHeightPx:l}=cr(i,this.lineHeight,this.fontSize,this.lineHeightPx),c=this.getResolvedMaxLines(),u=this.isMultilineClampEnabled()&&c!==void 0?lr({ctx:e,lines:n,font:i,maxWidth:s.width,maxLines:c,textOverflow:this.textOverflow,ellipsis:this.ellipsis}).lines:n,d=u.length*l;let a=s.y+Math.max(0,(s.height-d)*.5);this.lastPaintedTextWidth=0;for(let h=0,f=u.length;h<f;h+=1){const g=u[h];g!==void 0&&(this.overflow==="hidden"?t.fillTextClipped(g,s.x,a,i,r,s,"top","left"):t.fillText(g,s.x,a,i,r,"top"),a+=l)}}paintSingleLine(t,e,i,r,n,s){const l=s.y+s.height*.5;if(this.overflow==="hidden"){const c=Mi({ctx:e,text:i,font:r,maxWidth:s.width,textOverflow:this.textOverflow,ellipsis:this.ellipsis});if(this.lastPaintedTextWidth=Math.min(c.width,Math.max(0,s.width)),c.text.length===0)return;t.fillTextClipped(c.text,s.x,l,r,n,s,"middle","left");return}this.lastPaintedTextWidth=Pe(e,i,r),t.fillText(i,s.x,l,r,n,"middle")}}function cr(o,t,e,i){const r=mc(o,t,e,i);let n=zi.get(r);if(n===void 0){const s=uc.exec(o),l=e??(s&&s[1]!==void 0?Number(s[1]):sc);n={fontSize:l,lineHeightPx:i??l*t},zi.set(r,n)}return n}function Pe(o,t,e){const i=pc(e,t);let r=Oi.get(i);return r===void 0&&(o.font=e,r=o.measureText(t).width,mn(Oi,i,r,fc)),r}function bc(o,t,e,i,r){o.font=e;const n=Math.max(i,hc),s=pn(e,t,n,r);let l=Ni.get(s);if(!l){const c=r?e:`${e}${dc}`;l=Sc(Vs.split(o,t,c,n,r)),mn(Ni,s,l,gc)}return l}function ar(o,t){return typeof o=="number"&&o>0?o:t>0?t:0}function Fc(o){return Cc.test(o)}function Sc(o){if(Array.isArray(o))return o;const t=o;return t.lines&&Array.isArray(t.lines)?t.lines:[]}function wc(){zi.clear(),Oi.clear(),Ni.clear(),ic()}const ae={250:15.625,32:2,28:1.75,24:1.5,20:1.25,18:1.125,16:1,14:.875,12:.75,8:.5,0:0},ur=16,le=16,yn=90,hr="rgba(8, 8, 8, 0.08)",xc=4e3,Ac=1920,Ec="linear-gradient( 90deg, rgba(8, 8, 8, 0.09) 0%, rgba(8, 8, 8, 0.08) 6.25%, rgba(8, 8, 8, 0.05) 12.5%, rgba(8, 8, 8, 0.01) 25%, rgba(8, 8, 8, 0.05) 37.5%, rgba(8, 8, 8, 0.08) 43.75%, rgba(8, 8, 8, 0.09) 50%, rgba(8, 8, 8, 0.08) 56.25%, rgba(8, 8, 8, 0.05) 62.5%, rgba(8, 8, 8, 0.01) 75%, rgba(8, 8, 8, 0.05) 87.5%, rgba(8, 8, 8, 0.08) 93.75%, rgba(8, 8, 8, 0.09) 100% )",Tc="linear-gradient( 90deg, rgba(8, 8, 8, 0.36) 0%, rgba(8, 8, 8, 0.32) 6.25%, rgba(8, 8, 8, 0.20) 12.5%, rgba(8, 8, 8, 0.04) 25%, rgba(8, 8, 8, 0.20) 37.5%, rgba(8, 8, 8, 0.32) 43.75%, rgba(8, 8, 8, 0.36) 50%, rgba(8, 8, 8, 0.08) 56.25%, rgba(8, 8, 8, 0.20) 62.5%, rgba(8, 8, 8, 0.04) 75%, rgba(8, 8, 8, 0.20) 87.5%, rgba(8, 8, 8, 0.32) 93.75%, rgba(8, 8, 8, 0.36) 100% )";let dr=null;const Dc={right:90,left:270,top:0,bottom:180,"top right":45,"right top":45,"bottom right":135,"right bottom":135,"bottom left":225,"left bottom":225,"top left":315,"left top":315};class bn extends bt{constructor(t,e){super(t),this._gradientStops=null,this._gradientAngle=yn;const i=(e==null?void 0:e.customGradientColor)??(e!=null&&e.lighter?Tc:Ec),r=Pc(i);r&&(this._gradientStops=r.stops,this._gradientAngle=r.angle),this.borderRadius=Ic(e==null?void 0:e.roundness),this.animated=(e==null?void 0:e.animated)??!0,this.shimmerDuration=(e==null?void 0:e.shimmerDuration)??xc}measure(t){const{style:e,rect:i}=this;typeof e.width=="number"&&(i.width=e.width),typeof e.height=="number"&&(i.height=e.height)}onPaint(t,e){var f;const{x:i,y:r,width:n,height:s}=this.rect;if(n<=0||s<=0)return;const{_gradientStops:l,borderRadius:c}=this;if(!l||l.length<2){c>0?t.roundedRect(i,r,n,s,c,{fillStyle:hr}):t.fillRect(i,r,n,s,hr);return}const u=t.getAnimationContext(),d=u==null?void 0:u.frameTime;if(!this.animated||d===void 0){t.linearGradientRect(i,r,n,s,c,l,this._gradientAngle);return}dr??(dr=d);const h=(d-dr)%this.shimmerDuration/this.shimmerDuration;t.custom(g=>{g.save(),g.beginPath(),c>0?g.roundRect(i,r,n,s,c):g.rect(i,r,n,s),g.clip();const{startX:v,startY:C,endX:x,endY:y}=Bc(i,r,s,h),w=g.createLinearGradient(v,C,x,y);for(const F of l)w.addColorStop(F.offset,F.color);g.fillStyle=w,g.fillRect(i,r,n,s),g.restore()}),(f=u==null?void 0:u.requestAnimationFrame)==null||f.call(u)}}function fr(o){return o in ae}function Ic(o){if(o===void 0)return ae[ur]*le;if(typeof o=="number")return fr(o)?ae[o]*le:o;const t=o.trim(),e=Number(t);if(!Number.isNaN(e))return fr(e)?ae[e]*le:e;const i=t.match(/^(-?\d+(?:\.\d+)?)px$/i);if(i){const[,n]=i;return parseFloat(n)}const r=t.match(/^(-?\d+(?:\.\d+)?)rem$/i);if(r){const[,n]=r;return parseFloat(n)*le}return ae[ur]*le}function Hc(o){var i;const t=o.trim(),e=t.match(/^var\s*\(\s*[^,]+,\s*([\s\S]+)\s*\)$/i);return((i=e==null?void 0:e[1])==null?void 0:i.trim())??t}function Lc(o,t){switch(t.toLowerCase()){case"rad":return o*180/Math.PI;case"turn":return o*360;case"grad":return o*180/200;default:return o}}function Pc(o){const e=Hc(o).match(/^linear-gradient\s*\(([\s\S]+)\)$/i);if(!(e!=null&&e[1]))return null;const i=[];let r="",n=0;for(const h of e[1])h==="("&&n++,h===")"&&n--,h===","&&n===0?(i.push(r.trim()),r=""):r+=h;r.trim()&&i.push(r.trim());const[s]=i;if(i.length<2||!s)return null;let l=yn,c=0;const u=s.match(/^(-?\d+(?:\.\d+)?)(deg|rad|turn|grad)?$/i);if(u!=null&&u[1]){const[,h,f="deg"]=u;l=Lc(parseFloat(h),f),c=1}else if(s.startsWith("to ")){const h=s.substring(3).trim().toLowerCase(),f=Dc[h];f!==void 0&&(l=f,c=1)}const d=[],a=i.slice(c);for(let h=0;h<a.length;h++){const f=a[h];if(!f)continue;const g=f.trim().match(/^(#[0-9a-fA-F]{3,8}|rgba?\s*\([^)]+\)|hsla?\s*\([^)]+\)|[a-zA-Z]+)(?:\s+(-?\d+(?:\.\d+)?)(%))?$/);if(!(g!=null&&g[1]))continue;const[,v,C,x]=g,y=x==="%"?parseFloat(C)/100:a.length>1?h/(a.length-1):0;d.push({offset:Math.max(0,Math.min(1,y)),color:v})}return d.length<2?null:{stops:d,angle:l}}function Bc(o,t,e,i){const r=Ac,n=i*r,s=o-r+n,l=o+r+n,c=t+e/2;return{startX:s,startY:c,endX:l,endY:c}}function _c(o,t){const e=o.replace("#","");let i,r,n,s=255;e.length===3||e.length===4?(i=parseInt(e[0]+e[0],16),r=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),e.length===4&&(s=parseInt(e[3]+e[3],16))):(i=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),e.length===8&&(s=parseInt(e.slice(6,8),16)));const l=Math.round(s*t),c=u=>u.toString(16).padStart(2,"0");return`#${c(i)}${c(r)}${c(n)}${c(l)}`}function Rc(o){return{default:{color:o.textPrimary,colorHover:o.textPrimaryHover,colorActive:o.textPrimaryActive},accent:{color:o.textAccent,colorHover:o.textAccentHover,colorActive:o.textAccentActive},secondary:{color:o.textSecondary,colorHover:o.textSecondaryHover,colorActive:o.textSecondaryActive},tertiary:{color:o.textTertiary,colorHover:o.textTertiaryHover,colorActive:o.textTertiaryActive},paragraph:{color:o.textParagraph,colorHover:o.textParagraphHover,colorActive:o.textParagraphActive},positive:{color:o.textPositive,colorHover:o.textPositiveHover,colorActive:o.textPositiveActive},warning:{color:o.textWarning,colorHover:o.textWarningHover,colorActive:o.textWarningActive},negative:{color:o.textNegative,colorHover:o.textNegativeHover,colorActive:o.textNegativeActive},clear:{color:o.textPrimary,colorHover:o.textPrimaryHover,colorActive:o.textPrimaryActive}}}const kc="default",bi="pointer",Mc=.4,zc=2,Oc=1;class Fn extends ao{constructor(t,e,i){var r;super(t,e,i),this.view=kc,this.disabled=!1,this.isHovered=!1,this.isActive=!1,this.hasCustomColor=!1,super.style={...super.style,cursor:bi},i&&(this.href=i.href,this.target=i.target,this.rel=i.rel,i.view!==void 0&&(this.view=i.view),i.disabled!==void 0&&(this.disabled=i.disabled),this.hasCustomColor=i.color!==void 0,(r=i.theme)!=null&&r.tokens&&(this.viewColors=Rc(i.theme.tokens))),!this.hasCustomColor&&this.viewColors&&(this.color=this.viewColors[this.view].color)}set style(t){super.style={...super.style,cursor:bi,...t}}get style(){const t=super.style;return t.cursor=this.disabled?"not-allowed":bi,t}setOnClick(t){this.customClickHandler=t}resolveColor(){let t;if(this.hasCustomColor||!this.viewColors)t=this.color;else{const e=this.viewColors[this.view];this.isActive?t=e.colorActive:this.isHovered?t=e.colorHover:t=e.color}return this.disabled&&(t=_c(t,Mc)),t}onPaint(t,e){const i=this.color;this.color=this.resolveColor(),super.onPaint(t,e);const{view:r,isHovered:n,wordWrap:s}=this,c=!s&&(r==="default"||r==="clear"||!this.disabled&&n),u=this.getLastPaintedTextWidth();c&&u>0&&this.paintUnderline(t,u),this.color=i}paintUnderline(t,e){const{x:i,y:r,height:n}=this.rect,s=r+n+zc,l=this.resolveColor();t.custom(c=>{c.beginPath(),c.moveTo(i,s),c.lineTo(i+e,s),c.strokeStyle=l,c.lineWidth=Oc,c.stroke()})}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1,this.isActive=!1}onMouseDown(){this.disabled||(this.isActive=!0)}onMouseUp(){this.isActive=!1}onClick(t){if(this.disabled)return;let e=!1;const i=t.preventDefault;t.preventDefault=()=>{e=!0,i.call(t)},!(this.customClickHandler&&(this.customClickHandler(t),e))&&this.navigate()}navigate(){if(!this.href)return;const t=this.target||"_self";if(t==="_self")window.location.href=this.href;else{const e=this.rel??(t==="_blank"?"noopener,noreferrer":void 0);window.open(this.href,t,e)}}}let ue=0;const We=new Set;function Nc(){ue++,ue===1&&We.forEach(t=>t(!0));let o=!1;return()=>{o||(o=!0,ue--,ue===0&&We.forEach(t=>t(!1)))}}function Wc(){return ue>0}function Gc(o){return We.add(o),()=>{We.delete(o)}}const Ge="basic-grid-canvas-portal-hover",$c=400;let Uc=0;const Fi="__canvasPortalTargetId";function Xc(o){var i;if(!o)return"window";const t=o;if((i=t.dataset)!=null&&i.portalTargetId)return t.dataset.portalTargetId;const e=o;return e[Fi]||(e[Fi]=++Uc),String(e[Fi])}const Jt=new Map;function Vc(o,t){return`${o??"default"}:${t??"default"}`}function Wi(o,t){const e=new CustomEvent(Ge,{detail:o});t?t.dispatchEvent(e):window.dispatchEvent(e)}function gr(o){const t=Jt.get(o);t!==void 0&&(window.clearTimeout(t),Jt.delete(o))}function Yc(o){const t=`${o}:`;for(const[e,i]of Jt.entries())e.startsWith(t)&&(window.clearTimeout(i),Jt.delete(e))}function qc(o,t,e){const i=window.setTimeout(()=>{Jt.delete(o),Wi(t,e)},$c);Jt.set(o,i)}function fe(o,t,e){if(typeof window>"u")return;const i=Xc(t),r=`${i}:${Vc(o.source,o.originId)}`;o.visible?(Yc(i),Wi(o,t)):e?(gr(r),Wi(o,t)):(gr(r),qc(r,o,t))}function Kc(o,t){if(typeof window>"u")return()=>{};const e=t??window,i=r=>{const n=r;n.detail&&o(n.detail)};return e.addEventListener(Ge,i),()=>{e.removeEventListener(Ge,i)}}const Zc="cell";class yt{constructor(t,e){this.bounds=null,this.batcher=new Ke,this.portalEventTarget=null,this.tooltipContext=void 0,this.rootNode=t,this.hoverController=new qi({onCursorChange:i=>{var r;return(r=this.onCursorChange)==null?void 0:r.call(this,i)},portalHoverDispatch:fe,getPortalEventTarget:()=>this.portalEventTarget,portalSource:Zc,getTooltipContext:()=>this.tooltipContext})}setPortalEventTarget(t){this.portalEventTarget=t}setTooltipContext(t){this.tooltipContext=t}setRootNode(t){this.rootNode=t}setOriginId(t){}render(t,e,i,r,n){this.bounds={...r??e},this.hoverController.setAbsoluteBounds(this.bounds),t.save(),t.translate(e.x,e.y),this.prepareRootNode(t,e),i?this.dispatchPointerEvent("mousemove",i.x,i.y):this.handleMouseLeave(),this.batcher.clear(),this.batcher.setAnimationContext(n),this.rootNode.paint(this.batcher,t),this.batcher.flush(t),t.restore()}dispatchPointerEvent(t,e,i,r){var d;if(!this.bounds)return{propagationStopped:!1,suppressGridDefault:!1};const n=this.rootNode.hitTest(e,i),s=(d=n.find(a=>a.interaction!==void 0))==null?void 0:d.interaction;let l=!1,c=!1;const u={type:t,x:e,y:i,originalEvent:r??{},target:n[0],stopPropagation:()=>{l=!0},preventDefault:()=>{c=!0,r==null||r.preventDefault()}};return n.length===0?(t==="mousemove"&&this.hoverController.handlePointerMove([],null),{propagationStopped:!1,suppressGridDefault:c,...s?{interaction:s}:{}}):(this.dispatchEventToNodes(n,u,t),t==="mousemove"&&this.hoverController.handlePointerMove(n,u),{propagationStopped:l,suppressGridDefault:c,...s?{interaction:s}:{}})}getInteractionAtPoint(t,e){var i;if(this.bounds)return(i=this.rootNode.hitTest(t,e).find(r=>r.interaction))==null?void 0:i.interaction}dispatchEventToNodes(t,e,i){let r=!1;const n={...e,stopPropagation:()=>{r=!0,e.stopPropagation()}};for(const s of t){if(r)break;const l={...n,currentTarget:s};this.invokeNodeHandler(s,i,l)}}invokeNodeHandler(t,e,i){switch(e){case"click":t.onClick({...i,cellBounds:this.bounds});break;case"mousedown":t.onMouseDown(i);break;case"mouseup":t.onMouseUp(i);break;case"dblclick":t.onDoubleClick(i);break;case"mousemove":t.onMouseMove(i);break;case"mouseenter":t.onMouseEnter(i);break;case"mouseleave":t.onMouseLeave(i);break}}handleMouseLeave(){this.hoverController.handlePointerLeave()}prepareRootNode(t,e){this.rootNode.rect.x=0,this.rootNode.rect.y=0,this.rootNode.rect.width=e.width,this.rootNode.rect.height=e.height,this.rootNode instanceof gt?this.rootNode.performLayout(t):this.rootNode.measure(t)}computeCursor(t,e){return this.hoverController.computeCursor(t,e,this.rootNode)}getCurrentCursor(){return this.hoverController.getCurrentCursor()}forcePortalHide(){this.hoverController.handlePortalReset()}}const Qe="canvas-cell";function Sn(o,t,e,i){return{kind:L.GridCellKind.Custom,allowOverlay:!1,readonly:!0,copyData:e??"",data:{kind:Qe,render:o,onClick:t},...i}}function uo(o){var e;const t=o;return!!(t&&t.kind===L.GridCellKind.Custom&&((e=t.data)==null?void 0:e.kind)===Qe)}const he=5,wn=[["hoverX","hoverY"],["mouseX","mouseY"],["pointerX","pointerY"],["posX","posY"],["x","y"]],xn="default",An="pointer";function En(o,t){for(const[e,i]of wn){const r=o[e],n=o[i];if(typeof r=="number"&&typeof n=="number"&&!Number.isNaN(r)&&!Number.isNaN(n)){if(Tn(r,n,t))return{x:r-t.x,y:n-t.y};if(Dn(r,n,t))return{x:r,y:n}}}}function Tn(o,t,e){return o>=e.x&&o<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}function Dn(o,t,e){return o>=-he&&o<=e.width+he&&t>=-he&&t<=e.height+he}function In(o,t,e){if((o==null?void 0:o.canvasRoot)instanceof yt){const i=e?"nativeEvent"in e?e.nativeEvent:e:void 0;return o.canvasRoot.dispatchPointerEvent("click",t.x,t.y,i)}return{propagationStopped:!1,suppressGridDefault:!1}}function Hn(o,t){if(o!=null&&o.clickHandlers&&Array.isArray(o.clickHandlers)){for(const{area:e,handler:i}of o.clickHandlers)if(lo(t.x,t.y,e))return i(),!0}return!1}function Ln(o,t,e,i,r,n){const{onClick:s}=o.data;return s?!!s(t.x,t.y,e,i,r,n??void 0):!1}const Gi=new WeakMap,Pn=new Map;function Bn(o,t,e){const i={...e??{}};return delete i.hoveredAreas,Pn.set(o,i),t.data.renderData=i,i}function jt(o,t){return t.data.renderData??Pn.get(o)}function _n(o,t){var i,r;(((i=Gi.get(o))==null?void 0:i.hovered)??!1)!==t&&(Gi.set(o,{hovered:t}),t?(r=o.onMouseEnter)==null||r.call(o):jc(o))}function jc(o){const{renderData:t}=o;(t==null?void 0:t.canvasRoot)instanceof yt&&t.canvasRoot.forcePortalHide()}function Rn(o){var t;return(t=Gi.get(o))==null?void 0:t.hovered}function kn(o,t,e,i){var r;if(o instanceof yt)if(t){if(e.event){const s="nativeEvent"in e.event?e.event.nativeEvent:e.event;o.dispatchPointerEvent("mousemove",t.x,t.y,s)}const n=o.computeCursor(t.x,t.y);n&&n!==xn&&((r=i.overrideCursor)==null||r.call(i,n))}else o.handleMouseLeave(),o.forcePortalHide()}function Mn(o,t,e,i,r){var c;const n=!!(t&&e.some(u=>lo(t.x,t.y,u))),s=Rn(o)??!1,l=!!t;l!==s&&_n(o,l),n&&!i&&((c=r.overrideCursor)==null||c.call(r,An))}function ho({cell:o,rect:t,relativePoint:e,renderData:i,rowData:r,rowIndex:n,event:s}){const l=In(i,e,s);return l.propagationStopped?{handled:!0,propagationStopped:!0,suppressGridDefault:l.suppressGridDefault}:Hn(i,e)?{handled:!0,propagationStopped:!1,suppressGridDefault:l.suppressGridDefault}:Ln(o,e,t,r,n,i)?{handled:!0,propagationStopped:!1,suppressGridDefault:l.suppressGridDefault}:{handled:!1,propagationStopped:!1,suppressGridDefault:l.suppressGridDefault}}function zn(o){const t=o.selection==="keep",e=o.cellClick==="stop",i=o.editor==="never",r=o.contextMenu==="keep-selection"?"manual-keep-selection":o.contextMenu==="none"?"none":"normal";return{suppressEarlyGridSelect:t,suppressExternalCellClick:e,suppressGridDefaultFor:{pointerdown:t,click:i,contextmenu:r!=="normal"},contextMenuMode:r,...o.editor==="open-on-click"?{editorRequest:{target:"self"}}:{}}}function Jc({decision:o,propagationStopped:t,suppressGridDefault:e}){const i=o.suppressGridDefaultFor.click||e,r={suppressExternalCellClick:o.suppressExternalCellClick||t,suppressGridDefaultForClick:i};return!i&&o.editorRequest&&(r.editorRequest=o.editorRequest),r}function On({renderData:o,relativePoint:t}){const e=(o==null?void 0:o.canvasRoot)instanceof yt?o.canvasRoot.getInteractionAtPoint(t.x,t.y):void 0;return e?{handled:!0,suppressEarlyGridSelect:zn(e).suppressEarlyGridSelect,interaction:e}:{handled:!1,suppressEarlyGridSelect:!1}}function fo(o={}){return{kind:L.GridCellKind.Custom,isMatch:t=>{var e;return((e=t.data)==null?void 0:e.kind)===Qe},needsHover:!0,needsHoverPosition:!0,onSelect:t=>{var h;const e=t.cell,i=t.bounds,r=Hi(t);if(!r)return;const n=Li(r,i),s=ke(t),l=Zt(s,i),c=jt(l,e),u=On({renderData:c,relativePoint:n}),d=t.location??[s.colIndex,s.rowIndex],a=u.interaction&&o.beginOrGetInteractionSession?o.beginOrGetInteractionSession({cell:d,relativePoint:n,interaction:u.interaction,source:"pointer",...t.button!==void 0?{button:t.button}:{}}):void 0;(a!=null&&a.decision.suppressEarlyGridSelect||u.suppressEarlyGridSelect)&&((h=t.preventDefault)==null||h.call(t))},onClick:t=>{var h,f;const e=t.cell,i=t.bounds,r=Hi(t);if(!r)return;const n=Li(r,i),s=ke(t),l=Zt(s,i),c=jt(l,e),u=t.location??[s.colIndex,s.rowIndex],a=((h=o.consumeCanvasClickResult)==null?void 0:h.call(o,{cell:u,relativePoint:n,...t.button!==void 0?{button:t.button}:{}}))??ho({cell:e,rect:i,relativePoint:n,renderData:c,rowData:t.row??t.rowData,rowIndex:s.rowIndex,event:t.event});a.suppressGridDefault&&((f=t.preventDefault)==null||f.call(t)),a.handled},draw:(t,e)=>{const{ctx:i,rect:r,theme:n}=t,{render:s}=e.data,l=t.cellFillColor!==void 0?{...n,bgCell:t.cellFillColor}:n,c=ke(t),u=Zt(c,r),d={hoverX:t.hoverX,hoverY:t.hoverY,row:t.row,rowData:t.rowData,event:t.event,frameTime:t.frameTime,requestAnimationFrame:t.requestAnimationFrame},a=jr(t.hoverX,t.hoverY,r)??En(d,r);i.save();const h=jt(u,e),f=s(i,r,l,a==null?void 0:a.x,a==null?void 0:a.y,{...d,canvasRoot:h==null?void 0:h.canvasRoot}),g=(f==null?void 0:f.hoveredAreas)??[];Bn(u,e,f);const v=(f==null?void 0:f.canvasRoot)??(h==null?void 0:h.canvasRoot);kn(v,a,d,t),Mn(e.data,a,g,v,t),i.restore()},onPaste:()=>{}}}const Qc=fo(),$e=new Map;function Nn(o){const t=ta(o),e=$e.get(t);if(e)return e;const r=Ys.renderToString(o).match(/<svg[\s\S]*?<\/svg>/);if(!r)return console.warn("Could not extract SVG from React icon component:",o.type),"";const n=r[0];return $e.set(t,n),n}function ta(o){const t=o.type,e=typeof t=="function"||typeof t=="object"?t.displayName||t.name||"Anonymous":String(t),{size:i,color:r,className:n}=o.props||{},s=JSON.stringify({size:i,color:r,className:n});return`${e}:${s}`}function wt(o){return m.isValidElement(o)}function mt(o){return typeof o=="string"?o:wt(o)?Nn(o):""}function ea(){$e.clear()}function ia(){return $e.size}const $i=o=>{if(o===void 0)return;if(typeof o=="number")return o;const t=o.trim();if(t==="100%")return"100%";const e=t.match(/^(-?\d+(?:\.\d+)?)px$/i);if(e)return Number(e[1]);const i=t.match(/^(-?\d+(?:\.\d+)?)rem$/i);if(i)return Number(i[1])*16;const r=Number(t);if(!Number.isNaN(r))return r},Cr={small:{radius:4,stroke:1.5},medium:{radius:4,stroke:1.5},big:{radius:6,stroke:2}};function oa(o,t,e,i,r,n,s,l,c,u,d=!1,a=!1){const f=s-0,v=Math.min(f-0,Ki),C=n==="auto"?v:n,x=e+0,y=(c==null?void 0:c.rowSize)||"medium",w=!i&&!r,F=Rt(a,{x:t,y:e,width:C,height:s}),E=vl(c,i,r,F,d),b=t+C*.5,P=x+f*.5,T=b-v*.5,B=P-v*.5;return o.roundedRect(t,x,C,f,Cr[y].radius,{fillStyle:E.bgColor,strokeStyle:E.borderColor,lineWidth:w?Cr[y].stroke:void 0}),ut(o,l,T,B,v,E.iconColor),{x:t,y:x,width:C,height:f}}const ra=28,na="default",sa="s",vr="pointer",la=20,Ui={indeterminateIcon:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke-linecap="round" stroke-width="2" stroke="currentColor" d="m5.09449,9.0315l8,0"></path></svg>',checkedIcon:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg" fill="none"><path fill="currentColor" d="m5.70711,8.15582c-0.39053,-0.39052 -1.02369,-0.39052 -1.41422,0c-0.39052,0.39053 -0.39052,1.02369 0,1.41422l3.70666,3.70666l6.71095,-6.70248c0.3908,-0.39027 0.3912,-1.02344 0.0009,-1.41421c-0.3903,-0.39077 -1.02344,-0.39117 -1.41421,-0.00089l-5.29674,5.29004l-2.29334,-2.29334z"></path></svg>'},ca=Object.values(Ui),aa={accentColor:"#1e88e5",accentFg:"#ffffff"};class ua extends bt{constructor(t,e,i=!1,r=!1,n){super(t),this.view=na,this.buttonSize=sa,this.isHovered=!1,this.useNewApi=!1,this.icon=e,this.checked=i,this.indeterminate=r,this.size=(n==null?void 0:n.size)??"auto",this.theme=n==null?void 0:n.theme,this.view=(n==null?void 0:n.view)??"primary",this.disabled=(n==null?void 0:n.disabled)??!1,super.style={...super.style,cursor:this.disabled?"auto":vr},!this.disabled&&(n!=null&&n.onClick)&&(this.onClick=s=>{var l;return(l=n.onClick)==null?void 0:l.call(n,s)})}set style(t){super.style={...super.style,...t}}get style(){const t=super.style;return t.cursor||(t.cursor=vr),t}measure(t){if(this.useNewApi){const e=it[this.buttonSize];this.rect.height=e.height,this.rect.width=e.height}else{const e=ha(this.size);this.rect.height=e.height,this.rect.width=e.width}}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect;oa(t,i,r,this.checked,this.indeterminate,n,s,this.icon,this.theme??aa,this.view,this.disabled,this.isHovered)}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}}function ha(o,t){const e=typeof o=="number"?o:ra,i=0,r=Qt,n=Math.min(e-r*2-te,la),s=typeof o=="number"?o:n+i*2;return{height:e,width:s,paddingX:i,paddingY:r,iconSize:n}}const da=({backgroundColor:o,__backgroundColorResolver:t},e)=>(t==null?void 0:t(e))??o,Ct=o=>{const t=e=>null;return t.__canvasType=o,t},fa=m.memo(({cellId:o,renderContent:t,nodeRegistry:e,onRegistryChange:i})=>{const r=t(),n=m.useRef(null);return m.useLayoutEffect(()=>{const s=e.current,l=n.current;l&&l!==o&&s.delete(l);const c=s.get(o),u=c!==void 0;s.set(o,r),u&&c!==r&&(i==null||i()),n.current=o},[o,r,e,i]),m.useLayoutEffect(()=>()=>{const s=e.current;n.current&&(s.delete(n.current),n.current=null)},[e]),null}),ga=Ct("Skeleton"),Ca=Ct("Container"),va=Ct("Text"),ma=Ct("Icon"),pa=Ct("Button"),ya=Ct("IconButton"),ba=Ct("EmbedIconButton"),Fa=Ct("Rect"),Sa=Ct("Badge"),wa=Ct("Checkbox"),xa=Ct("Link"),de={Container:Ca,Text:va,Icon:ma,Button:pa,IconButton:ya,EmbedIconButton:ba,Checkbox:wa,Rect:Fa,Badge:Sa,Skeleton:ga,Link:xa,icon:mt};function at(o,t){if(o)return function(e){o.call(this,e)}}function Ue({element:o,idPrefix:t="root",theme:e}){const i=[],r=Wn(o,t,0,i,e);if(i.length>0){const n=new Map;for(const{icon:s,size:l}of i){if(!s)continue;const c=n.get(l)??[];c.push(s),n.set(l,c)}n.forEach((s,l)=>{on(s,{size:l})})}return r}function Xi(o){return o==null?"":typeof o=="string"||typeof o=="number"?String(o):Array.isArray(o)?o.map(Xi).join(""):""}function mr(o,t,e){const i=o.fontMetrics,r=o.fonts;if(i===void 0||r===void 0)return{};const n=t??o.baseFontStyle,s=Object.keys(r).find(c=>r[c]===n);if(s===void 0)return{};const l=i[s];return l===void 0?{}:{fontSize:l.fontSize,...e===void 0?{lineHeightPx:l.lineHeightPx}:{}}}function Wn(o,t,e,i,r){if(!o||!m.isValidElement(o))throw new Error("Invalid element. Use Canvas.* components.");const n=o.type,s=n.__canvasType;if(!s)throw new Error(`Unknown canvas component. Use Canvas.* components. Got: ${(n==null?void 0:n.name)||n}`);const l=o.props,u=(o.key!=null?String(o.key):null)??e,d=l.id??`${t}-${s.toLowerCase()}-${u}`,a=g=>wt(g)?mt(g):g;if(s==="Icon"&&l.icon)i.push({icon:a(l.icon),size:l.size??16});else if(s==="IconButton"&&l.icon){const g=l.buttonSize??"s",{iconSize:v}=it[g];i.push({icon:a(l.icon),size:v})}else if(s==="EmbedIconButton"&&l.icon){const g=l.buttonSize??"s",v=l.overrideIconSize??it[g].iconSize;i.push({icon:a(l.icon),size:v})}else if(s==="Checkbox")ca.forEach(g=>{i.push({icon:a(g),size:20})});else if(s==="Button"){const g=l.size??"s",{iconSize:v}=it[g];l.leftIcon&&i.push({icon:a(l.leftIcon),size:v}),l.rightIcon&&i.push({icon:a(l.rightIcon),size:v})}else if(s==="Badge"){const g=l.size??"s",C={xs:10,s:12,m:14,l:16}[g]??12;l.leftIcon&&i.push({icon:a(l.leftIcon),size:C}),l.rightIcon&&i.push({icon:a(l.rightIcon),size:C})}const h=Aa(s,d,l,r);if(l.portalHoverEnabled&&(h.portalHoverEnabled=!0),l.tooltip!==void 0&&(h.tooltip=l.tooltip),l.autoTooltip!==void 0){const g=l.autoTooltip;(g===!0||typeof g=="object"&&g!==null&&g.enabled!==!1)&&(h.portalHoverEnabled=!0)}l.interaction!==void 0&&(h.interaction=zr(l.interaction)),typeof l.zIndex=="number"&&(h.zIndex=l.zIndex),l.style&&(h.style=l.style);const{children:f}=l;return f&&h instanceof gt&&m.Children.toArray(f).forEach((v,C)=>{if(m.isValidElement(v)){const x=Wn(v,d,C,i,r);h.addChild(x)}}),h}function Aa(o,t,e,i){switch(o){case"Container":{const r=e,{id:n,gap:s,columnGap:l,rowGap:c,position:u,left:d,top:a,right:h,bottom:f,zIndex:g,onClick:v,onMouseEnter:C,onMouseLeave:x,onMouseDown:y,backgroundColor:w,__backgroundColorResolver:F,portalHoverEnabled:E,...b}=r,P={...b,columnGap:l??s??0,rowGap:c??s??0},T=new gt(t,P,da(r,i));u&&(T.position=u),d!==void 0&&(T.left=d),a!==void 0&&(T.top=a),h!==void 0&&(T.right=h),f!==void 0&&(T.bottom=f);const B=at(v),O=at(C),rt=at(x),G=at(y);return B&&(T.onClick=B),O&&(T.onMouseEnter=O),rt&&(T.onMouseLeave=rt),G&&(T.onMouseDown=G),T}case"Text":{const{children:r,font:n,color:s,wordWrap:l,lineHeight:c,overflow:u,textOverflow:d,ellipsis:a,maxLines:h,autoTooltip:f,position:g,left:v,top:C,right:x,bottom:y,portalHoverEnabled:w}=e,F=Xi(r),E=i.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';let b;n?b=/["']|sans-serif|serif|monospace/i.test(n)?n:`${n} ${E}`:b=i.baseFontStyle?`${i.baseFontStyle} ${E}`:`13px ${E}`;const P=mr(i,n,c),T=new ao(t,F,{font:b,...P,color:s,wordWrap:l,lineHeight:c,overflow:u,textOverflow:d,ellipsis:a,maxLines:h,autoTooltip:f});return g&&(T.position=g),v!==void 0&&(T.left=v),C!==void 0&&(T.top=C),x!==void 0&&(T.right=x),y!==void 0&&(T.bottom=y),T}case"Icon":{const{icon:r,size:n,color:s,backgroundColor:l,position:c,left:u,top:d,right:a,bottom:h,onClick:f,onMouseEnter:g,onMouseLeave:v,onMouseDown:C}=e,x=wt(r)?mt(r):r,y=new dn(t,x,{size:n,color:s});l&&(y.backgroundColor=l),c&&(y.position=c),u!==void 0&&(y.left=u),d!==void 0&&(y.top=d),a!==void 0&&(y.right=a),h!==void 0&&(y.bottom=h);const w=at(f),F=at(g),E=at(v),b=at(C);return w&&(y.onClick=w),F&&(y.onMouseEnter=F),E&&(y.onMouseLeave=E),b&&(y.onMouseDown=b),y}case"Button":{const{children:r,variant:n,view:s,size:l,leftIcon:c,rightIcon:u,disabled:d,position:a,left:h,top:f,right:g,bottom:v,onClick:C}=e,x=typeof r=="string"?r:"",y=wt(c)?mt(c):c,w=wt(u)?mt(u):u,F=new hn(t,x,{variant:n,view:s,size:l,leftIcon:y,rightIcon:w,disabled:d,theme:i});if(a&&(F.position=a),h!==void 0&&(F.left=h),f!==void 0&&(F.top=f),g!==void 0&&(F.right=g),v!==void 0&&(F.bottom=v),!d){const E=at(C);E&&(F.onClick=E)}return F}case"EmbedIconButton":case"IconButton":{const{icon:r,size:n,variant:s,view:l,buttonSize:c,overrideSquareSize:u,overrideIconSize:d,disabled:a,position:h,left:f,top:g,right:v,bottom:C,onClick:x}=e,y=wt(r)?mt(r):r,w=o==="IconButton"?fn:Bi,F=new w(t,y,{size:n,variant:s,view:l,buttonSize:c,overrideSquareSize:u,overrideIconSize:d,disabled:a});if(F instanceof Bi){const{iconColor:E,iconColorHovered:b}=e;E!==void 0&&(F.iconColor=E),b!==void 0&&(F.iconColorHovered=b)}if(h&&(F.position=h),f!==void 0&&(F.left=f),g!==void 0&&(F.top=g),v!==void 0&&(F.right=v),C!==void 0&&(F.bottom=C),!a){const E=at(x);E&&(F.onClick=E)}return F}case"Checkbox":{const{checked:r,indeterminate:n,size:s="auto",theme:l,view:c,buttonSize:u,disabled:d,position:a,left:h,top:f,right:g,bottom:v,onClick:C}=e,x=mt(r?Ui.checkedIcon:Ui.indeterminateIcon),y=new ua(t,x,r,n,{size:s,theme:l??i,view:c,buttonSize:u,disabled:d});if(a&&(y.position=a),h!==void 0&&(y.left=h),f!==void 0&&(y.top=f),g!==void 0&&(y.right=g),v!==void 0&&(y.bottom=v),!d){const w=at(C);w&&(y.onClick=w)}return y}case"Rect":{const{color:r,borderColor:n,borderWidth:s,position:l,left:c,top:u,right:d,bottom:a}=e,h=new gn(t,r);return n&&(h.borderColor=n),s&&(h.borderWidth=s),l&&(h.position=l),c!==void 0&&(h.left=c),u!==void 0&&(h.top=u),d!==void 0&&(h.right=d),a!==void 0&&(h.bottom=a),h}case"Badge":{const{text:r,view:n,size:s,transparent:l,clear:c,leftIcon:u,rightIcon:d,customColor:a,customBackgroundColor:h,position:f,left:g,top:v,right:C,bottom:x,portalHoverEnabled:y,pilled:w}=e,F=wt(u)?mt(u):u,E=wt(d)?mt(d):d,b=new un(t,r,{view:n,size:s,transparent:l,clear:c,leftIcon:F,rightIcon:E,pilled:w,customColor:a,customBackgroundColor:h,theme:i});return f&&(b.position=f),g!==void 0&&(b.left=g),v!==void 0&&(b.top=v),C!==void 0&&(b.right=C),x!==void 0&&(b.bottom=x),b}case"Skeleton":{const{width:r,height:n,roundness:s,lighter:l,customGradientColor:c,animated:u,shimmerDuration:d,style:a,portalHoverEnabled:h}=e,f=$i(r),g=$i(n),v={...a,...f!==void 0?{width:f}:null,...g!==void 0?{height:g}:null},C=new bn(t,{roundness:s,lighter:l,customGradientColor:c,shimmerDuration:d,animated:u});return C.style=v,C}case"Link":{const{children:r,href:n,target:s,view:l,disabled:c,font:u,color:d,wordWrap:a,lineHeight:h,overflow:f,textOverflow:g,ellipsis:v,maxLines:C,position:x,left:y,top:w,right:F,bottom:E,onClick:b,portalHoverEnabled:P}=e,T=Xi(r),B=i.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';let O;u?O=/["']|sans-serif|serif|monospace/i.test(u)?u:`${u} ${B}`:O=i.baseFontStyle?`${i.baseFontStyle} ${B}`:`13px ${B}`;const rt=mr(i,u,h),G=new Fn(t,T,{font:O,...rt,color:d,wordWrap:a,lineHeight:h,overflow:f,textOverflow:g,ellipsis:v,maxLines:C,href:n,target:s,view:l,disabled:c,theme:i});if(x&&(G.position=x),y!==void 0&&(G.left=y),w!==void 0&&(G.top=w),F!==void 0&&(G.right=F),E!==void 0&&(G.bottom=E),!c){const Q=at(b);Q&&G.setOnClick(Q)}return G}default:throw new Error(`Unknown canvas component type: ${o}`)}}const Ea='400 normal 1rem/1.25rem "SB Sans Text", sans-serif, Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif',Ta="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",Da=30,Ia=50,Ha=3;async function Gn(){return typeof document>"u"||!document.fonts?Promise.resolve():document.fonts.ready.then(()=>{})}function $n(o={}){const{testFont:t=Ea,testText:e=Ta,maxChecks:i=Da,checkInterval:r=Ia,stableThreshold:n=Ha}=o;return new Promise(s=>{if(typeof document>"u"){s();return}const c=document.createElement("canvas").getContext("2d");if(!c){s();return}let u=-1,d=0,a=0;const h=()=>{c.font=t;const{width:f}=c.measureText(e);f!==u?(u=f,d=0):d+=1,a+=1,d>=n||a>=i?s():setTimeout(h,r)};h()})}function Un(o){return Gn().then(()=>$n(o))}function go({dataEditorRef:o,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i}){const r=o.current;if(!r)return;const n=Math.min(30,t),s=e,l=[];for(let c=0-i;c<n;c+=1)for(let u=0;u<s;u+=1)l.push({cell:[u,c]});l.length>0&&r.updateCells(l)}function Co(o){let t=null;return()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,o()}))}}function La(){const o=m.useRef(null),t=m.useCallback(()=>(o.current||(o.current=new Nr),o.current),[]);return{registry:t(),getRegistry:t}}function Xn({dataEditorRef:o,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i}){m.useLayoutEffect(()=>{const r=Co(()=>{wc(),go({dataEditorRef:o,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i})});Un().then(r)},[o,t,e,i])}function Vn({dataEditorRef:o,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i}){m.useEffect(()=>{const r=Co(()=>{go({dataEditorRef:o,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i})});return tn(r)},[o,t,e,i])}L.GridCellKind.Text;const Xe=(o,t)=>({kind:L.GridCellKind.Text,data:o,displayData:o,allowOverlay:!0,readonly:!0,...t}),qt=o=>{const{data:t,...e}=o??{};return{kind:L.GridCellKind.Text,data:"",displayData:"",allowOverlay:!0,readonly:!0,...e}};function Yn(o){const t=o;return!!(t!=null&&t.kind)}function Pa(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)}function vo(o){return typeof o!="object"&&!Array.isArray(o)||o===null}function qn(o){return o==null||typeof o=="boolean"}const ti=o=>{if(!o||!m.isValidElement(o))return!1;const t=o.type;return!!(t!=null&&t.__canvasType)},mo=o=>typeof o=="string",Vi=o=>mo(o)?!0:ti(o),Ba=o=>mo(o)?!0:ti(o),pr=({jsxElement:o,canvasCellCache:t,cellInfo:e,options:i})=>{let r=null;if(Yn(o))return{...o,...i};if(vo(o))return qn(o)?qt(i):Xe(String(o),i);if(!ti(o)){const x="передан НЕ CanvasEl";return Xe(x,{...i,data:x})}const{colInd:n,rowInd:s,row:l,column:c}=e,{id:u}=c,d=i.getPortalEventTarget;let a=null;const h=`cell-${n}-${s}`,f=(x,y,w,F,E,b)=>{let P=(b==null?void 0:b.canvasRoot)instanceof yt?b.canvasRoot:a;{if(!o)return{};const O=Ue({element:o,idPrefix:`cell-${n}-${s}-${u}`,theme:w});P?(P.setRootNode(O),P.setOriginId(h)):P=new yt(O,h),a=P}if(!P)return{};const T=F!==void 0&&E!==void 0?{x:F,y:E}:void 0;P.rootNode.style={width:y.width,height:y.height},r||(r=x.canvas.getBoundingClientRect());const B={x:r.left+y.x,y:r.top+y.y,width:y.width,height:y.height};return P.setPortalEventTarget((d==null?void 0:d())??null),P.setTooltipContext({column:e.column,row:e.row,ctxs:e.ctxs,refTable:i.refTable}),P.render(x,y,T,B,{frameTime:b==null?void 0:b.frameTime,requestAnimationFrame:b==null?void 0:b.requestAnimationFrame}),a=P,{canvasRoot:P}},{data:g,...v}=i,C=c.copyData?typeof c.copyData=="function"?c.copyData(l):c.copyData:g;return Sn(f,void 0,C,v)},po=(o,t,e)=>o?t>=o.x&&t<o.x+o.width&&e>=o.y&&e<o.y+o.height:!1,_a=o=>{const t=o.findIndex(e=>!e.isServiceColumn);return t===-1?o.length:t},Ra=(o,t)=>{if(!o)return;const e=Math.max(o.x,t),i=Math.max(0,o.x+o.width-e);if(!(i<=0||o.height<=0))return{x:e,y:o.y,width:i,height:o.height}};function Kn({cellsSelectionMode:o,selection:t,baseTheme:e,serviceColumnsCount:i,activeDataRange:r,outlineRange:n,checkboxSelectedRowIndexes:s,errorCellRanges:l,highlightRegionsExternal:c}){return m.useMemo(()=>{const u=[...c??[]],d=t.current,a=()=>{if(l!=null&&l.length)for(const C of l)u.push({color:e.errorOutlineColor,range:C,style:"solid-outline"})};if(!d||o==="disabled")return a(),u.length>0?u:void 0;const[,h]=d.cell,g=(s==null?void 0:s.has(h))??!1?e.selectionActiveCheckboxBg:e.selectionActiveBg,v=e.selectionServiceActiveBg;return r&&i>0&&u.push({color:v,range:{x:0,y:r.y,width:i,height:r.height},style:"no-outline"}),r&&o==="cell"&&r.width===1&&r.height===1&&u.push({color:g,range:r,style:"no-outline"}),n&&u.push({color:e.accentColor,range:n,style:"solid-outline"}),a(),u.length>0?u:void 0},[o,t,e.selectionActiveBg,e.selectionActiveCheckboxBg,e.selectionServiceActiveBg,e.errorOutlineColor,e.accentColor,i,r,n,s,l,c])}function Zn({baseRegions:o,selectedColumnIndexes:t,headerSelectedRowIndexes:e,activeRow:i,activeRange:r,selectionRangeStack:n,checkboxAvailableRowIndexes:s,totalRows:l,firstDataCol:c,columnsCount:u,theme:d}){return m.useMemo(()=>{const a=t.length>0,h=e.length>0,f=i!==void 0,g=((n==null?void 0:n.length)??0)>0;if(!a&&!h&&!f&&!g)return o;const v=u-c,C=[...o??[]],x=(y,w)=>{const[F,...E]=[...y].sort((B,O)=>B-O);if(F===void 0)return;let b=F,P=F;const T=(B,O)=>{C.push({color:d.accentColor,range:w(B,O),style:"solid-outline"})};for(const B of E)B===P+1||(T(b,P),b=B),P=B;T(b,P)};if(a){c>0&&C.push({color:d.selectionServiceActiveBg,range:{x:0,y:0,width:c,height:l},style:"no-outline"});for(const y of t)C.push({color:d.selectionActiveBg,range:{x:y,y:0,width:1,height:l},style:"no-outline"});x(t,(y,w)=>({x:y,y:0,width:w-y+1,height:l}))}if(h&&v>0){if(c>0)for(const y of e)C.push({color:d.selectionServiceActiveBg,range:{x:0,y,width:c,height:1},style:"no-outline"});for(const y of e)C.push({color:d.selectionActiveBg,range:{x:c,y,width:v,height:1},style:"no-outline"});x(e,(y,w)=>({x:c,y,width:v,height:w-y+1}))}if(i!==void 0&&v>0){const y=s!=null&&s.has(i)?d.selectionActiveCheckboxBg:d.selectionCheckboxBg,w=(E,b)=>{b>0&&C.push({color:y,range:{x:E,y:i,width:b,height:1},style:"no-outline"})};if(!(r&&i>=r.y&&i<r.y+r.height))w(c,v);else{const E=Math.max(r.x,c),b=r.x+r.width;w(c,E-c),w(b,u-b)}}if(g&&n&&c>0){const y=new Set;for(const w of n){const F=Math.max(w.x,c);if(!(w.x+w.width-F<=0||w.height<=0))for(let b=w.y;b<w.y+w.height;b+=1)y.add(b)}for(const w of y)C.push({color:d.selectionServiceActiveBg,range:{x:0,y:w,width:c,height:1},style:"no-outline"})}return C},[o,t,e,i,r,n,s,l,c,u,d.selectionActiveBg,d.selectionActiveCheckboxBg,d.selectionCheckboxBg,d.selectionServiceActiveBg,d.accentColor])}const Be={columns:L.CompactSelection.empty(),rows:L.CompactSelection.empty(),current:void 0};function jn({cellsSelectionMode:o,gridSelection:t,onGridSelectionChange:e,onSelectionEmit:i}){const[r,n]=m.useState(Be),s=t!==void 0,l=t??r,c=m.useCallback(a=>{s?e==null||e(a):n(a),i==null||i(a)},[s,e,i]),u=m.useCallback(()=>{s?e==null||e(Be):n(Be),i==null||i(Be)},[s,e,i]),d=m.useMemo(()=>o==="range-cell"?"rect":o==="multi-range-cell"?"multi-rect":o==="disabled"?"none":"cell",[o]);return{selection:l,handleGridSelectionChange:c,handleSelectionCleared:u,rangeSelect:d}}const Vt=new Set,yr=({start:o,length:t})=>{const e=new Set;for(let i=0;i<t;i+=1)e.add(o+i);return e};function Jn({columns:o,selection:t,cellsSelectionMode:e,checkboxSelectedRowIndexes:i}){return m.useMemo(()=>{const r=t.current,n=_a(o);if(!(e!=="disabled"&&r!==void 0)||!r)return{hasAnyActiveSelection:!1,firstDataColumnIndex:n,leadingServiceColumnsCount:n,activeRows:Vt,activeColumns:Vt,activeDataRange:void 0,isSingleCellCustomHighlight:!1,outlineRange:void 0,isServiceColumn:h=>{var f;return!!((f=o[h])!=null&&f.isServiceColumn)},isActiveRow:h=>!1,isCheckboxSelectedRow:h=>(i==null?void 0:i.has(h))??!1,isActiveDataCell:(h,f)=>!1,isActiveHeaderColumn:h=>!1};const l=Ra(r.range,n),c=l!==void 0,u=e==="cell"&&l!==void 0&&l.width===1&&l.height===1;if(!c)return{hasAnyActiveSelection:!1,firstDataColumnIndex:n,leadingServiceColumnsCount:n,activeRows:Vt,activeColumns:Vt,activeDataRange:void 0,isSingleCellCustomHighlight:!1,outlineRange:void 0,isServiceColumn:h=>{var f;return!!((f=o[h])!=null&&f.isServiceColumn)},isActiveRow:h=>!1,isCheckboxSelectedRow:h=>(i==null?void 0:i.has(h))??!1,isActiveDataCell:(h,f)=>!1,isActiveHeaderColumn:h=>!1};const d=l!=null&&l.height&&l.height>0?yr({start:l.y,length:l.height}):Vt,a=l!=null&&l.width&&l.width>0?yr({start:l.x,length:l.width}):Vt;return{hasAnyActiveSelection:c,firstDataColumnIndex:n,leadingServiceColumnsCount:n,activeRows:d,activeColumns:a,activeDataRange:l,isSingleCellCustomHighlight:u,outlineRange:u?l:void 0,isServiceColumn:h=>{var f;return!!((f=o[h])!=null&&f.isServiceColumn)},isActiveRow:h=>d.has(h),isCheckboxSelectedRow:h=>(i==null?void 0:i.has(h))??!1,isActiveDataCell:(h,f)=>po(l,h,f),isActiveHeaderColumn:h=>o[h]?a.has(h):!1}},[o,e,i,t])}function ka({highlightActiveRow:o,onHighlightActiveRowChange:t,isHighlightActiveRowControlled:e}){const[i,r]=m.useState(void 0),n=e??t!==void 0,s=n?o:i,l=m.useCallback(c=>{n||r(c),t==null||t(c)},[n,t]);return{activeRow:s,commitActiveRow:l}}function Ma({columns:o}){const[t,e]=m.useState(()=>L.CompactSelection.empty()),i=m.useMemo(()=>t.toArray().filter(u=>{var d;return!((d=o[u])!=null&&d.isServiceColumn)}),[t,o]),r=m.useMemo(()=>new Set(i),[i]),n=m.useRef(void 0),[s,l]=m.useState(!1),c=m.useCallback(()=>{e(L.CompactSelection.empty())},[]);return{selectedColumns:t,setSelectedColumns:e,selectedColumnIndexes:i,selectedColumnSet:r,lastSelectedColumnRef:n,isNativeColumnSelection:s,setIsNativeColumnSelection:l,clearColumnSelection:c}}function za(){const[o,t]=m.useState(()=>L.CompactSelection.empty()),e=m.useMemo(()=>o.toArray(),[o]),i=m.useRef(o);i.current=o;const r=m.useRef(!1),n=m.useRef(L.CompactSelection.empty()),s=m.useRef(!1);m.useEffect(()=>{const c=d=>{r.current=d.ctrlKey||d.metaKey,n.current=i.current,s.current=!0},u=()=>{s.current=!1};return window.addEventListener("pointerdown",c,!0),window.addEventListener("pointerup",u,!0),()=>{window.removeEventListener("pointerdown",c,!0),window.removeEventListener("pointerup",u,!0)}},[]);const l=m.useCallback(()=>{t(L.CompactSelection.empty())},[]);return{selectedRows:o,setSelectedRows:t,headerSelectedRowIndexes:e,selectedRowsRef:i,ctrlGestureRef:r,ctrlBaseRowsRef:n,pointerGestureRef:s,clearRowSelection:l}}function Qn({columns:o,selection:t,cellsSelectionMode:e,highlightActiveType:i,enableColumnSelection:r,enableRowSelection:n,enableSelectAll:s,leadingServiceColumnsCount:l,dataRowCount:c,handleGridSelectionChange:u,handleSelectionCleared:d,onSelectionEmit:a,highlightActiveRow:h,onHighlightActiveRowChange:f,isHighlightActiveRowControlled:g}){const{selectedColumns:v,setSelectedColumns:C,selectedColumnIndexes:x,selectedColumnSet:y,lastSelectedColumnRef:w,isNativeColumnSelection:F,setIsNativeColumnSelection:E}=Ma({columns:o}),{setSelectedRows:b,headerSelectedRowIndexes:P,ctrlGestureRef:T,ctrlBaseRowsRef:B,pointerGestureRef:O}=za(),{activeRow:rt,commitActiveRow:G}=ka({highlightActiveRow:h,onHighlightActiveRowChange:f,isHighlightActiveRowControlled:g}),Q=m.useMemo(()=>o.findIndex(M=>M.isServiceColumn&&M.id==="row-markers"),[o]),kt=m.useCallback(M=>{const{current:N}=M;if(!N)return M;const z=l,{range:X}=N;if(X.x>=z)return M;const Y=X.x+X.width-z;return Y<=0?{current:void 0,rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()}:{...M,current:{...N,cell:[Math.max(N.cell[0],z),N.cell[1]],range:{...X,x:z,width:Y}}}},[l]),ei=m.useCallback(M=>{const N=M.current;if(n&&Q>=0&&N&&N.cell[0]===Q){const X=l,Y=N.range.y,nt=Y+Math.max(N.range.height,1);if(T.current){const W=nt-Y<=1;let tt=B.current;if(tt.length===0&&t.current&&t.current.cell[0]===Q){const dt=t.current.range;tt=L.CompactSelection.empty().add([dt.y,dt.y+Math.max(dt.height,1)]),B.current=tt}let st;W?st=tt.hasIndex(Y)?tt.remove(Y):tt.add(Y):st=tt.add([Y,nt]),C(L.CompactSelection.empty()),b(st),G(void 0),E(!1),u({...M,current:{...N,range:{x:X,y:N.range.y,width:0,height:N.range.height}}}),a==null||a({current:void 0,rows:st,columns:L.CompactSelection.empty()});return}const ht=Math.max(o.length-X,0);C(L.CompactSelection.empty()),b(L.CompactSelection.empty()),G(void 0),E(!1),u({...M,current:{...N,range:{x:X,y:N.range.y,width:ht,height:N.range.height}}});return}const z=kt(M);(z.current!==void 0||z.rows.length>0)&&(C(L.CompactSelection.empty()),b(L.CompactSelection.empty())),E(!1),i==="row"?O.current&&z.current&&G(z.current.cell[1]):G(void 0),u(z)},[o,t,u,kt,Q,n,l,i,a,G,T,B,O,C,b,E]),ii=m.useCallback(()=>{C(L.CompactSelection.empty()),b(L.CompactSelection.empty()),G(void 0),E(!1),d()},[d,G,C,b,E]),ee=m.useMemo(()=>{var N;const M=new Set(x);if(F&&t.current){const{x:z,width:X}=t.current.range;for(let Y=z;Y<z+X;Y+=1)(N=o[Y])!=null&&N.isServiceColumn||M.add(Y)}return Array.from(M).sort((z,X)=>z-X).map(z=>{var X;return(X=o[z])==null?void 0:X.id}).filter(z=>!!z)},[x,F,t,o]),Ht=(e==="range-cell"||e==="multi-range-cell")&&!F&&!(t.current!==void 0&&t.current.cell[0]<l),oi=m.useCallback((M,N)=>{if(s&&Q>=0&&M===Q&&e!=="disabled"){const W=l,tt=Math.max(o.length-W,0);if(tt===0||c===0)return;C(L.CompactSelection.empty()),b(L.CompactSelection.empty()),G(void 0),E(!0),u({current:{cell:[W,0],range:{x:W,y:0,width:tt,height:c},rangeStack:[]},rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()});return}if(!r)return;const z=o[M];if(!z||z.isServiceColumn)return;const X=N.shiftKey;if(N.ctrlKey||N.metaKey){let W=v;if(W.length===0&&F&&t.current){const st=t.current.range;W=W.add([st.x,st.x+st.width])}const tt=W.hasIndex(M)?W.remove(M):W.add(M);w.current=M,C(tt),b(L.CompactSelection.empty()),G(void 0),E(!1),u({current:void 0,rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()}),a==null||a({current:void 0,rows:L.CompactSelection.empty(),columns:tt});return}let nt,ht;X&&w.current!==void 0?(nt=Math.min(w.current,M),ht=Math.max(w.current,M)):(nt=M,ht=M,w.current=M),C(L.CompactSelection.empty()),b(L.CompactSelection.empty()),G(void 0),E(!0),u({current:{cell:[nt,0],range:{x:nt,y:0,width:ht-nt+1,height:c},rangeStack:[]},rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()})},[r,s,Q,e,l,o,t,F,v,c,u,a,G,w,C,b,E]),Ce=m.useCallback(M=>{const N=new Set(M),z=o.map((W,tt)=>!W.isServiceColumn&&N.has(W.id)?tt:-1).filter(W=>W>=0);if(b(L.CompactSelection.empty()),G(void 0),z.length===0){C(L.CompactSelection.empty()),E(!1),u({current:void 0,rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()});return}const X=z[0],Y=z[z.length-1];if(X===void 0||Y===void 0)return;const nt=Y-X===z.length-1;if(w.current=Y,nt){C(L.CompactSelection.empty()),E(!0),u({current:{cell:[X,0],range:{x:X,y:0,width:Y-X+1,height:c},rangeStack:[]},rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()});return}let ht=L.CompactSelection.empty();z.forEach(W=>{ht=ht.add(W)}),C(ht),E(!1),u({current:void 0,rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()})},[o,c,u,C,b,E,G,w]);return{selectedColumnIndexes:x,selectedColumnKeysAll:ee,selectColumnsByKeys:Ce,selectedColumnSet:y,headerSelectedRowIndexes:P,activeRow:rt,numberingColumnIndex:Q,drawFocusRing:Ht,selectColumnFromHeader:oi,handleGridSelectionWithColumnReset:ei,handleSelectionClearedWithColumns:ii}}function Oa(o,t,e,i){const r=performance.now();function n(s){const l=s-r,c=Math.min(l/i,1),u=t+(e-t)*c;o(Math.round(u)),c<1&&requestAnimationFrame(n)}requestAnimationFrame(n)}const Na=o=>{const t=typeof o=="number",[e,i]=m.useState(()=>t?o:56);return m.useEffect(()=>{t&&Oa(i,e,o,300)},[o]),t?e:o};function ts({cell:o,glideCell:t,rect:e,renderData:i,relativePoint:r,mouseArgs:n}){const s=(i==null?void 0:i.canvasRoot)instanceof yt?i.canvasRoot.getInteractionAtPoint(r.x,r.y):void 0;if(s)return{cell:o,glideCell:t,rect:e,renderData:i,relativePoint:r,interaction:s,...n?{mouseArgs:n}:{}}}function Wa({dataEditor:o,getCellContent:t,clientX:e,clientY:i,nativeEvent:r}){const n=o==null?void 0:o.getMouseArgsForPosition(e,i,r);if(!n||n.kind!=="cell")return;const s=[n.location[0],n.location[1]],l=t(s);if(!uo(l))return;const c=n.bounds,u=Zt({colIndex:s[0],rowIndex:s[1]},c),d=jt(u,l),a={x:n.localEventX,y:n.localEventY};return ts({cell:s,mouseArgs:n,glideCell:l,rect:c,renderData:d,relativePoint:a})}function Ga({eventTarget:o,dataEditorRef:t,getCellContent:e,interactionSessionStore:i,onCellContextMenuExternal:r}){m.useEffect(()=>{if(!o)return;const n=s=>{var g;if(!(s instanceof MouseEvent))return;const l=s;if(l.clientX===0&&l.clientY===0)return;const c=Wa({dataEditor:t.current,getCellContent:e,clientX:l.clientX,clientY:l.clientY,nativeEvent:l});if(!c)return;const{cell:u,interaction:d,mouseArgs:a,relativePoint:h}=c,f=i.beginOrGet({cell:u,relativePoint:h,interaction:d,button:l.button,source:"contextmenu"});if(f.decision.contextMenuMode!=="normal"){if(i.consumePhase(f,"contextmenu-capture"),l.stopPropagation(),(g=l.stopImmediatePropagation)==null||g.call(l),f.decision.contextMenuMode==="none"){l.cancelable&&l.preventDefault();return}!a||!r||r(u,{...a,preventDefault:()=>{l.cancelable&&l.preventDefault()}})}};return o.addEventListener("contextmenu",n,!0),()=>{o.removeEventListener("contextmenu",n,!0)}},[t,o,e,i,r])}const $a=250;function Ua(o){return m.useCallback((t,e)=>{const i=o.consumeEditorRequest(t,$a);return!i||i.target!=="self"?e:{...e,activationBehaviorOverride:"single-click"}},[o])}const ze=350;function br(o){return Math.round(o)}function Xa({cell:o,relativePoint:t,button:e}){return[o[0],o[1],e??"unknown",br(t.x),br(t.y)].join(":")}function Ve(o,t){return o[0]===t[0]&&o[1]===t[1]}function es(o,t){return Math.abs(o.x-t.x)<=1&&Math.abs(o.y-t.y)<=1}function Va(o,t){return!Ve(o.cell,t.cell)||o.button!==void 0&&t.button!==void 0&&o.button!==t.button?!1:es(o.relativePoint,t.relativePoint)}function Ya(o,t){return Date.now()-o.startedAt>(t.maxAgeMs??ze)||!Ve(o.cell,t.cell)||o.button!==void 0&&t.button!==void 0&&o.button!==t.button?!1:es(o.relativePoint,t.relativePoint)}function qa(){let o,t=1;const e=i=>{if(!(!o||!Ya(o,i)))return o};return{beginOrGet:i=>{const r=e(i);return r||(o={id:t++,key:Xa(i),cell:i.cell,relativePoint:i.relativePoint,interaction:i.interaction,decision:zn(i.interaction),consumedPhases:new Set,startedAt:i.startedAt??Date.now(),source:i.source,...i.button!==void 0?{button:i.button}:{}},o)},findMatching:e,getCurrent:()=>o,storeClickResult:(i,r)=>{i.clickResult=r},consumeClickResult:i=>{const r=o;if(!(r!=null&&r.clickResult))return;if(!Va(r,i)){delete r.clickResult;return}const n=r.clickResult;return delete r.clickResult,r.consumedPhases.add("renderer-click"),n},consumePhase:(i,r)=>i.consumedPhases.has(r)?!1:(i.consumedPhases.add(r),!0),armEditorRequest:(i,r)=>{var n;(n=i.editorRequest)!=null&&n.consumed||(i.editorRequest={target:r.target,armedAt:Date.now()})},consumeEditorRequest:(i,r=ze)=>{const n=o;if(!n)return;const s=n.editorRequest;if(!(s!=null&&s.consumed)&&s){if(Date.now()-s.armedAt>r){o=void 0;return}if(Ve(n.cell,i))return s.consumed=!0,n.consumedPhases.add("editor-activation"),s}},isMatchingRecent:(i,r,n=ze)=>{const s=o;return!s||!s.consumedPhases.has(i)?!1:Date.now()-s.startedAt<=n&&Ve(s.cell,r)},clearStale:(i=ze)=>{o&&Date.now()-o.startedAt>i&&(o=void 0)},clear:()=>{o=void 0}}}function Ka(){const o=m.useMemo(()=>qa(),[]),t=m.useCallback(i=>o.beginOrGet(i),[o]),e=m.useCallback(i=>o.consumeClickResult(i),[o]);return{interactionSessionStore:o,beginOrGetInteractionSession:t,consumeCanvasClickResult:e}}function Za(o={}){const t=m.useMemo(()=>!0,[]);return m.useMemo(()=>{const e=[];return t&&e.push(fo({beginOrGetInteractionSession:o.beginOrGetInteractionSession,consumeCanvasClickResult:o.consumeCanvasClickResult})),e.length>0?e:void 0},[t,o.beginOrGetInteractionSession,o.consumeCanvasClickResult])}const Si={glideScroller:"dvn-scroller",glideTable:"gdg-table",glideUnderlay:"dvn-underlay"};function is(o){const t=(o==null?void 0:o.querySelector(`.${Si.glideTable}`))??null,e=(t==null?void 0:t.querySelector(`.${Si.glideScroller}`))??null,i=(t==null?void 0:t.querySelector(`.${Si.glideUnderlay}`))??null;return{container:t,scroller:e,underlay:i}}const Fr="[useGlideElements]";function ja(o,t){const[e,i]=m.useState(null),[r,n]=m.useState(null),[s,l]=m.useState(null),c=m.useRef(null);m.useEffect(()=>{const d=o==null?void 0:o.current;if(Kt.tableDebug(Fr,"useEffect fired",{hasWrapper:!!d,fullScreened:t}),!d)return;const a=()=>{const{container:f,scroller:g,underlay:v}=is(d);return Kt.tableDebug(Fr,"tryFind",{containerFound:!!f,scrollerFound:!!g,underlayFound:!!v}),f?(i(C=>C===f?C:f),n(C=>C===g?C:g),l(C=>C===v?C:v),c.current&&(c.current.disconnect(),c.current=null),!0):!1},h=requestAnimationFrame(()=>{if(a())return;const f=new MutationObserver(()=>{a()});f.observe(d,{childList:!0,subtree:!0}),c.current=f});return()=>{cancelAnimationFrame(h),c.current&&(c.current.disconnect(),c.current=null),i(null),n(null),l(null)}},[o,t]);const u=m.useCallback(d=>e?_e.createPortal(d,e):null,[e]);return{glideContainer:e,glideScroller:r,glideUnderlay:s,isReady:!!e,renderInContainer:u}}function Ja(o){const t=document.createElement("div");t.style.cssText="position:fixed;left:0;top:0;width:0;height:0;pointer-events:none;visibility:hidden",o.appendChild(t);const e=t.getBoundingClientRect();return o.removeChild(t),{x:e.left,y:e.top}}function Qa(o,t){m.useEffect(()=>{if(!t)return;const e=o.current;if(!e)return;const i=Kt.throttleWithLastCall(()=>{const{x:r,y:n}=Ja(e);e.style.setProperty("--gdg-portal-offset-x",`${r}px`),e.style.setProperty("--gdg-portal-offset-y",`${n}px`)},100);return i(),window.addEventListener("resize",i),e.addEventListener("resize",i),()=>{window.removeEventListener("resize",i),e.removeEventListener("resize",i)}},[o,t])}function tu(o,t){const{columnsLast:e,rows:i,ctxs:r,refTable:n,theme:s,portalEventTargetRef:l,externalOnItemHovered:c,onHoverRowChange:u}=o,d=m.useRef(null),a=m.useCallback(f=>{const g=d.current;d.current=null,fe({visible:!1,x:0,y:0,width:0,height:0,source:"cell",originId:g??void 0,nodeId:g??void 0},f,!0)},[]);return m.useCallback(f=>{var x,y,w;c==null||c(f),u==null||u(f.kind==="cell"?f.location[1]:void 0);const g=(l==null?void 0:l.current)??null,v=(x=f.location)==null?void 0:x[0],C=v!=null?e[v]:void 0;if(f.kind==="header"){if(!(C!=null&&C.headerCellTooltip)){a(g);return}const F=`header-tooltip-${v}`;d.current===F||a(g);const b=(y=t.current)==null?void 0:y.getBounds(v,-1);if(!b)return;d.current=F,fe({visible:!0,x:b.x,y:b.y,width:b.width,height:b.height,source:"header",originId:F,nodeId:F,priority:0,tooltipContext:{column:C,ctxs:r,refTable:n,colInd:v,theme:s}},g);return}if(f.kind==="cell"){const F=f.location[1],E=i[F];if(!C||!E||!C.cellTooltip){a(g);return}const b=`col-tooltip-${v}-${F}`;d.current===b||a(g);const T=(w=t.current)==null?void 0:w.getBounds(v,F);if(!T)return;d.current=b,fe({visible:!0,x:T.x,y:T.y,width:T.width,height:T.height,source:"cell",originId:b,nodeId:b,priority:0,tooltipContext:{column:C,row:E,ctxs:r,refTable:n,colInd:v,rowInd:F,theme:s}},g);return}a(g)},[e,i,r,n,s,l,c,u,a,t])}function eu({enabled:o,portalEventTargetRef:t,headerHeight:e,groupHeaderHeight:i,experimental:r}){const[n,s]=m.useState(0),l=m.useRef(null),c=m.useMemo(()=>{const h=e??Oe;let f=typeof h=="number"?h:Oe;return Array.isArray(i)?f+=i.reduce((g,v)=>g+v,0):typeof i=="number"&&(f+=i),f},[e,i]),u=m.useRef(c);u.current=c;const d=m.useCallback(h=>{var x;if((x=l.current)==null||x.call(l),l.current=null,!h)return;if(!o){s(0);return}const f=t==null?void 0:t.current;if(!f)return;const g=f.querySelector(".dvn-scroller"),v=f.querySelector(".dvn-underlay");if(!g||!v)return;const C=()=>{const y=g.scrollTop,w=Math.min(y,u.current);s(-1*w),v.style.overflowY="visible",v.style.transform=`translateY(-${w}px)`};g.addEventListener("scroll",C),l.current=()=>{g.removeEventListener("scroll",C),v.style.transform="",v.style.overflowY=""}},[o,t]),a=m.useMemo(()=>o?{...r,paddingBottom:n}:r,[o,n,r]);return{unstickyCallbackRef:d,mergedExperimental:a}}const wi=xr.div.withConfig({displayName:"styled__StyledOverlayPortal"})(["[id^='gdg-overlay-']{position:fixed;z-index:9001;margin-left:calc(-1 * var(--gdg-portal-offset-x,0px));margin-top:calc(-1 * var(--gdg-portal-offset-y,0px));}"]),iu=xr(L).withConfig({displayName:"styled__StyledGlideDataEditor"})([""]),os={textPrimary:"#13181BF5",textPrimaryHover:"#13181B93",textPrimaryActive:"#13181BC4",textSecondary:"#485056B0",textSecondaryHover:"#485056FF",textSecondaryActive:"#485056D3",textTertiary:"#707C847A",textTertiaryHover:"#717C84FF",textTertiaryActive:"#717C8493",textTertiaryBase:"#8A959D",textTertiaryVariant:"#657179",textParagraph:"#13181BCC",textParagraphHover:"#13181B7A",textParagraphActive:"#13181BA3",textAccent:"#0B7ECB",textAccentHover:"#0D96F2FF",textAccentActive:"#0966A5FF",textAccentTransparent20:"#0B7ECB33",textPositive:"#108E26",textPositiveHover:"#14B32EFF",textPositiveActive:"#0C6A1BFF",textWarning:"#FA5F05",textWarningHover:"#FB782DFF",textWarningActive:"#D25004FF",textNegative:"#E31227",textNegativeHover:"#EE2F43FF",textNegativeActive:"#BD0F21FF",inverseTextPrimary:"#F2F5F8F5",onDarkTextPrimary:"#F2F5F8F5",onDarkTextPrimaryHover:"#F2F5F893",onDarkTextPrimaryActive:"#F2F5F8C4",onDarkTextPrimary96:"#F7F9FBF4",onDarkTextPrimary56:"#F7F9FB8E",onDarkTextPrimary28:"#F7F9FB47",onLightTextPrimary:"#13181BF5",onLightTextPrimaryHover:"#13181B93",onLightTextPrimaryActive:"#13181BC4",surfaceSolidCard:"#FFFFFF",surfaceAccentMinor:"#ECF6FCFF",surfaceSolidDefault:"#060A0C",surfaceSolidTertiary:"#E8EEF2",surfaceAccent:"#118CDF",surfaceAccentHover:"#1798EEFF",surfaceAccentActive:"#0F81CCFF",surfaceTransparentSecondary:"#ADB9C238",surfaceTransparentSecondaryHover:"#ADB9C247",surfaceTransparentSecondaryActive:"#ADB9C24D",surfaceTransparentTertiary:"#8A959D47",surfaceTransparentDeep:"#30373CC6",surfaceClear:"#FFFFFF00",surfacePositive:"#1A9E32",surfacePositiveHover:"#1EB83AFF",surfacePositiveActive:"#178C2CFF",surfaceWarning:"#FA5F05",surfaceWarningHover:"#FB782DFF",surfaceWarningActive:"#E65705FF",surfaceWarningMinor56:"#F3A9128E",surfaceNegative:"#FF293E",surfaceNegativeHover:"#FF5263FF",surfaceNegativeActive:"#FF142CFF",disabled:"#DDDDDD",surfaceTransparentAccent:"#118CDF1F",surfaceTransparentAccent12:"#118CDF1E",surfaceTransparentAccent20:"#118CDF33",surfaceTransparentPositive:"#1A9E321F",surfaceTransparentPositive12:"#1A9E321E",surfaceTransparentPositive20:"#1A9E3233",surfaceTransparentWarning:"#FA5F051F",surfaceTransparentWarning12:"#FA5F051E",surfaceTransparentWarning20:"#FA5F0533",surfaceTransparentNegative:"#FF293E1F",surfaceTransparentNegative12:"#FF293E1E",surfaceTransparentNegative20:"#FF293E33",onLightSurfaceSolidDefault:"#060A0C",onLightSurfaceTransparentDeep:"#30373CC7",onDarkSurfaceSolidDefault:"#F7F9FB",onDarkSurfaceTransparentCard:"#FFFFFF0F",outlineAccent:"#0B7ECB",outlineSolidPrimary:"#D5DFE6",outlineSolidPrimary26:"#D5DFE642",dataBlueMinor:"#CFECFF",dataBlueMinorActive:"#C2E7FFFF",dataBlue:"#8BB2FC",dataAccentMinorHover:"#52BAFF",dataPositive:"#28D247",dataPositiveMinor:"#9EFAAF",dataNegative:"#FF8F9A",dataNegativeMinor:"#FFE0E3",dataWarning:"#FD9C68",dataWarningMinor:"#FEE2D2",dataOrange:"#F3A912",dataOrangeMinor:"#FFD37A",dataViolet:"#AD42F5",dataVioletMinor:"#DEB7F7",dataPink:"#FF8FBC",dataMagenta:"#F391E2",dataCyan:"#00DDE0",dataCyanDark:"#04C6C9",dataLime:"#93E006",dataTeal:"#14CC98"},ou={textPrimary:"#13181BF5",textPrimaryHover:"#13181B93",textPrimaryActive:"#13181BC4",textSecondary:"#03070CAF",textSecondaryHover:"#485056FF",textSecondaryActive:"#485056D3",textTertiary:"#000206A8",textTertiaryHover:"#717C84FF",textTertiaryActive:"#717C8493",textTertiaryBase:"#818C95",textTertiaryVariant:"#65717A",textParagraph:"#13181BCC",textParagraphHover:"#13181B7A",textParagraphActive:"#13181BA3",textAccent:"#0058A2",textAccentHover:"#0D96F2FF",textAccentActive:"#0966A5FF",textAccentTransparent20:"#0058A23F",textPositive:"#0F5E00",textPositiveHover:"#14B32EFF",textPositiveActive:"#0C6A1BFF",textWarning:"#D95800",textWarningHover:"#FB782DFF",textWarningActive:"#D25004FF",textNegative:"#A50016",textNegativeHover:"#EE2F43FF",textNegativeActive:"#BD0F21FF",inverseTextPrimary:"#F2F5F8F5",onDarkTextPrimary:"#F2F5F8F5",onDarkTextPrimaryHover:"#F2F5F893",onDarkTextPrimaryActive:"#F2F5F8C4",onDarkTextPrimary96:"#F7F9FBF4",onDarkTextPrimary56:"#F7F9FB8E",onDarkTextPrimary28:"#F7F9FB47",onLightTextPrimary:"#13181BF5",onLightTextPrimaryHover:"#13181B93",onLightTextPrimaryActive:"#13181BC4",surfaceSolidCard:"#FFFFFF",surfaceAccentMinor:"#CFE5F2FF",surfaceSolidDefault:"#060A0C",surfaceSolidTertiary:"#CFD9E0",surfaceAccent:"#0076D2",surfaceAccentHover:"#1798EEFF",surfaceAccentActive:"#0F81CCFF",surfaceTransparentSecondary:"#7D96A838",surfaceTransparentSecondaryHover:"#ADB9C247",surfaceTransparentSecondaryActive:"#ADB9C24D",surfaceTransparentTertiary:"#516E8347",surfaceTransparentDeep:"#30373DC6",surfaceClear:"#FFFFFF00",surfacePositive:"#198A00",surfacePositiveHover:"#1EB83AFF",surfacePositiveActive:"#178C2CFF",surfaceWarning:"#D95800",surfaceWarningHover:"#FB782DFF",surfaceWarningActive:"#E65705FF",surfaceWarningMinor56:"#D491008E",surfaceNegative:"#E7002F",surfaceNegativeHover:"#FF5263FF",surfaceNegativeActive:"#FF142CFF",disabled:"#DDDDDD",surfaceTransparentAccent:"#0076D21F",surfaceTransparentAccent12:"#0076D21E",surfaceTransparentAccent20:"#0076D233",surfaceTransparentPositive:"#198A001F",surfaceTransparentPositive12:"#198A003F",surfaceTransparentPositive20:"#198A0033",surfaceTransparentWarning:"#D958001F",surfaceTransparentWarning12:"#D958003F",surfaceTransparentWarning20:"#D9580033",surfaceTransparentNegative:"#E7002F1F",surfaceTransparentNegative12:"#E7002F3F",surfaceTransparentNegative20:"#E7002F33",onLightSurfaceSolidDefault:"#060A0C",onLightSurfaceTransparentDeep:"#30373DC7",onDarkSurfaceSolidDefault:"#D6DFE7",onDarkSurfaceTransparentCard:"#FFFFFF0F",outlineAccent:"#0058A2",outlineSolidPrimary:"#C4CFD7",outlineSolidPrimary26:"#AFC0CB42",dataBlueMinor:"#9CD5FF",dataBlueMinorActive:"#C2E7FFFF",dataBlue:"#6096FF",dataAccentMinorHover:"#0077C1",dataPositive:"#168600",dataPositiveMinor:"#96DAA1",dataNegative:"#BA5161",dataNegativeMinor:"#F8BDC4",dataWarning:"#B35B10",dataWarningMinor:"#F7C29D",dataOrange:"#D49100",dataOrangeMinor:"#F3B400",dataViolet:"#9A29E0",dataVioletMinor:"#D48BFF",dataPink:"#FB5AA5",dataMagenta:"#EB60D7",dataCyan:"#00C1C3",dataCyanDark:"#00AAAD",dataLime:"#7FC400",dataTeal:"#00B082"},ru={...os},nu={light:os,dark:ru,highContrastLight:ou},su=(o="light")=>nu[o],ft={bgEditableCell:{light:"#FFF6E5",dark:"#211807",highContrastLight:"#F1DDB8"},bgEditableCellHovered:{light:"#FFF4E0",dark:"#2A1F09",highContrastLight:"#E8D4AD"},selectionCheckboxBg:{light:"#ECF6FC",dark:"#ECF6FC",highContrastLight:"#CFE5F2"},selectionActiveBg:{light:"#E2F1FB",dark:"#E2F1FB",highContrastLight:"#BFDDF4"},selectionActiveCheckboxBg:{light:"#D1E9F8",dark:"#D1E9F8",highContrastLight:"#9BCAEA"},selectionServiceBg:{light:"#ECF6FC",dark:"#ECF6FC",highContrastLight:"#CFE5F2"},selectionServiceActiveBg:{light:"#D4E7F2",dark:"#D4E7F2",highContrastLight:"#B9D6E7"},errorOutlineColor:{light:"#FF3D51",dark:"#FF3D51",highContrastLight:"#E9203F"},bgRowHovered:{light:"#F7F9FB",dark:"#F7F9FB",highContrastLight:"#E8EEF2"},bgServiceRowHovered:{light:"#D4E7F2",dark:"#D4E7F2",highContrastLight:"#B9D6E7"},bgSelectedRowHovered:{light:"#DEECF5",dark:"#DEECF5",highContrastLight:"#C2DCEB"}},lu=o=>({tokens:su(o),fonts:Ne,fontMetrics:Dr,bgEditableCell:ft.bgEditableCell[o],bgEditableCellHovered:ft.bgEditableCellHovered[o],selectionCheckboxBg:ft.selectionCheckboxBg[o],selectionActiveBg:ft.selectionActiveBg[o],selectionActiveCheckboxBg:ft.selectionActiveCheckboxBg[o],selectionServiceBg:ft.selectionServiceBg[o],selectionServiceActiveBg:ft.selectionServiceActiveBg[o],errorOutlineColor:ft.errorOutlineColor[o],bgRowHovered:ft.bgRowHovered[o],bgServiceRowHovered:ft.bgServiceRowHovered[o],bgSelectedRowHovered:ft.bgSelectedRowHovered[o]}),ot={accentColor:{light:"#0b7ecb",dark:"#0b7ecb",highContrastLight:"#0058A2"},accentLight:{light:"#E2F1FB",dark:"#E2F1FB",highContrastLight:"#DAE8F1"},textDark:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5"},textHeader:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5"},textHeaderSelected:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5"},textGroupHeader:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5"},bgCell:{light:"#FFFFFF",dark:"#FFFFFF",highContrastLight:"#FFFFFF"},bgHeader:{light:"#ECF6FCFF",dark:"#ECF6FCFF",highContrastLight:"#CFE5F2FF"},bgHeaderHasFocus:{light:"#ECF6FCFF",dark:"#ECF6FCFF",highContrastLight:"#B9D6E7"},bgHeaderHovered:{light:"#DEECF5",dark:"#DEECF5",highContrastLight:"#C2DCEB"},borderColor:{light:"#D5DFE6",dark:"#D5DFE6",highContrastLight:"#C4CFD7"},bgGroupHeader:{light:"#ECF6FCFF",dark:"#ECF6FCFF",highContrastLight:"#CFE5F2FF"},bgGroupHeaderHovered:{light:"#DEECF5",dark:"#DEECF5",highContrastLight:"#C2DCEB"}},cu=o=>({accentColor:ot.accentColor[o],accentLight:ot.accentLight[o],textDark:ot.textDark[o],textHeader:ot.textHeader[o],textHeaderSelected:ot.textHeaderSelected[o],textGroupHeader:ot.textGroupHeader[o],bgCell:ot.bgCell[o],bgHeader:ot.bgHeader[o],bgHeaderHasFocus:ot.bgHeaderHasFocus[o],bgHeaderHovered:ot.bgHeaderHovered[o],borderColor:ot.borderColor[o],bgGroupHeader:ot.bgGroupHeader[o],bgGroupHeaderHovered:ot.bgGroupHeaderHovered[o]}),Sr={small:"bodyXXS",medium:"bodyS",big:"bodyM"},au=(o="big")=>{const t=Ne[Sr[o]],e=Dr[Sr[o]],i=`${e.fontSize}px`,r=e.lineHeightPx,n=Er[o],{cellHorizontalPadding:s,cellVerticalPadding:l}=n;return{headerFontStyle:Ne.bodyXSBold,baseFontStyle:t,fontFamily:'"SB Sans Text", sans-serif, Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif',editorFontSize:i,lineHeight:r,cellHorizontalPadding:s,cellVerticalPadding:l,activeSizes:n}},yo=(o="big",t="light")=>({...cu(t),...au(o),...lu(t),rowSize:o}),uu=yo(),wr=(o,t)=>{if(o==null)return null;const e=typeof o=="number"?o:o(t);return[t.colInd,t.colInd+e]};function hu(...o){}const du={},xi=o=>Array.isArray(o)?o.filter(t=>typeof t=="string"):typeof o=="string"?[o]:[],fu=({columns:o,rows:t,bottomSummaryRows:e,rowHeight:i,width:r,rowSize:n="medium",ctxs:s=du,freezeColumns:l,onColumnResize:c,renderGroupHeader:u,groupAlignMap:d,refTable:a,onColumnsReorder:h,portalEventTargetRef:f,onItemHovered:g,unstickyHeader:v,resizableColumn:C=!0,minColumnWidth:x=56,maxColumnWidth:y,maxColumnAutoWidth:w,containerRef:F,containerClassName:E,containerStyle:b,renderOverlayFeatures:P,hideGrid:T,contentStateNode:B,fullScreened:O,editorOverlayPortal:rt,highlightActiveType:G="disabled",cellsSelectionMode:Q="range-cell",enableColumnSelection:kt=!0,enableRowSelection:ei=!0,enableSelectAll:ii=!0,enableLowDprHairline:ee,gridSelection:Ht,onGridSelectionChange:oi,onSelectionEmit:Ce,onColumnSelectionChange:M,pendingColumnSelectionKeys:N,onColumnSelectionApplied:z,highlightActiveRow:X,onHighlightActiveRowChange:Y,highlightActiveRowControlled:nt,highlightRegions:ht,checkboxSelectedRowIndexes:W,checkboxVisibleRowIndexes:tt,hoverEffects:st,onCellClicked:dt,onCellContextMenu:ie,onGroupHeaderClicked:Lt,onMouseMove:ve,portalElementRef:gu,...Mt})=>{var _o,Ro;const bo=Kt.useActiveTheme(),_=m.useMemo(()=>yo(n,bo),[n,bo]),rs=m.useMemo(()=>{const p=typeof i=="number"?i:void 0;if(p)return p;const S=Ar[n],A=typeof i=="function"?i:void 0;return A?D=>{const H=t[D];if(!H)return p??S;const R=A(H,{rowSizeName:n,rowSizeValue:S},D);return typeof R=="number"&&!Number.isNaN(R)?R:S}:S},[t,i,n]),zt=(e==null?void 0:e.length)??0,ns=Na(rs),[me,ss]=m.useState(new Map),ls=m.useCallback((p,S,A,D)=>{const H=p;H.id&&(c==null||c(H,S,A,D),ss(I=>(I.set(H.id,S),new Map(I))))},[c]),Ot=m.useMemo(()=>me.size===0?o:o.map(p=>me.has(p.id)?{...p,width:me.get(p.id),grow:0}:p),[o,me]),[Fo,Cu]=m.useState(0),ri=m.useMemo(()=>new WeakMap,[]),ni=m.useRef(null),Tt=m.useRef(null);m.useEffect(()=>{var p;(Ht==null?void 0:Ht.current)!==void 0&&((p=Tt.current)==null||p.focus())},[Ht]);const{interactionSessionStore:lt,beginOrGetInteractionSession:cs,consumeCanvasClickResult:as}=Ka(),So=Ua(lt),{selection:vt,handleGridSelectionChange:us,handleSelectionCleared:hs,rangeSelect:ds}=jn({cellsSelectionMode:Q,gridSelection:Ht,onGridSelectionChange:oi,onSelectionEmit:Ce}),et=Jn({columns:Ot,selection:vt,cellsSelectionMode:Q,checkboxSelectedRowIndexes:W}),fs=m.useMemo(()=>Y?p=>Y(p,p!==void 0?t[p]:void 0):void 0,[Y,t]),{selectedColumnIndexes:gs,selectedColumnKeysAll:wo,selectColumnsByKeys:pe,selectedColumnSet:ye,headerSelectedRowIndexes:xo,activeRow:Cs,numberingColumnIndex:Ao,drawFocusRing:vs,selectColumnFromHeader:Eo,handleGridSelectionWithColumnReset:ms,handleSelectionClearedWithColumns:ps}=Qn({columns:Ot,selection:vt,cellsSelectionMode:Q,highlightActiveType:G,enableColumnSelection:kt,enableRowSelection:ei,enableSelectAll:ii,leadingServiceColumnsCount:et.leadingServiceColumnsCount,dataRowCount:t.length+zt,handleGridSelectionChange:us,handleSelectionCleared:hs,onSelectionEmit:Ce,highlightActiveRow:X,onHighlightActiveRowChange:fs,isHighlightActiveRowControlled:nt});m.useEffect(()=>{M==null||M(wo)},[wo,M]),m.useEffect(()=>{if(!N)return;pe(N);const p=setTimeout(()=>z==null?void 0:z(),0);return()=>clearTimeout(p)},[N,Ot,pe,z]);const be=xo.length>0,Fe=m.useMemo(()=>{var A;const p=new Set,S=(A=vt.current)==null?void 0:A.rangeStack;if(S){const D=et.firstDataColumnIndex;for(const H of S){const I=Math.max(H.x,D);for(let R=I;R<H.x+H.width;R+=1)p.add(R)}}return p},[vt,et.firstDataColumnIndex]),V=m.useMemo(()=>Ot.map((p,S)=>{const A={...p.themeOverride??{}};let D=Object.keys(A).length>0;return p.isServiceColumn&&(A.bgCell=_.selectionServiceBg,D=!0),S===Ao&&(A.accentLight="transparent",A.accentColor="transparent",D=!0),et.isActiveHeaderColumn(S)&&(A.bgHeader=_.selectionServiceActiveBg,A.bgHeaderHasFocus=_.selectionServiceActiveBg,D=!0),ye.has(S)&&(A.bgHeader=_.selectionServiceActiveBg,A.bgHeaderHasFocus=_.selectionServiceActiveBg,D=!0),Fe.has(S)&&(A.bgHeader=_.selectionServiceActiveBg,A.bgHeaderHasFocus=_.selectionServiceActiveBg,D=!0),be&&!p.isServiceColumn&&(A.bgHeader=_.selectionServiceActiveBg,A.bgHeaderHasFocus=_.selectionServiceActiveBg,D=!0),D?{...p,themeOverride:A}:p}),[Ot,et,ye,Fe,be,Ao,_.selectionServiceBg,_.selectionServiceActiveBg]),ys=m.useMemo(()=>{var A;const p=(A=vt.current)==null?void 0:A.range,S=[];return V.forEach((D,H)=>{D.isServiceColumn||!D.isErrorCell||t.forEach((I,R)=>{var k;(k=D.isErrorCell)!=null&&k.call(D,I)&&(po(p,H,R)||S.push({x:H,y:R,width:1,height:1}))})}),S},[V,t,vt.current]),Se=m.useCallback(([p,S],A)=>{var Ee,Oo,Te,No;hu(Fo);const D=(A==null?void 0:A.applyCanvasEditorActivation)!==!1,H=It=>D?So([p,S],It):It,I=!!e&&S>t.length-1,R=t[S],k=V[p];if(!k)return qt();if(I){const It=e[S-t.length],{renderSummaryCell:Wo,colSpan:$s}=k;if(!Wo||!It)return qt();const fi={row:It,column:k,colInd:p,rowInd:S,ctxs:s,theme:_,hovered:{cellHover:!1,rowHover:!1},active:{cellActive:!1,rowActive:!1}},Us=Wo(fi),Go=wr($s,fi),Xs={data:"",...Go&&{span:Go}};return H(pr({jsxElement:Us,canvasCellCache:ri,cellInfo:fi,options:{...Xs,getPortalEventTarget:()=>(f==null?void 0:f.current)??null,refTable:a}}))}if(!R)return qt();const q=ni.current,U={row:R,column:k,colInd:p,rowInd:S,ctxs:s,theme:_,hovered:{cellHover:(q==null?void 0:q.colInd)===p&&(q==null?void 0:q.rowInd)===S,rowHover:(q==null?void 0:q.rowInd)===S},active:{cellActive:et.isActiveDataCell(p,S),rowActive:et.isActiveRow(S)}},{renderCell:K,id:j,colSpan:$,editable:Dt,contentAlign:Bt,columnThemeOverride:xe}=k,Ae=((Oo=(Ee=R[j])==null?void 0:Ee.toString)==null?void 0:Oo.call(Ee))??"NOT FOUND",ko=wr($,U),Mo=Dt?typeof Dt=="boolean"?Dt:Dt(R):!1,hi=typeof xe=="function"?xe(U):void 0,di={data:((No=(Te=R[j])==null?void 0:Te.toString)==null?void 0:No.call(Te))??"NOT FOUND",...Mo?{readonly:!1,allowOverlay:!0}:{readonly:!0,...k.hasPreview===!0&&{allowOverlay:!0},...k.hasPreview==="none"&&{allowOverlay:!1}},themeOverride:{...hi,...Mo&&{bgCell:_.bgEditableCell}},contentAlign:Bt,...ko&&{span:ko}};if(!K){const It=String(Ae);return vo(It)?H(Xe(It,di)):H(qt(di))}const zo=hi?{...U,theme:{..._,...hi}}:U,Gs=K(zo);return H(pr({jsxElement:Gs,canvasCellCache:ri,cellInfo:zo,options:{...di,getPortalEventTarget:()=>(f==null?void 0:f.current)??null,refTable:a}}))},[Fo,e,t,V,s,_,et,ri,f,So]),bs=m.useCallback((p,S)=>{var $;const A=Se(p,{applyCanvasEditorActivation:!1});if(!uo(A)){dt==null||dt(p,S);return}let D=!1;const H=S.preventDefault;S.preventDefault=()=>{D=!0,H()};const I=Zt({colIndex:p[0],rowIndex:p[1]},S.bounds),R=jt(I,A),k={x:S.localEventX,y:S.localEventY},q=ts({cell:p,glideCell:A,rect:S.bounds,renderData:R,relativePoint:k}),U=q?lt.beginOrGet({cell:p,relativePoint:k,interaction:q.interaction,button:S.button,source:"click"}):lt.beginOrGet({cell:p,relativePoint:k,interaction:Or(),button:S.button,source:"click"}),K=ho({cell:A,rect:S.bounds,relativePoint:k,renderData:R,rowData:t[p[1]],rowIndex:p[1]}),j=U?Jc({decision:U.decision,propagationStopped:K.propagationStopped,suppressGridDefault:K.suppressGridDefault}):{suppressExternalCellClick:K.propagationStopped,suppressGridDefaultForClick:K.suppressGridDefault};if(U&&(lt.consumePhase(U,"cell-click"),lt.storeClickResult(U,K)),S.button===0&&(($=j.editorRequest)==null?void 0:$.target)==="self"&<.armEditorRequest(U,j.editorRequest),j.suppressGridDefaultForClick&&(S.preventDefault(),U!=null&&U.decision.editorRequest&<.clear()),j.suppressExternalCellClick||dt==null||dt(p,S),D||S.button===1){lt.clear();return}},[Se,lt,dt,t]),Fs=m.useCallback((p,S)=>{lt.isMatchingRecent("contextmenu-capture",p)||ie==null||ie(p,S)},[lt,ie]),Ss=Za({beginOrGetInteractionSession:cs,consumeCanvasClickResult:as}),Nt=m.useRef(null),Wt=m.useRef(null),oe=m.useMemo(()=>new Map,[]),To=m.useMemo(()=>new Map,[]),si=m.useRef(null),Pt=m.useRef(null),ws=m.useMemo(()=>Kt.mergeRefs(Pt,F),[F]),{drawHeader:xs,onHeaderClicked:As}=m.useMemo(()=>({drawHeader:(A,D)=>{var Ae;const{ctx:H,rect:I,columnIndex:R}=A,k=V[R];if(!k||!k.renderHeaderCell)return D();const q={column:k,drawArgs:A,ctxs:s,theme:_};let U=k.renderHeaderCell(q);if(!Vi(U))return D();typeof U=="string"&&(U=Ft.jsx(de.Container,{style:{width:"100%"},alignItems:"center",children:Ft.jsx(de.Text,{children:U})}));const K=`header-${k.id}-${R}`,j=Ue({element:U,idPrefix:K,theme:_});let $;oe.has(k.id)?($=oe.get(k.id),$==null||$.setRootNode(j),$!=null&&$.rootNode&&($.rootNode.style={width:I.width,height:I.height})):($=new yt(j,K),$.rootNode.style={width:I.width,height:I.height},oe.set(k.id,$)),$==null||$.setPortalEventTarget((f==null?void 0:f.current)??null),$==null||$.setTooltipContext({column:k,ctxs:s,refTable:a});const Dt=((Ae=Nt.current)==null?void 0:Ae.id)===k.id?Nt.current:void 0,Bt=H.canvas.getBoundingClientRect(),xe={x:Bt.left+I.x,y:Bt.top+I.y,width:I.width,height:I.height};return $==null?void 0:$.render(H,I,Dt,xe)},onHeaderClicked:(A,D)=>{const H=V[A];if(H){if(H.renderHeaderCell){const I=oe.get(H.id);if(I){const R=I.getInteractionAtPoint(D.localEventX,D.localEventY);if(I.dispatchPointerEvent("click",D.localEventX,D.localEventY),R)return}}Eo(A,D)}}}),[V,s,_,oe,f,Tt,Eo]),Es=m.useCallback((p,S)=>{const A=V[p];if(!kt||!A){Lt==null||Lt(p,S);return}const D=xi(A.group),H=Math.max(0,D.indexOf(S.group)),I=D.slice(0,H+1).join("\0"),R=K=>{const j=V[K];return j!==void 0&&xi(j.group).slice(0,H+1).join("\0")===I};let k=p,q=p;for(;k-1>=0&&R(k-1);)k-=1;for(;q+1<V.length&&R(q+1);)q+=1;const U=[];for(let K=k;K<=q;K+=1){const j=V[K];j&&!j.isServiceColumn&&U.push(j.id)}U.length>0&&pe(U),Lt==null||Lt(p,S)},[kt,V,pe,Lt]),Do=m.useMemo(()=>{const p=new Map;V.forEach((A,D)=>{if(A.isServiceColumn)return;const H=et.isActiveHeaderColumn(D)||ye.has(D)||Fe.has(D)||be;xi(A.group).forEach(I=>{if(I==="")return;const R=p.get(I);p.set(I,(R??!0)&&H)})});const S=new Set;return p.forEach((A,D)=>{A&&S.add(D)}),S},[V,et,ye,Fe,be]),Ts=m.useCallback(p=>{const S=d==null?void 0:d.get(p),A={name:p,...S&&{spanAlign:S}};return Do.has(p)?{...A,overrideTheme:{bgGroupHeader:_.selectionServiceActiveBg,bgGroupHeaderHovered:_.bgHeaderHovered}}:A},[d,Do,_.selectionServiceActiveBg,_.bgHeaderHovered]),{glideContainer:li,isReady:Ds,renderInContainer:Is}=ja(Pt,O),Io=rt==="inside";Qa(Pt,Io),Ga({eventTarget:li??Pt.current,dataEditorRef:Tt,getCellContent:Se,interactionSessionStore:lt,onCellContextMenuExternal:ie});const{unstickyCallbackRef:Ho,mergedExperimental:ci}=eu({enabled:v,portalEventTargetRef:f,headerHeight:Mt.headerHeight,groupHeaderHeight:Mt.groupHeaderHeight,experimental:Mt.experimental}),Hs=m.useMemo(()=>Kt.mergeRefs(Tt,a,Ho),[a,Ho]),Ls=m.useMemo(()=>ee===void 0?ci:{...ci,enableLowDprHairline:ee},[ee,ci]),Lo=m.useCallback((...p)=>{var H;const S=Tt.current;if(!S)return;const A=new Set;p.forEach(I=>{typeof I=="number"&&I>=0&&I<t.length&&A.add(I)});const D=[];A.forEach(I=>{V.forEach((R,k)=>{D.push({cell:[k,I]})})}),D.length>0&&((H=S.updateCells)==null||H.call(S,D))},[V,t.length]),we=m.useCallback(p=>{const S=ni.current;(S==null?void 0:S.colInd)===(p==null?void 0:p.colInd)&&(S==null?void 0:S.rowInd)===(p==null?void 0:p.rowInd)||(ni.current=p,Lo(S==null?void 0:S.rowInd,p==null?void 0:p.rowInd))},[Lo]),Ps=m.useCallback(p=>{ve==null||ve(p),p.kind==="cell"?(()=>{const A=p.location[0],D=p.location[1],H=t[D],I=V[A];if(!H||!I||I.isServiceColumn){we(null);return}we({colInd:A,rowInd:D})})():we(null),p.kind==="group-header"?(()=>{if(typeof p.group!="string"){Wt.current=null;return}Wt.current={id:p.group,x:p.localEventX,y:p.localEventY}})():Wt.current=null,p.kind==="header"?(()=>{var I,R;const A=p.location[0],D=p.location[1],H=V[A];if(!H||!(H!=null&&H.renderHeaderCell)){Nt.current=null;return}Nt.current={id:H.id,x:p.localEventX,y:p.localEventY},(R=(I=Tt.current)==null?void 0:I.updateCells)==null||R.call(I,[{cell:[A,D]}])})():Nt.current=null,Nt.current=null,Wt.current=null},[V,ve,t,we]),Po={dataEditorRef:Tt,rowCount:t.length,columnCount:V.length,headerAndGroupHeaderRowsCount:1+(Mt.groupHeaderHeight??[]).length};Vn(Po),Xn(Po);const Bs=m.useMemo(()=>h?(S,A)=>{var I,R;const D=(I=V[S])==null?void 0:I.id,H=(R=V[A])==null?void 0:R.id;typeof D!="string"||typeof H!="string"||h(D,H)}:void 0,[V,h]),_s=m.useMemo(()=>{if(u)return(p,S)=>{var Bt;const A=u(p);if(A==="default")return S();if("defaultWithCustomGroupName"in A)return S(A.defaultWithCustomGroupName);const{groupName:H,rect:I,ctx:R}=p;let k=A;if(!Vi(k))return S();typeof k=="string"&&(k=Ft.jsx(de.Container,{style:{width:"100%"},alignItems:"center",children:Ft.jsx(de.Text,{children:k})}));const q=H,U=Ue({element:k,idPrefix:q,theme:_}),K=new yt(U,q);K.rootNode.style={width:I.width,height:I.height},K.setPortalEventTarget((f==null?void 0:f.current)??null),To.set(q,K);const j=((Bt=Wt.current)==null?void 0:Bt.id)===q?Wt.current:void 0,$=R.canvas.getBoundingClientRect(),Dt={x:$.left+I.x,y:$.top+I.y,width:I.width,height:I.height};return K.render(R,I,j,Dt)}},[To,u,_,f]),ai=st==null?void 0:st.row,re=!!ai,Bo=typeof ai=="object"?ai.color:void 0,[Gt,Rs]=m.useState(void 0),ks=m.useCallback(p=>{Rs(S=>S===p?S:p)},[]),Ms=m.useMemo(()=>{const p=!!(W!=null&&W.size),S=re?Gt:void 0;if(!zt&&!p&&S===void 0)return;const A=Bo??_.bgRowHovered;return D=>D>t.length-1?{bgCell:_.bgHeader}:W!=null&&W.has(D)?{bgCell:D===S?_.bgSelectedRowHovered:_.selectionCheckboxBg}:D===S?{bgCell:A}:{}},[t.length,zt,_.bgHeader,_.selectionCheckboxBg,_.bgRowHovered,_.bgSelectedRowHovered,W,re,Gt,Bo]),zs=tu({columnsLast:V,rows:t,ctxs:s,refTable:a,theme:_,portalEventTargetRef:f,externalOnItemHovered:g,onHoverRowChange:re?ks:void 0},Tt),Os=Kn({cellsSelectionMode:Q,selection:vt,baseTheme:_,serviceColumnsCount:et.leadingServiceColumnsCount,activeDataRange:et.activeDataRange,outlineRange:et.outlineRange,checkboxSelectedRowIndexes:W,errorCellRanges:ys,highlightRegionsExternal:ht}),ui=Zn({baseRegions:Os,selectedColumnIndexes:gs,headerSelectedRowIndexes:xo,activeRow:Cs,activeRange:(_o=vt.current)==null?void 0:_o.range,selectionRangeStack:(Ro=vt.current)==null?void 0:Ro.rangeStack,checkboxAvailableRowIndexes:tt,totalRows:t.length+zt,firstDataCol:et.leadingServiceColumnsCount,columnsCount:Ot.length,theme:_}),Ns=m.useMemo(()=>{const p=et.leadingServiceColumnsCount;return!re||Gt===void 0||Gt>t.length-1||p===0?ui:[{color:_.bgServiceRowHovered,range:{x:0,y:Gt,width:p,height:1},style:"no-outline"},...ui??[]]},[ui,et.leadingServiceColumnsCount,re,Gt,t.length,_.bgServiceRowHovered]),Ws=m.useMemo(()=>{if(!(!b&&!B&&!T))return{...b,...B?{position:"relative"}:void 0,...T?{height:"100%",minHeight:0}:void 0}},[b,B,T]);return Ft.jsxs("div",{ref:ws,className:E,style:Ws,children:[Io?_e.createPortal(Ft.jsx(wi,{ref:si,onAnimationEndCapture:p=>p.stopPropagation(),id:"portal"}),(Pt==null?void 0:Pt.current)??document.body):_e.createPortal(Ft.jsx(wi,{id:"portal",ref:si}),document.body),_e.createPortal(Ft.jsx(wi,{id:"portal2"}),document.body),!T&&Ft.jsx(iu,{ref:Hs,className:"gdg-table",portalElementRef:si,theme:_,getRowThemeOverride:Ms,onHeaderClicked:As,onGroupHeaderClicked:Es,onMouseMove:Ps,drawHeader:xs,drawGroupHeader:_s,getGroupDetails:Ts,getCellContent:Se,columns:V,rows:t.length+zt,freezeTrailingRows:zt,freezeColumns:l,minColumnWidth:x,maxColumnAutoWidth:w,maxColumnWidth:y,columnSelect:"none",columnSelectionBlending:"exclusive",drawFocusRing:vs,gridSelection:vt,onGridSelectionChange:ms,onSelectionCleared:ps,width:r??"100%",onColumnMoved:Bs,onColumnResize:C?ls:void 0,customRenderers:Ss,rowHeight:ns,highlightRegions:Ns,rangeSelect:ds,smoothScrollX:!0,smoothScrollY:!0,headerHeight:Oe,onCellClicked:bs,onCellContextMenu:Fs,onItemHovered:zs,...Mt,experimental:Ls,keybindings:{...Mt.keybindings,copy:!1,paste:!1},onPaste:!1}),B,Ds&&li&&(P==null?void 0:P({containerElement:li,renderInContainer:Is}))]})};exports.BUTTON_PADDING_Y=Qt;exports.CACHE_SEPARATOR=Qi;exports.CANVAS_CELL_KIND=Qe;exports.CANVAS_PORTAL_EVENT=Ge;exports.Canvas=de;exports.CanvasAbsoluteContainer=cl;exports.CanvasBadge=un;exports.CanvasButton=hn;exports.CanvasChevron=Bl;exports.CanvasContainer=gt;exports.CanvasEmbedIconButton=Bi;exports.CanvasHoverController=qi;exports.CanvasIcon=dn;exports.CanvasIconButton=fn;exports.CanvasLeaf=bt;exports.CanvasLink=Fn;exports.CanvasNode=_t;exports.CanvasRect=gn;exports.CanvasRegistry=Nr;exports.CanvasRoot=dl;exports.CanvasSkeleton=bn;exports.CanvasText=ao;exports.CellCanvasRoot=yt;exports.DANGER_COLOR=Ji;exports.DANGER_TEXT_COLOR=Ai;exports.DEFAULT_ACCENT_FG=ge;exports.DEFAULT_BORDER_WIDTH=At;exports.DEFAULT_BUTTON_RADIUS=Zi;exports.DEFAULT_CURSOR=xn;exports.DEFAULT_HEADER_HEIGHT=Oe;exports.DEFAULT_ICON_SIZE=Gr;exports.DEFAULT_ICON_SPACING=ji;exports.DEFAULT_ROW_HEIGHT=Ar;exports.DEFAULT_SECONDARY_HOVER=$r;exports.DEFAULT_SIZE=je;exports.DEFAULT_TEXT_PADDING=fl;exports.DEFAULT_VIEW=Je;exports.DISABLED_BG_COLOR=Ur;exports.DISABLED_BORDER_COLOR=Xr;exports.DISABLED_TEXT_COLOR=Ei;exports.DrawBatcher=Ke;exports.EMPTY_CELL_OBJ=qs;exports.FlexBox=xt;exports.FlexElement=Hr;exports.FlexTreeBuilder=_r;exports.HEX_COLOR_CHAR_CODE=Yr;exports.HEX_COLOR_PREFIX=Vr;exports.ICON_SIZE_ADJUSTMENT=te;exports.IconSpriteManager=Qr;exports.LEGACY_HOVER_CURSOR=An;exports.LIGHTEN_AMOUNT=to;exports.LayoutReconciler=Rr;exports.MAX_ICON_SIZE=Ki;exports.POINTER_CANDIDATE_KEYS=wn;exports.PositionResolver=St;exports.RELATIVE_COORD_TOLERANCE=he;exports.RootBridge=fa;exports.RootFlexBox=Yi;exports.SIZES=Er;exports.SIZE_CONFIG=it;exports.SizeAccumulator=qe;exports.TABLE_GLIDE_SIZES=Ks;exports.THEME=uu;exports.TableGlide=fu;exports.VIEW_COLORS=Ze;exports.buildButtonViewColors=Wr;exports.buildCanvasTree=Ue;exports.buildCellId=Zt;exports.calculateButtonWidth=oo;exports.calculateContentWidth=ro;exports.canvasCellRenderer=Qc;exports.clearButtonCaches=gl;exports.clearIconCache=ea;exports.createCanvasCell=Sn;exports.createCanvasCellRenderer=fo;exports.createEmptyCellGlide=qt;exports.createNormalCanvasInteraction=Or;exports.createRafUpdate=Co;exports.createSvgDataUrl=Pi;exports.createTextCellGlide=Xe;exports.defaultBatcher=hl;exports.defaultIconManager=Et;exports.dispatchCanvasPortalHover=fe;exports.drawButton=sn;exports.drawButtonWithView=ln;exports.drawEmbedIconButtonWithView=cn;exports.drawIcon=rn;exports.drawIcon$1=ut;exports.drawIconButton=co;exports.drawIconButtonWithView=an;exports.drawIconDirect=Fl;exports.flexBoxLayout=il;exports.fontStyles=Ne;exports.getCachedTextWidth=io;exports.getCellIndices=ke;exports.getDpr=Me;exports.getHoverState=Rn;exports.getIconCacheSize=ia;exports.getIconImageDirect=nn;exports.getIconSprite=en;exports.getIconSpriteStats=yl;exports.getRelativePointerPosition=En;exports.getRowHeightBySize=Re;exports.getTheme=yo;exports.handleCanvasRootClick=In;exports.handleCanvasRootHover=kn;exports.handleCellClick=Ln;exports.handleClickHandlers=Hn;exports.hashString=Jr;exports.isAbsoluteCoords=Tn;exports.isCanvasCell=uo;exports.isCanvasContent=Vi;exports.isCanvasEl=ti;exports.isCanvasString=mo;exports.isGlideCellObj=Ba;exports.isGlideGridCellObj=Yn;exports.isHoveringBounds=Rt;exports.isObject=Pa;exports.isPointInArea=lo;exports.isPortalHoverLocked=Wc;exports.isPrimitive=vo;exports.isReactIcon=wt;exports.isRelativeCoords=Dn;exports.isValueEmpty=qn;exports.lightenColor=eo;exports.lightenColorCached=qr;exports.lockPortalHover=Nc;exports.normalizeCanvasInteraction=zr;exports.normalizeDimensionValue=$i;exports.normalizeHoverPoint=jr;exports.normalizeIcon=mt;exports.onAnyIconLoad=tn;exports.performCanvasClick=ho;exports.performCanvasPointerDownIntent=On;exports.preloadIconSprites=on;exports.queryGlideElements=is;exports.reactIconToSvg=Nn;exports.rectContainsCell=po;exports.registerIconDefinitions=pl;exports.resetIconSpriteCache=bl;exports.resolveButtonColors=no;exports.resolveClickPoint=Hi;exports.resolveDangerColors=Zr;exports.resolvePaddingBox=Lr;exports.resolvePaddingBox$1=Mr;exports.resolvePrimaryColors=Ii;exports.resolveSecondaryColors=Kr;exports.resolveViewColors=so;exports.retrieveRenderData=jt;exports.storeRenderData=Bn;exports.subscribeToCanvasPortalHover=Kc;exports.subscribeToPortalHoverLock=Gc;exports.toRelativePoint=Li;exports.updateGridCells=go;exports.updateHoverState=_n;exports.updateHoverStateIfNeeded=Mn;exports.useBaseHighlightRegions=Kn;exports.useCanvasRegistry=La;exports.useColumnRowHighlightRegions=Zn;exports.useFontLoadRedraw=Xn;exports.useIconLoadRedraw=Vn;exports.useNativeGridSelection=jn;exports.useSelectionGeometry=Jn;exports.useTableSelectionSystem=Qn;exports.waitForCanvasFonts=$n;exports.waitForDocumentFonts=Gn;exports.waitForFonts=Un;
|
|
1
|
+
"use strict";const L=require("@glideappsfinal/glide-data-grid"),gi=require("@salutejs/sdds-themes/tokens/sdds_finai"),Vs=require("canvas-hypertxt"),m=require("react"),Ys=require("react-dom/server"),Ft=require("react/jsx-runtime");require("@glideappsfinal/glide-data-grid/dist/index.css");const Kt=require("./utils-DvDFSlCG.cjs"),_e=require("react-dom"),xr=require("styled-components"),Z={small:{rowHeight:20,cellVerticalPadding:4,cellHorizontalPadding:4,textfieldSize:"xs"},medium:{rowHeight:32,cellVerticalPadding:7,cellHorizontalPadding:8,textfieldSize:"s"},big:{rowHeight:48,cellVerticalPadding:12,cellHorizontalPadding:16,textfieldSize:"s"}},Re=o=>Z[o].rowHeight,Ci=o=>Z[o].textfieldSize,Ar={small:Z.small.rowHeight,medium:Z.medium.rowHeight,big:Z.big.rowHeight},qs={kind:L.GridCellKind.Text,data:"",displayData:"",allowOverlay:!0,readonly:!0},Er={big:{cellVerticalPadding:Z.big.cellVerticalPadding,cellHorizontalPadding:Z.big.cellHorizontalPadding,textfieldSize:Z.big.textfieldSize},medium:{cellVerticalPadding:Z.medium.cellVerticalPadding,cellHorizontalPadding:Z.medium.cellHorizontalPadding,textfieldSize:Z.medium.textfieldSize},small:{cellVerticalPadding:Z.small.cellVerticalPadding,cellHorizontalPadding:Z.small.cellHorizontalPadding,textfieldSize:Z.small.textfieldSize}},vi={"padding-block":"0px","padding-inline":"0px"},$t=o=>`${o}px`,Ks={small:{rowHeight:Re("small"),cell:{"padding-block":$t(Z.small.cellVerticalPadding),"padding-inline":$t(Z.small.cellHorizontalPadding)},editorCell:vi,input:Ci("small"),icon:"xs",combobox:"s",checkboxOfCombobox:"s",switch:"s",font:()=>gi.bodyXXS},medium:{rowHeight:Re("medium"),cell:{"padding-block":$t(Z.medium.cellVerticalPadding),"padding-inline":$t(Z.medium.cellHorizontalPadding)},editorCell:vi,input:Ci("medium"),icon:"s",combobox:"m",checkboxOfCombobox:"m",switch:"s",font:()=>gi.bodyS},big:{rowHeight:Re("big"),cell:{"padding-block":$t(Z.big.cellVerticalPadding),"padding-inline":$t(Z.big.cellHorizontalPadding)},editorCell:vi,input:Ci("big"),icon:"m",combobox:"l",checkboxOfCombobox:"l",switch:"l",font:()=>gi.bodyM}},Oe=33,Zs={bodyM:{"font-size":"1rem","font-weight":400,"line-height":"1.25rem","bold-font-size":"1rem","bold-font-weight":600,"bold-line-height":"1.25rem"},bodyS:{"font-size":"0.875rem","font-weight":400,"line-height":"1.125rem","bold-font-size":"0.875rem","bold-font-weight":600,"bold-line-height":"1.125rem"},bodyXS:{"font-size":"0.75rem","font-weight":400,"line-height":"0.875rem","bold-font-size":"0.75rem","bold-font-weight":600,"bold-line-height":"0.875rem"},bodyXXS:{"font-size":"0.625rem","font-weight":400,"line-height":"0.75rem","bold-font-size":"0.625rem","bold-font-weight":600,"bold-line-height":"0.75rem"}},js=16;function $o(o,t=js){const e=parseFloat(o);return Number.isFinite(e)?o.endsWith("rem")?e*t:e:0}const Js=(o,t=!1)=>{const e=t?o["bold-font-weight"]:o["font-weight"],i=t?o["bold-font-size"]:o["font-size"],r=t?o["bold-line-height"]:o["line-height"];return`${e} normal ${i}/${r}`},Qs=(o,t=!1)=>{const e=t?o["bold-font-size"]:o["font-size"],i=t?o["bold-line-height"]:o["line-height"];return{fontSize:$o(e),lineHeightPx:$o(i)}},Tr=o=>Object.entries(Zs).reduce((t,[e,i])=>{const r=e;return t.push([r,o(i)],[`${r}Bold`,o(i,!0)]),t},[]),Ne=Object.fromEntries(Tr(Js)),Dr=Object.fromEntries(Tr(Qs)),tl={flexGrow:0,flexShrink:1,flexBasis:0,alignSelf:"auto",width:void 0,height:void 0,crossAxisSizing:"auto"},el={top:0,right:0,bottom:0,left:0};class Ir{constructor(t=tl){this.size={width:0,height:0},this.position={x:0,y:0},this.style={flexGrow:t.flexGrow??0,flexShrink:t.flexShrink??1,flexBasis:t.flexBasis??0,alignSelf:t.alignSelf??"auto",width:t.width,height:t.height,crossAxisSizing:t.crossAxisSizing??"auto",id:t.id,metadata:t.metadata},this.id=t.id,this.metadata=t.metadata}}class Hr extends Ir{build(){}}class xt extends Ir{constructor(t,e,i={}){super({}),this.children=[],this.direction="row",this.wrap="nowrap",this.columnGap=0,this.rowGap=0,this.justifyContent="flex-start",this.alignItems="stretch",this.alignContent="stretch",this.padding={top:0,right:0,bottom:0,left:0},this.size.width=t,this.size.height=e,this.id=i.id,i.direction!==void 0&&(this.direction=i.direction),i.wrap!==void 0&&(this.wrap=i.wrap),i.columnGap!==void 0&&(this.columnGap=i.columnGap),i.rowGap!==void 0&&(this.rowGap=i.rowGap),i.justifyContent!==void 0&&(this.justifyContent=i.justifyContent),i.alignItems!==void 0&&(this.alignItems=i.alignItems),i.alignContent!==void 0&&(this.alignContent=i.alignContent),this.padding=Lr(i.padding)}addChild(t,e){if(t instanceof xt){const r=t;if(e){const n=r.style;n.flexGrow=e.flexGrow??0,n.flexShrink=e.flexShrink??1,n.flexBasis=e.flexBasis??0,n.alignSelf=e.alignSelf??"auto",n.width=e.width,n.height=e.height,n.crossAxisSizing=e.crossAxisSizing??"auto"}return this.children.push(r),r}const i=new Hr(t);return this.children.push(i),i}getContainerMetrics(){const t=this.direction==="row"||this.direction==="row-reverse",{left:e,right:i,top:r,bottom:n}=this.padding,{width:s,height:l}=this.size;return t?{main:s-e-i,cross:l-r-n,mainGap:this.columnGap,crossGap:this.rowGap}:{main:l-r-n,cross:s-e-i,mainGap:this.rowGap,crossGap:this.columnGap}}buildFlexLines(t,e){if(this.wrap==="nowrap")return[t];const i=[];let r=[],n=0;for(const s of t){const l=s.style.flexBasis,c=r.length>0?e.mainGap:0;r.length>0&&n+c+l>e.main&&(i.push(r),r=[],n=0),r.push(s),n+=(r.length>1?e.mainGap:0)+l}return r.length>0&&i.push(r),this.wrap==="wrap-reverse"&&i.reverse(),i}measureLineCrossSizes(t,e){const i=[];for(const r of t){let n=0;for(const s of r){if(this.isDeferredCrossAxisPercentChild(s,e))continue;const l=e?s.style.height:s.style.width,c=l!==void 0?l:e?s.size.height:s.size.width;c>n&&(n=c)}i.push(n)}return i}isDeferredCrossAxisPercentChild(t,e){const i=e?t.style.height:t.style.width;return(t.style.alignSelf!=="auto"?t.style.alignSelf:this.alignItems)==="stretch"&&i===void 0&&t.style.crossAxisSizing==="deferred-percent-stretch"}resolveCrossAxisLayout(t,e){const i=t.length,r=t.reduce((u,d)=>u+d,0),n=e.crossGap*(i>1?i-1:0),s=e.cross-r-n;let l=0,c=e.crossGap;if(this.wrap==="nowrap"&&i===1)t[0]=e.cross;else if(this.wrap!=="nowrap"){const{crossStart:u,crossBetween:d}=this.calculateAlignContent(s,i,e.crossGap);if(l=u,c=d,this.alignContent==="stretch"&&s>0){const a=s/i;for(let h=0;h<i;h++)t[h]+=a}}return{crossStart:l,crossBetween:c}}calculateAlignContent(t,e,i){let r=0,n=i;switch(this.alignContent){case"flex-end":r=t;break;case"center":r=t/2;break;case"space-between":n=e>1?i+t/(e-1):0;break;case"space-around":n=i+t/e,r=n/2;break;case"space-evenly":n=i+t/(e+1),r=n;break}return{crossStart:r,crossBetween:n}}distributeMainAxisSizes(t,e,i){let r=0,n=0,s=0;for(const d of t){const a=d.style.flexBasis;r+=a,n+=d.style.flexGrow,s+=d.style.flexShrink*a}const l=t.length>1?e.mainGap*(t.length-1):0,c=e.main-r-l;let u=0;for(const d of t){const{style:a}=d;let h=a.flexBasis;c>0&&n>0?h+=c*a.flexGrow/n:c<0&&s>0&&(h+=c*a.flexShrink*h/s),h<0&&(h=0),i?d.size.width=h:d.size.height=h,u+=h}return{lineMainUsed:u,totalGrow:n}}calculateJustifySpacing(t,e,i,r){let n=0,s=i.mainGap;if(r===0){const l=t>1?i.mainGap*(t-1):0;let c=i.main-e-l;switch(c<0&&(c=0),this.justifyContent){case"flex-end":n=c;break;case"center":n=c/2;break;case"space-between":s=t>1?i.mainGap+c/(t-1):0;break;case"space-around":s=i.mainGap+c/t,n=s/2;break;case"space-evenly":s=i.mainGap+c/(t+1),n=s;break}}return{leading:n,between:s}}getFinalLineHeight(t,e,i){if(this.wrap!=="nowrap")return e;let r=e;for(const n of t){if(this.isDeferredCrossAxisPercentChild(n,i))continue;const s=i?n.style.height:n.style.width,l=s!==void 0?s:i?n.size.height:n.size.width;l>r&&(r=l)}return r}getCrossSize(t,e,i){const r=i?t.style.height:t.style.width,n=t.style.alignSelf!=="auto"?t.style.alignSelf:this.alignItems;return r!==void 0?(i?t.size.height=r:t.size.width=r,r):n==="stretch"?(i?t.size.height=e:t.size.width=e,e):i?t.size.height:t.size.width}positionChildren(t,e,i,r,n,s,l,c,u){const d=this.direction==="row-reverse"||this.direction==="column-reverse",a=d?t.length-1:0,h=d?-1:t.length,f=d?-1:1;let g=n;for(let v=a;v!==h;v+=f){const C=t[v];if(C!==void 0){const x=C.style,y=C.size,w=C.position;if(i){const P=this.direction==="row"?g:e.main-g-y.width;w.x=l+P}else{const P=this.direction==="column"?g:e.main-g-y.height;w.y=c+P}const F=x.alignSelf!=="auto"?x.alignSelf:this.alignItems,E=this.getCrossSize(C,r,i);let b=0;F==="flex-end"?b=r-E:F==="center"&&(b=(r-E)*.5),i?(w.y=c+u+b,g+=y.width+s):(w.x=l+u+b,g+=y.height+s)}}}build(){const{children:t}=this;if(t.length===0)return;const e=this.direction==="row"||this.direction==="row-reverse",i=this.getContainerMetrics(),r=this.buildFlexLines(t,i);if(r.length===0)return;const n=this.measureLineCrossSizes(r,e),{crossStart:s,crossBetween:l}=this.resolveCrossAxisLayout(n,i),c=this.padding.left,u=this.padding.top;let d=s;for(let a=0;a<r.length;a++){const h=r[a];if(h===void 0||h.length===0)continue;const{lineMainUsed:f,totalGrow:g}=this.distributeMainAxisSizes(h,i,e),{leading:v,between:C}=this.calculateJustifySpacing(h.length,f,i,g),x=this.getFinalLineHeight(h,n[a],e);this.positionChildren(h,i,e,x,v,C,c,u,d),d+=x+l}for(const a of t)a instanceof xt&&a.build()}}function Lr(o){return o===void 0?el:typeof o=="number"?{top:o,right:o,bottom:o,left:o}:{top:o.top??0,right:o.right??0,bottom:o.bottom??0,left:o.left??0}}class Yi extends xt{constructor(t,e,i={}){super(t,e,i)}getLayout(){this.build();const t={};return this._collectLayout(this,t,{counter:0}),t}_collectLayout(t,e,i){for(const r of t.children){const n=r.id??`_$$${i.counter++}`;e[n]={position:r.position,size:r.size},r instanceof xt&&this._collectLayout(r,e,i)}}}const ne={direction:"row",columnGap:0,rowGap:0,justifyContent:"flex-start",alignItems:"stretch"};function Pr(o){const t=o;return{id:o.id,direction:t.direction??ne.direction,columnGap:t.columnGap??ne.columnGap,rowGap:t.rowGap??ne.rowGap,justifyContent:t.justifyContent??ne.justifyContent,alignItems:t.alignItems??ne.alignItems}}function Br(o,t){if(t!=null&&t.length)for(const e of t)if(e.children&&e.children.length>0){const i=new xt(e.width??0,e.height??0,Pr(e));o.addChild(i,e),Br(i,e.children)}else o.addChild(e)}const il=o=>{const t=o.width??0,e=o.height??0,i=Pr(o),r=new Yi(t,e,i);return Br(r,o.children),r.getLayout()},Ye=class Ye{constructor(t){this.debugColor="magenta",this.parent=null,this.children=[],this.rect={x:0,y:0,width:0,height:0},this.zIndex=0,this._intrinsicWidth=0,this._intrinsicHeight=0,this._layoutDirty=!0,this._measureDirty=!0,this._style={flexGrow:0,flexShrink:1,flexBasis:0,alignSelf:"auto"},this._position="static",this.backgroundColor="transparent",this.borderColor="transparent",this.borderWidth=0,this.portalHoverEnabled=!1,this.id=t}get style(){return this._style}set style(t){this._style=t,this.markLayoutDirty()}get position(){return this._position}set position(t){this._position!==t&&(this._position=t,this.markLayoutDirty())}get left(){return this._left}set left(t){this._left!==t&&(this._left=t,this.markLayoutDirty())}get top(){return this._top}set top(t){this._top!==t&&(this._top=t,this.markLayoutDirty())}get right(){return this._right}set right(t){this._right!==t&&(this._right=t,this.markLayoutDirty())}get bottom(){return this._bottom}set bottom(t){this._bottom!==t&&(this._bottom=t,this.markLayoutDirty())}isAbsolute(){return this._position==="absolute"}isPositioningContext(){return this._position!=="static"}markLayoutDirty(){var t;this._layoutDirty||(this._layoutDirty=!0,(t=this.parent)==null||t.markLayoutDirty())}markMeasureDirty(){this._measureDirty||(this._measureDirty=!0,this.markLayoutDirty())}isLayoutDirty(){return this._layoutDirty}isMeasureDirty(){return this._measureDirty}clearLayoutDirty(){this._layoutDirty=!1}clearMeasureDirty(){this._measureDirty=!1}addChild(t){this.attachChild(t,(e,i)=>e.push(i))}addChildStart(t){this.attachChild(t,(e,i)=>e.unshift(i))}removeChild(t){const e=this.children.indexOf(t);e!==-1&&(this.children.splice(e,1),t.parent=null,this.markLayoutDirty())}getTooltip(){return this.tooltip}paint(t,e){const i=t.getZIndex();t.setZIndex(i+this.zIndex),this.onPaint(t,e),Ye.DEBUG&&t.strokeRect(this.rect.x,this.rect.y,this.rect.width,this.rect.height,this.debugColor,1),t.setZIndex(i)}hitTest(t,e){const i=[];return this.collectHitCandidates(t,e,0,{value:0},i),i.sort((r,n)=>n.cumulativeZIndex-r.cumulativeZIndex||n.order-r.order),i.map(({node:r})=>r)}requestLayout(){this.parent&&this.parent.requestLayout()}requestPaint(){this.parent&&this.parent.requestPaint()}onClick(t){}onMouseDown(t){}onMouseUp(t){}onMouseEnter(t){}onMouseLeave(t){}onMouseMove(t){}onDoubleClick(t){}attachChild(t,e){t.parent=this,e(this.children,t),this.markLayoutDirty()}collectHitCandidates(t,e,i,r,n){if(!this.containsHitPoint(t,e))return;const s=i+this.zIndex;n.push({node:this,cumulativeZIndex:s,order:r.value}),r.value+=1;for(const l of this.children)l.collectHitCandidates(t,e,s,r,n)}containsHitPoint(t,e){return t>=this.rect.x&&t<=this.rect.x+this.rect.width&&e>=this.rect.y&&e<=this.rect.y+this.rect.height}};Ye.DEBUG=!1;let _t=Ye;class _r{constructor(){this.defaultFlexStyle={flexGrow:0,flexShrink:1,flexBasis:0,alignSelf:"auto",width:void 0,height:void 0,crossAxisSizing:"auto"}}build(t,e,i){const r=i??t.children.filter(c=>!c.isAbsolute()),n=r.length,s=e.direction,l=s==="row"||s==="row-reverse";for(let c=0;c<n;c+=1){const u=r[c],d=u.style,a=this.extractChildFlexProperties(u,d);this.handlePercentageDimensions(a,d.width,d.height,l,u.rect),this.defaultFlexStyle.flexGrow=a.flexGrow,this.defaultFlexStyle.flexShrink=a.flexShrink,this.defaultFlexStyle.flexBasis=a.flexBasis,this.defaultFlexStyle.alignSelf=a.alignSelf,this.defaultFlexStyle.width=a.width,this.defaultFlexStyle.height=a.height,this.defaultFlexStyle.crossAxisSizing=a.crossAxisSizing,this.isContainer(u)?this.addContainerChild(u,e):this.addLeafChild(u,e)}}extractChildFlexProperties(t,e){const i=e.flexGrow??0,r=e.flexShrink??1,n=e.flexBasis??0;return{width:typeof e.width=="number"?e.width:void 0,height:typeof e.height=="number"?e.height:void 0,flexGrow:i,flexShrink:r,flexBasis:n,alignSelf:e.alignSelf??"auto",crossAxisSizing:"auto"}}handlePercentageDimensions(t,e,i,r,n){e==="100%"&&(r?(t.width=void 0,t.flexGrow===0&&(t.flexGrow=1)):(t.width=void 0,t.alignSelf="stretch",t.crossAxisSizing="deferred-percent-stretch")),i==="100%"&&(r?(t.height=void 0,t.alignSelf="stretch",t.crossAxisSizing="deferred-percent-stretch"):(t.height=void 0,t.flexGrow===0&&(t.flexGrow=1))),t.flexBasis===0&&(t.flexBasis=r?n.width:n.height)}isContainer(t){return"flexOptions"in t}addContainerChild(t,e){const i=new xt(0,0,t.flexOptions);i.size.width=t.rect.width,i.size.height=t.rect.height,e.addChild(i,this.defaultFlexStyle),this.build(t,i)}addLeafChild(t,e){const i=e.addChild(this.defaultFlexStyle);i.size.width=t.rect.width,i.size.height=t.rect.height}}const De=.5;class Rr{constructor(t){this.positionResolver=t}reconcile(t,e,i,r,n,s=!1){let l=!1;const{parent:c}=e,u=c!==null?c.rect:n;l=this.updateNodePosition(e,i,u??e.rect);const d=r??e.children.filter(h=>!h.isAbsolute()),a=d.length>0;if(a&&i instanceof xt){const h=this.reconcileChildLayouts(t,d,i,n);if(l=l||h,this.isContainer(e)&&!s){const f=this.updateContainerFromContent(e,i);l=l||f}}else if(!a){const h=this.remeasureAndUpdateLeaf(t,e,i);l=l||h}return this.positionNestedAbsoluteChildren(t,e),l}updateNodePosition(t,e,i){const r=t.rect,n=e.position,s=e.size;r.x=i.x+n.x,r.y=i.y+n.y;const l=r.width!==s.width,c=r.height!==s.height;return r.width=s.width,r.height=s.height,l||c}reconcileChildLayouts(t,e,i,r){let n=!1;const s=i.children,l=e.length;for(let c=0;c<l;c+=1){const u=this.reconcile(t,e[c],s[c],void 0,r);n=n||u}return n}updateContainerFromContent(t,e){const i=this.getContainerCachedIsRow(t),r=this.getContainerCachedPadding(t),n=e.children,s=n.length;let l=0;if(i){for(let h=0;h<s;h+=1){const f=n[h],g=f.position.y+f.size.height;g>l&&(l=g)}const c=l>0?l+r.bottom:0,u=t.style.height;if(u==="100%")return!1;const d=typeof u=="number"?u:0,a=c>d?c:d;if(a>t.rect.height+De)return t.rect.height=a,this.syncFlexNodeSizeFromRect(t,e,!1,!0),!0}else{let c=0;for(let C=0;C<s;C+=1){const x=n[C],y=x.position.x+x.size.width,w=x.position.y+x.size.height;y>l&&(l=y),w>c&&(c=w)}const u=l>0?l+r.right:0,d=t.style.width;let a=!1,h=!1,f=!1;if(d!=="100%"){const C=typeof d=="number"?d:0,x=u>C?u:C;x>t.rect.width+De&&(t.rect.width=x,a=!0,h=!0)}const g=c>0?c+r.bottom:0,v=t.style.height;if(v!=="100%"){const C=typeof v=="number"?v:0,x=g>C?g:C;x>t.rect.height+De&&(t.rect.height=x,a=!0,f=!0)}return a&&this.syncFlexNodeSizeFromRect(t,e,h,f),a}return!1}syncFlexNodeSizeFromRect(t,e,i,r){i&&(e.size.width=t.rect.width),r&&(e.size.height=t.rect.height),this.syncAutoMainAxisFlexBasis(t,e,i,r)}syncAutoMainAxisFlexBasis(t,e,i,r){const n=t.parent;if(n===null||!this.isContainer(n)||t.style.flexBasis!==void 0&&t.style.flexBasis!==0)return;const s=this.getContainerCachedIsRow(n);s&&i?e.style.flexBasis=t.rect.width:!s&&r&&(e.style.flexBasis=t.rect.height)}remeasureAndUpdateLeaf(t,e,i){const r=e.rect.height,n=e.rect.width;e.measure(t),e.rect.width=n;const s=e.rect.height-r;return Math.abs(s)>De?(this.syncFlexNodeSizeFromRect(e,i,!1,!0),!0):!1}positionNestedAbsoluteChildren(t,e){if(!this.isContainer(e)||!e.isPositioningContext())return;const i=e,n=i.children.filter(l=>l.isAbsolute());if(n.length===0)return;const s=this.getContainerCachedPadding(i);this.positionResolver.positionAbsoluteChildren(i.rect,s,n,l=>l.measure(t),l=>this.layoutAbsoluteChildSubtree(t,l))}layoutAbsoluteChildSubtree(t,e){if(!this.isContainer(e))return;const i=e.parent;e.parent=null;try{e.performLayout(t,!0)}finally{e.parent=i}}isContainer(t){return"flexOptions"in t}getContainerCachedIsRow(t){return t.cachedIsRow??!0}getContainerCachedPadding(t){return t.cachedPadding??{top:0,right:0,bottom:0,left:0}}}class St{static resolvePositionValue(t,e){if(t!==void 0){if(typeof t=="number")return t;if(typeof t=="string"&&t.endsWith("%"))return parseFloat(t)/100*e}}static applyAxisPositioning(t,e,i,r,n){const s=n?e.x:e.y,l=s+(n?e.width:e.height),c=n?e.width:e.height;if(i!==void 0&&r!==void 0){const u=Math.max(0,c-i-r);n?(t.x=s+i,t.width=u):(t.y=s+i,t.height=u)}else i!==void 0&&(n?t.x=s+i:t.y=s+i);r!==void 0&&i===void 0?n?t.x=l-t.width-r:t.y=l-t.height-r:r===void 0&&i===void 0&&(n?t.x=s:t.y=s)}applyAbsolutePositioning(t,e){const i=St.resolvePositionValue(t.left,e.width),r=St.resolvePositionValue(t.right,e.width),n=St.resolvePositionValue(t.top,e.height),s=St.resolvePositionValue(t.bottom,e.height),l=t.rect;St.applyAxisPositioning(l,e,i,r,!0),St.applyAxisPositioning(l,e,n,s,!1)}positionAbsoluteChildren(t,e,i,r,n){const s={x:t.x+e.left,y:t.y+e.top,width:t.width-e.left-e.right,height:t.height-e.top-e.bottom};for(const l of i)r(l),this.applyAbsolutePositioning(l,s),n==null||n(l)}}class qe{constructor(){this.width=0,this.height=0,this.maxCrossSize=0,this.childCount=0,this.isRow=!0}reset(){this.width=0,this.height=0,this.maxCrossSize=0,this.childCount=0,this.isRow=!0}accumulate(t,e){this.isRow=e,e?(this.width+=t.width,this.maxCrossSize=Math.max(this.maxCrossSize,t.height)):(this.height+=t.height,this.maxCrossSize=Math.max(this.maxCrossSize,t.width)),this.childCount+=1}addGap(t,e){if(this.childCount>1){const i=t*(this.childCount-1);e?this.width+=i:this.height+=i}}getSize(){return this.isRow?{width:this.width,height:this.maxCrossSize}:{width:this.maxCrossSize,height:this.height}}static computeIntrinsicSize(t,e,i){const r=new qe;for(const n of t)r.accumulate(n,e);return r.addGap(i,e),r.getSize()}}const ol=3,kr={top:0,right:0,bottom:0,left:0},rl=o=>o===void 0||o==="row"||o==="row-reverse",Mr=o=>o===void 0?kr:typeof o=="number"?{top:o,right:o,bottom:o,left:o}:{top:o.top??0,right:o.right??0,bottom:o.bottom??0,left:o.left??0};class gt extends _t{constructor(t,e={},i="transparent"){super(t),this.cachedPadding=kr,this.cachedIsRow=!0,this.cachedGap=0,this.optionsCacheValid=!1,this.flexOptionsValue=e,this.positionResolver=new St,this.flexTreeBuilder=new _r,this.layoutReconciler=new Rr(this.positionResolver),this.invalidateOptionsCache(),this.backgroundColor=i}get flexOptions(){return this.flexOptionsValue}set flexOptions(t){this.flexOptionsValue=t,this.invalidateOptionsCache(),this.markLayoutDirty()}setFlexOptions(t){Object.assign(this.flexOptionsValue,t),this.invalidateOptionsCache(),this.markLayoutDirty()}invalidateOptionsCache(){this.optionsCacheValid=!1}ensureOptionsCache(){if(this.optionsCacheValid)return;const t=this.flexOptionsValue;this.cachedIsRow=rl(t.direction),this.cachedGap=this.cachedIsRow?t.columnGap??0:t.rowGap??0,this.cachedPadding=Mr(t.padding),this.optionsCacheValid=!0}measure(t){this.measureChildren(t),this.computeIntrinsicSize(),this.applySizeConstraints(),this.clearMeasureDirty()}measureChildren(t){const{children:e}=this;for(let i=0;i<e.length;i+=1)e[i].measure(t)}computeIntrinsicSize(){this.ensureOptionsCache();const{layoutChildren:t}=this.separateChildrenByLayoutMode(),e=t.map(s=>s.rect),{width:i,height:r}=qe.computeIntrinsicSize(e,this.cachedIsRow,this.cachedGap),n=this.cachedPadding;this._intrinsicWidth=i+n.left+n.right,this._intrinsicHeight=r+n.top+n.bottom}applySizeConstraints(){const{style:t}=this,e=this.resolveStyleDimension(t.width,"width"),i=this.resolveStyleDimension(t.height,"height");this.rect.width=e??this._intrinsicWidth,this.rect.height=i??this._intrinsicHeight,e===void 0&&this.clampWidthToParent()}resolveStyleDimension(t,e){if(typeof t=="number")return t;if(t!=="100%")return;const i=this.resolveParentContentSize(e);return i!==void 0?i:this.rect[e]>0?this.rect[e]:void 0}resolveParentContentSize(t){const{parent:e}=this;if(!(e instanceof gt))return e!=null&&e.rect[t]&&e.rect[t]>0?e.rect[t]:void 0;e.ensureOptionsCache();const i=e.cachedPadding,r=t==="width"?i.left+i.right:i.top+i.bottom,n=e.rect[t]-r;return n>0?n:void 0}performLayout(t,e=!1){if(e?(this.measureChildren(t),this.clearMeasureDirty()):this.measure(t),this.children.length===0){this.clearLayoutDirty();return}const{layoutChildren:i,absoluteChildren:r}=this.separateChildrenByLayoutMode();i.length>0&&this.layoutPhase1Flexbox(t,i,e),r.length>0&&this.isPositioningContext()&&this.layoutPhase2Absolute(t,r),this.clearLayoutDirty()}layoutPhase1Flexbox(t,e,i=!1){const r=new Yi(this.rect.width,this.rect.height,this.flexOptionsValue);this.flexTreeBuilder.build(this,r,e);let n=0,s;do r.build(),s=this.layoutReconciler.reconcile(t,this,r,e,this.rect,i),n+=1;while(s&&n<ol)}layoutPhase2Absolute(t,e){this.ensureOptionsCache(),this.positionResolver.positionAbsoluteChildren(this.rect,this.cachedPadding,e,i=>i.measure(t),i=>this.layoutAbsoluteChildSubtree(t,i))}layoutAbsoluteChildSubtree(t,e){if(!(e instanceof gt))return;const i=e.parent;e.parent=null;try{e.performLayout(t,!0)}finally{e.parent=i}}clampWidthToParent(){const{parent:t}=this;if(t===null||t.rect.width<=0)return;let e=t.rect.width;t instanceof gt&&(t.ensureOptionsCache(),e-=t.cachedPadding.left+t.cachedPadding.right),e=Math.max(0,e),this.rect.width>e&&(this.rect.width=e)}separateChildrenByLayoutMode(){const t=[],e=[];for(const i of this.children)i.isAbsolute()?e.push(i):t.push(i);return{layoutChildren:t,absoluteChildren:e}}onPaint(t,e){this.backgroundColor!=="transparent"&&t.fillRect(this.rect.x,this.rect.y,this.rect.width,this.rect.height,this.backgroundColor);for(const i of this.children)i.paint(t,e)}}const nl={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},sl=(o,t)=>({minX:Math.min(o.minX,t.rect.x),minY:Math.min(o.minY,t.rect.y),maxX:Math.max(o.maxX,t.rect.x+t.rect.width),maxY:Math.max(o.maxY,t.rect.y+t.rect.height)}),ll=o=>o.minX===1/0||o.maxX===-1/0;class cl extends gt{performLayout(t){const e=this.layoutChildren(t);if(!e){this.clearLayoutDirty();return}this.expandToFitBounds(e),this.clearLayoutDirty()}layoutChildren(t){let e={...nl};return this.children.forEach(i=>{i instanceof gt?i.performLayout(t):i.measure(t),e=sl(e,i)}),ll(e)?null:e}expandToFitBounds(t){const e=t.maxX-this.rect.x,i=t.maxY-this.rect.y;e>this.rect.width&&(this.rect.width=e),i>this.rect.height&&(this.rect.height=i)}onPaint(t,e){this.backgroundColor&&this.backgroundColor!=="transparent"&&t.fillRect(this.rect.x,this.rect.y,this.rect.width,this.rect.height,this.backgroundColor),this.borderWidth>0&&this.borderColor&&this.borderColor!=="transparent"&&t.strokeRect(this.rect.x+this.borderWidth/2,this.rect.y+this.borderWidth/2,this.rect.width-this.borderWidth,this.rect.height-this.borderWidth,this.borderColor,this.borderWidth),super.onPaint(t,e)}}class qi{constructor(t={}){this.options=t,this.hoveredNode=null,this.activePortalNode=null,this.currentCursor="default",this.bounds=null}setAbsoluteBounds(t){this.bounds=t?{...t}:null}handlePointerMove(t,e){this.transitionHover(t[0],e),this.updateCursor(t)}handlePointerLeave(){this.transitionHover(void 0,null),this.updateCursor([])}handlePortalReset(){this.activePortalNode&&this.dispatchPortalHover({visible:!1,x:0,y:0,width:0,height:0,originId:this.activePortalNode.id,source:this.options.portalSource}),this.activePortalNode=null}computeCursor(t,e,i){var n;const r=i.hitTest(t,e);for(const s of r){const l=(n=s.style)==null?void 0:n.cursor;if(l)return l}return"default"}getCurrentCursor(){return this.currentCursor}transitionHover(t,e){if(this.hoveredNode===t){this.updatePortalHover(t,e);return}this.hoveredNode&&this.hoveredNode.onMouseLeave(this.buildEvent("mouseleave",this.hoveredNode,e)),t&&t.onMouseEnter(this.buildEvent("mouseenter",t,e)),this.hoveredNode=t??null,this.updatePortalHover(t,e)}buildEvent(t,e,i){return i?{...i,type:t,target:e,currentTarget:e}:{type:t,x:0,y:0,originalEvent:{},stopPropagation:()=>{},preventDefault:()=>{},target:e,currentTarget:e}}updateCursor(t){var i,r,n;let e="default";for(const s of t){const l=(i=s.style)==null?void 0:i.cursor;if(l){e=l;break}}e!==this.currentCursor&&(this.currentCursor=e,(n=(r=this.options).onCursorChange)==null||n.call(r,e))}findPortalTarget(t){let e=t;for(;e;){if(e.portalHoverEnabled)return e;e=e.parent}return null}updatePortalHover(t,e=null){var l,c,u,d,a,h;const i=this.findPortalTarget(t),r=i?{...i.rect}:null,n=this.activePortalNode,s=i&&r?{id:i.id,rect:r}:null;if(i&&(n==null?void 0:n.id)===i.id){(c=(l=this.options).onPortalTargetChange)==null||c.call(l,i,e);return}if(this.activePortalNode=s,(d=(u=this.options).onPortalTargetChange)==null||d.call(u,i??null,e),!!this.options.portalHoverDispatch)if(i&&r&&this.bounds){const f=((h=(a=this.options).getTooltipContext)==null?void 0:h.call(a))??void 0;this.dispatchPortalHover({visible:!0,x:this.bounds.x+r.x,y:this.bounds.y+r.y,width:r.width,height:r.height,nodeId:i.id,originId:i.id,source:this.options.portalSource,tooltipContext:f,tooltipFromNode:i.getTooltip(),priority:1})}else n&&this.dispatchPortalHover({visible:!1,x:0,y:0,width:0,height:0,originId:n.id,source:this.options.portalSource})}dispatchPortalHover(t){var i,r,n,s;const e=((r=(i=this.options).getPortalEventTarget)==null?void 0:r.call(i))??null;(s=(n=this.options).portalHoverDispatch)==null||s.call(n,t,e)}}class bt extends _t{addChild(){throw new Error("CanvasLeaf cannot have children")}}const ce={selection:"normal",cellClick:"normal",editor:"normal",contextMenu:"normal"};function al(o){return o.selection!==void 0||o.cellClick!==void 0||o.editor!==void 0||o.contextMenu!==void 0}function zr(o){if(!o||!al(o))return;const t={selection:o.selection??ce.selection,cellClick:o.cellClick??ce.cellClick,editor:o.editor??ce.editor,contextMenu:o.contextMenu??ce.contextMenu};return t.editor==="open-on-click"&&t.selection==="keep"&&(console.warn('[TableCanvas interaction] `editor: "open-on-click"` требует обычного selection. Editor не будет открыт, чтобы не менять выделение неожиданно.'),t.editor="normal"),t.editor==="open-on-click"&&t.cellClick==="stop"&&(console.warn('[TableCanvas interaction] `editor: "open-on-click"` требует обычного cellClick, потому что editor открывается через click pipeline таблицы. Editor не будет открыт.'),t.editor="normal"),t}function Or(){return{...ce}}class Nr{constructor(){this.nodes=new Map,this.listeners=new Set}register(t,e){this.nodes.set(t,e),this.notify(t)}unregister(t){this.nodes.delete(t)}get(t){return this.nodes.get(t)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(t){this.listeners.forEach(e=>e(t))}}function ul(o,t){return o.zIndex!==t.zIndex?o.zIndex-t.zIndex:o.order-t.order}const Uo=typeof Path2D<"u"&&typeof CanvasRenderingContext2D.prototype.roundRect=="function";class Ke{constructor(){this.commands=[],this.orderCounter=0,this.currentZIndex=0}setAnimationContext(t){return this.animationContext=t,this}getAnimationContext(){return this.animationContext}setZIndex(t){return this.currentZIndex=t,this}getZIndex(){return this.currentZIndex}pushZIndex(t=1){return this.currentZIndex+=t,this}popZIndex(t=1){return this.currentZIndex-=t,this}fillRect(t,e,i,r,n){return this.commands.push({type:"fillRect",x:t,y:e,width:i,height:r,fillStyle:n,zIndex:this.currentZIndex,order:this.orderCounter++}),this}strokeRect(t,e,i,r,n,s=1){return this.commands.push({type:"strokeRect",x:t,y:e,width:i,height:r,strokeStyle:n,lineWidth:s,zIndex:this.currentZIndex,order:this.orderCounter++}),this}fillText(t,e,i,r,n,s="middle",l){return this.commands.push({type:"fillText",text:t,x:e,y:i,font:r,fillStyle:n,textBaseline:s,textAlign:l,zIndex:this.currentZIndex,order:this.orderCounter++}),this}fillTextClipped(t,e,i,r,n,s,l="middle",c){return this.commands.push({type:"fillTextClipped",text:t,x:e,y:i,font:r,fillStyle:n,textBaseline:l,textAlign:c,clipX:s.x,clipY:s.y,clipWidth:s.width,clipHeight:s.height,zIndex:this.currentZIndex,order:this.orderCounter++}),this}drawImage(t,e,i,r,n){return this.commands.push({type:"drawImage",image:t,x:e,y:i,width:r,height:n,zIndex:this.currentZIndex,order:this.orderCounter++}),this}roundedRect(t,e,i,r,n,s){return this.commands.push({type:"roundedRect",x:t,y:e,width:i,height:r,radius:n,fillStyle:s==null?void 0:s.fillStyle,strokeStyle:s==null?void 0:s.strokeStyle,lineWidth:s==null?void 0:s.lineWidth,zIndex:this.currentZIndex,order:this.orderCounter++}),this}linearGradientRect(t,e,i,r,n,s,l=90){return this.commands.push({type:"linearGradientRect",x:t,y:e,width:i,height:r,radius:n,gradientStops:s,angle:l,zIndex:this.currentZIndex,order:this.orderCounter++}),this}custom(t){return this.commands.push({type:"custom",fn:t,zIndex:this.currentZIndex,order:this.orderCounter++}),this}clear(){return this.commands.length=0,this.orderCounter=0,this.currentZIndex=0,this.animationContext=void 0,this}get commandCount(){return this.commands.length}flush(t){const{commands:e}=this,i=e.length;if(i===0)return;e.sort(ul);let r="",n="",s=-1,l="",c="",u="";for(let d=0;d<i;d++){const a=e[d];if(a!==void 0)switch(a.type){case"fillRect":r!==a.fillStyle&&(t.fillStyle=a.fillStyle,r=a.fillStyle),t.fillRect(a.x,a.y,a.width,a.height);break;case"strokeRect":n!==a.strokeStyle&&(t.strokeStyle=a.strokeStyle,n=a.strokeStyle),s!==a.lineWidth&&(t.lineWidth=a.lineWidth,s=a.lineWidth),t.strokeRect(a.x,a.y,a.width,a.height);break;case"fillText":l!==a.font&&(t.font=a.font,l=a.font),r!==a.fillStyle&&(t.fillStyle=a.fillStyle,r=a.fillStyle),c!==a.textBaseline&&(t.textBaseline=a.textBaseline,c=a.textBaseline),a.textAlign&&u!==a.textAlign&&(t.textAlign=a.textAlign,u=a.textAlign),t.fillText(a.text,a.x,a.y);break;case"fillTextClipped":l!==a.font&&(t.font=a.font,l=a.font),r!==a.fillStyle&&(t.fillStyle=a.fillStyle,r=a.fillStyle),c!==a.textBaseline&&(t.textBaseline=a.textBaseline,c=a.textBaseline),a.textAlign&&u!==a.textAlign&&(t.textAlign=a.textAlign,u=a.textAlign),this.executeFillTextClipped(t,a);break;case"drawImage":t.drawImage(a.image,a.x,a.y,a.width,a.height);break;case"roundedRect":this.executeRoundedRect(t,a),a.fillStyle&&(r=a.fillStyle),a.strokeStyle&&(n=a.strokeStyle),a.lineWidth!==void 0&&(s=a.lineWidth);break;case"linearGradientRect":this.executeLinearGradientRect(t,a);break;case"custom":a.fn(t),r="",n="",s=-1,l="",c="",u="";break}}this.clear()}executeLinearGradientRect(t,e){const{x:i,y:r,width:n,height:s,radius:l,gradientStops:c,angle:u}=e,d=(u-90)*Math.PI/180,a=Math.cos(d),h=Math.sin(d),f=n/2,g=s/2,v=i+f,C=r+g,y=(Math.abs(a*n)+Math.abs(h*s))/2,w=v-a*y,F=C-h*y,E=v+a*y,b=C+h*y,P=t.createLinearGradient(w,F,E,b);for(const T of c)P.addColorStop(T.offset,T.color);if(t.fillStyle=P,l>0)if(Uo)t.beginPath(),t.roundRect(i,r,n,s,l),t.fill();else{const T=l,B=i+n,O=r+s;t.beginPath(),t.moveTo(i+T,r),t.lineTo(B-T,r),t.quadraticCurveTo(B,r,B,r+T),t.lineTo(B,O-T),t.quadraticCurveTo(B,O,B-T,O),t.lineTo(i+T,O),t.quadraticCurveTo(i,O,i,O-T),t.lineTo(i,r+T),t.quadraticCurveTo(i,r,i+T,r),t.closePath(),t.fill()}else t.fillRect(i,r,n,s)}executeFillTextClipped(t,e){e.clipWidth<=0||e.clipHeight<=0||e.text.length===0||(t.save(),t.beginPath(),t.rect(e.clipX,e.clipY,e.clipWidth,e.clipHeight),t.clip(),t.fillText(e.text,e.x,e.y),t.restore())}executeRoundedRect(t,e){const{x:i,y:r,width:n,height:s,radius:l,fillStyle:c,strokeStyle:u,lineWidth:d}=e;if(Uo)t.beginPath(),t.roundRect(i,r,n,s,l);else{const a=l,h=i+n,f=r+s;t.beginPath(),t.moveTo(i+a,r),t.lineTo(h-a,r),t.quadraticCurveTo(h,r,h,r+a),t.lineTo(h,f-a),t.quadraticCurveTo(h,f,h-a,f),t.lineTo(i+a,f),t.quadraticCurveTo(i,f,i,f-a),t.lineTo(i,r+a),t.quadraticCurveTo(i,r,i+a,r),t.closePath()}c&&(t.fillStyle=c,t.fill()),u&&(t.strokeStyle=u,d!==void 0&&(t.lineWidth=d),t.stroke())}}const hl=new Ke;class dl{constructor(t,e){this.eventHandlers=new Map,this.batcher=new Ke,this.canvas=t,this.ctx=t.getContext("2d",{alpha:!1}),this.rootNode=e,this.hoverController=new qi({onCursorChange:i=>{var r;return(r=this.onCursorChange)==null?void 0:r.call(this,i)},onPortalTargetChange:(i,r)=>{var n;return(n=this.onPortalHoverTargetChange)==null?void 0:n.call(this,i,r)}}),this.setupEvents()}setupEvents(){["click","mousedown","mouseup","mousemove","dblclick"].forEach(e=>{const i=r=>this.dispatchPointerEvent(r,e);this.eventHandlers.set(e,i),this.canvas.addEventListener(e,i)})}destroy(){this.eventHandlers.forEach((t,e)=>{this.canvas.removeEventListener(e,t)}),this.eventHandlers.clear()}dispatchPointerEvent(t,e){const{x:i,y:r}=this.getEventCoords(t),n=this.rootNode.hitTest(i,r),s=n[0];let l=!1;const c={type:e,x:i,y:r,originalEvent:t,target:s,stopPropagation:()=>{l=!0},preventDefault:()=>t.preventDefault()};this.bubbleEvent(n,c,e,()=>l),e==="mousemove"&&(this.dispatchMouseMove(n,c,()=>l),this.hoverController.handlePointerMove(n,c))}getEventCoords(t){const e=this.canvas.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}bubbleEvent(t,e,i,r){t.length!==0&&this.dispatchToNodes(t,e,(n,s)=>this.invokePointerHandler(n,i,s),r)}dispatchMouseMove(t,e,i){this.dispatchToNodes(t,e,(r,n)=>r.onMouseMove(n),i)}dispatchToNodes(t,e,i,r){for(const n of t){if(r())break;i(n,{...e,currentTarget:n})}}invokePointerHandler(t,e,i){switch(e){case"click":t.onClick(i);break;case"mousedown":t.onMouseDown(i);break;case"mouseup":t.onMouseUp(i);break;case"dblclick":t.onDoubleClick(i);break}}render(){const t=window.devicePixelRatio||1,e=this.canvas.getBoundingClientRect();this.clearCanvas(),this.applyResolutionScale(t),this.updateRootRect(e),this.layoutRoot(),this.batcher.clear(),this.rootNode.paint(this.batcher,this.ctx),this.batcher.flush(this.ctx)}clearCanvas(){this.ctx.fillStyle="#ffffff",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)}applyResolutionScale(t){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.scale(t,t)}updateRootRect(t){this.rootNode.rect.width=t.width,this.rootNode.rect.height=t.height,this.rootNode.rect.x=0,this.rootNode.rect.y=0}layoutRoot(){this.rootNode instanceof gt?this.rootNode.performLayout(this.ctx):this.rootNode.measure(this.ctx)}}const it={xs:{height:24,fontSize:12,borderRadius:4,paddingX:8,iconSize:14},s:{height:32,fontSize:13,borderRadius:6,paddingX:12,iconSize:16},m:{height:40,fontSize:14,borderRadius:8,paddingX:16,iconSize:18},l:{height:48,fontSize:16,borderRadius:10,paddingX:20,iconSize:20}};function Wr(o){return{default:{bgColor:o.surfaceSolidDefault,bgColorHover:o.surfaceSolidDefault,borderColor:o.surfaceSolidDefault,textColor:o.inverseTextPrimary,iconColor:o.inverseTextPrimary},primary:{bgColor:o.surfaceSolidDefault,bgColorHover:o.surfaceSolidDefault,borderColor:o.surfaceSolidDefault,textColor:o.inverseTextPrimary,iconColor:o.inverseTextPrimary},accent:{bgColor:o.surfaceAccent,bgColorHover:o.surfaceAccentHover,borderColor:o.surfaceAccent,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},secondary:{bgColor:o.surfaceTransparentSecondary,bgColorHover:o.surfaceTransparentSecondaryHover,borderColor:"transparent",textColor:o.textPrimary,iconColor:o.textPrimary},clear:{bgColor:o.surfaceClear,bgColorHover:o.surfaceTransparentSecondaryHover,borderColor:"transparent",textColor:o.textPrimary,iconColor:o.textPrimary},success:{bgColor:o.surfacePositive,bgColorHover:o.surfacePositiveHover,borderColor:o.surfacePositive,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},warning:{bgColor:o.surfaceWarning,bgColorHover:o.surfaceWarningHover,borderColor:o.surfaceWarning,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},critical:{bgColor:o.surfaceNegative,bgColorHover:o.surfaceNegativeHover,borderColor:o.surfaceNegative,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},dark:{bgColor:o.onLightSurfaceTransparentDeep,bgColorHover:o.onLightSurfaceTransparentDeep,borderColor:o.onLightSurfaceTransparentDeep,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},black:{bgColor:o.onLightSurfaceSolidDefault,bgColorHover:o.onLightSurfaceSolidDefault,borderColor:o.onLightSurfaceSolidDefault,textColor:o.onDarkTextPrimary,iconColor:o.onDarkTextPrimary},white:{bgColor:o.onDarkSurfaceSolidDefault,bgColorHover:o.onDarkSurfaceSolidDefault,borderColor:o.onDarkSurfaceSolidDefault,textColor:o.onLightTextPrimary,iconColor:o.onLightTextPrimary}}}const Xo={bgColor:"#060A0C",bgColorHover:"#13181B",borderColor:"transparent",textColor:"#FFFFFF",textColorHover:"#F2F5F893",iconColor:"#FFFFFF",iconColorHover:"#F2F5F893"},Ze={default:Xo,primary:{bgColor:"#060A0C",bgColorHover:"#111C22",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},accent:{bgColor:"#118CDF",bgColorHover:"#1798EE",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},secondary:{bgColor:"#ADB9C238",bgColorHover:"#ADB9C247",borderColor:"transparent",textColor:"#060A0C",iconColor:"#060A0C"},clear:{bgColor:"transparent",bgColorHover:"rgba(6, 10, 12, 0.08)",borderColor:"transparent",textColor:"#060A0C",iconColor:"#060A0C"},success:{bgColor:"#1A9E32",bgColorHover:"#1EB83A",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},warning:{bgColor:"#FA5F05",bgColorHover:"#FB782D",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},critical:{bgColor:"#FF293E",bgColorHover:"#FF5263",borderColor:"transparent",textColor:"#FFFFFF",iconColor:"#FFFFFF"},dark:{bgColor:"#30373CC7",bgColorHover:"#30373CC7",borderColor:"transparent",textColor:"#FFFFFF",textColorHover:"#F2F5F893",iconColor:"#FFFFFF",iconColorHover:"#F2F5F893"},black:Xo,white:{bgColor:"#FFFFFF",bgColorHover:"#FFFFFF",borderColor:"transparent",textColor:"#060A0C",textColorHover:"#13181B93",iconColor:"#060A0C",iconColorHover:"#13181B93"}},Qt=4,te=4,Gr=16,Ki=20,Zi=4,At=1,ji=6,fl=4,je="s",Je="default",Ji="#d32f2f",ge="#ffffff",$r="rgba(30, 136, 229, 0.08)",Ai="#ffffff",Ur="#E8EEF2",Xr="#D5DFE6",Ei="#8A959D",Qi="|",Vr="#",Yr=35,to=15,Ti=new Map,Di=new Map;function eo(o,t){if(o.charCodeAt(0)===Yr){const e=parseInt(o.slice(1),16),i=Math.min(255,(e>>16&255)+t),r=Math.min(255,(e>>8&255)+t),n=Math.min(255,(e&255)+t);return`${Vr}${(i<<16|r<<8|n).toString(16).padStart(6,"0")}`}return o}function Vo(o,t){const e=Math.min(1,Math.max(0,t));if(o.charCodeAt(0)!==35)throw new Error("Only HEX color format is supported");let i=o.slice(1),r,n,s;if((i.length===3||i.length===4)&&(i=i.split("").map(l=>l+l).join("")),i.length===6)r=parseInt(i.slice(0,2),16),n=parseInt(i.slice(2,4),16),s=parseInt(i.slice(4,6),16);else if(i.length===8)r=parseInt(i.slice(0,2),16),n=parseInt(i.slice(2,4),16),s=parseInt(i.slice(4,6),16);else throw new Error(`Invalid HEX color format: ${o}`);return`rgba(${r}, ${n}, ${s}, ${e})`}function qr(o,t){const e=`${o}${Qi}${t}`;let i=Ti.get(e);return i===void 0&&(i=eo(o,t),Ti.set(e,i)),i}function io(o,t,e){const i=`${e}${Qi}${t}`;let r=Di.get(i);return r===void 0&&(o.font=e,r=o.measureText(t).width,Di.set(i,r)),r}function oo(o,t,e,i,r,n){if(o!=="auto")return o;let s=0;return r&&(s+=e+i),n&&(s+=e+i),t+s+4}function ro(o,t,e,i,r){let n=o;return i&&(n+=t+e),r&&(n+=t+e),n}function gl(){Ti.clear(),Di.clear()}const Cl=eo(Ji,to);function no(o,t,e,i){if(e)return{bgColor:o.bgCell,borderColor:o.borderColor,textColor:o.textLight,iconColor:o.textLight};switch(t){case"primary":return Ii(o,i);case"secondary":return Kr(o,i);case"danger":return Zr(i);default:return Ii(o,i)}}function vl(o,t,e,i,r){const{accentColor:n}=o,s=o.accentFg||ge,l=o.accentFg||ge,c=.4;if(t||e){const h=r?Vo(n,c):n;return{bgColor:h,borderColor:h,textColor:s,iconColor:l}}const u="#485056B0",d="white",a=r?Vo(u,c):u;return{bgColor:d,borderColor:a,textColor:s,iconColor:l}}function Ii(o,t){const{accentColor:e}=o,i=t?qr(e,to):e;return{bgColor:i,borderColor:i,textColor:o.accentFg||ge,iconColor:o.accentFg||ge}}function Kr(o,t){return{bgColor:t?o.accentLight||$r:o.bgCell,borderColor:o.accentColor,textColor:o.accentColor,iconColor:o.accentColor}}function Zr(o){const t=o?Cl:Ji;return{bgColor:t,borderColor:t,textColor:Ai,iconColor:Ai}}function so(o,t,e){return t?{bgColor:Ur,borderColor:Xr,textColor:Ei,iconColor:Ei}:{bgColor:e?o.bgColorHover:o.bgColor,borderColor:o.borderColor,textColor:e&&o.textColorHover?o.textColorHover:o.textColor,iconColor:e&&o.iconColorHover?o.iconColorHover:o.iconColor}}const Yt=-1,Yo=0,ct={colIndex:Yt,rowIndex:Yt},J={x:Yo,y:Yo},ml=2;function ke(o){const{location:t}=o;if(Array.isArray(t)&&t.length>=ml)return ct.colIndex=t[0]??Yt,ct.rowIndex=t[1]??Yt,ct;const{col:e}=o,{row:i}=o;if(typeof e=="number"&&typeof i=="number")return ct.colIndex=e,ct.rowIndex=i,ct;const{colIndex:r}=o,{rowIndex:n}=o;return typeof r=="number"&&typeof n=="number"?(ct.colIndex=r,ct.rowIndex=n,ct):(ct.colIndex=Yt,ct.rowIndex=Yt,ct)}const Ie="-",qo=0;function Zt(o,t){const{colIndex:e,rowIndex:i}=o;return e>=qo&&i>=qo?`${e}${Ie}${i}`:`${t.x}${Ie}${t.y}${Ie}${t.width}${Ie}${t.height}`}function Hi(o){const{posX:t}=o,{posY:e}=o;if(typeof t=="number"&&typeof e=="number"&&t===t&&e===e)return J.x=t,J.y=e,J;const{x:i}=o,{y:r}=o;if(typeof i=="number"&&typeof r=="number"&&i===i&&r===r)return J.x=i,J.y=r,J;const{location:n}=o;if(Array.isArray(n)&&n.length>=2){const s=n[0],l=n[1];if(typeof s=="number"&&typeof l=="number")return J.x=s,J.y=l,J}return null}function Li(o,t){const e=o.x,i=o.y,r=t.x,n=t.y;return e>=r&&e<=r+t.width&&i>=n&&i<=n+t.height?(J.x=e-r,J.y=i-n,J):o}function jr(o,t,e){if(typeof o!="number"||typeof t!="number")return;const i=e.width,r=e.height,n=e.x,s=e.y;if(o>=-1&&o<=i+1&&t>=-1&&t<=r+1)return J.x=o,J.y=t,J;if(o>=n-1&&o<=n+i+1&&t>=s-1&&t<=s+r+1)return J.x=o-n,J.y=t-s,J}function lo(o,t,e){const i=e.x,r=e.y;return o>=i&&o<=i+e.width&&t>=r&&t<=r+e.height}function Rt(o,t){if(typeof o=="object"&&o){const{hoverX:e}=o,{hoverY:i}=o,{rectX:r}=o,{rectY:n}=o;if(typeof e=="number"&&typeof i=="number"&&typeof r=="number"&&typeof n=="number"){const s=t.x-r,l=t.y-n;return e>=s&&e<=s+t.width&&i>=l&&i<=l+t.height}}return!!o}function Me(){return typeof window<"u"?Math.ceil(window.devicePixelRatio):1}function Jr(o){let t=0;for(let e=0;e<o.length;e++)t=(t<<5)-t+o.charCodeAt(e),t|=0;return t.toString(36)}function Pi(o,t){let e=o;return t&&(e=e.replace(/currentColor/g,t),!e.includes("fill=")&&!e.includes("stroke=")&&(e=e.replace("<svg",`<svg fill="${t}"`))),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}class Qr{constructor(){this.iconRegistry=new Map,this.svgDataUrlCache=new Map,this.spriteCache=new Map,this.pendingLoads=new Set,this.loadListeners=new Set,this.inFlightCount=0,this.stats={requests:0,hits:0,misses:0,cacheSize:0,inFlight:0}}onLoad(t){return this.loadListeners.add(t),()=>this.loadListeners.delete(t)}register(t,e={}){const i=Array.isArray(t)?t:Object.entries(t).map(([r,n])=>({name:r,svg:n}));for(const{name:r,svg:n}of i)r&&n&&(e.overwrite||!this.iconRegistry.has(r))&&this.iconRegistry.set(r,n);return this}getSprite(t,e,i){const r=this.resolveKey(t,e,i);if(!r)return null;this.stats.requests++;const n=this.spriteCache.get(r.key);return n?(this.stats.hits++,n):(this.stats.misses++,this.loadSprite(r.key,r.url,e,!0),null)}preload(t,e){const i=Array.isArray(t)?t:[t];for(const r of i){const n=this.resolveKey(r,e.size,e.color);n&&this.loadSprite(n.key,n.url,e.size,!1)}return this}draw(t,e,i,r,n,s){const l=this.getSprite(e,n,s);if(l){const c=n*Me();t.drawImage(l,0,0,c,c,i,r,n,n)}}getImageDirect(t){return t&&t instanceof HTMLImageElement&&t.complete&&t.naturalHeight!==0?t:null}getStats(){return{...this.stats}}reset(){return this.spriteCache.clear(),this.svgDataUrlCache.clear(),this.pendingLoads.clear(),this.stats={requests:0,hits:0,misses:0,cacheSize:0,inFlight:0},this}clearSpriteCache(){return this.spriteCache.clear(),this.pendingLoads.clear(),this.stats.cacheSize=0,this}has(t){return this.iconRegistry.has(t)}getSvg(t){return this.iconRegistry.get(t)}resolveKey(t,e,i){if(!t||e<=0)return null;const r=e*Me();if(typeof t=="string"){const{key:n,url:s}=this.resolveIconUrl(t,i);return{key:`${n}@${r}`,url:s}}return t instanceof HTMLImageElement?{key:`img:${t.src}:${i??""}@${r}`,url:t.src}:null}resolveIconUrl(t,e){const i=e??"",r=this.iconRegistry.get(t);if(r){const s=`r:${t}:${i}`;return this.svgDataUrlCache.has(s)||this.svgDataUrlCache.set(s,Pi(r,e)),{key:s,url:this.svgDataUrlCache.get(s)}}const n=t.trimStart();if(n.startsWith("<svg")){const s=`s:${Jr(n)}:${i}`;return this.svgDataUrlCache.has(s)||this.svgDataUrlCache.set(s,Pi(n,e)),{key:s,url:this.svgDataUrlCache.get(s)}}return{key:`u:${t}:${i}`,url:t}}loadSprite(t,e,i,r){var l;if(this.spriteCache.has(t)||this.pendingLoads.has(t))return;this.pendingLoads.add(t),this.inFlightCount++,this.stats.inFlight=this.inFlightCount;const n=new Image;n.src=e;const s=i*Me();(l=n.decode)==null||l.call(n).then(()=>{const c=document.createElement("canvas");c.width=s,c.height=s;const u=c.getContext("2d");u&&(u.drawImage(n,0,0,s,s),this.spriteCache.set(t,c),this.stats.cacheSize=this.spriteCache.size),r&&this.notifyListeners()}).catch(()=>{}).finally(()=>{this.pendingLoads.delete(t),this.inFlightCount--,this.stats.inFlight=this.inFlightCount,!r&&this.inFlightCount===0&&this.notifyListeners()})}notifyListeners(){this.loadListeners.forEach(t=>t())}}const Et=new Qr;function tn(o){return Et.onLoad(o)}function pl(o,t={}){Et.register(o,t)}function en(o,t,e){return Et.getSprite(o,t,e)}function on(o,t){Et.preload(o,t)}function rn(o,t,e,i,r,n){Et.draw(o,t,e,i,r,n)}function nn(o,t){return Et.getImageDirect(o)}function yl(){return Et.getStats()}function bl(){Et.clearSpriteCache()}const Fl=rn;function ut(o,t,e,i,r,n){if(!t||r<=0)return;const s=en(t,r,n);if(s){o.drawImage(s,e,i,r,r);return}const l=nn(t);l&&o.drawImage(l,e,i,r,r)}function sn(o,t,e,i,r,n,s,l="primary",c=!1,u=!1,d,a,h,f=ji){const g=Qt,v=r-g*2,C=Math.min(v-te,Gr),x=s.baseFontFull,y=h?io(h,n,x):0,w=oo(i,y,C,f,d,a),F=e+g,E=Rt(u,{x:t,y:e,width:w,height:r}),b=no(s,l,c,E),P=t+w*.5,T=F+v*.5;o.roundedRect(t,F,w,v,Zi,{fillStyle:b.bgColor,strokeStyle:b.borderColor,lineWidth:At});const B=ro(y,C,f,d,a);let O=P-B*.5;if(d){const rt=T-C*.5;ut(o,d,O,rt,C,b.textColor),O+=C+f}if(o.fillText(n,O,T,x,b.textColor,"middle","left"),a){const rt=O+y+f,G=T-C*.5;ut(o,a,rt,G,C,b.textColor)}return{x:t,y:F,width:w,height:v,actualWidth:w}}function ln(o,t,e,i,r,n=Je,s=je,l=!1,c=!1,u,d,a,h=ji,f){const g=it[s],v=f?f[n]:Ze[n],C=`${g.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,x=a?io(a,r,C):0,y=oo(i,x,g.iconSize,h,u,d),w=Rt(c,{x:t,y:e,width:y,height:g.height}),F=so(v,l,w),E=t+y*.5,b=e+g.height*.5;F.bgColor!=="transparent"?o.roundedRect(t,e,y,g.height,g.borderRadius,{fillStyle:F.bgColor,strokeStyle:F.borderColor!=="transparent"?F.borderColor:void 0,lineWidth:F.borderColor!=="transparent"?At:0}):F.borderColor!=="transparent"&&o.roundedRect(t,e,y,g.height,g.borderRadius,{fillStyle:F.bgColor,strokeStyle:F.borderColor,lineWidth:At});const P=ro(x,g.iconSize,h,u,d);let T=E-P*.5;if(u){const B=b-g.iconSize*.5;ut(o,u,T,B,g.iconSize,F.textColor),T+=g.iconSize+h}if(o.fillText(r,T,b,C,F.textColor,"middle","left"),d){const B=T+x+h,O=b-g.iconSize*.5;ut(o,d,B,O,g.iconSize,F.textColor)}return{x:t,y:e,width:y,height:g.height,actualWidth:y}}const Sl={100:"FF",90:"E6",80:"CC",75:"BF",70:"B3",60:"99",50:"80",40:"66",30:"4D",25:"40",20:"33",10:"1A",0:"00"},wl=(o,t)=>o.length!==6?o:o.slice(0,4)+Sl[t],Ut="transparent",xl=Object.fromEntries(Object.entries(Ze).map(([o,t])=>o==="secondary"?[o,{bgColor:Ut,borderColor:Ut,textColor:"#485056B0",bgColorHover:Ut,iconColor:"#485056B0",iconColorHovered:"#485056FF"}]:[o,{bgColor:Ut,borderColor:Ut,textColor:t.bgColor,bgColorHover:Ut,iconColor:t.bgColor,iconColorHovered:t.bgColorHover}]));function cn(o,t,e,i,r=Je,n=je,s=!1,l=!1,c){const u=it[n],d=xl[r],a=(c==null?void 0:c.overrideSquareSize)??u.height,h=(c==null?void 0:c.overrideIconSize)??u.iconSize,f=Rt(l,{x:t,y:e,width:a,height:a}),g=d,v=t+a*.5,C=e+a*.5,x=v-h*.5,y=C-h*.5;g.bgColor!=="transparent"?o.roundedRect(t,e,a,a,u.borderRadius,{fillStyle:g.bgColor,strokeStyle:g.borderColor!=="transparent"?g.borderColor:void 0,lineWidth:g.borderColor!=="transparent"?At:0}):g.borderColor!=="transparent"&&o.roundedRect(t,e,a,a,u.borderRadius,{fillStyle:g.bgColor,strokeStyle:g.borderColor,lineWidth:At});const w=(c==null?void 0:c.iconColor)??g.iconColor,F=(c==null?void 0:c.iconColorHovered)??(c==null?void 0:c.iconColor)??g.iconColorHovered,E=s?wl(w,40):f?F:w;return ut(o,i,x,y,h,E),{x:t,y:e,width:a,height:a}}function co(o,t,e,i,r,n,s,l="primary",c=!1,u=!1){const d=Qt,a=r-d*2,h=Math.min(a-te,Ki),f=i==="auto"?h:i,g=e+d,v=Rt(u,{x:t,y:e,width:f,height:r}),C=no(s,l,c,v),x=t+f*.5,y=g+a*.5,w=x-h*.5,F=y-h*.5;return o.roundedRect(t,g,f,a,Zi,{fillStyle:C.bgColor,strokeStyle:C.borderColor,lineWidth:At}),ut(o,n,w,F,h,C.iconColor),{x:t,y:g,width:f,height:a}}function an(o,t,e,i,r=Je,n=je,s=!1,l=!1){const c=it[n],u=Ze[r],d=c.height,a=Rt(l,{x:t,y:e,width:d,height:d}),h=so(u,s,a),f=t+d*.5,g=e+d*.5,v=f-c.iconSize*.5,C=g-c.iconSize*.5;return h.bgColor!=="transparent"?o.roundedRect(t,e,d,d,c.borderRadius,{fillStyle:h.bgColor,strokeStyle:h.borderColor!=="transparent"?h.borderColor:void 0,lineWidth:h.borderColor!=="transparent"?At:0}):h.borderColor!=="transparent"&&o.roundedRect(t,e,d,d,c.borderRadius,{fillStyle:h.bgColor,strokeStyle:h.borderColor,lineWidth:At}),ut(o,i,v,C,c.iconSize,h.iconColor),{x:t,y:e,width:d,height:d}}const Ko={xs:{height:16,fontSize:10,paddingX:4,borderRadius:4},s:{height:20,fontSize:11,paddingX:6,borderRadius:5},m:{height:24,fontSize:12,paddingX:8,borderRadius:6},l:{height:28,fontSize:13,paddingX:10,borderRadius:7}};function Al(o){return{default:{bgColor:o.surfaceSolidDefault,bgColorTransparent:o.surfaceTransparentSecondary,textColor:o.inverseTextPrimary,textColorOnTransparent:o.textPrimary},accent:{bgColor:o.surfaceAccent,bgColorTransparent:o.surfaceTransparentAccent,textColor:o.onDarkTextPrimary,textColorOnTransparent:o.textAccent},positive:{bgColor:o.surfacePositive,bgColorTransparent:o.surfaceTransparentPositive,textColor:o.onDarkTextPrimary,textColorOnTransparent:o.textPositive},warning:{bgColor:o.surfaceWarning,bgColorTransparent:o.surfaceTransparentWarning,textColor:o.onDarkTextPrimary,textColorOnTransparent:o.textWarning},negative:{bgColor:o.surfaceNegative,bgColorTransparent:o.surfaceTransparentNegative,textColor:o.onDarkTextPrimary,textColorOnTransparent:o.textNegative},dark:{bgColor:o.onLightSurfaceSolidDefault,bgColorTransparent:o.onLightSurfaceTransparentDeep,textColor:o.onDarkTextPrimary,textColorOnTransparent:o.onLightTextPrimary},light:{bgColor:o.onDarkSurfaceSolidDefault,bgColorTransparent:o.onDarkSurfaceTransparentCard,textColor:o.onLightTextPrimary,textColorOnTransparent:o.onDarkTextPrimary}}}const El="|",He=6,Zo=new Map,jo={xs:10,s:12,m:14,l:16};class un extends bt{constructor(t,e,i){var r;super(t),this.view="default",this.size="s",this.transparent=!1,this.clear=!1,this.pilled=!1,this.viewColors={},this.text=e,i&&(i.view!==void 0&&(this.view=i.view),i.size!==void 0&&(this.size=i.size),i.transparent!==void 0&&(this.transparent=i.transparent),i.clear!==void 0&&(this.clear=i.clear),i.pilled!==void 0&&(this.pilled=i.pilled),this.leftIcon=i.leftIcon,this.rightIcon=i.rightIcon,this.customColor=i.customColor,this.customBackgroundColor=i.customBackgroundColor,(r=i.theme)!=null&&r.tokens&&(this.viewColors=Al(i.theme.tokens)))}measure(t){const e=Ko[this.size],i=jo[this.size],r=`${e.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,n=Jo(t,r,this.text);let s=0;this.leftIcon&&(s+=i+He),this.rightIcon&&(s+=i+He),this.rect.width=n+s+e.paddingX*2,this.rect.height=e.height}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect,l=Ko[this.size],c=jo[this.size],u=this.viewColors[this.view];if(!u)return;const d=`${l.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`;let a,h;if(this.clear?(a="transparent",h=this.customColor??u.textColorOnTransparent):this.transparent?(a=this.customBackgroundColor??u.bgColorTransparent,h=this.customColor??u.textColorOnTransparent):(a=this.customBackgroundColor??u.bgColor,h=this.customColor??u.textColor),!this.clear){const v=this.pilled?s/2:l.borderRadius;t.roundedRect(i,r,n,s,v,{fillStyle:a})}const f=r+s/2;let g=i+l.paddingX;if(this.leftIcon){const v=f-c/2;ut(t,this.leftIcon,g,v,c,h),g+=c+He}if(t.fillText(this.text,g,f,d,h,"middle"),this.rightIcon){const v=Jo(e,d,this.text),C=g+v+He,x=f-c/2;ut(t,this.rightIcon,C,x,c,h)}}}function Jo(o,t,e){const i=`${t}${El}${e}`;let r=Zo.get(i);return r===void 0&&(o.font=t,r=o.measureText(e).width,Zo.set(i,r)),r}const Tl="default",Dl="s",mi="pointer",Le=8,Il={accentColor:"#1e88e5",accentLight:"rgba(30, 136, 229, 0.16)",accentFg:"#ffffff",bgCell:"#ffffff",borderColor:"#e0e0e0",textLight:"#9e9e9e",baseFontFull:"13px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},Qo=new Map;class hn extends bt{constructor(t,e,i){var r;super(t),this.variant="primary",this.view=Tl,this.size=Dl,this.disabled=!1,this.isHovered=!1,this.useNewApi=!1,this.text=e,super.style={...super.style,cursor:mi},i&&(i.view!==void 0?(this.view=i.view,this.useNewApi=!0):i.variant!==void 0&&(this.variant=i.variant),i.size!==void 0&&(this.size=i.size,this.useNewApi=!0),this.leftIcon=i.leftIcon,this.rightIcon=i.rightIcon,i.disabled!==void 0&&(this.disabled=i.disabled),i.onClick&&(this.onClick=i.onClick),(r=i.theme)!=null&&r.tokens&&(this.viewColors=Wr(i.theme.tokens)))}set style(t){super.style={...super.style,cursor:mi,...t}}get style(){const t=super.style;return t.cursor||(t.cursor=mi),t}measure(t){const e=it[this.size],i=`${e.fontSize}px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`,r=Hl(t,this.text,i);let n=0;this.leftIcon&&(n+=e.iconSize+Le),this.rightIcon&&(n+=e.iconSize+Le),this.rect.width=r+n+e.paddingX*2,this.rect.height=e.height}onPaint(t,e){const{x:i,y:r,width:n}=this.rect;if(this.useNewApi)ln(t,i,r,n,this.text,this.view,this.size,this.disabled,this.isHovered,this.leftIcon,this.rightIcon,e,Le,this.viewColors);else{const s=it[this.size];sn(t,i,r,n,s.height,this.text,Il,this.variant,this.disabled,this.isHovered,this.leftIcon,this.rightIcon,e,Le)}}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}}function Hl(o,t,e){const i=`${e}|${t}`;let r=Qo.get(i);return r===void 0&&(o.font=e,r=o.measureText(t).width,Qo.set(i,r)),r}const tr=16,er="black",ir=0,Ll=Math.PI/2,Pl=1.8,Xt={startX:-3.5,startY:-4.25,middleX:2.75,middleY:0,endX:-3.5,endY:4.25};class Bl extends bt{constructor(t,e={}){super(t),this.rotation=ir,this.color=er,this.rotation=e.rotation??ir,this.color=e.color??er,this.rect.width=tr,this.rect.height=tr}measure(t){}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect,l=i+n/2,c=r+s/2,u=this.rotation*Ll;t.custom(d=>{d.save(),d.translate(l,c),d.rotate(u),d.strokeStyle=this.color,d.lineWidth=Pl,d.lineCap="round",d.lineJoin="round",d.beginPath(),d.moveTo(Xt.startX,Xt.startY),d.lineTo(Xt.middleX,Xt.middleY),d.lineTo(Xt.endX,Xt.endY),d.stroke(),d.restore()})}}const _l=28,Rl="default",kl="s",Ml="pointer",zl=20,Ol={accentColor:"#1e88e5",accentLight:"rgba(30, 136, 229, 0.16)",accentFg:"#ffffff",bgCell:"#ffffff",borderColor:"#e0e0e0",textLight:"#9e9e9e"};class Bi extends bt{constructor(t,e,i){super(t),this.view=Rl,this.buttonSize=kl,this.isHovered=!1,this.useNewApi=!1,this.getDisabled=()=>this.disabled?"default":Ml,this.icon=e,this.size=(i==null?void 0:i.size)??"auto",this.variant=(i==null?void 0:i.variant)??"primary",this.disabled=(i==null?void 0:i.disabled)??!1,super.style={...super.style,cursor:this.getDisabled()},(i==null?void 0:i.view)!==void 0&&(this.view=i.view,this.useNewApi=!0),(i==null?void 0:i.buttonSize)!==void 0&&(this.buttonSize=i.buttonSize,this.useNewApi=!0),(i==null?void 0:i.overrideSquareSize)!==void 0&&(this.overrideSquareSize=i.overrideSquareSize),(i==null?void 0:i.overrideIconSize)!==void 0&&(this.overrideIconSize=i.overrideIconSize),(i==null?void 0:i.iconColor)!==void 0&&(this.iconColor=i.iconColor),(i==null?void 0:i.iconColorHovered)!==void 0&&(this.iconColorHovered=i.iconColorHovered),i!=null&&i.onClick&&(this.onClick=r=>{var n;return(n=i.onClick)==null?void 0:n.call(i,r)})}set style(t){super.style={...super.style,cursor:this.getDisabled(),...t}}get style(){const t=super.style;return t.cursor||(t.cursor=this.getDisabled()),t}measure(t){if(this.useNewApi){const e=it[this.buttonSize],i=this.overrideSquareSize??e.height;this.rect.height=i,this.rect.width=i}else{const e=or(this.size);this.rect.height=e.height,this.rect.width=e.width}}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect;if(this.useNewApi){const l=this.overrideSquareSize!==void 0||this.overrideIconSize!==void 0||this.iconColor!==void 0||this.iconColorHovered!==void 0?{overrideSquareSize:this.overrideSquareSize,overrideIconSize:this.overrideIconSize,iconColor:this.iconColor,iconColorHovered:this.iconColorHovered}:void 0;if(cn(t,i,r,this.icon,this.view,this.buttonSize,this.disabled,this.isHovered,l),_t.DEBUG){const c=it[this.buttonSize],u=this.overrideSquareSize??c.height,d=this.overrideIconSize??c.iconSize,a=i+(u-d)*.5,h=r+(u-d)*.5;t.strokeRect(a,h,d,d,"cyan",1)}}else co(t,i,r,n,s,this.icon,Ol,this.variant,this.disabled,this.isHovered)}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}containsHitPoint(t,e){if(this.useNewApi){const n=it[this.buttonSize],s=this.overrideSquareSize??n.height,l={x:this.rect.x,y:this.rect.y,width:s,height:s};return rr(t,e,l)}const i=or(this.size,this.rect.height),r=Nl(this.rect.x,this.rect.y,i);return rr(t,e,r)}}function or(o,t){const e=typeof o=="number"?o:t??_l,i=0,r=Qt,n=Math.min(e-r*2-te,zl),s=typeof o=="number"?o:n+i*2;return{height:e,width:s,paddingX:i,paddingY:r,iconSize:n}}function Nl(o,t,e){return{x:o+e.paddingX,y:t+e.paddingY,width:e.width-e.paddingX*2,height:e.height-e.paddingY*2}}function rr(o,t,e){return o>=e.x&&o<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}const Wl=16,Gl="transparent";class dn extends bt{constructor(t,e,i){super(t),this.icon=e,this.size=(i==null?void 0:i.size)??Wl,this.color=i==null?void 0:i.color}measure(t){this.rect.width=this.size,this.rect.height=this.size}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect;this.backgroundColor&&this.backgroundColor!==Gl&&t.fillRect(i,r,n,s,this.backgroundColor),ut(t,this.icon,i,r,this.size,this.color)}}const $l=28,Ul="default",Xl="s",pi="pointer",Vl=20,Yl={accentColor:"#1e88e5",accentLight:"rgba(30, 136, 229, 0.16)",accentFg:"#ffffff",bgCell:"#ffffff",borderColor:"#e0e0e0",textLight:"#9e9e9e"};class fn extends bt{constructor(t,e,i){super(t),this.view=Ul,this.buttonSize=Xl,this.isHovered=!1,this.useNewApi=!1,this.icon=e,this.size=(i==null?void 0:i.size)??"auto",this.variant=(i==null?void 0:i.variant)??"primary",this.disabled=(i==null?void 0:i.disabled)??!1,super.style={...super.style,cursor:pi},(i==null?void 0:i.view)!==void 0&&(this.view=i.view,this.useNewApi=!0),(i==null?void 0:i.buttonSize)!==void 0&&(this.buttonSize=i.buttonSize,this.useNewApi=!0),i!=null&&i.onClick&&(this.onClick=r=>{var n;return(n=i.onClick)==null?void 0:n.call(i,r)})}set style(t){super.style={...super.style,cursor:pi,...t}}get style(){const t=super.style;return t.cursor||(t.cursor=pi),t}measure(t){if(this.useNewApi){const e=it[this.buttonSize];this.rect.height=e.height,this.rect.width=e.height}else{const e=nr(this.size);this.rect.height=e.height,this.rect.width=e.width}}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect;this.useNewApi?an(t,i,r,this.icon,this.view,this.buttonSize,this.disabled,this.isHovered):co(t,i,r,n,s,this.icon,Yl,this.variant,this.disabled,this.isHovered)}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}containsHitPoint(t,e){if(this.useNewApi){const n=it[this.buttonSize],s={x:this.rect.x,y:this.rect.y,width:n.height,height:n.height};return sr(t,e,s)}const i=nr(this.size,this.rect.height),r=ql(this.rect.x,this.rect.y,i);return sr(t,e,r)}}function nr(o,t){const e=typeof o=="number"?o:t??$l,i=0,r=Qt,n=Math.min(e-r*2-te,Vl),s=typeof o=="number"?o:n+i*2;return{height:e,width:s,paddingX:i,paddingY:r,iconSize:n}}function ql(o,t,e){return{x:o+e.paddingX,y:t+e.paddingY,width:e.width-e.paddingX*2,height:e.height-e.paddingY*2}}function sr(o,t,e){return o>=e.x&&o<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}const se="transparent",Kl=0;class gn extends bt{constructor(t,e=se){super(t),this.color=se,this.borderColor=se,this.borderWidth=Kl,this.color=e}measure(t){const{style:e,rect:i}=this;typeof e.width=="number"&&(i.width=e.width),typeof e.height=="number"&&(i.height=e.height)}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect;if(this.color!==se&&t.fillRect(i,r,n,s,this.color),this.borderWidth>0&&this.borderColor!==se){const l=this.borderWidth/2;t.strokeRect(i+l,r+l,n-this.borderWidth,s-this.borderWidth,this.borderColor,this.borderWidth)}}}const Cn="|",Zl=2,jl=1e4,_i=new Map,Ri=new Map;function vn(o,t,e){o.size>=jl&&o.clear(),o.set(t,e)}function Jl(o,t){return`${o}${Cn}${t}`}function Ql({text:o,font:t,maxWidth:e,textOverflow:i,ellipsis:r,forceEllipsis:n}){return[t,o,e.toFixed(Zl),i,r,n?"force":"normal"].join(Cn)}function ki(o,t,e){const i=Jl(e,t);let r=_i.get(i);return r===void 0&&(o.font=e,r=o.measureText(t).width,vn(_i,i,r)),r}function tc(o){const t=typeof Intl<"u"?Intl.Segmenter:void 0;if(typeof t=="function"){const e=new t(void 0,{granularity:"grapheme"});return Array.from(e.segment(o),({segment:i})=>i)}return Array.from(o)}function ec(o,t,e,i,r){const n=ki(o,r,e);if(n>i)return{text:"",didTruncate:!0,width:0};const s=tc(t);let l=0,c=s.length,u=r,d=n;for(;l<=c;){const a=Math.floor((l+c)/2),h=`${s.slice(0,a).join("")}${r}`,f=ki(o,h,e);f<=i?(u=h,d=f,l=a+1):c=a-1}return{text:u,didTruncate:!0,width:d}}function Mi(o){const{ctx:t,text:e,font:i,maxWidth:r,textOverflow:n,ellipsis:s,forceEllipsis:l=!1}=o,c=Math.max(0,r);if(c<=0||e.length===0&&!(l&&n==="ellipsis"))return{text:"",didTruncate:e.length>0,width:0};const u=Ql({text:e,font:i,maxWidth:c,textOverflow:n,ellipsis:s,forceEllipsis:l}),d=Ri.get(u);if(d)return d;const a=ki(t,e,i);let h;return a<=c&&!l?h={text:e,didTruncate:!1,width:a}:n==="clip"?h={text:e,didTruncate:!0,width:a}:h=ec(t,e,i,c,s),vn(Ri,u,h),h}function lr({ctx:o,lines:t,font:e,maxWidth:i,maxLines:r,textOverflow:n,ellipsis:s}){const l=Math.max(0,Math.floor(r)),c=Math.min(t.length,l),u=t.slice(0,c),d=t.length>c;if(n==="ellipsis"&&u.length>0){const a=u.length-1,h=u[a]??"";u[a]=Mi({ctx:o,text:h,font:e,maxWidth:i,textOverflow:n,ellipsis:s,forceEllipsis:d}).text}return{lines:u,didClamp:d}}function ic(){_i.clear(),Ri.clear()}const oc="14px sans-serif",rc="black",nc=1,sc=14,lc="visible",cc="clip",ac="…",uc=/(\d*\.?\d+)px/,pt="|",hc=30,dc=`${pt}precise-wrap`,fc=1e4,gc=5e3,Cc=/[\u0300-\u036F\u1AB0-\u1AFF\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F\u200D\uFE0E\uFE0F\u2600-\u27BF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/,zi=new Map,Oi=new Map,Ni=new Map;let yi=null;function vc(){return yi===null&&typeof document<"u"&&(yi=document.createElement("canvas").getContext("2d")),yi}function mn(o,t,e,i){o.size>=i&&o.clear(),o.set(t,e)}function mc(o,t,e,i){return`${o}${pt}${t}${pt}${e??""}${pt}${i??""}`}function pc(o,t){return`${o}${pt}${t}`}function yc(o,t,e){return`${o}${pt}${t}${pt}${e}`}function pn(o,t,e,i){return`${o}${pt}${t}${pt}${e}${pt}${i}`}class ao extends _t{constructor(t,e,i){super(t),this.font=oc,this.color=rc,this.wordWrap=!1,this.lineHeight=nc,this.overflow=lc,this.textOverflow=cc,this.ellipsis=ac,this.lastMeasureKey="",this.cachedLines=null,this.cachedLinesKey="",this.lastPaintedTextWidth=0,this.text=e,i&&(i.font&&(this.font=i.font),i.fontSize!==void 0&&(this.fontSize=i.fontSize),i.lineHeightPx!==void 0&&(this.lineHeightPx=i.lineHeightPx),i.color&&(this.color=i.color),i.wordWrap!==void 0&&(this.wordWrap=i.wordWrap),i.lineHeight!==void 0&&(this.lineHeight=i.lineHeight,this.lineHeightPx=void 0),i.overflow!==void 0&&(this.overflow=i.overflow),i.textOverflow!==void 0&&(this.textOverflow=i.textOverflow),i.ellipsis!==void 0&&(this.ellipsis=i.ellipsis),i.maxLines!==void 0&&(this.maxLines=i.maxLines),i.autoTooltip!==void 0&&(this.autoTooltip=i.autoTooltip))}measure(t){const{font:e,text:i,wordWrap:r,lineHeight:n,rect:s,fontSize:l}=this,{lineHeightPx:c}=cr(e,n,l,this.lineHeightPx);this.isSingleLineClampEnabled()?this.measureSingleLineClamp(t,e,i,c,s):r?this.measureWordWrap(t,e,i,c,s):this.measureSingleLine(t,e,i,c,s)}measureWordWrap(t,e,i,r,n){const s=ar(this.style.width,n.width);if(s>0){const l=this.getResolvedMaxLines(),u=!(this.overflow==="hidden"&&l!==void 0&&l>1&&Fc(i)),d=pn(e,i,s,u);(d!==this.cachedLinesKey||this.cachedLines===null)&&(this.cachedLines=bc(t,i,e,s,u),this.cachedLinesKey=d),n.width=s;const a=l!==void 0&&this.overflow==="hidden"?Math.min(this.cachedLines.length,l):this.cachedLines.length;n.height=a*r}else n.width=Pe(t,i,e),n.height=r,this.cachedLines=null}measureSingleLineClamp(t,e,i,r,n){const s=ar(this.style.width,n.width);s>0?(n.width=s,n.height=r):(n.width=Pe(t,i,e),n.height=r),this.cachedLines=null}measureSingleLine(t,e,i,r,n){const s=yc(e,i,r);s!==this.lastMeasureKey&&(this.lastMeasureKey=s,n.width=Pe(t,i,e),n.height=r),this.cachedLines=null}getLastPaintedTextWidth(){return this.lastPaintedTextWidth}getTooltip(){if(this.tooltip)return this.tooltip;const t=this.autoTooltip;if(!t)return;const e=typeof t=="object"?t:void 0;if(!(e?e.enabled!==!1:t===!0)||!this.computeIsTruncated())return;let r=this.text;if(e&&typeof e.text=="function"?r=e.text(this.text):e&&typeof e.text=="string"&&(r=e.text),r===null||r==="")return;if(!e)return r;const{enabled:n,text:s,...l}=e;return{...l,text:r}}computeIsTruncated(){if(this.overflow!=="hidden"||this.textOverflow!=="ellipsis")return!1;const t=vc();if(!t)return!1;const e=this.cachedLines;if(e!==null&&e.length>0){const i=this.getResolvedMaxLines();return i===void 0?!1:lr({ctx:t,lines:e,font:this.font,maxWidth:this.rect.width,maxLines:i,textOverflow:this.textOverflow,ellipsis:this.ellipsis}).didClamp}return Mi({ctx:t,text:this.text,font:this.font,maxWidth:this.rect.width,textOverflow:this.textOverflow,ellipsis:this.ellipsis}).didTruncate}getResolvedMaxLines(){if(this.maxLines===void 0||!Number.isFinite(this.maxLines)||this.maxLines<=0)return;const t=Math.floor(this.maxLines);return t>0?t:void 0}isSingleLineClampEnabled(){return this.wordWrap&&this.overflow==="hidden"&&this.getResolvedMaxLines()===1}isMultilineClampEnabled(){return this.wordWrap&&this.overflow==="hidden"&&this.getResolvedMaxLines()!==void 0}onPaint(t,e){const{font:i,text:r,rect:n,color:s}=this,l=this.cachedLines;l!==null&&l.length>0?this.paintMultiline(t,e,i,s,l,n):this.paintSingleLine(t,e,r,i,s,n)}paintMultiline(t,e,i,r,n,s){const{lineHeightPx:l}=cr(i,this.lineHeight,this.fontSize,this.lineHeightPx),c=this.getResolvedMaxLines(),u=this.isMultilineClampEnabled()&&c!==void 0?lr({ctx:e,lines:n,font:i,maxWidth:s.width,maxLines:c,textOverflow:this.textOverflow,ellipsis:this.ellipsis}).lines:n,d=u.length*l;let a=s.y+Math.max(0,(s.height-d)*.5);this.lastPaintedTextWidth=0;for(let h=0,f=u.length;h<f;h+=1){const g=u[h];g!==void 0&&(this.overflow==="hidden"?t.fillTextClipped(g,s.x,a,i,r,s,"top","left"):t.fillText(g,s.x,a,i,r,"top"),a+=l)}}paintSingleLine(t,e,i,r,n,s){const l=s.y+s.height*.5;if(this.overflow==="hidden"){const c=Mi({ctx:e,text:i,font:r,maxWidth:s.width,textOverflow:this.textOverflow,ellipsis:this.ellipsis});if(this.lastPaintedTextWidth=Math.min(c.width,Math.max(0,s.width)),c.text.length===0)return;t.fillTextClipped(c.text,s.x,l,r,n,s,"middle","left");return}this.lastPaintedTextWidth=Pe(e,i,r),t.fillText(i,s.x,l,r,n,"middle")}}function cr(o,t,e,i){const r=mc(o,t,e,i);let n=zi.get(r);if(n===void 0){const s=uc.exec(o),l=e??(s&&s[1]!==void 0?Number(s[1]):sc);n={fontSize:l,lineHeightPx:i??l*t},zi.set(r,n)}return n}function Pe(o,t,e){const i=pc(e,t);let r=Oi.get(i);return r===void 0&&(o.font=e,r=o.measureText(t).width,mn(Oi,i,r,fc)),r}function bc(o,t,e,i,r){o.font=e;const n=Math.max(i,hc),s=pn(e,t,n,r);let l=Ni.get(s);if(!l){const c=r?e:`${e}${dc}`;l=Sc(Vs.split(o,t,c,n,r)),mn(Ni,s,l,gc)}return l}function ar(o,t){return typeof o=="number"&&o>0?o:t>0?t:0}function Fc(o){return Cc.test(o)}function Sc(o){if(Array.isArray(o))return o;const t=o;return t.lines&&Array.isArray(t.lines)?t.lines:[]}function wc(){zi.clear(),Oi.clear(),Ni.clear(),ic()}const ae={250:15.625,32:2,28:1.75,24:1.5,20:1.25,18:1.125,16:1,14:.875,12:.75,8:.5,0:0},ur=16,le=16,yn=90,hr="rgba(8, 8, 8, 0.08)",xc=4e3,Ac=1920,Ec="linear-gradient( 90deg, rgba(8, 8, 8, 0.09) 0%, rgba(8, 8, 8, 0.08) 6.25%, rgba(8, 8, 8, 0.05) 12.5%, rgba(8, 8, 8, 0.01) 25%, rgba(8, 8, 8, 0.05) 37.5%, rgba(8, 8, 8, 0.08) 43.75%, rgba(8, 8, 8, 0.09) 50%, rgba(8, 8, 8, 0.08) 56.25%, rgba(8, 8, 8, 0.05) 62.5%, rgba(8, 8, 8, 0.01) 75%, rgba(8, 8, 8, 0.05) 87.5%, rgba(8, 8, 8, 0.08) 93.75%, rgba(8, 8, 8, 0.09) 100% )",Tc="linear-gradient( 90deg, rgba(8, 8, 8, 0.36) 0%, rgba(8, 8, 8, 0.32) 6.25%, rgba(8, 8, 8, 0.20) 12.5%, rgba(8, 8, 8, 0.04) 25%, rgba(8, 8, 8, 0.20) 37.5%, rgba(8, 8, 8, 0.32) 43.75%, rgba(8, 8, 8, 0.36) 50%, rgba(8, 8, 8, 0.08) 56.25%, rgba(8, 8, 8, 0.20) 62.5%, rgba(8, 8, 8, 0.04) 75%, rgba(8, 8, 8, 0.20) 87.5%, rgba(8, 8, 8, 0.32) 93.75%, rgba(8, 8, 8, 0.36) 100% )";let dr=null;const Dc={right:90,left:270,top:0,bottom:180,"top right":45,"right top":45,"bottom right":135,"right bottom":135,"bottom left":225,"left bottom":225,"top left":315,"left top":315};class bn extends bt{constructor(t,e){super(t),this._gradientStops=null,this._gradientAngle=yn;const i=(e==null?void 0:e.customGradientColor)??(e!=null&&e.lighter?Tc:Ec),r=Pc(i);r&&(this._gradientStops=r.stops,this._gradientAngle=r.angle),this.borderRadius=Ic(e==null?void 0:e.roundness),this.animated=(e==null?void 0:e.animated)??!0,this.shimmerDuration=(e==null?void 0:e.shimmerDuration)??xc}measure(t){const{style:e,rect:i}=this;typeof e.width=="number"&&(i.width=e.width),typeof e.height=="number"&&(i.height=e.height)}onPaint(t,e){var f;const{x:i,y:r,width:n,height:s}=this.rect;if(n<=0||s<=0)return;const{_gradientStops:l,borderRadius:c}=this;if(!l||l.length<2){c>0?t.roundedRect(i,r,n,s,c,{fillStyle:hr}):t.fillRect(i,r,n,s,hr);return}const u=t.getAnimationContext(),d=u==null?void 0:u.frameTime;if(!this.animated||d===void 0){t.linearGradientRect(i,r,n,s,c,l,this._gradientAngle);return}dr??(dr=d);const h=(d-dr)%this.shimmerDuration/this.shimmerDuration;t.custom(g=>{g.save(),g.beginPath(),c>0?g.roundRect(i,r,n,s,c):g.rect(i,r,n,s),g.clip();const{startX:v,startY:C,endX:x,endY:y}=Bc(i,r,s,h),w=g.createLinearGradient(v,C,x,y);for(const F of l)w.addColorStop(F.offset,F.color);g.fillStyle=w,g.fillRect(i,r,n,s),g.restore()}),(f=u==null?void 0:u.requestAnimationFrame)==null||f.call(u)}}function fr(o){return o in ae}function Ic(o){if(o===void 0)return ae[ur]*le;if(typeof o=="number")return fr(o)?ae[o]*le:o;const t=o.trim(),e=Number(t);if(!Number.isNaN(e))return fr(e)?ae[e]*le:e;const i=t.match(/^(-?\d+(?:\.\d+)?)px$/i);if(i){const[,n]=i;return parseFloat(n)}const r=t.match(/^(-?\d+(?:\.\d+)?)rem$/i);if(r){const[,n]=r;return parseFloat(n)*le}return ae[ur]*le}function Hc(o){var i;const t=o.trim(),e=t.match(/^var\s*\(\s*[^,]+,\s*([\s\S]+)\s*\)$/i);return((i=e==null?void 0:e[1])==null?void 0:i.trim())??t}function Lc(o,t){switch(t.toLowerCase()){case"rad":return o*180/Math.PI;case"turn":return o*360;case"grad":return o*180/200;default:return o}}function Pc(o){const e=Hc(o).match(/^linear-gradient\s*\(([\s\S]+)\)$/i);if(!(e!=null&&e[1]))return null;const i=[];let r="",n=0;for(const h of e[1])h==="("&&n++,h===")"&&n--,h===","&&n===0?(i.push(r.trim()),r=""):r+=h;r.trim()&&i.push(r.trim());const[s]=i;if(i.length<2||!s)return null;let l=yn,c=0;const u=s.match(/^(-?\d+(?:\.\d+)?)(deg|rad|turn|grad)?$/i);if(u!=null&&u[1]){const[,h,f="deg"]=u;l=Lc(parseFloat(h),f),c=1}else if(s.startsWith("to ")){const h=s.substring(3).trim().toLowerCase(),f=Dc[h];f!==void 0&&(l=f,c=1)}const d=[],a=i.slice(c);for(let h=0;h<a.length;h++){const f=a[h];if(!f)continue;const g=f.trim().match(/^(#[0-9a-fA-F]{3,8}|rgba?\s*\([^)]+\)|hsla?\s*\([^)]+\)|[a-zA-Z]+)(?:\s+(-?\d+(?:\.\d+)?)(%))?$/);if(!(g!=null&&g[1]))continue;const[,v,C,x]=g,y=x==="%"?parseFloat(C)/100:a.length>1?h/(a.length-1):0;d.push({offset:Math.max(0,Math.min(1,y)),color:v})}return d.length<2?null:{stops:d,angle:l}}function Bc(o,t,e,i){const r=Ac,n=i*r,s=o-r+n,l=o+r+n,c=t+e/2;return{startX:s,startY:c,endX:l,endY:c}}function _c(o,t){const e=o.replace("#","");let i,r,n,s=255;e.length===3||e.length===4?(i=parseInt(e[0]+e[0],16),r=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),e.length===4&&(s=parseInt(e[3]+e[3],16))):(i=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),e.length===8&&(s=parseInt(e.slice(6,8),16)));const l=Math.round(s*t),c=u=>u.toString(16).padStart(2,"0");return`#${c(i)}${c(r)}${c(n)}${c(l)}`}function Rc(o){return{default:{color:o.textPrimary,colorHover:o.textPrimaryHover,colorActive:o.textPrimaryActive},accent:{color:o.textAccent,colorHover:o.textAccentHover,colorActive:o.textAccentActive},secondary:{color:o.textSecondary,colorHover:o.textSecondaryHover,colorActive:o.textSecondaryActive},tertiary:{color:o.textTertiary,colorHover:o.textTertiaryHover,colorActive:o.textTertiaryActive},paragraph:{color:o.textParagraph,colorHover:o.textParagraphHover,colorActive:o.textParagraphActive},positive:{color:o.textPositive,colorHover:o.textPositiveHover,colorActive:o.textPositiveActive},warning:{color:o.textWarning,colorHover:o.textWarningHover,colorActive:o.textWarningActive},negative:{color:o.textNegative,colorHover:o.textNegativeHover,colorActive:o.textNegativeActive},clear:{color:o.textPrimary,colorHover:o.textPrimaryHover,colorActive:o.textPrimaryActive}}}const kc="default",bi="pointer",Mc=.4,zc=2,Oc=1;class Fn extends ao{constructor(t,e,i){var r;super(t,e,i),this.view=kc,this.disabled=!1,this.isHovered=!1,this.isActive=!1,this.hasCustomColor=!1,super.style={...super.style,cursor:bi},i&&(this.href=i.href,this.target=i.target,this.rel=i.rel,i.view!==void 0&&(this.view=i.view),i.disabled!==void 0&&(this.disabled=i.disabled),this.hasCustomColor=i.color!==void 0,(r=i.theme)!=null&&r.tokens&&(this.viewColors=Rc(i.theme.tokens))),!this.hasCustomColor&&this.viewColors&&(this.color=this.viewColors[this.view].color)}set style(t){super.style={...super.style,cursor:bi,...t}}get style(){const t=super.style;return t.cursor=this.disabled?"not-allowed":bi,t}setOnClick(t){this.customClickHandler=t}resolveColor(){let t;if(this.hasCustomColor||!this.viewColors)t=this.color;else{const e=this.viewColors[this.view];this.isActive?t=e.colorActive:this.isHovered?t=e.colorHover:t=e.color}return this.disabled&&(t=_c(t,Mc)),t}onPaint(t,e){const i=this.color;this.color=this.resolveColor(),super.onPaint(t,e);const{view:r,isHovered:n,wordWrap:s}=this,c=!s&&(r==="default"||r==="clear"||!this.disabled&&n),u=this.getLastPaintedTextWidth();c&&u>0&&this.paintUnderline(t,u),this.color=i}paintUnderline(t,e){const{x:i,y:r,height:n}=this.rect,s=r+n+zc,l=this.resolveColor();t.custom(c=>{c.beginPath(),c.moveTo(i,s),c.lineTo(i+e,s),c.strokeStyle=l,c.lineWidth=Oc,c.stroke()})}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1,this.isActive=!1}onMouseDown(){this.disabled||(this.isActive=!0)}onMouseUp(){this.isActive=!1}onClick(t){if(this.disabled)return;let e=!1;const i=t.preventDefault;t.preventDefault=()=>{e=!0,i.call(t)},!(this.customClickHandler&&(this.customClickHandler(t),e))&&this.navigate()}navigate(){if(!this.href)return;const t=this.target||"_self";if(t==="_self")window.location.href=this.href;else{const e=this.rel??(t==="_blank"?"noopener,noreferrer":void 0);window.open(this.href,t,e)}}}let ue=0;const We=new Set;function Nc(){ue++,ue===1&&We.forEach(t=>t(!0));let o=!1;return()=>{o||(o=!0,ue--,ue===0&&We.forEach(t=>t(!1)))}}function Wc(){return ue>0}function Gc(o){return We.add(o),()=>{We.delete(o)}}const Ge="basic-grid-canvas-portal-hover",$c=400;let Uc=0;const Fi="__canvasPortalTargetId";function Xc(o){var i;if(!o)return"window";const t=o;if((i=t.dataset)!=null&&i.portalTargetId)return t.dataset.portalTargetId;const e=o;return e[Fi]||(e[Fi]=++Uc),String(e[Fi])}const Jt=new Map;function Vc(o,t){return`${o??"default"}:${t??"default"}`}function Wi(o,t){const e=new CustomEvent(Ge,{detail:o});t?t.dispatchEvent(e):window.dispatchEvent(e)}function gr(o){const t=Jt.get(o);t!==void 0&&(window.clearTimeout(t),Jt.delete(o))}function Yc(o){const t=`${o}:`;for(const[e,i]of Jt.entries())e.startsWith(t)&&(window.clearTimeout(i),Jt.delete(e))}function qc(o,t,e){const i=window.setTimeout(()=>{Jt.delete(o),Wi(t,e)},$c);Jt.set(o,i)}function fe(o,t,e){if(typeof window>"u")return;const i=Xc(t),r=`${i}:${Vc(o.source,o.originId)}`;o.visible?(Yc(i),Wi(o,t)):e?(gr(r),Wi(o,t)):(gr(r),qc(r,o,t))}function Kc(o,t){if(typeof window>"u")return()=>{};const e=t??window,i=r=>{const n=r;n.detail&&o(n.detail)};return e.addEventListener(Ge,i),()=>{e.removeEventListener(Ge,i)}}const Zc="cell";class yt{constructor(t,e){this.bounds=null,this.batcher=new Ke,this.portalEventTarget=null,this.tooltipContext=void 0,this.rootNode=t,this.hoverController=new qi({onCursorChange:i=>{var r;return(r=this.onCursorChange)==null?void 0:r.call(this,i)},portalHoverDispatch:fe,getPortalEventTarget:()=>this.portalEventTarget,portalSource:Zc,getTooltipContext:()=>this.tooltipContext})}setPortalEventTarget(t){this.portalEventTarget=t}setTooltipContext(t){this.tooltipContext=t}setRootNode(t){this.rootNode=t}setOriginId(t){}render(t,e,i,r,n){this.bounds={...r??e},this.hoverController.setAbsoluteBounds(this.bounds),t.save(),t.translate(e.x,e.y),this.prepareRootNode(t,e),i?this.dispatchPointerEvent("mousemove",i.x,i.y):this.handleMouseLeave(),this.batcher.clear(),this.batcher.setAnimationContext(n),this.rootNode.paint(this.batcher,t),this.batcher.flush(t),t.restore()}dispatchPointerEvent(t,e,i,r){var d;if(!this.bounds)return{propagationStopped:!1,suppressGridDefault:!1};const n=this.rootNode.hitTest(e,i),s=(d=n.find(a=>a.interaction!==void 0))==null?void 0:d.interaction;let l=!1,c=!1;const u={type:t,x:e,y:i,originalEvent:r??{},target:n[0],stopPropagation:()=>{l=!0},preventDefault:()=>{c=!0,r==null||r.preventDefault()}};return n.length===0?(t==="mousemove"&&this.hoverController.handlePointerMove([],null),{propagationStopped:!1,suppressGridDefault:c,...s?{interaction:s}:{}}):(this.dispatchEventToNodes(n,u,t),t==="mousemove"&&this.hoverController.handlePointerMove(n,u),{propagationStopped:l,suppressGridDefault:c,...s?{interaction:s}:{}})}getInteractionAtPoint(t,e){var i;if(this.bounds)return(i=this.rootNode.hitTest(t,e).find(r=>r.interaction))==null?void 0:i.interaction}dispatchEventToNodes(t,e,i){let r=!1;const n={...e,stopPropagation:()=>{r=!0,e.stopPropagation()}};for(const s of t){if(r)break;const l={...n,currentTarget:s};this.invokeNodeHandler(s,i,l)}}invokeNodeHandler(t,e,i){switch(e){case"click":t.onClick({...i,cellBounds:this.bounds});break;case"mousedown":t.onMouseDown(i);break;case"mouseup":t.onMouseUp(i);break;case"dblclick":t.onDoubleClick(i);break;case"mousemove":t.onMouseMove(i);break;case"mouseenter":t.onMouseEnter(i);break;case"mouseleave":t.onMouseLeave(i);break}}handleMouseLeave(){this.hoverController.handlePointerLeave()}prepareRootNode(t,e){this.rootNode.rect.x=0,this.rootNode.rect.y=0,this.rootNode.rect.width=e.width,this.rootNode.rect.height=e.height,this.rootNode instanceof gt?this.rootNode.performLayout(t):this.rootNode.measure(t)}computeCursor(t,e){return this.hoverController.computeCursor(t,e,this.rootNode)}getCurrentCursor(){return this.hoverController.getCurrentCursor()}forcePortalHide(){this.hoverController.handlePortalReset()}}const Qe="canvas-cell";function Sn(o,t,e,i){return{kind:L.GridCellKind.Custom,allowOverlay:!1,readonly:!0,copyData:e??"",data:{kind:Qe,render:o,onClick:t},...i}}function uo(o){var e;const t=o;return!!(t&&t.kind===L.GridCellKind.Custom&&((e=t.data)==null?void 0:e.kind)===Qe)}const he=5,wn=[["hoverX","hoverY"],["mouseX","mouseY"],["pointerX","pointerY"],["posX","posY"],["x","y"]],xn="default",An="pointer";function En(o,t){for(const[e,i]of wn){const r=o[e],n=o[i];if(typeof r=="number"&&typeof n=="number"&&!Number.isNaN(r)&&!Number.isNaN(n)){if(Tn(r,n,t))return{x:r-t.x,y:n-t.y};if(Dn(r,n,t))return{x:r,y:n}}}}function Tn(o,t,e){return o>=e.x&&o<=e.x+e.width&&t>=e.y&&t<=e.y+e.height}function Dn(o,t,e){return o>=-he&&o<=e.width+he&&t>=-he&&t<=e.height+he}function In(o,t,e){if((o==null?void 0:o.canvasRoot)instanceof yt){const i=e?"nativeEvent"in e?e.nativeEvent:e:void 0;return o.canvasRoot.dispatchPointerEvent("click",t.x,t.y,i)}return{propagationStopped:!1,suppressGridDefault:!1}}function Hn(o,t){if(o!=null&&o.clickHandlers&&Array.isArray(o.clickHandlers)){for(const{area:e,handler:i}of o.clickHandlers)if(lo(t.x,t.y,e))return i(),!0}return!1}function Ln(o,t,e,i,r,n){const{onClick:s}=o.data;return s?!!s(t.x,t.y,e,i,r,n??void 0):!1}const Gi=new WeakMap,Pn=new Map;function Bn(o,t,e){const i={...e??{}};return delete i.hoveredAreas,Pn.set(o,i),t.data.renderData=i,i}function jt(o,t){return t.data.renderData??Pn.get(o)}function _n(o,t){var i,r;(((i=Gi.get(o))==null?void 0:i.hovered)??!1)!==t&&(Gi.set(o,{hovered:t}),t?(r=o.onMouseEnter)==null||r.call(o):jc(o))}function jc(o){const{renderData:t}=o;(t==null?void 0:t.canvasRoot)instanceof yt&&t.canvasRoot.forcePortalHide()}function Rn(o){var t;return(t=Gi.get(o))==null?void 0:t.hovered}function kn(o,t,e,i){var r;if(o instanceof yt)if(t){if(e.event){const s="nativeEvent"in e.event?e.event.nativeEvent:e.event;o.dispatchPointerEvent("mousemove",t.x,t.y,s)}const n=o.computeCursor(t.x,t.y);n&&n!==xn&&((r=i.overrideCursor)==null||r.call(i,n))}else o.handleMouseLeave(),o.forcePortalHide()}function Mn(o,t,e,i,r){var c;const n=!!(t&&e.some(u=>lo(t.x,t.y,u))),s=Rn(o)??!1,l=!!t;l!==s&&_n(o,l),n&&!i&&((c=r.overrideCursor)==null||c.call(r,An))}function ho({cell:o,rect:t,relativePoint:e,renderData:i,rowData:r,rowIndex:n,event:s}){const l=In(i,e,s);return l.propagationStopped?{handled:!0,propagationStopped:!0,suppressGridDefault:l.suppressGridDefault}:Hn(i,e)?{handled:!0,propagationStopped:!1,suppressGridDefault:l.suppressGridDefault}:Ln(o,e,t,r,n,i)?{handled:!0,propagationStopped:!1,suppressGridDefault:l.suppressGridDefault}:{handled:!1,propagationStopped:!1,suppressGridDefault:l.suppressGridDefault}}function zn(o){const t=o.selection==="keep",e=o.cellClick==="stop",i=o.editor==="never",r=o.contextMenu==="keep-selection"?"manual-keep-selection":o.contextMenu==="none"?"none":"normal";return{suppressEarlyGridSelect:t,suppressExternalCellClick:e,suppressGridDefaultFor:{pointerdown:t,click:i,contextmenu:r!=="normal"},contextMenuMode:r,...o.editor==="open-on-click"?{editorRequest:{target:"self"}}:{}}}function Jc({decision:o,propagationStopped:t,suppressGridDefault:e}){const i=o.suppressGridDefaultFor.click||e,r={suppressExternalCellClick:o.suppressExternalCellClick||t,suppressGridDefaultForClick:i};return!i&&o.editorRequest&&(r.editorRequest=o.editorRequest),r}function On({renderData:o,relativePoint:t}){const e=(o==null?void 0:o.canvasRoot)instanceof yt?o.canvasRoot.getInteractionAtPoint(t.x,t.y):void 0;return e?{handled:!0,suppressEarlyGridSelect:zn(e).suppressEarlyGridSelect,interaction:e}:{handled:!1,suppressEarlyGridSelect:!1}}function fo(o={}){return{kind:L.GridCellKind.Custom,isMatch:t=>{var e;return((e=t.data)==null?void 0:e.kind)===Qe},needsHover:!0,needsHoverPosition:!0,onSelect:t=>{var h;const e=t.cell,i=t.bounds,r=Hi(t);if(!r)return;const n=Li(r,i),s=ke(t),l=Zt(s,i),c=jt(l,e),u=On({renderData:c,relativePoint:n}),d=t.location??[s.colIndex,s.rowIndex],a=u.interaction&&o.beginOrGetInteractionSession?o.beginOrGetInteractionSession({cell:d,relativePoint:n,interaction:u.interaction,source:"pointer",...t.button!==void 0?{button:t.button}:{}}):void 0;(a!=null&&a.decision.suppressEarlyGridSelect||u.suppressEarlyGridSelect)&&((h=t.preventDefault)==null||h.call(t))},onClick:t=>{var h,f;const e=t.cell,i=t.bounds,r=Hi(t);if(!r)return;const n=Li(r,i),s=ke(t),l=Zt(s,i),c=jt(l,e),u=t.location??[s.colIndex,s.rowIndex],a=((h=o.consumeCanvasClickResult)==null?void 0:h.call(o,{cell:u,relativePoint:n,...t.button!==void 0?{button:t.button}:{}}))??ho({cell:e,rect:i,relativePoint:n,renderData:c,rowData:t.row??t.rowData,rowIndex:s.rowIndex,event:t.event});a.suppressGridDefault&&((f=t.preventDefault)==null||f.call(t)),a.handled},draw:(t,e)=>{const{ctx:i,rect:r,theme:n}=t,{render:s}=e.data,l=t.cellFillColor!==void 0?{...n,bgCell:t.cellFillColor}:n,c=ke(t),u=Zt(c,r),d={hoverX:t.hoverX,hoverY:t.hoverY,row:t.row,rowData:t.rowData,event:t.event,frameTime:t.frameTime,requestAnimationFrame:t.requestAnimationFrame},a=jr(t.hoverX,t.hoverY,r)??En(d,r);i.save();const h=jt(u,e),f=s(i,r,l,a==null?void 0:a.x,a==null?void 0:a.y,{...d,canvasRoot:h==null?void 0:h.canvasRoot}),g=(f==null?void 0:f.hoveredAreas)??[];Bn(u,e,f);const v=(f==null?void 0:f.canvasRoot)??(h==null?void 0:h.canvasRoot);kn(v,a,d,t),Mn(e.data,a,g,v,t),i.restore()},onPaste:()=>{}}}const Qc=fo(),$e=new Map;function Nn(o){const t=ta(o),e=$e.get(t);if(e)return e;const r=Ys.renderToString(o).match(/<svg[\s\S]*?<\/svg>/);if(!r)return console.warn("Could not extract SVG from React icon component:",o.type),"";const n=r[0];return $e.set(t,n),n}function ta(o){const t=o.type,e=typeof t=="function"||typeof t=="object"?t.displayName||t.name||"Anonymous":String(t),{size:i,color:r,className:n}=o.props||{},s=JSON.stringify({size:i,color:r,className:n});return`${e}:${s}`}function wt(o){return m.isValidElement(o)}function mt(o){return typeof o=="string"?o:wt(o)?Nn(o):""}function ea(){$e.clear()}function ia(){return $e.size}const $i=o=>{if(o===void 0)return;if(typeof o=="number")return o;const t=o.trim();if(t==="100%")return"100%";const e=t.match(/^(-?\d+(?:\.\d+)?)px$/i);if(e)return Number(e[1]);const i=t.match(/^(-?\d+(?:\.\d+)?)rem$/i);if(i)return Number(i[1])*16;const r=Number(t);if(!Number.isNaN(r))return r},Cr={small:{radius:4,stroke:1.5},medium:{radius:4,stroke:1.5},big:{radius:6,stroke:2}};function oa(o,t,e,i,r,n,s,l,c,u,d=!1,a=!1){const f=s-0,v=Math.min(f-0,Ki),C=n==="auto"?v:n,x=e+0,y=(c==null?void 0:c.rowSize)||"medium",w=!i&&!r,F=Rt(a,{x:t,y:e,width:C,height:s}),E=vl(c,i,r,F,d),b=t+C*.5,P=x+f*.5,T=b-v*.5,B=P-v*.5;return o.roundedRect(t,x,C,f,Cr[y].radius,{fillStyle:E.bgColor,strokeStyle:E.borderColor,lineWidth:w?Cr[y].stroke:void 0}),ut(o,l,T,B,v,E.iconColor),{x:t,y:x,width:C,height:f}}const ra=28,na="default",sa="s",vr="pointer",la=20,Ui={indeterminateIcon:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke-linecap="round" stroke-width="2" stroke="currentColor" d="m5.09449,9.0315l8,0"></path></svg>',checkedIcon:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg" fill="none"><path fill="currentColor" d="m5.70711,8.15582c-0.39053,-0.39052 -1.02369,-0.39052 -1.41422,0c-0.39052,0.39053 -0.39052,1.02369 0,1.41422l3.70666,3.70666l6.71095,-6.70248c0.3908,-0.39027 0.3912,-1.02344 0.0009,-1.41421c-0.3903,-0.39077 -1.02344,-0.39117 -1.41421,-0.00089l-5.29674,5.29004l-2.29334,-2.29334z"></path></svg>'},ca=Object.values(Ui),aa={accentColor:"#1e88e5",accentFg:"#ffffff"};class ua extends bt{constructor(t,e,i=!1,r=!1,n){super(t),this.view=na,this.buttonSize=sa,this.isHovered=!1,this.useNewApi=!1,this.icon=e,this.checked=i,this.indeterminate=r,this.size=(n==null?void 0:n.size)??"auto",this.theme=n==null?void 0:n.theme,this.view=(n==null?void 0:n.view)??"primary",this.disabled=(n==null?void 0:n.disabled)??!1,super.style={...super.style,cursor:this.disabled?"auto":vr},!this.disabled&&(n!=null&&n.onClick)&&(this.onClick=s=>{var l;return(l=n.onClick)==null?void 0:l.call(n,s)})}set style(t){super.style={...super.style,...t}}get style(){const t=super.style;return t.cursor||(t.cursor=vr),t}measure(t){if(this.useNewApi){const e=it[this.buttonSize];this.rect.height=e.height,this.rect.width=e.height}else{const e=ha(this.size);this.rect.height=e.height,this.rect.width=e.width}}onPaint(t,e){const{x:i,y:r,width:n,height:s}=this.rect;oa(t,i,r,this.checked,this.indeterminate,n,s,this.icon,this.theme??aa,this.view,this.disabled,this.isHovered)}onMouseEnter(){this.isHovered=!0}onMouseLeave(){this.isHovered=!1}}function ha(o,t){const e=typeof o=="number"?o:ra,i=0,r=Qt,n=Math.min(e-r*2-te,la),s=typeof o=="number"?o:n+i*2;return{height:e,width:s,paddingX:i,paddingY:r,iconSize:n}}const da=({backgroundColor:o,__backgroundColorResolver:t},e)=>(t==null?void 0:t(e))??o,Ct=o=>{const t=e=>null;return t.__canvasType=o,t},fa=m.memo(({cellId:o,renderContent:t,nodeRegistry:e,onRegistryChange:i})=>{const r=t(),n=m.useRef(null);return m.useLayoutEffect(()=>{const s=e.current,l=n.current;l&&l!==o&&s.delete(l);const c=s.get(o),u=c!==void 0;s.set(o,r),u&&c!==r&&(i==null||i()),n.current=o},[o,r,e,i]),m.useLayoutEffect(()=>()=>{const s=e.current;n.current&&(s.delete(n.current),n.current=null)},[e]),null}),ga=Ct("Skeleton"),Ca=Ct("Container"),va=Ct("Text"),ma=Ct("Icon"),pa=Ct("Button"),ya=Ct("IconButton"),ba=Ct("EmbedIconButton"),Fa=Ct("Rect"),Sa=Ct("Badge"),wa=Ct("Checkbox"),xa=Ct("Link"),de={Container:Ca,Text:va,Icon:ma,Button:pa,IconButton:ya,EmbedIconButton:ba,Checkbox:wa,Rect:Fa,Badge:Sa,Skeleton:ga,Link:xa,icon:mt};function at(o,t){if(o)return function(e){o.call(this,e)}}function Ue({element:o,idPrefix:t="root",theme:e}){const i=[],r=Wn(o,t,0,i,e);if(i.length>0){const n=new Map;for(const{icon:s,size:l}of i){if(!s)continue;const c=n.get(l)??[];c.push(s),n.set(l,c)}n.forEach((s,l)=>{on(s,{size:l})})}return r}function Xi(o){return o==null?"":typeof o=="string"||typeof o=="number"?String(o):Array.isArray(o)?o.map(Xi).join(""):""}function mr(o,t,e){const i=o.fontMetrics,r=o.fonts;if(i===void 0||r===void 0)return{};const n=t??o.baseFontStyle,s=Object.keys(r).find(c=>r[c]===n);if(s===void 0)return{};const l=i[s];return l===void 0?{}:{fontSize:l.fontSize,...e===void 0?{lineHeightPx:l.lineHeightPx}:{}}}function Wn(o,t,e,i,r){if(!o||!m.isValidElement(o))throw new Error("Invalid element. Use Canvas.* components.");const n=o.type,s=n.__canvasType;if(!s)throw new Error(`Unknown canvas component. Use Canvas.* components. Got: ${(n==null?void 0:n.name)||n}`);const l=o.props,u=(o.key!=null?String(o.key):null)??e,d=l.id??`${t}-${s.toLowerCase()}-${u}`,a=g=>wt(g)?mt(g):g;if(s==="Icon"&&l.icon)i.push({icon:a(l.icon),size:l.size??16});else if(s==="IconButton"&&l.icon){const g=l.buttonSize??"s",{iconSize:v}=it[g];i.push({icon:a(l.icon),size:v})}else if(s==="EmbedIconButton"&&l.icon){const g=l.buttonSize??"s",v=l.overrideIconSize??it[g].iconSize;i.push({icon:a(l.icon),size:v})}else if(s==="Checkbox")ca.forEach(g=>{i.push({icon:a(g),size:20})});else if(s==="Button"){const g=l.size??"s",{iconSize:v}=it[g];l.leftIcon&&i.push({icon:a(l.leftIcon),size:v}),l.rightIcon&&i.push({icon:a(l.rightIcon),size:v})}else if(s==="Badge"){const g=l.size??"s",C={xs:10,s:12,m:14,l:16}[g]??12;l.leftIcon&&i.push({icon:a(l.leftIcon),size:C}),l.rightIcon&&i.push({icon:a(l.rightIcon),size:C})}const h=Aa(s,d,l,r);if(l.portalHoverEnabled&&(h.portalHoverEnabled=!0),l.tooltip!==void 0&&(h.tooltip=l.tooltip),l.autoTooltip!==void 0){const g=l.autoTooltip;(g===!0||typeof g=="object"&&g!==null&&g.enabled!==!1)&&(h.portalHoverEnabled=!0)}l.interaction!==void 0&&(h.interaction=zr(l.interaction)),typeof l.zIndex=="number"&&(h.zIndex=l.zIndex),l.style&&(h.style=l.style);const{children:f}=l;return f&&h instanceof gt&&m.Children.toArray(f).forEach((v,C)=>{if(m.isValidElement(v)){const x=Wn(v,d,C,i,r);h.addChild(x)}}),h}function Aa(o,t,e,i){switch(o){case"Container":{const r=e,{id:n,gap:s,columnGap:l,rowGap:c,position:u,left:d,top:a,right:h,bottom:f,zIndex:g,onClick:v,onMouseEnter:C,onMouseLeave:x,onMouseDown:y,backgroundColor:w,__backgroundColorResolver:F,portalHoverEnabled:E,...b}=r,P={...b,columnGap:l??s??0,rowGap:c??s??0},T=new gt(t,P,da(r,i));u&&(T.position=u),d!==void 0&&(T.left=d),a!==void 0&&(T.top=a),h!==void 0&&(T.right=h),f!==void 0&&(T.bottom=f);const B=at(v),O=at(C),rt=at(x),G=at(y);return B&&(T.onClick=B),O&&(T.onMouseEnter=O),rt&&(T.onMouseLeave=rt),G&&(T.onMouseDown=G),T}case"Text":{const{children:r,font:n,color:s,wordWrap:l,lineHeight:c,overflow:u,textOverflow:d,ellipsis:a,maxLines:h,autoTooltip:f,position:g,left:v,top:C,right:x,bottom:y,portalHoverEnabled:w}=e,F=Xi(r),E=i.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';let b;n?b=/["']|sans-serif|serif|monospace/i.test(n)?n:`${n} ${E}`:b=i.baseFontStyle?`${i.baseFontStyle} ${E}`:`13px ${E}`;const P=mr(i,n,c),T=new ao(t,F,{font:b,...P,color:s,wordWrap:l,lineHeight:c,overflow:u,textOverflow:d,ellipsis:a,maxLines:h,autoTooltip:f});return g&&(T.position=g),v!==void 0&&(T.left=v),C!==void 0&&(T.top=C),x!==void 0&&(T.right=x),y!==void 0&&(T.bottom=y),T}case"Icon":{const{icon:r,size:n,color:s,backgroundColor:l,position:c,left:u,top:d,right:a,bottom:h,onClick:f,onMouseEnter:g,onMouseLeave:v,onMouseDown:C}=e,x=wt(r)?mt(r):r,y=new dn(t,x,{size:n,color:s});l&&(y.backgroundColor=l),c&&(y.position=c),u!==void 0&&(y.left=u),d!==void 0&&(y.top=d),a!==void 0&&(y.right=a),h!==void 0&&(y.bottom=h);const w=at(f),F=at(g),E=at(v),b=at(C);return w&&(y.onClick=w),F&&(y.onMouseEnter=F),E&&(y.onMouseLeave=E),b&&(y.onMouseDown=b),y}case"Button":{const{children:r,variant:n,view:s,size:l,leftIcon:c,rightIcon:u,disabled:d,position:a,left:h,top:f,right:g,bottom:v,onClick:C}=e,x=typeof r=="string"?r:"",y=wt(c)?mt(c):c,w=wt(u)?mt(u):u,F=new hn(t,x,{variant:n,view:s,size:l,leftIcon:y,rightIcon:w,disabled:d,theme:i});if(a&&(F.position=a),h!==void 0&&(F.left=h),f!==void 0&&(F.top=f),g!==void 0&&(F.right=g),v!==void 0&&(F.bottom=v),!d){const E=at(C);E&&(F.onClick=E)}return F}case"EmbedIconButton":case"IconButton":{const{icon:r,size:n,variant:s,view:l,buttonSize:c,overrideSquareSize:u,overrideIconSize:d,disabled:a,position:h,left:f,top:g,right:v,bottom:C,onClick:x}=e,y=wt(r)?mt(r):r,w=o==="IconButton"?fn:Bi,F=new w(t,y,{size:n,variant:s,view:l,buttonSize:c,overrideSquareSize:u,overrideIconSize:d,disabled:a});if(F instanceof Bi){const{iconColor:E,iconColorHovered:b}=e;E!==void 0&&(F.iconColor=E),b!==void 0&&(F.iconColorHovered=b)}if(h&&(F.position=h),f!==void 0&&(F.left=f),g!==void 0&&(F.top=g),v!==void 0&&(F.right=v),C!==void 0&&(F.bottom=C),!a){const E=at(x);E&&(F.onClick=E)}return F}case"Checkbox":{const{checked:r,indeterminate:n,size:s="auto",theme:l,view:c,buttonSize:u,disabled:d,position:a,left:h,top:f,right:g,bottom:v,onClick:C}=e,x=mt(r?Ui.checkedIcon:Ui.indeterminateIcon),y=new ua(t,x,r,n,{size:s,theme:l??i,view:c,buttonSize:u,disabled:d});if(a&&(y.position=a),h!==void 0&&(y.left=h),f!==void 0&&(y.top=f),g!==void 0&&(y.right=g),v!==void 0&&(y.bottom=v),!d){const w=at(C);w&&(y.onClick=w)}return y}case"Rect":{const{color:r,borderColor:n,borderWidth:s,position:l,left:c,top:u,right:d,bottom:a}=e,h=new gn(t,r);return n&&(h.borderColor=n),s&&(h.borderWidth=s),l&&(h.position=l),c!==void 0&&(h.left=c),u!==void 0&&(h.top=u),d!==void 0&&(h.right=d),a!==void 0&&(h.bottom=a),h}case"Badge":{const{text:r,view:n,size:s,transparent:l,clear:c,leftIcon:u,rightIcon:d,customColor:a,customBackgroundColor:h,position:f,left:g,top:v,right:C,bottom:x,portalHoverEnabled:y,pilled:w}=e,F=wt(u)?mt(u):u,E=wt(d)?mt(d):d,b=new un(t,r,{view:n,size:s,transparent:l,clear:c,leftIcon:F,rightIcon:E,pilled:w,customColor:a,customBackgroundColor:h,theme:i});return f&&(b.position=f),g!==void 0&&(b.left=g),v!==void 0&&(b.top=v),C!==void 0&&(b.right=C),x!==void 0&&(b.bottom=x),b}case"Skeleton":{const{width:r,height:n,roundness:s,lighter:l,customGradientColor:c,animated:u,shimmerDuration:d,style:a,portalHoverEnabled:h}=e,f=$i(r),g=$i(n),v={...a,...f!==void 0?{width:f}:null,...g!==void 0?{height:g}:null},C=new bn(t,{roundness:s,lighter:l,customGradientColor:c,shimmerDuration:d,animated:u});return C.style=v,C}case"Link":{const{children:r,href:n,target:s,view:l,disabled:c,font:u,color:d,wordWrap:a,lineHeight:h,overflow:f,textOverflow:g,ellipsis:v,maxLines:C,position:x,left:y,top:w,right:F,bottom:E,onClick:b,portalHoverEnabled:P}=e,T=Xi(r),B=i.fontFamily||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';let O;u?O=/["']|sans-serif|serif|monospace/i.test(u)?u:`${u} ${B}`:O=i.baseFontStyle?`${i.baseFontStyle} ${B}`:`13px ${B}`;const rt=mr(i,u,h),G=new Fn(t,T,{font:O,...rt,color:d,wordWrap:a,lineHeight:h,overflow:f,textOverflow:g,ellipsis:v,maxLines:C,href:n,target:s,view:l,disabled:c,theme:i});if(x&&(G.position=x),y!==void 0&&(G.left=y),w!==void 0&&(G.top=w),F!==void 0&&(G.right=F),E!==void 0&&(G.bottom=E),!c){const Q=at(b);Q&&G.setOnClick(Q)}return G}default:throw new Error(`Unknown canvas component type: ${o}`)}}const Ea='400 normal 1rem/1.25rem "SB Sans Text", sans-serif, Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif',Ta="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",Da=30,Ia=50,Ha=3;async function Gn(){return typeof document>"u"||!document.fonts?Promise.resolve():document.fonts.ready.then(()=>{})}function $n(o={}){const{testFont:t=Ea,testText:e=Ta,maxChecks:i=Da,checkInterval:r=Ia,stableThreshold:n=Ha}=o;return new Promise(s=>{if(typeof document>"u"){s();return}const c=document.createElement("canvas").getContext("2d");if(!c){s();return}let u=-1,d=0,a=0;const h=()=>{c.font=t;const{width:f}=c.measureText(e);f!==u?(u=f,d=0):d+=1,a+=1,d>=n||a>=i?s():setTimeout(h,r)};h()})}function Un(o){return Gn().then(()=>$n(o))}function go({dataEditorRef:o,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i}){const r=o.current;if(!r)return;const n=Math.min(30,t),s=e,l=[];for(let c=0-i;c<n;c+=1)for(let u=0;u<s;u+=1)l.push({cell:[u,c]});l.length>0&&r.updateCells(l)}function Co(o){let t=null;return()=>{t===null&&(t=requestAnimationFrame(()=>{t=null,o()}))}}function La(){const o=m.useRef(null),t=m.useCallback(()=>(o.current||(o.current=new Nr),o.current),[]);return{registry:t(),getRegistry:t}}function Xn({dataEditorRef:o,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i}){m.useLayoutEffect(()=>{const r=Co(()=>{wc(),go({dataEditorRef:o,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i})});Un().then(r)},[o,t,e,i])}function Vn({dataEditorRef:o,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i}){m.useEffect(()=>{const r=Co(()=>{go({dataEditorRef:o,rowCount:t,columnCount:e,headerAndGroupHeaderRowsCount:i})});return tn(r)},[o,t,e,i])}L.GridCellKind.Text;const Xe=(o,t)=>({kind:L.GridCellKind.Text,data:o,displayData:o,allowOverlay:!0,readonly:!0,...t}),qt=o=>{const{data:t,...e}=o??{};return{kind:L.GridCellKind.Text,data:"",displayData:"",allowOverlay:!0,readonly:!0,...e}};function Yn(o){const t=o;return!!(t!=null&&t.kind)}function Pa(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)}function vo(o){return typeof o!="object"&&!Array.isArray(o)||o===null}function qn(o){return o==null||typeof o=="boolean"}const ti=o=>{if(!o||!m.isValidElement(o))return!1;const t=o.type;return!!(t!=null&&t.__canvasType)},mo=o=>typeof o=="string",Vi=o=>mo(o)?!0:ti(o),Ba=o=>mo(o)?!0:ti(o),pr=({jsxElement:o,canvasCellCache:t,cellInfo:e,options:i})=>{let r=null;if(Yn(o))return{...o,...i};if(vo(o))return qn(o)?qt(i):Xe(String(o),i);if(!ti(o)){const x="передан НЕ CanvasEl";return Xe(x,{...i,data:x})}const{colInd:n,rowInd:s,row:l,column:c}=e,{id:u}=c,d=i.getPortalEventTarget;let a=null;const h=`cell-${n}-${s}`,f=(x,y,w,F,E,b)=>{let P=(b==null?void 0:b.canvasRoot)instanceof yt?b.canvasRoot:a;{if(!o)return{};const O=Ue({element:o,idPrefix:`cell-${n}-${s}-${u}`,theme:w});P?(P.setRootNode(O),P.setOriginId(h)):P=new yt(O,h),a=P}if(!P)return{};const T=F!==void 0&&E!==void 0?{x:F,y:E}:void 0;P.rootNode.style={width:y.width,height:y.height},r||(r=x.canvas.getBoundingClientRect());const B={x:r.left+y.x,y:r.top+y.y,width:y.width,height:y.height};return P.setPortalEventTarget((d==null?void 0:d())??null),P.setTooltipContext({column:e.column,row:e.row,ctxs:e.ctxs,refTable:i.refTable}),P.render(x,y,T,B,{frameTime:b==null?void 0:b.frameTime,requestAnimationFrame:b==null?void 0:b.requestAnimationFrame}),a=P,{canvasRoot:P}},{data:g,...v}=i,C=c.copyData?typeof c.copyData=="function"?c.copyData(l):c.copyData:g;return Sn(f,void 0,C,v)},po=(o,t,e)=>o?t>=o.x&&t<o.x+o.width&&e>=o.y&&e<o.y+o.height:!1,_a=o=>{const t=o.findIndex(e=>!e.isServiceColumn);return t===-1?o.length:t},Ra=(o,t)=>{if(!o)return;const e=Math.max(o.x,t),i=Math.max(0,o.x+o.width-e);if(!(i<=0||o.height<=0))return{x:e,y:o.y,width:i,height:o.height}};function Kn({cellsSelectionMode:o,selection:t,baseTheme:e,serviceColumnsCount:i,activeDataRange:r,outlineRange:n,checkboxSelectedRowIndexes:s,errorCellRanges:l,highlightRegionsExternal:c}){return m.useMemo(()=>{const u=[...c??[]],d=t.current,a=()=>{if(l!=null&&l.length)for(const C of l)u.push({color:e.errorOutlineColor,range:C,style:"solid-outline"})};if(!d||o==="disabled")return a(),u.length>0?u:void 0;const[,h]=d.cell,g=(s==null?void 0:s.has(h))??!1?e.selectionActiveCheckboxBg:e.selectionActiveBg,v=e.selectionServiceActiveBg;return r&&i>0&&u.push({color:v,range:{x:0,y:r.y,width:i,height:r.height},style:"no-outline"}),r&&o==="cell"&&r.width===1&&r.height===1&&u.push({color:g,range:r,style:"no-outline"}),n&&u.push({color:e.accentColor,range:n,style:"solid-outline"}),a(),u.length>0?u:void 0},[o,t,e.selectionActiveBg,e.selectionActiveCheckboxBg,e.selectionServiceActiveBg,e.errorOutlineColor,e.accentColor,i,r,n,s,l,c])}function Zn({baseRegions:o,selectedColumnIndexes:t,headerSelectedRowIndexes:e,activeRow:i,activeRange:r,selectionRangeStack:n,checkboxAvailableRowIndexes:s,totalRows:l,firstDataCol:c,columnsCount:u,theme:d}){return m.useMemo(()=>{const a=t.length>0,h=e.length>0,f=i!==void 0,g=((n==null?void 0:n.length)??0)>0;if(!a&&!h&&!f&&!g)return o;const v=u-c,C=[...o??[]],x=(y,w)=>{const[F,...E]=[...y].sort((B,O)=>B-O);if(F===void 0)return;let b=F,P=F;const T=(B,O)=>{C.push({color:d.accentColor,range:w(B,O),style:"solid-outline"})};for(const B of E)B===P+1||(T(b,P),b=B),P=B;T(b,P)};if(a){c>0&&C.push({color:d.selectionServiceActiveBg,range:{x:0,y:0,width:c,height:l},style:"no-outline"});for(const y of t)C.push({color:d.selectionActiveBg,range:{x:y,y:0,width:1,height:l},style:"no-outline"});x(t,(y,w)=>({x:y,y:0,width:w-y+1,height:l}))}if(h&&v>0){if(c>0)for(const y of e)C.push({color:d.selectionServiceActiveBg,range:{x:0,y,width:c,height:1},style:"no-outline"});for(const y of e)C.push({color:d.selectionActiveBg,range:{x:c,y,width:v,height:1},style:"no-outline"});x(e,(y,w)=>({x:c,y,width:v,height:w-y+1}))}if(i!==void 0&&v>0){const y=s!=null&&s.has(i)?d.selectionActiveCheckboxBg:d.selectionCheckboxBg,w=(E,b)=>{b>0&&C.push({color:y,range:{x:E,y:i,width:b,height:1},style:"no-outline"})};if(!(r&&i>=r.y&&i<r.y+r.height))w(c,v);else{const E=Math.max(r.x,c),b=r.x+r.width;w(c,E-c),w(b,u-b)}}if(g&&n&&c>0){const y=new Set;for(const w of n){const F=Math.max(w.x,c);if(!(w.x+w.width-F<=0||w.height<=0))for(let b=w.y;b<w.y+w.height;b+=1)y.add(b)}for(const w of y)C.push({color:d.selectionServiceActiveBg,range:{x:0,y:w,width:c,height:1},style:"no-outline"})}return C},[o,t,e,i,r,n,s,l,c,u,d.selectionActiveBg,d.selectionActiveCheckboxBg,d.selectionCheckboxBg,d.selectionServiceActiveBg,d.accentColor])}const Be={columns:L.CompactSelection.empty(),rows:L.CompactSelection.empty(),current:void 0};function jn({cellsSelectionMode:o,gridSelection:t,onGridSelectionChange:e,onSelectionEmit:i}){const[r,n]=m.useState(Be),s=t!==void 0,l=t??r,c=m.useCallback(a=>{s?e==null||e(a):n(a),i==null||i(a)},[s,e,i]),u=m.useCallback(()=>{s?e==null||e(Be):n(Be),i==null||i(Be)},[s,e,i]),d=m.useMemo(()=>o==="range-cell"?"rect":o==="multi-range-cell"?"multi-rect":o==="disabled"?"none":"cell",[o]);return{selection:l,handleGridSelectionChange:c,handleSelectionCleared:u,rangeSelect:d}}const Vt=new Set,yr=({start:o,length:t})=>{const e=new Set;for(let i=0;i<t;i+=1)e.add(o+i);return e};function Jn({columns:o,selection:t,cellsSelectionMode:e,checkboxSelectedRowIndexes:i}){return m.useMemo(()=>{const r=t.current,n=_a(o);if(!(e!=="disabled"&&r!==void 0)||!r)return{hasAnyActiveSelection:!1,firstDataColumnIndex:n,leadingServiceColumnsCount:n,activeRows:Vt,activeColumns:Vt,activeDataRange:void 0,isSingleCellCustomHighlight:!1,outlineRange:void 0,isServiceColumn:h=>{var f;return!!((f=o[h])!=null&&f.isServiceColumn)},isActiveRow:h=>!1,isCheckboxSelectedRow:h=>(i==null?void 0:i.has(h))??!1,isActiveDataCell:(h,f)=>!1,isActiveHeaderColumn:h=>!1};const l=Ra(r.range,n),c=l!==void 0,u=e==="cell"&&l!==void 0&&l.width===1&&l.height===1;if(!c)return{hasAnyActiveSelection:!1,firstDataColumnIndex:n,leadingServiceColumnsCount:n,activeRows:Vt,activeColumns:Vt,activeDataRange:void 0,isSingleCellCustomHighlight:!1,outlineRange:void 0,isServiceColumn:h=>{var f;return!!((f=o[h])!=null&&f.isServiceColumn)},isActiveRow:h=>!1,isCheckboxSelectedRow:h=>(i==null?void 0:i.has(h))??!1,isActiveDataCell:(h,f)=>!1,isActiveHeaderColumn:h=>!1};const d=l!=null&&l.height&&l.height>0?yr({start:l.y,length:l.height}):Vt,a=l!=null&&l.width&&l.width>0?yr({start:l.x,length:l.width}):Vt;return{hasAnyActiveSelection:c,firstDataColumnIndex:n,leadingServiceColumnsCount:n,activeRows:d,activeColumns:a,activeDataRange:l,isSingleCellCustomHighlight:u,outlineRange:u?l:void 0,isServiceColumn:h=>{var f;return!!((f=o[h])!=null&&f.isServiceColumn)},isActiveRow:h=>d.has(h),isCheckboxSelectedRow:h=>(i==null?void 0:i.has(h))??!1,isActiveDataCell:(h,f)=>po(l,h,f),isActiveHeaderColumn:h=>o[h]?a.has(h):!1}},[o,e,i,t])}function ka({highlightActiveRow:o,onHighlightActiveRowChange:t,isHighlightActiveRowControlled:e}){const[i,r]=m.useState(void 0),n=e??t!==void 0,s=n?o:i,l=m.useCallback(c=>{n||r(c),t==null||t(c)},[n,t]);return{activeRow:s,commitActiveRow:l}}function Ma({columns:o}){const[t,e]=m.useState(()=>L.CompactSelection.empty()),i=m.useMemo(()=>t.toArray().filter(u=>{var d;return!((d=o[u])!=null&&d.isServiceColumn)}),[t,o]),r=m.useMemo(()=>new Set(i),[i]),n=m.useRef(void 0),[s,l]=m.useState(!1),c=m.useCallback(()=>{e(L.CompactSelection.empty())},[]);return{selectedColumns:t,setSelectedColumns:e,selectedColumnIndexes:i,selectedColumnSet:r,lastSelectedColumnRef:n,isNativeColumnSelection:s,setIsNativeColumnSelection:l,clearColumnSelection:c}}function za(){const[o,t]=m.useState(()=>L.CompactSelection.empty()),e=m.useMemo(()=>o.toArray(),[o]),i=m.useRef(o);i.current=o;const r=m.useRef(!1),n=m.useRef(L.CompactSelection.empty()),s=m.useRef(!1);m.useEffect(()=>{const c=d=>{r.current=d.ctrlKey||d.metaKey,n.current=i.current,s.current=!0},u=()=>{s.current=!1};return window.addEventListener("pointerdown",c,!0),window.addEventListener("pointerup",u,!0),()=>{window.removeEventListener("pointerdown",c,!0),window.removeEventListener("pointerup",u,!0)}},[]);const l=m.useCallback(()=>{t(L.CompactSelection.empty())},[]);return{selectedRows:o,setSelectedRows:t,headerSelectedRowIndexes:e,selectedRowsRef:i,ctrlGestureRef:r,ctrlBaseRowsRef:n,pointerGestureRef:s,clearRowSelection:l}}function Qn({columns:o,selection:t,cellsSelectionMode:e,highlightActiveType:i,enableColumnSelection:r,enableRowSelection:n,enableSelectAll:s,leadingServiceColumnsCount:l,dataRowCount:c,handleGridSelectionChange:u,handleSelectionCleared:d,onSelectionEmit:a,highlightActiveRow:h,onHighlightActiveRowChange:f,isHighlightActiveRowControlled:g}){const{selectedColumns:v,setSelectedColumns:C,selectedColumnIndexes:x,selectedColumnSet:y,lastSelectedColumnRef:w,isNativeColumnSelection:F,setIsNativeColumnSelection:E}=Ma({columns:o}),{setSelectedRows:b,headerSelectedRowIndexes:P,ctrlGestureRef:T,ctrlBaseRowsRef:B,pointerGestureRef:O}=za(),{activeRow:rt,commitActiveRow:G}=ka({highlightActiveRow:h,onHighlightActiveRowChange:f,isHighlightActiveRowControlled:g}),Q=m.useMemo(()=>o.findIndex(M=>M.isServiceColumn&&M.id==="row-markers"),[o]),kt=m.useCallback(M=>{const{current:N}=M;if(!N)return M;const z=l,{range:X}=N;if(X.x>=z)return M;const Y=X.x+X.width-z;return Y<=0?{current:void 0,rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()}:{...M,current:{...N,cell:[Math.max(N.cell[0],z),N.cell[1]],range:{...X,x:z,width:Y}}}},[l]),ei=m.useCallback(M=>{const N=M.current;if(n&&Q>=0&&N&&N.cell[0]===Q){const X=l,Y=N.range.y,nt=Y+Math.max(N.range.height,1);if(T.current){const W=nt-Y<=1;let tt=B.current;if(tt.length===0&&t.current&&t.current.cell[0]===Q){const dt=t.current.range;tt=L.CompactSelection.empty().add([dt.y,dt.y+Math.max(dt.height,1)]),B.current=tt}let st;W?st=tt.hasIndex(Y)?tt.remove(Y):tt.add(Y):st=tt.add([Y,nt]),C(L.CompactSelection.empty()),b(st),G(void 0),E(!1),u({...M,current:{...N,range:{x:X,y:N.range.y,width:0,height:N.range.height}}}),a==null||a({current:void 0,rows:st,columns:L.CompactSelection.empty()});return}const ht=Math.max(o.length-X,0);C(L.CompactSelection.empty()),b(L.CompactSelection.empty()),G(void 0),E(!1),u({...M,current:{...N,range:{x:X,y:N.range.y,width:ht,height:N.range.height}}});return}const z=kt(M);(z.current!==void 0||z.rows.length>0)&&(C(L.CompactSelection.empty()),b(L.CompactSelection.empty())),E(!1),i==="row"?O.current&&z.current&&G(z.current.cell[1]):G(void 0),u(z)},[o,t,u,kt,Q,n,l,i,a,G,T,B,O,C,b,E]),ii=m.useCallback(()=>{C(L.CompactSelection.empty()),b(L.CompactSelection.empty()),G(void 0),E(!1),d()},[d,G,C,b,E]),ee=m.useMemo(()=>{var N;const M=new Set(x);if(F&&t.current){const{x:z,width:X}=t.current.range;for(let Y=z;Y<z+X;Y+=1)(N=o[Y])!=null&&N.isServiceColumn||M.add(Y)}return Array.from(M).sort((z,X)=>z-X).map(z=>{var X;return(X=o[z])==null?void 0:X.id}).filter(z=>!!z)},[x,F,t,o]),Ht=(e==="range-cell"||e==="multi-range-cell")&&!F&&!(t.current!==void 0&&t.current.cell[0]<l),oi=m.useCallback((M,N)=>{if(s&&Q>=0&&M===Q&&e!=="disabled"){const W=l,tt=Math.max(o.length-W,0);if(tt===0||c===0)return;C(L.CompactSelection.empty()),b(L.CompactSelection.empty()),G(void 0),E(!0),u({current:{cell:[W,0],range:{x:W,y:0,width:tt,height:c},rangeStack:[]},rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()});return}if(!r)return;const z=o[M];if(!z||z.isServiceColumn)return;const X=N.shiftKey;if(N.ctrlKey||N.metaKey){let W=v;if(W.length===0&&F&&t.current){const st=t.current.range;W=W.add([st.x,st.x+st.width])}const tt=W.hasIndex(M)?W.remove(M):W.add(M);w.current=M,C(tt),b(L.CompactSelection.empty()),G(void 0),E(!1),u({current:void 0,rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()}),a==null||a({current:void 0,rows:L.CompactSelection.empty(),columns:tt});return}let nt,ht;X&&w.current!==void 0?(nt=Math.min(w.current,M),ht=Math.max(w.current,M)):(nt=M,ht=M,w.current=M),C(L.CompactSelection.empty()),b(L.CompactSelection.empty()),G(void 0),E(!0),u({current:{cell:[nt,0],range:{x:nt,y:0,width:ht-nt+1,height:c},rangeStack:[]},rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()})},[r,s,Q,e,l,o,t,F,v,c,u,a,G,w,C,b,E]),Ce=m.useCallback(M=>{const N=new Set(M),z=o.map((W,tt)=>!W.isServiceColumn&&N.has(W.id)?tt:-1).filter(W=>W>=0);if(b(L.CompactSelection.empty()),G(void 0),z.length===0){C(L.CompactSelection.empty()),E(!1),u({current:void 0,rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()});return}const X=z[0],Y=z[z.length-1];if(X===void 0||Y===void 0)return;const nt=Y-X===z.length-1;if(w.current=Y,nt){C(L.CompactSelection.empty()),E(!0),u({current:{cell:[X,0],range:{x:X,y:0,width:Y-X+1,height:c},rangeStack:[]},rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()});return}let ht=L.CompactSelection.empty();z.forEach(W=>{ht=ht.add(W)}),C(ht),E(!1),u({current:void 0,rows:L.CompactSelection.empty(),columns:L.CompactSelection.empty()})},[o,c,u,C,b,E,G,w]);return{selectedColumnIndexes:x,selectedColumnKeysAll:ee,selectColumnsByKeys:Ce,selectedColumnSet:y,headerSelectedRowIndexes:P,activeRow:rt,numberingColumnIndex:Q,drawFocusRing:Ht,selectColumnFromHeader:oi,handleGridSelectionWithColumnReset:ei,handleSelectionClearedWithColumns:ii}}function Oa(o,t,e,i){const r=performance.now();function n(s){const l=s-r,c=Math.min(l/i,1),u=t+(e-t)*c;o(Math.round(u)),c<1&&requestAnimationFrame(n)}requestAnimationFrame(n)}const Na=o=>{const t=typeof o=="number",[e,i]=m.useState(()=>t?o:56);return m.useEffect(()=>{t&&Oa(i,e,o,300)},[o]),t?e:o};function ts({cell:o,glideCell:t,rect:e,renderData:i,relativePoint:r,mouseArgs:n}){const s=(i==null?void 0:i.canvasRoot)instanceof yt?i.canvasRoot.getInteractionAtPoint(r.x,r.y):void 0;if(s)return{cell:o,glideCell:t,rect:e,renderData:i,relativePoint:r,interaction:s,...n?{mouseArgs:n}:{}}}function Wa({dataEditor:o,getCellContent:t,clientX:e,clientY:i,nativeEvent:r}){const n=o==null?void 0:o.getMouseArgsForPosition(e,i,r);if(!n||n.kind!=="cell")return;const s=[n.location[0],n.location[1]],l=t(s);if(!uo(l))return;const c=n.bounds,u=Zt({colIndex:s[0],rowIndex:s[1]},c),d=jt(u,l),a={x:n.localEventX,y:n.localEventY};return ts({cell:s,mouseArgs:n,glideCell:l,rect:c,renderData:d,relativePoint:a})}function Ga({eventTarget:o,dataEditorRef:t,getCellContent:e,interactionSessionStore:i,onCellContextMenuExternal:r}){m.useEffect(()=>{if(!o)return;const n=s=>{var g;if(!(s instanceof MouseEvent))return;const l=s;if(l.clientX===0&&l.clientY===0)return;const c=Wa({dataEditor:t.current,getCellContent:e,clientX:l.clientX,clientY:l.clientY,nativeEvent:l});if(!c)return;const{cell:u,interaction:d,mouseArgs:a,relativePoint:h}=c,f=i.beginOrGet({cell:u,relativePoint:h,interaction:d,button:l.button,source:"contextmenu"});if(f.decision.contextMenuMode!=="normal"){if(i.consumePhase(f,"contextmenu-capture"),l.stopPropagation(),(g=l.stopImmediatePropagation)==null||g.call(l),f.decision.contextMenuMode==="none"){l.cancelable&&l.preventDefault();return}!a||!r||r(u,{...a,preventDefault:()=>{l.cancelable&&l.preventDefault()}})}};return o.addEventListener("contextmenu",n,!0),()=>{o.removeEventListener("contextmenu",n,!0)}},[t,o,e,i,r])}const $a=250;function Ua(o){return m.useCallback((t,e)=>{const i=o.consumeEditorRequest(t,$a);return!i||i.target!=="self"?e:{...e,activationBehaviorOverride:"single-click"}},[o])}const ze=350;function br(o){return Math.round(o)}function Xa({cell:o,relativePoint:t,button:e}){return[o[0],o[1],e??"unknown",br(t.x),br(t.y)].join(":")}function Ve(o,t){return o[0]===t[0]&&o[1]===t[1]}function es(o,t){return Math.abs(o.x-t.x)<=1&&Math.abs(o.y-t.y)<=1}function Va(o,t){return!Ve(o.cell,t.cell)||o.button!==void 0&&t.button!==void 0&&o.button!==t.button?!1:es(o.relativePoint,t.relativePoint)}function Ya(o,t){return Date.now()-o.startedAt>(t.maxAgeMs??ze)||!Ve(o.cell,t.cell)||o.button!==void 0&&t.button!==void 0&&o.button!==t.button?!1:es(o.relativePoint,t.relativePoint)}function qa(){let o,t=1;const e=i=>{if(!(!o||!Ya(o,i)))return o};return{beginOrGet:i=>{const r=e(i);return r||(o={id:t++,key:Xa(i),cell:i.cell,relativePoint:i.relativePoint,interaction:i.interaction,decision:zn(i.interaction),consumedPhases:new Set,startedAt:i.startedAt??Date.now(),source:i.source,...i.button!==void 0?{button:i.button}:{}},o)},findMatching:e,getCurrent:()=>o,storeClickResult:(i,r)=>{i.clickResult=r},consumeClickResult:i=>{const r=o;if(!(r!=null&&r.clickResult))return;if(!Va(r,i)){delete r.clickResult;return}const n=r.clickResult;return delete r.clickResult,r.consumedPhases.add("renderer-click"),n},consumePhase:(i,r)=>i.consumedPhases.has(r)?!1:(i.consumedPhases.add(r),!0),armEditorRequest:(i,r)=>{var n;(n=i.editorRequest)!=null&&n.consumed||(i.editorRequest={target:r.target,armedAt:Date.now()})},consumeEditorRequest:(i,r=ze)=>{const n=o;if(!n)return;const s=n.editorRequest;if(!(s!=null&&s.consumed)&&s){if(Date.now()-s.armedAt>r){o=void 0;return}if(Ve(n.cell,i))return s.consumed=!0,n.consumedPhases.add("editor-activation"),s}},isMatchingRecent:(i,r,n=ze)=>{const s=o;return!s||!s.consumedPhases.has(i)?!1:Date.now()-s.startedAt<=n&&Ve(s.cell,r)},clearStale:(i=ze)=>{o&&Date.now()-o.startedAt>i&&(o=void 0)},clear:()=>{o=void 0}}}function Ka(){const o=m.useMemo(()=>qa(),[]),t=m.useCallback(i=>o.beginOrGet(i),[o]),e=m.useCallback(i=>o.consumeClickResult(i),[o]);return{interactionSessionStore:o,beginOrGetInteractionSession:t,consumeCanvasClickResult:e}}function Za(o={}){const t=m.useMemo(()=>!0,[]);return m.useMemo(()=>{const e=[];return t&&e.push(fo({beginOrGetInteractionSession:o.beginOrGetInteractionSession,consumeCanvasClickResult:o.consumeCanvasClickResult})),e.length>0?e:void 0},[t,o.beginOrGetInteractionSession,o.consumeCanvasClickResult])}const Si={glideScroller:"dvn-scroller",glideTable:"gdg-table",glideUnderlay:"dvn-underlay"};function is(o){const t=(o==null?void 0:o.querySelector(`.${Si.glideTable}`))??null,e=(t==null?void 0:t.querySelector(`.${Si.glideScroller}`))??null,i=(t==null?void 0:t.querySelector(`.${Si.glideUnderlay}`))??null;return{container:t,scroller:e,underlay:i}}const Fr="[useGlideElements]";function ja(o,t){const[e,i]=m.useState(null),[r,n]=m.useState(null),[s,l]=m.useState(null),c=m.useRef(null);m.useEffect(()=>{const d=o==null?void 0:o.current;if(Kt.tableDebug(Fr,"useEffect fired",{hasWrapper:!!d,fullScreened:t}),!d)return;const a=()=>{const{container:f,scroller:g,underlay:v}=is(d);return Kt.tableDebug(Fr,"tryFind",{containerFound:!!f,scrollerFound:!!g,underlayFound:!!v}),f?(i(C=>C===f?C:f),n(C=>C===g?C:g),l(C=>C===v?C:v),c.current&&(c.current.disconnect(),c.current=null),!0):!1},h=requestAnimationFrame(()=>{if(a())return;const f=new MutationObserver(()=>{a()});f.observe(d,{childList:!0,subtree:!0}),c.current=f});return()=>{cancelAnimationFrame(h),c.current&&(c.current.disconnect(),c.current=null),i(null),n(null),l(null)}},[o,t]);const u=m.useCallback(d=>e?_e.createPortal(d,e):null,[e]);return{glideContainer:e,glideScroller:r,glideUnderlay:s,isReady:!!e,renderInContainer:u}}function Ja(o){const t=document.createElement("div");t.style.cssText="position:fixed;left:0;top:0;width:0;height:0;pointer-events:none;visibility:hidden",o.appendChild(t);const e=t.getBoundingClientRect();return o.removeChild(t),{x:e.left,y:e.top}}function Qa(o,t){m.useEffect(()=>{if(!t)return;const e=o.current;if(!e)return;const i=Kt.throttleWithLastCall(()=>{const{x:r,y:n}=Ja(e);e.style.setProperty("--gdg-portal-offset-x",`${r}px`),e.style.setProperty("--gdg-portal-offset-y",`${n}px`)},100);return i(),window.addEventListener("resize",i),e.addEventListener("resize",i),()=>{window.removeEventListener("resize",i),e.removeEventListener("resize",i)}},[o,t])}function tu(o,t){const{columnsLast:e,rows:i,ctxs:r,refTable:n,theme:s,portalEventTargetRef:l,externalOnItemHovered:c,onHoverRowChange:u}=o,d=m.useRef(null),a=m.useCallback(f=>{const g=d.current;d.current=null,fe({visible:!1,x:0,y:0,width:0,height:0,source:"cell",originId:g??void 0,nodeId:g??void 0},f,!0)},[]);return m.useCallback(f=>{var x,y,w;c==null||c(f),u==null||u(f.kind==="cell"?f.location[1]:void 0);const g=(l==null?void 0:l.current)??null,v=(x=f.location)==null?void 0:x[0],C=v!=null?e[v]:void 0;if(f.kind==="header"){if(!(C!=null&&C.headerCellTooltip)){a(g);return}const F=`header-tooltip-${v}`;d.current===F||a(g);const b=(y=t.current)==null?void 0:y.getBounds(v,-1);if(!b)return;d.current=F,fe({visible:!0,x:b.x,y:b.y,width:b.width,height:b.height,source:"header",originId:F,nodeId:F,priority:0,tooltipContext:{column:C,ctxs:r,refTable:n,colInd:v,theme:s}},g);return}if(f.kind==="cell"){const F=f.location[1],E=i[F];if(!C||!E||!C.cellTooltip){a(g);return}const b=`col-tooltip-${v}-${F}`;d.current===b||a(g);const T=(w=t.current)==null?void 0:w.getBounds(v,F);if(!T)return;d.current=b,fe({visible:!0,x:T.x,y:T.y,width:T.width,height:T.height,source:"cell",originId:b,nodeId:b,priority:0,tooltipContext:{column:C,row:E,ctxs:r,refTable:n,colInd:v,rowInd:F,theme:s}},g);return}a(g)},[e,i,r,n,s,l,c,u,a,t])}function eu({enabled:o,portalEventTargetRef:t,headerHeight:e,groupHeaderHeight:i,experimental:r}){const[n,s]=m.useState(0),l=m.useRef(null),c=m.useMemo(()=>{const h=e??Oe;let f=typeof h=="number"?h:Oe;return Array.isArray(i)?f+=i.reduce((g,v)=>g+v,0):typeof i=="number"&&(f+=i),f},[e,i]),u=m.useRef(c);u.current=c;const d=m.useCallback(h=>{var x;if((x=l.current)==null||x.call(l),l.current=null,!h)return;if(!o){s(0);return}const f=t==null?void 0:t.current;if(!f)return;const g=f.querySelector(".dvn-scroller"),v=f.querySelector(".dvn-underlay");if(!g||!v)return;const C=()=>{const y=g.scrollTop,w=Math.min(y,u.current);s(-1*w),v.style.overflowY="visible",v.style.transform=`translateY(-${w}px)`};g.addEventListener("scroll",C),l.current=()=>{g.removeEventListener("scroll",C),v.style.transform="",v.style.overflowY=""}},[o,t]),a=m.useMemo(()=>o?{...r,paddingBottom:n}:r,[o,n,r]);return{unstickyCallbackRef:d,mergedExperimental:a}}const wi=xr.div.withConfig({displayName:"styled__StyledOverlayPortal"})(["[id^='gdg-overlay-']{position:fixed;z-index:9001;margin-left:calc(-1 * var(--gdg-portal-offset-x,0px));margin-top:calc(-1 * var(--gdg-portal-offset-y,0px));}"]),iu=xr(L).withConfig({displayName:"styled__StyledGlideDataEditor"})([""]),os={textPrimary:"#13181BF5",textPrimaryHover:"#13181B93",textPrimaryActive:"#13181BC4",textSecondary:"#485056B0",textSecondaryHover:"#485056FF",textSecondaryActive:"#485056D3",textTertiary:"#707C847A",textTertiaryHover:"#717C84FF",textTertiaryActive:"#717C8493",textTertiaryBase:"#8A959D",textTertiaryVariant:"#657179",textParagraph:"#13181BCC",textParagraphHover:"#13181B7A",textParagraphActive:"#13181BA3",textAccent:"#0B7ECB",textAccentHover:"#0D96F2FF",textAccentActive:"#0966A5FF",textAccentTransparent20:"#0B7ECB33",textPositive:"#108E26",textPositiveHover:"#14B32EFF",textPositiveActive:"#0C6A1BFF",textWarning:"#FA5F05",textWarningHover:"#FB782DFF",textWarningActive:"#D25004FF",textNegative:"#E31227",textNegativeHover:"#EE2F43FF",textNegativeActive:"#BD0F21FF",inverseTextPrimary:"#F2F5F8F5",onDarkTextPrimary:"#F2F5F8F5",onDarkTextPrimaryHover:"#F2F5F893",onDarkTextPrimaryActive:"#F2F5F8C4",onDarkTextPrimary96:"#F7F9FBF4",onDarkTextPrimary56:"#F7F9FB8E",onDarkTextPrimary28:"#F7F9FB47",onLightTextPrimary:"#13181BF5",onLightTextPrimaryHover:"#13181B93",onLightTextPrimaryActive:"#13181BC4",surfaceSolidCard:"#FFFFFF",surfaceAccentMinor:"#ECF6FCFF",surfaceSolidDefault:"#060A0C",surfaceSolidTertiary:"#E8EEF2",surfaceAccent:"#118CDF",surfaceAccentHover:"#1798EEFF",surfaceAccentActive:"#0F81CCFF",surfaceTransparentSecondary:"#ADB9C238",surfaceTransparentSecondaryHover:"#ADB9C247",surfaceTransparentSecondaryActive:"#ADB9C24D",surfaceTransparentTertiary:"#8A959D47",surfaceTransparentDeep:"#30373CC6",surfaceClear:"#FFFFFF00",surfacePositive:"#1A9E32",surfacePositiveHover:"#1EB83AFF",surfacePositiveActive:"#178C2CFF",surfaceWarning:"#FA5F05",surfaceWarningHover:"#FB782DFF",surfaceWarningActive:"#E65705FF",surfaceWarningMinor56:"#F3A9128E",surfaceNegative:"#FF293E",surfaceNegativeHover:"#FF5263FF",surfaceNegativeActive:"#FF142CFF",disabled:"#DDDDDD",surfaceTransparentAccent:"#118CDF1F",surfaceTransparentAccent12:"#118CDF1E",surfaceTransparentAccent20:"#118CDF33",surfaceTransparentPositive:"#1A9E321F",surfaceTransparentPositive12:"#1A9E321E",surfaceTransparentPositive20:"#1A9E3233",surfaceTransparentWarning:"#FA5F051F",surfaceTransparentWarning12:"#FA5F051E",surfaceTransparentWarning20:"#FA5F0533",surfaceTransparentNegative:"#FF293E1F",surfaceTransparentNegative12:"#FF293E1E",surfaceTransparentNegative20:"#FF293E33",onLightSurfaceSolidDefault:"#060A0C",onLightSurfaceTransparentDeep:"#30373CC7",onDarkSurfaceSolidDefault:"#F7F9FB",onDarkSurfaceTransparentCard:"#FFFFFF0F",outlineAccent:"#0B7ECB",outlineSolidPrimary:"#D5DFE6",outlineSolidPrimary26:"#D5DFE642",dataBlueMinor:"#CFECFF",dataBlueMinorActive:"#C2E7FFFF",dataBlue:"#8BB2FC",dataAccentMinorHover:"#52BAFF",dataPositive:"#28D247",dataPositiveMinor:"#9EFAAF",dataNegative:"#FF8F9A",dataNegativeMinor:"#FFE0E3",dataWarning:"#FD9C68",dataWarningMinor:"#FEE2D2",dataOrange:"#F3A912",dataOrangeMinor:"#FFD37A",dataViolet:"#AD42F5",dataVioletMinor:"#DEB7F7",dataPink:"#FF8FBC",dataMagenta:"#F391E2",dataCyan:"#00DDE0",dataCyanDark:"#04C6C9",dataLime:"#93E006",dataTeal:"#14CC98"},ou={textPrimary:"#13181BF5",textPrimaryHover:"#13181B93",textPrimaryActive:"#13181BC4",textSecondary:"#03070CAF",textSecondaryHover:"#485056FF",textSecondaryActive:"#485056D3",textTertiary:"#000206A8",textTertiaryHover:"#717C84FF",textTertiaryActive:"#717C8493",textTertiaryBase:"#818C95",textTertiaryVariant:"#65717A",textParagraph:"#13181BCC",textParagraphHover:"#13181B7A",textParagraphActive:"#13181BA3",textAccent:"#0058A2",textAccentHover:"#0D96F2FF",textAccentActive:"#0966A5FF",textAccentTransparent20:"#0058A23F",textPositive:"#0F5E00",textPositiveHover:"#14B32EFF",textPositiveActive:"#0C6A1BFF",textWarning:"#D95800",textWarningHover:"#FB782DFF",textWarningActive:"#D25004FF",textNegative:"#A50016",textNegativeHover:"#EE2F43FF",textNegativeActive:"#BD0F21FF",inverseTextPrimary:"#F2F5F8F5",onDarkTextPrimary:"#F2F5F8F5",onDarkTextPrimaryHover:"#F2F5F893",onDarkTextPrimaryActive:"#F2F5F8C4",onDarkTextPrimary96:"#F7F9FBF4",onDarkTextPrimary56:"#F7F9FB8E",onDarkTextPrimary28:"#F7F9FB47",onLightTextPrimary:"#13181BF5",onLightTextPrimaryHover:"#13181B93",onLightTextPrimaryActive:"#13181BC4",surfaceSolidCard:"#FFFFFF",surfaceAccentMinor:"#CFE5F2FF",surfaceSolidDefault:"#060A0C",surfaceSolidTertiary:"#CFD9E0",surfaceAccent:"#0076D2",surfaceAccentHover:"#1798EEFF",surfaceAccentActive:"#0F81CCFF",surfaceTransparentSecondary:"#7D96A838",surfaceTransparentSecondaryHover:"#ADB9C247",surfaceTransparentSecondaryActive:"#ADB9C24D",surfaceTransparentTertiary:"#516E8347",surfaceTransparentDeep:"#30373DC6",surfaceClear:"#FFFFFF00",surfacePositive:"#198A00",surfacePositiveHover:"#1EB83AFF",surfacePositiveActive:"#178C2CFF",surfaceWarning:"#D95800",surfaceWarningHover:"#FB782DFF",surfaceWarningActive:"#E65705FF",surfaceWarningMinor56:"#D491008E",surfaceNegative:"#E7002F",surfaceNegativeHover:"#FF5263FF",surfaceNegativeActive:"#FF142CFF",disabled:"#DDDDDD",surfaceTransparentAccent:"#0076D21F",surfaceTransparentAccent12:"#0076D21E",surfaceTransparentAccent20:"#0076D233",surfaceTransparentPositive:"#198A001F",surfaceTransparentPositive12:"#198A003F",surfaceTransparentPositive20:"#198A0033",surfaceTransparentWarning:"#D958001F",surfaceTransparentWarning12:"#D958003F",surfaceTransparentWarning20:"#D9580033",surfaceTransparentNegative:"#E7002F1F",surfaceTransparentNegative12:"#E7002F3F",surfaceTransparentNegative20:"#E7002F33",onLightSurfaceSolidDefault:"#060A0C",onLightSurfaceTransparentDeep:"#30373DC7",onDarkSurfaceSolidDefault:"#D6DFE7",onDarkSurfaceTransparentCard:"#FFFFFF0F",outlineAccent:"#0058A2",outlineSolidPrimary:"#C4CFD7",outlineSolidPrimary26:"#AFC0CB42",dataBlueMinor:"#9CD5FF",dataBlueMinorActive:"#C2E7FFFF",dataBlue:"#6096FF",dataAccentMinorHover:"#0077C1",dataPositive:"#168600",dataPositiveMinor:"#96DAA1",dataNegative:"#BA5161",dataNegativeMinor:"#F8BDC4",dataWarning:"#B35B10",dataWarningMinor:"#F7C29D",dataOrange:"#D49100",dataOrangeMinor:"#F3B400",dataViolet:"#9A29E0",dataVioletMinor:"#D48BFF",dataPink:"#FB5AA5",dataMagenta:"#EB60D7",dataCyan:"#00C1C3",dataCyanDark:"#00AAAD",dataLime:"#7FC400",dataTeal:"#00B082"},ru={...os},nu={light:os,dark:ru,highContrastLight:ou},su=(o="light")=>nu[o],ft={bgEditableCell:{light:"#FFF6E5",dark:"#211807",highContrastLight:"#F1DDB8"},bgEditableCellHovered:{light:"#FFF4E0",dark:"#2A1F09",highContrastLight:"#E8D4AD"},selectionCheckboxBg:{light:"#ECF6FC",dark:"#ECF6FC",highContrastLight:"#CFE5F2"},selectionActiveBg:{light:"#E2F1FB",dark:"#E2F1FB",highContrastLight:"#BFDDF4"},selectionActiveCheckboxBg:{light:"#D1E9F8",dark:"#D1E9F8",highContrastLight:"#9BCAEA"},selectionServiceBg:{light:"#ECF6FC",dark:"#ECF6FC",highContrastLight:"#CFE5F2"},selectionServiceActiveBg:{light:"#D4E7F2",dark:"#D4E7F2",highContrastLight:"#B9D6E7"},errorOutlineColor:{light:"#FF3D51",dark:"#FF3D51",highContrastLight:"#E9203F"},bgRowHovered:{light:"#F7F9FB",dark:"#F7F9FB",highContrastLight:"#E8EEF2"},bgServiceRowHovered:{light:"#D4E7F2",dark:"#D4E7F2",highContrastLight:"#B9D6E7"},bgSelectedRowHovered:{light:"#DEECF5",dark:"#DEECF5",highContrastLight:"#C2DCEB"}},lu=o=>({tokens:su(o),fonts:Ne,fontMetrics:Dr,bgEditableCell:ft.bgEditableCell[o],bgEditableCellHovered:ft.bgEditableCellHovered[o],selectionCheckboxBg:ft.selectionCheckboxBg[o],selectionActiveBg:ft.selectionActiveBg[o],selectionActiveCheckboxBg:ft.selectionActiveCheckboxBg[o],selectionServiceBg:ft.selectionServiceBg[o],selectionServiceActiveBg:ft.selectionServiceActiveBg[o],errorOutlineColor:ft.errorOutlineColor[o],bgRowHovered:ft.bgRowHovered[o],bgServiceRowHovered:ft.bgServiceRowHovered[o],bgSelectedRowHovered:ft.bgSelectedRowHovered[o]}),ot={accentColor:{light:"#0b7ecb",dark:"#0b7ecb",highContrastLight:"#0058A2"},accentLight:{light:"#E2F1FB",dark:"#E2F1FB",highContrastLight:"#DAE8F1"},textDark:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5"},textHeader:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5"},textHeaderSelected:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5"},textGroupHeader:{light:"#13181BF5",dark:"#13181BF5",highContrastLight:"#13181BF5"},bgCell:{light:"#FFFFFF",dark:"#FFFFFF",highContrastLight:"#FFFFFF"},bgHeader:{light:"#ECF6FCFF",dark:"#ECF6FCFF",highContrastLight:"#CFE5F2FF"},bgHeaderHasFocus:{light:"#ECF6FCFF",dark:"#ECF6FCFF",highContrastLight:"#B9D6E7"},bgHeaderHovered:{light:"#DEECF5",dark:"#DEECF5",highContrastLight:"#C2DCEB"},borderColor:{light:"#D5DFE6",dark:"#D5DFE6",highContrastLight:"#C4CFD7"},bgGroupHeader:{light:"#ECF6FCFF",dark:"#ECF6FCFF",highContrastLight:"#CFE5F2FF"},bgGroupHeaderHovered:{light:"#DEECF5",dark:"#DEECF5",highContrastLight:"#C2DCEB"}},cu=o=>({accentColor:ot.accentColor[o],accentLight:ot.accentLight[o],textDark:ot.textDark[o],textHeader:ot.textHeader[o],textHeaderSelected:ot.textHeaderSelected[o],textGroupHeader:ot.textGroupHeader[o],bgCell:ot.bgCell[o],bgHeader:ot.bgHeader[o],bgHeaderHasFocus:ot.bgHeaderHasFocus[o],bgHeaderHovered:ot.bgHeaderHovered[o],borderColor:ot.borderColor[o],bgGroupHeader:ot.bgGroupHeader[o],bgGroupHeaderHovered:ot.bgGroupHeaderHovered[o]}),Sr={small:"bodyXXS",medium:"bodyS",big:"bodyM"},au=(o="big")=>{const t=Ne[Sr[o]],e=Dr[Sr[o]],i=`${e.fontSize}px`,r=e.lineHeightPx,n=Er[o],{cellHorizontalPadding:s,cellVerticalPadding:l}=n;return{headerFontStyle:Ne.bodyXSBold,baseFontStyle:t,fontFamily:'"SB Sans Text", sans-serif, Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif',editorFontSize:i,lineHeight:r,cellHorizontalPadding:s,cellVerticalPadding:l,activeSizes:n}},yo=(o="big",t="light")=>({...cu(t),...au(o),...lu(t),rowSize:o}),uu=yo(),wr=(o,t)=>{if(o==null)return null;const e=typeof o=="number"?o:o(t);return[t.colInd,t.colInd+e]};function hu(...o){}const du={},xi=o=>Array.isArray(o)?o.filter(t=>typeof t=="string"):typeof o=="string"?[o]:[],fu=({columns:o,rows:t,bottomSummaryRows:e,rowHeight:i,width:r,rowSize:n="medium",ctxs:s=du,freezeColumns:l,onColumnResize:c,renderGroupHeader:u,groupAlignMap:d,refTable:a,onColumnsReorder:h,portalEventTargetRef:f,onItemHovered:g,unstickyHeader:v,resizableColumn:C=!0,minColumnWidth:x=56,maxColumnWidth:y,maxColumnAutoWidth:w,containerRef:F,containerClassName:E,containerStyle:b,renderOverlayFeatures:P,hideGrid:T,contentStateNode:B,fullScreened:O,editorOverlayPortal:rt,highlightActiveType:G="disabled",cellsSelectionMode:Q="range-cell",enableColumnSelection:kt=!0,enableRowSelection:ei=!0,enableSelectAll:ii=!0,enableLowDprHairline:ee,gridSelection:Ht,onGridSelectionChange:oi,onSelectionEmit:Ce,onColumnSelectionChange:M,pendingColumnSelectionKeys:N,onColumnSelectionApplied:z,highlightActiveRow:X,onHighlightActiveRowChange:Y,highlightActiveRowControlled:nt,highlightRegions:ht,checkboxSelectedRowIndexes:W,checkboxVisibleRowIndexes:tt,hoverEffects:st,onCellClicked:dt,onCellContextMenu:ie,onGroupHeaderClicked:Lt,onMouseMove:ve,portalElementRef:gu,...Mt})=>{var _o,Ro;const bo=Kt.useActiveTheme(),_=m.useMemo(()=>yo(n,bo),[n,bo]),rs=m.useMemo(()=>{const p=typeof i=="number"?i:void 0;if(p)return p;const S=Ar[n],A=typeof i=="function"?i:void 0;return A?D=>{const H=t[D];if(!H)return p??S;const R=A(H,{rowSizeName:n,rowSizeValue:S},D);return typeof R=="number"&&!Number.isNaN(R)?R:S}:S},[t,i,n]),zt=(e==null?void 0:e.length)??0,ns=Na(rs),[me,ss]=m.useState(new Map),ls=m.useCallback((p,S,A,D)=>{const H=p;H.id&&(c==null||c(H,S,A,D),ss(I=>(I.set(H.id,S),new Map(I))))},[c]),Ot=m.useMemo(()=>me.size===0?o:o.map(p=>me.has(p.id)?{...p,width:me.get(p.id),grow:0}:p),[o,me]),[Fo,Cu]=m.useState(0),ri=m.useMemo(()=>new WeakMap,[]),ni=m.useRef(null),Tt=m.useRef(null);m.useEffect(()=>{var p;(Ht==null?void 0:Ht.current)!==void 0&&((p=Tt.current)==null||p.focus())},[Ht]);const{interactionSessionStore:lt,beginOrGetInteractionSession:cs,consumeCanvasClickResult:as}=Ka(),So=Ua(lt),{selection:vt,handleGridSelectionChange:us,handleSelectionCleared:hs,rangeSelect:ds}=jn({cellsSelectionMode:Q,gridSelection:Ht,onGridSelectionChange:oi,onSelectionEmit:Ce}),et=Jn({columns:Ot,selection:vt,cellsSelectionMode:Q,checkboxSelectedRowIndexes:W}),fs=m.useMemo(()=>Y?p=>Y(p,p!==void 0?t[p]:void 0):void 0,[Y,t]),{selectedColumnIndexes:gs,selectedColumnKeysAll:wo,selectColumnsByKeys:pe,selectedColumnSet:ye,headerSelectedRowIndexes:xo,activeRow:Cs,numberingColumnIndex:Ao,drawFocusRing:vs,selectColumnFromHeader:Eo,handleGridSelectionWithColumnReset:ms,handleSelectionClearedWithColumns:ps}=Qn({columns:Ot,selection:vt,cellsSelectionMode:Q,highlightActiveType:G,enableColumnSelection:kt,enableRowSelection:ei,enableSelectAll:ii,leadingServiceColumnsCount:et.leadingServiceColumnsCount,dataRowCount:t.length+zt,handleGridSelectionChange:us,handleSelectionCleared:hs,onSelectionEmit:Ce,highlightActiveRow:X,onHighlightActiveRowChange:fs,isHighlightActiveRowControlled:nt});m.useEffect(()=>{M==null||M(wo)},[wo,M]),m.useEffect(()=>{if(!N)return;pe(N);const p=setTimeout(()=>z==null?void 0:z(),0);return()=>clearTimeout(p)},[N,Ot,pe,z]);const be=xo.length>0,Fe=m.useMemo(()=>{var A;const p=new Set,S=(A=vt.current)==null?void 0:A.rangeStack;if(S){const D=et.firstDataColumnIndex;for(const H of S){const I=Math.max(H.x,D);for(let R=I;R<H.x+H.width;R+=1)p.add(R)}}return p},[vt,et.firstDataColumnIndex]),V=m.useMemo(()=>Ot.map((p,S)=>{const A={...p.themeOverride??{}};let D=Object.keys(A).length>0;return p.isServiceColumn&&(A.bgCell=_.selectionServiceBg,D=!0),S===Ao&&(A.accentLight="transparent",A.accentColor="transparent",D=!0),et.isActiveHeaderColumn(S)&&(A.bgHeader=_.selectionServiceActiveBg,A.bgHeaderHasFocus=_.selectionServiceActiveBg,D=!0),ye.has(S)&&(A.bgHeader=_.selectionServiceActiveBg,A.bgHeaderHasFocus=_.selectionServiceActiveBg,D=!0),Fe.has(S)&&(A.bgHeader=_.selectionServiceActiveBg,A.bgHeaderHasFocus=_.selectionServiceActiveBg,D=!0),be&&!p.isServiceColumn&&(A.bgHeader=_.selectionServiceActiveBg,A.bgHeaderHasFocus=_.selectionServiceActiveBg,D=!0),D?{...p,themeOverride:A}:p}),[Ot,et,ye,Fe,be,Ao,_.selectionServiceBg,_.selectionServiceActiveBg]),ys=m.useMemo(()=>{var A;const p=(A=vt.current)==null?void 0:A.range,S=[];return V.forEach((D,H)=>{D.isServiceColumn||!D.isErrorCell||t.forEach((I,R)=>{var k;(k=D.isErrorCell)!=null&&k.call(D,I)&&(po(p,H,R)||S.push({x:H,y:R,width:1,height:1}))})}),S},[V,t,vt.current]),Se=m.useCallback(([p,S],A)=>{var Ee,Oo,Te,No;hu(Fo);const D=(A==null?void 0:A.applyCanvasEditorActivation)!==!1,H=It=>D?So([p,S],It):It,I=!!e&&S>t.length-1,R=t[S],k=V[p];if(!k)return qt();if(I){const It=e[S-t.length],{renderSummaryCell:Wo,colSpan:$s}=k;if(!Wo||!It)return qt();const fi={row:It,column:k,colInd:p,rowInd:S,ctxs:s,theme:_,hovered:{cellHover:!1,rowHover:!1},active:{cellActive:!1,rowActive:!1}},Us=Wo(fi),Go=wr($s,fi),Xs={data:"",...Go&&{span:Go}};return H(pr({jsxElement:Us,canvasCellCache:ri,cellInfo:fi,options:{...Xs,getPortalEventTarget:()=>(f==null?void 0:f.current)??null,refTable:a}}))}if(!R)return qt();const q=ni.current,U={row:R,column:k,colInd:p,rowInd:S,ctxs:s,theme:_,hovered:{cellHover:(q==null?void 0:q.colInd)===p&&(q==null?void 0:q.rowInd)===S,rowHover:(q==null?void 0:q.rowInd)===S},active:{cellActive:et.isActiveDataCell(p,S),rowActive:et.isActiveRow(S)}},{renderCell:K,id:j,colSpan:$,editable:Dt,contentAlign:Bt,columnThemeOverride:xe}=k,Ae=((Oo=(Ee=R[j])==null?void 0:Ee.toString)==null?void 0:Oo.call(Ee))??"NOT FOUND",ko=wr($,U),Mo=Dt?typeof Dt=="boolean"?Dt:Dt(R):!1,hi=typeof xe=="function"?xe(U):void 0,di={data:((No=(Te=R[j])==null?void 0:Te.toString)==null?void 0:No.call(Te))??"NOT FOUND",...Mo?{readonly:!1,allowOverlay:!0}:{readonly:!0,...k.hasPreview===!0&&{allowOverlay:!0},...k.hasPreview==="none"&&{allowOverlay:!1}},themeOverride:{...hi,...Mo&&{bgCell:_.bgEditableCell}},contentAlign:Bt,...ko&&{span:ko}};if(!K){const It=String(Ae);return vo(It)?H(Xe(It,di)):H(qt(di))}const zo=hi?{...U,theme:{..._,...hi}}:U,Gs=K(zo);return H(pr({jsxElement:Gs,canvasCellCache:ri,cellInfo:zo,options:{...di,getPortalEventTarget:()=>(f==null?void 0:f.current)??null,refTable:a}}))},[Fo,e,t,V,s,_,et,ri,f,So]),bs=m.useCallback((p,S)=>{var $;const A=Se(p,{applyCanvasEditorActivation:!1});if(!uo(A)){dt==null||dt(p,S);return}let D=!1;const H=S.preventDefault;S.preventDefault=()=>{D=!0,H()};const I=Zt({colIndex:p[0],rowIndex:p[1]},S.bounds),R=jt(I,A),k={x:S.localEventX,y:S.localEventY},q=ts({cell:p,glideCell:A,rect:S.bounds,renderData:R,relativePoint:k}),U=q?lt.beginOrGet({cell:p,relativePoint:k,interaction:q.interaction,button:S.button,source:"click"}):lt.beginOrGet({cell:p,relativePoint:k,interaction:Or(),button:S.button,source:"click"}),K=ho({cell:A,rect:S.bounds,relativePoint:k,renderData:R,rowData:t[p[1]],rowIndex:p[1]}),j=U?Jc({decision:U.decision,propagationStopped:K.propagationStopped,suppressGridDefault:K.suppressGridDefault}):{suppressExternalCellClick:K.propagationStopped,suppressGridDefaultForClick:K.suppressGridDefault};if(U&&(lt.consumePhase(U,"cell-click"),lt.storeClickResult(U,K)),S.button===0&&(($=j.editorRequest)==null?void 0:$.target)==="self"&<.armEditorRequest(U,j.editorRequest),j.suppressGridDefaultForClick&&(S.preventDefault(),U!=null&&U.decision.editorRequest&<.clear()),j.suppressExternalCellClick||dt==null||dt(p,S),D||S.button===1){lt.clear();return}},[Se,lt,dt,t]),Fs=m.useCallback((p,S)=>{lt.isMatchingRecent("contextmenu-capture",p)||ie==null||ie(p,S)},[lt,ie]),Ss=Za({beginOrGetInteractionSession:cs,consumeCanvasClickResult:as}),Nt=m.useRef(null),Wt=m.useRef(null),oe=m.useMemo(()=>new Map,[]),To=m.useMemo(()=>new Map,[]),si=m.useRef(null),Pt=m.useRef(null),ws=m.useMemo(()=>Kt.mergeRefs(Pt,F),[F]),{drawHeader:xs,onHeaderClicked:As}=m.useMemo(()=>({drawHeader:(A,D)=>{var Ae;const{ctx:H,rect:I,columnIndex:R}=A,k=V[R];if(!k||!k.renderHeaderCell)return D();const q={column:k,drawArgs:A,ctxs:s,theme:_};let U=k.renderHeaderCell(q);if(!Vi(U))return D();typeof U=="string"&&(U=Ft.jsx(de.Container,{style:{width:"100%"},alignItems:"center",children:Ft.jsx(de.Text,{children:U})}));const K=`header-${k.id}-${R}`,j=Ue({element:U,idPrefix:K,theme:_});let $;oe.has(k.id)?($=oe.get(k.id),$==null||$.setRootNode(j),$!=null&&$.rootNode&&($.rootNode.style={width:I.width,height:I.height})):($=new yt(j,K),$.rootNode.style={width:I.width,height:I.height},oe.set(k.id,$)),$==null||$.setPortalEventTarget((f==null?void 0:f.current)??null),$==null||$.setTooltipContext({column:k,ctxs:s,refTable:a});const Dt=((Ae=Nt.current)==null?void 0:Ae.id)===k.id?Nt.current:void 0,Bt=H.canvas.getBoundingClientRect(),xe={x:Bt.left+I.x,y:Bt.top+I.y,width:I.width,height:I.height};return $==null?void 0:$.render(H,I,Dt,xe)},onHeaderClicked:(A,D)=>{const H=V[A];if(H){if(H.renderHeaderCell){const I=oe.get(H.id);if(I){const R=I.getInteractionAtPoint(D.localEventX,D.localEventY);if(I.dispatchPointerEvent("click",D.localEventX,D.localEventY),R)return}}Eo(A,D)}}}),[V,s,_,oe,f,Tt,Eo]),Es=m.useCallback((p,S)=>{const A=V[p];if(!kt||!A){Lt==null||Lt(p,S);return}const D=xi(A.group),H=Math.max(0,D.indexOf(S.group)),I=D.slice(0,H+1).join("\0"),R=K=>{const j=V[K];return j!==void 0&&xi(j.group).slice(0,H+1).join("\0")===I};let k=p,q=p;for(;k-1>=0&&R(k-1);)k-=1;for(;q+1<V.length&&R(q+1);)q+=1;const U=[];for(let K=k;K<=q;K+=1){const j=V[K];j&&!j.isServiceColumn&&U.push(j.id)}U.length>0&&pe(U),Lt==null||Lt(p,S)},[kt,V,pe,Lt]),Do=m.useMemo(()=>{const p=new Map;V.forEach((A,D)=>{if(A.isServiceColumn)return;const H=et.isActiveHeaderColumn(D)||ye.has(D)||Fe.has(D)||be;xi(A.group).forEach(I=>{if(I==="")return;const R=p.get(I);p.set(I,(R??!0)&&H)})});const S=new Set;return p.forEach((A,D)=>{A&&S.add(D)}),S},[V,et,ye,Fe,be]),Ts=m.useCallback(p=>{const S=d==null?void 0:d.get(p),A={name:p,...S&&{spanAlign:S}};return Do.has(p)?{...A,overrideTheme:{bgGroupHeader:_.selectionServiceActiveBg,bgGroupHeaderHovered:_.bgHeaderHovered}}:A},[d,Do,_.selectionServiceActiveBg,_.bgHeaderHovered]),{glideContainer:li,isReady:Ds,renderInContainer:Is}=ja(Pt,O),Io=rt==="inside";Qa(Pt,Io),Ga({eventTarget:li??Pt.current,dataEditorRef:Tt,getCellContent:Se,interactionSessionStore:lt,onCellContextMenuExternal:ie});const{unstickyCallbackRef:Ho,mergedExperimental:ci}=eu({enabled:v,portalEventTargetRef:f,headerHeight:Mt.headerHeight,groupHeaderHeight:Mt.groupHeaderHeight,experimental:Mt.experimental}),Hs=m.useMemo(()=>Kt.mergeRefs(Tt,a,Ho),[a,Ho]),Ls=m.useMemo(()=>ee===void 0?ci:{...ci,enableLowDprHairline:ee},[ee,ci]),Lo=m.useCallback((...p)=>{var H;const S=Tt.current;if(!S)return;const A=new Set;p.forEach(I=>{typeof I=="number"&&I>=0&&I<t.length&&A.add(I)});const D=[];A.forEach(I=>{V.forEach((R,k)=>{D.push({cell:[k,I]})})}),D.length>0&&((H=S.updateCells)==null||H.call(S,D))},[V,t.length]),we=m.useCallback(p=>{const S=ni.current;(S==null?void 0:S.colInd)===(p==null?void 0:p.colInd)&&(S==null?void 0:S.rowInd)===(p==null?void 0:p.rowInd)||(ni.current=p,Lo(S==null?void 0:S.rowInd,p==null?void 0:p.rowInd))},[Lo]),Ps=m.useCallback(p=>{ve==null||ve(p),p.kind==="cell"?(()=>{const A=p.location[0],D=p.location[1],H=t[D],I=V[A];if(!H||!I||I.isServiceColumn){we(null);return}we({colInd:A,rowInd:D})})():we(null),p.kind==="group-header"?(()=>{if(typeof p.group!="string"){Wt.current=null;return}Wt.current={id:p.group,x:p.localEventX,y:p.localEventY}})():Wt.current=null,p.kind==="header"?(()=>{var I,R;const A=p.location[0],D=p.location[1],H=V[A];if(!H||!(H!=null&&H.renderHeaderCell)){Nt.current=null;return}Nt.current={id:H.id,x:p.localEventX,y:p.localEventY},(R=(I=Tt.current)==null?void 0:I.updateCells)==null||R.call(I,[{cell:[A,D]}])})():Nt.current=null,Nt.current=null,Wt.current=null},[V,ve,t,we]),Po={dataEditorRef:Tt,rowCount:t.length,columnCount:V.length,headerAndGroupHeaderRowsCount:1+(Mt.groupHeaderHeight??[]).length};Vn(Po),Xn(Po);const Bs=m.useMemo(()=>h?(S,A)=>{var I,R;const D=(I=V[S])==null?void 0:I.id,H=(R=V[A])==null?void 0:R.id;typeof D!="string"||typeof H!="string"||h(D,H)}:void 0,[V,h]),_s=m.useMemo(()=>{if(u)return(p,S)=>{var Bt;const A=u(p);if(A==="default")return S();if("defaultWithCustomGroupName"in A)return S(A.defaultWithCustomGroupName);const{groupName:H,rect:I,ctx:R}=p;let k=A;if(!Vi(k))return S();typeof k=="string"&&(k=Ft.jsx(de.Container,{style:{width:"100%"},alignItems:"center",children:Ft.jsx(de.Text,{children:k})}));const q=H,U=Ue({element:k,idPrefix:q,theme:_}),K=new yt(U,q);K.rootNode.style={width:I.width,height:I.height},K.setPortalEventTarget((f==null?void 0:f.current)??null),To.set(q,K);const j=((Bt=Wt.current)==null?void 0:Bt.id)===q?Wt.current:void 0,$=R.canvas.getBoundingClientRect(),Dt={x:$.left+I.x,y:$.top+I.y,width:I.width,height:I.height};return K.render(R,I,j,Dt)}},[To,u,_,f]),ai=st==null?void 0:st.row,re=!!ai,Bo=typeof ai=="object"?ai.color:void 0,[Gt,Rs]=m.useState(void 0),ks=m.useCallback(p=>{Rs(S=>S===p?S:p)},[]),Ms=m.useMemo(()=>{const p=!!(W!=null&&W.size),S=re?Gt:void 0;if(!zt&&!p&&S===void 0)return;const A=Bo??_.bgRowHovered;return D=>D>t.length-1?{bgCell:_.bgHeader}:W!=null&&W.has(D)?{bgCell:D===S?_.bgSelectedRowHovered:_.selectionCheckboxBg}:D===S?{bgCell:A}:{}},[t.length,zt,_.bgHeader,_.selectionCheckboxBg,_.bgRowHovered,_.bgSelectedRowHovered,W,re,Gt,Bo]),zs=tu({columnsLast:V,rows:t,ctxs:s,refTable:a,theme:_,portalEventTargetRef:f,externalOnItemHovered:g,onHoverRowChange:re?ks:void 0},Tt),Os=Kn({cellsSelectionMode:Q,selection:vt,baseTheme:_,serviceColumnsCount:et.leadingServiceColumnsCount,activeDataRange:et.activeDataRange,outlineRange:et.outlineRange,checkboxSelectedRowIndexes:W,errorCellRanges:ys,highlightRegionsExternal:ht}),ui=Zn({baseRegions:Os,selectedColumnIndexes:gs,headerSelectedRowIndexes:xo,activeRow:Cs,activeRange:(_o=vt.current)==null?void 0:_o.range,selectionRangeStack:(Ro=vt.current)==null?void 0:Ro.rangeStack,checkboxAvailableRowIndexes:tt,totalRows:t.length+zt,firstDataCol:et.leadingServiceColumnsCount,columnsCount:Ot.length,theme:_}),Ns=m.useMemo(()=>{const p=et.leadingServiceColumnsCount;return!re||Gt===void 0||Gt>t.length-1||p===0?ui:[{color:_.bgServiceRowHovered,range:{x:0,y:Gt,width:p,height:1},style:"no-outline"},...ui??[]]},[ui,et.leadingServiceColumnsCount,re,Gt,t.length,_.bgServiceRowHovered]),Ws=m.useMemo(()=>{if(!(!b&&!B&&!T))return{...b,...B?{position:"relative"}:void 0,...T?{height:"100%",minHeight:0}:void 0}},[b,B,T]);return Ft.jsxs("div",{ref:ws,className:E,style:Ws,children:[Io?_e.createPortal(Ft.jsx(wi,{ref:si,onAnimationEndCapture:p=>p.stopPropagation(),id:"portal"}),(Pt==null?void 0:Pt.current)??document.body):_e.createPortal(Ft.jsx(wi,{id:"portal",ref:si}),document.body),_e.createPortal(Ft.jsx(wi,{id:"portal2"}),document.body),!T&&Ft.jsx(iu,{ref:Hs,className:"gdg-table",portalElementRef:si,theme:_,getRowThemeOverride:Ms,onHeaderClicked:As,onGroupHeaderClicked:Es,onMouseMove:Ps,drawHeader:xs,drawGroupHeader:_s,getGroupDetails:Ts,getCellContent:Se,columns:V,rows:t.length+zt,freezeTrailingRows:zt,freezeColumns:l,minColumnWidth:x,maxColumnAutoWidth:w,maxColumnWidth:y,columnSelect:"none",columnSelectionBlending:"exclusive",drawFocusRing:vs,gridSelection:vt,onGridSelectionChange:ms,onSelectionCleared:ps,width:r??"100%",onColumnMoved:Bs,onColumnResize:C?ls:void 0,customRenderers:Ss,rowHeight:ns,highlightRegions:Ns,rangeSelect:ds,smoothScrollX:!0,smoothScrollY:!0,headerHeight:Oe,onCellClicked:bs,onCellContextMenu:Fs,onItemHovered:zs,...Mt,experimental:Ls,keybindings:{...Mt.keybindings,copy:!1,paste:!1},onPaste:!1}),B,Ds&&li&&(P==null?void 0:P({containerElement:li,renderInContainer:Is}))]})};exports.BUTTON_PADDING_Y=Qt;exports.CACHE_SEPARATOR=Qi;exports.CANVAS_CELL_KIND=Qe;exports.CANVAS_PORTAL_EVENT=Ge;exports.Canvas=de;exports.CanvasAbsoluteContainer=cl;exports.CanvasBadge=un;exports.CanvasButton=hn;exports.CanvasChevron=Bl;exports.CanvasContainer=gt;exports.CanvasEmbedIconButton=Bi;exports.CanvasHoverController=qi;exports.CanvasIcon=dn;exports.CanvasIconButton=fn;exports.CanvasLeaf=bt;exports.CanvasLink=Fn;exports.CanvasNode=_t;exports.CanvasRect=gn;exports.CanvasRegistry=Nr;exports.CanvasRoot=dl;exports.CanvasSkeleton=bn;exports.CanvasText=ao;exports.CellCanvasRoot=yt;exports.DANGER_COLOR=Ji;exports.DANGER_TEXT_COLOR=Ai;exports.DEFAULT_ACCENT_FG=ge;exports.DEFAULT_BORDER_WIDTH=At;exports.DEFAULT_BUTTON_RADIUS=Zi;exports.DEFAULT_CURSOR=xn;exports.DEFAULT_HEADER_HEIGHT=Oe;exports.DEFAULT_ICON_SIZE=Gr;exports.DEFAULT_ICON_SPACING=ji;exports.DEFAULT_ROW_HEIGHT=Ar;exports.DEFAULT_SECONDARY_HOVER=$r;exports.DEFAULT_SIZE=je;exports.DEFAULT_TEXT_PADDING=fl;exports.DEFAULT_VIEW=Je;exports.DISABLED_BG_COLOR=Ur;exports.DISABLED_BORDER_COLOR=Xr;exports.DISABLED_TEXT_COLOR=Ei;exports.DrawBatcher=Ke;exports.EMPTY_CELL_OBJ=qs;exports.FlexBox=xt;exports.FlexElement=Hr;exports.FlexTreeBuilder=_r;exports.HEX_COLOR_CHAR_CODE=Yr;exports.HEX_COLOR_PREFIX=Vr;exports.ICON_SIZE_ADJUSTMENT=te;exports.IconSpriteManager=Qr;exports.LEGACY_HOVER_CURSOR=An;exports.LIGHTEN_AMOUNT=to;exports.LayoutReconciler=Rr;exports.MAX_ICON_SIZE=Ki;exports.POINTER_CANDIDATE_KEYS=wn;exports.PositionResolver=St;exports.RELATIVE_COORD_TOLERANCE=he;exports.RootBridge=fa;exports.RootFlexBox=Yi;exports.SIZES=Er;exports.SIZE_CONFIG=it;exports.SizeAccumulator=qe;exports.TABLE_GLIDE_SIZES=Ks;exports.THEME=uu;exports.TableGlide=fu;exports.VIEW_COLORS=Ze;exports.buildButtonViewColors=Wr;exports.buildCanvasTree=Ue;exports.buildCellId=Zt;exports.calculateButtonWidth=oo;exports.calculateContentWidth=ro;exports.canvasCellRenderer=Qc;exports.clearButtonCaches=gl;exports.clearIconCache=ea;exports.createCanvasCell=Sn;exports.createCanvasCellRenderer=fo;exports.createEmptyCellGlide=qt;exports.createNormalCanvasInteraction=Or;exports.createRafUpdate=Co;exports.createSvgDataUrl=Pi;exports.createTextCellGlide=Xe;exports.defaultBatcher=hl;exports.defaultIconManager=Et;exports.dispatchCanvasPortalHover=fe;exports.drawButton=sn;exports.drawButtonWithView=ln;exports.drawEmbedIconButtonWithView=cn;exports.drawIcon=rn;exports.drawIcon$1=ut;exports.drawIconButton=co;exports.drawIconButtonWithView=an;exports.drawIconDirect=Fl;exports.flexBoxLayout=il;exports.fontStyles=Ne;exports.getCachedTextWidth=io;exports.getCellIndices=ke;exports.getDpr=Me;exports.getHoverState=Rn;exports.getIconCacheSize=ia;exports.getIconImageDirect=nn;exports.getIconSprite=en;exports.getIconSpriteStats=yl;exports.getRelativePointerPosition=En;exports.getRowHeightBySize=Re;exports.getTheme=yo;exports.handleCanvasRootClick=In;exports.handleCanvasRootHover=kn;exports.handleCellClick=Ln;exports.handleClickHandlers=Hn;exports.hashString=Jr;exports.isAbsoluteCoords=Tn;exports.isCanvasCell=uo;exports.isCanvasContent=Vi;exports.isCanvasEl=ti;exports.isCanvasString=mo;exports.isGlideCellObj=Ba;exports.isGlideGridCellObj=Yn;exports.isHoveringBounds=Rt;exports.isObject=Pa;exports.isPointInArea=lo;exports.isPortalHoverLocked=Wc;exports.isPrimitive=vo;exports.isReactIcon=wt;exports.isRelativeCoords=Dn;exports.isValueEmpty=qn;exports.lightenColor=eo;exports.lightenColorCached=qr;exports.lockPortalHover=Nc;exports.normalizeCanvasInteraction=zr;exports.normalizeDimensionValue=$i;exports.normalizeHoverPoint=jr;exports.normalizeIcon=mt;exports.onAnyIconLoad=tn;exports.performCanvasClick=ho;exports.performCanvasPointerDownIntent=On;exports.preloadIconSprites=on;exports.queryGlideElements=is;exports.reactIconToSvg=Nn;exports.rectContainsCell=po;exports.registerIconDefinitions=pl;exports.resetIconSpriteCache=bl;exports.resolveButtonColors=no;exports.resolveClickPoint=Hi;exports.resolveDangerColors=Zr;exports.resolvePaddingBox=Lr;exports.resolvePaddingBox$1=Mr;exports.resolvePrimaryColors=Ii;exports.resolveSecondaryColors=Kr;exports.resolveViewColors=so;exports.retrieveRenderData=jt;exports.storeRenderData=Bn;exports.subscribeToCanvasPortalHover=Kc;exports.subscribeToPortalHoverLock=Gc;exports.toRelativePoint=Li;exports.updateGridCells=go;exports.updateHoverState=_n;exports.updateHoverStateIfNeeded=Mn;exports.useBaseHighlightRegions=Kn;exports.useCanvasRegistry=La;exports.useColumnRowHighlightRegions=Zn;exports.useFontLoadRedraw=Xn;exports.useIconLoadRedraw=Vn;exports.useNativeGridSelection=jn;exports.useSelectionGeometry=Jn;exports.useTableSelectionSystem=Qn;exports.waitForCanvasFonts=$n;exports.waitForDocumentFonts=Gn;exports.waitForFonts=Un;
|