@carto/ps-react-ui 4.19.0 → 4.20.1
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/dist/actions-DKX98LlI.js +1318 -0
- package/dist/actions-DKX98LlI.js.map +1 -0
- package/dist/actions-Dy9JVr7F.js +1004 -0
- package/dist/actions-Dy9JVr7F.js.map +1 -0
- package/dist/category-DHZscHaS.js +826 -0
- package/dist/category-DHZscHaS.js.map +1 -0
- package/dist/chart-config-BGt7wkK7.js +108 -0
- package/dist/chart-config-BGt7wkK7.js.map +1 -0
- package/dist/chat.js +1589 -1711
- package/dist/chat.js.map +1 -1
- package/dist/cjs-CBrZjPCj.js +75 -0
- package/dist/cjs-CBrZjPCj.js.map +1 -0
- package/dist/components-DDt4mOQn.js +2403 -0
- package/dist/components-DDt4mOQn.js.map +1 -0
- package/dist/components.js +5 -1841
- package/dist/copy-button-DaQqWVu0.js +25 -0
- package/dist/copy-button-DaQqWVu0.js.map +1 -0
- package/dist/csv-modifiers-D6HGC24b.js +26 -0
- package/dist/csv-modifiers-D6HGC24b.js.map +1 -0
- package/dist/download-BT6qBamM.js +232 -0
- package/dist/download-BT6qBamM.js.map +1 -0
- package/dist/echart-BkaV3V5G.js +133 -0
- package/dist/echart-BkaV3V5G.js.map +1 -0
- package/dist/echart-DSz2Tu0z.js +250 -0
- package/dist/echart-DSz2Tu0z.js.map +1 -0
- package/dist/formatter-wVO81tYk.js +6 -0
- package/dist/formatter-wVO81tYk.js.map +1 -0
- package/dist/formula-Bk9CBzm2.js +190 -0
- package/dist/formula-Bk9CBzm2.js.map +1 -0
- package/dist/formula-Dsru_p-g.js +285 -0
- package/dist/formula-Dsru_p-g.js.map +1 -0
- package/dist/hooks-zf5gKZYq.js +22 -0
- package/dist/hooks-zf5gKZYq.js.map +1 -0
- package/dist/legend/stores.js +2 -24
- package/dist/legend.js +2274 -2323
- package/dist/legend.js.map +1 -1
- package/dist/markdown-DnSJMPjQ.js +165 -0
- package/dist/markdown-DnSJMPjQ.js.map +1 -0
- package/dist/markdown-content-BzKoX3eu.js +8764 -0
- package/dist/markdown-content-BzKoX3eu.js.map +1 -0
- package/dist/range-BPWVrAsY.js +277 -0
- package/dist/range-BPWVrAsY.js.map +1 -0
- package/dist/rolldown-runtime-B0aSnxlc.js +20 -0
- package/dist/row-CvVGBuy_.js +35 -0
- package/dist/row-CvVGBuy_.js.map +1 -0
- package/dist/shared-resize-observer-BEiP2rQt.js +157 -0
- package/dist/shared-resize-observer-BEiP2rQt.js.map +1 -0
- package/dist/smart-tooltip-CwGHCqab.js +34 -0
- package/dist/smart-tooltip-CwGHCqab.js.map +1 -0
- package/dist/spread-Dy8pshpN.js +149 -0
- package/dist/spread-Dy8pshpN.js.map +1 -0
- package/dist/stores-B81-IU1G.js +374 -0
- package/dist/stores-B81-IU1G.js.map +1 -0
- package/dist/stores-BVFMfgyo.js +248 -0
- package/dist/stores-BVFMfgyo.js.map +1 -0
- package/dist/styles-Y-qGBELO.js +13 -0
- package/dist/styles-Y-qGBELO.js.map +1 -0
- package/dist/table-BfTG6rrs.js +439 -0
- package/dist/table-BfTG6rrs.js.map +1 -0
- package/dist/tooltip-DJUGNZxY.js +23 -0
- package/dist/tooltip-DJUGNZxY.js.map +1 -0
- package/dist/types/chat/bubbles/chat-agent-message-markdown.d.ts +1 -1
- package/dist/types/chat/bubbles/chat-error-message.d.ts +1 -1
- package/dist/types/chat/bubbles/chat-suggestion-button.d.ts +1 -1
- package/dist/types/chat/bubbles/chat-user-message.d.ts +1 -1
- package/dist/types/chat/containers/chat-footer.d.ts +1 -1
- package/dist/types/chat/containers/chat-header.d.ts +1 -1
- package/dist/types/chat/containers/chat-starter.d.ts +1 -1
- package/dist/types/chat/feedback/chat-loader.d.ts +1 -1
- package/dist/types/chat/feedback/chat-rating-action.d.ts +1 -1
- package/dist/types/chat/feedback/chat-thinking.d.ts +1 -1
- package/dist/types/chat/feedback/chat-tool-code-area.d.ts +1 -1
- package/dist/types/chat/feedback/chat-tool-full-view-dialog.d.ts +1 -1
- package/dist/types/chat/feedback/chat-tool-group.d.ts +1 -1
- package/dist/types/chat/feedback/chat-tool-trace.d.ts +2 -2
- package/dist/types/components/basemaps/group-wrapper.d.ts +1 -1
- package/dist/types/components/basemaps/group.d.ts +1 -1
- package/dist/types/components/basemaps/header.d.ts +1 -1
- package/dist/types/components/copy-button/copy-button.d.ts +1 -1
- package/dist/types/components/lasso-tool/chip.d.ts +1 -1
- package/dist/types/components/lasso-tool/icons.d.ts +7 -7
- package/dist/types/components/lasso-tool/lasso-tool.d.ts +4 -4
- package/dist/types/components/lasso-tool/message.d.ts +1 -1
- package/dist/types/components/list-data/list-data-skeleton.d.ts +1 -1
- package/dist/types/components/measurement-tools/icons.d.ts +3 -3
- package/dist/types/components/no-data-alert/no-data-alert.d.ts +1 -1
- package/dist/types/components/responsive-drawer/responsive-drawer.d.ts +1 -1
- package/dist/types/components/smart-tooltip/smart-tooltip.d.ts +1 -1
- package/dist/types/components/tooltip/tooltip.d.ts +1 -1
- package/dist/types/hooks/use-widget-ref.d.ts +2 -1
- package/dist/types/legend/components/legend-actions/legend-actions.d.ts +1 -1
- package/dist/types/legend/components/legend-category/legend-category-ui.d.ts +1 -1
- package/dist/types/legend/components/legend-config-select/legend-config-select.d.ts +1 -1
- package/dist/types/legend/components/legend-group/legend-group.d.ts +1 -1
- package/dist/types/legend/components/legend-group-menu/legend-group-menu-items.d.ts +4 -4
- package/dist/types/legend/components/legend-group-menu/legend-group-menu.d.ts +1 -1
- package/dist/types/legend/components/legend-icon/legend-icon-ui.d.ts +1 -1
- package/dist/types/legend/components/legend-item/legend-item-ui.d.ts +1 -1
- package/dist/types/legend/components/legend-item/legend-item.d.ts +1 -1
- package/dist/types/legend/components/legend-opacity/legend-opacity.d.ts +2 -2
- package/dist/types/legend/components/legend-overflow-menu/legend-overflow-menu.d.ts +1 -1
- package/dist/types/legend/components/legend-panel-menu/legend-panel-menu.d.ts +1 -1
- package/dist/types/legend/components/legend-proportion/legend-proportion-ui.d.ts +1 -1
- package/dist/types/legend/components/legend-ramp/legend-ramp-ui.d.ts +1 -1
- package/dist/types/legend/components/legend-row/legend-row.d.ts +1 -1
- package/dist/types/legend/components/legend-row-menu/legend-row-menu-items.d.ts +2 -2
- package/dist/types/legend/components/legend-row-menu/legend-row-menu.d.ts +1 -1
- package/dist/types/legend/components/legend-row-menu/legend-zoom-to.d.ts +1 -1
- package/dist/types/legend/components/legend-sortable/legend-sortable.d.ts +1 -1
- package/dist/types/legend/components/legend-swatch/legend-swatch.d.ts +1 -1
- package/dist/types/legend/components/legend-visibility-toggle/legend-visibility-toggle.d.ts +1 -1
- package/dist/types/legend/components/legend-visible-layers/legend-visible-layers.d.ts +1 -1
- package/dist/types/legend/index.d.ts +2 -2
- package/dist/types/legend/provider/legend-provider.d.ts +1 -1
- package/dist/types/widgets/actions/brush-toggle/brush-toggle.d.ts +1 -1
- package/dist/types/widgets/actions/change-column/change-column-icon.d.ts +1 -1
- package/dist/types/widgets/actions/change-column/change-column.d.ts +1 -1
- package/dist/types/widgets/actions/change-column/sortable-column-item.d.ts +1 -1
- package/dist/types/widgets/actions/download/download.d.ts +1 -1
- package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +1 -1
- package/dist/types/widgets/actions/lock-selection/lock-selection.d.ts +1 -1
- package/dist/types/widgets/actions/relative-data/relative-data.d.ts +1 -1
- package/dist/types/widgets/actions/searcher/searcher-toggle.d.ts +1 -1
- package/dist/types/widgets/actions/searcher/searcher.d.ts +1 -1
- package/dist/types/widgets/actions/stack-toggle/grouped-bar-chart-icon.d.ts +1 -1
- package/dist/types/widgets/actions/stack-toggle/stack-toggle.d.ts +1 -1
- package/dist/types/widgets/actions/zoom-toggle/zoom-toggle.d.ts +1 -1
- package/dist/types/widgets/bar/skeleton.d.ts +1 -1
- package/dist/types/widgets/category/category-ui.d.ts +1 -1
- package/dist/types/widgets/category/components/category-bar.d.ts +1 -1
- package/dist/types/widgets/category/components/category-legend.d.ts +1 -1
- package/dist/types/widgets/category/components/category-row-multi.d.ts +1 -1
- package/dist/types/widgets/category/components/category-row-other.d.ts +1 -1
- package/dist/types/widgets/category/components/category-row-single.d.ts +1 -1
- package/dist/types/widgets/category/skeleton.d.ts +1 -1
- package/dist/types/widgets/echart/echart-ui.d.ts +1 -1
- package/dist/types/widgets/echart/echart.d.ts +1 -1
- package/dist/types/widgets/error/error.d.ts +1 -1
- package/dist/types/widgets/formula/components/item.d.ts +1 -1
- package/dist/types/widgets/formula/components/prefix.d.ts +1 -1
- package/dist/types/widgets/formula/components/row.d.ts +1 -1
- package/dist/types/widgets/formula/components/series.d.ts +1 -1
- package/dist/types/widgets/formula/components/suffix.d.ts +1 -1
- package/dist/types/widgets/formula/components/value.d.ts +1 -1
- package/dist/types/widgets/formula/formula-ui.d.ts +1 -1
- package/dist/types/widgets/formula/skeleton.d.ts +1 -1
- package/dist/types/widgets/histogram/skeleton.d.ts +1 -1
- package/dist/types/widgets/markdown/markdown-ui.d.ts +1 -1
- package/dist/types/widgets/markdown/markdown.d.ts +1 -1
- package/dist/types/widgets/markdown/skeleton.d.ts +1 -1
- package/dist/types/widgets/no-data/no-data.d.ts +1 -1
- package/dist/types/widgets/note/note.d.ts +1 -1
- package/dist/types/widgets/pie/skeleton.d.ts +1 -1
- package/dist/types/widgets/range/components/range-item.d.ts +1 -1
- package/dist/types/widgets/range/range-ui.d.ts +1 -1
- package/dist/types/widgets/range/skeleton.d.ts +1 -1
- package/dist/types/widgets/scatterplot/skeleton.d.ts +1 -1
- package/dist/types/widgets/selection-summary/selection-summary.d.ts +1 -1
- package/dist/types/widgets/skeleton-loader/skeleton-loader.d.ts +1 -1
- package/dist/types/widgets/spread/components/max-value.d.ts +1 -1
- package/dist/types/widgets/spread/components/min-value.d.ts +1 -1
- package/dist/types/widgets/spread/components/separator.d.ts +1 -1
- package/dist/types/widgets/spread/skeleton.d.ts +1 -1
- package/dist/types/widgets/spread/spread-ui.d.ts +1 -1
- package/dist/types/widgets/subheader/subheader.d.ts +1 -1
- package/dist/types/widgets/table/components/cell-header.d.ts +1 -1
- package/dist/types/widgets/table/components/cell.d.ts +1 -1
- package/dist/types/widgets/table/components/pagination-actions.d.ts +1 -1
- package/dist/types/widgets/table/components/pagination.d.ts +1 -1
- package/dist/types/widgets/table/components/row.d.ts +1 -1
- package/dist/types/widgets/table/skeleton.d.ts +1 -1
- package/dist/types/widgets/table/table-ui.d.ts +2 -2
- package/dist/types/widgets/timeseries/skeleton.d.ts +1 -1
- package/dist/types/widgets/wrapper/components/actions.d.ts +1 -1
- package/dist/types/widgets/wrapper/components/options.d.ts +1 -1
- package/dist/types/widgets/wrapper/components/title.d.ts +1 -1
- package/dist/types/widgets/wrapper/wrapper-ui.d.ts +1 -1
- package/dist/types/widgets/wrapper/wrapper.d.ts +1 -1
- package/dist/types/widgets-v2/actions/brush-toggle/brush-toggle.d.ts +1 -1
- package/dist/types/widgets-v2/actions/change-column/change-column-icon.d.ts +1 -1
- package/dist/types/widgets-v2/actions/change-column/change-column.d.ts +1 -1
- package/dist/types/widgets-v2/actions/change-column/sortable-column-item.d.ts +1 -1
- package/dist/types/widgets-v2/actions/download/download.d.ts +1 -1
- package/dist/types/widgets-v2/actions/download/icons.d.ts +3 -3
- package/dist/types/widgets-v2/actions/fullscreen/fullscreen.d.ts +2 -2
- package/dist/types/widgets-v2/actions/lock-selection/lock-selection.d.ts +1 -1
- package/dist/types/widgets-v2/actions/relative-data/relative-data.d.ts +1 -1
- package/dist/types/widgets-v2/actions/searcher/searcher-toggle.d.ts +1 -1
- package/dist/types/widgets-v2/actions/searcher/searcher.d.ts +1 -1
- package/dist/types/widgets-v2/actions/show-all/show-all.d.ts +1 -1
- package/dist/types/widgets-v2/actions/stack-toggle/stack-toggle.d.ts +1 -1
- package/dist/types/widgets-v2/actions/zoom-toggle/zoom-toggle.d.ts +1 -1
- package/dist/types/widgets-v2/bar/skeleton.d.ts +1 -1
- package/dist/types/widgets-v2/category/category-ui.d.ts +1 -1
- package/dist/types/widgets-v2/category/category.d.ts +1 -1
- package/dist/types/widgets-v2/category/components/category-bar-stacked.d.ts +1 -1
- package/dist/types/widgets-v2/category/components/category-bar.d.ts +1 -1
- package/dist/types/widgets-v2/category/components/category-legend.d.ts +1 -1
- package/dist/types/widgets-v2/category/components/category-row-multi.d.ts +1 -1
- package/dist/types/widgets-v2/category/components/category-row-other.d.ts +1 -1
- package/dist/types/widgets-v2/category/components/category-row-single.d.ts +1 -1
- package/dist/types/widgets-v2/category/components/category-row-stacked.d.ts +1 -1
- package/dist/types/widgets-v2/category/skeleton.d.ts +1 -1
- package/dist/types/widgets-v2/echart/echart-ui.d.ts +1 -1
- package/dist/types/widgets-v2/echart/echart.d.ts +1 -1
- package/dist/types/widgets-v2/formula/delta.d.ts +1 -1
- package/dist/types/widgets-v2/formula/formula-ui.d.ts +1 -1
- package/dist/types/widgets-v2/formula/formula.d.ts +1 -1
- package/dist/types/widgets-v2/formula/note.d.ts +1 -1
- package/dist/types/widgets-v2/formula/prefix.d.ts +1 -1
- package/dist/types/widgets-v2/formula/series.d.ts +1 -1
- package/dist/types/widgets-v2/formula/skeleton.d.ts +1 -1
- package/dist/types/widgets-v2/formula/suffix.d.ts +1 -1
- package/dist/types/widgets-v2/formula/value.d.ts +1 -1
- package/dist/types/widgets-v2/histogram/skeleton.d.ts +1 -1
- package/dist/types/widgets-v2/index.d.ts +5 -5
- package/dist/types/widgets-v2/markdown/markdown-content.d.ts +1 -1
- package/dist/types/widgets-v2/markdown/markdown-ui.d.ts +1 -1
- package/dist/types/widgets-v2/markdown/markdown.d.ts +1 -1
- package/dist/types/widgets-v2/markdown/skeleton.d.ts +1 -1
- package/dist/types/widgets-v2/note/widget-note.d.ts +2 -2
- package/dist/types/widgets-v2/pie/skeleton.d.ts +1 -1
- package/dist/types/widgets-v2/provider/widget-provider.d.ts +1 -1
- package/dist/types/widgets-v2/range/range-ui.d.ts +1 -1
- package/dist/types/widgets-v2/range/range.d.ts +1 -1
- package/dist/types/widgets-v2/range/skeleton.d.ts +1 -1
- package/dist/types/widgets-v2/scatterplot/skeleton.d.ts +1 -1
- package/dist/types/widgets-v2/selection-summary/selection-summary.d.ts +1 -1
- package/dist/types/widgets-v2/spread/band.d.ts +37 -0
- package/dist/types/widgets-v2/spread/band.test.d.ts +1 -0
- package/dist/types/widgets-v2/spread/index.d.ts +1 -0
- package/dist/types/widgets-v2/spread/separator.d.ts +1 -1
- package/dist/types/widgets-v2/spread/skeleton.d.ts +1 -1
- package/dist/types/widgets-v2/spread/spread-ui.d.ts +1 -1
- package/dist/types/widgets-v2/spread/spread.d.ts +1 -1
- package/dist/types/widgets-v2/state/widget-state.d.ts +1 -1
- package/dist/types/widgets-v2/subheader/subheader.d.ts +1 -1
- package/dist/types/widgets-v2/table/skeleton.d.ts +1 -1
- package/dist/types/widgets-v2/table/table-ui.d.ts +1 -1
- package/dist/types/widgets-v2/table/table.d.ts +1 -1
- package/dist/types/widgets-v2/timeseries/skeleton.d.ts +1 -1
- package/dist/types/widgets-v2/toolbox/toolbox.d.ts +1 -1
- package/dist/types/widgets-v2/wrapper/widget-actions.d.ts +2 -2
- package/dist/types/widgets-v2/wrapper/widget-content.d.ts +2 -2
- package/dist/types/widgets-v2/wrapper/widget-wrapper.d.ts +1 -1
- package/dist/use-widget-selector-VSPhfhNm.js +12 -0
- package/dist/{use-widget-selector-DFl2hW0R.js.map → use-widget-selector-VSPhfhNm.js.map} +1 -1
- package/dist/utils-DtvTjjMq.js +58 -0
- package/dist/utils-DtvTjjMq.js.map +1 -0
- package/dist/widget-store-BFPKYm4R.js +187 -0
- package/dist/widget-store-BFPKYm4R.js.map +1 -0
- package/dist/widgets/actions.js +2 -1317
- package/dist/widgets/bar.js +183 -175
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/category.js +429 -434
- package/dist/widgets/category.js.map +1 -1
- package/dist/widgets/echart.js +3 -120
- package/dist/widgets/error.js +28 -38
- package/dist/widgets/error.js.map +1 -1
- package/dist/widgets/formula.js +3 -123
- package/dist/widgets/histogram.js +183 -202
- package/dist/widgets/histogram.js.map +1 -1
- package/dist/widgets/loader.js +63 -61
- package/dist/widgets/loader.js.map +1 -1
- package/dist/widgets/markdown.js +141 -123
- package/dist/widgets/markdown.js.map +1 -1
- package/dist/widgets/no-data.js +52 -58
- package/dist/widgets/no-data.js.map +1 -1
- package/dist/widgets/note.js +125 -122
- package/dist/widgets/note.js.map +1 -1
- package/dist/widgets/pie.js +245 -259
- package/dist/widgets/pie.js.map +1 -1
- package/dist/widgets/range.js +225 -204
- package/dist/widgets/range.js.map +1 -1
- package/dist/widgets/scatterplot.js +220 -215
- package/dist/widgets/scatterplot.js.map +1 -1
- package/dist/widgets/selection-summary.js +39 -38
- package/dist/widgets/selection-summary.js.map +1 -1
- package/dist/widgets/skeleton-loader.js +22 -23
- package/dist/widgets/skeleton-loader.js.map +1 -1
- package/dist/widgets/spread.js +150 -156
- package/dist/widgets/spread.js.map +1 -1
- package/dist/widgets/stores.js +3 -8
- package/dist/widgets/subheader.js +49 -50
- package/dist/widgets/subheader.js.map +1 -1
- package/dist/widgets/table.js +576 -644
- package/dist/widgets/table.js.map +1 -1
- package/dist/widgets/timeseries.js +175 -170
- package/dist/widgets/timeseries.js.map +1 -1
- package/dist/widgets/toolbar-actions.js +140 -145
- package/dist/widgets/toolbar-actions.js.map +1 -1
- package/dist/widgets/utils.js +17 -33
- package/dist/widgets/utils.js.map +1 -1
- package/dist/widgets/wrapper.js +265 -276
- package/dist/widgets/wrapper.js.map +1 -1
- package/dist/widgets-v2/actions.js +4 -51
- package/dist/widgets-v2/bar.js +253 -307
- package/dist/widgets-v2/bar.js.map +1 -1
- package/dist/widgets-v2/category.js +2 -98
- package/dist/widgets-v2/echart.js +2 -57
- package/dist/widgets-v2/formula.js +2 -68
- package/dist/widgets-v2/histogram.js +285 -350
- package/dist/widgets-v2/histogram.js.map +1 -1
- package/dist/widgets-v2/markdown.js +3 -69
- package/dist/widgets-v2/pie.js +363 -461
- package/dist/widgets-v2/pie.js.map +1 -1
- package/dist/widgets-v2/range.js +2 -52
- package/dist/widgets-v2/scatterplot.js +316 -391
- package/dist/widgets-v2/scatterplot.js.map +1 -1
- package/dist/widgets-v2/spread.js +2 -66
- package/dist/widgets-v2/stores.js +2 -42
- package/dist/widgets-v2/table.js +2 -78
- package/dist/widgets-v2/timeseries.js +285 -340
- package/dist/widgets-v2/timeseries.js.map +1 -1
- package/dist/widgets-v2/utils.js +2 -8
- package/dist/widgets-v2.js +955 -951
- package/dist/widgets-v2.js.map +1 -1
- package/dist/zoom-toggle-CA0ifG23.js +164 -0
- package/dist/zoom-toggle-CA0ifG23.js.map +1 -0
- package/package.json +4 -4
- package/src/hooks/use-widget-ref.ts +1 -0
- package/src/widgets-v2/index.ts +6 -1
- package/src/widgets-v2/spread/band.test.ts +46 -0
- package/src/widgets-v2/spread/band.ts +47 -0
- package/src/widgets-v2/spread/index.ts +1 -0
- package/dist/category-Ct2BzADB.js +0 -753
- package/dist/category-Ct2BzADB.js.map +0 -1
- package/dist/change-column-Fu1DCYQ3.js +0 -1186
- package/dist/change-column-Fu1DCYQ3.js.map +0 -1
- package/dist/cjs-D4KH3azB.js +0 -85
- package/dist/cjs-D4KH3azB.js.map +0 -1
- package/dist/components.js.map +0 -1
- package/dist/copy-button-DGL1tyli.js +0 -26
- package/dist/copy-button-DGL1tyli.js.map +0 -1
- package/dist/csv-item-hH_Gt7ur.js +0 -32
- package/dist/csv-item-hH_Gt7ur.js.map +0 -1
- package/dist/data-zoom-layout-D_FYdnap.js +0 -28
- package/dist/data-zoom-layout-D_FYdnap.js.map +0 -1
- package/dist/download-config-OKlLLSW_.js +0 -58
- package/dist/download-config-OKlLLSW_.js.map +0 -1
- package/dist/echart-B10dhEaM.js +0 -262
- package/dist/echart-B10dhEaM.js.map +0 -1
- package/dist/exports-Cr43OCul.js +0 -51
- package/dist/exports-Cr43OCul.js.map +0 -1
- package/dist/exports-Cx-f6m6U.js +0 -63
- package/dist/exports-Cx-f6m6U.js.map +0 -1
- package/dist/formatter-B9Bxn1k7.js +0 -6
- package/dist/formatter-B9Bxn1k7.js.map +0 -1
- package/dist/formula-DuC0NQLH.js +0 -79
- package/dist/formula-DuC0NQLH.js.map +0 -1
- package/dist/lasso-tool-YLFRgb-S.js +0 -582
- package/dist/lasso-tool-YLFRgb-S.js.map +0 -1
- package/dist/legend/stores.js.map +0 -1
- package/dist/legend-store-registry-p1tSwJXH.js +0 -472
- package/dist/legend-store-registry-p1tSwJXH.js.map +0 -1
- package/dist/markdown-DdqANCiN.js +0 -102
- package/dist/markdown-DdqANCiN.js.map +0 -1
- package/dist/markdown-content-Dk2DSgbf.js +0 -10287
- package/dist/markdown-content-Dk2DSgbf.js.map +0 -1
- package/dist/option-builders-DPeoyQaM.js +0 -130
- package/dist/option-builders-DPeoyQaM.js.map +0 -1
- package/dist/options-CthfUJDz.js +0 -46
- package/dist/options-CthfUJDz.js.map +0 -1
- package/dist/png-item-9dNbB37T.js +0 -57
- package/dist/png-item-9dNbB37T.js.map +0 -1
- package/dist/range-l4fNHLEg.js +0 -213
- package/dist/range-l4fNHLEg.js.map +0 -1
- package/dist/resolve-theme-color-BdojIw0K.js +0 -47
- package/dist/resolve-theme-color-BdojIw0K.js.map +0 -1
- package/dist/row-DZSP99LW.js +0 -34
- package/dist/row-DZSP99LW.js.map +0 -1
- package/dist/series-DLNHDWs0.js +0 -90
- package/dist/series-DLNHDWs0.js.map +0 -1
- package/dist/shared-resize-observer-98b1SK1e.js +0 -17
- package/dist/shared-resize-observer-98b1SK1e.js.map +0 -1
- package/dist/smart-tooltip-DFV6GD8R.js +0 -40
- package/dist/smart-tooltip-DFV6GD8R.js.map +0 -1
- package/dist/spread-4MYPOntd.js +0 -66
- package/dist/spread-4MYPOntd.js.map +0 -1
- package/dist/style-DVnT6HC1.js +0 -131
- package/dist/style-DVnT6HC1.js.map +0 -1
- package/dist/styles-cohnxh9F.js +0 -23
- package/dist/styles-cohnxh9F.js.map +0 -1
- package/dist/table-CTcLOycx.js +0 -383
- package/dist/table-CTcLOycx.js.map +0 -1
- package/dist/tooltip-BDnrRKrp.js +0 -25
- package/dist/tooltip-BDnrRKrp.js.map +0 -1
- package/dist/transforms-Cdx4fkU5.js +0 -106
- package/dist/transforms-Cdx4fkU5.js.map +0 -1
- package/dist/use-transform-DXPN3nY7.js +0 -110
- package/dist/use-transform-DXPN3nY7.js.map +0 -1
- package/dist/use-widget-ref-Ddr_SlJJ.js +0 -22
- package/dist/use-widget-ref-Ddr_SlJJ.js.map +0 -1
- package/dist/use-widget-selector-DFl2hW0R.js +0 -12
- package/dist/utils-BOhInag6.js +0 -170
- package/dist/utils-BOhInag6.js.map +0 -1
- package/dist/widget-context-DTGO0Yta.js +0 -13
- package/dist/widget-context-DTGO0Yta.js.map +0 -1
- package/dist/widget-store-Bw5zRUGg.js +0 -261
- package/dist/widget-store-Bw5zRUGg.js.map +0 -1
- package/dist/widget-store-registry-_W4Z4xp-.js +0 -178
- package/dist/widget-store-registry-_W4Z4xp-.js.map +0 -1
- package/dist/widgets/actions.js.map +0 -1
- package/dist/widgets/echart.js.map +0 -1
- package/dist/widgets/formula.js.map +0 -1
- package/dist/widgets/stores.js.map +0 -1
- package/dist/widgets-v2/actions.js.map +0 -1
- package/dist/widgets-v2/category.js.map +0 -1
- package/dist/widgets-v2/echart.js.map +0 -1
- package/dist/widgets-v2/formula.js.map +0 -1
- package/dist/widgets-v2/markdown.js.map +0 -1
- package/dist/widgets-v2/range.js.map +0 -1
- package/dist/widgets-v2/spread.js.map +0 -1
- package/dist/widgets-v2/stores.js.map +0 -1
- package/dist/widgets-v2/table.js.map +0 -1
- package/dist/widgets-v2/utils.js.map +0 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { C as e, T as t } from "./stores-BVFMfgyo.js";
|
|
2
|
+
import { n, t as r } from "./download-BT6qBamM.js";
|
|
3
|
+
import { a as i, c as a, l as o, o as s, s as c, u as l } from "./formula-Dsru_p-g.js";
|
|
4
|
+
import { c as u } from "react/compiler-runtime";
|
|
5
|
+
import { Box as d, Skeleton as f } from "@mui/material";
|
|
6
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
7
|
+
//#region src/widgets-v2/spread/separator.tsx
|
|
8
|
+
function h() {
|
|
9
|
+
let e = u(1), t;
|
|
10
|
+
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ p(s, {
|
|
11
|
+
color: "inherit",
|
|
12
|
+
children: "-"
|
|
13
|
+
}), e[0] = t) : t = e[0], t;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/widgets-v2/spread/spread-ui.tsx
|
|
17
|
+
function g(e) {
|
|
18
|
+
let t = u(8), { items: n, formatter: r, ref: f } = e, g = r ?? _, v;
|
|
19
|
+
if (t[0] !== g || t[1] !== n) {
|
|
20
|
+
let e;
|
|
21
|
+
t[3] === g ? e = t[4] : (e = (e, t) => /* @__PURE__ */ m(d, {
|
|
22
|
+
sx: i.row,
|
|
23
|
+
children: [e.series ? /* @__PURE__ */ p(a, {
|
|
24
|
+
name: e.series.name,
|
|
25
|
+
color: e.series.color
|
|
26
|
+
}) : null, /* @__PURE__ */ m(d, {
|
|
27
|
+
sx: i.body,
|
|
28
|
+
children: [/* @__PURE__ */ m(d, {
|
|
29
|
+
sx: i.valueRow,
|
|
30
|
+
children: [
|
|
31
|
+
e.prefix ? /* @__PURE__ */ p(o, { children: e.prefix }) : null,
|
|
32
|
+
/* @__PURE__ */ p(s, {
|
|
33
|
+
color: e.color,
|
|
34
|
+
children: g(e.min)
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ p(h, {}),
|
|
37
|
+
/* @__PURE__ */ p(s, {
|
|
38
|
+
color: e.color,
|
|
39
|
+
children: g(e.max)
|
|
40
|
+
}),
|
|
41
|
+
e.suffix ? /* @__PURE__ */ p(c, { children: e.suffix }) : null
|
|
42
|
+
]
|
|
43
|
+
}), e.note ? /* @__PURE__ */ p(l, { children: e.note }) : null]
|
|
44
|
+
})]
|
|
45
|
+
}, `spread-${e.series?.name ?? ""}-${e.min}-${e.max}-${t}`), t[3] = g, t[4] = e), v = n.map(e), t[0] = g, t[1] = n, t[2] = v;
|
|
46
|
+
} else v = t[2];
|
|
47
|
+
let y;
|
|
48
|
+
return t[5] !== f || t[6] !== v ? (y = /* @__PURE__ */ p(d, {
|
|
49
|
+
ref: f,
|
|
50
|
+
sx: i.root,
|
|
51
|
+
children: v
|
|
52
|
+
}), t[5] = f, t[6] = v, t[7] = y) : y = t[7], y;
|
|
53
|
+
}
|
|
54
|
+
function _(e) {
|
|
55
|
+
return String(e);
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/widgets-v2/spread/spread.tsx
|
|
59
|
+
var v = Object.freeze([]), y = (e) => ({
|
|
60
|
+
data: e.data ?? v,
|
|
61
|
+
formatter: e.formatter
|
|
62
|
+
});
|
|
63
|
+
function b() {
|
|
64
|
+
let n = u(3), r = t(), i = e(r, y), a;
|
|
65
|
+
return n[0] !== i.data || n[1] !== i.formatter ? (a = /* @__PURE__ */ p(g, {
|
|
66
|
+
items: i.data,
|
|
67
|
+
formatter: i.formatter
|
|
68
|
+
}), n[0] = i.data, n[1] = i.formatter, n[2] = a) : a = n[2], a;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/widgets-v2/spread/skeleton.tsx
|
|
72
|
+
var x = {
|
|
73
|
+
root: {
|
|
74
|
+
display: "flex",
|
|
75
|
+
flexDirection: "column",
|
|
76
|
+
gap: 2,
|
|
77
|
+
py: 1
|
|
78
|
+
},
|
|
79
|
+
row: {
|
|
80
|
+
display: "flex",
|
|
81
|
+
alignItems: "center",
|
|
82
|
+
gap: 1.5
|
|
83
|
+
},
|
|
84
|
+
block: {
|
|
85
|
+
width: 200,
|
|
86
|
+
height: 32
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
function S(e) {
|
|
90
|
+
let t = u(2), { count: n } = e, r = n === void 0 ? 1 : n, i;
|
|
91
|
+
return t[0] === r ? i = t[1] : (i = /* @__PURE__ */ p(d, {
|
|
92
|
+
sx: x.root,
|
|
93
|
+
children: Array.from({ length: r }).map(C)
|
|
94
|
+
}), t[0] = r, t[1] = i), i;
|
|
95
|
+
}
|
|
96
|
+
function C(e, t) {
|
|
97
|
+
return /* @__PURE__ */ p(d, {
|
|
98
|
+
sx: x.row,
|
|
99
|
+
children: /* @__PURE__ */ p(f, {
|
|
100
|
+
variant: "rectangular",
|
|
101
|
+
sx: x.block
|
|
102
|
+
})
|
|
103
|
+
}, `row-${t}`);
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/widgets-v2/spread/download.ts
|
|
107
|
+
function w(e) {
|
|
108
|
+
let t = [];
|
|
109
|
+
return e.getCaptureEl && t.push(n({
|
|
110
|
+
filename: e.filename,
|
|
111
|
+
getCaptureEl: e.getCaptureEl,
|
|
112
|
+
pixelRatio: e.pngPixelRatio,
|
|
113
|
+
backgroundColor: e.pngBackgroundColor
|
|
114
|
+
})), t.push(r({
|
|
115
|
+
filename: e.filename,
|
|
116
|
+
getRows: () => {
|
|
117
|
+
let t = e.getData(), n = [[
|
|
118
|
+
"series",
|
|
119
|
+
"prefix",
|
|
120
|
+
"min",
|
|
121
|
+
"max",
|
|
122
|
+
"suffix",
|
|
123
|
+
"note"
|
|
124
|
+
]];
|
|
125
|
+
for (let e of t) n.push([
|
|
126
|
+
e.series?.name ?? "",
|
|
127
|
+
e.prefix ?? "",
|
|
128
|
+
e.min,
|
|
129
|
+
e.max,
|
|
130
|
+
e.suffix ?? "",
|
|
131
|
+
e.note ?? ""
|
|
132
|
+
]);
|
|
133
|
+
return n;
|
|
134
|
+
}
|
|
135
|
+
})), t;
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/widgets-v2/spread/band.ts
|
|
139
|
+
function T({ value: e, spread: t, variant: n = "percentage" }) {
|
|
140
|
+
let r = n === "absolute" ? t : t / 100 * e, i = Math.abs(r);
|
|
141
|
+
return {
|
|
142
|
+
min: e - i,
|
|
143
|
+
max: e + i
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
//#endregion
|
|
147
|
+
export { g as a, b as i, w as n, h as o, S as r, T as t };
|
|
148
|
+
|
|
149
|
+
//# sourceMappingURL=spread-Dy8pshpN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spread-Dy8pshpN.js","names":["Value","Separator","$","_c","t0","Symbol","for","Box","Ref","Note","Prefix","Series","Suffix","Value","styles","Separator","SpreadDataItem","SpreadUIProps","items","formatter","value","ref","HTMLDivElement","SpreadUI","t0","$","_c","fmt","_temp","t1","t2","item","i","series","name","min","max","row","color","body","valueRow","prefix","suffix","note","map","root","n","String","useWidgetId","useWidgetShallow","SpreadUI","SpreadWidgetData","SpreadSlice","data","formatter","value","EMPTY_DATA","Object","freeze","spreadSelector","s","Spread","$","_c","id","slice","t0","Box","Skeleton","SxProps","Theme","styles","root","display","flexDirection","gap","py","row","alignItems","block","width","height","Record","SpreadSkeletonProps","count","SpreadSkeleton","t0","$","_c","t1","undefined","t2","Array","from","length","map","_temp","_","i","buildCsvDownloadItem","buildPngDownloadItem","DownloadItem","SpreadWidgetData","createSpreadDownloadConfig","args","filename","getData","getCaptureEl","HTMLElement","pngPixelRatio","pngBackgroundColor","items","push","pixelRatio","backgroundColor","getRows","data","rows","item","series","name","prefix","min","max","suffix","note","SpreadVariant","GetSpreadBandOptions","value","spread","variant","getSpreadBand","min","max","offset","width","Math","abs"],"sources":["../src/widgets-v2/spread/separator.tsx","../src/widgets-v2/spread/spread-ui.tsx","../src/widgets-v2/spread/spread.tsx","../src/widgets-v2/spread/skeleton.tsx","../src/widgets-v2/spread/download.ts","../src/widgets-v2/spread/band.ts"],"sourcesContent":["import { Value } from '../formula'\n\n/**\n * Em-dash separator placed between a Spread row's `min` and `max` values.\n * Built from the Formula {@link Value} primitive so typography (h5/600,\n * baseline alignment) matches the numbers around it. Renders with\n * `text.secondary` so it visually recedes between the two bounds.\n */\nexport function Separator() {\n return <Value color='inherit'>-</Value>\n}\n","import { Box } from '@mui/material'\nimport type { Ref } from 'react'\nimport { Note, Prefix, Series, Suffix, Value } from '../formula'\nimport { styles } from '../formula/style'\nimport { Separator } from './separator'\nimport type { SpreadDataItem } from './types'\n\nexport interface SpreadUIProps {\n items: readonly SpreadDataItem[]\n /** Number formatter — applied to each item's `min` and `max`. */\n formatter?: (value: number) => string\n /** Forwarded to the root `<Box>` so consumers can capture the DOM (PNG export). */\n ref?: Ref<HTMLDivElement>\n}\n\n/**\n * Pure presentational component for the Spread widget. Each item renders as\n * a row containing (in order): optional `Series` avatar, a body with\n * `[prefix] min — max [suffix]` plus optional `Note`. Reuses the Formula\n * primitives ({@link Series}, {@link Prefix}, {@link Value}, {@link Suffix},\n * {@link Note}) and the Formula row styles so Spread and Formula stay\n * visually aligned when used together.\n */\nexport function SpreadUI({ items, formatter, ref }: SpreadUIProps) {\n const fmt = formatter ?? ((n: number) => String(n))\n return (\n <Box ref={ref} sx={styles.root}>\n {items.map((item, i) => (\n // Composite of series name + min/max bounds for stability across\n // reorders; falls back to the index when bounds happen to collide.\n <Box\n key={`spread-${item.series?.name ?? ''}-${item.min}-${item.max}-${i}`}\n sx={styles.row}\n >\n {item.series ? (\n <Series name={item.series.name} color={item.series.color} />\n ) : null}\n <Box sx={styles.body}>\n <Box sx={styles.valueRow}>\n {item.prefix ? <Prefix>{item.prefix}</Prefix> : null}\n <Value color={item.color}>{fmt(item.min)}</Value>\n <Separator />\n <Value color={item.color}>{fmt(item.max)}</Value>\n {item.suffix ? <Suffix>{item.suffix}</Suffix> : null}\n </Box>\n {item.note ? <Note>{item.note}</Note> : null}\n </Box>\n </Box>\n ))}\n </Box>\n )\n}\n","import { useWidgetId, useWidgetShallow } from '../stores'\nimport { SpreadUI } from './spread-ui'\nimport type { SpreadWidgetData } from './types'\n\ninterface SpreadSlice {\n data: SpreadWidgetData\n formatter?: (value: number) => string\n}\n\n// Stable empty-data sentinel — keeps the slice's `data` reference stable\n// when the underlying store value is null/undefined so the shallow-equality\n// gate in `useWidgetShallow` doesn't re-render every commit.\nconst EMPTY_DATA: SpreadWidgetData = Object.freeze([]) as SpreadWidgetData\n\nconst spreadSelector = (s: {\n data: unknown\n formatter?: (value: number) => string\n}): SpreadSlice => ({\n data: (s.data ?? EMPTY_DATA) as SpreadWidgetData,\n formatter: s.formatter,\n})\n\n/**\n * Stateful Spread bridge — reads `data` (post-pipeline) and `formatter` from\n * the per-widget store and forwards them to the pure {@link SpreadUI}.\n */\nexport function Spread() {\n const id = useWidgetId()\n const slice = useWidgetShallow(id, spreadSelector)\n return <SpreadUI items={slice.data} formatter={slice.formatter} />\n}\n","import { Box, Skeleton } from '@mui/material'\nimport type { SxProps, Theme } from '@mui/material'\n\nconst styles = {\n root: {\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n py: 1,\n },\n row: {\n display: 'flex',\n alignItems: 'center',\n gap: 1.5,\n },\n block: { width: 200, height: 32 },\n} satisfies Record<string, SxProps<Theme>>\n\nexport interface SpreadSkeletonProps {\n count?: number\n}\n\n/**\n * Loading placeholder for the Spread widget. Renders `count` rows, each\n * sized for the `min — max` pair so the layout doesn't jump once data\n * resolves. Mirrors the row-per-item structure of {@link SpreadUI}.\n */\nexport function SpreadSkeleton({ count = 1 }: SpreadSkeletonProps) {\n return (\n <Box sx={styles.root}>\n {Array.from({ length: count }).map((_, i) => (\n <Box key={`row-${i}`} sx={styles.row}>\n <Skeleton variant='rectangular' sx={styles.block} />\n </Box>\n ))}\n </Box>\n )\n}\n","import {\n buildCsvDownloadItem,\n buildPngDownloadItem,\n type DownloadItem,\n} from '../actions/download'\nimport type { SpreadWidgetData } from './types'\n\n/**\n * Download menu items for the Spread widget. Always includes a CSV item\n * with `series, prefix, min, max, suffix, note` columns (one row per\n * entry). When `getCaptureEl` is supplied, prepends a PNG item that\n * rasterises the captured element via `html2canvas`.\n */\nexport function createSpreadDownloadConfig(args: {\n filename: string\n getData: () => SpreadWidgetData\n getCaptureEl?: () => HTMLElement | null\n pngPixelRatio?: number\n pngBackgroundColor?: string | null\n}): DownloadItem[] {\n const items: DownloadItem[] = []\n if (args.getCaptureEl) {\n items.push(\n buildPngDownloadItem({\n filename: args.filename,\n getCaptureEl: args.getCaptureEl,\n pixelRatio: args.pngPixelRatio,\n backgroundColor: args.pngBackgroundColor,\n }),\n )\n }\n items.push(\n buildCsvDownloadItem({\n filename: args.filename,\n getRows: () => {\n const data = args.getData()\n const rows: unknown[][] = [\n ['series', 'prefix', 'min', 'max', 'suffix', 'note'],\n ]\n for (const item of data) {\n rows.push([\n item.series?.name ?? '',\n item.prefix ?? '',\n item.min,\n item.max,\n item.suffix ?? '',\n item.note ?? '',\n ])\n }\n return rows\n },\n }),\n )\n return items\n}\n","/**\n * How a `spread` amount is applied to a centre value.\n *\n * - `percentage` — `spread` is a whole-number percentage of the centre\n * value, so `5` means +/-5%.\n * - `absolute` — `spread` is a raw offset in the value's own units.\n */\nexport type SpreadVariant = 'percentage' | 'absolute'\n\nexport interface GetSpreadBandOptions {\n /** The centre value the band is drawn around. */\n value: number\n /** Half-width of the band, read according to `variant`. */\n spread: number\n /** Defaults to `percentage`. */\n variant?: SpreadVariant\n}\n\n/**\n * Derives the `min` / `max` band around a centre value, for feeding a\n * {@link SpreadDataItem} from a single aggregated number (a prediction, a\n * target) plus a tolerance — rather than from a real column range.\n *\n * `spread` is read as a percentage by default, which is what a tolerance\n * almost always is: an absolute offset is meaningless without knowing the\n * value's magnitude, and gets visually lost on large values (+/-5 on a\n * prediction of 204,113 renders as a range indistinguishable from a single\n * number).\n *\n * @example\n * getSpreadBand({ value: 1000, spread: 5 })\n * // -> { min: 950, max: 1050 }\n * getSpreadBand({ value: 1000, spread: 5, variant: 'absolute' })\n * // -> { min: 995, max: 1005 }\n */\nexport function getSpreadBand({\n value,\n spread,\n variant = 'percentage',\n}: GetSpreadBandOptions): { min: number; max: number } {\n const offset = variant === 'absolute' ? spread : (spread / 100) * value\n // Keep `min <= max`: a percentage of a negative centre value (or a negative\n // `spread`) yields a negative offset, which would invert the band.\n const width = Math.abs(offset)\n\n return { min: value - width, max: value + width }\n}\n"],"mappings":";;;;;;;AAQA,SAAOC,IAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GAAAC;CACkC,OADlCF,EAAA,OAAAG,OAAAC,IAAA,2BAAA,KACEF,IAAA,kBAAC,GAAD;EAAa,OAAA;EAAU,UAAA;CAAjB,CAAA,GAA0BF,EAAA,KAAAE,KAAAA,IAAAF,EAAA,IAAhCE;AAAgC;;;ACczC,SAAOmB,EAAAC,GAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GAAkB,EAAAR,UAAAC,cAAAE,WAAAG,GACvBG,IAAYR,KAAAS,GAAuCC;CAAA,IAAAJ,EAAA,OAAAE,KAAAF,EAAA,OAAAP,GAAA;EAAA,IAAAY;EAwB7CL,AAxB6CA,EAAA,OAAAE,IAwB9CG,IAAAL,EAAA,MArBUK,KAAAC,GAAAC,MAGT,kBAAC,GAAD;GAEM,IAAAlB,EAAMuB;GAFZ,UAAA,CAIGN,EAAIE,SACH,kBAAC,GAAD;IAAc,MAAAF,EAAIE,OAAOC;IAAc,OAAAH,EAAIE,OAAOK;GAAM,CAAA,IADzD,MAGD,kBAAC,GAAD;IAAS,IAAAxB,EAAMyB;IAAf,UAAA,CACE,kBAAC,GAAD;KAAS,IAAAzB,EAAM0B;KAAf,UAAA;MACGT,EAAIU,SAAU,kBAAC,GAAD,EAAA,UAASV,EAAIU,OAAN,CAAA,IAArB;MACD,kBAAC,GAAD;OAAc,OAAAV,EAAIO;OAASX,UAAAA,EAAII,EAAII,GAAI;MAAjC,CAAA;MACN,kBAAC,GAAD,CAAU,CAAA;MACV,kBAAC,GAAD;OAAc,OAAAJ,EAAIO;OAASX,UAAAA,EAAII,EAAIK,GAAI;MAAjC,CAAA;MACLL,EAAIW,SAA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QAAQC,QAAQ;IACrBF,EAAKG,UAAU;IACfH,EAAKI;IACLJ,EAAKK;IACLL,EAAKM,UAAU;IACfN,EAAKO,QAAQ;GAAE,CAChB;GAEH,OAAOR;EACT;CACF,CAAC,CACH,GACON;AACT;;;ACnBA,SAAgBoB,EAAc,EAC5BH,UACAC,WACAC,aAAU,gBAC2C;CACrD,IAAMI,IAASJ,MAAY,aAAaD,IAAUA,IAAS,MAAOD,GAG5DO,IAAQC,KAAKC,IAAIH,CAAM;CAE7B,OAAO;EAAEF,KAAKJ,IAAQO;EAAOF,KAAKL,IAAQO;CAAM;AAClD"}
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { c as e } from "react/compiler-runtime";
|
|
2
|
+
import { createContext as t, isValidElement as n, useContext as r } from "react";
|
|
3
|
+
import { useStore as i } from "zustand";
|
|
4
|
+
import { createStore as a } from "zustand/vanilla";
|
|
5
|
+
import { devtools as o } from "zustand/middleware";
|
|
6
|
+
import { useShallow as s } from "zustand/react/shallow";
|
|
7
|
+
//#region src/legend/stores/legend-context.ts
|
|
8
|
+
var c = t(null);
|
|
9
|
+
function l() {
|
|
10
|
+
let e = r(c);
|
|
11
|
+
if (e == null) throw Error("useLegendId() must be called inside <Legend.Provider>. If you are calling from outside the Provider tree, use the hooks (useLegendStore, useLegendShallow) directly with an explicit id.");
|
|
12
|
+
return e;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/legend/stores/selectors.ts
|
|
16
|
+
var u = (e, t) => e.order - t.order;
|
|
17
|
+
function d(e) {
|
|
18
|
+
return Object.values(e.groups).sort(u);
|
|
19
|
+
}
|
|
20
|
+
function f(e, t) {
|
|
21
|
+
return Object.values(e.layers).filter((e) => e.groupId === t).sort(u);
|
|
22
|
+
}
|
|
23
|
+
function p(e) {
|
|
24
|
+
return Object.values(e.layers).sort(u);
|
|
25
|
+
}
|
|
26
|
+
function m(e) {
|
|
27
|
+
let t = Object.values(e.groups);
|
|
28
|
+
return t.length > 0 && t.every((e) => e.collapsed);
|
|
29
|
+
}
|
|
30
|
+
function h(e) {
|
|
31
|
+
return Object.keys(e.groups).length > 0;
|
|
32
|
+
}
|
|
33
|
+
function g(e) {
|
|
34
|
+
let t = (t) => f(e, t).filter((e) => e.visible), n = [];
|
|
35
|
+
for (let r of d(e)) {
|
|
36
|
+
let e = t(r.id);
|
|
37
|
+
e.length > 0 && n.push({
|
|
38
|
+
group: r,
|
|
39
|
+
layers: e
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
let r = t(void 0);
|
|
43
|
+
return r.length > 0 && n.push({ layers: r }), n;
|
|
44
|
+
}
|
|
45
|
+
function _(e, t) {
|
|
46
|
+
let n = e.layers[t];
|
|
47
|
+
return n ? n.variables.length > 0 || (n.sections?.length ?? 0) > 0 || !!n.helperText : !1;
|
|
48
|
+
}
|
|
49
|
+
function v(e, t) {
|
|
50
|
+
let n = !1, r = !1;
|
|
51
|
+
for (let i of f(e, t)) i.visible ? n = !0 : r = !0;
|
|
52
|
+
return n && r ? "mixed" : r ? "hidden" : "visible";
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/legend/stores/legend-store-registry.ts
|
|
56
|
+
var y = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Set(), S = () => {
|
|
57
|
+
try {
|
|
58
|
+
return !1;
|
|
59
|
+
} catch {
|
|
60
|
+
return !1;
|
|
61
|
+
}
|
|
62
|
+
}, C = (e) => Math.min(1, Math.max(0, e));
|
|
63
|
+
function w(e, t) {
|
|
64
|
+
return e.visible === t ? null : t ? {
|
|
65
|
+
visible: t,
|
|
66
|
+
collapsed: e.collapsedBeforeHide ?? !1,
|
|
67
|
+
collapsedBeforeHide: void 0
|
|
68
|
+
} : {
|
|
69
|
+
visible: t,
|
|
70
|
+
collapsed: !0,
|
|
71
|
+
collapsedBeforeHide: e.collapsed
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function T(e, t) {
|
|
75
|
+
return e.visible ? { collapsed: t } : {
|
|
76
|
+
collapsed: t,
|
|
77
|
+
collapsedBeforeHide: t
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function E(e, t, n) {
|
|
81
|
+
let r = e.findIndex((e) => e.id === t);
|
|
82
|
+
if (r === -1) return null;
|
|
83
|
+
let i = Math.max(0, Math.min(e.length - 1, n));
|
|
84
|
+
if (i === r) return null;
|
|
85
|
+
let a = [...e], [o] = a.splice(r, 1);
|
|
86
|
+
a.splice(i, 0, o);
|
|
87
|
+
let s = /* @__PURE__ */ new Map();
|
|
88
|
+
return a.forEach((e, t) => {
|
|
89
|
+
e.order !== t && s.set(e.id, t);
|
|
90
|
+
}), s.size > 0 ? s : null;
|
|
91
|
+
}
|
|
92
|
+
function D(e, t, n) {
|
|
93
|
+
let r = e.layers[t];
|
|
94
|
+
return r ? { layers: {
|
|
95
|
+
...e.layers,
|
|
96
|
+
[t]: {
|
|
97
|
+
...r,
|
|
98
|
+
...n
|
|
99
|
+
}
|
|
100
|
+
} } : {};
|
|
101
|
+
}
|
|
102
|
+
function O(e, t, n) {
|
|
103
|
+
let r = e.groups[t];
|
|
104
|
+
return r ? { groups: {
|
|
105
|
+
...e.groups,
|
|
106
|
+
[t]: {
|
|
107
|
+
...r,
|
|
108
|
+
...n
|
|
109
|
+
}
|
|
110
|
+
} } : {};
|
|
111
|
+
}
|
|
112
|
+
function k(e, t) {
|
|
113
|
+
if (!t || !e || e === t) return t;
|
|
114
|
+
let n = t.map((t) => {
|
|
115
|
+
let n = e.find((e) => e.id === t.id);
|
|
116
|
+
return n && n.active !== t.active && t.options.includes(n.active) ? {
|
|
117
|
+
...t,
|
|
118
|
+
active: n.active
|
|
119
|
+
} : t;
|
|
120
|
+
});
|
|
121
|
+
return e.length === n.length && n.every((t, n) => {
|
|
122
|
+
let r = e[n];
|
|
123
|
+
return r.id === t.id && r.title === t.title && r.options === t.options && r.active === t.active;
|
|
124
|
+
}) ? e : n;
|
|
125
|
+
}
|
|
126
|
+
function A(e, t) {
|
|
127
|
+
return !n(e) || !n(t) || e.type !== t.type || e.key !== t.key ? !1 : j(e.props, t.props);
|
|
128
|
+
}
|
|
129
|
+
function j(e, t) {
|
|
130
|
+
let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
131
|
+
for (let r of n) if (!Object.is(e[r], t[r]) && !A(e[r], t[r])) return !1;
|
|
132
|
+
return !0;
|
|
133
|
+
}
|
|
134
|
+
function M(e, t) {
|
|
135
|
+
let n = /* @__PURE__ */ new Map();
|
|
136
|
+
for (let r of e) {
|
|
137
|
+
let e = t(r.merged), i = n.get(e);
|
|
138
|
+
i ? i.push(r) : n.set(e, [r]);
|
|
139
|
+
}
|
|
140
|
+
for (let e of n.values()) e.sort((e, t) => e.merged.order - t.merged.order || e.index - t.index).forEach((e, t) => {
|
|
141
|
+
e.merged.order = t;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
function N(e, t, n) {
|
|
145
|
+
return {
|
|
146
|
+
...t,
|
|
147
|
+
visible: e?.visible ?? t.visible ?? !0,
|
|
148
|
+
opacity: e?.opacity ?? t.opacity ?? 1,
|
|
149
|
+
collapsed: e?.collapsed ?? t.collapsed ?? !1,
|
|
150
|
+
collapsedBeforeHide: e?.collapsedBeforeHide,
|
|
151
|
+
sections: k(e?.sections, t.sections),
|
|
152
|
+
order: e?.order ?? t.order ?? n
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function P(e, t, n, r) {
|
|
156
|
+
return {
|
|
157
|
+
...t,
|
|
158
|
+
collapsed: e?.collapsed ?? t.collapsed ?? !r,
|
|
159
|
+
collapsedBeforeHide: e?.collapsedBeforeHide,
|
|
160
|
+
order: e?.order ?? t.order ?? n
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function F(e, t, n) {
|
|
164
|
+
let r = t.map((t, n) => ({
|
|
165
|
+
index: n,
|
|
166
|
+
merged: N(e.layers[t.id], t, n)
|
|
167
|
+
}));
|
|
168
|
+
M(r, (e) => e.groupId);
|
|
169
|
+
let i = new Set(r.filter(({ merged: e }) => e.visible && e.groupId != null).map(({ merged: e }) => e.groupId)), a = n.map((t, n) => ({
|
|
170
|
+
index: n,
|
|
171
|
+
merged: P(e.groups[t.id], t, n, i.has(t.id))
|
|
172
|
+
}));
|
|
173
|
+
M(a, () => void 0);
|
|
174
|
+
let o = r.length !== Object.keys(e.layers).length, s = {};
|
|
175
|
+
for (let { merged: t } of r) {
|
|
176
|
+
let n = e.layers[t.id];
|
|
177
|
+
n && j(n, t) ? s[t.id] = n : (s[t.id] = t, o = !0);
|
|
178
|
+
}
|
|
179
|
+
let c = a.length !== Object.keys(e.groups).length, l = {};
|
|
180
|
+
for (let { merged: t } of a) {
|
|
181
|
+
let n = e.groups[t.id];
|
|
182
|
+
n && j(n, t) ? l[t.id] = n : (l[t.id] = t, c = !0);
|
|
183
|
+
}
|
|
184
|
+
return !o && !c ? {} : {
|
|
185
|
+
layers: o ? s : e.layers,
|
|
186
|
+
groups: c ? l : e.groups
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function I(e, t, n) {
|
|
190
|
+
let r = Object.values(t).map((e, t) => ({
|
|
191
|
+
index: t,
|
|
192
|
+
merged: { ...e }
|
|
193
|
+
}));
|
|
194
|
+
M(r, n);
|
|
195
|
+
let i = r.length !== Object.keys(e).length, a = {};
|
|
196
|
+
for (let { merged: t } of r) {
|
|
197
|
+
let n = e[t.id];
|
|
198
|
+
n && j(n, t) ? a[t.id] = n : (a[t.id] = t, i = !0);
|
|
199
|
+
}
|
|
200
|
+
return i ? a : null;
|
|
201
|
+
}
|
|
202
|
+
function L(e, t) {
|
|
203
|
+
let n = Object.values(e.layers).filter((e) => e.groupId === t.groupId && e.id !== t.id).length, r = N(e.layers[t.id], t, n), i = I(e.layers, {
|
|
204
|
+
...e.layers,
|
|
205
|
+
[t.id]: r
|
|
206
|
+
}, (e) => e.groupId);
|
|
207
|
+
return i ? { layers: i } : {};
|
|
208
|
+
}
|
|
209
|
+
function R(e, t) {
|
|
210
|
+
if (!e.layers[t]) return {};
|
|
211
|
+
let n = { ...e.layers };
|
|
212
|
+
delete n[t];
|
|
213
|
+
let r = I(e.layers, n, (e) => e.groupId);
|
|
214
|
+
return r ? { layers: r } : {};
|
|
215
|
+
}
|
|
216
|
+
function z(e, t) {
|
|
217
|
+
let n = Object.values(e.groups).filter((e) => e.id !== t.id).length, r = Object.values(e.layers).some((e) => e.groupId === t.id && e.visible), i = P(e.groups[t.id], t, n, r), a = I(e.groups, {
|
|
218
|
+
...e.groups,
|
|
219
|
+
[t.id]: i
|
|
220
|
+
}, () => void 0);
|
|
221
|
+
return a ? { groups: a } : {};
|
|
222
|
+
}
|
|
223
|
+
function B(e, t) {
|
|
224
|
+
if (!e.groups[t]) return {};
|
|
225
|
+
let n = { ...e.groups };
|
|
226
|
+
delete n[t];
|
|
227
|
+
let r = I(e.groups, n, () => void 0), i = Object.values(e.layers).filter((e) => e.groupId === t);
|
|
228
|
+
if (i.length === 0) return r ? { groups: r } : {};
|
|
229
|
+
let a = { ...e.layers };
|
|
230
|
+
for (let e of i) a[e.id] = {
|
|
231
|
+
...e,
|
|
232
|
+
groupId: void 0
|
|
233
|
+
};
|
|
234
|
+
let o = I(e.layers, a, (e) => e.groupId);
|
|
235
|
+
return {
|
|
236
|
+
...r ? { groups: r } : {},
|
|
237
|
+
...o ? { layers: o } : {}
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
function V(e, t = {}) {
|
|
241
|
+
let n = F({
|
|
242
|
+
layers: {},
|
|
243
|
+
groups: {}
|
|
244
|
+
}, t.layers ?? [], t.groups ?? []);
|
|
245
|
+
return a()(o((e) => ({
|
|
246
|
+
layers: n.layers ?? {},
|
|
247
|
+
groups: n.groups ?? {},
|
|
248
|
+
setVisibility: (t, n) => e((e) => {
|
|
249
|
+
let r = e.layers[t], i = r && w(r, n);
|
|
250
|
+
return i ? D(e, t, i) : {};
|
|
251
|
+
}, !1, "setVisibility"),
|
|
252
|
+
setOpacity: (t, n) => e((e) => D(e, t, { opacity: C(n) }), !1, "setOpacity"),
|
|
253
|
+
setCollapsed: (t, n) => e((e) => {
|
|
254
|
+
let r = e.layers[t];
|
|
255
|
+
return r ? D(e, t, T(r, n)) : {};
|
|
256
|
+
}, !1, "setCollapsed"),
|
|
257
|
+
setSectionValue: (t, n, r) => e((e) => {
|
|
258
|
+
let i = e.layers[t], a = i?.sections?.find((e) => e.id === n);
|
|
259
|
+
return !i?.sections || !a || a.active === r || !a.options.includes(r) ? {} : D(e, t, { sections: i.sections.map((e) => e.id === n ? {
|
|
260
|
+
...e,
|
|
261
|
+
active: r
|
|
262
|
+
} : e) });
|
|
263
|
+
}, !1, "setSectionValue"),
|
|
264
|
+
moveLayer: (t, n) => e((e) => {
|
|
265
|
+
let r = e.layers[t];
|
|
266
|
+
if (!r) return {};
|
|
267
|
+
let i = E(f(e, r.groupId), t, n);
|
|
268
|
+
if (!i) return {};
|
|
269
|
+
let a = { ...e.layers };
|
|
270
|
+
for (let [e, t] of i) a[e] = {
|
|
271
|
+
...a[e],
|
|
272
|
+
order: t
|
|
273
|
+
};
|
|
274
|
+
return { layers: a };
|
|
275
|
+
}, !1, "moveLayer"),
|
|
276
|
+
setGroupVisibility: (t, n) => e((e) => {
|
|
277
|
+
let r = e.groups[t];
|
|
278
|
+
if (!r) return {};
|
|
279
|
+
let i = Object.values(e.layers).filter((e) => e.groupId === t), a = i.some((e) => e.visible);
|
|
280
|
+
if (i.length === 0 || !n && !a) return {};
|
|
281
|
+
let o = { ...e.layers }, s = !1;
|
|
282
|
+
for (let e of i) {
|
|
283
|
+
let t = w(e, n);
|
|
284
|
+
t && (o[e.id] = {
|
|
285
|
+
...e,
|
|
286
|
+
...t
|
|
287
|
+
}, s = !0);
|
|
288
|
+
}
|
|
289
|
+
if (!s) return {};
|
|
290
|
+
let c = null;
|
|
291
|
+
return !n && a ? c = {
|
|
292
|
+
collapsed: !0,
|
|
293
|
+
collapsedBeforeHide: r.collapsed
|
|
294
|
+
} : n && !a && (c = {
|
|
295
|
+
collapsed: r.collapsedBeforeHide ?? !1,
|
|
296
|
+
collapsedBeforeHide: void 0
|
|
297
|
+
}), {
|
|
298
|
+
layers: o,
|
|
299
|
+
...c ? { groups: {
|
|
300
|
+
...e.groups,
|
|
301
|
+
[t]: {
|
|
302
|
+
...r,
|
|
303
|
+
...c
|
|
304
|
+
}
|
|
305
|
+
} } : {}
|
|
306
|
+
};
|
|
307
|
+
}, !1, "setGroupVisibility"),
|
|
308
|
+
setGroupCollapsed: (t, n) => e((e) => {
|
|
309
|
+
if (!e.groups[t]) return {};
|
|
310
|
+
let r = Object.values(e.layers).filter((e) => e.groupId === t);
|
|
311
|
+
return O(e, t, r.length > 0 && r.every((e) => !e.visible) ? {
|
|
312
|
+
collapsed: n,
|
|
313
|
+
collapsedBeforeHide: n
|
|
314
|
+
} : { collapsed: n });
|
|
315
|
+
}, !1, "setGroupCollapsed"),
|
|
316
|
+
moveGroup: (t, n) => e((e) => {
|
|
317
|
+
if (!e.groups[t]) return {};
|
|
318
|
+
let r = E(d(e), t, n);
|
|
319
|
+
if (!r) return {};
|
|
320
|
+
let i = { ...e.groups };
|
|
321
|
+
for (let [e, t] of r) i[e] = {
|
|
322
|
+
...i[e],
|
|
323
|
+
order: t
|
|
324
|
+
};
|
|
325
|
+
return { groups: i };
|
|
326
|
+
}, !1, "moveGroup"),
|
|
327
|
+
setLegendLayer: (t) => e((e) => L(e, t), !1, "setLegendLayer"),
|
|
328
|
+
removeLegendLayer: (t) => e((e) => R(e, t), !1, "removeLegendLayer"),
|
|
329
|
+
setLegendGroup: (t) => e((e) => z(e, t), !1, "setLegendGroup"),
|
|
330
|
+
removeLegendGroup: (t) => e((e) => B(e, t), !1, "removeLegendGroup"),
|
|
331
|
+
_sync: (t, n) => e((e) => F(e, t, n), !1, "_sync")
|
|
332
|
+
}), {
|
|
333
|
+
name: `legend-${e}`,
|
|
334
|
+
enabled: S()
|
|
335
|
+
}));
|
|
336
|
+
}
|
|
337
|
+
function H(e) {
|
|
338
|
+
let t = y.get(e);
|
|
339
|
+
if (!t) throw Error(`[legend] Legend store "${e}" not found.`);
|
|
340
|
+
return t;
|
|
341
|
+
}
|
|
342
|
+
function U(e) {
|
|
343
|
+
return y.has(e);
|
|
344
|
+
}
|
|
345
|
+
function W(e) {
|
|
346
|
+
y.delete(e);
|
|
347
|
+
}
|
|
348
|
+
function G() {
|
|
349
|
+
y.clear(), b.clear(), x.clear();
|
|
350
|
+
}
|
|
351
|
+
function K(e, t) {
|
|
352
|
+
y.set(e, t);
|
|
353
|
+
}
|
|
354
|
+
function q(e, t) {
|
|
355
|
+
y.set(e, t);
|
|
356
|
+
let n = (b.get(e) ?? 0) + 1;
|
|
357
|
+
b.set(e, n), n > 1 && S() && !x.has(e) && (console.warn(`[legend] Duplicate <Legend.Provider id="${e}"> detected. Multiple providers sharing an id will race on prop sync. Use unique ids per legend panel.`), x.add(e));
|
|
358
|
+
}
|
|
359
|
+
function J(e, t) {
|
|
360
|
+
let n = (b.get(e) ?? 1) - 1;
|
|
361
|
+
n <= 0 ? (b.delete(e), t.keepAlive || y.delete(e)) : b.set(e, n);
|
|
362
|
+
}
|
|
363
|
+
function Y(t, n) {
|
|
364
|
+
let r = e(2), a;
|
|
365
|
+
return r[0] === t ? a = r[1] : (a = H(t), r[0] = t, r[1] = a), i(a, n);
|
|
366
|
+
}
|
|
367
|
+
function X(t, n) {
|
|
368
|
+
let r = e(2), a;
|
|
369
|
+
return r[0] === t ? a = r[1] : (a = H(t), r[0] = t, r[1] = a), i(a, s(n));
|
|
370
|
+
}
|
|
371
|
+
//#endregion
|
|
372
|
+
export { p as _, U as a, l as b, J as c, m as d, v as f, d as g, f as h, H as i, X as l, _ as m, V as n, q as o, h as p, W as r, K as s, G as t, Y as u, g as v, c as y };
|
|
373
|
+
|
|
374
|
+
//# sourceMappingURL=stores-B81-IU1G.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stores-B81-IU1G.js","names":["createContext","useContext","LegendContext","useLegendId","id","Error","LegendGroup","LegendLayer","LegendState","byOrder","order","a","T","b","selectOrderedGroups","state","Object","values","groups","sort","selectLayersByGroup","groupId","layers","filter","l","selectOrderedLayers","selectAllGroupsCollapsed","length","every","g","collapsed","selectHasGroups","keys","selectVisibleLayersGrouped","group","visible","sections","id","push","ungrouped","undefined","selectLayerCollapsible","layerId","layer","variables","Boolean","helperText","LegendVisibility","selectGroupVisibility","anyVisible","anyHidden","isValidElement","useStore","StoreApi","createStore","devtools","useShallow","LegendConfigSection","LegendGroup","LegendGroupInput","LegendInit","LegendLayer","LegendLayerInput","LegendState","LegendStoreApi","selectLayersByGroup","selectOrderedGroups","legendStores","Map","legendMountCounts","warnedDuplicates","Set","isDev","Boolean","import","meta","env","DEV","clamp01","n","Math","min","max","visibilityPatch","entity","visible","collapsed","collapsedBeforeHide","undefined","collapsePatch","movePatch","id","order","bucket","T","toIndex","fromIndex","findIndex","e","clamped","length","next","moved","splice","orders","forEach","index","set","size","updateLayer","state","patch","Partial","layer","layers","updateGroup","group","groups","mergeSections","prev","merged","map","section","prevSection","find","p","active","options","includes","sameAsPrev","every","m","i","title","reactElementEqual","a","b","type","key","shallowEqualEntity","props","Record","keys","Object","is","normalizeOrders","entries","bucketOf","buckets","entry","get","push","values","sort","mergeLayerEntity","input","fallbackOrder","opacity","sections","mergeGroupEntity","hasVisibleLayer","syncState","layerInputs","groupInputs","layerEntries","l","groupId","groupsWithVisibleLayer","filter","groupEntries","has","layersChanged","groupsChanged","rebuildRecord","changed","out","before","upsertLayerState","siblingCount","removeLayerState","upsertGroupState","count","g","some","removeGroupState","nextGroups","members","nextLayers","member","createLegendStore","init","seeded","setVisibility","lid","s","setOpacity","setCollapsed","setSectionValue","sectionId","value","x","moveLayer","setGroupVisibility","gid","anyVisible","groupPatch","setGroupCollapsed","hidden","moveGroup","setLegendLayer","removeLegendLayer","setLegendGroup","removeLegendGroup","_sync","name","enabled","getLegendStore","store","Error","hasLegendStore","deleteLegendStore","delete","clearAllLegendStores","clear","setLegendStoreEntry","registerLegendStore","console","warn","add","unregisterLegendStore","keepAlive","useLegendStore","selector","$","_c","t0","useLegendShallow"],"sources":["../src/legend/stores/legend-context.ts","../src/legend/stores/selectors.ts","../src/legend/stores/legend-store-registry.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\n/** @experimental This API is new and may change in a future release. */\nexport const LegendContext = createContext<string | null>(null)\n\n/** @experimental This API is new and may change in a future release. */\nexport function useLegendId(): string {\n const id = useContext(LegendContext)\n if (id == null) {\n throw new Error(\n 'useLegendId() must be called inside <Legend.Provider>. ' +\n 'If you are calling from outside the Provider tree, use the hooks ' +\n '(useLegendStore, useLegendShallow) directly with an explicit id.',\n )\n }\n return id\n}\n","import type { LegendGroup, LegendLayer, LegendState } from './types'\n\nconst byOrder = <T extends { order: number }>(a: T, b: T): number =>\n a.order - b.order\n\n/**\n * Groups sorted by `order`.\n *\n * @experimental This API is new and may change in a future release.\n */\nexport function selectOrderedGroups(state: LegendState): LegendGroup[] {\n return Object.values(state.groups).sort(byOrder)\n}\n\n/**\n * Layers belonging to `groupId` (pass `undefined` for ungrouped, top-level\n * layers), sorted by `order`.\n *\n * @experimental This API is new and may change in a future release.\n */\nexport function selectLayersByGroup(\n state: LegendState,\n groupId: string | undefined,\n): LegendLayer[] {\n return Object.values(state.layers)\n .filter((l) => l.groupId === groupId)\n .sort(byOrder)\n}\n\n/**\n * All layers sorted by `order`, regardless of group.\n *\n * @experimental This API is new and may change in a future release.\n */\nexport function selectOrderedLayers(state: LegendState): LegendLayer[] {\n return Object.values(state.layers).sort(byOrder)\n}\n\n/**\n * `true` when every group is collapsed (`false` with no groups) — drives the\n * \"Collapse all groups\" / \"Expand all groups\" menu label flip.\n *\n * @experimental This API is new and may change in a future release.\n */\nexport function selectAllGroupsCollapsed(state: LegendState): boolean {\n const groups = Object.values(state.groups)\n return groups.length > 0 && groups.every((g) => g.collapsed)\n}\n\n/**\n * Whether the legend has groups — gates panel-level group actions.\n *\n * @experimental This API is new and may change in a future release.\n */\nexport function selectHasGroups(state: LegendState): boolean {\n return Object.keys(state.groups).length > 0\n}\n\n/**\n * Visible layers grouped for the enabled-layers menu.\n *\n * @experimental This API is new and may change in a future release.\n */\nexport function selectVisibleLayersGrouped(\n state: LegendState,\n): { group?: LegendGroup; layers: LegendLayer[] }[] {\n const visible = (groupId: string | undefined) =>\n selectLayersByGroup(state, groupId).filter((l) => l.visible)\n const sections: { group?: LegendGroup; layers: LegendLayer[] }[] = []\n for (const group of selectOrderedGroups(state)) {\n const layers = visible(group.id)\n if (layers.length > 0) sections.push({ group, layers })\n }\n const ungrouped = visible(undefined)\n if (ungrouped.length > 0) sections.push({ layers: ungrouped })\n return sections\n}\n\n/**\n * Whether a layer has any collapsible body — something the row's `Collapse`\n * can actually fold. A layer with no variables, sections, or helper note\n * renders an empty body, so there is nothing to collapse. Gates the row's\n * title-area collapse affordance (chevron + click).\n *\n * @experimental This API is new and may change in a future release.\n */\nexport function selectLayerCollapsible(\n state: LegendState,\n layerId: string,\n): boolean {\n const layer = state.layers[layerId]\n if (!layer) return false\n return (\n layer.variables.length > 0 ||\n (layer.sections?.length ?? 0) > 0 ||\n // Truthiness matches the render condition — an empty-string note renders\n // no footer, so it must not enable the collapse affordance.\n Boolean(layer.helperText)\n )\n}\n\n/**\n * Tri-state visibility — derived for groups from their member layers, and the\n * state contract of a controlled `Legend.VisibilityToggle` for any custom\n * element kind.\n */\nexport type LegendVisibility = 'visible' | 'hidden' | 'mixed'\n\n/**\n * Tri-state group visibility: `'visible'` when every member layer is visible\n * (also for empty groups), `'hidden'` when none is, `'mixed'` otherwise.\n *\n * @experimental This API is new and may change in a future release.\n */\nexport function selectGroupVisibility(\n state: LegendState,\n groupId: string,\n): LegendVisibility {\n let anyVisible = false\n let anyHidden = false\n for (const layer of selectLayersByGroup(state, groupId)) {\n if (layer.visible) anyVisible = true\n else anyHidden = true\n }\n if (anyVisible && anyHidden) return 'mixed'\n return anyHidden ? 'hidden' : 'visible'\n}\n","import { isValidElement } from 'react'\nimport { useStore, type StoreApi } from 'zustand'\nimport { createStore } from 'zustand/vanilla'\nimport { devtools } from 'zustand/middleware'\nimport { useShallow } from 'zustand/react/shallow'\nimport type {\n LegendConfigSection,\n LegendGroup,\n LegendGroupInput,\n LegendInit,\n LegendLayer,\n LegendLayerInput,\n LegendState,\n LegendStoreApi,\n} from './types'\nimport { selectLayersByGroup, selectOrderedGroups } from './selectors'\n\n// Per-panel legend store registry. One store per `<Legend.Provider id>`.\n// Mirrors the widgets-v2 registry pattern (keyed Map + refcounted mounts),\n// without the chart-pipeline machinery.\nconst legendStores = new Map<string, LegendStoreApi>()\nconst legendMountCounts = new Map<string, number>()\nconst warnedDuplicates = new Set<string>()\n\nconst isDev = (): boolean => {\n try {\n return Boolean(\n (import.meta as unknown as { env?: { DEV?: boolean } }).env?.DEV,\n )\n } catch {\n return false\n }\n}\n\nconst clamp01 = (n: number): number => Math.min(1, Math.max(0, n))\n\n// ─── Pure state helpers ─────────────────────────────────────────────────────\n\n/**\n * Visibility↔collapse coupling. Hiding snapshots the current collapsed state\n * and collapses; showing restores the snapshot (manual choices persist) and\n * defaults to expanded. Idempotent: returns `null` when `visible` is already\n * the requested value, so a double-hide can't overwrite the real snapshot.\n */\nfunction visibilityPatch(\n entity: {\n visible: boolean\n collapsed: boolean\n collapsedBeforeHide?: boolean\n },\n visible: boolean,\n): {\n visible: boolean\n collapsed: boolean\n collapsedBeforeHide: boolean | undefined\n} | null {\n if (entity.visible === visible) return null\n return visible\n ? // Showing: restore the pre-hide collapsed state (default expand).\n {\n visible,\n collapsed: entity.collapsedBeforeHide ?? false,\n collapsedBeforeHide: undefined,\n }\n : // Hiding: snapshot, then collapse.\n {\n visible,\n collapsed: true,\n collapsedBeforeHide: entity.collapsed,\n }\n}\n\n/**\n * Manual collapse. While hidden, the snapshot follows the manual choice so\n * the next show keeps it.\n */\nfunction collapsePatch(\n entity: { visible: boolean },\n collapsed: boolean,\n): { collapsed: boolean; collapsedBeforeHide?: boolean } {\n return entity.visible\n ? { collapsed }\n : { collapsed, collapsedBeforeHide: collapsed }\n}\n\n/**\n * Reorder one entity within its **ordered** bucket: splice it out, insert at\n * the clamped index, and return the dense `order` rewrites (only the entries\n * whose order actually changes). `null` when the position doesn't change or\n * the id isn't in the bucket. Powers `moveLayer` / `moveGroup`.\n */\nfunction movePatch<T extends { id: string; order: number }>(\n bucket: T[],\n id: string,\n toIndex: number,\n): Map<string, number> | null {\n const fromIndex = bucket.findIndex((e) => e.id === id)\n if (fromIndex === -1) return null\n const clamped = Math.max(0, Math.min(bucket.length - 1, toIndex))\n if (clamped === fromIndex) return null\n const next = [...bucket]\n const [moved] = next.splice(fromIndex, 1)\n next.splice(clamped, 0, moved!)\n const orders = new Map<string, number>()\n next.forEach((entity, index) => {\n if (entity.order !== index) orders.set(entity.id, index)\n })\n return orders.size > 0 ? orders : null\n}\n\nfunction updateLayer(\n state: LegendState,\n id: string,\n patch: Partial<LegendLayer>,\n): Partial<LegendState> {\n const layer = state.layers[id]\n if (!layer) return {}\n return { layers: { ...state.layers, [id]: { ...layer, ...patch } } }\n}\n\nfunction updateGroup(\n state: LegendState,\n id: string,\n patch: Partial<LegendGroup>,\n): Partial<LegendState> {\n const group = state.groups[id]\n if (!group) return {}\n return { groups: { ...state.groups, [id]: { ...group, ...patch } } }\n}\n\n/**\n * Merge incoming config-select sections while preserving the user's picked\n * `active` for any section id that still exists and whose pick is still among\n * the new `options` (the structure — ids, titles, options, order — always\n * follows the props). Returns the previous array when the merge lands on the\n * same content, so unchanged syncs keep entity identity (bail-out).\n */\nfunction mergeSections(\n prev: LegendConfigSection[] | undefined,\n next: LegendConfigSection[] | undefined,\n): LegendConfigSection[] | undefined {\n if (!next || !prev || prev === next) return next\n const merged = next.map((section) => {\n const prevSection = prev.find((p) => p.id === section.id)\n return prevSection &&\n prevSection.active !== section.active &&\n section.options.includes(prevSection.active)\n ? { ...section, active: prevSection.active }\n : section\n })\n const sameAsPrev =\n prev.length === merged.length &&\n merged.every((m, i) => {\n const p = prev[i]!\n return (\n p.id === m.id &&\n p.title === m.title &&\n p.options === m.options &&\n p.active === m.active\n )\n })\n return sameAsPrev ? prev : merged\n}\n\n/**\n * Same-type, same-key React elements with shallow-equal props count as\n * equal, so a ReactNode field (e.g. `LegendGroup.icon`) re-created inline on\n * every render (`icon={<MyIcon />}`) doesn't look \"changed\" on every sync. A\n * different `key` is treated as a real change, same as a different type.\n */\nfunction reactElementEqual(a: unknown, b: unknown): boolean {\n if (!isValidElement(a) || !isValidElement(b)) return false\n if (a.type !== b.type || a.key !== b.key) return false\n return shallowEqualEntity(\n a.props as Record<string, unknown>,\n b.props as Record<string, unknown>,\n )\n}\n\n/**\n * Shallow equality over the union of both objects' keys — `Object.is` per\n * value, except React elements, which fall back to {@link reactElementEqual}.\n */\nfunction shallowEqualEntity<T extends object>(a: T, b: T): boolean {\n const keys = new Set([...Object.keys(a), ...Object.keys(b)]) as Set<keyof T>\n for (const key of keys) {\n if (Object.is(a[key], b[key])) continue\n if (!reactElementEqual(a[key], b[key])) return false\n }\n return true\n}\n\n/**\n * Reassign `order` to dense indexes `0..n-1` within each sibling bucket,\n * sorted by current order with ties broken by input position. This is the\n * only boundary where external (possibly duplicated) orders enter, so the\n * stored orders stay dense and unique within each bucket.\n */\nfunction normalizeOrders<T extends { order: number }>(\n entries: { merged: T; index: number }[],\n bucketOf: (e: T) => string | undefined,\n): void {\n const buckets = new Map<string | undefined, { merged: T; index: number }[]>()\n for (const entry of entries) {\n const key = bucketOf(entry.merged)\n const bucket = buckets.get(key)\n if (bucket) bucket.push(entry)\n else buckets.set(key, [entry])\n }\n for (const bucket of buckets.values()) {\n bucket\n .sort((a, b) => a.merged.order - b.merged.order || a.index - b.index)\n .forEach((entry, i) => {\n entry.merged.order = i\n })\n }\n}\n\n/**\n * Seed/merge one layer: static fields follow the input; interactive state\n * (`visible`/`opacity`/`collapsed`/`order`/`collapsedBeforeHide` + section\n * actives) sticks to the store entry when present. Shared by `_sync` (per\n * entry) and the imperative `setLegendLayer`.\n */\nfunction mergeLayerEntity(\n prev: LegendLayer | undefined,\n input: LegendLayerInput,\n fallbackOrder: number,\n): LegendLayer {\n return {\n ...input,\n visible: prev?.visible ?? input.visible ?? true,\n opacity: prev?.opacity ?? input.opacity ?? 1,\n collapsed: prev?.collapsed ?? input.collapsed ?? false,\n collapsedBeforeHide: prev?.collapsedBeforeHide,\n sections: mergeSections(prev?.sections, input.sections),\n order: prev?.order ?? input.order ?? fallbackOrder,\n } as LegendLayer\n}\n\n/**\n * Group counterpart of {@link mergeLayerEntity}. A group with no `prev`\n * state (first sync) defaults collapsed when none of its member layers is\n * visible yet — `hasVisibleLayer` is ignored once the group exists so a\n * user's manual expand/collapse always sticks.\n */\nfunction mergeGroupEntity(\n prev: LegendGroup | undefined,\n input: LegendGroupInput,\n fallbackOrder: number,\n hasVisibleLayer: boolean,\n): LegendGroup {\n return {\n ...input,\n collapsed: prev?.collapsed ?? input.collapsed ?? !hasVisibleLayer,\n collapsedBeforeHide: prev?.collapsedBeforeHide,\n order: prev?.order ?? input.order ?? fallbackOrder,\n } as LegendGroup\n}\n\n/**\n * Merge incoming definitions while preserving interactive state of known\n * entities: static fields (name, subtitle, variables, attributes, …) follow\n * the props; `visible`/`opacity`/`collapsed`/`order` stick to what's in the\n * store. New entities are seeded; vanished ones are dropped. Sibling orders\n * are normalized to dense indexes.\n *\n * Unchanged entities keep their previous object identity (`variables`\n * compared by reference), and when nothing changed at all the sync is a\n * no-op (`{}`), so stable consumer props never produce a state update.\n */\nfunction syncState(\n state: LegendState,\n layerInputs: LegendLayerInput[],\n groupInputs: LegendGroupInput[],\n): Partial<LegendState> {\n const layerEntries = layerInputs.map((input, index) => ({\n index,\n merged: mergeLayerEntity(state.layers[input.id], input, index),\n }))\n normalizeOrders(layerEntries, (l) => l.groupId)\n\n const groupsWithVisibleLayer = new Set(\n layerEntries\n .filter(({ merged }) => merged.visible && merged.groupId != null)\n .map(({ merged }) => merged.groupId!),\n )\n const groupEntries = groupInputs.map((input, index) => ({\n index,\n merged: mergeGroupEntity(\n state.groups[input.id],\n input,\n index,\n groupsWithVisibleLayer.has(input.id),\n ),\n }))\n normalizeOrders(groupEntries, () => undefined)\n\n // Reference preservation: reuse the previous entity object when nothing\n // about it changed, so subscribers see stable identities.\n let layersChanged = layerEntries.length !== Object.keys(state.layers).length\n const layers: Record<string, LegendLayer> = {}\n for (const { merged } of layerEntries) {\n const prev = state.layers[merged.id]\n if (prev && shallowEqualEntity(prev, merged)) {\n layers[merged.id] = prev\n } else {\n layers[merged.id] = merged\n layersChanged = true\n }\n }\n\n let groupsChanged = groupEntries.length !== Object.keys(state.groups).length\n const groups: Record<string, LegendGroup> = {}\n for (const { merged } of groupEntries) {\n const prev = state.groups[merged.id]\n if (prev && shallowEqualEntity(prev, merged)) {\n groups[merged.id] = prev\n } else {\n groups[merged.id] = merged\n groupsChanged = true\n }\n }\n\n if (!layersChanged && !groupsChanged) return {}\n return {\n layers: layersChanged ? layers : state.layers,\n groups: groupsChanged ? groups : state.groups,\n }\n}\n\n/**\n * Rebuild a layer/group record from a candidate map, normalizing dense order\n * per bucket and preserving the previous object identity for entries that are\n * unchanged. Returns `null` when nothing changed (so callers can bail with\n * `{}`).\n */\nfunction rebuildRecord<\n T extends { id: string; order: number; groupId?: string },\n>(\n prev: Record<string, T>,\n next: Record<string, T>,\n bucketOf: (e: T) => string | undefined,\n): Record<string, T> | null {\n const entries = Object.values(next).map((e, index) => ({\n index,\n merged: { ...e },\n }))\n normalizeOrders(entries, bucketOf)\n let changed = entries.length !== Object.keys(prev).length\n const out: Record<string, T> = {}\n for (const { merged } of entries) {\n const before = prev[merged.id]\n if (before && shallowEqualEntity(before, merged)) {\n out[merged.id] = before\n } else {\n out[merged.id] = merged\n changed = true\n }\n }\n return changed ? out : null\n}\n\n/** Add or update a single layer (imperative `setLegendLayer`). */\nfunction upsertLayerState(\n state: LegendState,\n input: LegendLayerInput,\n): Partial<LegendState> {\n const siblingCount = Object.values(state.layers).filter(\n (l) => l.groupId === input.groupId && l.id !== input.id,\n ).length\n const merged = mergeLayerEntity(state.layers[input.id], input, siblingCount)\n const layers = rebuildRecord(\n state.layers,\n { ...state.layers, [input.id]: merged },\n (l) => l.groupId,\n )\n return layers ? { layers } : {}\n}\n\n/** Remove a single layer, re-densifying its sibling orders. */\nfunction removeLayerState(\n state: LegendState,\n id: string,\n): Partial<LegendState> {\n if (!state.layers[id]) return {}\n const next = { ...state.layers }\n delete next[id]\n const layers = rebuildRecord(state.layers, next, (l) => l.groupId)\n return layers ? { layers } : {}\n}\n\n/** Add or update a single group (imperative `setLegendGroup`). */\nfunction upsertGroupState(\n state: LegendState,\n input: LegendGroupInput,\n): Partial<LegendState> {\n const count = Object.values(state.groups).filter(\n (g) => g.id !== input.id,\n ).length\n const hasVisibleLayer = Object.values(state.layers).some(\n (l) => l.groupId === input.id && l.visible,\n )\n const merged = mergeGroupEntity(\n state.groups[input.id],\n input,\n count,\n hasVisibleLayer,\n )\n const groups = rebuildRecord(\n state.groups,\n { ...state.groups, [input.id]: merged },\n () => undefined,\n )\n return groups ? { groups } : {}\n}\n\n/**\n * Remove a group; its member layers are un-grouped (`groupId` cleared) so they\n * survive as ungrouped rows. Re-densifies both group and layer orders.\n */\nfunction removeGroupState(\n state: LegendState,\n id: string,\n): Partial<LegendState> {\n if (!state.groups[id]) return {}\n const nextGroups = { ...state.groups }\n delete nextGroups[id]\n const groups = rebuildRecord(state.groups, nextGroups, () => undefined)\n\n const members = Object.values(state.layers).filter((l) => l.groupId === id)\n if (members.length === 0) return groups ? { groups } : {}\n\n const nextLayers = { ...state.layers }\n for (const member of members) {\n nextLayers[member.id] = { ...member, groupId: undefined }\n }\n const layers = rebuildRecord(state.layers, nextLayers, (l) => l.groupId)\n return {\n ...(groups ? { groups } : {}),\n ...(layers ? { layers } : {}),\n }\n}\n\n// ─── Store factory ────────────────────────────────────────────────────────────\n\n/**\n * @internal — used by Provider; not part of the public API.\n *\n * @experimental This API is new and may change in a future release.\n */\nexport function createLegendStore(\n id: string,\n init: LegendInit = {},\n): LegendStoreApi {\n // Seed through the same merge/normalize path as `_sync`, so a later sync\n // with identical input is a guaranteed no-op (stable identities).\n const seeded = syncState(\n { layers: {}, groups: {} } as LegendState,\n init.layers ?? [],\n init.groups ?? [],\n )\n\n return createStore<LegendState>()(\n devtools(\n (set) => ({\n layers: seeded.layers ?? {},\n groups: seeded.groups ?? {},\n\n setVisibility: (lid, visible) =>\n set(\n (s) => {\n const layer = s.layers[lid]\n const patch = layer && visibilityPatch(layer, visible)\n return patch ? updateLayer(s, lid, patch) : {}\n },\n false,\n 'setVisibility',\n ),\n setOpacity: (lid, opacity) =>\n set(\n (s) => updateLayer(s, lid, { opacity: clamp01(opacity) }),\n false,\n 'setOpacity',\n ),\n setCollapsed: (lid, collapsed) =>\n set(\n (s) => {\n const layer = s.layers[lid]\n return layer\n ? updateLayer(s, lid, collapsePatch(layer, collapsed))\n : {}\n },\n false,\n 'setCollapsed',\n ),\n setSectionValue: (lid, sectionId, value) =>\n set(\n (s) => {\n const layer = s.layers[lid]\n const section = layer?.sections?.find((x) => x.id === sectionId)\n if (\n !layer?.sections ||\n !section ||\n section.active === value ||\n !section.options.includes(value)\n ) {\n return {}\n }\n const sections = layer.sections.map((x) =>\n x.id === sectionId ? { ...x, active: value } : x,\n )\n return updateLayer(s, lid, { sections })\n },\n false,\n 'setSectionValue',\n ),\n\n moveLayer: (lid, toIndex) =>\n set(\n (s) => {\n const layer = s.layers[lid]\n if (!layer) return {}\n const bucket = selectLayersByGroup(s, layer.groupId)\n const orders = movePatch(bucket, lid, toIndex)\n if (!orders) return {}\n const layers = { ...s.layers }\n for (const [id, order] of orders) {\n layers[id] = { ...layers[id]!, order }\n }\n return { layers }\n },\n false,\n 'moveLayer',\n ),\n\n setGroupVisibility: (gid, visible) =>\n set(\n (s) => {\n const group = s.groups[gid]\n if (!group) return {}\n const members = Object.values(s.layers).filter(\n (l) => l.groupId === gid,\n )\n const anyVisible = members.some((l) => l.visible)\n // Idempotence on the derived state: hide needs a visible member,\n // show needs a fully-hidden group (mixed acts in both directions\n // except show-from-mixed still shows the hidden remainder).\n if (members.length === 0 || (!visible && !anyVisible)) return {}\n\n // Cascade: each member runs the standard visibility↔collapse\n // coupling, so per-layer collapse snapshots survive a group\n // hide/show; members already at the target are untouched.\n const layers = { ...s.layers }\n let layersChanged = false\n for (const member of members) {\n const patch = visibilityPatch(member, visible)\n if (patch) {\n layers[member.id] = { ...member, ...patch }\n layersChanged = true\n }\n }\n if (!layersChanged) return {}\n\n // Group-level collapse coupling, only on real derived\n // transitions: any-visible→hidden snapshots + collapses;\n // hidden→visible restores the snapshot.\n let groupPatch: Partial<LegendGroup> | null = null\n if (!visible && anyVisible) {\n groupPatch = {\n collapsed: true,\n collapsedBeforeHide: group.collapsed,\n }\n } else if (visible && !anyVisible) {\n groupPatch = {\n collapsed: group.collapsedBeforeHide ?? false,\n collapsedBeforeHide: undefined,\n }\n }\n return {\n layers,\n ...(groupPatch\n ? {\n groups: {\n ...s.groups,\n [gid]: { ...group, ...groupPatch },\n },\n }\n : {}),\n }\n },\n false,\n 'setGroupVisibility',\n ),\n setGroupCollapsed: (gid, collapsed) =>\n set(\n (s) => {\n const group = s.groups[gid]\n if (!group) return {}\n // Group visibility is derived from members; while the group is\n // hidden the snapshot follows the manual choice (layer parity).\n const members = Object.values(s.layers).filter(\n (l) => l.groupId === gid,\n )\n const hidden =\n members.length > 0 && members.every((l) => !l.visible)\n return updateGroup(\n s,\n gid,\n hidden\n ? { collapsed, collapsedBeforeHide: collapsed }\n : { collapsed },\n )\n },\n false,\n 'setGroupCollapsed',\n ),\n\n moveGroup: (gid, toIndex) =>\n set(\n (s) => {\n if (!s.groups[gid]) return {}\n const orders = movePatch(selectOrderedGroups(s), gid, toIndex)\n if (!orders) return {}\n const groups = { ...s.groups }\n for (const [id, order] of orders) {\n groups[id] = { ...groups[id]!, order }\n }\n return { groups }\n },\n false,\n 'moveGroup',\n ),\n\n setLegendLayer: (input) =>\n set((s) => upsertLayerState(s, input), false, 'setLegendLayer'),\n removeLegendLayer: (lid) =>\n set((s) => removeLayerState(s, lid), false, 'removeLegendLayer'),\n setLegendGroup: (input) =>\n set((s) => upsertGroupState(s, input), false, 'setLegendGroup'),\n removeLegendGroup: (gid) =>\n set((s) => removeGroupState(s, gid), false, 'removeLegendGroup'),\n\n _sync: (layerInputs, groupInputs) =>\n set((s) => syncState(s, layerInputs, groupInputs), false, '_sync'),\n }),\n { name: `legend-${id}`, enabled: isDev() },\n ),\n )\n}\n\n// ─── Registry ───────────────────────────────────────────────────────────────\n\n/** @experimental This API is new and may change in a future release. */\nexport function getLegendStore(id: string): LegendStoreApi {\n const store = legendStores.get(id)\n if (!store) throw new Error(`[legend] Legend store \"${id}\" not found.`)\n return store\n}\n\n/** @experimental This API is new and may change in a future release. */\nexport function hasLegendStore(id: string): boolean {\n return legendStores.has(id)\n}\n\n/** @experimental This API is new and may change in a future release. */\nexport function deleteLegendStore(id: string): void {\n legendStores.delete(id)\n}\n\n/** @experimental This API is new and may change in a future release. */\nexport function clearAllLegendStores(): void {\n legendStores.clear()\n legendMountCounts.clear()\n warnedDuplicates.clear()\n}\n\n/**\n * @internal — used by Provider's lazy init so children can resolve the store first render.\n *\n * @experimental This API is new and may change in a future release.\n */\nexport function setLegendStoreEntry(id: string, store: LegendStoreApi): void {\n legendStores.set(id, store)\n}\n\n/**\n * @internal — registers a Provider mount and warns on duplicate ids in dev.\n *\n * @experimental This API is new and may change in a future release.\n */\nexport function registerLegendStore(id: string, store: LegendStoreApi): void {\n legendStores.set(id, store)\n const count = (legendMountCounts.get(id) ?? 0) + 1\n legendMountCounts.set(id, count)\n if (count > 1 && isDev() && !warnedDuplicates.has(id)) {\n // eslint-disable-next-line no-console\n console.warn(\n `[legend] Duplicate <Legend.Provider id=\"${id}\"> detected. ` +\n `Multiple providers sharing an id will race on prop sync. ` +\n `Use unique ids per legend panel.`,\n )\n warnedDuplicates.add(id)\n }\n}\n\n/**\n * @internal — Provider unmount counterpart; removes the entry on last unmount.\n *\n * @experimental This API is new and may change in a future release.\n */\nexport function unregisterLegendStore(\n id: string,\n options: { keepAlive: boolean },\n): void {\n const count = (legendMountCounts.get(id) ?? 1) - 1\n if (count <= 0) {\n legendMountCounts.delete(id)\n if (!options.keepAlive) legendStores.delete(id)\n } else {\n legendMountCounts.set(id, count)\n }\n}\n\n// ─── Hooks ────────────────────────────────────────────────────────────────────\n\n/** @experimental This API is new and may change in a future release. */\nexport function useLegendStore<T>(\n id: string,\n selector: (state: LegendState) => T,\n): T {\n const store = getLegendStore(id) as unknown as StoreApi<LegendState>\n return useStore(store, selector)\n}\n\n/** @experimental This API is new and may change in a future release. */\nexport function useLegendShallow<T>(\n id: string,\n selector: (state: LegendState) => T,\n): T {\n const store = getLegendStore(id) as unknown as StoreApi<LegendState>\n return useStore(store, useShallow(selector))\n}\n"],"mappings":";;;;;;;AAGA,IAAaE,IAAgBF,EAA6B,IAAI;AAG9D,SAAOG,IAAA;CACL,IAAAC,IAAWH,EAAWC,CAAa;CACnC,IAAIE,KAAM,MACR,MAAUC,MACR,0LAGF;CACD,OACMD;AAAE;;;ACbX,IAAMK,KAAwCE,GAAME,MAClDF,EAAED,QAAQG,EAAEH;AAOd,SAAgBI,EAAoBC,GAAmC;CACrE,OAAOC,OAAOC,OAAOF,EAAMG,MAAM,CAAC,CAACC,KAAKV,CAAO;AACjD;AAQA,SAAgBW,EACdL,GACAM,GACe;CACf,OAAOL,OAAOC,OAAOF,EAAMO,MAAM,CAAC,CAC/BC,QAAQC,MAAMA,EAAEH,YAAYA,CAAO,CAAC,CACpCF,KAAKV,CAAO;AACjB;AAOA,SAAgBgB,EAAoBV,GAAmC;CACrE,OAAOC,OAAOC,OAAOF,EAAMO,MAAM,CAAC,CAACH,KAAKV,CAAO;AACjD;AAQA,SAAgB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