asma-ui-table 1.0.11 → 1.0.13
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/asma-ui-table.es.js +2 -2
- package/dist/src/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/asma-ui-table.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode("._asma-ui-table-styled-table_2axop_1 *,._asma-ui-table-styled-table_2axop_1 *:after,._asma-ui-table-styled-table_2axop_1 *:before{box-sizing:border-box;-webkit-box-sizing:border-box}._asma-ui-table-styled-table_2axop_1 ._table-wrapper_2axop_7{overflow:auto;width:100%}._asma-ui-table-styled-table_2axop_1 ._styled-table_2axop_11{display:table;margin:0;border-collapse:separate;border-spacing:0 .5px;max-width:inherit;width:100%}._asma-ui-table-styled-table_2axop_1 ._styled-table_2axop_11 ._tbody_2axop_19{display:table-row-group;vertical-align:middle;max-width:inherit}._asma-ui-table-styled-table_2axop_1 ._loading-icon_2axop_24{position:absolute;top:50%;left:50%;z-index:10}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30{margin-top:1px;display:table-row;border-style:solid;border-left-width:.5px;border-right-width:.5px;border-top-width:.5px;border-bottom-width:.5px;border-left-color:transparent;border-right-color:transparent;border-top-color:var(--colors-delta-300)}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30:hover{background-color:var(--colors-gama-25);cursor:pointer}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30:hover ._action-cell_2axop_46,._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30:hover ._fixed-cell_2axop_49{background-color:var(--colors-gama-25)}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30:focus{background-color:var(--colors-gama-50)}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30:focus ._action-cell_2axop_46{background-color:var(--colors-gama-50)}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30:focus ._fixed-cell_2axop_49{background-color:var(--colors-gama-50)}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30:focus ._t-cell_2axop_61{border-top:.5px solid var(--colors-gama-500);border-bottom:.5px solid var(--colors-gama-500)}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30:focus ._t-cell_2axop_61:first-child{border-left:.5px solid var(--colors-gama-500)}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30:focus ._t-cell_2axop_61:last-child{border-right:.5px solid var(--colors-gama-500)}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30:focus-visible{outline:none}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30:last-child{border-bottom-color:transparent}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30:first-child{border-top-color:transparent}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30 ._t-cell_2axop_61{overflow-wrap:break-word;vertical-align:middle;font-size:14px;line-height:20px;color:var(--colors-delta-900);display:table-cell;white-space:pre-wrap;padding:0 5px;border-top:.5px solid transparent;border-bottom:.5px solid var(--colors-delta-300)}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30 ._t-cell_2axop_61:first-child{border-left:.5px solid transparent}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30 ._t-cell_2axop_61:last-child{border-right:.5px solid transparent}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30 ._action-cell_2axop_46{height:100%;position:sticky;right:0px;z-index:1}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30 ._action-cell_2axop_46._selected_2axop_107{background-color:var(--colors-gama-50)}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30 ._action-cell_2axop_46._shadowed_2axop_110{box-shadow:-15px 0 15px #0000001a}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30 ._fixed-cell_2axop_49{height:100%;position:sticky;left:0;z-index:1;box-shadow:15px 0 15px #0000001a}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30 ._fixed-cell_2axop_49._selected_2axop_107,._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30._selected_2axop_107{background-color:var(--colors-gama-50)}._asma-ui-table-styled-table_2axop_1 ._t-row_2axop_30._is-loading_2axop_126{opacity:.5}._asma-ui-table-styled-table_2axop_1 ._action-cell-default-background_2axop_129,._asma-ui-table-styled-table_2axop_1 ._fixed-cell-default-background_2axop_132{background-color:#fff}._asma-ui-table-styled-table_2axop_1 tr._no-rows-overlay_2axop_135{height:112px}._asma-ui-table-styled-table_2axop_1 tr._no-rows-overlay_2axop_135 td{font-size:.875rem;line-height:1.25rem;text-align:center;vertical-align:middle}._asma-ui-table-styled-table_2axop_1 ._hide-table-header_2axop_144{height:0px;opacity:0}._asma-ui-table-styled-table_2axop_1 ._show-table-header_2axop_148{position:relative;height:30px;opacity:1}._asma-ui-table-styled-table_2axop_1 ._sortable-column_2axop_153{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}._asma-ui-table-styled-table_2axop_1 ._resizer_2axop_157{position:absolute;top:0;height:100%;right:0;width:5px;background:var(--colors-delta-300);cursor:col-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:none}._asma-ui-table-styled-table_2axop_1 ._resizer_2axop_157._isResizing_2axop_168{background:var(--colors-gama-500);opacity:1}@media (hover: hover){._asma-ui-table-styled-table_2axop_1 ._resizer_2axop_157{opacity:0}._asma-ui-table-styled-table_2axop_1 *:hover>._resizer_2axop_157{opacity:1}}._asma-ui-table-styled-table_2axop_1 ._table-header_2axop_180{display:table-header-group;z-index:49;background-color:#fcfcfd;cursor:default}._asma-ui-table-styled-table_2axop_1 ._table-header_2axop_180 ._t-cell_2axop_61{text-transform:uppercase;background-color:transparent;font-size:10px;font-weight:600;text-align:start;color:var(--colors-delta-500);white-space:pre-wrap;padding:0 5px;border-top:.5px solid var(--colors-delta-300);border-bottom:.5px solid var(--colors-delta-300)}._asma-ui-table-styled-table_2axop_1 ._table-header_2axop_180 ._t-cell_2axop_61._t-cell__actions_2axop_201{position:sticky;right:0;background-color:#fcfcfd}._asma-ui-table-styled-table_2axop_1 ._table-header_2axop_180 ._t-cell_2axop_61._t-cell__actions_2axop_201._shadowed_2axop_110{box-shadow:-15px 0 15px #0000001a}._asma-ui-table-styled-table_2axop_1 ._table-header_2axop_180 ._t-cell_2axop_61._t-cell__fixed_2axop_209{position:sticky;left:0;background-color:#fcfcfd;z-index:160;box-shadow:15px 0 15px #0000001a}._asma-ui-table-styled-table_2axop_1 ._table-header_2axop_180 ._sort-icon_2axop_216{color:var(--colors-delta-800)}._asma-ui-table-styled-table_2axop_1 ._table-footer_2axop_219{display:flex;width:100%;gap:8px;background-color:transparent;flex-direction:row;padding-top:4px;padding-bottom:4px;align-items:center;justify-content:flex-end}._table-pagination_k2a41_1{display:flex;width:-moz-fit-content;width:fit-content;gap:8px;background-color:transparent;flex-direction:row;padding-top:4px;padding-bottom:4px;align-items:center;justify-content:flex-end}._table-pagination__pages-list_k2a41_13{overflow:auto;width:160px;max-height:200px}._table-pagination__pages-list_k2a41_13 ._table-pagination__pages-list__page_k2a41_18{height:36px;position:relative;display:flex;align-items:center;padding-left:40px;cursor:pointer}._table-pagination__pages-list_k2a41_13 ._table-pagination__pages-list__page_k2a41_18:hover{background-color:var(--colors-delta-30)}._table-pagination__pages-list_k2a41_13 ._table-pagination__pages-list__page_k2a41_18._page-selected_k2a41_29{background-color:var(--colors-gama-50)}._table-pagination__pages-list_k2a41_13 ._table-pagination__pages-list__page_k2a41_18 ._check-icon_k2a41_32{position:absolute;left:8px;top:4px;color:var(--colors-gama-500)}._asma-core-ui-button_1r2np_1{border-color:transparent;border-width:1px;border-style:solid}._asma-core-ui-button_1r2np_1._contained_1r2np_27._common_1r2np_27{cursor:pointer;border-radius:4px;border-width:1px;border-style:solid;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:600;transition:all .3s ease-in-out;color:var(--colors-button-contained-common-text-color)!important;background-color:var(--colors-button-contained-common-bg-color)!important;border-color:var(--colors-button-contained-common-border-color)!important}._asma-core-ui-button_1r2np_1._contained_1r2np_27._common_1r2np_27:active{color:var(--colors-button-contained-common-active-text-color)!important;background-color:var(--colors-button-contained-common-active-bg-color)!important;border-color:var(--colors-button-contained-common-active-border-color)!important;outline:none!important}._asma-core-ui-button_1r2np_1._contained_1r2np_27._common_1r2np_27:hover{color:var(--colors-button-contained-common-hover-text-color)!important;background-color:var(--colors-button-contained-common-hover-bg-color)!important;border-color:var(--colors-button-contained-common-hover-border-color)!important}._asma-core-ui-button_1r2np_1._contained_1r2np_27._common_1r2np_27:focus{outline-offset:-2px!important;color:var(--colors-button-contained-common-focused-text-color)!important;background-color:var(--colors-button-contained-common-focused-bg-color)!important;outline:2px solid var(--colors-button-contained-common-focused-border-color)!important;transition:none!important}._asma-core-ui-button_1r2np_1._contained_1r2np_27._common_1r2np_27:focus._asma-core-ui-button_1r2np_1._contained_1r2np_27{box-shadow:inset 0 0 0 2px #fff}._asma-core-ui-button_1r2np_1._contained_1r2np_27._common_1r2np_27:disabled{cursor:default;color:var(--colors-button-contained-common-disabled-text-color)!important;background-color:var(--colors-button-contained-common-disabled-bg-color)!important;border-color:var(--colors-button-contained-common-disabled-border-color)!important}._asma-core-ui-button_1r2np_1._contained_1r2np_27._error_1r2np_84{cursor:pointer;border-radius:4px;border-width:1px;border-style:solid;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:600;transition:all .3s ease-in-out;color:var(--colors-button-contained-error-text-color)!important;background-color:var(--colors-button-contained-error-bg-color)!important;border-color:var(--colors-button-contained-error-border-color)!important}._asma-core-ui-button_1r2np_1._contained_1r2np_27._error_1r2np_84:active{color:var(--colors-button-contained-error-active-text-color)!important;background-color:var(--colors-button-contained-error-active-bg-color)!important;border-color:var(--colors-button-contained-error-active-border-color)!important;outline:none!important}._asma-core-ui-button_1r2np_1._contained_1r2np_27._error_1r2np_84:hover{color:var(--colors-button-contained-error-hover-text-color)!important;background-color:var(--colors-button-contained-error-hover-bg-color)!important;border-color:var(--colors-button-contained-error-hover-border-color)!important}._asma-core-ui-button_1r2np_1._contained_1r2np_27._error_1r2np_84:focus{outline-offset:-2px!important;color:var(--colors-button-contained-error-focused-text-color)!important;background-color:var(--colors-button-contained-error-focused-bg-color)!important;outline:2px solid var(--colors-button-contained-error-focused-border-color)!important;transition:none!important}._asma-core-ui-button_1r2np_1._contained_1r2np_27._error_1r2np_84:focus._asma-core-ui-button_1r2np_1._contained_1r2np_27{box-shadow:inset 0 0 0 2px #fff}._asma-core-ui-button_1r2np_1._contained_1r2np_27._error_1r2np_84:disabled{cursor:default;color:var(--colors-button-contained-error-disabled-text-color)!important;background-color:var(--colors-button-contained-error-disabled-bg-color)!important;border-color:var(--colors-button-contained-error-disabled-border-color)!important}._asma-core-ui-button_1r2np_1._outlined_1r2np_141._common_1r2np_27{cursor:pointer;border-radius:4px;border-width:1px;border-style:solid;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:600;transition:all .3s ease-in-out;color:var(--colors-button-outlined-common-text-color)!important;background-color:var(--colors-button-outlined-common-bg-color)!important;border-color:var(--colors-button-outlined-common-border-color)!important}._asma-core-ui-button_1r2np_1._outlined_1r2np_141._common_1r2np_27:active{color:var(--colors-button-outlined-common-active-text-color)!important;background-color:var(--colors-button-outlined-common-active-bg-color)!important;border-color:var(--colors-button-outlined-common-active-border-color)!important;outline:none!important}._asma-core-ui-button_1r2np_1._outlined_1r2np_141._common_1r2np_27:hover{color:var(--colors-button-outlined-common-hover-text-color)!important;background-color:var(--colors-button-outlined-common-hover-bg-color)!important;border-color:var(--colors-button-outlined-common-hover-border-color)!important}._asma-core-ui-button_1r2np_1._outlined_1r2np_141._common_1r2np_27:focus{outline-offset:-2px!important;color:var(--colors-button-outlined-common-focused-text-color)!important;background-color:var(--colors-button-outlined-common-focused-bg-color)!important;outline:2px solid var(--colors-button-outlined-common-focused-border-color)!important;transition:none!important}._asma-core-ui-button_1r2np_1._outlined_1r2np_141._common_1r2np_27:focus._asma-core-ui-button_1r2np_1._contained_1r2np_27{box-shadow:inset 0 0 0 2px #fff}._asma-core-ui-button_1r2np_1._outlined_1r2np_141._common_1r2np_27:disabled{cursor:default;color:var(--colors-button-outlined-common-disabled-text-color)!important;background-color:var(--colors-button-outlined-common-disabled-bg-color)!important;border-color:var(--colors-button-outlined-common-disabled-border-color)!important}._asma-core-ui-button_1r2np_1._outlined_1r2np_141._error_1r2np_84{cursor:pointer;border-radius:4px;border-width:1px;border-style:solid;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:600;transition:all .3s ease-in-out;color:var(--colors-button-outlined-error-text-color)!important;background-color:var(--colors-button-outlined-error-bg-color)!important;border-color:var(--colors-button-outlined-error-border-color)!important}._asma-core-ui-button_1r2np_1._outlined_1r2np_141._error_1r2np_84:active{color:var(--colors-button-outlined-error-active-text-color)!important;background-color:var(--colors-button-outlined-error-active-bg-color)!important;border-color:var(--colors-button-outlined-error-active-border-color)!important;outline:none!important}._asma-core-ui-button_1r2np_1._outlined_1r2np_141._error_1r2np_84:hover{color:var(--colors-button-outlined-error-hover-text-color)!important;background-color:var(--colors-button-outlined-error-hover-bg-color)!important;border-color:var(--colors-button-outlined-error-hover-border-color)!important}._asma-core-ui-button_1r2np_1._outlined_1r2np_141._error_1r2np_84:focus{outline-offset:-2px!important;color:var(--colors-button-outlined-error-focused-text-color)!important;background-color:var(--colors-button-outlined-error-focused-bg-color)!important;outline:2px solid var(--colors-button-outlined-error-focused-border-color)!important;transition:none!important}._asma-core-ui-button_1r2np_1._outlined_1r2np_141._error_1r2np_84:focus._asma-core-ui-button_1r2np_1._contained_1r2np_27{box-shadow:inset 0 0 0 2px #fff}._asma-core-ui-button_1r2np_1._outlined_1r2np_141._error_1r2np_84:disabled{cursor:default;color:var(--colors-button-outlined-error-disabled-text-color)!important;background-color:var(--colors-button-outlined-error-disabled-bg-color)!important;border-color:var(--colors-button-outlined-error-disabled-border-color)!important}._asma-core-ui-button_1r2np_1._text_1r2np_255._common_1r2np_27{cursor:pointer;border-radius:4px;border-width:1px;border-style:solid;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:600;transition:all .3s ease-in-out;color:var(--colors-button-text-common-text-color)!important;background-color:var(--colors-button-text-common-bg-color)!important;border-color:var(--colors-button-text-common-border-color)!important}._asma-core-ui-button_1r2np_1._text_1r2np_255._common_1r2np_27:active{color:var(--colors-button-text-common-active-text-color)!important;background-color:var(--colors-button-text-common-active-bg-color)!important;border-color:var(--colors-button-text-common-active-border-color)!important;outline:none!important}._asma-core-ui-button_1r2np_1._text_1r2np_255._common_1r2np_27:hover{color:var(--colors-button-text-common-hover-text-color)!important;background-color:var(--colors-button-text-common-hover-bg-color)!important;border-color:var(--colors-button-text-common-hover-border-color)!important}._asma-core-ui-button_1r2np_1._text_1r2np_255._common_1r2np_27:focus{outline-offset:-2px!important;color:var(--colors-button-text-common-focused-text-color)!important;background-color:var(--colors-button-text-common-focused-bg-color)!important;outline:2px solid var(--colors-button-text-common-focused-border-color)!important;transition:none!important}._asma-core-ui-button_1r2np_1._text_1r2np_255._common_1r2np_27:focus._asma-core-ui-button_1r2np_1._contained_1r2np_27{box-shadow:inset 0 0 0 2px #fff}._asma-core-ui-button_1r2np_1._text_1r2np_255._common_1r2np_27:disabled{cursor:default;color:var(--colors-button-text-common-disabled-text-color)!important;background-color:var(--colors-button-text-common-disabled-bg-color)!important;border-color:var(--colors-button-text-common-disabled-border-color)!important}._asma-core-ui-button_1r2np_1._text_1r2np_255._error_1r2np_84{cursor:pointer;border-radius:4px;border-width:1px;border-style:solid;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:600;transition:all .3s ease-in-out;color:var(--colors-button-text-error-text-color)!important;background-color:var(--colors-button-text-error-bg-color)!important;border-color:var(--colors-button-text-error-border-color)!important}._asma-core-ui-button_1r2np_1._text_1r2np_255._error_1r2np_84:active{color:var(--colors-button-text-error-active-text-color)!important;background-color:var(--colors-button-text-error-active-bg-color)!important;border-color:var(--colors-button-text-error-active-border-color)!important;outline:none!important}._asma-core-ui-button_1r2np_1._text_1r2np_255._error_1r2np_84:hover{color:var(--colors-button-text-error-hover-text-color)!important;background-color:var(--colors-button-text-error-hover-bg-color)!important;border-color:var(--colors-button-text-error-hover-border-color)!important}._asma-core-ui-button_1r2np_1._text_1r2np_255._error_1r2np_84:focus{outline-offset:-2px!important;color:var(--colors-button-text-error-focused-text-color)!important;background-color:var(--colors-button-text-error-focused-bg-color)!important;outline:2px solid var(--colors-button-text-error-focused-border-color)!important;transition:none!important}._asma-core-ui-button_1r2np_1._text_1r2np_255._error_1r2np_84:focus._asma-core-ui-button_1r2np_1._contained_1r2np_27{box-shadow:inset 0 0 0 2px #fff}._asma-core-ui-button_1r2np_1._text_1r2np_255._error_1r2np_84:disabled{cursor:default;color:var(--colors-button-text-error-disabled-text-color)!important;background-color:var(--colors-button-text-error-disabled-bg-color)!important;border-color:var(--colors-button-text-error-disabled-border-color)!important}._asma-core-ui-button_1r2np_1._textGray_1r2np_369._common_1r2np_27{cursor:pointer;border-radius:4px;border-width:1px;border-style:solid;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:600;transition:all .3s ease-in-out;color:var(--colors-button-textGray-common-text-color)!important;background-color:var(--colors-button-textGray-common-bg-color)!important;border-color:var(--colors-button-textGray-common-border-color)!important}._asma-core-ui-button_1r2np_1._textGray_1r2np_369._common_1r2np_27:active{color:var(--colors-button-textGray-common-active-text-color)!important;background-color:var(--colors-button-textGray-common-active-bg-color)!important;border-color:var(--colors-button-textGray-common-active-border-color)!important;outline:none!important}._asma-core-ui-button_1r2np_1._textGray_1r2np_369._common_1r2np_27:hover{color:var(--colors-button-textGray-common-hover-text-color)!important;background-color:var(--colors-button-textGray-common-hover-bg-color)!important;border-color:var(--colors-button-textGray-common-hover-border-color)!important}._asma-core-ui-button_1r2np_1._textGray_1r2np_369._common_1r2np_27:focus{outline-offset:-2px!important;color:var(--colors-button-textGray-common-focused-text-color)!important;background-color:var(--colors-button-textGray-common-focused-bg-color)!important;outline:2px solid var(--colors-button-textGray-common-focused-border-color)!important;transition:none!important}._asma-core-ui-button_1r2np_1._textGray_1r2np_369._common_1r2np_27:focus._asma-core-ui-button_1r2np_1._contained_1r2np_27{box-shadow:inset 0 0 0 2px #fff}._asma-core-ui-button_1r2np_1._textGray_1r2np_369._common_1r2np_27:disabled{cursor:default;color:var(--colors-button-textGray-common-disabled-text-color)!important;background-color:var(--colors-button-textGray-common-disabled-bg-color)!important;border-color:var(--colors-button-textGray-common-disabled-border-color)!important}._asma-core-ui-button_1r2np_1._textWhite_1r2np_426._common_1r2np_27{cursor:pointer;border-radius:4px;border-width:1px;border-style:solid;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:600;transition:all .3s ease-in-out;color:var(--colors-button-textWhite-common-text-color)!important;background-color:var(--colors-button-textWhite-common-bg-color)!important;border-color:var(--colors-button-textWhite-common-border-color)!important}._asma-core-ui-button_1r2np_1._textWhite_1r2np_426._common_1r2np_27:active{color:var(--colors-button-textWhite-common-active-text-color)!important;background-color:var(--colors-button-textWhite-common-active-bg-color)!important;border-color:var(--colors-button-textWhite-common-active-border-color)!important;outline:none!important}._asma-core-ui-button_1r2np_1._textWhite_1r2np_426._common_1r2np_27:hover{color:var(--colors-button-textWhite-common-hover-text-color)!important;background-color:var(--colors-button-textWhite-common-hover-bg-color)!important;border-color:var(--colors-button-textWhite-common-hover-border-color)!important}._asma-core-ui-button_1r2np_1._textWhite_1r2np_426._common_1r2np_27:focus{outline-offset:-2px!important;color:var(--colors-button-textWhite-common-focused-text-color)!important;background-color:var(--colors-button-textWhite-common-focused-bg-color)!important;outline:2px solid var(--colors-button-textWhite-common-focused-border-color)!important;transition:none!important}._asma-core-ui-button_1r2np_1._textWhite_1r2np_426._common_1r2np_27:focus._asma-core-ui-button_1r2np_1._contained_1r2np_27{box-shadow:inset 0 0 0 2px #fff}._asma-core-ui-button_1r2np_1._textWhite_1r2np_426._common_1r2np_27:disabled{cursor:default;color:var(--colors-button-textWhite-common-disabled-text-color)!important;background-color:var(--colors-button-textWhite-common-disabled-bg-color)!important;border-color:var(--colors-button-textWhite-common-disabled-border-color)!important}._asma-core-ui-button_1r2np_1._medium_1r2np_69{height:38px;padding-left:4px;padding-right:4px}._asma-core-ui-button_1r2np_1._small_1r2np_74{height:32px;padding-left:4px;padding-right:4px}._asma-core-ui-button_1r2np_1._large_1r2np_79{height:40px;padding-left:8px;padding-right:8px}")),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
-
import*as e from"react";import t,{
|
|
2
|
+
import*as e from"react";import t,{useMemo as n,useLayoutEffect as o,useEffect as r,useRef as l,useCallback as i,useState as a,createContext as s,useContext as u,memo as d,useReducer as c,Fragment as g}from"react";import{Skeleton as p,Tooltip as f,Popover as h,Checkbox as m,MenuItem as v}from"@mui/material";import{unstable_batchedUpdates as b,createPortal as w}from"react-dom";const y=e=>void 0!==e.component,x="select",C="expand-column-id",S="actions",R="dnd-handle";var _,E={exports:{}},D={};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -38,4 +38,4 @@ import*as e from"react";import t,{useLayoutEffect as n,useEffect as o,useMemo as
|
|
|
38
38
|
*
|
|
39
39
|
* @license MIT
|
|
40
40
|
*/
|
|
41
|
-
function Ee(t,n){return t?function(e){return function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(e)||"function"==typeof e||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(e)}(t)?e.createElement(t,n):t:null}const De={"asma-ui-table-styled-table":"_asma-ui-table-styled-table_2axop_1","table-wrapper":"_table-wrapper_2axop_7","styled-table":"_styled-table_2axop_11",tbody:"_tbody_2axop_19","loading-icon":"_loading-icon_2axop_24","t-row":"_t-row_2axop_30","action-cell":"_action-cell_2axop_46","fixed-cell":"_fixed-cell_2axop_49","t-cell":"_t-cell_2axop_61",selected:"_selected_2axop_107",shadowed:"_shadowed_2axop_110","is-loading":"_is-loading_2axop_126","action-cell-default-background":"_action-cell-default-background_2axop_129","fixed-cell-default-background":"_fixed-cell-default-background_2axop_132","no-rows-overlay":"_no-rows-overlay_2axop_135","hide-table-header":"_hide-table-header_2axop_144","show-table-header":"_show-table-header_2axop_148","sortable-column":"_sortable-column_2axop_153",resizer:"_resizer_2axop_157",isResizing:"_isResizing_2axop_168","table-header":"_table-header_2axop_180","t-cell__actions":"_t-cell__actions_2axop_201","t-cell__fixed":"_t-cell__fixed_2axop_209","sort-icon":"_sort-icon_2axop_216","table-footer":"_table-footer_2axop_219"};function Fe(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Fe(e[t]))&&(o&&(o+=" "),o+=n);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function Me(){for(var e,t,n=0,o="";n<arguments.length;)(e=arguments[n++])&&(t=Fe(e))&&(o&&(o+=" "),o+=t);return o}const Ie=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ne(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Pe(e){return"nodeType"in e}function Oe(e){var t,n;return e?Ne(e)?e:Pe(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function Ve(e){const{Document:t}=Oe(e);return e instanceof t}function ke(e){return!Ne(e)&&e instanceof Oe(e).HTMLElement}function Ae(e){return e instanceof Oe(e).SVGElement}function je(e){return e?Ne(e)?e.document:Pe(e)?Ve(e)?e:ke(e)||Ae(e)?e.ownerDocument:document:document:document}const ze=Ie?n:o;function Le(e){const t=l(e);return ze((()=>{t.current=e})),i((function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)}),[])}function Te(e,t){void 0===t&&(t=[e]);const n=l(e);return ze((()=>{n.current!==e&&(n.current=e)}),t),n}function He(e,t){const n=l();return r((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function Ge(e){const t=Le(e),n=l(null),o=i((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,o]}function Be(e){const t=l();return o((()=>{t.current=e}),[e]),t.current}let Ue={};function $e(e,t){return r((()=>{if(t)return t;const n=null==Ue[e]?0:Ue[e]+1;return Ue[e]=n,e+"-"+n}),[e,t])}function qe(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce(((t,n)=>{const o=Object.entries(n);for(const[n,r]of o){const o=t[n];null!=o&&(t[n]=o+e*r)}return t}),{...t})}}const We=qe(1),Xe=qe(-1);function Ye(e){if(!e)return!1;const{KeyboardEvent:t}=Oe(e.target);return t&&e instanceof t}function Ke(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Oe(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Je=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Je.Translate.toString(e),Je.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),Ze="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Qe(e){return e.matches(Ze)?e:e.querySelector(Ze)}const et={display:"none"};function tt(e){let{id:n,value:o}=e;return t.createElement("div",{id:n,style:et},o)}function nt(e){let{id:n,announcement:o,ariaLiveType:r="assertive"}=e;return t.createElement("div",{id:n,style:{position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},o)}const ot=s(null);const rt={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},lt={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function it(e){let{announcements:n=lt,container:l,hiddenTextDescribedById:s,screenReaderInstructions:u=rt}=e;const{announce:d,announcement:g}=function(){const[e,t]=a("");return{announce:i((e=>{null!=e&&t(e)}),[]),announcement:e}}(),p=$e("DndLiveRegion"),[f,h]=a(!1);if(o((()=>{h(!0)}),[]),function(e){const t=c(ot);o((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}(r((()=>({onDragStart(e){let{active:t}=e;d(n.onDragStart({active:t}))},onDragMove(e){let{active:t,over:o}=e;n.onDragMove&&d(n.onDragMove({active:t,over:o}))},onDragOver(e){let{active:t,over:o}=e;d(n.onDragOver({active:t,over:o}))},onDragEnd(e){let{active:t,over:o}=e;d(n.onDragEnd({active:t,over:o}))},onDragCancel(e){let{active:t,over:o}=e;d(n.onDragCancel({active:t,over:o}))}})),[d,n])),!f)return null;const m=t.createElement(t.Fragment,null,t.createElement(tt,{id:s,value:u.draggable}),t.createElement(nt,{id:p,announcement:g}));return l?w(m,l):m}var at,st;function ut(){}(st=at||(at={})).DragStart="dragStart",st.DragMove="dragMove",st.DragEnd="dragEnd",st.DragCancel="dragCancel",st.DragOver="dragOver",st.RegisterDroppable="registerDroppable",st.SetDroppableDisabled="setDroppableDisabled",st.UnregisterDroppable="unregisterDroppable";const dt=Object.freeze({x:0,y:0});function ct(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function gt(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function pt(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function ft(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const ht=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=ft(t,t.left,t.top),l=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=ct(ft(o),r);l.push({id:t,data:{droppableContainer:e,value:n}})}}return l.sort(gt)};function mt(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),i=r-o,a=l-n;if(o<r&&n<l){const n=t.width*t.height,o=e.width*e.height,r=i*a;return Number((r/(n+o-r)).toFixed(4))}return 0}const vt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const e of o){const{id:o}=e,l=n.get(o);if(l){const n=mt(l,t);n>0&&r.push({id:o,data:{droppableContainer:e,value:n}})}}return r.sort(pt)};function bt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:dt}function wt(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce(((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const yt=wt(1);const xt={ignoreTransform:!1};function Ct(e,t){void 0===t&&(t=xt);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:o}=Oe(e).getComputedStyle(e);t&&(n=function(e,t,n){const o=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!o)return e;const{scaleX:r,scaleY:l,x:i,y:a}=o,s=e.left-i-(1-r)*parseFloat(n),u=e.top-a-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?e.width/r:e.width,c=l?e.height/l:e.height;return{width:d,height:c,top:u,right:s+d,bottom:u+c,left:s}}(n,t,o))}const{top:o,left:r,width:l,height:i,bottom:a,right:s}=n;return{top:o,left:r,width:l,height:i,bottom:a,right:s}}function St(e){return Ct(e,{ignoreTransform:!0})}function Rt(e,t){const n=[];return e?function o(r){if(null!=t&&n.length>=t||!r)return n;if(Ve(r)&&null!=r.scrollingElement&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!ke(r)||Ae(r)||n.includes(r))return n;const l=Oe(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=Oe(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const o=t[e];return"string"==typeof o&&n.test(o)}))}(r,l)&&n.push(r),function(e,t){return void 0===t&&(t=Oe(e).getComputedStyle(e)),"fixed"===t.position}(r,l)?n:o(r.parentNode)}(e):n}function _t(e){const[t]=Rt(e,1);return t??null}function Et(e){return Ie&&e?Ne(e)?e:Pe(e)?Ve(e)||e===je(e).scrollingElement?window:ke(e)?e:null:null:null}function Dt(e){return Ne(e)?e.scrollX:e.scrollLeft}function Ft(e){return Ne(e)?e.scrollY:e.scrollTop}function Mt(e){return{x:Dt(e),y:Ft(e)}}var It;function Nt(e){return!(!Ie||!e)&&e===document.scrollingElement}function Pt(e){const t={x:0,y:0},n=Nt(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(It||(It={}));const Ot={x:.2,y:.2};function Vt(e,t,n,o,r){let{top:l,left:i,right:a,bottom:s}=n;void 0===o&&(o=10),void 0===r&&(r=Ot);const{isTop:u,isBottom:d,isLeft:c,isRight:g}=Pt(e),p={x:0,y:0},f={x:0,y:0},h=t.height*r.y,m=t.width*r.x;return!u&&l<=t.top+h?(p.y=It.Backward,f.y=o*Math.abs((t.top+h-l)/h)):!d&&s>=t.bottom-h&&(p.y=It.Forward,f.y=o*Math.abs((t.bottom-h-s)/h)),!g&&a>=t.right-m?(p.x=It.Forward,f.x=o*Math.abs((t.right-m-a)/m)):!c&&i<=t.left+m&&(p.x=It.Backward,f.x=o*Math.abs((t.left+m-i)/m)),{direction:p,speed:f}}function kt(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function At(e){return e.reduce(((e,t)=>We(e,Mt(t))),dt)}const jt=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+Dt(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+Ft(t)),0)}]];class zt{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Rt(t),o=At(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of jt)for(const l of t)Object.defineProperty(this,l,{get:()=>{const t=r(n),i=o[e]-t;return this.rect[l]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Lt{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var o;null==(o=this.target)||o.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Tt(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var Ht,Gt;function Bt(e){e.preventDefault()}function Ut(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Ht||(Ht={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(Gt||(Gt={}));const $t={start:[Gt.Space,Gt.Enter],cancel:[Gt.Esc],end:[Gt.Space,Gt.Enter]},qt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Gt.Right:return{...n,x:n.x+25};case Gt.Left:return{...n,x:n.x-25};case Gt.Down:return{...n,y:n.y+25};case Gt.Up:return{...n,y:n.y-25}}};class Wt{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Lt(je(t)),this.windowListeners=new Lt(Oe(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ht.Resize,this.handleCancel),this.windowListeners.add(Ht.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(Ht.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=Ct),!e)return;const{top:n,left:o,bottom:r,right:l}=t(e);_t(e)&&(r<=0||l<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(dt)}handleKeyDown(e){if(Ye(e)){const{active:t,context:n,options:o}=this.props,{keyboardCodes:r=$t,coordinateGetter:l=qt,scrollBehavior:i="smooth"}=o,{code:a}=e;if(r.end.includes(a))return void this.handleEnd(e);if(r.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:s}=n.current,u=s?{x:s.left,y:s.top}:dt;this.referenceCoordinates||(this.referenceCoordinates=u);const d=l(e,{active:t,context:n.current,currentCoordinates:u});if(d){const t=Xe(d,u),o={x:0,y:0},{scrollableAncestors:r}=n.current;for(const n of r){const r=e.code,{isTop:l,isRight:a,isLeft:s,isBottom:u,maxScroll:c,minScroll:g}=Pt(n),p=kt(n),f={x:Math.min(r===Gt.Right?p.right-p.width/2:p.right,Math.max(r===Gt.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(r===Gt.Down?p.bottom-p.height/2:p.bottom,Math.max(r===Gt.Down?p.top:p.top+p.height/2,d.y))},h=r===Gt.Right&&!a||r===Gt.Left&&!s,m=r===Gt.Down&&!u||r===Gt.Up&&!l;if(h&&f.x!==d.x){const e=n.scrollLeft+t.x,l=r===Gt.Right&&e<=c.x||r===Gt.Left&&e>=g.x;if(l&&!t.y)return void n.scrollTo({left:e,behavior:i});o.x=l?n.scrollLeft-e:r===Gt.Right?n.scrollLeft-c.x:n.scrollLeft-g.x,o.x&&n.scrollBy({left:-o.x,behavior:i});break}if(m&&f.y!==d.y){const e=n.scrollTop+t.y,l=r===Gt.Down&&e<=c.y||r===Gt.Up&&e>=g.y;if(l&&!t.x)return void n.scrollTo({top:e,behavior:i});o.y=l?n.scrollTop-e:r===Gt.Down?n.scrollTop-c.y:n.scrollTop-g.y,o.y&&n.scrollBy({top:-o.y,behavior:i});break}}this.handleMove(e,We(Xe(d,this.referenceCoordinates),o))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Xt(e){return!(!e||!("distance"in e))}function Yt(e){return!(!e||!("delay"in e))}Wt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=$t,onActivation:r}=t,{active:l}=n;const{code:i}=e.nativeEvent;if(o.start.includes(i)){const t=l.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==r||r({event:e.nativeEvent}),!0)}return!1}}];class Kt{constructor(e,t,n){var o;void 0===n&&(n=function(e){const{EventTarget:t}=Oe(e);return e instanceof t?e:je(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:r}=e,{target:l}=r;this.props=e,this.events=t,this.document=je(l),this.documentListeners=new Lt(this.document),this.listeners=new Lt(n),this.windowListeners=new Lt(Oe(l)),this.initialCoordinates=null!=(o=Ke(r))?o:dt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(Ht.Resize,this.handleCancel),this.windowListeners.add(Ht.DragStart,Bt),this.windowListeners.add(Ht.VisibilityChange,this.handleCancel),this.windowListeners.add(Ht.ContextMenu,Bt),this.documentListeners.add(Ht.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Yt(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(Xt(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Ht.Click,Ut,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ht.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:o,props:r}=this,{onMove:l,options:{activationConstraint:i}}=r;if(!o)return;const a=null!=(t=Ke(e))?t:dt,s=Xe(o,a);if(!n&&i){if(Xt(i)){if(null!=i.tolerance&&Tt(s,i.tolerance))return this.handleCancel();if(Tt(s,i.distance))return this.handleStart()}return Yt(i)&&Tt(s,i.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),l(a)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===Gt.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Jt={move:{name:"pointermove"},end:{name:"pointerup"}};class Zt extends Kt{constructor(e){const{event:t}=e,n=je(t.target);super(e,Jt,n)}}Zt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||0!==n.button)&&(null==o||o({event:n}),!0)}}];const Qt={move:{name:"mousemove"},end:{name:"mouseup"}};var en;!function(e){e[e.RightClick=2]="RightClick"}(en||(en={}));(class extends Kt{constructor(e){super(e,Qt,je(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==en.RightClick&&(null==o||o({event:n}),!0)}}];const tn={move:{name:"touchmove"},end:{name:"touchend"}};var nn,on;function rn(e){let{acceleration:t,activator:n=nn.Pointer,canScroll:a,draggingRect:s,enabled:u,interval:d=5,order:c=on.TreeOrder,pointerCoordinates:g,scrollableAncestors:p,scrollableAncestorRects:f,delta:h,threshold:m}=e;const v=function(e){let{delta:t,disabled:n}=e;const o=Be(t);return He((e=>{if(n||!o||!e)return ln;const r={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[It.Backward]:e.x[It.Backward]||-1===r.x,[It.Forward]:e.x[It.Forward]||1===r.x},y:{[It.Backward]:e.y[It.Backward]||-1===r.y,[It.Forward]:e.y[It.Forward]||1===r.y}}}),[n,t,o])}({delta:h,disabled:!u}),[b,w]=function(){const e=l(null);return[i(((t,n)=>{e.current=setInterval(t,n)}),[]),i((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),y=l({x:0,y:0}),x=l({x:0,y:0}),C=r((()=>{switch(n){case nn.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case nn.DraggableRect:return s}}),[n,s,g]),S=l(null),R=i((()=>{const e=S.current;if(!e)return;const t=y.current.x*x.current.x,n=y.current.y*x.current.y;e.scrollBy(t,n)}),[]),_=r((()=>c===on.TreeOrder?[...p].reverse():p),[c,p]);o((()=>{if(u&&p.length&&C){for(const e of _){if(!1===(null==a?void 0:a(e)))continue;const n=p.indexOf(e),o=f[n];if(!o)continue;const{direction:r,speed:l}=Vt(e,o,C,t,m);for(const e of["x","y"])v[e][r[e]]||(l[e]=0,r[e]=0);if(l.x>0||l.y>0)return w(),S.current=e,b(R,d),y.current=l,void(x.current=r)}y.current={x:0,y:0},x.current={x:0,y:0},w()}else w()}),[t,R,a,w,u,d,JSON.stringify(C),JSON.stringify(v),b,p,_,f,JSON.stringify(m)])}(class extends Kt{constructor(e){super(e,tn)}static setup(){return window.addEventListener(tn.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(tn.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return!(r.length>1)&&(null==o||o({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(nn||(nn={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(on||(on={}));const ln={x:{[It.Backward]:!1,[It.Forward]:!1},y:{[It.Backward]:!1,[It.Forward]:!1}};var an,sn;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(an||(an={})),(sn||(sn={})).Optimized="optimized";const un=new Map;function dn(e,t){return He((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function cn(e){let{callback:t,disabled:n}=e;const l=Le(t),i=r((()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:e}=window;return new e(l)}),[n]);return o((()=>()=>null==i?void 0:i.disconnect()),[i]),i}function gn(e){return new zt(Ct(e),e)}function pn(e,t,n){void 0===t&&(t=gn);const[l,i]=d((function(o){if(!e)return null;var r;if(!1===e.isConnected)return null!=(r=o??n)?r:null;const l=t(e);return JSON.stringify(o)===JSON.stringify(l)?o:l}),null),a=function(e){let{callback:t,disabled:n}=e;const l=Le(t),i=r((()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:e}=window;return new e(l)}),[l,n]);return o((()=>()=>null==i?void 0:i.disconnect()),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:o}=n;if("childList"===t&&o instanceof HTMLElement&&o.contains(e)){i();break}}}}),s=cn({callback:i});return ze((()=>{i(),e?(null==s||s.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==a||a.disconnect())}),[e]),l}const fn=[];function hn(e,t){void 0===t&&(t=[]);const n=l(null);return o((()=>{n.current=null}),t),o((()=>{const t=e!==dt;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?Xe(e,n.current):dt}function mn(e){return r((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const vn=[];function bn(e){let{measure:t}=e;const[n,o]=a(null),l=cn({callback:i((e=>{for(const{target:n}of e)if(ke(n)){o((e=>{const o=t(n);return e?{...e,width:o.width,height:o.height}:o}));break}}),[t])}),s=i((e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ke(t)?t:e}(e);null==l||l.disconnect(),n&&(null==l||l.observe(n)),o(n?t(n):null)}),[t,l]),[u,d]=Ge(s);return r((()=>({nodeRef:u,rect:n,setRef:d})),[n,u,d])}const wn=[{sensor:Zt,options:{}},{sensor:Wt,options:{}}],yn={current:{}},xn={draggable:{measure:St},droppable:{measure:St,strategy:an.WhileDragging,frequency:sn.Optimized},dragOverlay:{measure:Ct}};class Cn extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Sn={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Cn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ut},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:xn,measureDroppableContainers:ut,windowRect:null,measuringScheduled:!1},Rn=s({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ut,draggableNodes:new Map,over:null,measureDroppableContainers:ut}),_n=s(Sn);function En(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Cn}}}function Dn(e,t){switch(t.type){case at.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case at.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case at.DragEnd:case at.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case at.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new Cn(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case at.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,l=e.droppable.containers.get(n);if(!l||o!==l.key)return e;const i=new Cn(e.droppable.containers);return i.set(n,{...l,disabled:r}),{...e,droppable:{...e.droppable,containers:i}}}case at.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const l=new Cn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Fn(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:l}=c(Rn),i=Be(r),a=Be(null==n?void 0:n.id);return o((()=>{if(!t&&!r&&i&&null!=a){if(!Ye(i)||document.activeElement===i.target)return;const e=l.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=Qe(e);if(t){t.focus();break}}}))}}),[r,t,l,a,i]),null}const Mn=s({...dt,scaleX:1,scaleY:1});var In;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(In||(In={}));const Nn=u((function(e){var n,s,u,c;let{id:g,accessibility:p,autoScroll:f=!0,children:h,sensors:m=wn,collisionDetection:v=vt,measuring:w,modifiers:y,...x}=e;const C=d(Dn,void 0,En),[S,R]=C,[_,E]=function(){const[e]=a((()=>new Set)),t=i((t=>(e.add(t),()=>e.delete(t))),[e]);return[i((t=>{let{type:n,event:o}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,o)}))}),[e]),t]}(),[D,F]=a(In.Uninitialized),M=D===In.Initialized,{draggable:{active:I,nodes:N,translate:P},droppable:{containers:O}}=S,V=I?N.get(I):null,k=l({initial:null,translated:null}),A=r((()=>{var e;return null!=I?{id:I,data:null!=(e=null==V?void 0:V.data)?e:yn,rect:k}:null}),[I,V]),j=l(null),[z,L]=a(null),[T,H]=a(null),G=Te(x,Object.values(x)),B=$e("DndDescribedBy",g),U=r((()=>O.getEnabled()),[O]),$=function(e){return r((()=>({draggable:{...xn.draggable,...null==e?void 0:e.draggable},droppable:{...xn.droppable,...null==e?void 0:e.droppable},dragOverlay:{...xn.dragOverlay,...null==e?void 0:e.dragOverlay}})),[null==e?void 0:e.draggable,null==e?void 0:e.droppable,null==e?void 0:e.dragOverlay])}(w),{droppableRects:q,measureDroppableContainers:W,measuringScheduled:X}=function(e,t){let{dragging:n,dependencies:r,config:s}=t;const[u,d]=a(null),{frequency:c,measure:g,strategy:p}=s,f=l(e),h=function(){switch(p){case an.Always:return!1;case an.BeforeDragging:return n;default:return!n}}(),m=Te(h),v=i((function(e){void 0===e&&(e=[]),!m.current&&d((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[m]),b=l(null),w=He((t=>{if(h&&!n)return un;if(!t||t===un||f.current!==e||null!=u){const t=new Map;for(let n of e){if(!n)continue;if(u&&u.length>0&&!u.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,o=e?new zt(g(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t}),[e,u,n,h,g]);return o((()=>{f.current=e}),[e]),o((()=>{h||v()}),[n,h]),o((()=>{u&&u.length>0&&d(null)}),[JSON.stringify(u)]),o((()=>{h||"number"!=typeof c||null!==b.current||(b.current=setTimeout((()=>{v(),b.current=null}),c))}),[c,h,v,...r]),{droppableRects:w,measureDroppableContainers:v,measuringScheduled:null!=u}}(U,{dragging:M,dependencies:[P.x,P.y],config:$.droppable}),Y=function(e,t){const n=null!==t?e.get(t):void 0,o=n?n.node.current:null;return He((e=>{var n;return null===t?null:null!=(n=o??e)?n:null}),[o,t])}(N,I),K=r((()=>T?Ke(T):null),[T]),J=function(){const e=!1===(null==z?void 0:z.autoScrollEnabled),t="object"==typeof f?!1===f.enabled:!1===f,n=M&&!e&&!t;return"object"==typeof f?{...f,enabled:n}:{enabled:n}}(),Z=function(e,t){return dn(e,t)}(Y,$.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:r=!0}=e;const i=l(!1),{x:a,y:s}="boolean"==typeof r?{x:r,y:r}:r;ze((()=>{if(!a&&!s||!t)return void(i.current=!1);if(i.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=bt(n(e),o);if(a||(r.x=0),s||(r.y=0),i.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=_t(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,a,s,o,n])}({activeNode:I?N.get(I):null,config:J.layoutShiftCompensation,initialRect:Z,measure:$.draggable.measure});const Q=pn(Y,$.draggable.measure,Z),ee=pn(Y?Y.parentElement:null),te=l({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ne=O.getNodeFor(null==(n=te.current.over)?void 0:n.id),oe=bn({measure:$.dragOverlay.measure}),re=null!=(s=oe.nodeRef.current)?s:Y,le=M?null!=(u=oe.rect)?u:Q:null,ie=!(!oe.nodeRef.current||!oe.rect),ae=function(e){return bt(e,dn(e))}(ie?null:Q),se=mn(re?Oe(re):null),ue=function(e){const t=l(e),n=He((n=>e?n&&n!==fn&&e&&t.current&&e.parentNode===t.current.parentNode?n:Rt(e):fn),[e]);return o((()=>{t.current=e}),[e]),n}(M?ne??Y:null),de=function(e,t){void 0===t&&(t=Ct);const[n]=e,o=mn(n?Oe(n):null),[r,l]=d((function(){return e.length?e.map((e=>Nt(e)?o:new zt(t(e),e))):vn}),vn),i=cn({callback:l});return e.length>0&&r===vn&&l(),ze((()=>{e.length?e.forEach((e=>null==i?void 0:i.observe(e))):(null==i||i.disconnect(),l())}),[e]),r}(ue),ce=function(e,t){let{transform:n,...o}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...o})),n):n}(y,{transform:{x:P.x-ae.x,y:P.y-ae.y,scaleX:1,scaleY:1},activatorEvent:T,active:A,activeNodeRect:Q,containerNodeRect:ee,draggingNodeRect:le,over:te.current.over,overlayNodeRect:oe.rect,scrollableAncestors:ue,scrollableAncestorRects:de,windowRect:se}),ge=K?We(K,P):null,pe=function(e){const[t,n]=a(null),s=l(e),u=i((e=>{const t=Et(e.target);t&&n((e=>e?(e.set(t,Mt(t)),new Map(e)):null))}),[]);return o((()=>{const t=s.current;if(e!==t){o(t);const r=e.map((e=>{const t=Et(e);return t?(t.addEventListener("scroll",u,{passive:!0}),[t,Mt(t)]):null})).filter((e=>null!=e));n(r.length?new Map(r):null),s.current=e}return()=>{o(e),o(t)};function o(e){e.forEach((e=>{const t=Et(e);null==t||t.removeEventListener("scroll",u)}))}}),[u,e]),r((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>We(e,t)),dt):At(e):dt),[e,t])}(ue),fe=hn(pe),he=hn(pe,[Q]),me=We(ce,fe),ve=le?yt(le,ce):null,be=A&&ve?v({active:A,collisionRect:ve,droppableRects:q,droppableContainers:U,pointerCoordinates:ge}):null,we=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(be,"id"),[ye,xe]=a(null),Ce=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ie?ce:We(ce,he),null!=(c=null==ye?void 0:ye.rect)?c:null,Q),Se=i(((e,t)=>{let{sensor:n,options:o}=t;if(null==j.current)return;const r=N.get(j.current);if(!r)return;const l=e.nativeEvent,i=new n({active:j.current,activeNode:r,event:l,options:o,context:te,onStart(e){const t=j.current;if(null==t)return;const n=N.get(t);if(!n)return;const{onDragStart:o}=G.current,r={active:{id:t,data:n.data,rect:k}};b((()=>{null==o||o(r),F(In.Initializing),R({type:at.DragStart,initialCoordinates:e,active:t}),_({type:"onDragStart",event:r})}))},onMove(e){R({type:at.DragMove,coordinates:e})},onEnd:a(at.DragEnd),onCancel:a(at.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:r}=te.current;let i=null;if(t&&r){const{cancelDrop:a}=G.current;i={activatorEvent:l,active:t,collisions:n,delta:r,over:o},e===at.DragEnd&&"function"==typeof a&&await Promise.resolve(a(i))&&(e=at.DragCancel)}j.current=null,b((()=>{R({type:e}),F(In.Uninitialized),xe(null),L(null),H(null);const t=e===at.DragEnd?"onDragEnd":"onDragCancel";if(i){const e=G.current[t];null==e||e(i),_({type:t,event:i})}}))}}b((()=>{L(i),H(e.nativeEvent)}))}),[N]),Re=function(e,t){return r((()=>e.reduce(((e,n)=>{const{sensor:o}=n;return[...e,...o.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(m,i(((e,t)=>(n,o)=>{const r=n.nativeEvent,l=N.get(o);if(null!==j.current||!l||r.dndKit||r.defaultPrevented)return;const i={active:l};!0===e(n,t.options,i)&&(r.dndKit={capturedBy:t.sensor},j.current=o,Se(n,t))}),[N,Se]));(function(e){o((()=>{if(!Ie)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))})(m),ze((()=>{Q&&D===In.Initializing&&F(In.Initialized)}),[Q,D]),o((()=>{const{onDragMove:e}=G.current,{active:t,activatorEvent:n,collisions:o,over:r}=te.current;if(!t||!n)return;const l={active:t,activatorEvent:n,collisions:o,delta:{x:me.x,y:me.y},over:r};b((()=>{null==e||e(l),_({type:"onDragMove",event:l})}))}),[me.x,me.y]),o((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:o,scrollAdjustedTranslate:r}=te.current;if(!e||null==j.current||!t||!r)return;const{onDragOver:l}=G.current,i=o.get(we),a=i&&i.rect.current?{id:i.id,rect:i.rect.current,data:i.data,disabled:i.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:r.x,y:r.y},over:a};b((()=>{xe(a),null==l||l(s),_({type:"onDragOver",event:s})}))}),[we]),ze((()=>{te.current={activatorEvent:T,active:A,activeNode:Y,collisionRect:ve,collisions:be,droppableRects:q,draggableNodes:N,draggingNode:re,draggingNodeRect:le,droppableContainers:O,over:ye,scrollableAncestors:ue,scrollAdjustedTranslate:me},k.current={initial:le,translated:ve}}),[A,Y,be,ve,N,re,le,q,O,ye,ue,me]),rn({...J,delta:P,draggingRect:ve,pointerCoordinates:ge,scrollableAncestors:ue,scrollableAncestorRects:de});const _e=r((()=>({active:A,activeNode:Y,activeNodeRect:Q,activatorEvent:T,collisions:be,containerNodeRect:ee,dragOverlay:oe,draggableNodes:N,droppableContainers:O,droppableRects:q,over:ye,measureDroppableContainers:W,scrollableAncestors:ue,scrollableAncestorRects:de,measuringConfiguration:$,measuringScheduled:X,windowRect:se})),[A,Y,Q,T,be,ee,oe,N,O,q,ye,W,ue,de,$,X,se]),Ee=r((()=>({activatorEvent:T,activators:Re,active:A,activeNodeRect:Q,ariaDescribedById:{draggable:B},dispatch:R,draggableNodes:N,over:ye,measureDroppableContainers:W})),[T,Re,A,Q,R,B,N,ye,W]);return t.createElement(ot.Provider,{value:E},t.createElement(Rn.Provider,{value:Ee},t.createElement(_n.Provider,{value:_e},t.createElement(Mn.Provider,{value:Ce},h)),t.createElement(Fn,{disabled:!1===(null==p?void 0:p.restoreFocus)})),t.createElement(it,{...p,hiddenTextDescribedById:B}))})),Pn=s(null),On="button",Vn="Droppable";function kn(e){let{id:t,data:n,disabled:o=!1,attributes:l}=e;const i=$e(Vn),{activators:a,activatorEvent:s,active:u,activeNodeRect:d,ariaDescribedById:g,draggableNodes:p,over:f}=c(Rn),{role:h=On,roleDescription:m="draggable",tabIndex:v=0}=l??{},b=(null==u?void 0:u.id)===t,w=c(b?Mn:Pn),[y,x]=Ge(),[C,S]=Ge(),R=function(e,t){return r((()=>e.reduce(((e,n)=>{let{eventName:o,handler:r}=n;return e[o]=e=>{r(e,t)},e}),{})),[e,t])}(a,t),_=Te(n);ze((()=>(p.set(t,{id:t,key:i,node:y,activatorNode:C,data:_}),()=>{const e=p.get(t);e&&e.key===i&&p.delete(t)})),[p,t]);return{active:u,activatorEvent:s,activeNodeRect:d,attributes:r((()=>({role:h,tabIndex:v,"aria-disabled":o,"aria-pressed":!(!b||h!==On)||void 0,"aria-roledescription":m,"aria-describedby":g.draggable})),[o,h,v,b,m,g.draggable]),isDragging:b,listeners:o?void 0:R,node:y,over:f,setNodeRef:x,setActivatorNodeRef:S,transform:w}}const An="Droppable",jn={timeout:25};function zn(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function Ln(e,t){return e.reduce(((e,n,o)=>{const r=t.get(n);return r&&(e[o]=r),e}),Array(e.length))}function Tn(e){return null!==e&&e>=0}const Hn=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const l=zn(t,o,n),i=t[r],a=l[r];return a&&i?{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}:null},Gn={scaleX:1,scaleY:1},Bn=e=>{var t;let{activeIndex:n,activeNodeRect:o,index:r,rects:l,overIndex:i}=e;const a=null!=(t=l[n])?t:o;if(!a)return null;if(r===n){const e=l[i];return e?{x:0,y:n<i?e.top+e.height-(a.top+a.height):e.top-a.top,...Gn}:null}const s=function(e,t,n){const o=e[t],r=e[t-1],l=e[t+1];return o?n<t?r?o.top-(r.top+r.height):l?l.top-(o.top+o.height):0:l?l.top-(o.top+o.height):r?o.top-(r.top+r.height):0:0}(l,r,n);return r>n&&r<=i?{x:0,y:-a.height-s,...Gn}:r<n&&r>=i?{x:0,y:a.height+s,...Gn}:{x:0,y:0,...Gn}};const Un="Sortable",$n=t.createContext({activeIndex:-1,containerId:Un,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Hn,disabled:{draggable:!1,droppable:!1}});function qn(e){let{children:n,id:i,items:a,strategy:s=Hn,disabled:u=!1}=e;const{active:d,dragOverlay:g,droppableRects:p,over:f,measureDroppableContainers:h}=c(_n),m=$e(Un,i),v=null!==g.rect,b=r((()=>a.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[a]),w=null!=d,y=d?b.indexOf(d.id):-1,x=f?b.indexOf(f.id):-1,C=l(b),S=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(b,C.current),R=-1!==x&&-1===y||S,_=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(u);ze((()=>{S&&w&&h(b)}),[S,b,w,h]),o((()=>{C.current=b}),[b]);const E=r((()=>({activeIndex:y,containerId:m,disabled:_,disableTransforms:R,items:b,overIndex:x,useDragOverlay:v,sortedRects:Ln(b,p),strategy:s})),[y,m,_.draggable,_.droppable,R,b,x,p,v,s]);return t.createElement($n.Provider,{value:E},n)}const Wn=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return zn(n,o,r).indexOf(t)},Xn=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:l,newIndex:i,previousItems:a,previousContainerId:s,transition:u}=e;return!(!u||!o||a!==l&&r===i)&&(!!n||i!==r&&t===s)},Yn={duration:200,easing:"ease"},Kn="transform",Jn=Je.Transition.toString({property:Kn,duration:0,easing:"linear"}),Zn={roleDescription:"sortable"};function Qn(e){let{animateLayoutChanges:t=Xn,attributes:n,disabled:s,data:u,getNewIndex:d=Wn,id:g,strategy:p,resizeObserverConfig:f,transition:h=Yn}=e;const{items:m,containerId:v,activeIndex:b,disabled:w,disableTransforms:y,sortedRects:x,overIndex:C,useDragOverlay:S,strategy:R}=c($n),_=function(e,t){var n,o;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(o=null==e?void 0:e.droppable)?o:t.droppable}}(s,w),E=m.indexOf(g),D=r((()=>({sortable:{containerId:v,index:E,items:m},...u})),[v,u,E,m]),F=r((()=>m.slice(m.indexOf(g))),[m,g]),{rect:M,node:I,isOver:N,setNodeRef:P}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:a}=e;const s=$e(An),{active:u,dispatch:d,over:g,measureDroppableContainers:p}=c(Rn),f=l({disabled:n}),h=l(!1),m=l(null),v=l(null),{disabled:b,updateMeasurementsFor:w,timeout:y}={...jn,...a},x=Te(w??r),C=cn({callback:i((()=>{h.current?(null!=v.current&&clearTimeout(v.current),v.current=setTimeout((()=>{p(Array.isArray(x.current)?x.current:[x.current]),v.current=null}),y)):h.current=!0}),[y]),disabled:b||!u}),S=i(((e,t)=>{C&&(t&&(C.unobserve(t),h.current=!1),e&&C.observe(e))}),[C]),[R,_]=Ge(S),E=Te(t);return o((()=>{!C||!R.current||(C.disconnect(),h.current=!1,C.observe(R.current))}),[R,C]),ze((()=>(d({type:at.RegisterDroppable,element:{id:r,key:s,disabled:n,node:R,rect:m,data:E}}),()=>d({type:at.UnregisterDroppable,key:s,id:r}))),[r]),o((()=>{n!==f.current.disabled&&(d({type:at.SetDroppableDisabled,id:r,key:s,disabled:n}),f.current.disabled=n)}),[r,s,n,d]),{active:u,rect:m,isOver:(null==g?void 0:g.id)===r,node:R,over:g,setNodeRef:_}}({id:g,data:D,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:F,...f}}),{active:O,activatorEvent:V,activeNodeRect:k,attributes:A,setNodeRef:j,listeners:z,isDragging:L,over:T,setActivatorNodeRef:H,transform:G}=kn({id:g,data:D,attributes:{...Zn,...n},disabled:_.draggable}),B=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r((()=>e=>{t.forEach((t=>t(e)))}),t)}(P,j),U=!!O,$=U&&!y&&Tn(b)&&Tn(C),q=!S&&L,W=$?(q&&$?G:null)??(p??R)({rects:x,activeNodeRect:k,activeIndex:b,overIndex:C,index:E}):null,X=Tn(b)&&Tn(C)?d({id:g,items:m,activeIndex:b,overIndex:C}):E,Y=null==O?void 0:O.id,K=l({activeId:Y,items:m,newIndex:X,containerId:v}),J=m!==K.current.items,Z=t({active:O,containerId:v,isDragging:L,isSorting:U,id:g,index:E,items:m,newIndex:K.current.newIndex,previousItems:K.current.items,previousContainerId:K.current.containerId,transition:h,wasDragging:null!=K.current.activeId}),Q=function(e){let{disabled:t,index:n,node:r,rect:i}=e;const[s,u]=a(null),d=l(n);return ze((()=>{if(!t&&n!==d.current&&r.current){const e=i.current;if(e){const t=Ct(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&u(n)}}n!==d.current&&(d.current=n)}),[t,n,r,i]),o((()=>{s&&u(null)}),[s]),s}({disabled:!Z,index:E,node:I,rect:M});return o((()=>{U&&K.current.newIndex!==X&&(K.current.newIndex=X),v!==K.current.containerId&&(K.current.containerId=v),m!==K.current.items&&(K.current.items=m)}),[U,X,v,m]),o((()=>{if(Y===K.current.activeId)return;if(Y&&!K.current.activeId)return void(K.current.activeId=Y);const e=setTimeout((()=>{K.current.activeId=Y}),50);return()=>clearTimeout(e)}),[Y]),{active:O,activeIndex:b,attributes:A,data:D,rect:M,index:E,newIndex:X,items:m,isOver:N,isSorting:U,isDragging:L,listeners:z,node:I,overIndex:C,over:T,setNodeRef:B,setActivatorNodeRef:H,setDroppableNodeRef:P,setDraggableNodeRef:j,transform:Q??W,transition:function(){if(Q||J&&K.current.newIndex===E)return Jn;if((!q||Ye(V))&&h&&(U||Z))return Je.Transition.toString({...h,property:Kn})}()}}function eo({styledTableProps:e,row:t,index:n}){const{focusable:o,loading:l,getRowClassName:i,rowHeight:a,onRowClick:s,expandArrow:u,enableDnd:d,tdClassName:c,customSubRowData:p,renderSubRows:f}=e,{transform:h,transition:m,setNodeRef:v,isDragging:b}=Qn({id:t.original.id,disabled:!d}),w={transform:Je.Transform.toString(h),transition:m,opacity:b?.8:1,zIndex:b?1:0,position:"relative"},y=t.getVisibleCells(),x=r((()=>y.map(((e,t)=>({...e,left:y.slice(0,t).reduce(((e,t)=>e+(t.column.getSize()||0)),0)})))),[y]),C=r((()=>x.some((e=>!0===e.column.columnDef.fixedLeft))),[x]);return I.jsxs(g,{children:[I.jsx("tr",{"data-index":n,"data-test":t.id,id:t.id,tabIndex:o?-1:void 0,className:Me(De["t-row"],l&&De["is-loading"],(t.getIsExpanded()||t.getIsSelected())&&De.selected,null==i?void 0:i(t)),style:{height:a?`${a}px`:"inherit",...d&&w},ref:v,onMouseUp:e=>{var n,o;if(e.target.classList.contains("MuiModal-backdrop")||"INPUT"===e.target.nodeName||"BUTTON"===e.target.nodeName)return;t.getCanExpand()&&!u&&t.getToggleExpandedHandler()(),null==(n=document.getElementById(t.id))||n.focus();const r="Range"===(null==(o=window.getSelection())?void 0:o.type);s&&!r&&s(e,t)},children:x.map((e=>{const n="actions"===e.column.id,o=e.column.columnDef.fixedLeft;return I.jsx("td",{className:Me(De["t-cell"],c,n&&De["action-cell"],n&&C&&De.shadowed,n&&(t.getIsExpanded()||t.getIsSelected())&&De.selected,n&&(null!=i&&i(t)?null==i?void 0:i(t):De["action-cell-default-background"]),o&&De["fixed-cell"],o&&(t.getIsExpanded()||t.getIsSelected())&&De.selected,o&&(null!=i&&i(t)?null==i?void 0:i(t):De["fixed-cell-default-background"])),style:o?{left:e.left}:{},children:Ee(e.column.columnDef.cell,e.getContext())},e.id)}))}),t.getIsExpanded()&&I.jsx(I.Fragment,{children:p&&f&&f({rows:p.get(t.original.id.toString())??[],row:t.original})})]},t.id)}function to({styledTableProps:e,table:t}){const n=e.hideFooter?t.getCoreRowModel().rows:t.getRowModel().rows;return I.jsx(I.Fragment,{children:n.map(((t,n)=>I.jsx(eo,{styledTableProps:e,row:t,index:n},t.id)))})}Gt.Down,Gt.Right,Gt.Up,Gt.Left;const no=({colSpan:e,noRowsOverlay:t})=>I.jsx("tr",{className:De["no-rows-overlay"],children:I.jsx("td",{colSpan:e,children:t})});function oo(e){return I.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:[I.jsx("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:.5}),I.jsx("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z",children:I.jsx("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})})]})}function ro({table:e,styledTableProps:t}){const{columns:n,data:o,loading:r,noRowsOverlay:l,enableDnd:i}=t;return I.jsxs("tbody",{className:De.tbody,children:[o.length>0&&r&&I.jsx(oo,{className:De["loading-icon"],width:50,height:50}),0===o.length&&r?I.jsx(N,{colSpan:n.length}):o.length>0?I.jsx(I.Fragment,{children:i?I.jsx(qn,{items:o,strategy:Bn,children:I.jsx(to,{table:e,styledTableProps:t})}):I.jsx(to,{table:e,styledTableProps:t})}):I.jsx(no,{colSpan:n.length,noRowsOverlay:l})]})}const lo=()=>{const[e,t]=a(null),n=!!e,o=i((e=>{t(e.currentTarget)}),[]);return{open:n,handleClose:i((()=>{t(null)}),[]),handleOpen:o,anchorEl:e}};function io(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z"})})}function ao(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6l-6-6z"})})}function so(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"M8.59 16.58L13.17 12L8.59 7.41L10 6l6 6l-6 6z"})})}const uo={"table-pagination":"_table-pagination_k2a41_1","table-pagination__pages-list":"_table-pagination__pages-list_k2a41_13","table-pagination__pages-list__page":"_table-pagination__pages-list__page_k2a41_18","page-selected":"_page-selected_k2a41_29","check-icon":"_check-icon_k2a41_32"};function co(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"M15.41 16.58L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function go(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z"})})}const po="_asma-core-ui-button_1r2np_1",fo={contained:"_contained_1r2np_27",outlined:"_outlined_1r2np_141",text:"_text_1r2np_255",textGray:"_textGray_1r2np_369",textWhite:"_textWhite_1r2np_426",large:"_large_1r2np_79",small:"_small_1r2np_74",medium:"_medium_1r2np_69",error:"_error_1r2np_84",common:"_common_1r2np_27"},ho=({variant:e="contained",className:t="",size:n="medium",children:o,refLink:r,startIcon:l,endIcon:i,dataTest:a,error:s,...u})=>{const d="large"===n||"medium"===n,c=s?"error":"common";return I.jsxs("button",{...u,className:Me(po,fo[e],fo[c],fo[n],t),ref:r,"data-test":a,children:[l,o&&I.jsx("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",justifyContent:"center",gap:d?"8px":"4px",paddingLeft:d?"8px":"4px",paddingRight:d?"8px":"4px"},children:o}),i]})};function mo({table:e,locale:t}){const{anchorEl:n,open:o,handleClose:r,handleOpen:i}=lo(),a=l(null),s="no"===t,u=De["asma-ui-table-styled-table"],d=()=>{var e,t,n,o;null==(o=null==(n=null==(t=null==(e=null==a?void 0:a.current)?void 0:e.closest(`.${u}`))?void 0:t.querySelectorAll('[data-index="0"]'))?void 0:n[0])||o.scrollIntoView({block:"center",inline:"start"})},c=e.getPageCount(),g=e.getState().pagination.pageIndex+1,p=Array.from({length:c},((e,t)=>t+1));return c>1?I.jsxs("div",{ref:a,className:uo["table-pagination"],children:[I.jsx(f,{title:s?"Nåværende side":"Current Page",children:I.jsx("div",{children:I.jsxs(ho,{dataTest:"",variant:"outlined",style:{minWidth:"140px"},onClick:e=>{i(e)},endIcon:o?I.jsx(io,{height:24,width:24}):I.jsx(ao,{height:24,width:24}),children:[s?"Side":"Page"," ",g," ",s?"av":"of"," ",c]})})}),I.jsx(h,{open:o,anchorEl:n,onClose:r,anchorOrigin:{vertical:-5,horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"},children:I.jsx("div",{className:uo["table-pagination__pages-list"],children:p.map((t=>I.jsxs("div",{className:Me(uo["table-pagination__pages-list__page"],g===t&&"page-selected"),onClick:()=>{e.setPageIndex(t-1),r(),d()},children:[g===t&&I.jsx(go,{className:uo["check-icon"],height:24,width:24}),I.jsxs("span",{children:[s?"Side":"Page"," ",t]})]},t)))})}),I.jsx(f,{title:1===g?"":s?"Forrige side":"Previous Page",children:I.jsx("div",{children:I.jsx(ho,{dataTest:"",variant:"outlined",onClick:()=>{e.previousPage(),d()},disabled:!e.getCanPreviousPage(),style:{minWidth:40,width:40},startIcon:I.jsx(co,{height:24,width:24})})})}),I.jsx(f,{title:g===c?"":s?"Neste side":"Next Page",children:I.jsx("div",{children:I.jsx(ho,{dataTest:"",variant:"outlined",onClick:()=>{e.nextPage(),d()},disabled:!e.getCanNextPage(),style:{minWidth:40,width:40},startIcon:I.jsx(so,{height:24,width:24})})})})]}):null}function vo({table:e,styledTableProps:t}){var n;return t.hideFooter?null:I.jsxs("div",{className:De["table-footer"],children:[null==(n=t.footer)?void 0:n.call(t,e),I.jsx(mo,{table:e,locale:t.locale||"en"})]})}const bo=t=>{const{columns:n,data:o,initialState:r,pageSize:l,enableRowSelection:i,tableInstanceRef:a,...s}=t,u=function(t){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[o]=e.useState((()=>({current:xe(n)}))),[r,l]=e.useState((()=>o.current.initialState));return o.current.setOptions((e=>({...e,...t,state:{...r,...t.state},onStateChange:e=>{l(e),null==t.onStateChange||t.onStateChange(e)}}))),o.current}({columns:n,data:o,initialState:{pagination:{pageIndex:0,pageSize:l||50},columnVisibility:{...null==r?void 0:r.columnVisibility,[x]:!1},...r},enableRowSelection:i,getCoreRowModel:e=>k((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,r,l){void 0===r&&(r=0);const i=[];for(let s=0;s<t.length;s++){const u=Ce(e,e._getRowId(t[s],s,l),t[s],s,r,void 0,null==l?void 0:l.id);var a;n.flatRows.push(u),n.rowsById[u.id]=u,i.push(u),e.options.getSubRows&&(u.originalSubRows=e.options.getSubRows(t[s],s),null!=(a=u.originalSubRows)&&a.length&&(u.subRows=o(u.originalSubRows,r+1,u)))}return i};return n.rows=o(t),n}),{key:"development"===process.env.NODE_ENV&&"getRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}}),getExpandedRowModel:e=>k((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>t.rows.length&&(!0===e||Object.keys(e??{}).length)&&n?_e(t):t),{key:"development"===process.env.NODE_ENV&&"getExpandedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),getFilteredRowModel:e=>k((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,o)=>{if(!t.rows.length||(null==n||!n.length)&&!o){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const r=[],l=[];(n??[]).forEach((t=>{var n;const o=e.getColumn(t.id);if(!o)return;const l=o.getFilterFn();l?r.push({id:t.id,filterFn:l,resolvedValue:null!=(n=null==l.resolveFilterValue?void 0:l.resolveFilterValue(t.value))?n:t.value}):"production"!==process.env.NODE_ENV&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${o.id}.`)}));const i=n.map((e=>e.id)),a=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let u,d;o&&a&&s.length&&(i.push("__global__"),s.forEach((e=>{var t;l.push({id:e.id,filterFn:a,resolvedValue:null!=(t=null==a.resolveFilterValue?void 0:a.resolveFilterValue(o))?t:o})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},r.length)for(let e=0;e<r.length;e++){u=r[e];const t=u.id;n.columnFilters[t]=u.filterFn(n,t,u.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(l.length){for(let e=0;e<l.length;e++){d=l[e];const t=d.id;if(d.filterFn(n,t,d.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return Re(t.rows,(e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0}),e)}),{key:"development"===process.env.NODE_ENV&&"getFilteredRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}}),getSortedRowModel:e=>k((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const o=e.getState().sorting,r=[],l=o.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),i={};l.forEach((t=>{const n=e.getColumn(t.id);n&&(i[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const a=e=>{const t=[...e];return t.sort(((e,t)=>{for(let o=0;o<l.length;o+=1){var n;const r=l[o],a=i[r.id],s=null!=(n=null==r?void 0:r.desc)&&n;let u=0;if(a.sortUndefined){const n=void 0===e.getValue(r.id),o=void 0===t.getValue(r.id);(n||o)&&(u=n&&o?0:n?a.sortUndefined:-a.sortUndefined)}if(0===u&&(u=a.sortingFn(e,t,r.id)),0!==u)return s&&(u*=-1),a.invertSorting&&(u*=-1),u}return e.index-t.index})),t.forEach((e=>{var t;r.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=a(e.subRows))})),t};return{rows:a(n.rows),flatRows:r,rowsById:n.rowsById}}),{key:"development"===process.env.NODE_ENV&&"getSortedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}}),getPaginationRowModel:e=>k((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:o,pageIndex:r}=t;let{rows:l,flatRows:i,rowsById:a}=n;const s=o*r,u=s+o;let d;l=l.slice(s,u),d=e.options.paginateExpandedRows?{rows:l,flatRows:i,rowsById:a}:_e({rows:l,flatRows:i,rowsById:a}),d.flatRows=[];const c=e=>{d.flatRows.push(e),e.subRows.length&&e.subRows.forEach(c)};return d.rows.forEach(c),d}),{key:"development"===process.env.NODE_ENV&&"getPaginationRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),getRowId:s.getRowId||((e,t,n)=>n?[n.id,e.id].join("."):e.id.toString()),defaultColumn:t.enableResizing?{size:void 0}:void 0,...s});return a&&(a.current=u),{table:u}},wo=({dataTest:e,...t})=>I.jsx(m,{...t,"data-test":e,sx:{...t.sx,"&.MuiCheckbox-root":{color:"var(--colors-delta-500) !important"},"&.MuiCheckbox-root.Mui-checked":{color:"var(--colors-gama-500) !important"},"&.MuiCheckbox-root.MuiCheckbox-indeterminate":{color:"var(--colors-gama-500) !important"},"&.MuiCheckbox-root.Mui-disabled":{color:"var(--colors-delta-200) !important"},"&.MuiCheckbox-root .PrivateSwitchBase-input":{height:"100% !important",width:"100% !important"}}});function yo(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"M12 16a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2m0-6a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2m0-6a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2"})})}const xo=e=>{var t;return I.jsx(v,{...e,classes:{root:Me("px-3 py-2.5",null==(t=e.classes)?void 0:t.root),...e.classes}})};function Co({tableData:e,actions:n}){const{anchorEl:o,open:r,handleClose:l,handleOpen:i}=lo(),a=n(e.row);return I.jsx("div",{className:"flex justify-center items-center w-[42px]",children:a.length?I.jsxs(I.Fragment,{children:[I.jsx(ho,{dataTest:"",variant:"text",onClick:e=>{e.stopPropagation(),e.preventDefault(),i(e)},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onMouseUp:e=>{e.stopPropagation(),e.preventDefault()},children:I.jsx(yo,{className:"text-delta-800",width:20,height:20})}),I.jsx(h,{open:r,anchorEl:o,onClose:l,onClick:l,anchorOrigin:{horizontal:"center",vertical:"bottom"},transformOrigin:{vertical:"top",horizontal:"right"},children:n(e.row).map(((n,o)=>{if(y(n)){const r=n.component(e.row,l);return t.isValidElement(r)?I.jsx(t.Fragment,{children:r},o):null}return n.hide?null:I.jsx(xo,{className:n.className,disabled:n.disabled,onClick:()=>{var t;null==(t=n.onClick)||t.call(n,e.row)},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onMouseUp:e=>{e.stopPropagation(),e.preventDefault()},children:n.label},o)}))})]}):null})}function So(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16 9V4h2V2H6v2h2v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1l1-1v-7H19v-2c-1.66 0-3-1.34-3-3"})})}function Ro({headerData:e}){const{anchorEl:t,open:n,handleClose:o,handleOpen:r}=lo();return I.jsxs("div",{className:"w-full flex items-center justify-end",children:[I.jsx("div",{className:"px-2.5 h-[30px] flex items-center justify-center cursor-pointer",onClick:r,children:I.jsx(So,{className:"text-delta-500 hover:text-delta-600 min-w-[20px] min-h-[20px]"})}),I.jsx(h,{anchorEl:t,anchorOrigin:{horizontal:"left",vertical:"bottom"},open:n,onClose:o,sx:{"& .MuiPaper-root":{maxHeight:"calc(7 * 44px)",overflowY:"auto",scrollbarWidth:"thin"}},children:e.table.getAllLeafColumns().filter((e=>e.getCanHide()&&e.id!==x)).map((e=>e.columnDef.header?I.jsxs(xo,{onClick:()=>e.toggleVisibility(!e.getIsVisible()),className:"h-[44px]",children:[I.jsx(wo,{size:"small",dataTest:"test",disableRipple:!0,className:"p-0 pr-2",checked:e.getIsVisible()}),"string"==typeof e.columnDef.header?e.columnDef.header:e.id]},e.id):null))})]})}function _o(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",...e,children:I.jsx("path",{fill:"currentColor",d:"M14 6.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 0 0-3 0m-5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 0 0-3 0M5.5 8a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m8.5 5.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 0 0-3 0M10.5 15a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M4 13.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 0 0-3 0"})})}const Eo=({rowId:e})=>{const{attributes:t,listeners:n}=Qn({id:e});return I.jsx("div",{...t,...n,children:I.jsx(_o,{width:24,height:24,className:"text-delta-800"})})},Do=e=>{const{columns:t,actions:n,customActionsNode:o,headerPin:r=!0,enableRowSelection:l,expandArrow:i,enableDnd:a,customDndColumnProps:s}=e;!t.find((e=>"actions"===e.id))&&(n||o||r)&&t.push(function(e){const{headerPin:t,actions:n,customActionsNode:o}=e;return{id:"actions",enableHiding:!1,enableSorting:!1,accessorFn:e=>e,header:e=>t?I.jsx(Ro,{headerData:e}):null,cell:e=>n||o?I.jsxs("div",{className:"flex items-center justify-end",children:[o&&I.jsx("div",{className:"mr-1",children:null==o?void 0:o(e)}),n&&I.jsx(Co,{tableData:e,actions:n})]}):null,size:50}}({headerPin:r,actions:n,customActionsNode:o})),l&&!t.find((e=>e.id===x))&&t.unshift({id:x,minSize:40,maxSize:40,size:40,header:({table:e})=>I.jsx("div",{className:"w-[25px]",children:I.jsx(wo,{size:"small",dataTest:"cell-select-all",checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler()})}),cell:({cell:e})=>I.jsx("div",{className:"w-[25px]",children:I.jsx(wo,{size:"small",dataTest:"cell-select",checked:e.row.getIsSelected(),disabled:!e.row.getCanSelect(),onClick:e=>e.stopPropagation(),onChange:e.row.getToggleSelectedHandler()})})}),i&&!t.find((e=>e.id===C))&&t.unshift({id:C,minSize:50,maxSize:50,size:50,enableHiding:!1,enableSorting:!1,header:()=>null,cell:({cell:e})=>{const t=e.row.getIsExpanded();return e.row.getCanExpand()?I.jsx("span",{className:"flex h-fit w-full outline-none focus:outline-none items-center justify-center",onClick:()=>e.row.getToggleExpandedHandler()(),children:t?I.jsx(io,{width:24,height:24}):I.jsx(ao,{width:24,height:24})}):null}}),a&&!t.find((e=>e.id===R))&&t.unshift(function(e){return{enableHiding:!1,enableSorting:!1,header:()=>null,cell:({row:e})=>I.jsx(Eo,{rowId:e.id}),...e,id:R}}(s))};function Fo(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"m7 14l5-5l5 5z"})})}function Mo(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"m7 10l5 5l5-5z"})})}const Io=e=>{var t;const{header:n,enableResizing:o,element:r}=e;let l=n.getSize();if(!o){l&&(l=`${l}px`);const e="actions"===(null==(t=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}(n.headerGroup.headers))?void 0:t.id),o=n.headerGroup.headers[n.headerGroup.headers.length-(e?2:1)];return((null==o?void 0:o.id)===n.id||!l)&&(l="100%"),{width:l||n.column.columnDef.size,maxWidth:l||n.column.columnDef.maxSize,minWidth:l||n.column.columnDef.minSize}}const i=n.column.columnDef.size,a=n.column.columnDef.minSize;return{width:i,maxWidth:n.column.columnDef.maxSize,minWidth:a}};function No({styledTableProps:e,header:t,tableCanResize:n=!1,left:o,hasFixedLeftColumn:r}){const{hideHeader:i=!1,enableResizing:a=!1}=e,s=l(null);return I.jsx("th",{ref:s,colSpan:t.colSpan,className:Me(De["t-cell"],"actions"===t.column.id&&De["t-cell__actions"],r&&"actions"===t.column.id&&De.shadowed,!0===t.column.columnDef.fixedLeft&&De["t-cell__fixed"]),style:{...Io({enableResizing:a,header:t,element:s.current}),...t.column.columnDef.fixedLeft&&{left:o}},children:I.jsxs("div",{className:Me("flex items-center justify-left",i?De["hide-table-header"]:De["show-table-header"],t.column.getCanSort()&&De["sortable-column"],t.column.columnDef.className),onClick:t.column.getToggleSortingHandler(),children:[Ee(t.column.columnDef.header,t.getContext()),{asc:I.jsx(Fo,{className:De["sort-icon"]}),desc:I.jsx(Mo,{className:De["sort-icon"]})}[t.column.getIsSorted()]??null,n&&t.column.getCanResize()&&![x,C,S].includes(t.column.id)&&I.jsx("div",{onDoubleClick:()=>t.column.resetSize(),onMouseDown:t.getResizeHandler(),onTouchStart:t.getResizeHandler(),className:`${De.resizer} ${t.column.getIsResizing()?De.isResizing:""}`})]})},t.id)}function Po({table:e,styledTableProps:t,tableCanResize:n}){const{stickyHeader:o=!1,hideHeader:r=!1}=t;if(t.loading)return null;const l=e.getHeaderGroups().some((e=>e.headers.some((e=>!0===e.column.columnDef.fixedLeft))));return I.jsx("thead",{className:Me(De["table-header"],r&&De["hide-table-header"]),style:o&&{position:"sticky",top:-.2}||{},children:e.getHeaderGroups().map((e=>I.jsx("tr",{children:e.headers.map(((o,r)=>{const i=o.column.columnDef.fixedLeft,a=e.headers.slice(0,r).reduce(((e,t)=>e+(t.column.getSize()||0)),0);return I.jsx(No,{styledTableProps:t,header:o,tableCanResize:n,left:i?a:0,hasFixedLeftColumn:l},o.column.id)}))},e.id)))})}const Oo=e=>{let{transform:t}=e;return{...t,x:0}},Vo=e=>{const{className:t,height:n,data:o,enableDnd:l,setData:i}=e;Do(e);const{table:a}=bo(e),s=r((()=>{var t,n;if(!e.enableColumnResizing)return;const o=a.getFlatHeaders(),r={};for(let e=0;e<o.length;e++){const t=o[e];r[`--header-${t.id}-size`]=t.getSize(),r[`--col-${t.column.id}-size`]=t.column.getSize()}return null==(t=e.getTableState)||t.call(e,a.getState()),null==(n=e.getColumnSizing)||n.call(e,a.getState().columnSizing),r}),[e.enableColumnResizing,a.getState().columnSizingInfo,a.getState().columnSizing]),u=l?Nn:g,d=r((()=>null==o?void 0:o.map((e=>e.id))),[o]);return I.jsx(u,{collisionDetection:ht,modifiers:[Oo],onDragEnd:function(e){if(!l||!i)return;const{active:t,over:n}=e;t&&n&&t.id!==n.id&&i((e=>zn(e,d.indexOf(t.id),d.indexOf(n.id))))},children:I.jsxs("div",{className:De["asma-ui-table-styled-table"],children:[I.jsx("div",{className:Me(De["table-wrapper"],t),style:{height:n},children:I.jsxs("table",{className:De["styled-table"],style:{...s},children:[I.jsx(Po,{table:a,styledTableProps:e,tableCanResize:!!e.enableColumnResizing}),s?I.jsx(I.Fragment,{children:a.getState().columnSizingInfo.isResizingColumn?I.jsx(ko,{table:a,styledTableProps:e}):I.jsx(ro,{table:a,styledTableProps:e})}):I.jsx(ro,{table:a,styledTableProps:e})]})}),I.jsx(vo,{table:a,styledTableProps:e})]})})},ko=u(ro,((e,t)=>e.table.options.data===t.table.options.data));export{S as ACTIONS_COLUMN_ID,R as DND_HANDLE_COLUMN_ID,C as EXPAND_COLUMN_ID,ko as MemoizedTableBody,x as SELECT_COLUMN_ID,Vo as StyledTable,Se as createColumnHelper,y as isCustomAction};
|
|
41
|
+
function Ee(t,n){return t?function(e){return function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(e)||"function"==typeof e||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(e)}(t)?e.createElement(t,n):t:null}const De={"asma-ui-table-styled-table":"_asma-ui-table-styled-table_2axop_1","table-wrapper":"_table-wrapper_2axop_7","styled-table":"_styled-table_2axop_11",tbody:"_tbody_2axop_19","loading-icon":"_loading-icon_2axop_24","t-row":"_t-row_2axop_30","action-cell":"_action-cell_2axop_46","fixed-cell":"_fixed-cell_2axop_49","t-cell":"_t-cell_2axop_61",selected:"_selected_2axop_107",shadowed:"_shadowed_2axop_110","is-loading":"_is-loading_2axop_126","action-cell-default-background":"_action-cell-default-background_2axop_129","fixed-cell-default-background":"_fixed-cell-default-background_2axop_132","no-rows-overlay":"_no-rows-overlay_2axop_135","hide-table-header":"_hide-table-header_2axop_144","show-table-header":"_show-table-header_2axop_148","sortable-column":"_sortable-column_2axop_153",resizer:"_resizer_2axop_157",isResizing:"_isResizing_2axop_168","table-header":"_table-header_2axop_180","t-cell__actions":"_t-cell__actions_2axop_201","t-cell__fixed":"_t-cell__fixed_2axop_209","sort-icon":"_sort-icon_2axop_216","table-footer":"_table-footer_2axop_219"};function Fe(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Fe(e[t]))&&(o&&(o+=" "),o+=n);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function Me(){for(var e,t,n=0,o="";n<arguments.length;)(e=arguments[n++])&&(t=Fe(e))&&(o&&(o+=" "),o+=t);return o}const Ie=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ne(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Pe(e){return"nodeType"in e}function Oe(e){var t,n;return e?Ne(e)?e:Pe(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function Ve(e){const{Document:t}=Oe(e);return e instanceof t}function ke(e){return!Ne(e)&&e instanceof Oe(e).HTMLElement}function Ae(e){return e instanceof Oe(e).SVGElement}function je(e){return e?Ne(e)?e.document:Pe(e)?Ve(e)?e:ke(e)||Ae(e)?e.ownerDocument:document:document:document}const ze=Ie?o:r;function Le(e){const t=l(e);return ze((()=>{t.current=e})),i((function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)}),[])}function Te(e,t){void 0===t&&(t=[e]);const n=l(e);return ze((()=>{n.current!==e&&(n.current=e)}),t),n}function He(e,t){const o=l();return n((()=>{const t=e(o.current);return o.current=t,t}),[...t])}function Ge(e){const t=Le(e),n=l(null),o=i((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,o]}function Be(e){const t=l();return r((()=>{t.current=e}),[e]),t.current}let Ue={};function $e(e,t){return n((()=>{if(t)return t;const n=null==Ue[e]?0:Ue[e]+1;return Ue[e]=n,e+"-"+n}),[e,t])}function qe(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce(((t,n)=>{const o=Object.entries(n);for(const[n,r]of o){const o=t[n];null!=o&&(t[n]=o+e*r)}return t}),{...t})}}const We=qe(1),Xe=qe(-1);function Ye(e){if(!e)return!1;const{KeyboardEvent:t}=Oe(e.target);return t&&e instanceof t}function Ke(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Oe(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Je=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Je.Translate.toString(e),Je.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),Ze="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Qe(e){return e.matches(Ze)?e:e.querySelector(Ze)}const et={display:"none"};function tt(e){let{id:n,value:o}=e;return t.createElement("div",{id:n,style:et},o)}function nt(e){let{id:n,announcement:o,ariaLiveType:r="assertive"}=e;return t.createElement("div",{id:n,style:{position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},o)}const ot=s(null);const rt={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},lt={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function it(e){let{announcements:o=lt,container:l,hiddenTextDescribedById:s,screenReaderInstructions:d=rt}=e;const{announce:c,announcement:g}=function(){const[e,t]=a("");return{announce:i((e=>{null!=e&&t(e)}),[]),announcement:e}}(),p=$e("DndLiveRegion"),[f,h]=a(!1);if(r((()=>{h(!0)}),[]),function(e){const t=u(ot);r((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}(n((()=>({onDragStart(e){let{active:t}=e;c(o.onDragStart({active:t}))},onDragMove(e){let{active:t,over:n}=e;o.onDragMove&&c(o.onDragMove({active:t,over:n}))},onDragOver(e){let{active:t,over:n}=e;c(o.onDragOver({active:t,over:n}))},onDragEnd(e){let{active:t,over:n}=e;c(o.onDragEnd({active:t,over:n}))},onDragCancel(e){let{active:t,over:n}=e;c(o.onDragCancel({active:t,over:n}))}})),[c,o])),!f)return null;const m=t.createElement(t.Fragment,null,t.createElement(tt,{id:s,value:d.draggable}),t.createElement(nt,{id:p,announcement:g}));return l?w(m,l):m}var at,st;function ut(){}(st=at||(at={})).DragStart="dragStart",st.DragMove="dragMove",st.DragEnd="dragEnd",st.DragCancel="dragCancel",st.DragOver="dragOver",st.RegisterDroppable="registerDroppable",st.SetDroppableDisabled="setDroppableDisabled",st.UnregisterDroppable="unregisterDroppable";const dt=Object.freeze({x:0,y:0});function ct(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function gt(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function pt(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function ft(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const ht=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=ft(t,t.left,t.top),l=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=ct(ft(o),r);l.push({id:t,data:{droppableContainer:e,value:n}})}}return l.sort(gt)};function mt(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),i=r-o,a=l-n;if(o<r&&n<l){const n=t.width*t.height,o=e.width*e.height,r=i*a;return Number((r/(n+o-r)).toFixed(4))}return 0}const vt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const e of o){const{id:o}=e,l=n.get(o);if(l){const n=mt(l,t);n>0&&r.push({id:o,data:{droppableContainer:e,value:n}})}}return r.sort(pt)};function bt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:dt}function wt(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce(((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x})),{...t})}}const yt=wt(1);const xt={ignoreTransform:!1};function Ct(e,t){void 0===t&&(t=xt);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:o}=Oe(e).getComputedStyle(e);t&&(n=function(e,t,n){const o=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!o)return e;const{scaleX:r,scaleY:l,x:i,y:a}=o,s=e.left-i-(1-r)*parseFloat(n),u=e.top-a-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?e.width/r:e.width,c=l?e.height/l:e.height;return{width:d,height:c,top:u,right:s+d,bottom:u+c,left:s}}(n,t,o))}const{top:o,left:r,width:l,height:i,bottom:a,right:s}=n;return{top:o,left:r,width:l,height:i,bottom:a,right:s}}function St(e){return Ct(e,{ignoreTransform:!0})}function Rt(e,t){const n=[];return e?function o(r){if(null!=t&&n.length>=t||!r)return n;if(Ve(r)&&null!=r.scrollingElement&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!ke(r)||Ae(r)||n.includes(r))return n;const l=Oe(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=Oe(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const o=t[e];return"string"==typeof o&&n.test(o)}))}(r,l)&&n.push(r),function(e,t){return void 0===t&&(t=Oe(e).getComputedStyle(e)),"fixed"===t.position}(r,l)?n:o(r.parentNode)}(e):n}function _t(e){const[t]=Rt(e,1);return t??null}function Et(e){return Ie&&e?Ne(e)?e:Pe(e)?Ve(e)||e===je(e).scrollingElement?window:ke(e)?e:null:null:null}function Dt(e){return Ne(e)?e.scrollX:e.scrollLeft}function Ft(e){return Ne(e)?e.scrollY:e.scrollTop}function Mt(e){return{x:Dt(e),y:Ft(e)}}var It;function Nt(e){return!(!Ie||!e)&&e===document.scrollingElement}function Pt(e){const t={x:0,y:0},n=Nt(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(It||(It={}));const Ot={x:.2,y:.2};function Vt(e,t,n,o,r){let{top:l,left:i,right:a,bottom:s}=n;void 0===o&&(o=10),void 0===r&&(r=Ot);const{isTop:u,isBottom:d,isLeft:c,isRight:g}=Pt(e),p={x:0,y:0},f={x:0,y:0},h=t.height*r.y,m=t.width*r.x;return!u&&l<=t.top+h?(p.y=It.Backward,f.y=o*Math.abs((t.top+h-l)/h)):!d&&s>=t.bottom-h&&(p.y=It.Forward,f.y=o*Math.abs((t.bottom-h-s)/h)),!g&&a>=t.right-m?(p.x=It.Forward,f.x=o*Math.abs((t.right-m-a)/m)):!c&&i<=t.left+m&&(p.x=It.Backward,f.x=o*Math.abs((t.left+m-i)/m)),{direction:p,speed:f}}function kt(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function At(e){return e.reduce(((e,t)=>We(e,Mt(t))),dt)}const jt=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+Dt(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+Ft(t)),0)}]];class zt{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Rt(t),o=At(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of jt)for(const l of t)Object.defineProperty(this,l,{get:()=>{const t=r(n),i=o[e]-t;return this.rect[l]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Lt{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,n){var o;null==(o=this.target)||o.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function Tt(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var Ht,Gt;function Bt(e){e.preventDefault()}function Ut(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(Ht||(Ht={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(Gt||(Gt={}));const $t={start:[Gt.Space,Gt.Enter],cancel:[Gt.Esc],end:[Gt.Space,Gt.Enter]},qt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Gt.Right:return{...n,x:n.x+25};case Gt.Left:return{...n,x:n.x-25};case Gt.Down:return{...n,y:n.y+25};case Gt.Up:return{...n,y:n.y-25}}};class Wt{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Lt(je(t)),this.windowListeners=new Lt(Oe(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ht.Resize,this.handleCancel),this.windowListeners.add(Ht.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(Ht.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=Ct),!e)return;const{top:n,left:o,bottom:r,right:l}=t(e);_t(e)&&(r<=0||l<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(dt)}handleKeyDown(e){if(Ye(e)){const{active:t,context:n,options:o}=this.props,{keyboardCodes:r=$t,coordinateGetter:l=qt,scrollBehavior:i="smooth"}=o,{code:a}=e;if(r.end.includes(a))return void this.handleEnd(e);if(r.cancel.includes(a))return void this.handleCancel(e);const{collisionRect:s}=n.current,u=s?{x:s.left,y:s.top}:dt;this.referenceCoordinates||(this.referenceCoordinates=u);const d=l(e,{active:t,context:n.current,currentCoordinates:u});if(d){const t=Xe(d,u),o={x:0,y:0},{scrollableAncestors:r}=n.current;for(const n of r){const r=e.code,{isTop:l,isRight:a,isLeft:s,isBottom:u,maxScroll:c,minScroll:g}=Pt(n),p=kt(n),f={x:Math.min(r===Gt.Right?p.right-p.width/2:p.right,Math.max(r===Gt.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(r===Gt.Down?p.bottom-p.height/2:p.bottom,Math.max(r===Gt.Down?p.top:p.top+p.height/2,d.y))},h=r===Gt.Right&&!a||r===Gt.Left&&!s,m=r===Gt.Down&&!u||r===Gt.Up&&!l;if(h&&f.x!==d.x){const e=n.scrollLeft+t.x,l=r===Gt.Right&&e<=c.x||r===Gt.Left&&e>=g.x;if(l&&!t.y)return void n.scrollTo({left:e,behavior:i});o.x=l?n.scrollLeft-e:r===Gt.Right?n.scrollLeft-c.x:n.scrollLeft-g.x,o.x&&n.scrollBy({left:-o.x,behavior:i});break}if(m&&f.y!==d.y){const e=n.scrollTop+t.y,l=r===Gt.Down&&e<=c.y||r===Gt.Up&&e>=g.y;if(l&&!t.x)return void n.scrollTo({top:e,behavior:i});o.y=l?n.scrollTop-e:r===Gt.Down?n.scrollTop-c.y:n.scrollTop-g.y,o.y&&n.scrollBy({top:-o.y,behavior:i});break}}this.handleMove(e,We(Xe(d,this.referenceCoordinates),o))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Xt(e){return!(!e||!("distance"in e))}function Yt(e){return!(!e||!("delay"in e))}Wt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=$t,onActivation:r}=t,{active:l}=n;const{code:i}=e.nativeEvent;if(o.start.includes(i)){const t=l.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==r||r({event:e.nativeEvent}),!0)}return!1}}];class Kt{constructor(e,t,n){var o;void 0===n&&(n=function(e){const{EventTarget:t}=Oe(e);return e instanceof t?e:je(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:r}=e,{target:l}=r;this.props=e,this.events=t,this.document=je(l),this.documentListeners=new Lt(this.document),this.listeners=new Lt(n),this.windowListeners=new Lt(Oe(l)),this.initialCoordinates=null!=(o=Ke(r))?o:dt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(Ht.Resize,this.handleCancel),this.windowListeners.add(Ht.DragStart,Bt),this.windowListeners.add(Ht.VisibilityChange,this.handleCancel),this.windowListeners.add(Ht.ContextMenu,Bt),this.documentListeners.add(Ht.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Yt(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(Xt(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Ht.Click,Ut,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ht.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:o,props:r}=this,{onMove:l,options:{activationConstraint:i}}=r;if(!o)return;const a=null!=(t=Ke(e))?t:dt,s=Xe(o,a);if(!n&&i){if(Xt(i)){if(null!=i.tolerance&&Tt(s,i.tolerance))return this.handleCancel();if(Tt(s,i.distance))return this.handleStart()}return Yt(i)&&Tt(s,i.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),l(a)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===Gt.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Jt={move:{name:"pointermove"},end:{name:"pointerup"}};class Zt extends Kt{constructor(e){const{event:t}=e,n=je(t.target);super(e,Jt,n)}}Zt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||0!==n.button)&&(null==o||o({event:n}),!0)}}];const Qt={move:{name:"mousemove"},end:{name:"mouseup"}};var en;!function(e){e[e.RightClick=2]="RightClick"}(en||(en={}));(class extends Kt{constructor(e){super(e,Qt,je(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==en.RightClick&&(null==o||o({event:n}),!0)}}];const tn={move:{name:"touchmove"},end:{name:"touchend"}};var nn,on;function rn(e){let{acceleration:t,activator:o=nn.Pointer,canScroll:a,draggingRect:s,enabled:u,interval:d=5,order:c=on.TreeOrder,pointerCoordinates:g,scrollableAncestors:p,scrollableAncestorRects:f,delta:h,threshold:m}=e;const v=function(e){let{delta:t,disabled:n}=e;const o=Be(t);return He((e=>{if(n||!o||!e)return ln;const r={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[It.Backward]:e.x[It.Backward]||-1===r.x,[It.Forward]:e.x[It.Forward]||1===r.x},y:{[It.Backward]:e.y[It.Backward]||-1===r.y,[It.Forward]:e.y[It.Forward]||1===r.y}}}),[n,t,o])}({delta:h,disabled:!u}),[b,w]=function(){const e=l(null);return[i(((t,n)=>{e.current=setInterval(t,n)}),[]),i((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),y=l({x:0,y:0}),x=l({x:0,y:0}),C=n((()=>{switch(o){case nn.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case nn.DraggableRect:return s}}),[o,s,g]),S=l(null),R=i((()=>{const e=S.current;if(!e)return;const t=y.current.x*x.current.x,n=y.current.y*x.current.y;e.scrollBy(t,n)}),[]),_=n((()=>c===on.TreeOrder?[...p].reverse():p),[c,p]);r((()=>{if(u&&p.length&&C){for(const e of _){if(!1===(null==a?void 0:a(e)))continue;const n=p.indexOf(e),o=f[n];if(!o)continue;const{direction:r,speed:l}=Vt(e,o,C,t,m);for(const e of["x","y"])v[e][r[e]]||(l[e]=0,r[e]=0);if(l.x>0||l.y>0)return w(),S.current=e,b(R,d),y.current=l,void(x.current=r)}y.current={x:0,y:0},x.current={x:0,y:0},w()}else w()}),[t,R,a,w,u,d,JSON.stringify(C),JSON.stringify(v),b,p,_,f,JSON.stringify(m)])}(class extends Kt{constructor(e){super(e,tn)}static setup(){return window.addEventListener(tn.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(tn.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return!(r.length>1)&&(null==o||o({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(nn||(nn={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(on||(on={}));const ln={x:{[It.Backward]:!1,[It.Forward]:!1},y:{[It.Backward]:!1,[It.Forward]:!1}};var an,sn;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(an||(an={})),(sn||(sn={})).Optimized="optimized";const un=new Map;function dn(e,t){return He((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function cn(e){let{callback:t,disabled:o}=e;const l=Le(t),i=n((()=>{if(o||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:e}=window;return new e(l)}),[o]);return r((()=>()=>null==i?void 0:i.disconnect()),[i]),i}function gn(e){return new zt(Ct(e),e)}function pn(e,t,o){void 0===t&&(t=gn);const[l,i]=c((function(n){if(!e)return null;var r;if(!1===e.isConnected)return null!=(r=n??o)?r:null;const l=t(e);return JSON.stringify(n)===JSON.stringify(l)?n:l}),null),a=function(e){let{callback:t,disabled:o}=e;const l=Le(t),i=n((()=>{if(o||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:e}=window;return new e(l)}),[l,o]);return r((()=>()=>null==i?void 0:i.disconnect()),[i]),i}({callback(t){if(e)for(const n of t){const{type:t,target:o}=n;if("childList"===t&&o instanceof HTMLElement&&o.contains(e)){i();break}}}}),s=cn({callback:i});return ze((()=>{i(),e?(null==s||s.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==s||s.disconnect(),null==a||a.disconnect())}),[e]),l}const fn=[];function hn(e,t){void 0===t&&(t=[]);const n=l(null);return r((()=>{n.current=null}),t),r((()=>{const t=e!==dt;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?Xe(e,n.current):dt}function mn(e){return n((()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null),[e])}const vn=[];function bn(e){let{measure:t}=e;const[o,r]=a(null),l=cn({callback:i((e=>{for(const{target:n}of e)if(ke(n)){r((e=>{const o=t(n);return e?{...e,width:o.width,height:o.height}:o}));break}}),[t])}),s=i((e=>{const n=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ke(t)?t:e}(e);null==l||l.disconnect(),n&&(null==l||l.observe(n)),r(n?t(n):null)}),[t,l]),[u,d]=Ge(s);return n((()=>({nodeRef:u,rect:o,setRef:d})),[o,u,d])}const wn=[{sensor:Zt,options:{}},{sensor:Wt,options:{}}],yn={current:{}},xn={draggable:{measure:St},droppable:{measure:St,strategy:an.WhileDragging,frequency:sn.Optimized},dragOverlay:{measure:Ct}};class Cn extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Sn={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Cn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ut},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:xn,measureDroppableContainers:ut,windowRect:null,measuringScheduled:!1},Rn=s({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ut,draggableNodes:new Map,over:null,measureDroppableContainers:ut}),_n=s(Sn);function En(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Cn}}}function Dn(e,t){switch(t.type){case at.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case at.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case at.DragEnd:case at.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case at.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new Cn(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case at.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,l=e.droppable.containers.get(n);if(!l||o!==l.key)return e;const i=new Cn(e.droppable.containers);return i.set(n,{...l,disabled:r}),{...e,droppable:{...e.droppable,containers:i}}}case at.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const l=new Cn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Fn(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:l}=u(Rn),i=Be(o),a=Be(null==n?void 0:n.id);return r((()=>{if(!t&&!o&&i&&null!=a){if(!Ye(i)||document.activeElement===i.target)return;const e=l.get(a);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame((()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=Qe(e);if(t){t.focus();break}}}))}}),[o,t,l,a,i]),null}const Mn=s({...dt,scaleX:1,scaleY:1});var In;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(In||(In={}));const Nn=d((function(e){var o,s,u,d;let{id:g,accessibility:p,autoScroll:f=!0,children:h,sensors:m=wn,collisionDetection:v=vt,measuring:w,modifiers:y,...x}=e;const C=c(Dn,void 0,En),[S,R]=C,[_,E]=function(){const[e]=a((()=>new Set)),t=i((t=>(e.add(t),()=>e.delete(t))),[e]);return[i((t=>{let{type:n,event:o}=t;e.forEach((e=>{var t;return null==(t=e[n])?void 0:t.call(e,o)}))}),[e]),t]}(),[D,F]=a(In.Uninitialized),M=D===In.Initialized,{draggable:{active:I,nodes:N,translate:P},droppable:{containers:O}}=S,V=I?N.get(I):null,k=l({initial:null,translated:null}),A=n((()=>{var e;return null!=I?{id:I,data:null!=(e=null==V?void 0:V.data)?e:yn,rect:k}:null}),[I,V]),j=l(null),[z,L]=a(null),[T,H]=a(null),G=Te(x,Object.values(x)),B=$e("DndDescribedBy",g),U=n((()=>O.getEnabled()),[O]),$=function(e){return n((()=>({draggable:{...xn.draggable,...null==e?void 0:e.draggable},droppable:{...xn.droppable,...null==e?void 0:e.droppable},dragOverlay:{...xn.dragOverlay,...null==e?void 0:e.dragOverlay}})),[null==e?void 0:e.draggable,null==e?void 0:e.droppable,null==e?void 0:e.dragOverlay])}(w),{droppableRects:q,measureDroppableContainers:W,measuringScheduled:X}=function(e,t){let{dragging:n,dependencies:o,config:s}=t;const[u,d]=a(null),{frequency:c,measure:g,strategy:p}=s,f=l(e),h=function(){switch(p){case an.Always:return!1;case an.BeforeDragging:return n;default:return!n}}(),m=Te(h),v=i((function(e){void 0===e&&(e=[]),!m.current&&d((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[m]),b=l(null),w=He((t=>{if(h&&!n)return un;if(!t||t===un||f.current!==e||null!=u){const t=new Map;for(let n of e){if(!n)continue;if(u&&u.length>0&&!u.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,o=e?new zt(g(e),e):null;n.rect.current=o,o&&t.set(n.id,o)}return t}return t}),[e,u,n,h,g]);return r((()=>{f.current=e}),[e]),r((()=>{h||v()}),[n,h]),r((()=>{u&&u.length>0&&d(null)}),[JSON.stringify(u)]),r((()=>{h||"number"!=typeof c||null!==b.current||(b.current=setTimeout((()=>{v(),b.current=null}),c))}),[c,h,v,...o]),{droppableRects:w,measureDroppableContainers:v,measuringScheduled:null!=u}}(U,{dragging:M,dependencies:[P.x,P.y],config:$.droppable}),Y=function(e,t){const n=null!==t?e.get(t):void 0,o=n?n.node.current:null;return He((e=>{var n;return null===t?null:null!=(n=o??e)?n:null}),[o,t])}(N,I),K=n((()=>T?Ke(T):null),[T]),J=function(){const e=!1===(null==z?void 0:z.autoScrollEnabled),t="object"==typeof f?!1===f.enabled:!1===f,n=M&&!e&&!t;return"object"==typeof f?{...f,enabled:n}:{enabled:n}}(),Z=function(e,t){return dn(e,t)}(Y,$.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:o,config:r=!0}=e;const i=l(!1),{x:a,y:s}="boolean"==typeof r?{x:r,y:r}:r;ze((()=>{if(!a&&!s||!t)return void(i.current=!1);if(i.current||!o)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=bt(n(e),o);if(a||(r.x=0),s||(r.y=0),i.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=_t(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,a,s,o,n])}({activeNode:I?N.get(I):null,config:J.layoutShiftCompensation,initialRect:Z,measure:$.draggable.measure});const Q=pn(Y,$.draggable.measure,Z),ee=pn(Y?Y.parentElement:null),te=l({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ne=O.getNodeFor(null==(o=te.current.over)?void 0:o.id),oe=bn({measure:$.dragOverlay.measure}),re=null!=(s=oe.nodeRef.current)?s:Y,le=M?null!=(u=oe.rect)?u:Q:null,ie=!(!oe.nodeRef.current||!oe.rect),ae=function(e){return bt(e,dn(e))}(ie?null:Q),se=mn(re?Oe(re):null),ue=function(e){const t=l(e),n=He((n=>e?n&&n!==fn&&e&&t.current&&e.parentNode===t.current.parentNode?n:Rt(e):fn),[e]);return r((()=>{t.current=e}),[e]),n}(M?ne??Y:null),de=function(e,t){void 0===t&&(t=Ct);const[n]=e,o=mn(n?Oe(n):null),[r,l]=c((function(){return e.length?e.map((e=>Nt(e)?o:new zt(t(e),e))):vn}),vn),i=cn({callback:l});return e.length>0&&r===vn&&l(),ze((()=>{e.length?e.forEach((e=>null==i?void 0:i.observe(e))):(null==i||i.disconnect(),l())}),[e]),r}(ue),ce=function(e,t){let{transform:n,...o}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...o})),n):n}(y,{transform:{x:P.x-ae.x,y:P.y-ae.y,scaleX:1,scaleY:1},activatorEvent:T,active:A,activeNodeRect:Q,containerNodeRect:ee,draggingNodeRect:le,over:te.current.over,overlayNodeRect:oe.rect,scrollableAncestors:ue,scrollableAncestorRects:de,windowRect:se}),ge=K?We(K,P):null,pe=function(e){const[t,o]=a(null),s=l(e),u=i((e=>{const t=Et(e.target);t&&o((e=>e?(e.set(t,Mt(t)),new Map(e)):null))}),[]);return r((()=>{const t=s.current;if(e!==t){n(t);const r=e.map((e=>{const t=Et(e);return t?(t.addEventListener("scroll",u,{passive:!0}),[t,Mt(t)]):null})).filter((e=>null!=e));o(r.length?new Map(r):null),s.current=e}return()=>{n(e),n(t)};function n(e){e.forEach((e=>{const t=Et(e);null==t||t.removeEventListener("scroll",u)}))}}),[u,e]),n((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>We(e,t)),dt):At(e):dt),[e,t])}(ue),fe=hn(pe),he=hn(pe,[Q]),me=We(ce,fe),ve=le?yt(le,ce):null,be=A&&ve?v({active:A,collisionRect:ve,droppableRects:q,droppableContainers:U,pointerCoordinates:ge}):null,we=function(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}(be,"id"),[ye,xe]=a(null),Ce=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ie?ce:We(ce,he),null!=(d=null==ye?void 0:ye.rect)?d:null,Q),Se=i(((e,t)=>{let{sensor:n,options:o}=t;if(null==j.current)return;const r=N.get(j.current);if(!r)return;const l=e.nativeEvent,i=new n({active:j.current,activeNode:r,event:l,options:o,context:te,onStart(e){const t=j.current;if(null==t)return;const n=N.get(t);if(!n)return;const{onDragStart:o}=G.current,r={active:{id:t,data:n.data,rect:k}};b((()=>{null==o||o(r),F(In.Initializing),R({type:at.DragStart,initialCoordinates:e,active:t}),_({type:"onDragStart",event:r})}))},onMove(e){R({type:at.DragMove,coordinates:e})},onEnd:a(at.DragEnd),onCancel:a(at.DragCancel)});function a(e){return async function(){const{active:t,collisions:n,over:o,scrollAdjustedTranslate:r}=te.current;let i=null;if(t&&r){const{cancelDrop:a}=G.current;i={activatorEvent:l,active:t,collisions:n,delta:r,over:o},e===at.DragEnd&&"function"==typeof a&&await Promise.resolve(a(i))&&(e=at.DragCancel)}j.current=null,b((()=>{R({type:e}),F(In.Uninitialized),xe(null),L(null),H(null);const t=e===at.DragEnd?"onDragEnd":"onDragCancel";if(i){const e=G.current[t];null==e||e(i),_({type:t,event:i})}}))}}b((()=>{L(i),H(e.nativeEvent)}))}),[N]),Re=function(e,t){return n((()=>e.reduce(((e,n)=>{const{sensor:o}=n;return[...e,...o.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,n)})))]}),[])),[e,t])}(m,i(((e,t)=>(n,o)=>{const r=n.nativeEvent,l=N.get(o);if(null!==j.current||!l||r.dndKit||r.defaultPrevented)return;const i={active:l};!0===e(n,t.options,i)&&(r.dndKit={capturedBy:t.sensor},j.current=o,Se(n,t))}),[N,Se]));(function(e){r((()=>{if(!Ie)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))})(m),ze((()=>{Q&&D===In.Initializing&&F(In.Initialized)}),[Q,D]),r((()=>{const{onDragMove:e}=G.current,{active:t,activatorEvent:n,collisions:o,over:r}=te.current;if(!t||!n)return;const l={active:t,activatorEvent:n,collisions:o,delta:{x:me.x,y:me.y},over:r};b((()=>{null==e||e(l),_({type:"onDragMove",event:l})}))}),[me.x,me.y]),r((()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:o,scrollAdjustedTranslate:r}=te.current;if(!e||null==j.current||!t||!r)return;const{onDragOver:l}=G.current,i=o.get(we),a=i&&i.rect.current?{id:i.id,rect:i.rect.current,data:i.data,disabled:i.disabled}:null,s={active:e,activatorEvent:t,collisions:n,delta:{x:r.x,y:r.y},over:a};b((()=>{xe(a),null==l||l(s),_({type:"onDragOver",event:s})}))}),[we]),ze((()=>{te.current={activatorEvent:T,active:A,activeNode:Y,collisionRect:ve,collisions:be,droppableRects:q,draggableNodes:N,draggingNode:re,draggingNodeRect:le,droppableContainers:O,over:ye,scrollableAncestors:ue,scrollAdjustedTranslate:me},k.current={initial:le,translated:ve}}),[A,Y,be,ve,N,re,le,q,O,ye,ue,me]),rn({...J,delta:P,draggingRect:ve,pointerCoordinates:ge,scrollableAncestors:ue,scrollableAncestorRects:de});const _e=n((()=>({active:A,activeNode:Y,activeNodeRect:Q,activatorEvent:T,collisions:be,containerNodeRect:ee,dragOverlay:oe,draggableNodes:N,droppableContainers:O,droppableRects:q,over:ye,measureDroppableContainers:W,scrollableAncestors:ue,scrollableAncestorRects:de,measuringConfiguration:$,measuringScheduled:X,windowRect:se})),[A,Y,Q,T,be,ee,oe,N,O,q,ye,W,ue,de,$,X,se]),Ee=n((()=>({activatorEvent:T,activators:Re,active:A,activeNodeRect:Q,ariaDescribedById:{draggable:B},dispatch:R,draggableNodes:N,over:ye,measureDroppableContainers:W})),[T,Re,A,Q,R,B,N,ye,W]);return t.createElement(ot.Provider,{value:E},t.createElement(Rn.Provider,{value:Ee},t.createElement(_n.Provider,{value:_e},t.createElement(Mn.Provider,{value:Ce},h)),t.createElement(Fn,{disabled:!1===(null==p?void 0:p.restoreFocus)})),t.createElement(it,{...p,hiddenTextDescribedById:B}))})),Pn=s(null),On="button",Vn="Droppable";function kn(e){let{id:t,data:o,disabled:r=!1,attributes:l}=e;const i=$e(Vn),{activators:a,activatorEvent:s,active:d,activeNodeRect:c,ariaDescribedById:g,draggableNodes:p,over:f}=u(Rn),{role:h=On,roleDescription:m="draggable",tabIndex:v=0}=l??{},b=(null==d?void 0:d.id)===t,w=u(b?Mn:Pn),[y,x]=Ge(),[C,S]=Ge(),R=function(e,t){return n((()=>e.reduce(((e,n)=>{let{eventName:o,handler:r}=n;return e[o]=e=>{r(e,t)},e}),{})),[e,t])}(a,t),_=Te(o);ze((()=>(p.set(t,{id:t,key:i,node:y,activatorNode:C,data:_}),()=>{const e=p.get(t);e&&e.key===i&&p.delete(t)})),[p,t]);return{active:d,activatorEvent:s,activeNodeRect:c,attributes:n((()=>({role:h,tabIndex:v,"aria-disabled":r,"aria-pressed":!(!b||h!==On)||void 0,"aria-roledescription":m,"aria-describedby":g.draggable})),[r,h,v,b,m,g.draggable]),isDragging:b,listeners:r?void 0:R,node:y,over:f,setNodeRef:x,setActivatorNodeRef:S,transform:w}}const An="Droppable",jn={timeout:25};function zn(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function Ln(e,t){return e.reduce(((e,n,o)=>{const r=t.get(n);return r&&(e[o]=r),e}),Array(e.length))}function Tn(e){return null!==e&&e>=0}const Hn=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const l=zn(t,o,n),i=t[r],a=l[r];return a&&i?{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}:null},Gn={scaleX:1,scaleY:1},Bn=e=>{var t;let{activeIndex:n,activeNodeRect:o,index:r,rects:l,overIndex:i}=e;const a=null!=(t=l[n])?t:o;if(!a)return null;if(r===n){const e=l[i];return e?{x:0,y:n<i?e.top+e.height-(a.top+a.height):e.top-a.top,...Gn}:null}const s=function(e,t,n){const o=e[t],r=e[t-1],l=e[t+1];return o?n<t?r?o.top-(r.top+r.height):l?l.top-(o.top+o.height):0:l?l.top-(o.top+o.height):r?o.top-(r.top+r.height):0:0}(l,r,n);return r>n&&r<=i?{x:0,y:-a.height-s,...Gn}:r<n&&r>=i?{x:0,y:a.height+s,...Gn}:{x:0,y:0,...Gn}};const Un="Sortable",$n=t.createContext({activeIndex:-1,containerId:Un,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Hn,disabled:{draggable:!1,droppable:!1}});function qn(e){let{children:o,id:i,items:a,strategy:s=Hn,disabled:d=!1}=e;const{active:c,dragOverlay:g,droppableRects:p,over:f,measureDroppableContainers:h}=u(_n),m=$e(Un,i),v=null!==g.rect,b=n((()=>a.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[a]),w=null!=c,y=c?b.indexOf(c.id):-1,x=f?b.indexOf(f.id):-1,C=l(b),S=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(b,C.current),R=-1!==x&&-1===y||S,_=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(d);ze((()=>{S&&w&&h(b)}),[S,b,w,h]),r((()=>{C.current=b}),[b]);const E=n((()=>({activeIndex:y,containerId:m,disabled:_,disableTransforms:R,items:b,overIndex:x,useDragOverlay:v,sortedRects:Ln(b,p),strategy:s})),[y,m,_.draggable,_.droppable,R,b,x,p,v,s]);return t.createElement($n.Provider,{value:E},o)}const Wn=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return zn(n,o,r).indexOf(t)},Xn=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:l,newIndex:i,previousItems:a,previousContainerId:s,transition:u}=e;return!(!u||!o||a!==l&&r===i)&&(!!n||i!==r&&t===s)},Yn={duration:200,easing:"ease"},Kn="transform",Jn=Je.Transition.toString({property:Kn,duration:0,easing:"linear"}),Zn={roleDescription:"sortable"};function Qn(e){let{animateLayoutChanges:t=Xn,attributes:o,disabled:s,data:d,getNewIndex:c=Wn,id:g,strategy:p,resizeObserverConfig:f,transition:h=Yn}=e;const{items:m,containerId:v,activeIndex:b,disabled:w,disableTransforms:y,sortedRects:x,overIndex:C,useDragOverlay:S,strategy:R}=u($n),_=function(e,t){var n,o;return"boolean"==typeof e?{draggable:e,droppable:!1}:{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(o=null==e?void 0:e.droppable)?o:t.droppable}}(s,w),E=m.indexOf(g),D=n((()=>({sortable:{containerId:v,index:E,items:m},...d})),[v,d,E,m]),F=n((()=>m.slice(m.indexOf(g))),[m,g]),{rect:M,node:I,isOver:N,setNodeRef:P}=function(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:a}=e;const s=$e(An),{active:d,dispatch:c,over:g,measureDroppableContainers:p}=u(Rn),f=l({disabled:n}),h=l(!1),m=l(null),v=l(null),{disabled:b,updateMeasurementsFor:w,timeout:y}={...jn,...a},x=Te(w??o),C=cn({callback:i((()=>{h.current?(null!=v.current&&clearTimeout(v.current),v.current=setTimeout((()=>{p(Array.isArray(x.current)?x.current:[x.current]),v.current=null}),y)):h.current=!0}),[y]),disabled:b||!d}),S=i(((e,t)=>{C&&(t&&(C.unobserve(t),h.current=!1),e&&C.observe(e))}),[C]),[R,_]=Ge(S),E=Te(t);return r((()=>{!C||!R.current||(C.disconnect(),h.current=!1,C.observe(R.current))}),[R,C]),ze((()=>(c({type:at.RegisterDroppable,element:{id:o,key:s,disabled:n,node:R,rect:m,data:E}}),()=>c({type:at.UnregisterDroppable,key:s,id:o}))),[o]),r((()=>{n!==f.current.disabled&&(c({type:at.SetDroppableDisabled,id:o,key:s,disabled:n}),f.current.disabled=n)}),[o,s,n,c]),{active:d,rect:m,isOver:(null==g?void 0:g.id)===o,node:R,over:g,setNodeRef:_}}({id:g,data:D,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:F,...f}}),{active:O,activatorEvent:V,activeNodeRect:k,attributes:A,setNodeRef:j,listeners:z,isDragging:L,over:T,setActivatorNodeRef:H,transform:G}=kn({id:g,data:D,attributes:{...Zn,...o},disabled:_.draggable}),B=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return n((()=>e=>{t.forEach((t=>t(e)))}),t)}(P,j),U=!!O,$=U&&!y&&Tn(b)&&Tn(C),q=!S&&L,W=$?(q&&$?G:null)??(p??R)({rects:x,activeNodeRect:k,activeIndex:b,overIndex:C,index:E}):null,X=Tn(b)&&Tn(C)?c({id:g,items:m,activeIndex:b,overIndex:C}):E,Y=null==O?void 0:O.id,K=l({activeId:Y,items:m,newIndex:X,containerId:v}),J=m!==K.current.items,Z=t({active:O,containerId:v,isDragging:L,isSorting:U,id:g,index:E,items:m,newIndex:K.current.newIndex,previousItems:K.current.items,previousContainerId:K.current.containerId,transition:h,wasDragging:null!=K.current.activeId}),Q=function(e){let{disabled:t,index:n,node:o,rect:i}=e;const[s,u]=a(null),d=l(n);return ze((()=>{if(!t&&n!==d.current&&o.current){const e=i.current;if(e){const t=Ct(o.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&u(n)}}n!==d.current&&(d.current=n)}),[t,n,o,i]),r((()=>{s&&u(null)}),[s]),s}({disabled:!Z,index:E,node:I,rect:M});return r((()=>{U&&K.current.newIndex!==X&&(K.current.newIndex=X),v!==K.current.containerId&&(K.current.containerId=v),m!==K.current.items&&(K.current.items=m)}),[U,X,v,m]),r((()=>{if(Y===K.current.activeId)return;if(Y&&!K.current.activeId)return void(K.current.activeId=Y);const e=setTimeout((()=>{K.current.activeId=Y}),50);return()=>clearTimeout(e)}),[Y]),{active:O,activeIndex:b,attributes:A,data:D,rect:M,index:E,newIndex:X,items:m,isOver:N,isSorting:U,isDragging:L,listeners:z,node:I,overIndex:C,over:T,setNodeRef:B,setActivatorNodeRef:H,setDroppableNodeRef:P,setDraggableNodeRef:j,transform:Q??W,transition:function(){if(Q||J&&K.current.newIndex===E)return Jn;if((!q||Ye(V))&&h&&(U||Z))return Je.Transition.toString({...h,property:Kn})}()}}function eo({styledTableProps:e,row:t,index:o}){const{focusable:r,loading:l,getRowClassName:i,rowHeight:a,onRowClick:s,expandArrow:u,enableDnd:d,tdClassName:c,customSubRowData:p,renderSubRows:f}=e,{transform:h,transition:m,setNodeRef:v,isDragging:b}=Qn({id:t.original.id,disabled:!d}),w={transform:Je.Transform.toString(h),transition:m,opacity:b?.8:1,zIndex:b?1:0,position:"relative"},y=t.getVisibleCells(),x=n((()=>y.map(((e,t)=>({...e,left:y.slice(0,t).reduce(((e,t)=>e+(t.column.getSize()||0)),0)})))),[y]),C=n((()=>x.some((e=>!0===e.column.columnDef.fixedLeft))),[x]);return I.jsxs(g,{children:[I.jsx("tr",{"data-index":o,"data-test":t.id,id:t.id,tabIndex:r?-1:void 0,className:Me(De["t-row"],l&&De["is-loading"],(t.getIsExpanded()||t.getIsSelected())&&De.selected,null==i?void 0:i(t)),style:{height:a?`${a}px`:"inherit",...d&&w},ref:v,onMouseUp:e=>{var n,o;if(e.target.classList.contains("MuiModal-backdrop")||"INPUT"===e.target.nodeName||"BUTTON"===e.target.nodeName)return;t.getCanExpand()&&!u&&t.getToggleExpandedHandler()(),null==(n=document.getElementById(t.id))||n.focus();const r="Range"===(null==(o=window.getSelection())?void 0:o.type);s&&!r&&s(e,t)},children:x.map((e=>{const n="actions"===e.column.id,o=e.column.columnDef.fixedLeft;return I.jsx("td",{className:Me(De["t-cell"],c,n&&De["action-cell"],n&&C&&De.shadowed,n&&(t.getIsExpanded()||t.getIsSelected())&&De.selected,n&&(null!=i&&i(t)?null==i?void 0:i(t):De["action-cell-default-background"]),o&&De["fixed-cell"],o&&(t.getIsExpanded()||t.getIsSelected())&&De.selected,o&&(null!=i&&i(t)?null==i?void 0:i(t):De["fixed-cell-default-background"])),style:o?{left:e.left}:{},children:Ee(e.column.columnDef.cell,e.getContext())},e.id)}))}),t.getIsExpanded()&&I.jsx(I.Fragment,{children:p&&f&&f({rows:p.get(t.original.id.toString())??[],row:t.original})})]},t.id)}function to({styledTableProps:e,table:t}){const n=e.hideFooter?t.getCoreRowModel().rows:t.getRowModel().rows;return I.jsx(I.Fragment,{children:n.map(((t,n)=>I.jsx(eo,{styledTableProps:e,row:t,index:n},t.id)))})}Gt.Down,Gt.Right,Gt.Up,Gt.Left;const no=({colSpan:e,noRowsOverlay:t})=>I.jsx("tr",{className:De["no-rows-overlay"],children:I.jsx("td",{colSpan:e,children:t})});function oo(e){return I.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:[I.jsx("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:.5}),I.jsx("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z",children:I.jsx("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})})]})}function ro({table:e,styledTableProps:t}){const{columns:n,data:o,loading:r,noRowsOverlay:l,enableDnd:i}=t;return I.jsxs("tbody",{className:De.tbody,children:[o.length>0&&r&&I.jsx(oo,{className:De["loading-icon"],width:50,height:50}),0===o.length&&r?I.jsx(N,{colSpan:n.length}):o.length>0?I.jsx(I.Fragment,{children:i?I.jsx(qn,{items:o,strategy:Bn,children:I.jsx(to,{table:e,styledTableProps:t})}):I.jsx(to,{table:e,styledTableProps:t})}):I.jsx(no,{colSpan:n.length,noRowsOverlay:l})]})}const lo=()=>{const[e,t]=a(null),n=!!e,o=i((e=>{t(e.currentTarget)}),[]);return{open:n,handleClose:i((()=>{t(null)}),[]),handleOpen:o,anchorEl:e}};function io(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z"})})}function ao(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6l-6-6z"})})}function so(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"M8.59 16.58L13.17 12L8.59 7.41L10 6l6 6l-6 6z"})})}const uo={"table-pagination":"_table-pagination_k2a41_1","table-pagination__pages-list":"_table-pagination__pages-list_k2a41_13","table-pagination__pages-list__page":"_table-pagination__pages-list__page_k2a41_18","page-selected":"_page-selected_k2a41_29","check-icon":"_check-icon_k2a41_32"};function co(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"M15.41 16.58L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function go(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z"})})}const po="_asma-core-ui-button_1r2np_1",fo={contained:"_contained_1r2np_27",outlined:"_outlined_1r2np_141",text:"_text_1r2np_255",textGray:"_textGray_1r2np_369",textWhite:"_textWhite_1r2np_426",large:"_large_1r2np_79",small:"_small_1r2np_74",medium:"_medium_1r2np_69",error:"_error_1r2np_84",common:"_common_1r2np_27"},ho=({variant:e="contained",className:t="",size:n="medium",children:o,refLink:r,startIcon:l,endIcon:i,dataTest:a,error:s,...u})=>{const d="large"===n||"medium"===n,c=s?"error":"common";return I.jsxs("button",{...u,className:Me(po,fo[e],fo[c],fo[n],t),ref:r,"data-test":a,children:[l,o&&I.jsx("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",justifyContent:"center",gap:d?"8px":"4px",paddingLeft:d?"8px":"4px",paddingRight:d?"8px":"4px"},children:o}),i]})};function mo({table:e,locale:t}){const{anchorEl:n,open:o,handleClose:r,handleOpen:i}=lo(),a=l(null),s="no"===t,u=De["asma-ui-table-styled-table"],d=()=>{var e,t,n,o;null==(o=null==(n=null==(t=null==(e=null==a?void 0:a.current)?void 0:e.closest(`.${u}`))?void 0:t.querySelectorAll('[data-index="0"]'))?void 0:n[0])||o.scrollIntoView({block:"center",inline:"start"})},c=e.getPageCount(),g=e.getState().pagination.pageIndex+1,p=Array.from({length:c},((e,t)=>t+1));return c>1?I.jsxs("div",{ref:a,className:uo["table-pagination"],children:[I.jsx(f,{title:s?"Nåværende side":"Current Page",children:I.jsx("div",{children:I.jsxs(ho,{dataTest:"",variant:"outlined",style:{minWidth:"140px"},onClick:e=>{i(e)},endIcon:o?I.jsx(io,{height:24,width:24}):I.jsx(ao,{height:24,width:24}),children:[s?"Side":"Page"," ",g," ",s?"av":"of"," ",c]})})}),I.jsx(h,{open:o,anchorEl:n,onClose:r,anchorOrigin:{vertical:-5,horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"},children:I.jsx("div",{className:uo["table-pagination__pages-list"],children:p.map((t=>I.jsxs("div",{className:Me(uo["table-pagination__pages-list__page"],g===t&&"page-selected"),onClick:()=>{e.setPageIndex(t-1),r(),d()},children:[g===t&&I.jsx(go,{className:uo["check-icon"],height:24,width:24}),I.jsxs("span",{children:[s?"Side":"Page"," ",t]})]},t)))})}),I.jsx(f,{title:1===g?"":s?"Forrige side":"Previous Page",children:I.jsx("div",{children:I.jsx(ho,{dataTest:"",variant:"outlined",onClick:()=>{e.previousPage(),d()},disabled:!e.getCanPreviousPage(),style:{minWidth:40,width:40},startIcon:I.jsx(co,{height:24,width:24})})})}),I.jsx(f,{title:g===c?"":s?"Neste side":"Next Page",children:I.jsx("div",{children:I.jsx(ho,{dataTest:"",variant:"outlined",onClick:()=>{e.nextPage(),d()},disabled:!e.getCanNextPage(),style:{minWidth:40,width:40},startIcon:I.jsx(so,{height:24,width:24})})})})]}):null}function vo({table:e,styledTableProps:t}){var n;return t.hideFooter?null:I.jsxs("div",{className:De["table-footer"],children:[null==(n=t.footer)?void 0:n.call(t,e),I.jsx(mo,{table:e,locale:t.locale||"en"})]})}const bo=t=>{const{columns:n,data:o,initialState:r,pageSize:l,enableRowSelection:i,tableInstanceRef:a,...s}=t,u=function(t){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[o]=e.useState((()=>({current:xe(n)}))),[r,l]=e.useState((()=>o.current.initialState));return o.current.setOptions((e=>({...e,...t,state:{...r,...t.state},onStateChange:e=>{l(e),null==t.onStateChange||t.onStateChange(e)}}))),o.current}({columns:n,data:o,initialState:{pagination:{pageIndex:0,pageSize:l||50},columnVisibility:{...null==r?void 0:r.columnVisibility,[x]:!1},...r},enableRowSelection:i,getCoreRowModel:e=>k((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,r,l){void 0===r&&(r=0);const i=[];for(let s=0;s<t.length;s++){const u=Ce(e,e._getRowId(t[s],s,l),t[s],s,r,void 0,null==l?void 0:l.id);var a;n.flatRows.push(u),n.rowsById[u.id]=u,i.push(u),e.options.getSubRows&&(u.originalSubRows=e.options.getSubRows(t[s],s),null!=(a=u.originalSubRows)&&a.length&&(u.subRows=o(u.originalSubRows,r+1,u)))}return i};return n.rows=o(t),n}),{key:"development"===process.env.NODE_ENV&&"getRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}}),getExpandedRowModel:e=>k((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>t.rows.length&&(!0===e||Object.keys(e??{}).length)&&n?_e(t):t),{key:"development"===process.env.NODE_ENV&&"getExpandedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),getFilteredRowModel:e=>k((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,o)=>{if(!t.rows.length||(null==n||!n.length)&&!o){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const r=[],l=[];(n??[]).forEach((t=>{var n;const o=e.getColumn(t.id);if(!o)return;const l=o.getFilterFn();l?r.push({id:t.id,filterFn:l,resolvedValue:null!=(n=null==l.resolveFilterValue?void 0:l.resolveFilterValue(t.value))?n:t.value}):"production"!==process.env.NODE_ENV&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${o.id}.`)}));const i=n.map((e=>e.id)),a=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let u,d;o&&a&&s.length&&(i.push("__global__"),s.forEach((e=>{var t;l.push({id:e.id,filterFn:a,resolvedValue:null!=(t=null==a.resolveFilterValue?void 0:a.resolveFilterValue(o))?t:o})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},r.length)for(let e=0;e<r.length;e++){u=r[e];const t=u.id;n.columnFilters[t]=u.filterFn(n,t,u.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(l.length){for(let e=0;e<l.length;e++){d=l[e];const t=d.id;if(d.filterFn(n,t,d.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return Re(t.rows,(e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0}),e)}),{key:"development"===process.env.NODE_ENV&&"getFilteredRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}}),getSortedRowModel:e=>k((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const o=e.getState().sorting,r=[],l=o.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),i={};l.forEach((t=>{const n=e.getColumn(t.id);n&&(i[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const a=e=>{const t=[...e];return t.sort(((e,t)=>{for(let o=0;o<l.length;o+=1){var n;const r=l[o],a=i[r.id],s=null!=(n=null==r?void 0:r.desc)&&n;let u=0;if(a.sortUndefined){const n=void 0===e.getValue(r.id),o=void 0===t.getValue(r.id);(n||o)&&(u=n&&o?0:n?a.sortUndefined:-a.sortUndefined)}if(0===u&&(u=a.sortingFn(e,t,r.id)),0!==u)return s&&(u*=-1),a.invertSorting&&(u*=-1),u}return e.index-t.index})),t.forEach((e=>{var t;r.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=a(e.subRows))})),t};return{rows:a(n.rows),flatRows:r,rowsById:n.rowsById}}),{key:"development"===process.env.NODE_ENV&&"getSortedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}}),getPaginationRowModel:e=>k((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:o,pageIndex:r}=t;let{rows:l,flatRows:i,rowsById:a}=n;const s=o*r,u=s+o;let d;l=l.slice(s,u),d=e.options.paginateExpandedRows?{rows:l,flatRows:i,rowsById:a}:_e({rows:l,flatRows:i,rowsById:a}),d.flatRows=[];const c=e=>{d.flatRows.push(e),e.subRows.length&&e.subRows.forEach(c)};return d.rows.forEach(c),d}),{key:"development"===process.env.NODE_ENV&&"getPaginationRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),getRowId:s.getRowId||((e,t,n)=>n?[n.id,e.id].join("."):e.id.toString()),defaultColumn:t.enableResizing?{size:void 0}:void 0,...s});return a&&(a.current=u),{table:u}},wo=({dataTest:e,...t})=>I.jsx(m,{...t,"data-test":e,sx:{...t.sx,"&.MuiCheckbox-root":{color:"var(--colors-delta-500) !important"},"&.MuiCheckbox-root.Mui-checked":{color:"var(--colors-gama-500) !important"},"&.MuiCheckbox-root.MuiCheckbox-indeterminate":{color:"var(--colors-gama-500) !important"},"&.MuiCheckbox-root.Mui-disabled":{color:"var(--colors-delta-200) !important"},"&.MuiCheckbox-root .PrivateSwitchBase-input":{height:"100% !important",width:"100% !important"}}});function yo(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"M12 16a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2m0-6a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2m0-6a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2"})})}const xo=e=>{var t;return I.jsx(v,{...e,classes:{root:Me("px-3 py-2.5",null==(t=e.classes)?void 0:t.root),...e.classes}})};function Co({tableData:e,actions:n}){const{anchorEl:o,open:r,handleClose:l,handleOpen:i}=lo(),a=n(e.row);return I.jsx("div",{className:"flex justify-center items-center w-[42px]",children:a.length?I.jsxs(I.Fragment,{children:[I.jsx(ho,{dataTest:"",variant:"text",onClick:e=>{e.stopPropagation(),e.preventDefault(),i(e)},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onMouseUp:e=>{e.stopPropagation(),e.preventDefault()},children:I.jsx(yo,{className:"text-delta-800",width:20,height:20})}),I.jsx(h,{open:r,anchorEl:o,onClose:l,onClick:l,anchorOrigin:{horizontal:"center",vertical:"bottom"},transformOrigin:{vertical:"top",horizontal:"right"},children:n(e.row).map(((n,o)=>{if(y(n)){const r=n.component(e.row,l);return t.isValidElement(r)?I.jsx(t.Fragment,{children:r},o):null}return n.hide?null:I.jsx(xo,{className:n.className,disabled:n.disabled,onClick:()=>{var t;null==(t=n.onClick)||t.call(n,e.row)},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onMouseUp:e=>{e.stopPropagation(),e.preventDefault()},children:n.label},o)}))})]}):null})}function So(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16 9V4h2V2H6v2h2v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1l1-1v-7H19v-2c-1.66 0-3-1.34-3-3"})})}function Ro({headerData:e}){const{anchorEl:t,open:n,handleClose:o,handleOpen:r}=lo();return I.jsxs("div",{className:"w-full flex items-center justify-end",children:[I.jsx("div",{className:"px-2.5 h-[30px] flex items-center justify-center cursor-pointer",onClick:r,children:I.jsx(So,{className:"text-delta-500 hover:text-delta-600 min-w-[20px] min-h-[20px]"})}),I.jsx(h,{anchorEl:t,anchorOrigin:{horizontal:"left",vertical:"bottom"},open:n,onClose:o,sx:{"& .MuiPaper-root":{maxHeight:"calc(7 * 44px)",overflowY:"auto",scrollbarWidth:"thin"}},children:e.table.getAllLeafColumns().filter((e=>e.getCanHide()&&e.id!==x)).map((e=>e.columnDef.header?I.jsxs(xo,{onClick:()=>e.toggleVisibility(!e.getIsVisible()),className:"h-[44px]",children:[I.jsx(wo,{size:"small",dataTest:"test",disableRipple:!0,className:"p-0 pr-2",checked:e.getIsVisible()}),"string"==typeof e.columnDef.header?e.columnDef.header:e.id]},e.id):null))})]})}function _o(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",...e,children:I.jsx("path",{fill:"currentColor",d:"M14 6.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 0 0-3 0m-5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 0 0-3 0M5.5 8a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3m8.5 5.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 0 0-3 0M10.5 15a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3M4 13.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 0 0-3 0"})})}const Eo=({rowId:e})=>{const{attributes:t,listeners:n}=Qn({id:e});return I.jsx("div",{...t,...n,children:I.jsx(_o,{width:24,height:24,className:"text-delta-800"})})},Do=e=>{const{columns:t,actions:n,customActionsNode:o,headerPin:r=!0,enableRowSelection:l,expandArrow:i,enableDnd:a,customDndColumnProps:s}=e;!t.find((e=>"actions"===e.id))&&(n||o||r)&&t.push(function(e){const{headerPin:t,actions:n,customActionsNode:o}=e;return{id:"actions",enableHiding:!1,enableSorting:!1,accessorFn:e=>e,header:e=>t?I.jsx(Ro,{headerData:e}):null,cell:e=>n||o?I.jsxs("div",{className:"flex items-center justify-end",children:[o&&I.jsx("div",{className:"mr-1",children:null==o?void 0:o(e)}),n&&I.jsx(Co,{tableData:e,actions:n})]}):null,size:50}}({headerPin:r,actions:n,customActionsNode:o})),l&&!t.find((e=>e.id===x))&&t.unshift({id:x,minSize:40,maxSize:40,size:40,header:({table:e})=>I.jsx("div",{className:"w-[25px]",children:I.jsx(wo,{size:"small",dataTest:"cell-select-all",checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler()})}),cell:({cell:e})=>I.jsx("div",{className:"w-[25px]",children:I.jsx(wo,{size:"small",dataTest:"cell-select",checked:e.row.getIsSelected(),disabled:!e.row.getCanSelect(),onClick:e=>e.stopPropagation(),onChange:e.row.getToggleSelectedHandler()})})}),i&&!t.find((e=>e.id===C))&&t.unshift({id:C,minSize:50,maxSize:50,size:50,enableHiding:!1,enableSorting:!1,header:()=>null,cell:({cell:e})=>{const t=e.row.getIsExpanded();return e.row.getCanExpand()?I.jsx("span",{className:"flex h-fit w-full outline-none focus:outline-none items-center justify-center",onClick:()=>e.row.getToggleExpandedHandler()(),children:t?I.jsx(io,{width:24,height:24}):I.jsx(ao,{width:24,height:24})}):null}}),a&&!t.find((e=>e.id===R))&&t.unshift(function(e){return{enableHiding:!1,enableSorting:!1,header:()=>null,cell:({row:e})=>I.jsx(Eo,{rowId:e.id}),...e,id:R}}(s))};function Fo(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"m7 14l5-5l5 5z"})})}function Mo(e){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:I.jsx("path",{fill:"currentColor",d:"m7 10l5 5l5-5z"})})}const Io=e=>{var t;const{header:n,enableResizing:o,element:r}=e;let l=n.getSize();if(!o){l&&(l=`${l}px`);const e="actions"===(null==(t=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}(n.headerGroup.headers))?void 0:t.id),o=n.headerGroup.headers[n.headerGroup.headers.length-(e?2:1)];return((null==o?void 0:o.id)===n.id||!l)&&(l="100%"),{width:l||n.column.columnDef.size,maxWidth:l||n.column.columnDef.maxSize,minWidth:l||n.column.columnDef.minSize}}const i=n.column.columnDef.size,a=n.column.columnDef.minSize;return{width:i,maxWidth:n.column.columnDef.maxSize,minWidth:a}};function No({styledTableProps:e,header:t,tableCanResize:n=!1,left:o,hasFixedLeftColumn:r}){const{hideHeader:i=!1,enableResizing:a=!1}=e,s=l(null);return I.jsx("th",{ref:s,colSpan:t.colSpan,className:Me(De["t-cell"],"actions"===t.column.id&&De["t-cell__actions"],r&&"actions"===t.column.id&&De.shadowed,!0===t.column.columnDef.fixedLeft&&De["t-cell__fixed"]),style:{...Io({enableResizing:a,header:t,element:s.current}),...t.column.columnDef.fixedLeft&&{left:o}},children:I.jsxs("div",{className:Me("flex items-center justify-left",i?De["hide-table-header"]:De["show-table-header"],t.column.getCanSort()&&De["sortable-column"],t.column.columnDef.className),onClick:t.column.getToggleSortingHandler(),children:[Ee(t.column.columnDef.header,t.getContext()),{asc:I.jsx(Fo,{className:De["sort-icon"]}),desc:I.jsx(Mo,{className:De["sort-icon"]})}[t.column.getIsSorted()]??null,n&&t.column.getCanResize()&&![x,C,S].includes(t.column.id)&&I.jsx("div",{onDoubleClick:()=>t.column.resetSize(),onMouseDown:t.getResizeHandler(),onTouchStart:t.getResizeHandler(),className:`${De.resizer} ${t.column.getIsResizing()?De.isResizing:""}`})]})},t.id)}function Po({table:e,styledTableProps:t,tableCanResize:n}){const{stickyHeader:o=!1,hideHeader:r=!1}=t;if(t.loading)return null;const l=e.getHeaderGroups().some((e=>e.headers.some((e=>!0===e.column.columnDef.fixedLeft))));return I.jsx("thead",{className:Me(De["table-header"],r&&De["hide-table-header"]),style:o&&{position:"sticky",top:-.2}||{},children:e.getHeaderGroups().map((e=>I.jsx("tr",{children:e.headers.map(((o,r)=>{const i=o.column.columnDef.fixedLeft,a=e.headers.slice(0,r).reduce(((e,t)=>e+(t.column.getSize()||0)),0);return I.jsx(No,{styledTableProps:t,header:o,tableCanResize:n,left:i?a:0,hasFixedLeftColumn:l},o.column.id)}))},e.id)))})}const Oo=e=>{let{transform:t}=e;return{...t,x:0}},Vo=({data:e,setData:t,children:o})=>{const r=n((()=>null==e?void 0:e.map((e=>e.id))),[e]);return I.jsx(Nn,{collisionDetection:ht,modifiers:[Oo],onDragEnd:function(e){if(!t)return;const{active:n,over:o}=e;n&&o&&n.id!==o.id&&t((e=>zn(e,r.indexOf(n.id),r.indexOf(o.id))))},children:o})},ko=({data:e,setData:t,enableDnd:n,children:o})=>n?I.jsx(Vo,{data:e,setData:t,children:o}):I.jsx(I.Fragment,{children:o}),Ao=e=>{const{className:t,height:o,data:r,enableDnd:l,setData:i}=e;Do(e);const{table:a}=bo(e),s=n((()=>{var t,n;if(!e.enableColumnResizing)return;const o=a.getFlatHeaders(),r={};for(let e=0;e<o.length;e++){const t=o[e];r[`--header-${t.id}-size`]=t.getSize(),r[`--col-${t.column.id}-size`]=t.column.getSize()}return null==(t=e.getTableState)||t.call(e,a.getState()),null==(n=e.getColumnSizing)||n.call(e,a.getState().columnSizing),r}),[e.enableColumnResizing,a.getState().columnSizingInfo,a.getState().columnSizing]);return I.jsx(ko,{enableDnd:!!l,data:r,setData:i,children:I.jsxs("div",{className:De["asma-ui-table-styled-table"],children:[I.jsx("div",{className:Me(De["table-wrapper"],t),style:{height:o},children:I.jsxs("table",{className:De["styled-table"],style:{...s},children:[I.jsx(Po,{table:a,styledTableProps:e,tableCanResize:!!e.enableColumnResizing}),s?I.jsx(I.Fragment,{children:a.getState().columnSizingInfo.isResizingColumn?I.jsx(jo,{table:a,styledTableProps:e}):I.jsx(ro,{table:a,styledTableProps:e})}):I.jsx(ro,{table:a,styledTableProps:e})]})}),I.jsx(vo,{table:a,styledTableProps:e})]})})},jo=d(ro,((e,t)=>e.table.options.data===t.table.options.data));export{S as ACTIONS_COLUMN_ID,R as DND_HANDLE_COLUMN_ID,C as EXPAND_COLUMN_ID,jo as MemoizedTableBody,Eo as RowDragHandleCell,x as SELECT_COLUMN_ID,Ao as StyledTable,Se as createColumnHelper,y as isCustomAction};
|
package/dist/src/index.d.ts
CHANGED