asma-ui-table 1.0.17-nikolaev → 1.0.17-nikolaev1

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.
@@ -38,4 +38,4 @@ import*as e from"react";import t,{useMemo as n,useLayoutEffect as o,useEffect as
38
38
  *
39
39
  * @license MIT
40
40
  */
41
- function Fe(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 Me={"asma-ui-table-styled-table":"_asma-ui-table-styled-table_hpbqi_1","table-wrapper":"_table-wrapper_hpbqi_10","styled-table":"_styled-table_hpbqi_14",tbody:"_tbody_hpbqi_23","loading-icon":"_loading-icon_hpbqi_28","t-row":"_t-row_hpbqi_34","action-cell":"_action-cell_hpbqi_50","fixed-cell":"_fixed-cell_hpbqi_53","t-cell":"_t-cell_hpbqi_65",non_expanded_row:"_non_expanded_row_hpbqi_99",selected:"_selected_hpbqi_123",shadowed:"_shadowed_hpbqi_126","is-loading":"_is-loading_hpbqi_142","action-cell-default-background":"_action-cell-default-background_hpbqi_145","fixed-cell-default-background":"_fixed-cell-default-background_hpbqi_148","no-rows-overlay":"_no-rows-overlay_hpbqi_151","hide-table-header":"_hide-table-header_hpbqi_160","show-table-header":"_show-table-header_hpbqi_164","sortable-column":"_sortable-column_hpbqi_169",resizer:"_resizer_hpbqi_173",isResizing:"_isResizing_hpbqi_185","table-header":"_table-header_hpbqi_197","t-cell__actions":"_t-cell__actions_hpbqi_217","t-cell__fixed":"_t-cell__fixed_hpbqi_225","sort-icon":"_sort-icon_hpbqi_232","table-footer":"_table-footer_hpbqi_235"};function Ie(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=Ie(e[t]))&&(o&&(o+=" "),o+=n);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function Ne(){for(var e,t,n=0,o="";n<arguments.length;)(e=arguments[n++])&&(t=Ie(e))&&(o&&(o+=" "),o+=t);return o}const Pe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Oe(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Ve(e){return"nodeType"in e}function ke(e){var t,n;return e?Oe(e)?e:Ve(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function Ae(e){const{Document:t}=ke(e);return e instanceof t}function je(e){return!Oe(e)&&e instanceof ke(e).HTMLElement}function Le(e){return e instanceof ke(e).SVGElement}function ze(e){return e?Oe(e)?e.document:Ve(e)?Ae(e)?e:je(e)||Le(e)?e.ownerDocument:document:document:document}const Te=Pe?o:r;function He(e){const t=l(e);return Te((()=>{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 Ge(e,t){void 0===t&&(t=[e]);const n=l(e);return Te((()=>{n.current!==e&&(n.current=e)}),t),n}function Be(e,t){const o=l();return n((()=>{const t=e(o.current);return o.current=t,t}),[...t])}function qe(e){const t=He(e),n=l(null),o=i((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,o]}function Ue(e){const t=l();return r((()=>{t.current=e}),[e]),t.current}let $e={};function We(e,t){return n((()=>{if(t)return t;const n=null==$e[e]?0:$e[e]+1;return $e[e]=n,e+"-"+n}),[e,t])}function Xe(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 Ye=Xe(1),Ke=Xe(-1);function Je(e){if(!e)return!1;const{KeyboardEvent:t}=ke(e.target);return t&&e instanceof t}function Ze(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=ke(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 Qe=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[Qe.Translate.toString(e),Qe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),et="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function tt(e){return e.matches(et)?e:e.querySelector(et)}const nt={display:"none"};function ot(e){let{id:n,value:o}=e;return t.createElement("div",{id:n,style:nt},o)}function rt(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 lt=s(null);const it={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 "},at={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 st(e){let{announcements:o=at,container:l,hiddenTextDescribedById:s,screenReaderInstructions:d=it}=e;const{announce:c,announcement:g}=function(){const[e,t]=a("");return{announce:i((e=>{null!=e&&t(e)}),[]),announcement:e}}(),p=We("DndLiveRegion"),[f,h]=a(!1);if(r((()=>{h(!0)}),[]),function(e){const t=u(lt);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(ot,{id:s,value:d.draggable}),t.createElement(rt,{id:p,announcement:g}));return l?w(m,l):m}var ut,dt;function ct(){}(dt=ut||(ut={})).DragStart="dragStart",dt.DragMove="dragMove",dt.DragEnd="dragEnd",dt.DragCancel="dragCancel",dt.DragOver="dragOver",dt.RegisterDroppable="registerDroppable",dt.SetDroppableDisabled="setDroppableDisabled",dt.UnregisterDroppable="unregisterDroppable";const gt=Object.freeze({x:0,y:0});function pt(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ft(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function ht(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function mt(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 vt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=mt(t,t.left,t.top),l=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=pt(mt(o),r);l.push({id:t,data:{droppableContainer:e,value:n}})}}return l.sort(ft)};function bt(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 wt=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=bt(l,t);n>0&&r.push({id:o,data:{droppableContainer:e,value:n}})}}return r.sort(ht)};function yt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:gt}function xt(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 Ct=xt(1);const St={ignoreTransform:!1};function Rt(e,t){void 0===t&&(t=St);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:o}=ke(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 _t(e){return Rt(e,{ignoreTransform:!0})}function Et(e,t){const n=[];return e?function o(r){if(null!=t&&n.length>=t||!r)return n;if(Ae(r)&&null!=r.scrollingElement&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!je(r)||Le(r)||n.includes(r))return n;const l=ke(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=ke(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=ke(e).getComputedStyle(e)),"fixed"===t.position}(r,l)?n:o(r.parentNode)}(e):n}function Dt(e){const[t]=Et(e,1);return t??null}function Ft(e){return Pe&&e?Oe(e)?e:Ve(e)?Ae(e)||e===ze(e).scrollingElement?window:je(e)?e:null:null:null}function Mt(e){return Oe(e)?e.scrollX:e.scrollLeft}function It(e){return Oe(e)?e.scrollY:e.scrollTop}function Nt(e){return{x:Mt(e),y:It(e)}}var Pt;function Ot(e){return!(!Pe||!e)&&e===document.scrollingElement}function Vt(e){const t={x:0,y:0},n=Ot(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"}(Pt||(Pt={}));const kt={x:.2,y:.2};function At(e,t,n,o,r){let{top:l,left:i,right:a,bottom:s}=n;void 0===o&&(o=10),void 0===r&&(r=kt);const{isTop:u,isBottom:d,isLeft:c,isRight:g}=Vt(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=Pt.Backward,f.y=o*Math.abs((t.top+h-l)/h)):!d&&s>=t.bottom-h&&(p.y=Pt.Forward,f.y=o*Math.abs((t.bottom-h-s)/h)),!g&&a>=t.right-m?(p.x=Pt.Forward,f.x=o*Math.abs((t.right-m-a)/m)):!c&&i<=t.left+m&&(p.x=Pt.Backward,f.x=o*Math.abs((t.left+m-i)/m)),{direction:p,speed:f}}function jt(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 Lt(e){return e.reduce(((e,t)=>Ye(e,Nt(t))),gt)}const zt=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+Mt(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+It(t)),0)}]];class Tt{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=Et(t),o=Lt(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of zt)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 Ht{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 Gt(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 Bt,qt;function Ut(e){e.preventDefault()}function $t(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"}(Bt||(Bt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(qt||(qt={}));const Wt={start:[qt.Space,qt.Enter],cancel:[qt.Esc],end:[qt.Space,qt.Enter]},Xt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case qt.Right:return{...n,x:n.x+25};case qt.Left:return{...n,x:n.x-25};case qt.Down:return{...n,y:n.y+25};case qt.Up:return{...n,y:n.y-25}}};class Yt{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 Ht(ze(t)),this.windowListeners=new Ht(ke(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Bt.Resize,this.handleCancel),this.windowListeners.add(Bt.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(Bt.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=Rt),!e)return;const{top:n,left:o,bottom:r,right:l}=t(e);Dt(e)&&(r<=0||l<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(gt)}handleKeyDown(e){if(Je(e)){const{active:t,context:n,options:o}=this.props,{keyboardCodes:r=Wt,coordinateGetter:l=Xt,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}:gt;this.referenceCoordinates||(this.referenceCoordinates=u);const d=l(e,{active:t,context:n.current,currentCoordinates:u});if(d){const t=Ke(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}=Vt(n),p=jt(n),f={x:Math.min(r===qt.Right?p.right-p.width/2:p.right,Math.max(r===qt.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(r===qt.Down?p.bottom-p.height/2:p.bottom,Math.max(r===qt.Down?p.top:p.top+p.height/2,d.y))},h=r===qt.Right&&!a||r===qt.Left&&!s,m=r===qt.Down&&!u||r===qt.Up&&!l;if(h&&f.x!==d.x){const e=n.scrollLeft+t.x,l=r===qt.Right&&e<=c.x||r===qt.Left&&e>=g.x;if(l&&!t.y)return void n.scrollTo({left:e,behavior:i});o.x=l?n.scrollLeft-e:r===qt.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===qt.Down&&e<=c.y||r===qt.Up&&e>=g.y;if(l&&!t.x)return void n.scrollTo({top:e,behavior:i});o.y=l?n.scrollTop-e:r===qt.Down?n.scrollTop-c.y:n.scrollTop-g.y,o.y&&n.scrollBy({top:-o.y,behavior:i});break}}this.handleMove(e,Ye(Ke(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 Kt(e){return!(!e||!("distance"in e))}function Jt(e){return!(!e||!("delay"in e))}Yt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=Wt,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 Zt{constructor(e,t,n){var o;void 0===n&&(n=function(e){const{EventTarget:t}=ke(e);return e instanceof t?e:ze(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=ze(l),this.documentListeners=new Ht(this.document),this.listeners=new Ht(n),this.windowListeners=new Ht(ke(l)),this.initialCoordinates=null!=(o=Ze(r))?o:gt,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(Bt.Resize,this.handleCancel),this.windowListeners.add(Bt.DragStart,Ut),this.windowListeners.add(Bt.VisibilityChange,this.handleCancel),this.windowListeners.add(Bt.ContextMenu,Ut),this.documentListeners.add(Bt.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Jt(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(Kt(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(Bt.Click,$t,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Bt.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=Ze(e))?t:gt,s=Ke(o,a);if(!n&&i){if(Kt(i)){if(null!=i.tolerance&&Gt(s,i.tolerance))return this.handleCancel();if(Gt(s,i.distance))return this.handleStart()}return Jt(i)&&Gt(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===qt.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Qt={move:{name:"pointermove"},end:{name:"pointerup"}};class en extends Zt{constructor(e){const{event:t}=e,n=ze(t.target);super(e,Qt,n)}}en.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 tn={move:{name:"mousemove"},end:{name:"mouseup"}};var nn;!function(e){e[e.RightClick=2]="RightClick"}(nn||(nn={}));(class extends Zt{constructor(e){super(e,tn,ze(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==nn.RightClick&&(null==o||o({event:n}),!0)}}];const on={move:{name:"touchmove"},end:{name:"touchend"}};var rn,ln;function an(e){let{acceleration:t,activator:o=rn.Pointer,canScroll:a,draggingRect:s,enabled:u,interval:d=5,order:c=ln.TreeOrder,pointerCoordinates:g,scrollableAncestors:p,scrollableAncestorRects:f,delta:h,threshold:m}=e;const v=function(e){let{delta:t,disabled:n}=e;const o=Ue(t);return Be((e=>{if(n||!o||!e)return sn;const r={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[Pt.Backward]:e.x[Pt.Backward]||-1===r.x,[Pt.Forward]:e.x[Pt.Forward]||1===r.x},y:{[Pt.Backward]:e.y[Pt.Backward]||-1===r.y,[Pt.Forward]:e.y[Pt.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 rn.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case rn.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===ln.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}=At(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 Zt{constructor(e){super(e,on)}static setup(){return window.addEventListener(on.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(on.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"}(rn||(rn={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(ln||(ln={}));const sn={x:{[Pt.Backward]:!1,[Pt.Forward]:!1},y:{[Pt.Backward]:!1,[Pt.Forward]:!1}};var un,dn;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(un||(un={})),(dn||(dn={})).Optimized="optimized";const cn=new Map;function gn(e,t){return Be((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function pn(e){let{callback:t,disabled:o}=e;const l=He(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 fn(e){return new Tt(Rt(e),e)}function hn(e,t,o){void 0===t&&(t=fn);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=He(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=pn({callback:i});return Te((()=>{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 mn=[];function vn(e,t){void 0===t&&(t=[]);const n=l(null);return r((()=>{n.current=null}),t),r((()=>{const t=e!==gt;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?Ke(e,n.current):gt}function bn(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 wn=[];function yn(e){let{measure:t}=e;const[o,r]=a(null),l=pn({callback:i((e=>{for(const{target:n}of e)if(je(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 je(t)?t:e}(e);null==l||l.disconnect(),n&&(null==l||l.observe(n)),r(n?t(n):null)}),[t,l]),[u,d]=qe(s);return n((()=>({nodeRef:u,rect:o,setRef:d})),[o,u,d])}const xn=[{sensor:en,options:{}},{sensor:Yt,options:{}}],Cn={current:{}},Sn={draggable:{measure:_t},droppable:{measure:_t,strategy:un.WhileDragging,frequency:dn.Optimized},dragOverlay:{measure:Rt}};class Rn 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 _n={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Rn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ct},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Sn,measureDroppableContainers:ct,windowRect:null,measuringScheduled:!1},En=s({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ct,draggableNodes:new Map,over:null,measureDroppableContainers:ct}),Dn=s(_n);function Fn(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Rn}}}function Mn(e,t){switch(t.type){case ut.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ut.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 ut.DragEnd:case ut.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ut.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new Rn(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case ut.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 Rn(e.droppable.containers);return i.set(n,{...l,disabled:r}),{...e,droppable:{...e.droppable,containers:i}}}case ut.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const l=new Rn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function In(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:l}=u(En),i=Ue(o),a=Ue(null==n?void 0:n.id);return r((()=>{if(!t&&!o&&i&&null!=a){if(!Je(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=tt(e);if(t){t.focus();break}}}))}}),[o,t,l,a,i]),null}const Nn=s({...gt,scaleX:1,scaleY:1});var Pn;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Pn||(Pn={}));const On=d((function(e){var o,s,u,d;let{id:g,accessibility:p,autoScroll:f=!0,children:h,sensors:m=xn,collisionDetection:v=wt,measuring:w,modifiers:y,...x}=e;const C=c(Mn,void 0,Fn),[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(Pn.Uninitialized),M=D===Pn.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:Cn,rect:k}:null}),[I,V]),j=l(null),[L,z]=a(null),[T,H]=a(null),G=Ge(x,Object.values(x)),B=We("DndDescribedBy",g),q=n((()=>O.getEnabled()),[O]),U=function(e){return n((()=>({draggable:{...Sn.draggable,...null==e?void 0:e.draggable},droppable:{...Sn.droppable,...null==e?void 0:e.droppable},dragOverlay:{...Sn.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:$,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 un.Always:return!1;case un.BeforeDragging:return n;default:return!n}}(),m=Ge(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=Be((t=>{if(h&&!n)return cn;if(!t||t===cn||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 Tt(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}}(q,{dragging:M,dependencies:[P.x,P.y],config:U.droppable}),Y=function(e,t){const n=null!==t?e.get(t):void 0,o=n?n.node.current:null;return Be((e=>{var n;return null===t?null:null!=(n=o??e)?n:null}),[o,t])}(N,I),K=n((()=>T?Ze(T):null),[T]),J=function(){const e=!1===(null==L?void 0:L.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 gn(e,t)}(Y,U.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;Te((()=>{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=yt(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=Dt(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:U.draggable.measure});const Q=hn(Y,U.draggable.measure,Z),ee=hn(Y?Y.parentElement:null),te=l({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:$,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=yn({measure:U.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 yt(e,gn(e))}(ie?null:Q),se=bn(re?ke(re):null),ue=function(e){const t=l(e),n=Be((n=>e?n&&n!==mn&&e&&t.current&&e.parentNode===t.current.parentNode?n:Et(e):mn),[e]);return r((()=>{t.current=e}),[e]),n}(M?ne??Y:null),de=function(e,t){void 0===t&&(t=Rt);const[n]=e,o=bn(n?ke(n):null),[r,l]=c((function(){return e.length?e.map((e=>Ot(e)?o:new Tt(t(e),e))):wn}),wn),i=pn({callback:l});return e.length>0&&r===wn&&l(),Te((()=>{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?Ye(K,P):null,pe=function(e){const[t,o]=a(null),s=l(e),u=i((e=>{const t=Ft(e.target);t&&o((e=>e?(e.set(t,Nt(t)),new Map(e)):null))}),[]);return r((()=>{const t=s.current;if(e!==t){n(t);const r=e.map((e=>{const t=Ft(e);return t?(t.addEventListener("scroll",u,{passive:!0}),[t,Nt(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=Ft(e);null==t||t.removeEventListener("scroll",u)}))}}),[u,e]),n((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>Ye(e,t)),gt):Lt(e):gt),[e,t])}(ue),fe=vn(pe),he=vn(pe,[Q]),me=Ye(ce,fe),ve=le?Ct(le,ce):null,be=A&&ve?v({active:A,collisionRect:ve,droppableRects:$,droppableContainers:q,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:Ye(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(Pn.Initializing),R({type:ut.DragStart,initialCoordinates:e,active:t}),_({type:"onDragStart",event:r})}))},onMove(e){R({type:ut.DragMove,coordinates:e})},onEnd:a(ut.DragEnd),onCancel:a(ut.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===ut.DragEnd&&"function"==typeof a&&await Promise.resolve(a(i))&&(e=ut.DragCancel)}j.current=null,b((()=>{R({type:e}),F(Pn.Uninitialized),xe(null),z(null),H(null);const t=e===ut.DragEnd?"onDragEnd":"onDragCancel";if(i){const e=G.current[t];null==e||e(i),_({type:t,event:i})}}))}}b((()=>{z(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(!Pe)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),Te((()=>{Q&&D===Pn.Initializing&&F(Pn.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]),Te((()=>{te.current={activatorEvent:T,active:A,activeNode:Y,collisionRect:ve,collisions:be,droppableRects:$,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,$,O,ye,ue,me]),an({...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:$,over:ye,measureDroppableContainers:W,scrollableAncestors:ue,scrollableAncestorRects:de,measuringConfiguration:U,measuringScheduled:X,windowRect:se})),[A,Y,Q,T,be,ee,oe,N,O,$,ye,W,ue,de,U,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(lt.Provider,{value:E},t.createElement(En.Provider,{value:Ee},t.createElement(Dn.Provider,{value:_e},t.createElement(Nn.Provider,{value:Ce},h)),t.createElement(In,{disabled:!1===(null==p?void 0:p.restoreFocus)})),t.createElement(st,{...p,hiddenTextDescribedById:B}))})),Vn=s(null),kn="button",An="Droppable";function jn(e){let{id:t,data:o,disabled:r=!1,attributes:l}=e;const i=We(An),{activators:a,activatorEvent:s,active:d,activeNodeRect:c,ariaDescribedById:g,draggableNodes:p,over:f}=u(En),{role:h=kn,roleDescription:m="draggable",tabIndex:v=0}=l??{},b=(null==d?void 0:d.id)===t,w=u(b?Nn:Vn),[y,x]=qe(),[C,S]=qe(),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),_=Ge(o);Te((()=>(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!==kn)||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 Ln="Droppable",zn={timeout:25};function Tn(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function Hn(e,t){return e.reduce(((e,n,o)=>{const r=t.get(n);return r&&(e[o]=r),e}),Array(e.length))}function Gn(e){return null!==e&&e>=0}const Bn=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const l=Tn(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},qn={scaleX:1,scaleY:1},Un=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,...qn}: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,...qn}:r<n&&r>=i?{x:0,y:a.height+s,...qn}:{x:0,y:0,...qn}};const $n="Sortable",Wn=t.createContext({activeIndex:-1,containerId:$n,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Bn,disabled:{draggable:!1,droppable:!1}});function Xn(e){let{children:o,id:i,items:a,strategy:s=Bn,disabled:d=!1}=e;const{active:c,dragOverlay:g,droppableRects:p,over:f,measureDroppableContainers:h}=u(Dn),m=We($n,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);Te((()=>{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:Hn(b,p),strategy:s})),[y,m,_.draggable,_.droppable,R,b,x,p,v,s]);return t.createElement(Wn.Provider,{value:E},o)}const Yn=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return Tn(n,o,r).indexOf(t)},Kn=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)},Jn={duration:200,easing:"ease"},Zn="transform",Qn=Qe.Transition.toString({property:Zn,duration:0,easing:"linear"}),eo={roleDescription:"sortable"};function to(e){let{animateLayoutChanges:t=Kn,attributes:o,disabled:s,data:d,getNewIndex:c=Yn,id:g,strategy:p,resizeObserverConfig:f,transition:h=Jn}=e;const{items:m,containerId:v,activeIndex:b,disabled:w,disableTransforms:y,sortedRects:x,overIndex:C,useDragOverlay:S,strategy:R}=u(Wn),_=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=We(Ln),{active:d,dispatch:c,over:g,measureDroppableContainers:p}=u(En),f=l({disabled:n}),h=l(!1),m=l(null),v=l(null),{disabled:b,updateMeasurementsFor:w,timeout:y}={...zn,...a},x=Ge(w??o),C=pn({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,_]=qe(S),E=Ge(t);return r((()=>{!C||!R.current||(C.disconnect(),h.current=!1,C.observe(R.current))}),[R,C]),Te((()=>(c({type:ut.RegisterDroppable,element:{id:o,key:s,disabled:n,node:R,rect:m,data:E}}),()=>c({type:ut.UnregisterDroppable,key:s,id:o}))),[o]),r((()=>{n!==f.current.disabled&&(c({type:ut.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:L,isDragging:z,over:T,setActivatorNodeRef:H,transform:G}=jn({id:g,data:D,attributes:{...eo,...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),q=!!O,U=q&&!y&&Gn(b)&&Gn(C),$=!S&&z,W=U?($&&U?G:null)??(p??R)({rects:x,activeNodeRect:k,activeIndex:b,overIndex:C,index:E}):null,X=Gn(b)&&Gn(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:z,isSorting:q,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 Te((()=>{if(!t&&n!==d.current&&o.current){const e=i.current;if(e){const t=Rt(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((()=>{q&&K.current.newIndex!==X&&(K.current.newIndex=X),v!==K.current.containerId&&(K.current.containerId=v),m!==K.current.items&&(K.current.items=m)}),[q,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:q,isDragging:z,listeners:L,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 Qn;if((!$||Je(V))&&h&&(q||Z))return Qe.Transition.toString({...h,property:Zn})}()}}function no(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.jsx("path",{fill:"currentColor",d:"M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6l-6-6z"})})}qt.Down,qt.Right,qt.Up,qt.Left;const oo=s(void 0),ro=({children:e})=>{const[t,n]=a(new Set);return P.jsx(oo.Provider,{value:{expandedRows:t,toggleExpand:e=>{n((t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}))}},children:e})},lo=()=>{const e=u(oo);if(void 0===e)throw new Error("useShowFullText must be used within a ShowFullTextProvider");return e};function io({info:e,rowHeight:t}){const{expandedRows:n,toggleExpand:o}=lo(),r=n.has(e.row.id);return P.jsx("div",{className:"flex w-full items-center justify-center",style:{height:t||"auto"},onClick:()=>o(e.row.id),onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>{e.preventDefault(),e.stopPropagation()},children:P.jsx("div",{style:{rotate:r?"180deg":"0deg",transitionTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",transitionDuration:"500ms"},children:P.jsx(no,{width:20,height:20,color:"var(--colors-gray-700)"})})})}function ao({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}=to({id:t.original.id,disabled:!d}),w={transform:Qe.Transform.toString(h),transition:m,opacity:b?.8:1,zIndex:b?1:0,position:"relative"},{expandedRows:y}=lo(),x=t.getVisibleCells(),C=n((()=>x.map(((e,t)=>({...e,left:x.slice(0,t).reduce(((e,t)=>e+(t.column.getSize()||0)),0)})))),[x]),S=n((()=>C.some((e=>!0===e.column.columnDef.fixedLeft))),[C]);return P.jsxs(g,{children:[P.jsx("tr",{"data-index":o,"data-test":t.id,id:t.id,tabIndex:r?-1:void 0,className:Ne(Me["t-row"],l&&Me["is-loading"],(t.getIsExpanded()||t.getIsSelected())&&Me.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:C.map((e=>{const n="actions"===e.column.id,o=e.column.columnDef.fixedLeft,r=y.has(t.original.id.toString()),l=e.column.id,s=E.includes(l),u=a?(a-20)/2:0;return P.jsx("td",{className:Ne(Me["t-cell"],c,n&&Me["action-cell"],n&&S&&Me.shadowed,n&&(t.getIsExpanded()||t.getIsSelected())&&Me.selected,n&&(null!=i&&i(t)?null==i?void 0:i(t):Me["action-cell-default-background"]),o&&Me["fixed-cell"],o&&(t.getIsExpanded()||t.getIsSelected())&&Me.selected,o&&(null!=i&&i(t)?null==i?void 0:i(t):Me["fixed-cell-default-background"]),!r&&Me.non_expanded_row),style:{left:o?e.left:void 0},children:P.jsx("div",{style:{paddingBlock:s?0:u},children:Fe(e.column.columnDef.cell,e.getContext())})},e.id)}))}),t.getIsExpanded()&&P.jsx(P.Fragment,{children:p&&f&&f({rows:p.get(t.original.id.toString())??[],row:t.original})})]},t.id)}function so({styledTableProps:e,table:t}){const n=e.hideFooter?t.getCoreRowModel().rows:t.getRowModel().rows;return P.jsx(P.Fragment,{children:n.map(((t,n)=>P.jsx(ao,{styledTableProps:e,row:t,index:n},t.id)))})}const uo=({colSpan:e,noRowsOverlay:t})=>P.jsx("tr",{className:Me["no-rows-overlay"],children:P.jsx("td",{colSpan:e,children:t})});function co(e){return P.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:[P.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}),P.jsx("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z",children:P.jsx("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})})]})}function go({table:e,styledTableProps:t}){const{columns:n,data:o,loading:r,noRowsOverlay:l,enableDnd:i}=t;return P.jsxs("tbody",{className:Me.tbody,children:[o.length>0&&r&&P.jsx(co,{className:Me["loading-icon"],width:50,height:50}),0===o.length&&r?P.jsx(O,{colSpan:n.length}):o.length>0?P.jsx(P.Fragment,{children:i?P.jsx(Xn,{items:o,strategy:Un,children:P.jsx(so,{table:e,styledTableProps:t})}):P.jsx(so,{table:e,styledTableProps:t})}):P.jsx(uo,{colSpan:n.length,noRowsOverlay:l})]})}const po=()=>{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 fo(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.jsx("path",{fill:"currentColor",d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z"})})}function ho(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.jsx("path",{fill:"currentColor",d:"M8.59 16.58L13.17 12L8.59 7.41L10 6l6 6l-6 6z"})})}const mo={"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 vo(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.jsx("path",{fill:"currentColor",d:"M15.41 16.58L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function bo(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.jsx("path",{fill:"currentColor",d:"M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z"})})}const wo="_asma-core-ui-button_1r2np_1",yo={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"},xo=({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 P.jsxs("button",{...u,className:Ne(wo,yo[e],yo[c],yo[n],t),ref:r,"data-test":a,children:[l,o&&P.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 Co({table:e,locale:t}){const{anchorEl:n,open:o,handleClose:r,handleOpen:i}=po(),a=l(null),s="no"===t,u=Me["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 P.jsxs("div",{ref:a,className:mo["table-pagination"],children:[P.jsx(f,{title:s?"Nåværende side":"Current Page",children:P.jsx("div",{children:P.jsxs(xo,{dataTest:"",variant:"outlined",style:{minWidth:"140px"},onClick:e=>{i(e)},endIcon:o?P.jsx(fo,{height:24,width:24}):P.jsx(no,{height:24,width:24}),children:[s?"Side":"Page"," ",g," ",s?"av":"of"," ",c]})})}),P.jsx(h,{open:o,anchorEl:n,onClose:r,anchorOrigin:{vertical:-5,horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"},children:P.jsx("div",{className:mo["table-pagination__pages-list"],children:p.map((t=>P.jsxs("div",{className:Ne(mo["table-pagination__pages-list__page"],g===t&&"page-selected"),onClick:()=>{e.setPageIndex(t-1),r(),d()},children:[g===t&&P.jsx(bo,{className:mo["check-icon"],height:24,width:24}),P.jsxs("span",{children:[s?"Side":"Page"," ",t]})]},t)))})}),P.jsx(f,{title:1===g?"":s?"Forrige side":"Previous Page",children:P.jsx("div",{children:P.jsx(xo,{dataTest:"",variant:"outlined",onClick:()=>{e.previousPage(),d()},disabled:!e.getCanPreviousPage(),style:{minWidth:40,width:40},startIcon:P.jsx(vo,{height:24,width:24})})})}),P.jsx(f,{title:g===c?"":s?"Neste side":"Next Page",children:P.jsx("div",{children:P.jsx(xo,{dataTest:"",variant:"outlined",onClick:()=>{e.nextPage(),d()},disabled:!e.getCanNextPage(),style:{minWidth:40,width:40},startIcon:P.jsx(ho,{height:24,width:24})})})})]})}function So({table:e,styledTableProps:t}){var n;return t.hideFooter?null:P.jsxs("div",{className:Me["table-footer"],children:[null==(n=t.footer)?void 0:n.call(t,e),P.jsx(Co,{table:e,locale:t.locale||"en"})]})}const Ro=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:Se(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=>j((()=>[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=Re(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=>j((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>t.rows.length&&(!0===e||Object.keys(e??{}).length)&&n?De(t):t),{key:"development"===process.env.NODE_ENV&&"getExpandedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),getFilteredRowModel:e=>j((()=>[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 Ee(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=>j((()=>[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=>j((()=>[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}:De({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}},_o=({dataTest:e,...t})=>P.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 Eo(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.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 Do=e=>{var t;return P.jsx(v,{...e,classes:{root:Ne("px-3 py-2.5",null==(t=e.classes)?void 0:t.root),...e.classes}})};function Fo({tableData:e,actions:n}){const{anchorEl:o,open:r,handleClose:l,handleOpen:i}=po(),a=n(e.row);return P.jsx("div",{className:"flex justify-center items-center w-[42px]",children:a.length?P.jsxs(P.Fragment,{children:[P.jsx(xo,{dataTest:"",variant:"text",onClick:e=>{e.stopPropagation(),e.preventDefault(),i(e)},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onMouseUp:e=>{e.stopPropagation(),e.preventDefault()},children:P.jsx(Eo,{className:"text-delta-800",width:20,height:20})}),P.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)?P.jsx(t.Fragment,{children:r},o):null}return n.hide?null:P.jsx(Do,{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 Mo(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.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 Io({headerData:e}){const{anchorEl:t,open:n,handleClose:o,handleOpen:r}=po();return P.jsxs("div",{className:"flex absolute-center items-center justify-center ",children:[P.jsx("div",{className:"h-[30px] flex items-center justify-center cursor-pointer",onClick:r,children:P.jsx(Mo,{className:"text-delta-500 hover:text-delta-600 min-w-[20px] min-h-[20px]"})}),P.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?P.jsxs(Do,{onClick:()=>e.toggleVisibility(!e.getIsVisible()),className:"h-[44px]",children:[P.jsx(_o,{size:"small",dataTest:"test",disableRipple:!0,className:"p-0 pr-2",checked:e.getIsVisible()}),e.columnDef.pinnedHeaderText?e.columnDef.pinnedHeaderText:"string"==typeof e.columnDef.header?e.columnDef.header:e.id]},e.id):null))})]})}function No(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",...e,children:P.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 Po=({rowId:e,rowHeight:t})=>{const{attributes:n,listeners:o}=to({id:e});return P.jsx("div",{...n,...o,style:{height:t||"auto"},children:P.jsx(No,{width:24,height:24,className:"text-delta-800"})})},Oo=e=>{const{columns:t,actions:n,customActionsNode:o,headerPin:r=!0,enableRowSelection:l,expandArrow:i,enableDnd:a,customDndColumnProps:s,rowHeight:u,textExpandArrow:d}=e,c=t.some((e=>!0===e.fixedLeft));!t.find((e=>"actions"===e.id))&&(n||o||r)&&t.push(function(e){const{headerPin:t,actions:n,customActionsNode:o,rowHeight:r}=e;return{id:"actions",enableHiding:!1,enableSorting:!1,accessorFn:e=>e,header:e=>t?P.jsx(Io,{headerData:e}):null,cell:e=>n||o?P.jsxs("div",{className:"flex items-center justify-center",style:{height:r||"auto"},children:[o&&P.jsx("div",{className:"mr-1",children:null==o?void 0:o(e)}),n&&P.jsx(Fo,{tableData:e,actions:n})]}):null,size:50}}({headerPin:r,actions:n,customActionsNode:o,rowHeight:u})),d&&!t.find((e=>e.id===_))&&t.unshift(function(e,t){return{id:_,minSize:40,maxSize:40,size:40,enableHiding:!1,enableSorting:!1,header:()=>null,cell:e=>P.jsx(io,{info:e,rowHeight:t}),fixedLeft:e}}(c,u)),i&&!d&&!t.find((e=>e.id===C))&&t.unshift(function(e,t){return{id:C,minSize:50,maxSize:50,size:50,enableHiding:!1,enableSorting:!1,header:()=>null,cell:({cell:e})=>{const n=e.row.getIsExpanded();return e.row.getCanExpand()?P.jsx("span",{className:"flex w-full outline-none focus:outline-none items-center justify-center",onClick:()=>e.row.getToggleExpandedHandler()(),style:{height:t||"auto"},children:P.jsx(no,{width:24,height:24,style:{rotate:n?"180deg":"0deg",transitionTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",transitionDuration:"500ms"}})}):null},fixedLeft:e}}(c,u)),a&&!t.find((e=>e.id===R))&&t.unshift(function(e,t){return{enableHiding:!1,enableSorting:!1,header:()=>null,cell:({row:e})=>P.jsx(Po,{rowId:e.id,rowHeight:t}),...e,id:R}}(s,u)),l&&!t.find((e=>e.id===x))&&t.unshift(function(e,t){return{id:x,minSize:52,maxSize:52,size:52,header:({table:e})=>P.jsx(_o,{size:"small",dataTest:"cell-select-all",checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler()}),cell:({cell:e})=>P.jsx("div",{className:"w-[38px] h-[38px] flex items-center",style:{height:t||"auto"},children:P.jsx(_o,{size:"small",dataTest:"cell-select",checked:e.row.getIsSelected(),disabled:!e.row.getCanSelect(),onClick:e=>e.stopPropagation(),onChange:e.row.getToggleSelectedHandler()})}),fixedLeft:e}}(c,u))};function Vo(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.jsx("path",{fill:"currentColor",d:"m7 14l5-5l5 5z"})})}function ko(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.jsx("path",{fill:"currentColor",d:"m7 10l5 5l5-5z"})})}const Ao=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 jo({styledTableProps:e,header:t,tableCanResize:n=!1,left:o,hasFixedLeftColumn:r}){const{hideHeader:i=!1,enableResizing:s=!1}=e,u=l(null),[d,c]=a(!1);return P.jsx("th",{ref:u,colSpan:t.colSpan,className:Ne(Me["t-cell"],"actions"===t.column.id&&Me["t-cell__actions"],r&&"actions"===t.column.id&&Me.shadowed,!0===t.column.columnDef.fixedLeft&&Me["t-cell__fixed"]),style:{...Ao({enableResizing:s,header:t,element:u.current}),...t.column.columnDef.fixedLeft&&{left:o}},children:P.jsxs("div",{className:Ne("flex items-center justify-left",i?Me["hide-table-header"]:Me["show-table-header"],t.column.getCanSort()&&Me["sortable-column"],t.column.columnDef.className),onClick:e=>{const n=t.column.getToggleSortingHandler();!d&&n&&n(e),c(!1)},children:[Fe(t.column.columnDef.header,t.getContext()),{asc:P.jsx(Vo,{className:Me["sort-icon"]}),desc:P.jsx(ko,{className:Me["sort-icon"]})}[t.column.getIsSorted()]??null,n&&t.column.getCanResize()&&![x,C,S,_].includes(t.column.id)&&P.jsx("div",{onDoubleClick:()=>t.column.resetSize(),onMouseDown:e=>{e.stopPropagation(),c(!0),t.getResizeHandler()(e)},onTouchStart:e=>{e.stopPropagation(),c(!0),t.getResizeHandler()(e)},className:`${Me.resizer} ${t.column.getIsResizing()?Me.isResizing:""}`})]})},t.id)}function Lo({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 P.jsx("thead",{className:Ne(Me["table-header"],r&&Me["hide-table-header"]),style:o&&{position:"sticky",top:-.2}||{},children:e.getHeaderGroups().map((e=>P.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 P.jsx(jo,{styledTableProps:t,header:o,tableCanResize:n,left:i?a:0,hasFixedLeftColumn:l},o.column.id)}))},e.id)))})}const zo=e=>{let{transform:t}=e;return{...t,x:0}},To=({data:e,setData:t,children:o})=>{const r=n((()=>null==e?void 0:e.map((e=>e.id))),[e]);return P.jsx(On,{collisionDetection:vt,modifiers:[zo],onDragEnd:function(e){if(!t)return;const{active:n,over:o}=e;n&&o&&n.id!==o.id&&t((e=>Tn(e,r.indexOf(n.id),r.indexOf(o.id))))},children:o})},Ho=({data:e,setData:t,enableDnd:n,children:o})=>n?P.jsx(To,{data:e,setData:t,children:o}):P.jsx(P.Fragment,{children:o}),Go=e=>{const t={...e,rowHeight:e.rowHeight||48},{className:o,height:r,data:l,enableDnd:i,setData:a}=t;Oo(t);const{table:s}=Ro(t),u=n((()=>{var e,n;if(!t.enableColumnResizing)return;const o=s.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==(e=t.getTableState)||e.call(t,s.getState()),null==(n=t.getColumnSizing)||n.call(t,s.getState().columnSizing),r}),[t.enableColumnResizing,s.getState().columnSizingInfo,s.getState().columnSizing]);return P.jsx(ro,{children:P.jsx(Ho,{enableDnd:!!i,data:l,setData:a,children:P.jsxs("div",{className:Me["asma-ui-table-styled-table"],children:[P.jsx("div",{className:Ne(Me["table-wrapper"],o),style:{height:r},children:P.jsxs("table",{className:Me["styled-table"],style:{...u},children:[P.jsx(Lo,{table:s,styledTableProps:t,tableCanResize:!!t.enableColumnResizing}),u?P.jsx(P.Fragment,{children:s.getState().columnSizingInfo.isResizingColumn?P.jsx(Bo,{table:s,styledTableProps:t}):P.jsx(go,{table:s,styledTableProps:t})}):P.jsx(go,{table:s,styledTableProps:t})]})}),P.jsx(So,{table:s,styledTableProps:t})]})})})},Bo=d(go,((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,E as INTERNAL_COLUMN_IDS,Bo as MemoizedTableBody,Po as RowDragHandleCell,x as SELECT_COLUMN_ID,_ as SHOW_FULL_TEXT_ID,Go as StyledTable,_e as createColumnHelper,y as isCustomAction};
41
+ function Fe(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 Me={"asma-ui-table-styled-table":"_asma-ui-table-styled-table_hpbqi_1","table-wrapper":"_table-wrapper_hpbqi_10","styled-table":"_styled-table_hpbqi_14",tbody:"_tbody_hpbqi_23","loading-icon":"_loading-icon_hpbqi_28","t-row":"_t-row_hpbqi_34","action-cell":"_action-cell_hpbqi_50","fixed-cell":"_fixed-cell_hpbqi_53","t-cell":"_t-cell_hpbqi_65",non_expanded_row:"_non_expanded_row_hpbqi_99",selected:"_selected_hpbqi_123",shadowed:"_shadowed_hpbqi_126","is-loading":"_is-loading_hpbqi_142","action-cell-default-background":"_action-cell-default-background_hpbqi_145","fixed-cell-default-background":"_fixed-cell-default-background_hpbqi_148","no-rows-overlay":"_no-rows-overlay_hpbqi_151","hide-table-header":"_hide-table-header_hpbqi_160","show-table-header":"_show-table-header_hpbqi_164","sortable-column":"_sortable-column_hpbqi_169",resizer:"_resizer_hpbqi_173",isResizing:"_isResizing_hpbqi_185","table-header":"_table-header_hpbqi_197","t-cell__actions":"_t-cell__actions_hpbqi_217","t-cell__fixed":"_t-cell__fixed_hpbqi_225","sort-icon":"_sort-icon_hpbqi_232","table-footer":"_table-footer_hpbqi_235"};function Ie(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=Ie(e[t]))&&(o&&(o+=" "),o+=n);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function Ne(){for(var e,t,n=0,o="";n<arguments.length;)(e=arguments[n++])&&(t=Ie(e))&&(o&&(o+=" "),o+=t);return o}const Pe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Oe(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Ve(e){return"nodeType"in e}function ke(e){var t,n;return e?Oe(e)?e:Ve(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function Ae(e){const{Document:t}=ke(e);return e instanceof t}function je(e){return!Oe(e)&&e instanceof ke(e).HTMLElement}function Le(e){return e instanceof ke(e).SVGElement}function ze(e){return e?Oe(e)?e.document:Ve(e)?Ae(e)?e:je(e)||Le(e)?e.ownerDocument:document:document:document}const Te=Pe?o:r;function He(e){const t=l(e);return Te((()=>{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 Ge(e,t){void 0===t&&(t=[e]);const n=l(e);return Te((()=>{n.current!==e&&(n.current=e)}),t),n}function Be(e,t){const o=l();return n((()=>{const t=e(o.current);return o.current=t,t}),[...t])}function qe(e){const t=He(e),n=l(null),o=i((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,o]}function Ue(e){const t=l();return r((()=>{t.current=e}),[e]),t.current}let $e={};function We(e,t){return n((()=>{if(t)return t;const n=null==$e[e]?0:$e[e]+1;return $e[e]=n,e+"-"+n}),[e,t])}function Xe(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 Ye=Xe(1),Ke=Xe(-1);function Je(e){if(!e)return!1;const{KeyboardEvent:t}=ke(e.target);return t&&e instanceof t}function Ze(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=ke(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 Qe=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[Qe.Translate.toString(e),Qe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),et="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function tt(e){return e.matches(et)?e:e.querySelector(et)}const nt={display:"none"};function ot(e){let{id:n,value:o}=e;return t.createElement("div",{id:n,style:nt},o)}function rt(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 lt=s(null);const it={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 "},at={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 st(e){let{announcements:o=at,container:l,hiddenTextDescribedById:s,screenReaderInstructions:d=it}=e;const{announce:c,announcement:g}=function(){const[e,t]=a("");return{announce:i((e=>{null!=e&&t(e)}),[]),announcement:e}}(),p=We("DndLiveRegion"),[f,h]=a(!1);if(r((()=>{h(!0)}),[]),function(e){const t=u(lt);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(ot,{id:s,value:d.draggable}),t.createElement(rt,{id:p,announcement:g}));return l?w(m,l):m}var ut,dt;function ct(){}(dt=ut||(ut={})).DragStart="dragStart",dt.DragMove="dragMove",dt.DragEnd="dragEnd",dt.DragCancel="dragCancel",dt.DragOver="dragOver",dt.RegisterDroppable="registerDroppable",dt.SetDroppableDisabled="setDroppableDisabled",dt.UnregisterDroppable="unregisterDroppable";const gt=Object.freeze({x:0,y:0});function pt(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ft(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function ht(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function mt(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 vt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=mt(t,t.left,t.top),l=[];for(const e of o){const{id:t}=e,o=n.get(t);if(o){const n=pt(mt(o),r);l.push({id:t,data:{droppableContainer:e,value:n}})}}return l.sort(ft)};function bt(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 wt=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=bt(l,t);n>0&&r.push({id:o,data:{droppableContainer:e,value:n}})}}return r.sort(ht)};function yt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:gt}function xt(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 Ct=xt(1);const St={ignoreTransform:!1};function Rt(e,t){void 0===t&&(t=St);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:o}=ke(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 _t(e){return Rt(e,{ignoreTransform:!0})}function Et(e,t){const n=[];return e?function o(r){if(null!=t&&n.length>=t||!r)return n;if(Ae(r)&&null!=r.scrollingElement&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!je(r)||Le(r)||n.includes(r))return n;const l=ke(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=ke(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=ke(e).getComputedStyle(e)),"fixed"===t.position}(r,l)?n:o(r.parentNode)}(e):n}function Dt(e){const[t]=Et(e,1);return t??null}function Ft(e){return Pe&&e?Oe(e)?e:Ve(e)?Ae(e)||e===ze(e).scrollingElement?window:je(e)?e:null:null:null}function Mt(e){return Oe(e)?e.scrollX:e.scrollLeft}function It(e){return Oe(e)?e.scrollY:e.scrollTop}function Nt(e){return{x:Mt(e),y:It(e)}}var Pt;function Ot(e){return!(!Pe||!e)&&e===document.scrollingElement}function Vt(e){const t={x:0,y:0},n=Ot(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"}(Pt||(Pt={}));const kt={x:.2,y:.2};function At(e,t,n,o,r){let{top:l,left:i,right:a,bottom:s}=n;void 0===o&&(o=10),void 0===r&&(r=kt);const{isTop:u,isBottom:d,isLeft:c,isRight:g}=Vt(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=Pt.Backward,f.y=o*Math.abs((t.top+h-l)/h)):!d&&s>=t.bottom-h&&(p.y=Pt.Forward,f.y=o*Math.abs((t.bottom-h-s)/h)),!g&&a>=t.right-m?(p.x=Pt.Forward,f.x=o*Math.abs((t.right-m-a)/m)):!c&&i<=t.left+m&&(p.x=Pt.Backward,f.x=o*Math.abs((t.left+m-i)/m)),{direction:p,speed:f}}function jt(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 Lt(e){return e.reduce(((e,t)=>Ye(e,Nt(t))),gt)}const zt=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+Mt(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+It(t)),0)}]];class Tt{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=Et(t),o=Lt(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of zt)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 Ht{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 Gt(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 Bt,qt;function Ut(e){e.preventDefault()}function $t(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"}(Bt||(Bt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(qt||(qt={}));const Wt={start:[qt.Space,qt.Enter],cancel:[qt.Esc],end:[qt.Space,qt.Enter]},Xt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case qt.Right:return{...n,x:n.x+25};case qt.Left:return{...n,x:n.x-25};case qt.Down:return{...n,y:n.y+25};case qt.Up:return{...n,y:n.y-25}}};class Yt{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 Ht(ze(t)),this.windowListeners=new Ht(ke(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Bt.Resize,this.handleCancel),this.windowListeners.add(Bt.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(Bt.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=Rt),!e)return;const{top:n,left:o,bottom:r,right:l}=t(e);Dt(e)&&(r<=0||l<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(gt)}handleKeyDown(e){if(Je(e)){const{active:t,context:n,options:o}=this.props,{keyboardCodes:r=Wt,coordinateGetter:l=Xt,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}:gt;this.referenceCoordinates||(this.referenceCoordinates=u);const d=l(e,{active:t,context:n.current,currentCoordinates:u});if(d){const t=Ke(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}=Vt(n),p=jt(n),f={x:Math.min(r===qt.Right?p.right-p.width/2:p.right,Math.max(r===qt.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(r===qt.Down?p.bottom-p.height/2:p.bottom,Math.max(r===qt.Down?p.top:p.top+p.height/2,d.y))},h=r===qt.Right&&!a||r===qt.Left&&!s,m=r===qt.Down&&!u||r===qt.Up&&!l;if(h&&f.x!==d.x){const e=n.scrollLeft+t.x,l=r===qt.Right&&e<=c.x||r===qt.Left&&e>=g.x;if(l&&!t.y)return void n.scrollTo({left:e,behavior:i});o.x=l?n.scrollLeft-e:r===qt.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===qt.Down&&e<=c.y||r===qt.Up&&e>=g.y;if(l&&!t.x)return void n.scrollTo({top:e,behavior:i});o.y=l?n.scrollTop-e:r===qt.Down?n.scrollTop-c.y:n.scrollTop-g.y,o.y&&n.scrollBy({top:-o.y,behavior:i});break}}this.handleMove(e,Ye(Ke(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 Kt(e){return!(!e||!("distance"in e))}function Jt(e){return!(!e||!("delay"in e))}Yt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=Wt,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 Zt{constructor(e,t,n){var o;void 0===n&&(n=function(e){const{EventTarget:t}=ke(e);return e instanceof t?e:ze(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=ze(l),this.documentListeners=new Ht(this.document),this.listeners=new Ht(n),this.windowListeners=new Ht(ke(l)),this.initialCoordinates=null!=(o=Ze(r))?o:gt,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(Bt.Resize,this.handleCancel),this.windowListeners.add(Bt.DragStart,Ut),this.windowListeners.add(Bt.VisibilityChange,this.handleCancel),this.windowListeners.add(Bt.ContextMenu,Ut),this.documentListeners.add(Bt.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Jt(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(Kt(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(Bt.Click,$t,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Bt.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=Ze(e))?t:gt,s=Ke(o,a);if(!n&&i){if(Kt(i)){if(null!=i.tolerance&&Gt(s,i.tolerance))return this.handleCancel();if(Gt(s,i.distance))return this.handleStart()}return Jt(i)&&Gt(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===qt.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Qt={move:{name:"pointermove"},end:{name:"pointerup"}};class en extends Zt{constructor(e){const{event:t}=e,n=ze(t.target);super(e,Qt,n)}}en.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 tn={move:{name:"mousemove"},end:{name:"mouseup"}};var nn;!function(e){e[e.RightClick=2]="RightClick"}(nn||(nn={}));(class extends Zt{constructor(e){super(e,tn,ze(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==nn.RightClick&&(null==o||o({event:n}),!0)}}];const on={move:{name:"touchmove"},end:{name:"touchend"}};var rn,ln;function an(e){let{acceleration:t,activator:o=rn.Pointer,canScroll:a,draggingRect:s,enabled:u,interval:d=5,order:c=ln.TreeOrder,pointerCoordinates:g,scrollableAncestors:p,scrollableAncestorRects:f,delta:h,threshold:m}=e;const v=function(e){let{delta:t,disabled:n}=e;const o=Ue(t);return Be((e=>{if(n||!o||!e)return sn;const r={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[Pt.Backward]:e.x[Pt.Backward]||-1===r.x,[Pt.Forward]:e.x[Pt.Forward]||1===r.x},y:{[Pt.Backward]:e.y[Pt.Backward]||-1===r.y,[Pt.Forward]:e.y[Pt.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 rn.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case rn.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===ln.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}=At(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 Zt{constructor(e){super(e,on)}static setup(){return window.addEventListener(on.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(on.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"}(rn||(rn={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(ln||(ln={}));const sn={x:{[Pt.Backward]:!1,[Pt.Forward]:!1},y:{[Pt.Backward]:!1,[Pt.Forward]:!1}};var un,dn;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(un||(un={})),(dn||(dn={})).Optimized="optimized";const cn=new Map;function gn(e,t){return Be((n=>e?n||("function"==typeof t?t(e):e):null),[t,e])}function pn(e){let{callback:t,disabled:o}=e;const l=He(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 fn(e){return new Tt(Rt(e),e)}function hn(e,t,o){void 0===t&&(t=fn);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=He(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=pn({callback:i});return Te((()=>{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 mn=[];function vn(e,t){void 0===t&&(t=[]);const n=l(null);return r((()=>{n.current=null}),t),r((()=>{const t=e!==gt;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)}),[e]),n.current?Ke(e,n.current):gt}function bn(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 wn=[];function yn(e){let{measure:t}=e;const[o,r]=a(null),l=pn({callback:i((e=>{for(const{target:n}of e)if(je(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 je(t)?t:e}(e);null==l||l.disconnect(),n&&(null==l||l.observe(n)),r(n?t(n):null)}),[t,l]),[u,d]=qe(s);return n((()=>({nodeRef:u,rect:o,setRef:d})),[o,u,d])}const xn=[{sensor:en,options:{}},{sensor:Yt,options:{}}],Cn={current:{}},Sn={draggable:{measure:_t},droppable:{measure:_t,strategy:un.WhileDragging,frequency:dn.Optimized},dragOverlay:{measure:Rt}};class Rn 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 _n={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Rn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ct},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Sn,measureDroppableContainers:ct,windowRect:null,measuringScheduled:!1},En=s({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ct,draggableNodes:new Map,over:null,measureDroppableContainers:ct}),Dn=s(_n);function Fn(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Rn}}}function Mn(e,t){switch(t.type){case ut.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ut.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 ut.DragEnd:case ut.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ut.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new Rn(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case ut.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 Rn(e.droppable.containers);return i.set(n,{...l,disabled:r}),{...e,droppable:{...e.droppable,containers:i}}}case ut.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const l=new Rn(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function In(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:l}=u(En),i=Ue(o),a=Ue(null==n?void 0:n.id);return r((()=>{if(!t&&!o&&i&&null!=a){if(!Je(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=tt(e);if(t){t.focus();break}}}))}}),[o,t,l,a,i]),null}const Nn=s({...gt,scaleX:1,scaleY:1});var Pn;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Pn||(Pn={}));const On=d((function(e){var o,s,u,d;let{id:g,accessibility:p,autoScroll:f=!0,children:h,sensors:m=xn,collisionDetection:v=wt,measuring:w,modifiers:y,...x}=e;const C=c(Mn,void 0,Fn),[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(Pn.Uninitialized),M=D===Pn.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:Cn,rect:k}:null}),[I,V]),j=l(null),[L,z]=a(null),[T,H]=a(null),G=Ge(x,Object.values(x)),B=We("DndDescribedBy",g),q=n((()=>O.getEnabled()),[O]),U=function(e){return n((()=>({draggable:{...Sn.draggable,...null==e?void 0:e.draggable},droppable:{...Sn.droppable,...null==e?void 0:e.droppable},dragOverlay:{...Sn.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:$,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 un.Always:return!1;case un.BeforeDragging:return n;default:return!n}}(),m=Ge(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=Be((t=>{if(h&&!n)return cn;if(!t||t===cn||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 Tt(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}}(q,{dragging:M,dependencies:[P.x,P.y],config:U.droppable}),Y=function(e,t){const n=null!==t?e.get(t):void 0,o=n?n.node.current:null;return Be((e=>{var n;return null===t?null:null!=(n=o??e)?n:null}),[o,t])}(N,I),K=n((()=>T?Ze(T):null),[T]),J=function(){const e=!1===(null==L?void 0:L.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 gn(e,t)}(Y,U.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;Te((()=>{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=yt(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=Dt(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:U.draggable.measure});const Q=hn(Y,U.draggable.measure,Z),ee=hn(Y?Y.parentElement:null),te=l({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:$,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=yn({measure:U.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 yt(e,gn(e))}(ie?null:Q),se=bn(re?ke(re):null),ue=function(e){const t=l(e),n=Be((n=>e?n&&n!==mn&&e&&t.current&&e.parentNode===t.current.parentNode?n:Et(e):mn),[e]);return r((()=>{t.current=e}),[e]),n}(M?ne??Y:null),de=function(e,t){void 0===t&&(t=Rt);const[n]=e,o=bn(n?ke(n):null),[r,l]=c((function(){return e.length?e.map((e=>Ot(e)?o:new Tt(t(e),e))):wn}),wn),i=pn({callback:l});return e.length>0&&r===wn&&l(),Te((()=>{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?Ye(K,P):null,pe=function(e){const[t,o]=a(null),s=l(e),u=i((e=>{const t=Ft(e.target);t&&o((e=>e?(e.set(t,Nt(t)),new Map(e)):null))}),[]);return r((()=>{const t=s.current;if(e!==t){n(t);const r=e.map((e=>{const t=Ft(e);return t?(t.addEventListener("scroll",u,{passive:!0}),[t,Nt(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=Ft(e);null==t||t.removeEventListener("scroll",u)}))}}),[u,e]),n((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>Ye(e,t)),gt):Lt(e):gt),[e,t])}(ue),fe=vn(pe),he=vn(pe,[Q]),me=Ye(ce,fe),ve=le?Ct(le,ce):null,be=A&&ve?v({active:A,collisionRect:ve,droppableRects:$,droppableContainers:q,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:Ye(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(Pn.Initializing),R({type:ut.DragStart,initialCoordinates:e,active:t}),_({type:"onDragStart",event:r})}))},onMove(e){R({type:ut.DragMove,coordinates:e})},onEnd:a(ut.DragEnd),onCancel:a(ut.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===ut.DragEnd&&"function"==typeof a&&await Promise.resolve(a(i))&&(e=ut.DragCancel)}j.current=null,b((()=>{R({type:e}),F(Pn.Uninitialized),xe(null),z(null),H(null);const t=e===ut.DragEnd?"onDragEnd":"onDragCancel";if(i){const e=G.current[t];null==e||e(i),_({type:t,event:i})}}))}}b((()=>{z(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(!Pe)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),Te((()=>{Q&&D===Pn.Initializing&&F(Pn.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]),Te((()=>{te.current={activatorEvent:T,active:A,activeNode:Y,collisionRect:ve,collisions:be,droppableRects:$,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,$,O,ye,ue,me]),an({...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:$,over:ye,measureDroppableContainers:W,scrollableAncestors:ue,scrollableAncestorRects:de,measuringConfiguration:U,measuringScheduled:X,windowRect:se})),[A,Y,Q,T,be,ee,oe,N,O,$,ye,W,ue,de,U,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(lt.Provider,{value:E},t.createElement(En.Provider,{value:Ee},t.createElement(Dn.Provider,{value:_e},t.createElement(Nn.Provider,{value:Ce},h)),t.createElement(In,{disabled:!1===(null==p?void 0:p.restoreFocus)})),t.createElement(st,{...p,hiddenTextDescribedById:B}))})),Vn=s(null),kn="button",An="Droppable";function jn(e){let{id:t,data:o,disabled:r=!1,attributes:l}=e;const i=We(An),{activators:a,activatorEvent:s,active:d,activeNodeRect:c,ariaDescribedById:g,draggableNodes:p,over:f}=u(En),{role:h=kn,roleDescription:m="draggable",tabIndex:v=0}=l??{},b=(null==d?void 0:d.id)===t,w=u(b?Nn:Vn),[y,x]=qe(),[C,S]=qe(),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),_=Ge(o);Te((()=>(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!==kn)||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 Ln="Droppable",zn={timeout:25};function Tn(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function Hn(e,t){return e.reduce(((e,n,o)=>{const r=t.get(n);return r&&(e[o]=r),e}),Array(e.length))}function Gn(e){return null!==e&&e>=0}const Bn=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const l=Tn(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},qn={scaleX:1,scaleY:1},Un=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,...qn}: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,...qn}:r<n&&r>=i?{x:0,y:a.height+s,...qn}:{x:0,y:0,...qn}};const $n="Sortable",Wn=t.createContext({activeIndex:-1,containerId:$n,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Bn,disabled:{draggable:!1,droppable:!1}});function Xn(e){let{children:o,id:i,items:a,strategy:s=Bn,disabled:d=!1}=e;const{active:c,dragOverlay:g,droppableRects:p,over:f,measureDroppableContainers:h}=u(Dn),m=We($n,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);Te((()=>{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:Hn(b,p),strategy:s})),[y,m,_.draggable,_.droppable,R,b,x,p,v,s]);return t.createElement(Wn.Provider,{value:E},o)}const Yn=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return Tn(n,o,r).indexOf(t)},Kn=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)},Jn={duration:200,easing:"ease"},Zn="transform",Qn=Qe.Transition.toString({property:Zn,duration:0,easing:"linear"}),eo={roleDescription:"sortable"};function to(e){let{animateLayoutChanges:t=Kn,attributes:o,disabled:s,data:d,getNewIndex:c=Yn,id:g,strategy:p,resizeObserverConfig:f,transition:h=Jn}=e;const{items:m,containerId:v,activeIndex:b,disabled:w,disableTransforms:y,sortedRects:x,overIndex:C,useDragOverlay:S,strategy:R}=u(Wn),_=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=We(Ln),{active:d,dispatch:c,over:g,measureDroppableContainers:p}=u(En),f=l({disabled:n}),h=l(!1),m=l(null),v=l(null),{disabled:b,updateMeasurementsFor:w,timeout:y}={...zn,...a},x=Ge(w??o),C=pn({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,_]=qe(S),E=Ge(t);return r((()=>{!C||!R.current||(C.disconnect(),h.current=!1,C.observe(R.current))}),[R,C]),Te((()=>(c({type:ut.RegisterDroppable,element:{id:o,key:s,disabled:n,node:R,rect:m,data:E}}),()=>c({type:ut.UnregisterDroppable,key:s,id:o}))),[o]),r((()=>{n!==f.current.disabled&&(c({type:ut.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:L,isDragging:z,over:T,setActivatorNodeRef:H,transform:G}=jn({id:g,data:D,attributes:{...eo,...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),q=!!O,U=q&&!y&&Gn(b)&&Gn(C),$=!S&&z,W=U?($&&U?G:null)??(p??R)({rects:x,activeNodeRect:k,activeIndex:b,overIndex:C,index:E}):null,X=Gn(b)&&Gn(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:z,isSorting:q,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 Te((()=>{if(!t&&n!==d.current&&o.current){const e=i.current;if(e){const t=Rt(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((()=>{q&&K.current.newIndex!==X&&(K.current.newIndex=X),v!==K.current.containerId&&(K.current.containerId=v),m!==K.current.items&&(K.current.items=m)}),[q,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:q,isDragging:z,listeners:L,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 Qn;if((!$||Je(V))&&h&&(q||Z))return Qe.Transition.toString({...h,property:Zn})}()}}function no(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.jsx("path",{fill:"currentColor",d:"M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6l-6-6z"})})}qt.Down,qt.Right,qt.Up,qt.Left;const oo=s(void 0),ro=({children:e})=>{const[t,n]=a(new Set);return P.jsx(oo.Provider,{value:{expandedRows:t,toggleExpand:e=>{n((t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}))}},children:e})},lo=()=>{const e=u(oo);if(void 0===e)throw new Error("useShowFullText must be used within a ShowFullTextProvider");return e};function io({info:e,rowHeight:t}){const{expandedRows:n,toggleExpand:o}=lo(),r=n.has(e.row.id);return P.jsx("div",{className:"flex w-full items-center justify-center",style:{height:t||"auto"},onClick:()=>o(e.row.id),onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>{e.preventDefault(),e.stopPropagation()},children:P.jsx("div",{style:{rotate:r?"180deg":"0deg",transitionTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",transitionDuration:"500ms"},children:P.jsx(no,{width:20,height:20,color:"var(--colors-gray-700)"})})})}function ao({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}=to({id:t.original.id,disabled:!d}),w={transform:Qe.Transform.toString(h),transition:m,opacity:b?.8:1,zIndex:b?1:0,position:"relative"},{expandedRows:y}=lo(),x=t.getVisibleCells(),C=n((()=>x.map(((e,t)=>({...e,left:x.slice(0,t).reduce(((e,t)=>e+(t.column.getSize()||0)),0)})))),[x]),S=n((()=>C.some((e=>!0===e.column.columnDef.fixedLeft))),[C]);return P.jsxs(g,{children:[P.jsx("tr",{"data-index":o,"data-test":t.id,id:t.id,tabIndex:r?-1:void 0,className:Ne(Me["t-row"],l&&Me["is-loading"],(t.getIsExpanded()||t.getIsSelected())&&Me.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:C.map((e=>{const n="actions"===e.column.id,o=e.column.columnDef.fixedLeft,r=y.has(t.original.id.toString());return P.jsx("td",{className:Ne(Me["t-cell"],c,n&&Me["action-cell"],n&&S&&Me.shadowed,n&&(t.getIsExpanded()||t.getIsSelected())&&Me.selected,n&&(null!=i&&i(t)?null==i?void 0:i(t):Me["action-cell-default-background"]),o&&Me["fixed-cell"],o&&(t.getIsExpanded()||t.getIsSelected())&&Me.selected,o&&(null!=i&&i(t)?null==i?void 0:i(t):Me["fixed-cell-default-background"]),!r&&Me.non_expanded_row),style:{left:o?e.left:void 0},children:Fe(e.column.columnDef.cell,e.getContext())},e.id)}))}),t.getIsExpanded()&&P.jsx(P.Fragment,{children:p&&f&&f({rows:p.get(t.original.id.toString())??[],row:t.original})})]},t.id)}function so({styledTableProps:e,table:t}){const n=e.hideFooter?t.getCoreRowModel().rows:t.getRowModel().rows;return P.jsx(P.Fragment,{children:n.map(((t,n)=>P.jsx(ao,{styledTableProps:e,row:t,index:n},t.id)))})}const uo=({colSpan:e,noRowsOverlay:t})=>P.jsx("tr",{className:Me["no-rows-overlay"],children:P.jsx("td",{colSpan:e,children:t})});function co(e){return P.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:[P.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}),P.jsx("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z",children:P.jsx("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})})]})}function go({table:e,styledTableProps:t}){const{columns:n,data:o,loading:r,noRowsOverlay:l,enableDnd:i}=t;return P.jsxs("tbody",{className:Me.tbody,children:[o.length>0&&r&&P.jsx(co,{className:Me["loading-icon"],width:50,height:50}),0===o.length&&r?P.jsx(O,{colSpan:n.length}):o.length>0?P.jsx(P.Fragment,{children:i?P.jsx(Xn,{items:o,strategy:Un,children:P.jsx(so,{table:e,styledTableProps:t})}):P.jsx(so,{table:e,styledTableProps:t})}):P.jsx(uo,{colSpan:n.length,noRowsOverlay:l})]})}const po=()=>{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 fo(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.jsx("path",{fill:"currentColor",d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z"})})}function ho(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.jsx("path",{fill:"currentColor",d:"M8.59 16.58L13.17 12L8.59 7.41L10 6l6 6l-6 6z"})})}const mo={"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 vo(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.jsx("path",{fill:"currentColor",d:"M15.41 16.58L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function bo(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.jsx("path",{fill:"currentColor",d:"M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z"})})}const wo="_asma-core-ui-button_1r2np_1",yo={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"},xo=({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 P.jsxs("button",{...u,className:Ne(wo,yo[e],yo[c],yo[n],t),ref:r,"data-test":a,children:[l,o&&P.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 Co({table:e,locale:t}){const{anchorEl:n,open:o,handleClose:r,handleOpen:i}=po(),a=l(null),s="no"===t,u=Me["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 P.jsxs("div",{ref:a,className:mo["table-pagination"],children:[P.jsx(f,{title:s?"Nåværende side":"Current Page",children:P.jsx("div",{children:P.jsxs(xo,{dataTest:"",variant:"outlined",style:{minWidth:"140px"},onClick:e=>{i(e)},endIcon:o?P.jsx(fo,{height:24,width:24}):P.jsx(no,{height:24,width:24}),children:[s?"Side":"Page"," ",g," ",s?"av":"of"," ",c]})})}),P.jsx(h,{open:o,anchorEl:n,onClose:r,anchorOrigin:{vertical:-5,horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"},children:P.jsx("div",{className:mo["table-pagination__pages-list"],children:p.map((t=>P.jsxs("div",{className:Ne(mo["table-pagination__pages-list__page"],g===t&&"page-selected"),onClick:()=>{e.setPageIndex(t-1),r(),d()},children:[g===t&&P.jsx(bo,{className:mo["check-icon"],height:24,width:24}),P.jsxs("span",{children:[s?"Side":"Page"," ",t]})]},t)))})}),P.jsx(f,{title:1===g?"":s?"Forrige side":"Previous Page",children:P.jsx("div",{children:P.jsx(xo,{dataTest:"",variant:"outlined",onClick:()=>{e.previousPage(),d()},disabled:!e.getCanPreviousPage(),style:{minWidth:40,width:40},startIcon:P.jsx(vo,{height:24,width:24})})})}),P.jsx(f,{title:g===c?"":s?"Neste side":"Next Page",children:P.jsx("div",{children:P.jsx(xo,{dataTest:"",variant:"outlined",onClick:()=>{e.nextPage(),d()},disabled:!e.getCanNextPage(),style:{minWidth:40,width:40},startIcon:P.jsx(ho,{height:24,width:24})})})})]})}function So({table:e,styledTableProps:t}){var n;return t.hideFooter?null:P.jsxs("div",{className:Me["table-footer"],children:[null==(n=t.footer)?void 0:n.call(t,e),P.jsx(Co,{table:e,locale:t.locale||"en"})]})}const Ro=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:Se(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=>j((()=>[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=Re(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=>j((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>t.rows.length&&(!0===e||Object.keys(e??{}).length)&&n?De(t):t),{key:"development"===process.env.NODE_ENV&&"getExpandedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),getFilteredRowModel:e=>j((()=>[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 Ee(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=>j((()=>[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=>j((()=>[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}:De({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}},_o=({dataTest:e,...t})=>P.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 Eo(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.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 Do=e=>{var t;return P.jsx(v,{...e,classes:{root:Ne("px-3 py-2.5",null==(t=e.classes)?void 0:t.root),...e.classes}})};function Fo({tableData:e,actions:n}){const{anchorEl:o,open:r,handleClose:l,handleOpen:i}=po(),a=n(e.row);return P.jsx("div",{className:"flex justify-center items-center w-[42px]",children:a.length?P.jsxs(P.Fragment,{children:[P.jsx(xo,{dataTest:"",variant:"text",onClick:e=>{e.stopPropagation(),e.preventDefault(),i(e)},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onMouseUp:e=>{e.stopPropagation(),e.preventDefault()},children:P.jsx(Eo,{className:"text-delta-800",width:20,height:20})}),P.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)?P.jsx(t.Fragment,{children:r},o):null}return n.hide?null:P.jsx(Do,{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 Mo(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.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 Io({headerData:e}){const{anchorEl:t,open:n,handleClose:o,handleOpen:r}=po();return P.jsxs("div",{className:"flex absolute-center items-center justify-center ",children:[P.jsx("div",{className:"h-[30px] flex items-center justify-center cursor-pointer",onClick:r,children:P.jsx(Mo,{className:"text-delta-500 hover:text-delta-600 min-w-[20px] min-h-[20px]"})}),P.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?P.jsxs(Do,{onClick:()=>e.toggleVisibility(!e.getIsVisible()),className:"h-[44px]",children:[P.jsx(_o,{size:"small",dataTest:"test",disableRipple:!0,className:"p-0 pr-2",checked:e.getIsVisible()}),e.columnDef.pinnedHeaderText?e.columnDef.pinnedHeaderText:"string"==typeof e.columnDef.header?e.columnDef.header:e.id]},e.id):null))})]})}function No(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",...e,children:P.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 Po=({rowId:e,rowHeight:t})=>{const{attributes:n,listeners:o}=to({id:e});return P.jsx("div",{...n,...o,style:{height:t||"auto"},children:P.jsx(No,{width:24,height:24,className:"text-delta-800"})})},Oo=e=>{const{columns:t,actions:n,customActionsNode:o,headerPin:r=!0,enableRowSelection:l,expandArrow:i,enableDnd:a,customDndColumnProps:s,rowHeight:u,textExpandArrow:d}=e,c=t.some((e=>!0===e.fixedLeft));!t.find((e=>"actions"===e.id))&&(n||o||r)&&t.push(function(e){const{headerPin:t,actions:n,customActionsNode:o,rowHeight:r}=e;return{id:"actions",enableHiding:!1,enableSorting:!1,accessorFn:e=>e,header:e=>t?P.jsx(Io,{headerData:e}):null,cell:e=>n||o?P.jsxs("div",{className:"flex items-center justify-center",style:{height:r||"auto"},children:[o&&P.jsx("div",{className:"mr-1",children:null==o?void 0:o(e)}),n&&P.jsx(Fo,{tableData:e,actions:n})]}):null,size:50}}({headerPin:r,actions:n,customActionsNode:o,rowHeight:u})),d&&!t.find((e=>e.id===_))&&t.unshift(function(e,t){return{id:_,minSize:40,maxSize:40,size:40,enableHiding:!1,enableSorting:!1,header:()=>null,cell:e=>P.jsx(io,{info:e,rowHeight:t}),fixedLeft:e}}(c,u)),i&&!d&&!t.find((e=>e.id===C))&&t.unshift(function(e,t){return{id:C,minSize:50,maxSize:50,size:50,enableHiding:!1,enableSorting:!1,header:()=>null,cell:({cell:e})=>{const n=e.row.getIsExpanded();return e.row.getCanExpand()?P.jsx("span",{className:"flex w-full outline-none focus:outline-none items-center justify-center",onClick:()=>e.row.getToggleExpandedHandler()(),style:{height:t||"auto"},children:P.jsx(no,{width:24,height:24,style:{rotate:n?"180deg":"0deg",transitionTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",transitionDuration:"500ms"}})}):null},fixedLeft:e}}(c,u)),a&&!t.find((e=>e.id===R))&&t.unshift(function(e,t){return{enableHiding:!1,enableSorting:!1,header:()=>null,cell:({row:e})=>P.jsx(Po,{rowId:e.id,rowHeight:t}),...e,id:R}}(s,u)),l&&!t.find((e=>e.id===x))&&t.unshift(function(e,t){return{id:x,minSize:52,maxSize:52,size:52,header:({table:e})=>P.jsx(_o,{size:"small",dataTest:"cell-select-all",checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler()}),cell:({cell:e})=>P.jsx("div",{className:"w-[38px] h-[38px] flex items-center",style:{height:t||"auto"},children:P.jsx(_o,{size:"small",dataTest:"cell-select",checked:e.row.getIsSelected(),disabled:!e.row.getCanSelect(),onClick:e=>e.stopPropagation(),onChange:e.row.getToggleSelectedHandler()})}),fixedLeft:e}}(c,u))};function Vo(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.jsx("path",{fill:"currentColor",d:"m7 14l5-5l5 5z"})})}function ko(e){return P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",...e,children:P.jsx("path",{fill:"currentColor",d:"m7 10l5 5l5-5z"})})}const Ao=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 jo({styledTableProps:e,header:t,tableCanResize:n=!1,left:o,hasFixedLeftColumn:r}){const{hideHeader:i=!1,enableResizing:s=!1}=e,u=l(null),[d,c]=a(!1);return P.jsx("th",{ref:u,colSpan:t.colSpan,className:Ne(Me["t-cell"],"actions"===t.column.id&&Me["t-cell__actions"],r&&"actions"===t.column.id&&Me.shadowed,!0===t.column.columnDef.fixedLeft&&Me["t-cell__fixed"]),style:{...Ao({enableResizing:s,header:t,element:u.current}),...t.column.columnDef.fixedLeft&&{left:o}},children:P.jsxs("div",{className:Ne("flex items-center justify-left",i?Me["hide-table-header"]:Me["show-table-header"],t.column.getCanSort()&&Me["sortable-column"],t.column.columnDef.className),onClick:e=>{const n=t.column.getToggleSortingHandler();!d&&n&&n(e),c(!1)},children:[Fe(t.column.columnDef.header,t.getContext()),{asc:P.jsx(Vo,{className:Me["sort-icon"]}),desc:P.jsx(ko,{className:Me["sort-icon"]})}[t.column.getIsSorted()]??null,n&&t.column.getCanResize()&&!E.includes(t.column.id)&&P.jsx("div",{onDoubleClick:()=>t.column.resetSize(),onMouseDown:e=>{e.stopPropagation(),c(!0),t.getResizeHandler()(e)},onTouchStart:e=>{e.stopPropagation(),c(!0),t.getResizeHandler()(e)},className:`${Me.resizer} ${t.column.getIsResizing()?Me.isResizing:""}`})]})},t.id)}function Lo({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 P.jsx("thead",{className:Ne(Me["table-header"],r&&Me["hide-table-header"]),style:o&&{position:"sticky",top:-.2}||{},children:e.getHeaderGroups().map((e=>P.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 P.jsx(jo,{styledTableProps:t,header:o,tableCanResize:n,left:i?a:0,hasFixedLeftColumn:l},o.column.id)}))},e.id)))})}const zo=e=>{let{transform:t}=e;return{...t,x:0}},To=({data:e,setData:t,children:o})=>{const r=n((()=>null==e?void 0:e.map((e=>e.id))),[e]);return P.jsx(On,{collisionDetection:vt,modifiers:[zo],onDragEnd:function(e){if(!t)return;const{active:n,over:o}=e;n&&o&&n.id!==o.id&&t((e=>Tn(e,r.indexOf(n.id),r.indexOf(o.id))))},children:o})},Ho=({data:e,setData:t,enableDnd:n,children:o})=>n?P.jsx(To,{data:e,setData:t,children:o}):P.jsx(P.Fragment,{children:o}),Go=e=>{const t={...e,rowHeight:e.rowHeight||48},{className:o,height:r,data:l,enableDnd:i,setData:a}=t;Oo(t);const{table:s}=Ro(t),u=n((()=>{var e,n;if(!t.enableColumnResizing)return;const o=s.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==(e=t.getTableState)||e.call(t,s.getState()),null==(n=t.getColumnSizing)||n.call(t,s.getState().columnSizing),r}),[t.enableColumnResizing,s.getState().columnSizingInfo,s.getState().columnSizing]);return P.jsx(ro,{children:P.jsx(Ho,{enableDnd:!!i,data:l,setData:a,children:P.jsxs("div",{className:Me["asma-ui-table-styled-table"],children:[P.jsx("div",{className:Ne(Me["table-wrapper"],o),style:{height:r},children:P.jsxs("table",{className:Me["styled-table"],style:{...u},children:[P.jsx(Lo,{table:s,styledTableProps:t,tableCanResize:!!t.enableColumnResizing}),u?P.jsx(P.Fragment,{children:s.getState().columnSizingInfo.isResizingColumn?P.jsx(Bo,{table:s,styledTableProps:t}):P.jsx(go,{table:s,styledTableProps:t})}):P.jsx(go,{table:s,styledTableProps:t})]})}),P.jsx(So,{table:s,styledTableProps:t})]})})})},Bo=d(go,((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,E as INTERNAL_COLUMN_IDS,Bo as MemoizedTableBody,Po as RowDragHandleCell,x as SELECT_COLUMN_ID,_ as SHOW_FULL_TEXT_ID,Go as StyledTable,_e as createColumnHelper,y as isCustomAction};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.0.17-nikolaev",
6
+ "version": "1.0.17-nikolaev1",
7
7
  "type": "module",
8
8
  "files": [
9
9
  "dist/**/*"