1import{q as s,p as Sl,o as gi,t as P,_ as w,w as ae,af as ze,H as We,v as Se,b as te,y as Ft,G as Nt,m as pt,Q as $e,x as qe,l as fi,e as hi,z as Ge,P as Pl,K as mi,aj as A}from"./system-B6wAwYdQ.js";import{s as Re,ai as yl,o as Il,ab as Ci,P as Ml,n as _o,g as st,a7 as Yn,a2 as Ze,a3 as ut,r as pi,aj as Fl,t as Fe,z as wi,a4 as ht,ac as bi,ak as vi,al as xi,I as kl,A as El,l as Si,C as Pi,am as yi,an as wr,ao as Dl,ae as Ii,ap as Mi,q as Fi,y as ki,a as Ei,w as Di,aq as Ri,F as Ti,v as Hi,ar as Oi,f as $i,u as Gi}from"./material-BYB1fIha.js";import{_ as U,a as Qt}from"../app-design-system-DtaKcdW2.js";import{u as Li,W as _i}from"./x-date-pickers-pro-BtcfQAzC.js";const Rl=s.createContext(void 0);function dt(){const e=s.useContext(Rl);if(e===void 0)throw new Error(["MUI: Could not find the data grid private context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the data grid."].join(` 2`));return e}const br={};function Vo(e,t){const n=s.useRef(br);return n.current===br&&(n.current=e(t)),n}const Vi=[];function Ao(e){s.useEffect(e,Vi)}const bt=(e,t="warning")=>{let n=!1;const o=Array.isArray(e)?e.join(` 3`):e;return()=>{n||(n=!0,t==="error"?console.error(o):console.warn(o))}},Ai=Object.is;function Tl(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,o=0;for(const r in e)if(n+=1,!Ai(e[r],t[r])||!(r in t))return!1;for(const r in t)o+=1;return n===o}bt(["MUI: `useGridSelector` has been called before the initialization of the state.","This hook can only be used inside the context of the grid."]);function zi(e){return e.acceptsApiRef}function vr(e,t){return zi(t)?t(e):t(e.current.state)}const ji=Object.is,zo=Tl,Ni=()=>({state:null,equals:null,selector:null}),q=(e,t,n=ji)=>{const o=Vo(Ni),r=o.current.selector!==null,[l,i]=s.useState(r?null:vr(e,t));return o.current.state=l,o.current.equals=n,o.current.selector=t,Ao(()=>e.current.store.subscribe(()=>{const c=vr(e,o.current.selector);o.current.equals(o.current.state,c)||(o.current.state=c,i(c))})),l};function de(e){return gi("MuiDataGrid",e)}const V=Sl("MuiDataGrid",["actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","aggregationColumnHeaderLabel","autoHeight","autosizing","booleanCell","cell--editable","cell--editing","cell--textCenter","cell--textLeft","cell--textRight","cell--withRenderer","cell--rangeTop","cell--rangeBottom","cell--rangeLeft","cell--rangeRight","cell--selectionMode","cell","cellContent","cellCheckbox","cellSkeleton","checkboxInput","columnHeader--alignCenter","columnHeader--alignLeft","columnHeader--alignRight","columnHeader--dragging","columnHeader--moving","columnHeader--numeric","columnHeader--sortable","columnHeader--sorted","columnHeader--filtered","columnHeader","columnHeaderCheckbox","columnHeaderDraggableContainer","columnHeaderDropZone","columnHeaderTitle","columnHeaderTitleContainer","columnHeaderTitleContainerContent","columnGroupHeader","columnHeader--filledGroup","columnHeader--emptyGroup","columnHeader--showColumnBorder","columnHeaders","columnHeadersInner","columnHeadersInner--scrollable","columnSeparator--resizable","columnSeparator--resizing","columnSeparator--sideLeft","columnSeparator--sideRight","columnSeparator","columnsPanel","columnsPanelRow","detailPanel","detailPanels","detailPanelToggleCell","detailPanelToggleCell--expanded","footerCell","panel","panelHeader","panelWrapper","panelContent","panelFooter","paper","editBooleanCell","editInputCell","filterForm","filterFormDeleteIcon","filterFormLogicOperatorInput","filterFormColumnInput","filterFormOperatorInput","filterFormValueInput","filterIcon","footerContainer","headerFilterRow","iconButtonContainer","iconSeparator","main","menu","menuIcon","menuIconButton","menuOpen","menuList","overlay","overlayWrapper","overlayWrapperInner","root","root--densityStandard","root--densityComfortable","root--densityCompact","root--disableUserSelection","row","row--editable","row--editing","row--lastVisible","row--dragging","row--dynamicHeight","row--detailPanelExpanded","rowReorderCellPlaceholder","rowCount","rowReorderCellContainer","rowReorderCell","rowReorderCell--draggable","scrollArea--left","scrollArea--right","scrollArea","selectedRowCount","sortIcon","toolbarContainer","toolbarFilterList","virtualScroller","virtualScrollerContent","virtualScrollerContent--overflowed","virtualScrollerRenderZone","pinnedColumns","pinnedColumns--left","pinnedColumns--right","pinnedColumnHeaders","pinnedColumnHeaders--left","pinnedColumnHeaders--right","withBorderColor","cell--withRightBorder","columnHeader--withRightBorder","treeDataGroupingCell","treeDataGroupingCellToggle","groupingCriteriaCell","groupingCriteriaCellToggle","pinnedRows","pinnedRows--top","pinnedRows--bottom","pinnedRowsRenderZone"]),Hl
3=s.createContext(void 0),ne=()=>{const e=s.useContext(Hl);if(!e)throw new Error("MUI: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return e};var Vn="NOT_FOUND";function Bi(e){var t;return{get:function(o){return t&&e(t.key,o)?t.value:Vn},put:function(o,r){t={key:o,value:r}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function Ui(e,t){var n=[];function o(c){var a=n.findIndex(function(u){return t(c,u.key)});if(a>-1){var d=n[a];return a>0&&(n.splice(a,1),n.unshift(d)),d.value}return Vn}function r(c,a){o(c)===Vn&&(n.unshift({key:c,value:a}),n.length>e&&n.pop())}function l(){return n}function i(){n=[]}return{get:o,put:r,getEntries:l,clear:i}}var Wi=function(t,n){return t===n};function Ki(e){return function(n,o){if(n===null||o===null||n.length!==o.length)return!1;for(var r=n.length,l=0;l<r;l++)if(!e(n[l],o[l]))return!1;return!0}}function Xn(e,t){var n=typeof t=="object"?t:{equalityCheck:t},o=n.equalityCheck,r=o===void 0?Wi:o,l=n.maxSize,i=l===void 0?1:l,c=n.resultEqualityCheck,a=Ki(r),d=i===1?Bi(a):Ui(i,a);function u(){var g=d.get(arguments);if(g===Vn){if(g=e.apply(null,arguments),c){var f=d.getEntries(),m=f.find(function(h){return c(h.value,g)});m&&(g=m.value)}d.put(arguments,g)}return g}return u.clearCache=function(){return d.clear()},u}function qi(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(o){return typeof o=="function"})){var n=t.map(function(o){return typeof o=="function"?"function "+(o.name||"unnamed")+"()":typeof o}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function Qi(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var r=function(){for(var i=arguments.length,c=new Array(i),a=0;a<i;a++)c[a]=arguments[a];var d=0,u,g={memoizeOptions:void 0},f=c.pop();if(typeof f=="object"&&(g=f,f=c.pop()),typeof f!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof f+"]");var m=g,h=m.memoizeOptions,C=h===void 0?n:h,v=Array.isArray(C)?C:[C],b=qi(c),p=e.apply(void 0,[function(){return d++,f.apply(null,arguments)}].concat(v)),y=e(function(){for(var _=[],I=b.length,D=0;D<I;D++)_.push(b[D].apply(null,arguments));return u=p.apply(null,_),u});return Object.assign(y,{resultFunc:f,memoizedResultFunc:p,dependencies:b,lastResult:function(){return u},recomputations:function(){return d},resetRecomputations:function(){return d=0}}),y};return r}var Zi=Qi(Xn);const Yi={cache:new WeakMap};bt(["MUI: A selector was called without passing the instance ID, which may impact the performance of the grid.","To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g. `mySelector(state, apiRef.current.instanceId)`."]);function bo(e){return"current"in e&&"instanceId"in e.current}const vo={id:"default"},fe=(e,t,n,o,r,l,...i)=>{if(i.length>0)throw new Error("Unsupported number of selectors");let c;if(e&&t&&n)c=(a,d)=>{const u=bo(a),g=d??(u?a.current.instanceId:vo),f=u?a.current.state:a,m=e(f,g),h=t(f,g);return n(m,h)};else if(e&&t)c=(a,d)=>{const u=bo(a),g=d??(u?a.current.instanceId:vo),f=u?a.current.state:a,m=e(f,g);return t(m)};else throw new Error("Missing arguments");return c.acceptsApiRef=!0,c},He=(...e)=>{const t=(...n)=>{var o,r;const[l,i]=n,c=bo(l),a=c?l.current.instanceId:i??vo,d=c?l.current.state:l,{cache:u}=Yi;if(u.get(a)&&(o=u.get(a))!=null&&o.get(e)){var g;return(g=u.get(a))==null?void 0:g.get(e)(d,a)}const f=Zi(...e);return u.get(a)||u.set(a,new Map),(r=u.get(a))==null||r.set(e,f),f(d,a)};return t.acceptsApiRef=!0,t},$t=e=>e.columns,at=fe($t,e=>e.orderedFields),Zt=fe($t,e=>e.lookup),mt=He(at,Zt,(e,t)=>e.map(n=>t[n])),lt=fe($t,e=>e.columnVisibilityModel),Ae=He(mt,lt,(e,t)=>e.filter(n=>t[n.field]!==!1)),Lt=He(Ae,e=>e.map(t=>t.field)),Ut=He(Ae,e=>{const t=[];let n=0;for(let o=0;o<e.length;o+=1)t.push(n),n+=e[o].computedWidth;return t}),kn=fe(Ae,Ut,(e,t)=>{const n=e.length;return n===0?0:t[n-1]+e[n-1].computedWidth}),Ol=He(mt,e=>e.filter(t=>t.filterable)),Xi=He(mt,e=>e.reduce((t,n)=>(n.filterable&&(t[n.field]=n),t),{})),Jn=e=>e.columnGrouping,Ji=He(Jn,e=>{var t;return(t=e?.unwrappedGroupingModel)!=null?t:{}}),$l=He(Jn,e=>{var t;return(t=e?.lookup)!=null?t:{}}),ec=He(Jn,e=>{var t;return(t=e?.headerStructure)!=null?t:[]}),En=fe(Jn,e=>{var t;return(t=e?.maxDepth)!=null?t:0}),gt=e=>e.rows,eo=fe(gt,e=>e.totalRowCount),tc=fe(gt,e=>e.loading),nc=fe(gt,e=>e.totalTopLevelRowCount),It=fe(gt,e=>
3e.dataRowIdToModelLookup),An=fe(gt,e=>e.dataRowIdToIdLookup),nt=fe(gt,e=>e.tree),oc=fe(gt,e=>e.groupingName),xr=fe(gt,e=>e.treeDepths),an=He(gt,e=>{const t=Object.entries(e.treeDepths);return t.length===0?1:t.filter(([,n])=>n>0).map(([n])=>Number(n)).sort((n,o)=>o-n)[0]+1}),rn=fe(gt,e=>e.dataRowIds),rc=fe(gt,e=>e?.additionalRowGroups),Yt=He(rc,e=>{var t,n;const o=e?.pinnedRows;return{bottom:o==null||(t=o.bottom)==null?void 0:t.map(r=>{var l;return{id:r.id,model:(l=r.model)!=null?l:{}}}),top:o==null||(n=o.top)==null?void 0:n.map(r=>{var l;return{id:r.id,model:(l=r.model)!=null?l:{}}})}}),lc=fe(Yt,e=>{var t,n;return((e==null||(t=e.top)==null?void 0:t.length)||0)+((e==null||(n=e.bottom)==null?void 0:n.length)||0)}),Gl=()=>{var e;const t=dt(),n=ne(),o=q(t,Ae),r=q(t,eo),l=q(t,En),i=q(t,lc);let c="grid";return(e=n.experimentalFeatures)!=null&&e.ariaV7&&n.treeData&&(c="treegrid"),{role:c,"aria-colcount":o.length,"aria-rowcount":l+1+i+r,"aria-multiselectable":!n.disableMultipleRowSelection}},sc=e=>{const{classes:t}=e;return ae({root:["main"]},de,t)},ic=ze("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>t.main})(()=>({position:"relative",flexGrow:1,display:"flex",flexDirection:"column",overflow:"hidden"})),cc=s.forwardRef((e,t)=>{var n;const o=ne(),r=sc(o),l=(n=o.experimentalFeatures)!=null&&n.ariaV7?Gl:null,i=typeof l=="function"?l():null;return P.jsx(ic,w({ref:t,className:r.root,ownerState:o},i,{children:e.children}))}),Ll=e=>e.sorting,jo=fe(Ll,e=>e.sortedRows),No=He(jo,It,(e,t)=>e.map(n=>{var o;return{id:n,model:(o=t[n])!=null?o:{}}})),Qe=fe(Ll,e=>e.sortModel),uc=He(Qe,e=>e.reduce((n,o,r)=>(n[o.field]={sortDirection:o.sort,sortIndex:e.length>1?r+1:void 0},n),{})),Bo=e=>e.filter,Ve=fe(Bo,e=>e.filterModel);fe(Ve,e=>e.quickFilterValues);const ac=e=>e.visibleRowsLookup,_l=fe(Bo,e=>e.filteredRowsLookup),dc=fe(Bo,e=>e.filteredDescendantCountLookup),_t=He(ac,No,(e,t)=>t.filter(n=>e[n.id]!==!1)),bn=He(_t,e=>e.map(t=>t.id)),gc=He(_l,No,(e,t)=>t.filter(n=>e[n.id]!==!1)),fc=He(gc,e=>e.map(t=>t.id)),Vl=He(_t,nt,an,(e,t,n)=>n<2?e:e.filter(o=>{var r;return((r=t[o.id])==null?void 0:r.depth)===0})),Al=fe(_t,e=>e.length),to=fe(Vl,e=>e.length),hc=He(Ve,Zt,(e,t)=>{var n;return(n=e.items)==null?void 0:n.filter(o=>{var r,l;if(!o.field)return!1;const i=t[o.field];if(!(i!=null&&i.filterOperators)||(i==null||(r=i.filterOperators)==null?void 0:r.length)===0)return!1;const c=i.filterOperators.find(a=>a.value===o.operator);return c?!c.InputComponent||o.value!=null&&((l=o.value)==null?void 0:l.toString())!=="":!1})}),mc=He(hc,e=>e.reduce((n,o)=>(n[o.field]?n[o.field].push(o):n[o.field]=[o],n),{})),no=e=>e.focus,tt=fe(no,e=>e.cell),Cc=fe(no,e=>e.columnHeader),pc=fe(no,e=>e.columnHeaderFilter),zn=fe(no,e=>e.columnGroupHeader),oo=e=>e.tabIndex,jn=fe(oo,e=>e.cell),zl=fe(oo,e=>e.columnHeader),wc=fe(oo,e=>e.columnHeaderFilter),bc=fe(oo,e=>e.columnGroupHeader),Uo=e=>e.density,vc=fe(Uo,e=>e.value),Xt=fe(Uo,e=>e.factor),xo=e=>e.columnMenu;function xc(e){const{VirtualScrollerComponent:t,ColumnHeadersProps:n,children:o}=e,r=dt(),l=ne(),i=s.useRef(null),c=q(r,Ae),a=q(r,mc),d=q(r,uc),u=q(r,Ut),g=q(r,zl),f=q(r,jn),m=q(r,bc),h=q(r,Cc),C=q(r,zn),v=q(r,Xt),b=q(r,En),p=q(r,xo),y=q(r,lt),E=q(r,ec),_=!(m===null&&g===null&&f===null);We(()=>{r.current.computeSizeAndPublishResizeEvent();const $=i.current;if(typeof ResizeObserver>"u")return()=>{};let H;const O=new ResizeObserver(()=>{H=requestAnimationFrame(()=>{r.current.computeSizeAndPublishResizeEvent()})});return $&&O.observe($),()=>{H&&window.cancelAnimationFrame(H),$&&O.unobserve($)}},[r]);const I=s.useRef(null),D=s.useRef(null),R=s.useRef(null);r.current.register("private",{columnHeadersContainerElementRef:D,columnHeadersElementRef:I,virtualScrollerRef:R,mainElementRef:i});const L=!!r.current.getRootDimensions();return P.jsxs(cc,{ref:i,children:[P.jsx(l.slots.columnHeaders,w({ref:D,innerRef:I,visibleColumns:c,filterColumnLookup:a,sortColumnLookup:d,columnPositions:u,columnHeaderTabIndexState:g,columnGroupHeaderTabIndexState:m,columnHeaderFocus:h,columnGroupHeaderFocus:C,densityFactor:v,headerGroupingMaxDepth:b,columnMenuState:p,columnVisibility:y,columnGroupsHeaderStructure:E,hasOtherElementInTabSequence:_},n)),L&&P.jsx(t,{ref:R}),o]})}function Sc(){var e;const t=ne();return t.hideFooter?null:P.jsx(t.slots.footer,w({},(e=t.slotProps)==null?void 0:e.footer))}const jl=s.createContext(void 0);function he(){const e=s.useContext(jl);if(e===void 0)throw new Error(["MUI: Could not find the data grid context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the data grid."].join(` 4`));return e}const Ee="auto-generated-group-node-root",sn=Symbol("mui.id_autogenerated"),Nl=()=>({type:"group",id:Ee,depth:-1,groupingField:null,groupingKey:null,isAutoGenerated:!0,children:[],childrenFromPath:{},childrenExpanded:!0,parent:null});function Pc(e,t,n="A row was provided without id in the rows prop:"){if(e==null)throw new Error(["MUI: The data grid component requires all rows to have a unique `id` property.","Alternatively, you can use the `getRowId` prop to specify a custom id for each row.",n,JSON.stringify(t)].join(` 5`))}const un=(e,t,n)=>{const o=t?t(e):e.id;return Pc(o,e,n),o},Gn=({rows:e,getRowId:t,loading:n,rowCount:o})=>{const r={type:"full",rows:[]},l={},i={};for(let c=0;c<e.length;c+=1){const a=e[c],d=un(a,t);l[d]=a,i[d]=d,r.rows.push(d)}return{rowsBeforePartialUpdates:e,loadingPropBeforePartialUpdates:n,rowCountPropBeforePartialUpdates:o,updates:r,dataRowIdToIdLookup:i,dataRowIdToModelLo
5okup:l}},Bl=({tree:e,rowCountProp:t=0})=>{const n=e[Ee];return Math.max(t,n.children.length+(n.footerId==null?0:1))},Ul=({apiRef:e,rowCountProp:t=0,loadingProp:n,previousTree:o,previousTreeDepths:r})=>{const l=e.current.caches.rows,{tree:i,treeDepths:c,dataRowIds:a,groupingName:d}=e.current.applyStrategyProcessor("rowTreeCreation",{previousTree:o,previousTreeDepths:r,updates:l.updates,dataRowIdToIdLookup:l.dataRowIdToIdLookup,dataRowIdToModelLookup:l.dataRowIdToModelLookup}),u=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:i,treeDepths:c,dataRowIdToIdLookup:l.dataRowIdToIdLookup,dataRowIds:a,dataRowIdToModelLookup:l.dataRowIdToModelLookup});return e.current.caches.rows.updates={type:"partial",actions:{insert:[],modify:[],remove:[]},idToActionLookup:{}},w({},u,{totalRowCount:Math.max(t,u.dataRowIds.length),totalTopLevelRowCount:Bl({tree:u.tree,rowCountProp:t}),groupingName:d,loading:n})},vn=e=>e.type==="skeletonRow"||e.type==="footer"||e.type==="group"&&e.isAutoGenerated||e.type==="pinnedRow"&&e.isAutoGenerated,ro=(e,t,n)=>{const o=e[t];if(o.type!=="group")return[];const r=[];for(let l=0;l<o.children.length;l+=1){const i=o.children[l];(!n||!vn(e[i]))&&r.push(i);const c=ro(e,i,n);for(let a=0;a<c.length;a+=1)r.push(c[a])}return!n&&o.footerId!=null&&r.push(o.footerId),r},yc=({previousCache:e,getRowId:t,updates:n})=>{var o,r,l;if(e.updates.type==="full")throw new Error("MUI: Unable to prepare a partial update if a full update is not applied yet");const i=new Map;n.forEach(f=>{const m=un(f,t,"A row was provided without id when calling updateRows():");i.has(m)?i.set(m,w({},i.get(m),f)):i.set(m,f)});const c={type:"partial",actions:{insert:[...(o=e.updates.actions.insert)!=null?o:[]],modify:[...(r=e.updates.actions.modify)!=null?r:[]],remove:[...(l=e.updates.actions.remove)!=null?l:[]]},idToActionLookup:w({},e.updates.idToActionLookup)},a=w({}
5,e.dataRowIdToModelLookup),d=w({},e.dataRowIdToIdLookup),u={insert:{},modify:{},remove:{}};i.forEach((f,m)=>{const h=c.idToActionLookup[m];if(f._action==="delete"){if(h==="remove"||!a[m])return;h!=null&&(u[h][m]=!0),c.actions.remove.push(m),delete a[m],delete d[m];return}const C=a[m];if(C){h==="remove"?(u.remove[m]=!0,c.actions.modify.push(m)):h==null&&c.actions.modify.push(m),a[m]=w({},C,f);return}h==="remove"?(u.remove[m]=!0,c.actions.insert.push(m)):h==null&&c.actions.insert.push(m),a[m]=f,d[m]=m});const g=Object.keys(u);for(let f=0;f<g.length;f+=1){const m=g[f],h=u[m];Object.keys(h).length>0&&(c.actions[m]=c.actions[m].filter(C=>!h[C]))}return{dataRowIdToModelLookup:a,dataRowIdToIdLookup:d,updates:c,rowsBeforePartialUpdates:e.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:e.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:e.rowCountPropBeforePartialUpdates}};function Wo(e){var t,n;const o=Yt(e),r=(o==null||(t=o.top)==null?void 0:t.reduce((i,c)=>(i+=e.current.unstable_getRowHeight(c.id),i),0))||0,l=(o==null||(n=o.bottom)==null?void 0:n.reduce((i,c)=>(i+=e.current.unstable_getRowHeight(c.id),i),0))||0;return{top:r,bottom:l}}function Wl(e,t){const n=Xt(e);return`var(--DataGrid-overlayHeight, ${2*Math.floor(t*n)}px)`}const Ic=ze("div",{name:"MuiDataGrid",slot:"OverlayWrapper",shouldForwardProp:e=>e!=="overlayType",overridesResolver:(e,t)=>t.overlayWrapper})(({overlayType:e})=>({position:"sticky",top:0,left:0,width:0,height:0,zIndex:e==="loadingOverlay"?5:4})),Mc=ze("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",shouldForwardProp:e=>e!=="overlayType",overridesResolver:(e,t)=>t.overlayWrapperInner})({}),Fc=e=>{const{classes:t}=e;return ae({root:["overlayWrapper"],inner:["overlayWrapperInner"]},de,t)};function kc(e){var t,n;const o=he(),r=ne(),[l,i]=s.useState(()=>{var u,g;return(u=(g=o.current.getRootDimensions())==null?void 0:g.viewportInnerSize)!=null?u:null}),c=s.useCallback(()=>{var u,g;i((u=(g=o.current.getRootDimensions())==null?void 0:g.viewportInnerSize)!=null?u:null)},[o]);We(()=>o.current.subscribeEvent("viewportInnerSizeChange",c),[o,c]);let a=(t=l?.height)!=null?t:0;r.autoHeight&&a===0&&(a=Wl(o,r.rowHeight));const d=Fc(w({},e,{classes:r.classes}));return l?P.jsx(Ic,{className:Se(d.root),overlayType:e.overlayType,children:P.jsx(Mc,w({className:Se(d.inner),style:{height:a,width:(n=l?.width)!=null?n:0}},e))}):null}function Ec(){const e=he(),t=ne(),n=q(e,eo),o=q(e,Al),r=q(e,tc),l=!r&&n===0,i=!r&&n>0&&o===0;let c=null,a="";if(l){var d;c=P.jsx(t.slots.noRowsOverlay,w({},(d=t.slotProps)==null?void 0:d.noRowsOverlay)),a="noRowsOverlay"}if(i){var u;c=P.jsx(t.slots.noResultsOverlay,w({},(u=t.slotProps)==null?void 0:u.noResultsOverlay)),a="noResultsOverlay"}if(r){var g;c=P.jsx(t.slots.loadingOverlay,w({},(g=t.slotProps)==null?void 0:g.loadingOverlay)),a="loadingOverlay"}return c===null?null:P.jsx(kc,{overlayType:a,children:c})}function lo(e){return s.memo(e,Tl)}let fo;function Dc(){return fo===void 0&&document.createElement("div").focus({get preventScroll(){return fo=!0,!1}}),fo}var wt=(function(e){return e.Cell="cell",e.Row="row",e})(wt||{}),ke=(function(e){return e.Edit="edit",e.View="view",e})(ke||{}),Te=(function(e){return e.Edit="edit",e.View="view",e})(Te||{}),Ye=(function(e){return e.And="and",e.Or="or",e})(Ye||{}),vt=(function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e.pasteKeyDown="pasteKeyDown",e})(vt||{}),ct=(function(e){return e.cellFocusOut="cellFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e})(ct||{}),Dt=(function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e})(Dt||{}),xt=(function(e){return e.rowFocusOut="rowFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e})(xt||{});function Kl(e){return e.field!==void 0}function Rc(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function Nn(e,t){return e.closest(`.${t}`)}function Ko(e){return e.replace(/["\\]/g,"\\$&")}function Tc(e,t){return e.querySelector(`[role="columnheader"][data-field="${Ko(t)}"]`)}function ql(e){return`.${V.row}[data-id="${Ko(String(e))}"]`}function Hc(e,t){return e.querySelector(ql(t))}function Oc(e,{id:t,field:n}){const o=ql(t),r=`.${V.cell}[data-field="${Ko(n)}"]`,l=`${o} ${r}`;return e.querySelector(l)}function dn(e){return e.target.nodeType===1&&!e.currentTarget.contains(e.target)}function ge(e,t,n){const o=s.useRef(!0);s.useEffect(()=>{o.current=!1,e.current.register(n,t)},[e,n,t]),o.current&&e.current.register(n,t)}
5class ln extends Error{}function $c(e,t){const{getRowId:n}=t,o=s.useCallback(h=>({field:h,colDef:e.current.getColumn(h)}),[e]),r=s.useCallback(h=>{const C=e.current.getRow(h);if(!C)throw new ln(`No row with id #${h} found`);return{id:h,columns:e.current.getAllColumns(),row:C}},[e]),l=s.useCallback((h,C)=>{const v=e.current.getRow(h),b=e.current.getRowNode(h);if(!v||!b)throw new ln(`No row with id #${h} found`);const p=tt(e),y=jn(e);return{id:h,field:C,row:v,rowNode:b,value:v[C],colDef:e.current.getColumn(C),cellMode:e.current.getCellMode(h,C),api:e.current,hasFocus:p!==null&&p.field===C&&p.id===h,tabIndex:y&&y.field===C&&y.id===h?0:-1}},[e]),i=s.useCallback((h,C)=>{const v=e.current.getColumn(C),b=e.current.getCellValue(h,C),p=e.current.getRow(h),y=e.current.getRowNode(h);if(!p||!y)throw new ln(`No row with id #${h} found`);const E=tt(e),_=jn(e),I={id:h,field:C,row:p,rowNode:y,colDef:v,cellMode:e.current.getCellMode(h,C),hasFocus:E!==null&&E.field===C&&E.id===h,tabIndex:_&&_.field===C&&_.id===h?0:-1,value:b,formattedValue:b,isEditable:!1};return v&&v.valueFormatter&&(I.formattedValue=v.valueFormatter({id:h,field:I.field,value:I.value,api:e.current})),I.isEditable=v&&e.current.isCellEditable(I),I},[e]),c=s.useCallback((h,C)=>{const v=e.current.getColumn(C);if(!v||!v.valueGetter){const b=e.current.getRow(h);if(!b)throw new ln(`No row with id #${h} found`);return b[C]}return v.valueGetter(l(h,C))},[e,l]),a=s.useCallback((h,C)=>{var v;const b=sn in h?h[sn]:(v=n?.(h))!=null?v:h.id,p=C.field;return!C||!C.valueGetter?h[p]:C.valueGetter(l(b,p))},[l,n]),d=s.useCallback((h,C)=>{var v;const b=a(h,C);if(!C||!C.valueFormatter)return b;const p=(v=n?n(h):h.id)!=null?v:h[sn],y=C.field;return C.valueFormatter({id:p,field:y,value:b,api:e.current})},[e,n,a]),u=s.useCallback(h=>e.current.rootElementRef.current?Tc(e.current.rootElementRef.current,h):null,[e]),g=s.useCallback(h=>e.current.rootElementRef.current?Hc(e.current.rootElementRef.current,h):null,[e]),f=s.useCallback((h,C)=>e.current.rootElementRef.current?Oc(e.current.rootElementRef.current,{id:h,field:C}):null,[e]);ge(e,{getCellValue:c,getCellParams:i,getCellElement:f,getRowValue:a,getRowFormattedValue:d,getRowParams:r,getRowElement:g,getColumnHeaderParams:o,getColumnHeaderElement:u},"public")}
5const Gc=["changeReason","unstable_updateValueOnRender"],Lc=["column","rowId","editCellState","align","children","colIndex","height","width","className","showRightBorder","extendRowFullWidth","row","colSpan","disableDragEvents","isNotVisible","onClick","onDoubleClick","onMouseDown","onMouseUp","onMouseOver","onKeyDown","onKeyUp","onDragEnter","onDragOver","style"],_c=["changeReason","unstable_updateValueOnRender"],Bn={id:-1,field:"__unset__",row:{},rowNode:{id:-1,depth:0,type:"leaf",parent:-1,groupingKey:null},colDef:{type:"string",field:"__unset__",computedWidth:0},cellMode:ke.View,hasFocus:!1,tabIndex:-1,value:null,formattedValue:"__unset__",isEditable:!1,api:{}},Vc=e=>{const{align:t,showRightBorder:n,isEditable:o,isSelected:r,isSelectionMode:l,classes:i}=e,c={root:["cell",`cell--text${pt(t)}`,o&&"cell--editable",r&&"selected",n&&"cell--withRightBorder",l&&!o&&"cell--selectionMode","withBorderColor"],content:["cellContent"]};return ae(c,de,i)},Ac=s.forwardRef((e,t)=>{const{column:n,rowId:o,editCellState:r}=e,l=he(),i=ne(),c=n.field,a=q(l,()=>{try{const L=l.current.getCellParams(o,c);return L.api=l.current,L}catch(R){if(R instanceof ln)return Bn;throw R}},zo),d=q(l,()=>l.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:o,field:c}));if(a===Bn)return null;const{cellMode:u,hasFocus:g,isEditable:f,value:m,formattedValue:h}=a,C=n.type==="actions",v=(u==="view"||!f)&&!C?a.tabIndex:-1,{classes:b,getCellClassName:p}=i,y=l.current.unstable_applyPipeProcessors("cellClassName",[],{id:o,field:c});n.cellClassName&&y.push(typeof n.cellClassName=="function"?n.cellClassName(a):n.cellClassName),p&&y.push(p(a));let E;if(r==null&&n.renderCell&&(E=n.renderCell(a),y.push(V["cell--withRenderer"]),y.push(b?.["cell--withRenderer"])),r!=null&&n.renderEditCell){const R=l.current.getRowWithUpdatedValues(o,n.field),L=te(r,Gc),$=w({},a,{row:R},L);E=n.renderEditCell($),y.push(V["cell--editing"]),y.push(b?.["cell--editing"])}const{slots:_}=i,I=_.cell,D=w({},e,{ref:t,field:c,formattedValue:h,hasFocus:g,isEditable:f,isSelected:d,value:m,cellMode:u,children:E,tabIndex:v,className:Se(y)});return s.createElement(I,D)}),zc=lo(Ac),jc=s.forwardRef((e,t)=>{var n,o,r,l;const{column:i,rowId:c,editCellState:a,align:d,colIndex:u,height:g,width:f,className:m,showRightBorder:h,colSpan:C,disableDragEvents:v,isNotVisible:b,onClick:p,onDoubleClick:y,onMouseDown:E,onMouseUp:_,onMouseOver:I,onKeyDown:D,onKeyUp:R,onDragEnter:L,onDragOver:$,style:H}=e,O=te(e,Lc),M=he(),S=ne(),x=i.field,F=q(M,()=>{try{const oe=M.current.getCellParams(c,x);return oe.api=M.current,oe}catch(X){if(X instanceof ln)return Bn;throw X}},zo),T=q(M,()=>M.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:c,field:x})),{cellMode:k,hasFocus:G,isEditable:z,value:N,formattedValue:j}=F,B=i.type==="actions"&&((n=(o=i).getActions)==null?void 0:n.call(o,M.current.getRowParams(c)).some(X=>!X.props.disabled)),Z=(k==="view"||!z)&&!B?F.tabIndex:-1,{classes:W,getCellClassName:ee}=S,K=M.current.unstable_applyPipeProcessors("cellClassName",[],{id:c,field:x});i.cellClassName&&K.push(typeof i.cellClassName=="function"?i.cellClassName(F):i.cellClassName),ee&&K.push(ee(F));const ce=j??N,we=s.useRef(null),ue=Ft(t,we),se=s.useRef(null),pe=(r=S.unstable_cellSelection)!=null?r:!1,be={align:d,showRightBorder:h,isEditable:z,classes:S.classes,isSelected:T,isSelectionMode:pe},ye=Vc(be),Pe=s.useCallback(X=>oe=>{const re=M.current.getCellParams(c,x||"");M.current.publishEvent(X,re,oe),_&&_(oe)},[M,x,_,c]),Y=s.useCallback(X=>oe=>{const re=M.current.getCellParams(c,x||"");M.current.publishEvent(X,re,oe),E&&E(oe)},[M,x,E,c]),J=s.useCallback((X,oe)=>re=>{if(!M.current.getRow(c))return;const xe=M.current.getCellParams(c,x||"");M.current.publishEvent(X,xe,re),oe&&oe(re)},[M,x,c]),ie=s.useMemo(()=>b?w({padding:0,opacity:0,width:0,border:0},H):w({minWidth:f,maxWidth:f,minHeight:g,maxHeight:g==="auto"?"n
5one":g},H),[f,g,b,H]);if(s.useEffect(()=>{if(!G||k===ke.Edit)return;const X=Nt(M.current.rootElementRef.current);if(we.current&&!we.current.contains(X.activeElement)){const oe=we.current.querySelector('[tabindex="0"]'),re=se.current||oe||we.current;if(Dc())re.focus({preventScroll:!0});else{const xe=M.current.getScrollPosition();re.focus(),M.current.scroll(xe)}}},[G,k,M]),F===Bn)return null;let me=O.onFocus,Ce;if(a==null&&i.renderCell&&(Ce=i.renderCell(F),K.push(V["cell--withRenderer"]),K.push(W?.["cell--withRenderer"])),a!=null&&i.renderEditCell){const X=M.current.getRowWithUpdatedValues(c,i.field),oe=te(a,_c),re=w({},F,{row:X},oe);Ce=i.renderEditCell(re),K.push(V["cell--editing"]),K.push(W?.["cell--editing"])}if(Ce===void 0){const X=ce?.toString();Ce=P.jsx("div",{className:ye.content,title:X,role:"presentation",children:X})}s.isValidElement(Ce)&&B&&(Ce=s.cloneElement(Ce,{focusElementRef:se}));const ve=v?null:{onDragEnter:J("cellDragEnter",L),onDragOver:J("cellDragOver",$)},le=(l=S.experimentalFeatures)==null?void 0:l.ariaV7;return P.jsx("div",w({ref:ue,className:Se(m,K,ye.root),role:le?"gridcell":"cell","data-field":x,"data-colindex":u,"aria-colindex":u+1,"aria-colspan":C,style:ie,tabIndex:Z,onClick:J("cellClick",p),onDoubleClick:J("cellDoubleClick",y),onMouseOver:J("cellMouseOver",I),onMouseDown:Y("cellMouseDown"),onMouseUp:Pe("cellMouseUp"),onKeyDown:J("cellKeyDown",D),onKeyUp:J("cellKeyUp",R)},ve,O,{onFocus:me,children:Ce}))}),So=lo(jc),Nc=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex"],Bc=e=>{const{classes:t}=e;return ae({root:["booleanCell"]},de,t)};function Uc(e){const{value:t}=e,n=te(e,Nc),o=he(),r=ne(),l={classes:r.classes},i=Bc(l),c=s.useMemo(()=>t?r.slots.booleanCellTrueIcon:r.slots.booleanCellFalseIcon,[r.slots.booleanCellFalseIcon,r.slots.booleanCellTrueIcon,t]);return P.jsx(c,w({fontSize:"small",className:i.root,titleAccess:o.current.getLocaleText(t?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":!!t},n))}const Wc=s.memo(Uc),Kc=e=>vn(e.rowNode)?"":P.jsx(Wc,w({},e)),qc=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange"],Qc=e=>{const{classes:t}=e;return ae({root:["editBooleanCell"]},de,t)};function Zc(e){var t;const{id:n,value:o,field:r,className:l,hasFocus:i,onValueChange:c}=e,a=te(e,qc),d=he(),u=s.useRef(null),g=$e(),[f,m]=s.useState(o),h=ne(),C={classes:h.classes},v=Qc(C),b=s.useCallback(async p=>{const y=p.target.checked;c&&await c(p,y),m(y),await d.current.setEditCellValue({id:n,field:r,value:y},p)},[d,r,n,c]);return s.useEffect(()=>{m(o)},[o]),We(()=>{i&&u.current.focus()},[i]),P.jsx("label",w({htmlFor:g,className:Se(v.root,l)},a,{children:P.jsx(h.slots.baseCheckbox,w({id:g,inputRef:u,checked:!!f,onChange:b,size:"small"},(t=h.slotProps)==null?void 0:t.baseCheckbox))}))}const Yc=e=>P.jsx(Zc,w({},e)),Xc=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","inputProps","isValidating","isProcessingProps","onValueChange"],Jc=Re(yl)({fontSize:"inherit"}),eu=e=>{const{classes:t}=e;return ae({root:["editInputCell"]},de,t)};function tu(e){const{id:t,value:n,field:o,colDef:r,hasFocus:l,inputProps:i,onValueChange:c}=e,a=te(e,Xc),d=r.type==="dateTime",u=he(),g=s.useRef(),f=s.useMemo(()=>{let E;n==null?E=null:n instanceof Date?E=n:E=new Date((n??"").toString());let _;return E==null||Number.isNaN(E.getTime())?_="":_=new Date(E.getTime()-E.getTimezoneOffset()*60*1e3).toISOString().substr(0,d?16:10),{parsed:E,formatted:_}},[n,d]),[m,h]=s.useState(f),v={classes:ne().classes},b=eu(v),p=s.useCallback(E=>{if(E==="")return null;const[_,I]=E.split("T"),[D,R,L]=_.split("-"),$=new Date;if($.setFullYear(Number(D),Number(R)-1,Number(L)),$.setHours(0,0,0,0),I){const[H,O]=I.split(":");$.setHours(Number(H),Number(O),0,0)}return $},[]),y=s.useCallback(async E=>{const _=E.target.value,I=p(_);c&&await c(E,I),h({parsed:I,formatted:_}),u.current.setEditCellValue({id:t,field:o,value:I},E)},[u,o,t,c,p]);return s.useEffect(()=>{h(E=>{var _,I;return f.parsed!==E.parsed&&((_=f.parsed)==null?void 0:_.getTime())!==((I=E.parsed)==null?void 0:I.getTime())?f:E})},[f]),We(()=>{l&&g.current.focus()},[l]),P.jsx(Jc,w({inputRef:g,fullWidth:!0,className:b.root,type:d?"datetime-local":"date",inputProps:w({max:d?"9999-12-31T23:59":"9999-12-31"},i),value:m.formatted,onChange:y},a))}const Ql=e=>P.jsx(tu,w({},e)),nu=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","isValidating","debounceMs","isProcessingProps","onValueChange"],ou=e=>{const{classes:t}=e;return ae({root:["editInputCell"]},de,t)},ru=Re(yl,{name:"MuiDataGrid",slot:"EditInputCell",overridesResolver:(e,t)=>t.editInputCell})(({theme:e})=>w({},e.typography.body2,{padding:"1px 0","& input":{padding:"0 16px",height:"100%"}})),lu=s.forwardRef((e,t)=>
5{const n=ne(),{id:o,value:r,field:l,colDef:i,hasFocus:c,debounceMs:a=200,isProcessingProps:d,onValueChange:u}=e,g=te(e,nu),f=he(),m=s.useRef(),[h,C]=s.useState(r),v=ou(n),b=s.useCallback(async y=>{const E=y.target.value;u&&await u(y,E);const _=f.current.getColumn(l);let I=E;_.valueParser&&(I=_.valueParser(E,f.current.getCellParams(o,l))),C(I),f.current.setEditCellValue({id:o,field:l,value:I,debounceMs:a,unstable_skipValueParser:!0},y)},[f,a,l,o,u]),p=f.current.unstable_getEditCellMeta(o,l);return s.useEffect(()=>{p?.changeReason!=="debouncedSetEditCellValue"&&C(r)},[p,r]),We(()=>{c&&m.current.focus()},[c]),P.jsx(ru,w({ref:t,inputRef:m,className:v.root,ownerState:n,fullWidth:!0,type:i.type==="number"?i.type:"text",value:h??"",onChange:b,endAdornment:d?P.jsx(n.slots.loadIcon,{fontSize:"small",color:"action"}):void 0},g))}),su=e=>P.jsx(lu,w({},e)),Un=e=>e==="Escape",iu=e=>e==="Enter",qo=e=>e==="Tab",Zl=e=>e===" ",cu=e=>e.indexOf("Arrow")===0,uu=e=>e==="Home"||e==="End",au=e=>e.indexOf("Page")===0;function Yl(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}const xn=e=>uu(e)||cu(e)||au(e)||Zl(e),du=e=>!!e.key,Xl=e=>qo(e)||Un(e);function Bt(e){return e?.type==="singleSelect"}function Po(e,t,n){if(t===void 0)return;const o=t.find(r=>{const l=n(r);return String(l)===String(e)});return n(o)}const gu=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen","getOptionLabel","getOptionValue"],fu=["MenuProps"];function hu(e){return!!e.key}function mu(e){var t,n,o;const r=ne(),{id:l,value:i,field:c,row:a,colDef:d,hasFocus:u,error:g,onValueChange:f,initialOpen:m=r.editMode===wt.Cell,getOptionLabel:h,getOptionValue:C}=e,v=te(e,gu),b=he(),p=s.useRef(),y=s.useRef(),[E,_]=s.useState(m),D=(n=(((t=r.slotProps)==null?void 0:t.baseSelect)||{}).native)!=null?n:!1,R=((o=r.slotProps)==null?void 0:o.baseSelect)||{},{MenuProps:L}=R,$=te(R,fu);if(We(()=>{if(u){var T;(T=y.current)==null||T.focus()}},[u]),!Bt(d))return null;let H;if(typeof d?.valueOptions=="function"?H=d?.valueOptions({id:l,row:a,field:c}):H=d?.valueOptions,!H)return null;const O=C||d.getOptionValue,M=h||d.getOptionLabel,S=async T=>{if(!Bt(d)||!H)return;_(!1);const k=T.target,G=Po(k.value,H,O);f&&await f(T,G),await b.current.setEditCellValue({id:l,field:c,value:G},T)},x=(T,k)=>{if(r.editMode===wt.Row){_(!1);return}if(k==="backdropClick"||Un(T.key)){const G=b.current.getCellParams(l,c);b.current.publishEvent("cellEditStop",w({},G,{reason:Un(T.key)?ct.escapeKeyDown:ct.cellFocusOut}))}},F=T=>{hu(T)&&T.key==="Enter"||_(!0)};return!H||!d?null:P.jsx(r.slots.baseSelect,w({ref:p,inputRef:y,value:i,onChange:S,open:E,onOpen:F,MenuProps:w({onClose:x},L),error:g,native:D,fullWidth:!0},v,$,{children:H.map(T=>{var k;const G=O(T);return s.createElement(r.slots.baseSelectOption,w({},((k=r.slotProps)==null?void 0:k.baseSelectOption)||{},{native:D,key:G,value:G}),M(T))})}))}const Cu=e=>P.jsx(mu,w({},e)),pu=["open","target","onClose","children","position","className","onExited"],wu=e=>{const{classes:t}=e;return ae({root:["menu"]},de,t)},bu=Re(_o,{name:"MuiDataGrid",slot:"Menu",overridesResolver:(e,t)=>t.menu})(({theme:e})=>({zIndex:e.zIndex.modal,[`& .${V.menuList}`]:{outline:0}})),vu={"bottom-start":"top left","bottom-end":"top right"};function so(e){var t;const{open:n,target:o,onClose:r,children:l,position:i,className:c,onExited:a}=e,d=te(e,pu),u=he(),g=ne(),f=wu(g),m=s.useRef(null);We(()=>{if(n)m.current=document.activeElement instanceof HTMLElement?document.activeElement:null;else{var v,b;(v=m.current)==null||(b=v.focus)==null||b.call(v),m.current=null}},[n]),s.useEffect(()=>{const v=n?"menuOpen":"menuClose";u.current.publishEvent(v,{target:o})},[u,n,o]);const h=v=>b=>{v&&v(),a&&a(b)},C=v=>{v.target&&(o===v.target||o!=null&&o.contains(v.target))||r(v)};return P.jsx(bu,w({as:g.slots.basePopper,className:Se(c,f.root),ownerState:g,open:n,anchorEl:o,transition:!0,placement:i}
5,d,(t=g.slotProps)==null?void 0:t.basePopper,{children:({TransitionProps:v,placement:b})=>P.jsx(Il,{onClickAway:C,mouseEvent:"onMouseDown",children:P.jsx(Ci,w({},v,{style:{transformOrigin:vu[b]},onExited:h(v?.onExited),children:P.jsx(Ml,{children:l})}))})}))}const xu=["api","colDef","id","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","tabIndex","position","focusElementRef"],Su=e=>typeof e.getActions=="function";function Pu(e){var t;const{colDef:n,id:o,hasFocus:r,tabIndex:l,position:i="bottom-end",focusElementRef:c}=e,a=te(e,xu),[d,u]=s.useState(-1),[g,f]=s.useState(!1),m=he(),h=s.useRef(null),C=s.useRef(null),v=s.useRef(!1),b=s.useRef({}),p=st(),y=$e(),E=$e(),_=ne();if(!Su(n))throw new Error("MUI: Missing the `getActions` property in the `GridColDef`.");const I=n.getActions(m.current.getRowParams(o)),D=I.filter(F=>!F.props.showInMenu),R=I.filter(F=>F.props.showInMenu),L=D.length+(R.length?1:0);s.useLayoutEffect(()=>{r||Object.entries(b.current).forEach(([F,T])=>{T?.stop({},()=>{delete b.current[F]})})},[r]),s.useEffect(()=>{if(d<0||!h.current||d>=h.current.children.length)return;h.current.children[d].focus({preventScroll:!0})},[d]),s.useEffect(()=>{r||(u(-1),v.current=!1)},[r]),s.useImperativeHandle(c,()=>({focus(){if(!v.current){const F=I.findIndex(T=>!T.props.disabled);u(F)}}}),[I]),s.useEffect(()=>{d>=L&&u(L-1)},[d,L]);const $=()=>{f(!0),u(L-1),v.current=!0},H=()=>{f(!1)},O=F=>T=>{b.current[F]=T},M=(F,T)=>k=>{u(F),v.current=!0,T&&T(k)},S=F=>{if(L<=1)return;const T=(G,z)=>{var N;if(G<0||G>I.length)return G;const j=p.direction==="rtl"?-1:1,B=(z==="left"?-1:1)*j;return(N=I[G+B])!=null&&N.props.disabled?T(G+B,z):G+B};let k=d;F.key==="ArrowRight"?k=T(d,"right"):F.key==="ArrowLeft"&&(k=T(d,"left")),!(k<0||k>=L)&&k!==d&&(F.preventDefault(),F.stopPropagation(),u(k))},x=F=>{F.key==="Tab"&&F.preventDefault(),["Tab","Escape"].includes(F.key)&&H()};return P.jsxs("div",w({role:"menu",ref:h,tabIndex:-1,className:V.actionsCell,onKeyDown:S},a,{children:[D.map((F,T)=>s.cloneElement(F,{key:T,touchRippleRef:O(T),onClick:M(T,F.props.onClick),tabIndex:d===T?l:-1})),R.length>0&&E&&P.jsx(_.slots.baseIconButton,w({ref:C,id:E,"aria-label":m.current.getLocaleText("actionsCellMore"),"aria-haspopup":"menu","aria-expanded":g,"aria-controls":g?y:void 0,role:"menuitem",size:"small",onClick:$,touchRippleRef:O(E),tabIndex:d===D.length?l:-1},(t=_.slotProps)==null?void 0:t.baseIconButton,{children:P.jsx(_.slots.moreActionsIcon,{fontSize:"small"})})),R.length>0&&P.jsx(so,{open:g,target:C.current,position:i,onClose:H,children:P.jsx(Yn,{id:y,className:V.menuList,onKeyDown:x,"aria-labelledby":E,variant:"menu",autoFocusItem:!0,children:R.map((F,T)=>s.cloneElement(F,{key:T,closeMenu:H}))})})]}))}const yu=e=>P.jsx(Pu,w({},e)),Iu=["label","icon","showInMenu","onClick"],Mu=["label","icon","showInMenu","onClick","closeMenuOnClick","closeMenu"],Lp=s.forwardRef((e,t)=>{const n=ne();if(!e.showInMenu){var o;const{label:g,icon:f,onClick:m}=e,h=te(e,Iu),C=v=>{m?.(v)};return P.jsx(n.slots.baseIconButton,w({ref:t,size:"small",role:"menuitem","aria-label":g},h,{onClick:C},(o=n.slotProps)==null?void 0:o.baseIconButton,{children:s.cloneElement(f,{fontSize:"small"})}))}const{label:r,icon:l,onClick:i,closeMenuOnClick:c=!0,closeMenu:a}=e,d=te(e,Mu),u=g=>{i?.(g),c&&a?.()};return P.jsxs(Ze,w({ref:t},d,{onClick:u,children:[l&&P.jsx(ut,{children:l}),r]}))}),Fu=["field","align","width","contentWidth"],ku=e=>{const{align:t,classes:n}=e,o={root:["cell","cellSkeleton",`cell--text${pt(t)}`,"withBorderColor"]};return ae(o,de,n)};function Eu(e){const{align:t,width:n,contentWidth:o}=e,r=te(e,Fu),i={classes:ne().classes,align:t},c=ku(i);return P.jsx("div",w({className:c.root,style:{width:n}},r,{children:P.jsx(pi,{width:`${o}%`})}))}function Du(e){return e.vars?e.vars.palette.TableCell.border:e.palette.mode==="light"?fi(qe(e.palette.divider,1),.88):hi(qe(e.palette.divider,1),.68)}const Sr={[`.${V.columnSeparator}, .${V["columnSeparator--resizing"]}`]:{visibility:"visible",width:"auto"}},Pr={[`& .${V.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${V.menuIcon}`]:{width:"auto",visibility:"visible"}},Ru=Re("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[{[`&.${V.autoHeight}`]:t.autoHeight},{[`&.${V.aggregationColumnHeader}`]:t.aggregationColumnHeader},{[`&.${V["aggregationColumnHeader--alignLeft"]}`]:t["aggregationColumnHeader--alignLeft"]},{[`&.${V["aggregationColumnHeader--alignCenter"]}`]:t["aggregationColumnHeader--alignCenter"]},{[`&.${V["aggregationColumnHeader--alignRight"]}`]:t["aggregationColumnHeader--alignRight"]},{[`&.${V.aggregationColumnHeaderLabel}`]:t.aggregationColumnHeaderLabel},{[`&.${V["root--disableUserSelection"]} .${V.cell}`]:t["root--disableUserSelection"]},{[`&.${V.autosizing}`]:t.autosizing},{[`& .${V.editBooleanCell}`]:t.editBooleanCell},{[`& .${V["cell--editing"]}`]:t["cell--editing"]},{[`& .${V["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${V["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${V["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${V["cell--withRenderer"]}`]:t["cell--withRenderer"]},{[`& .${V.cell}`]:t.cell},{[`& .${V["cell--rangeTop"]}`]:t["cell--rangeTop"]},{[`& .${V["cell--rangeBottom"]}`]:t["cell--rangeBottom"]},{[`& .${V["cell--rangeLeft"]}`]:t["cell--rangeLeft"]},{[`& .${V["cell--rangeRight"]}`]:t["cell--rangeRight"]},{[`& .${V["cell--withRightBorder"]}`]:t["cell--withRightBorder"]},{[`& .${V.cellContent}`]:t.cellContent},{[`& .${V.cellCheckbox}`]:t.cellCheckbox},{[`& .${V.cellSkeleton}`]:t.cellSkeleton},{[`& .${V.checkboxInput}`]:t.checkboxInput},{[`& .${V["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${V["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${V["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${V["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${V["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${V["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${V["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${V["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${V["columnHeader--withRightBorder"]}`]:t["columnHeader--withRightBorder"]},{[`& .${V.columnHeader}`]:t.columnHeader},{[`& .${V.headerFilterRow}`]:t.headerFilterRow},{[`& .${V.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${V.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${V.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${V["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${V["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${V.columnSeparator}`]:t.columnSeparator},{[`& .${V.filterIcon}`]:t.filterIcon},{[`& .${V.iconSeparator}`]:t.iconSeparator},{[`& .${V.menuIcon}`]:t.menuIcon},{[`& .${V.menuIconButton}`]:t.menuIconButton},{[`& .${V.menuOpen}`]:t.menuOpen},{[`& .${V.menuList}`]:t.menuList},{[`& .${V["row--editable"]}`]:t["row--editable"]},{[`& .${V["row--editing"]}`]:t["row--editing"]},{[`& .${V["row--dragging"]}`]:t["row--dragging"]},{[`& .${V.row}`]:t.row},{[`& .${V.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${V.rowReorderCell}`]:t.rowReorderCell},{[`& .${V["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${V.sortIcon}`]:t.sortIcon},{[`& .${V.withBorderColor}`]:t.withBorderColor},{[`& .${V.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${V.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${V.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${V["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},t.root]})(({theme:e})=>{const t=Du(e),n=e.shape.borderRadius;return w({"--unstable_DataGrid-radius":typeof n=="number"?`${n}
5px`:n,"--unstable_DataGrid-headWeight":e.typography.fontWeightMedium,"--unstable_DataGrid-overlayBackground":e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:qe(e.palette.background.default,e.palette.action.disabledOpacity),"--DataGrid-cellOffsetMultiplier":2,flex:1,boxSizing:"border-box",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:t,borderRadius:"var(--unstable_DataGrid-radius)",color:(e.vars||e).palette.text.primary},e.typography.body2,{outline:"none",height:"100%",display:"flex",minWidth:0,minHeight:0,flexDirection:"column",overflowAnchor:"none",[`&.${V.autoHeight}`]:{height:"auto",[`& .${V["row--lastVisible"]} .${V.cell}`]:{borderBottomColor:"transparent"}},[`&.${V.autosizing}`]:{[`& .${V.columnHeaderTitleContainerContent} > *`]:{overflow:"visible !important"},[`& .${V.cell} > *`]:{overflow:"visible !important",whiteSpace:"nowrap"},[`& .${V.groupingCriteriaCell}`]:{width:"unset"},[`& .${V.treeDataGroupingCell}`]:{width:"unset"}},[`& .${V["virtualScrollerContent--overflowed"]} .${V["row--lastVisible"]} .${V.cell}`]:{borderBottomColor:"transparent"},[`& .${V.columnHeader}, & .${V.cell}`]:{WebkitTapHighlightColor:"transparent",lineHeight:null,padding:"0 10px",boxSizing:"border-box"},[`& .${V.columnHeader}:focus-within, & .${V.cell}:focus-within`]:{outline:`solid ${e.vars?`rgba(${e.vars.palette.primary.mainChannel} / 0.5)`:qe(e.palette.primary.main,.5)} 1px`,outlineWidth:1,outlineOffset:-1},[`& .${V.columnHeader}:focus, & .${V.cell}:focus`]:{outline:`solid ${e.palette.primary.main} 1px`},[`& .${V.columnHeaderCheckbox}, & .${V.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${V.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center"},[`& .${V["columnHeader--sorted"]} .${V.iconButtonContainer}, & .${V["columnHeader--filtered"]} .${V.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${V.columnHeader}:not(.${V["columnHeader--sorted"]}) .${V.sortIcon}`]:{opacity:0,transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter})},[`& .${V.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden",position:"relative"},[`& .${V.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${V["columnHeader--filledGroup"]} .${V.columnHeaderTitleContainer}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${V["columnHeader--filledGroup"]}.${V["columnHeader--showColumnBorder"]} .${V.columnHeaderTitleContainer}`]:{borderBottom:"none"},[`& .${V["columnHeader--filledGroup"]}.${V["columnHeader--showColumnBorder"]}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${V.headerFilterRow}`]:{borderTop:`1px solid ${t}`},[`& .${V.sortIcon}, & .${V.filterIcon}`]:{fontSize:"inherit"},[`& .${V["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${V["columnHeader--alignCenter"]} .${V.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${V["columnHeader--alignRight"]} .${V.columnHeaderDraggableContainer}, & .${V["columnHeader--alignRight"]} .${V.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${V["columnHeader--alignCenter"]} .${V.menuIcon}, & .${V["columnHeader--alignRight"]} .${V.menuIcon}`]:{marginRight:"auto",marginLeft:-6},[`& .${V["columnHeader--alignRight"]} .${V.menuIcon}, & .${V["columnHeader--alignRight"]} .${V.menuIcon}`]:{marginRight:"auto",marginLeft:-10},[`& .${V["columnHeader--moving"]}`]:{backgroundColor:(e.vars||e).palette.action.hover},[`& .${V.columnSeparator}`]:{visibility:"hidden",position:"absolute",zIndex:100,display:"flex",flexDirection:"column",justifyContent:"center",color:t},"@media (hover: hover)":{[`& .${V.columnHeaders}:hover`]:Sr,[`& .${V.columnHeader}:hover`]:Pr,[`& .${V.columnHeader}:not(.${V["columnHeader--sorted"]}):hover .${V.sortIcon}`]:{opacity:.5}},"@media (hover: none)":{[`& .${V.columnHeaders}`]:Sr,[`& .${V.columnHeader}`]:Pr},[`& .${V["columnSeparator--sideLeft"]}`]:{left:-12},[`& .${V["columnSeparator--sideRight"]}`]:{right:-12},[`& .${V["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none","&:hover":{color:(e.vars||e).palette.text.primary,"@media (hover: none)":{color:t}},[`&.${V["columnSeparator--resizing"]}`]:{color:(e.vars||e).palette.text.primary},"& svg":{pointerEvents:"none"}},[`& .${V.iconSeparator}`]:{color:"inherit"},[`& .${V.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-10,display:"flex",alignItems:"center"},[`.${V.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${V.row}`]:{display:"flex",width:"fit-content",breakInside:"avoid","&:hover, &.Mui-hovered":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},"&.Mui-selected":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:qe(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover, &.Mui-hovered":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc( 6 ${e.vars.palette.action.selectedOpacity} + 7 ${e.vars.palette.action.hoverOpacity} 8 ))`:qe(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:qe(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},[`& .${V.cell}`]:{display:"flex",alignItems:"center",borderBottom:"1px solid","&.Mu
8i-selected":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:qe(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover, &.Mui-hovered":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity+e.palette.action.hoverOpacity})`:qe(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:qe(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},[`&.${V["root--disableUserSelection"]} .${V.cell}`]:{userSelect:"none"},[`& .${V.row}:not(.${V["row--dynamicHeight"]}) > .${V.cell}`]:{overflow:"hidden",whiteSpace:"nowrap"},[`& .${V.cellContent}`]:{overflow:"hidden",textOverflow:"ellipsis"},[`& .${V.cell}.${V["cell--selectionMode"]}`]:{cursor:"default"},[`& .${V.cell}.${V["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:e.shadows[2],backgroundColor:(e.vars||e).palette.background.paper,"&:focus-within":{outline:`solid ${(e.vars||e).palette.primary.main} 1px`,outlineOffset:"-1px"}},[`& .${V["row--editing"]}`]:{boxShadow:e.shadows[2]},[`& .${V["row--editing"]} .${V.cell}`]:{boxShadow:e.shadows[0],backgroundColor:(e.vars||e).palette.background.paper},[`& .${V.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${V.booleanCell}[data-value="true"]`]:{color:(e.vars||e).palette.text.secondary},[`& .${V.booleanCell}[data-value="false"]`]:{color:(e.vars||e).palette.text.disabled},[`& .${V.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:e.spacing(1)},[`& .${V.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${V["rowReorderCell--draggable"]}`]:{cursor:"move",opacity:1},[`& .${V.rowReorderCellContainer}`]:{padding:0,alignItems:"stretch"},[`.${V.withBorderColor}`]:{borderColor:t},[`& .${V["cell--withRightBorder"]}`]:{borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${V["columnHeader--withRightBorder"]}`]:{borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${V["cell--textLeft"]}`]:{justifyContent:"flex-start"},[`& .${V["cell--textRight"]}`]:{justifyContent:"flex-end"},[`& .${V["cell--textCenter"]}`]:{justifyContent:"center"},[`& .${V.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${V.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${V["columnHeader--dragging"]}, & .${V["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${V["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity,[`& .${V.rowReorderCellPlaceholder}`]:{display:"flex"}},[`& .${V.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${V.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`& .${V.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${V.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)}})}),Tu=["children","className"],Hu=e=>{const{autoHeight:t,density:n,classes:o}=e,r={root:["root",t&&"autoHeight",`root--density${pt(n)}`,"withBorderColor"]};return ae(r,de,o)},Ou=s.forwardRef(function(t,n){var o;const r=ne(),{children:l,className:i}=t,c=te(t,Tu),a=dt(),d=q(a,vc),u=s.useRef(null),g=Ft(u,n),f=(o=r.experimentalFeatures)!=null&&o.ariaV7?null:Gl,m=typeof f=="function"?f():null,h=w({},r,{density:d}),C=Hu(h);a.current.register("public",{rootElementRef:u});const[v,b]=s.useState(!1);return We(()=>{b(!0)},[]),v?P.jsx(Ru,w({ref:g,className:Se(i,C.root),ownerState:h},m,c,{children:l})):null}),$u=["className"],Gu=e=>{const{classes:t}=e;return ae({root:["footerContainer","withBorderColor"]},de,t)},Lu=ze("div",{name:"MuiDataGrid",slot:"FooterContainer",overridesResolver:(e,t)=>t.footerContainer})({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:"1px solid"}),_u=s.forwardRef(function(t,n){const{className:o}=t,r=te(t,$u),l=ne(),i=Gu(l);return P.jsx(Lu,w({ref:n,className:Se(i.root,o),ownerState:l},r))}),Vu=["className"],Au=e=>{const{classes:t}=e;return ae({root:["overlay"]},de,t)},zu=ze("div",{name:"MuiDataGrid",slot:"Overlay",overridesResolver:(e,t)=>t.overlay})({width:"100%",height:"100%",display:"flex",alignSelf:"center",alignItems:"center",justifyContent:"center",backgroundColor:"var(--unstable_DataGrid-overlayBackgroun
8d)"}),Qo=s.forwardRef(function(t,n){const{className:o}=t,r=te(t,Vu),l=ne(),i=Au(l);return P.jsx(zu,w({ref:n,className:Se(i.root,o),ownerState:l},r))}),ju=["className","children"],Nu=e=>{const{classes:t}=e;return ae({root:["toolbarContainer"]},de,t)},Bu=ze("div",{name:"MuiDataGrid",slot:"ToolbarContainer",overridesResolver:(e,t)=>t.toolbarContainer})(({theme:e})=>({display:"flex",alignItems:"center",flexWrap:"wrap",gap:e.spacing(1),padding:e.spacing(.5,.5,0)})),_p=s.forwardRef(function(t,n){const{className:o,children:r}=t,l=te(t,ju),i=ne(),c=Nu(i);return r?P.jsx(Bu,w({ref:n,className:Se(o,c.root),ownerState:i},l,{children:r})):null}),Uu=["className"],Wu=e=>{const{classes:t}=e;return ae({root:["iconButtonContainer"]},de,t)},Ku=ze("div",{name:"MuiDataGrid",slot:"IconButtonContainer",overridesResolver:(e,t)=>t.iconButtonContainer})(()=>({display:"flex",visibility:"hidden",width:0})),Jl=s.forwardRef(function(t,n){const{className:o}=t,r=te(t,Uu),l=ne(),i=Wu(l);return P.jsx(Ku,w({ref:n,className:Se(i.root,o),ownerState:l},r))}),qu=e=>{const{classes:t}=e;return ae({icon:["sortIcon"]},de,t)};function Qu(e,t,n,o){let r;const l={};return t==="asc"?r=e.columnSortedAscendingIcon:t==="desc"?r=e.columnSortedDescendingIcon:(r=e.columnUnsortedIcon,l.sortingOrder=o),r?P.jsx(r,w({fontSize:"small",className:n},l)):null}function Zu(e){var t;const{direction:n,index:o,sortingOrder:r}=e,l=he(),i=ne(),c=w({},e,{classes:i.classes}),a=qu(c),d=Qu(i.slots,n,a.icon,r);if(!d)return null;const u=P.jsx(i.slots.baseIconButton,w({tabIndex:-1,"aria-label":l.current.getLocaleText("columnHeaderSortIconLabel"),title:l.current.getLocaleText("columnHeaderSortIconLabel"),size:"small"},(t=i.slotProps)==null?void 0:t.baseIconButton,{children:d}));return P.jsxs(Jl,{children:[o!=null&&P.jsx(Fl,{badgeContent:o,color:"default",children:u}),o==null&&u]})}const Yu=s.memo(Zu),Xu=e=>{const{classes:t,open:n}=e;return ae({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},de,t)},Ju=s.memo(e=>{var t,n;const{colDef:o,open:r,columnMenuId:l,columnMenuButtonId:i,iconButtonRef:c}=e,a=he(),d=ne(),u=w({},e,{classes:d.classes}),g=Xu(u),f=s.useCallback(m=>{m.preventDefault(),m.stopPropagation(),a.current.toggleColumnMenu(o.field)},[a,o.field]);return P.jsx("div",{className:g.root,children:P.jsx(d.slots.baseTooltip,w({title:a.current.getLocaleText("columnMenuLabel"),enterDelay:1e3},(t=d.slotProps)==null?void 0:t.baseTooltip,{children:P.jsx(d.slots.baseIconButton,w({ref:c,tabIndex:-1,className:g.button,"aria-label":a.current.getLocaleText("columnMenuLabel"),size:"small",onClick:f,"aria-haspopup":"menu","aria-expanded":r,"aria-controls":r?l:void 0,id:i},(n=d.slotProps)==null?void 0:n.baseIconButton,{children:P.jsx(d.slots.columnMenuIcon,{fontSize:"small"})}))}))})});function ea({columnMenuId:e,columnMenuButtonId:t,ContentComponent:n,contentComponentProps:o,field:r,open:l,target:i,onExited:c}){const a=he(),d=a.current.getColumn(r),u=Ge(g=>{g&&(g.stopPropagation(),i!=null&&i.contains(g.target))||a.current.hideColumnMenu()});return!i||!d?null:P.jsx(so,{placement:`bottom-${d.align==="right"?"start":"end"}`,open:l,target:i,onClose:u,onExited:c,children:P.jsx(n,w({colDef:d,hideMenu:u,open:l,id:e,labelledby:t},o))})}const ta=["className"],na=e=>{const{classes:t}=e;return ae({root:["columnHeaderTitle"]},de,t)},oa=ze("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle",overridesResolver:(e,t)=>t.columnHeaderTitle})({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:"var(--unstable_DataGrid-headWeight)"}),ra=s.forwardRef(function(t,n){const{className:o}=t,r=te(t,ta),l=ne(),i=na(l);return P.jsx(oa,w({ref:n,className:Se(i.root,o),ownerState:l},r))});function la(e){var t;const{label:n,description:o}=e,r=ne(),l=s.useRef(null),[i,c]=s.useState(""),a=s.useCallback(()=>{if(!o&&l!=null&&l.current){const d=Rc(l.current);c(d?n:"")}},[o,n]);return P.jsx(r.slots.baseTooltip,w({title:o||i},(t=r.slotProps)==null?void 0:t.baseTooltip,{children:P.jsx(ra,{onMouseOver:a,ref:l,children:n})}))}const sa=["resizable","resizing","height","side"];var Zo=(function(e){return e.Left="left",e.Right="right",e})(Zo||{});const ia=e=>{const{resizable:t,resizing:n,classes:o,side:r}=e,l={root:["columnSeparator",t&&"columnSeparator--resizable",n&&"columnSeparator--resizing",r&&`columnSeparator--side${pt(r)}`],icon:["iconSeparator"]};return ae(l,de,o)};function ca(e){const{height:t,side:n=Zo.Right}=e,o=te(e,sa),r=ne(),l=w({},e,{side:n,classes:r.classes}),i=ia(l),c=s.useCallback(a=>{a.preventDefault(),a.stopPropagation()},[]);return P.jsx("div",w({className:i.root,style:{minHeight:t,opacity:r.showColumnVerticalBorder?0:1}},o,{onClick:c,children:P.jsx(r.slots.columnResizeIcon,{className:i.icon})}
8))}const ua=s.memo(ca),aa=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps"],es=s.forwardRef(function(t,n){const{classes:o,columnMenuOpen:r,colIndex:l,height:i,isResizing:c,sortDirection:a,hasFocus:d,tabIndex:u,separatorSide:g,isDraggable:f,headerComponent:m,description:h,width:C,columnMenuIconButton:v=null,columnMenu:b=null,columnTitleIconButtons:p=null,headerClassName:y,label:E,resizable:_,draggableContainerProps:I,columnHeaderSeparatorProps:D}=t,R=te(t,aa),L=dt(),$=ne(),H=s.useRef(null),[O,M]=s.useState(r),S=Ft(H,n);let x="none";return a!=null&&(x=a==="asc"?"ascending":"descending"),s.useEffect(()=>{O||M(r)},[O,r]),s.useLayoutEffect(()=>{const F=L.current.state.columnMenu;if(d&&!F.open){const k=H.current.querySelector('[tabindex="0"]')||H.current;k?.focus(),L.current.columnHeadersContainerElementRef.current.scrollLeft=0}},[L,d]),P.jsxs("div",w({ref:S,className:Se(o.root,y),style:{height:i,width:C,minWidth:C,maxWidth:C},role:"columnheader",tabIndex:u,"aria-colindex":l+1,"aria-sort":x,"aria-label":m==null?E:void 0},R,{children:[P.jsxs("div",w({className:o.draggableContainer,draggable:f,role:"presentation"},I,{children:[P.jsxs("div",{className:o.titleContainer,role:"presentation",children:[P.jsx("div",{className:o.titleContainerContent,children:m!==void 0?m:P.jsx(la,{label:E,description:h,columnWidth:C})}),p]}),v]})),P.jsx(ua,w({resizable:!$.disableColumnResize&&!!_,resizing:c,height:i,side:g},D)),b]}))}),da=e=>{const{colDef:t,classes:n,isDragging:o,sortDirection:r,showRightBorder:l,filterItemsCounter:i}=e,c=r!=null,a=i!=null&&i>0,d=t.type==="number",u={root:["columnHeader",t.headerAlign==="left"&&"columnHeader--alignLeft",t.headerAlign==="center"&&"columnHeader--alignCenter",t.headerAlign==="right"&&"columnHeader--alignRight",t.sortable&&"columnHeader--sortable",o&&"columnHeader--moving",c&&"columnHeader--sorted",a&&"columnHeader--filtered",d&&"columnHeader--numeric","withBorderColor",l&&"columnHeader--withRightBorder"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]};return ae(u,de,n)};function ga(e){var t,n,o,r;const{colDef:l,columnMenuOpen:i,colIndex:c,headerHeight:a,isResizing:d,sortDirection:u,sortIndex:g,filterItemsCounter:f,hasFocus:m,tabIndex:h,disableReorder:C,separatorSide:v}=e,b=dt(),p=ne(),y=s.useRef(null),E=$e(),_=$e(),I=s.useRef(null),[D,R]=s.useState(i),L=s.useMemo(()=>!p.disableColumnReorder&&!C&&!l.disableReorder,[p.disableColumnReorder,C,l.disableReorder]);let $;l.renderHeader&&($=l.renderHeader(b.current.getColumnHeaderParams(l.field)));const H=w({},e,{classes:p.classes,showRightBorder:p.showColumnVerticalBorder}),O=da(H),M=s.useCallback(Z=>W=>{dn(W)||b.current.publishEvent(Z,b.current.getColumnHeaderParams(l.field),W)},[b,l.field]),S=s.useMemo(()=>({onClick:M("columnHeaderClick"),onDoubleClick:M("columnHeaderDoubleClick"),onMouseOver:M("columnHeaderOver"),onMouseOut:M("columnHeaderOut"),onMouseEnter:M("columnHeaderEnter"),onMouseLeave:M("columnHeaderLeave"),onKeyDown:M("columnHeaderKeyDown"),onFocus:M("columnHeaderFocus"),onBlur:M("columnHeaderBlur")}),[M]),x=s.useMemo(()=>L?{onDragStart:M("columnHeaderDragStart"),onDragEnter:M("columnHeaderDragEnter"),onDragOver:M("columnHeaderDragOver"),onDragEnd:M("columnHeaderDragEnd")}:{},[L,M]),F=s.useMemo(()=>({onMouseDown:M("columnSeparatorMouseDown"),onDoubleClick:M("columnSeparatorDoubleClick")}),[M]);s.useEffect(()=>{D||R(i)},[D,i]);const T=s.useCallback(()=>{R(!1)},[]),k=!p.disableColumnMenu&&!l.disableColumnMenu&&P.jsx(Ju,{colDef:l,columnMenuId:E,columnMenuButtonId:_,open:D,iconButtonRef:I}),G=P.jsx(ea,{columnMenuId:E,columnMenuButtonId:_,field:l.field,open:i,target:I.current,ContentComponent:p.slots.columnMenu,contentComponentProps:(t=p.slotProps)==null?void 0:t.columnMenu,onExited:T}),z=(n=l.sortingOrder)!=null?n:p.sortingOrder,N=P.jsxs(s.Fragment,{children:[!p.disableColumnFilter&&P.jsx(p.slots.columnHeaderFilterIconButton,w({field:l.field,counter:f},(o=p.slotProps)==null?void 0:o.columnHeaderFilterIconButton)),l.sortable&&!l.hideSortIcons&&P.jsx(Yu,{direction:u,index:g,sortingOrder:z})]});s.useLayoutEffect(()=>{const Z=b.current.state.columnMenu;if(m&&!Z.open){const ee=y.current.querySelector('[tabindex="0"]')||y.current;ee?.focus(),b.current.columnHeadersContainerElementRef.current.scrollLeft=0}},[b,m]);const j=typeof l.headerClassName=="function"?l.headerClassName({field:l.field,colDef:l}):l.headerClassName,B=(r=l.headerName)!=null?r:l.field;return P.jsx(es,w({ref:y,classes:O,columnMenuOpen:i,colIndex:c,height:a,isResizing:d,sortDirection:u,hasFocus:m,tabIndex:h,separatorSide:v,isDraggable:L,headerComponent:$,description:l.description,elementId:l.field,width:l.computedWidth,columnMenuIconButton:k,columnTitleIconButtons:N,headerClassName:j,label:B,resizable:!p.disableColumnResize&&!!l.resizable,"data-field":l.field,columnMenu:G,draggableContainerProps:x,columnHeaderSeparatorProps:F},S))}const Sn=()=>({items:[],logicOperator:Ye.And,quickFilterValues:[],quickFilterLogicOperator:Ye.And}),yr=1e3;class fa{constructor(t=yr){this.timeouts=new Map,this.cleanupTimeout=yr,this.cleanupTimeout=t}register(t,n,o){this.timeouts||(this.timeouts=new Map);const r=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(o.cleanupToken)},this.cleanupTimeout);this.timeouts.set(o.cleanupToken,r)}unregister(t){const n=this.timeouts.get(t.cleanupToken);n&&(this.timeouts.delete(t.cleanupToken),clearTimeout(n))}
8reset(){this.timeouts&&(this.timeouts.forEach((t,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class ha{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,n,o){this.registry.register(t,n,o)}unregister(t){this.registry.unregister(t)}reset(){}}var Ct=(function(e){return e.DataGrid="DataGrid",e.DataGridPro="DataGridPro",e})(Ct||{});class ma{}function Ca(e){let t=0;return function(o,r,l,i){e.registry===null&&(e.registry=typeof FinalizationRegistry<"u"?new ha:new fa);const[c]=s.useState(new ma),a=s.useRef(null),d=s.useRef();d.current=l;const u=s.useRef(null);if(!a.current&&d.current){const g=(f,m,h)=>{if(!m.defaultMuiPrevented){var C;(C=d.current)==null||C.call(d,f,m,h)}};a.current=o.current.subscribeEvent(r,g,i),t+=1,u.current={cleanupToken:t},e.registry.register(c,()=>{var f;(f=a.current)==null||f.call(a),a.current=null,u.current=null},u.current)}else!d.current&&a.current&&(a.current(),a.current=null,u.current&&(e.registry.unregister(u.current),u.current=null));s.useEffect(()=>{if(!a.current&&d.current){const g=(f,m,h)=>{if(!m.defaultMuiPrevented){var C;(C=d.current)==null||C.call(d,f,m,h)}};a.current=o.current.subscribeEvent(r,g,i)}return u.current&&e.registry&&(e.registry.unregister(u.current),u.current=null),()=>{var g;(g=a.current)==null||g.call(a),a.current=null}},[o,r,i])}}const pa={registry:null},Q=Ca(pa),wa={isFirst:!0};function Me(e,t,n){Q(e,t,n,wa)}function je(e,t){const n=s.useRef(null);if(n.current)return n.current;const o=e.current.getLogger(t);return n.current=o,o}function ba(e){return typeof e=="number"&&!Number.isNaN(e)}function ts(e){return typeof e=="function"}function Yo(e){return typeof e=="object"&&e!==null}function va(){try{const e="__some_random_key_you_are_not_going_to_use__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}function Ln(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}const Mt=(e,t,n)=>Math.max(t,Math.min(n,e));function Gt(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const r=e.length;if(r!==t.length)return!1;for(let l=0;l<r;l+=1)if(!Gt(e[l],t[l]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;const r=Array.from(e.entries());for(let l=0;l<r.length;l+=1)if(!t.has(r[l][0]))return!1;for(let l=0;l<r.length;l+=1){const i=r[l];if(!Gt(i[1],t.get(i[0])))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;const r=Array.from(e.entries());for(let l=0;l<r.length;l+=1)if(!t.has(r[l][0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){const r=e.length;if(r!==t.length)return!1;for(let l=0;l<r;l+=1)if(e[l]!==t[l])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),o=n.length;if(o!==Object.keys(t).length)return!1;for(let r=0;r<o;r+=1)if(!Object.prototype.hasOwnProperty.call(t,n[r]))return!1;for(let r=0;r<o;r+=1){const l=n[r];if(!Gt(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function xa(e){return()=>{let t=e+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function Sa(e,t,n){const o=xa(e);return()=>t+(n-t)*o()}function ns(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}const os=(e,t,n,o,r)=>{const l=je(e,"useNativeEventListener"),[i,c]=s.useState(!1),a=s.useRef(o),d=s.useCallback(u=>a.current&&a.current(u),[]);s.useEffect(()=>{a.current=o},[o]),s.useEffect(()=>{let u;if(ts(t)?u=t():u=t&&t.current?t.current:null,u&&n&&!i){l.debug(`Binding native ${n} event`),u.addEventListener(n,d,r);const g=u;c(!0);const f=()=>{l.debug(`Clearing native ${n} event`),g.removeEventListener(n,d,r)};e.current.subscribeEvent("unmount",f)}},[t,d,n,i,l,r,e])},gn=e=>{const t=s.useRef(!0);t.current&&(t.current=!1,e())},Pa=100,ya=e=>e?0:100,rs=(e,t)=>t>0&&e>0?Math.ceil(e/t):0;bt(["MUI: the 'rowCount' prop is undefined while using paginationMode='server'","For more detail, see http://mui.com/components/data-grid/pagination/#basic-implementation"],"error");const ls=e=>({page:0,pageSize:e?0:100}),Ia=(e,t=0)=>t===0?e:Math.max(Math.min(e,t-1),0),ss=(e,t)=>{if(t===Ct.DataGrid&&e>Pa)throw new Error(["MUI: `pageSize` cannot exceed 100 in the MIT version of the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(` 9`))},is=e=>e.pagination,rt=fe(is,e=>e.paginationModel),Ma=fe(rt,e=>e.page),Fa=fe(rt,e=>e.pageSize);fe(rt,to,(e,t)=>rs(t,e.pageSize));const Xo=He(rt,nt,an,_t,Vl,(e,t,n,o,r)=>{const l=r.length,i=Math.min(e.pageSize*e.page,l-1),c=Math.min(i+e.pageSize-1,l-1);if(i===-1||c===-1)return null;if(n<2)return{firstRowIndex:i,lastRowIndex:c};const a=r[i],d=c-i+1,u=o.findIndex(h=>h.id===a.id);let g=u,f=0;for(;g<o.length&&f<=d;){var m;const h=o[g],C=(m=t[h.id])==null?void 0:m.depth;C===void 0?g+=1:((f<d||C>0)&&(g+=1),C===0&&(f+=1))}return{firstRowIndex:u,lastRowIndex:g-1}}),ka=He(_t,Xo,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),cs=He(bn,Xo,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),Pn=e=>e.preferencePanel;var Wt=(function(e){return e.filters="filters",e.columns="columns",e})(Wt||{});const Kt=e=>e.rowsMeta,ot=e=>e.rowSelection,Ea=fe(ot,e=>e.length),Da=He(ot,It,(e,t)=>new Map(e.map(n=>[n,t[n]]))),Wn=He(ot,e=>e.reduce((t,n)=>(t[n]=n,t),{})),Ra=bt(["MUI: The `sortModel` can only contain a single item when the `disableMultipleColumnsSorting` prop is set to `true`.","If you are using the community version of the `DataGrid`, this prop is always `true`."],"error"),us=(e,t)=>t&&e.length>1?(Ra(),[e[0]]):e,Ir=(e,t)=>
9n=>w({},n,{sorting:w({},n.sorting,{sortModel:us(e,t)})}),Ta=e=>e==="desc",Ha=(e,t)=>{const n=t.current.getColumn(e.field);if(!n)return null;const o=Ta(e.sort)?(...l)=>-1*n.sortComparator(...l):n.sortComparator;return{getSortCellParams:l=>({id:l,field:n.field,rowNode:t.current.getRowNode(l),value:t.current.getCellValue(l,n.field),api:t.current}),comparator:o}},Oa=(e,t,n)=>e.reduce((o,r,l)=>{if(o!==0)return o;const i=t.params[l],c=n.params[l];return o=r.comparator(i.value,c.value,i,c),o},0),$a=(e,t)=>{const n=e.map(o=>Ha(o,t)).filter(o=>!!o);return n.length===0?null:o=>o.map(r=>({node:r,params:n.map(l=>l.getSortCellParams(r.id))})).sort((r,l)=>Oa(n,r,l)).map(r=>r.node.id)},Mr=(e,t)=>{const n=e.indexOf(t);return!t||n===-1||n+1===e.length?e[0]:e[n+1]},Jo=(e,t)=>e==null&&t!=null?-1:t==null&&e!=null?1:e==null&&t==null?0:null,Ga=new Intl.Collator,La=(e,t)=>{const n=Jo(e,t);return n!==null?n:typeof e=="string"?Ga.compare(e.toString(),t.toString()):e-t},as=(e,t)=>{const n=Jo(e,t);return n!==null?n:Number(e)-Number(t)},ds=(e,t)=>{const n=Jo(e,t);return n!==null?n:e>t?1:e<t?-1:0},gs=e=>e.headerFiltering,fs=fe(gs,e=>e.editing),er=fe(gs,e=>e.menuOpen),_a=(e,t)=>{const n={enabled:!t.disableVirtualization,enabledForColumns:!0};return w({},e,{virtualization:n})};function Va(e,t){const n=l=>{e.current.setState(i=>w({},i,{virtualization:w({},i.virtualization,{enabled:l})}))};ge(e,{unstable_setVirtualization:n,unstable_setColumnVirtualization:l=>{e.current.setState(i=>w({},i,{virtualization:w({},i.virtualization,{enabledForColumns:l})}))}},"public"),s.useEffect(()=>{n(!t.disableVirtualization)},[t.disableVirtualization])}const hs=e=>e.virtualization,Aa=fe(hs,e=>e.enabled),tr=fe(hs,e=>e.enabledForColumns),za=e=>{const{classes:t}=e;return ae({icon:["filterIcon"]},de,t)};function ja(e){var t,n;const{counter:o,field:r,onClick:l}=e,i=he(),c=ne(),a=w({},e,{classes:c.classes}),d=za(a),u=q(i,Pn),g=$e(),f=$e(),m=s.useCallback(v=>{v.preventDefault(),v.stopPropagation();const{open:b,openedPanelValue:p}=Pn(i.current.state);b&&p===Wt.filters?i.current.hideFilterPanel():i.current.showFilterPanel(void 0,f,g),l&&l(i.current.getColumnHeaderParams(r),v)},[i,r,l,f,g]);if(!o)return null;const h=u.open&&u.labelId===g,C=P.jsx(c.slots.baseIconButton,w({id:g,onClick:m,color:"default","aria-label":i.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?f:void 0},(t=c.slotProps)==null?void 0:t.baseIconButton,{children:P.jsx(c.slots.columnFilteredIcon,{className:d.icon,fontSize:"small"})}));return P.jsx(c.slots.baseTooltip,w({title:i.current.getLocaleText("columnHeaderFiltersTooltipActive")(o),enterDelay:1e3},(n=c.slotProps)==null?void 0:n.baseTooltip,{children:P.jsxs(Jl,{children:[o>1&&P.jsx(Fl,{badgeContent:o,color:"default",children:C}),o===1&&C]})}))}const Na=["field","id","value","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","api"],Ba=e=>{const{classes:t}=e;return ae({root:["checkboxInput"]},de,t)},Ua=s.forwardRef(function(t,n){var o;const{field:r,id:l,value:i,rowNode:c,hasFocus:a,tabIndex:d}=t,u=te(t,Na),g=he(),f=ne(),m={classes:f.classes},h=Ba(m),C=s.useRef(null),v=s.useRef(null),b=Ft(C,n),p=g.current.getCellElement(l,r),y=D=>{const R={value:D.target.checked,id:l};g.current.publishEvent("rowSelectionCheckboxChange",R,D)};s.useLayoutEffect(()=>{d===0&&p&&(p.tabIndex=-1)},[p,d]),s.useEffect(()=>{if(a){var D;const R=(D=C.current)==null?void 0:D.querySelector("input");R?.focus({preventScroll:!0})}else v.current&&v.current.stop({})},[a]);const E=s.useCallback(D=>{Zl(D.key)&&D.stopPropagation()},[]);if(c.type==="footer"||c.type==="pinnedRow")return null;const _=g.current.isRowSelectable(l),I=g.current.getLocaleText(i?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return P.jsx(f.slots.baseCheckbox,w({ref:b,tabIndex:d,checked:i,onChange:y,className:h.root,inputProps:{"aria-label":I},onKeyDown:E,disabled:!_,touchRippleRef:v},(o=f.slotProps)==null?void 0:o.baseCheckbox,u))}),Wa=Ua,Ka=["field","colDef"],qa=e=>{const{classes:t}=e;return ae({root:["checkboxInput"]},de,t)},Qa=s.forwardRef(function(t,n){var o;const r=te(t,Ka),[,l]=s.useState(!1),i=he(),c=ne(),a={classes:c.classes},d=qa(a),u=q(i,zl),g=q(i,ot),f=q(i,bn),m=q(i,cs),h=s.useMemo(()=>typeof c.isRowSelectable!="function"?g:g.filter(R=>
9i.current.getRow(R)?c.isRowSelectable(i.current.getRowParams(R)):!1),[i,c.isRowSelectable,g]),C=s.useMemo(()=>(!c.pagination||!c.checkboxSelectionVisibleOnly?f:m).reduce((L,$)=>(L[$]=!0,L),{}),[c.pagination,c.checkboxSelectionVisibleOnly,m,f]),v=s.useMemo(()=>h.filter(R=>C[R]).length,[h,C]),b=v>0&&v<Object.keys(C).length,p=v>0,y=R=>{const L={value:R.target.checked};i.current.publishEvent("headerSelectionCheckboxChange",L)},E=u!==null&&u.field===t.field?0:-1;s.useLayoutEffect(()=>{const R=i.current.getColumnHeaderElement(t.field);E===0&&R&&(R.tabIndex=-1)},[E,i,t.field]);const _=s.useCallback(R=>{R.key===" "&&i.current.publishEvent("headerSelectionCheckboxChange",{value:!p})},[i,p]),I=s.useCallback(()=>{l(R=>!R)},[]);s.useEffect(()=>i.current.subscribeEvent("rowSelectionChange",I),[i,I]);const D=i.current.getLocaleText(p?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return P.jsx(c.slots.baseCheckbox,w({ref:n,indeterminate:b,checked:p,onChange:y,className:d.root,inputProps:{"aria-label":D},tabIndex:E,onKeyDown:_},(o=c.slotProps)==null?void 0:o.baseCheckbox,r))}),Fr=Fe(P.jsx("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward"),kr=Fe(P.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward"),Er=Fe(P.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight"),Dr=Fe(P.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),Za=Fe(P.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList"),Rr=Fe(P.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61z"}),"FilterAlt"),Ya=Fe(P.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"Search");Fe(P.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");Fe(P.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");const Xa=Fe(P.jsx("path",{d:"M6 5H3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm14 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm-7 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1z"}),"ColumnIcon"),Ja=Fe(P.jsx("path",{d:"M11 19V5h2v14z"}),"Separator"),ed=Fe(P.jsx("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"}),"ViewHeadline"),td=Fe(P.jsx("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"}),"TableRows"),nd=Fe(P.jsx("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"}),"ViewStream"),od=Fe(P.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"TripleDotsVertical"),ho=Fe(P.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Tr=Fe(P.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add"),rd=Fe(P.jsx("path",{d:"M19 13H5v-2h14v2z"}),"Remove"),ld=Fe(P.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}),"Load"),Hr=Fe(P.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"Drag"),sd=Fe(P.jsx("path",{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"}),"SaveAlt"),id=Fe(P.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}
9),"Check"),cd=Fe(P.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert"),ud=Fe(P.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"}),"VisibilityOff"),ad=Fe(P.jsx("g",{children:P.jsx("path",{d:"M14.67,5v14H9.33V5H14.67z M15.67,19H21V5h-5.33V19z M8.33,19V5H3v14H8.33z"})}),"ViewColumn"),dd=Fe(P.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");Fe(P.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");const gd=Fe(P.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"Delete"),fd=["hideMenu","colDef","id","labelledby","className","children","open"],hd=Re(Yn)(()=>({minWidth:248})),md=s.forwardRef(function(t,n){const{hideMenu:o,id:r,labelledby:l,className:i,children:c,open:a}=t,d=te(t,fd),u=s.useCallback(g=>{qo(g.key)&&g.preventDefault(),Xl(g.key)&&o(g)},[o]);return P.jsx(hd,w({id:r,ref:n,className:Se(V.menuList,i),"aria-labelledby":l,onKeyDown:u,autoFocus:a},d,{children:c}))}),Cd=["displayOrder"],pd=e=>{const t=dt(),{defaultSlots:n,defaultSlotProps:o,slots:r={},slotProps:l={},hideMenu:i,colDef:c,addDividers:a=!0}=e,d=s.useMemo(()=>w({},n,r),[n,r]),u=s.useMemo(()=>{if(!l||Object.keys(l).length===0)return o;const m=w({},l);return Object.entries(o).forEach(([h,C])=>{m[h]=w({},C,l[h]||{})}),m},[o,l]),g=t.current.unstable_applyPipeProcessors("columnMenu",[],e.colDef),f=s.useMemo(()=>{const m=Object.keys(n);return Object.keys(r).filter(h=>!m.includes(h))},[r,n]);return s.useMemo(()=>{const C=Array.from(new Set([...g,...f])).filter(v=>d[v]!=null).sort((v,b)=>{const p=u[v],y=u[b],E=Number.isFinite(p?.displayOrder)?p.displayOrder:100,_=Number.isFinite(y?.displayOrder)?y.displayOrder:100;return E-_});return C.reduce((v,b,p)=>{let y={colDef:c,onClick:i};const E=u[b];if(E){const _=te(E,Cd);y=w({},y,_)}return a&&p!==C.length-1?[...v,[d[b],y],[wi,{}]]:[...v,[d[b],y]]},[])},[a,c,g,i,d,u,f])};function wd(e){const{colDef:t,onClick:n}=e,o=he(),r=ne(),c=Ae(o).filter(d=>d.disableColumnMenu!==!0).length===1,a=s.useCallback(d=>{c||(o.current.setColumnVisibility(t.field,!1),n(d))},[o,t.field,n,c]);return r.disableColumnSelector||t.hideable===!1?null:P.jsxs(Ze,{onClick:a,disabled:c,children:[P.jsx(ut,{children:P.jsx(r.slots.columnMenuHideIcon,{fontSize:"small"})}),P.jsx(ht,{children:o.current.getLocaleText("columnMenuHideColumn")})]})}function bd(e){const{onClick:t}=e,n=he(),o=ne(),r=s.useCallback(l=>{t(l),n.current.showPreferences(Wt.columns)},[n,t]);return o.disableColumnSelector?null:P.jsxs(Ze,{onClick:r,children:[P.jsx(ut,{children:P.jsx(o.slots.columnMenuManageColumnsIcon,{fontSize:"small"})}),P.jsx(ht,{children:n.current.getLocaleText("columnMenuManageColumns")})]})}function vd(e){return P.jsxs(s.Fragment,{children:[P.jsx(wd,w({},e)),P.jsx(bd,w({},e))]})}function xd(e){const{colDef:t,onClick:n}=e,o=he(),r=ne(),l=s.useCallback(i=>{n(i),o.current.showFilterPanel(t.field)},[o,t.field,n]);return r.disableColumnFilter||!t.filterable?null:P.jsxs(Ze,{onClick:l,children:[P.jsx(ut,{children:P.jsx(r.slots.columnMenuFilterIcon,{fontSize:"small"})}),P.jsx(ht,{children:o.current.getLocaleText("columnMenuFilter")})]})}function Sd(e){var t;const{colDef:n,onClick:o}=e,r=he(),l=q(r,Qe),i=ne(),c=s.useMemo(()=>{if(!n)return null;const g=l.find(f=>f.field===n.field);return g?.sort},[n,l]),a=(t=n.sortingOrder)!=null?t:i.sortingOrder,d=s.useCallback(g=>{o(g);const f=g.currentTarget.getAttribute("data-value")||null;r.current.sortColumn(n,f===c?null:f)}
9,[r,n,o,c]);if(!n||!n.sortable||!a.some(g=>!!g))return null;const u=g=>{const f=r.current.getLocaleText(g);return typeof f=="function"?f(n):f};return P.jsxs(s.Fragment,{children:[a.includes("asc")&&c!=="asc"?P.jsxs(Ze,{onClick:d,"data-value":"asc",children:[P.jsx(ut,{children:P.jsx(i.slots.columnMenuSortAscendingIcon,{fontSize:"small"})}),P.jsx(ht,{children:u("columnMenuSortAsc")})]}):null,a.includes("desc")&&c!=="desc"?P.jsxs(Ze,{onClick:d,"data-value":"desc",children:[P.jsx(ut,{children:P.jsx(i.slots.columnMenuSortDescendingIcon,{fontSize:"small"})}),P.jsx(ht,{children:u("columnMenuSortDesc")})]}):null,a.includes(null)&&c!=null?P.jsxs(Ze,{onClick:d,children:[P.jsx(ut,{}),P.jsx(ht,{children:r.current.getLocaleText("columnMenuUnsort")})]}):null]})}const Pd=["defaultSlots","defaultSlotProps","slots","slotProps"],ms={columnMenuSortItem:Sd,columnMenuFilterItem:xd,columnMenuColumnsItem:vd},Cs={columnMenuSortItem:{displayOrder:10},columnMenuFilterItem:{displayOrder:20},columnMenuColumnsItem:{displayOrder:30}},ps=s.forwardRef(function(t,n){const{defaultSlots:o,defaultSlotProps:r,slots:l,slotProps:i}=t,c=te(t,Pd),a=pd(w({},c,{defaultSlots:o,defaultSlotProps:r,slots:l,slotProps:i}));return P.jsx(md,w({ref:n},c,{children:a.map(([d,u],g)=>P.jsx(d,w({},u),g))}))}),yd=s.forwardRef(function(t,n){return P.jsx(ps,w({},t,{ref:n,defaultSlots:ms,defaultSlotProps:Cs}))}),Id=["className"],Md=e=>{const{classes:t}=e;return ae({root:["panelContent"]},de,t)},Fd=ze("div",{name:"MuiDataGrid",slot:"PanelContent",overridesResolver:(e,t)=>t.panelContent})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400});function ws(e){const{className:t}=e,n=te(e,Id),o=ne(),r=Md(o);return P.jsx(Fd,w({className:Se(t,r.root),ownerState:o},n))}const kd=["className"],Ed=e=>{const{classes:t}=e;return ae({root:["panelFooter"]},de,t)},Dd=ze("div",{name:"MuiDataGrid",slot:"PanelFooter",overridesResolver:(e,t)=>t.panelFooter})(({theme:e})=>({padding:e.spacing(.5),display:"flex",justifyContent:"space-between"}));function bs(e){const{className:t}=e,n=te(e,kd),o=ne(),r=Ed(o);return P.jsx(Dd,w({className:Se(t,r.root),ownerState:o},n))}const Rd=["className"],Td=e=>{const{classes:t}=e;return ae({root:["panelHeader"]},de,t)},Hd=ze("div",{name:"MuiDataGrid",slot:"PanelHeader",overridesResolver:(e,t)=>t.panelHeader})(({theme:e})=>({padding:e.spacing(1)}));function Od(e){const{className:t}=e,n=te(e,Rd),o=ne(),r=Td(o);return P.jsx(Hd,w({className:Se(t,r.root),ownerState:o},n))}const $d=["className","slotProps"],Gd=e=>{const{classes:t}=e;return ae({root:["panelWrapper"]},de,t)},Ld=Re("div",{name:"MuiDataGrid",slot:"PanelWrapper",overridesResolver:(e,t)=>t.panelWrapper})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),_d=()=>!0,vs=s.forwardRef(function(t,n){const{className:o,slotProps:r={}}=t,l=te(t,$d),i=ne(),c=Gd(i);return P.jsx(bi,w({open:!0,disableEnforceFocus:!0,isEnabled:_d},r.TrapFocus,{children:P.jsx(Ld,w({ref:n,tabIndex:-1,className:Se(o,c.root),ownerState:i},l))}))}),Vd=!1,Ad=["sort","searchPredicate","autoFocusSearchField","disableHideAllButton","disableShowAllButton","getTogglableColumns"],zd=e=>{const{classes:t}=e;return ae({root:["columnsPanel"],columnsPanelRow:["columnsPanelRow"]},de,t)},jd=Re("div",{name:"MuiDataGrid",slot:"ColumnsPanel",overridesResolver:(e,t)=>t.columnsPanel})({padding:"8px 0px 8px 8px"}),Nd=Re("div",{name:"MuiDataGrid",slot:"ColumnsPanelRow",overridesResolver:(e,t)=>t.columnsPanelRow})(({theme:e})=>({display:"flex",justifyContent:"space-between",padding:"1px 8px 1px 7px",[`& .${xi.root}`]:{marginRight:e.spacing(.5)}}));Re(kl)({justifyContent:"flex-end"});const Or=new Intl.Collator,Bd=(e,t)=>(e.headerName||e.field).toLowerCase().indexOf(t)>-1;function Ud(e){var t,n,o;const r=he(),l=s.useRef(null),i=q(r,mt),c=q(r,lt),a=ne(),[d,u]=s.useState(""),g=zd(a),{sort:f,searchPredicate:m=Bd,autoFocusSearchField:h=!0,disableHideAllButton:C=!1,disableShowAllButton:v=!1,getTogglableColumns:b}=e,p=te(e,Ad),y=s.useMemo(()=>{switch(f){case"asc":return[...i].sort((H,O)=>Or.compare(H.headerName||H.field,O.headerName||O.field));
9case"desc":return[...i].sort((H,O)=>-Or.compare(H.headerName||H.field,O.headerName||O.field));default:return i}},[i,f]),E=H=>{const{name:O}=H.target;r.current.setColumnVisibility(O,c[O]===!1)},_=s.useCallback(H=>{const O=lt(r),M=w({},O),S=b?b(i):null;return i.forEach(x=>{x.hideable&&(S==null||S.includes(x.field))&&(H?delete M[x.field]:M[x.field]=!1)}),r.current.setColumnVisibilityModel(M)},[r,i,b]),I=s.useCallback(H=>{u(H.target.value)},[]),D=s.useMemo(()=>{const H=b?b(y):null,O=H?y.filter(({field:M})=>H.includes(M)):y;return d?O.filter(M=>m(M,d.toLowerCase())):O},[y,d,m,b]),R=s.useRef(null);s.useEffect(()=>{h?l.current.focus():R.current&&typeof R.current.focus=="function"&&R.current.focus()},[h]);let L=!1;const $=H=>L===!1&&H.hideable!==!1?(L=!0,!0):!1;return P.jsxs(vs,w({},p,{children:[P.jsx(Od,{children:P.jsx(a.slots.baseTextField,w({label:r.current.getLocaleText("columnsPanelTextFieldLabel"),placeholder:r.current.getLocaleText("columnsPanelTextFieldPlaceholder"),inputRef:l,value:d,onChange:I,variant:"standard",fullWidth:!0},(t=a.slotProps)==null?void 0:t.baseTextField))}),P.jsx(ws,{children:P.jsx(jd,{className:g.root,ownerState:a,children:D.map(H=>{var O;return P.jsxs(Nd,{className:g.columnsPanelRow,ownerState:a,children:[P.jsx(vi,{control:P.jsx(a.slots.baseSwitch,w({disabled:H.hideable===!1,checked:c[H.field]!==!1,onClick:E,name:H.field,size:"small",inputRef:$(H)?R:void 0},(O=a.slotProps)==null?void 0:O.baseSwitch)),label:H.headerName||H.field}),!a.disableColumnReorder&&Vd]},H.field)})})}),v&&C?null:P.jsxs(bs,{children:[C?P.jsx("span",{}):P.jsx(a.slots.baseButton,w({onClick:()=>_(!1)},(n=a.slotProps)==null?void 0:n.baseButton,{disabled:C,children:r.current.getLocaleText("columnsPanelHideAllButton")})),v?null:P.jsx(a.slots.baseButton,w({onClick:()=>_(!0)},(o=a.slotProps)==null?void 0:o.baseButton,{disabled:v,children:r.current.getLocaleText("columnsPanelShowAllButton")}))]})]}))}const Wd=["children","className","classes"],Kd=Sl("MuiDataGrid",["panel","paper"]),qd=Re(_o,{name:"MuiDataGrid",slot:"Panel",overridesResolver:(e,t)=>t.panel})(({theme:e})=>({zIndex:e.zIndex.modal})),Qd=Re(Ml,{name:"MuiDataGrid",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,minWidth:300,maxHeight:450,display:"flex"})),Zd=s.forwardRef((e,t)=>{const{children:n,className:o}=e,r=te(e,Wd),l=he(),i=ne(),c=Kd,[a,d]=s.useState(!1),u=s.useCallback(()=>{l.current.hidePreferences()},[l]),g=s.useCallback(C=>{Un(C.key)&&l.current.hidePreferences()},[l]),f=s.useMemo(()=>[{name:"flip",enabled:!1},{name:"isPlaced",enabled:!0,phase:"main",fn:()=>{d(!0)},effect:()=>()=>{d(!1)}}],[]),[m,h]=s.useState(null);return s.useEffect(()=>{var C;const v=(C=l.current.rootElementRef)==null||(C=C.current)==null?void 0:C.querySelector(`.${V.columnHeaders}`);v&&h(v)},[l]),m?P.jsx(qd,w({ref:t,placement:"bottom-start",className:Se(o,c.panel),ownerState:i,anchorEl:m,modifiers:f},r,{children:P.jsx(Il,{mouseEvent:"onMouseUp",onClickAway:u,children:P.jsx(Qd,{className:c.paper,ownerState:i,elevation:8,onKeyDown:g,children:a&&n})})})):null}),Yd=s.forwardRef(function(t,n){var o,r,l;const i=he(),c=q(i,mt),a=ne(),d=q(i,Pn),u=i.current.unstable_applyPipeProcessors("preferencePanel",null,(o=d.openedPanelValue)!=null?o:Wt.filters);return P.jsx(a.slots.panel,w({ref:n,as:a.slots.basePopper,open:c.length>0&&d.open,id:d.panelId,"aria-labelledby":d.labelId},(r=a.slotProps)==null?void 0:r.panel,t,(l=a.slotProps)==null?void 0:l.basePopper,{children:u}))}),Xd=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","multiFilterOperator","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","logicOperators","columnsSort","filterColumns","deleteIconProps","logicOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","children"],Jd=["InputComponentProps"],eg=e=>{const{classes:t}=e;return ae({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],logicOperatorInput:["filterFormLogicOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},de,t)},tg=Re("div",{name:"MuiDataGrid",slot:"FilterForm",overridesResolver:(e,t)=>t.filterForm})(({theme:e})=>({display:"flex",padding:e.spacing(1)})),ng=Re("div",{name:"MuiDataGrid",slot:"FilterFormDeleteIcon",overridesResolver:(e,t)=>t.filterFormDeleteIcon})(({theme:e})=>({flexShrink:0,justifyContent:"flex-end",marginRight:e.spacing(.5),marginBottom:e.spacing(.2)})),og=Re("div",{name:"MuiDataGrid",slot:"FilterFormLogicOperatorInput",overridesResolver:(e,t)=>t.filterFormLogicOperatorInput})({minWidth:55,marginRight:5,justifyContent:"end"}
9),rg=Re("div",{name:"MuiDataGrid",slot:"FilterFormColumnInput",overridesResolver:(e,t)=>t.filterFormColumnInput})({width:150}),lg=Re("div",{name:"MuiDataGrid",slot:"FilterFormOperatorInput",overridesResolver:(e,t)=>t.filterFormOperatorInput})({width:120}),sg=Re("div",{name:"MuiDataGrid",slot:"FilterFormValueInput",overridesResolver:(e,t)=>t.filterFormValueInput})({width:190}),ig=e=>{switch(e){case Ye.And:return"filterPanelOperatorAnd";case Ye.Or:return"filterPanelOperatorOr";default:throw new Error("MUI: Invalid `logicOperator` property in the `GridFilterPanel`.")}},mn=e=>e.headerName||e.field,$r=new Intl.Collator,cg=s.forwardRef(function(t,n){var o,r,l,i,c,a,d,u,g,f;const{item:m,hasMultipleFilters:h,deleteFilter:C,applyFilterChanges:v,multiFilterOperator:b,showMultiFilterOperators:p,disableMultiFilterOperator:y,applyMultiFilterOperatorChanges:E,focusElementRef:_,logicOperators:I=[Ye.And,Ye.Or],columnsSort:D,filterColumns:R,deleteIconProps:L={},logicOperatorInputProps:$={},operatorInputProps:H={},columnInputProps:O={},valueInputProps:M={}}=t,S=te(t,Xd),x=he(),F=q(x,Ol),T=q(x,Ve),k=$e(),G=$e(),z=$e(),N=$e(),j=ne(),B=eg(j),Z=s.useRef(null),W=s.useRef(null),ee=h&&I.length>0,K=((o=j.slotProps)==null?void 0:o.baseFormControl)||{},we=(l=(((r=j.slotProps)==null?void 0:r.baseSelect)||{}).native)!=null?l:!0,ue=((i=j.slotProps)==null?void 0:i.baseInputLabel)||{},se=((c=j.slotProps)==null?void 0:c.baseSelectOption)||{},{InputComponentProps:pe}=M,be=te(M,Jd),ye=s.useMemo(()=>{if(R===void 0||typeof R!="function")return F;const le=R({field:m.field,columns:F,currentFilters:T?.items||[]});return F.filter(X=>le.includes(X.field))},[R,T?.items,F,m.field]),Pe=s.useMemo(()=>{switch(D){case"asc":return ye.sort((le,X)=>$r.compare(mn(le),mn(X)));case"desc":return ye.sort((le,X)=>-$r.compare(mn(le),mn(X)));default:return ye}},[ye,D]),Y=m.field?x.current.getColumn(m.field):null,J=s.useMemo(()=>{var le;return!m.operator||!Y?null:(le=Y.filterOperators)==null?void 0:le.find(X=>X.value===m.operator)},[m,Y]),ie=s.useCallback(le=>{const X=le.target.value,oe=x.current.getColumn(X);if(oe.field===Y.field)return;const re=oe.filterOperators.find(Oe=>Oe.value===m.operator)||oe.filterOperators[0],xe=!re.InputComponent||re.InputComponent!==J?.InputComponent||oe.type!==Y.type;v(w({},m,{field:X,operator:re.value,value:xe?void 0:m.value}))},[x,v,m,Y,J]),me=s.useCallback(le=>{const X=le.target.value,oe=Y?.filterOperators.find(xe=>xe.value===X),re=!(oe!=null&&oe.InputComponent)||oe?.InputComponent!==J?.InputComponent;v(w({},m,{operator:X,value:re?void 0:m.value}))},[v,m,Y,J]),Ce=s.useCallback(le=>{const X=le.target.value===Ye.And.toString()?Ye.And:Ye.Or;E(X)},[E]),ve=()=>{j.disableMultipleColumnsFiltering?m.value===void 0?C(m):v(w({},m,{value:void 0})):C(m)};return s.useImperativeHandle(_,()=>({focus:()=>{if(J!=null&&J.InputComponent){var le;Z==null||(le=Z.current)==null||le.focus()}else W.current.focus()}}),[J]),P.jsxs(tg,w({ref:n,className:B.root,"data-id":m.id,ownerState:j},S,{children:[P.jsx(ng,w({variant:"standard",as:j.slots.baseFormControl},K,L,{className:Se(B.deleteIcon,K.className,L.className),ownerState:j,children:P.jsx(j.slots.baseIconButton,w({"aria-label":x.current.getLocaleText("filterPanelDeleteIconLabel"),title:x.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:ve,size:"small"},(a=j.slotProps)==null?void 0:a.baseIconButton,{children:P.jsx(j.slots.filterPanelDeleteIcon,{fontSize:"small"})}))})),P.jsx(og,w({variant:"standard",as:j.slots.baseFormControl},K,$,{sx:w({display:ee?"flex":"none",visibility:p?"visible":"hidden"},K.sx||{},$.sx||{}),className:Se(B.logicOperatorInput,K.className,$.className),ownerState:j,children:P.jsx(j.slots.baseSelect,w({inputProps:{"aria-label":x.current.getLocaleText("filterPanelLogicOperator")},value:b,onChange:Ce,disabled:!!y||I.length===1,native:we},(d=j.slotProps)==null?void 0:d.baseSelect,{children:I.map(le=>s.createElement(j.slots.baseSelectOption,w({},se,{native:we,key:le.toString(),value:le.toString()}),x.current.getLocaleText(ig(le))))}))})),P.jsxs(rg,w({variant:"standard",as:j.slots.baseFormControl},K,O,{className:Se(B.columnInput,K.className,O.className),ownerState:j,children:[P.jsx(j.slots.baseInputLabel,w({},ue,{htmlFor:k,id:G,children:x.current.getLocaleText("filterPanelColumns")}
9)),P.jsx(j.slots.baseSelect,w({labelId:G,id:k,label:x.current.getLocaleText("filterPanelColumns"),value:m.field||"",onChange:ie,native:we},(u=j.slotProps)==null?void 0:u.baseSelect,{children:Pe.map(le=>s.createElement(j.slots.baseSelectOption,w({},se,{native:we,key:le.field,value:le.field}),mn(le)))}))]})),P.jsxs(lg,w({variant:"standard",as:j.slots.baseFormControl},K,H,{className:Se(B.operatorInput,K.className,H.className),ownerState:j,children:[P.jsx(j.slots.baseInputLabel,w({},ue,{htmlFor:z,id:N,children:x.current.getLocaleText("filterPanelOperator")})),P.jsx(j.slots.baseSelect,w({labelId:N,label:x.current.getLocaleText("filterPanelOperator"),id:z,value:m.operator,onChange:me,native:we,inputRef:W},(g=j.slotProps)==null?void 0:g.baseSelect,{children:Y==null||(f=Y.filterOperators)==null?void 0:f.map(le=>s.createElement(j.slots.baseSelectOption,w({},se,{native:we,key:le.value,value:le.value}),le.label||x.current.getLocaleText(`filterOperator${pt(le.value)}`)))}))]})),P.jsx(sg,w({variant:"standard",as:j.slots.baseFormControl},K,be,{className:Se(B.valueInput,K.className,be.className),ownerState:j,children:J!=null&&J.InputComponent?P.jsx(J.InputComponent,w({apiRef:x,item:m,applyValue:v,focusElementRef:Z},J.InputComponentProps,pe)):null}))]}))});
9class nr{constructor(){this.currentId=0,this.clear=()=>{this.currentId!==0&&(clearTimeout(this.currentId),this.currentId=0)},this.disposeEffect=()=>this.clear}static create(){return new nr}start(t,n){this.clear(),this.currentId=setTimeout(n,t)}}function Dn(){const e=Vo(nr.create).current;return Ao(e.disposeEffect),e}const ug=["item","applyValue","type","apiRef","focusElementRef","tabIndex","disabled","isFilterActive","clearButton","InputProps","variant"];function ft(e){var t,n;const{item:o,applyValue:r,type:l,apiRef:i,focusElementRef:c,tabIndex:a,disabled:d,clearButton:u,InputProps:g,variant:f="standard"}=e,m=te(e,ug),h=Dn(),[C,v]=s.useState((t=o.value)!=null?t:""),[b,p]=s.useState(!1),y=$e(),E=ne(),_=s.useCallback(I=>{const{value:D}=I.target;v(String(D)),p(!0),h.start(E.filterDebounceMs,()=>{const R=w({},o,{value:D,fromInput:y});r(R),p(!1)})},[y,r,o,E.filterDebounceMs,h]);return s.useEffect(()=>{if(o.fromInput!==y||o.value===void 0){var D;v(String((D=o.value)!=null?D:""))}},[y,o]),P.jsx(E.slots.baseTextField,w({id:y,label:i.current.getLocaleText("filterPanelInputLabel"),placeholder:i.current.getLocaleText("filterPanelInputPlaceholder"),value:C,onChange:_,variant:f,type:l||"text",InputProps:w({},b||u?{endAdornment:b?P.jsx(E.slots.loadIcon,{fontSize:"small",color:"action"}):u}:{},{disabled:d},g,{inputProps:w({tabIndex:a},g?.inputProps)}),InputLabelProps:{shrink:!0},inputRef:c},m,(n=E.slotProps)==null?void 0:n.baseTextField))}const ag=["item","applyValue","type","apiRef","focusElementRef","InputProps","isFilterActive","clearButton","tabIndex","disabled"];function Jt(e){var t,n;const{item:o,applyValue:r,type:l,apiRef:i,focusElementRef:c,InputProps:a,clearButton:d,tabIndex:u,disabled:g}=e,f=te(e,ag),m=Dn(),[h,C]=s.useState((t=o.value)!=null?t:""),[v,b]=s.useState(!1),p=$e(),y=ne(),E=s.useCallback(_=>{const I=_.target.value;C(String(I)),b(!0),m.start(y.filterDebounceMs,()=>{r(w({},o,{value:I})),b(!1)})},[r,o,y.filterDebounceMs,m]);return s.useEffect(()=>{var _;const I=(_=o.value)!=null?_:"";C(String(I))},[o.value]),P.jsx(y.slots.baseTextField,w({fullWidth:!0,id:p,label:i.current.getLocaleText("filterPanelInputLabel"),placeholder:i.current.getLocaleText("filterPanelInputPlaceholder"),value:h,onChange:E,variant:"standard",type:l||"text",InputLabelProps:{shrink:!0},inputRef:c,InputProps:w({},v||d?{endAdornment:v?P.jsx(y.slots.loadIcon,{fontSize:"small",color:"action"}):d}:{},{disabled:g},a,{inputProps:w({max:l==="datetime-local"?"9999-12-31T23:59":"9999-12-31",tabIndex:u},a?.inputProps)})},f,(n=y.slotProps)==null?void 0:n.baseTextField))}const dg=["item","applyValue","type","apiRef","focusElementRef","getOptionLabel","getOptionValue","placeholder","tabIndex","label","variant","isFilterActive","clearButton","InputLabelProps"],gg=({column:{valueOptions:e,field:t},OptionComponent:n,getOptionLabel:o,getOptionValue:r,isSelectNative:l,baseSelectOptionProps:i})=>(typeof e=="function"?["",...e({field:t})]:["",...e||[]]).map(a=>{const d=r(a),u=o(a);return s.createElement(n,w({},i,{native:l,key:d,value:d}),u)}),fg=Re("div")({display:"flex",alignItems:"flex-end",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function Gr(e){var t,n,o,r,l,i,c,a;const{item:d,applyValue:u,type:g,apiRef:f,focusElementRef:m,getOptionLabel:h,getOptionValue:C,placeholder:v,tabIndex:b,label:p,variant:y="standard",clearButton:E}=e,_=te(e,dg),[I,D]=s.useState((t=d.value)!=null?t:""),R=$e(),L=$e(),$=ne(),H=(n=(o=$.slotProps)==null||(o=o.baseSelect)==null?void 0:o.native)!=null?n:!0;let O=null;if(d.field){const k=f.current.getColumn(d.field);Bt(k)&&(O=k)}const M=C||((r=O)==null?void 0:r.getOptionValue),S=h||((l=O)==null?void 0:l.getOptionLabel),x=s.useMemo(()=>{if(O)return typeof O.valueOptions=="function"?O.valueOptions({field:O.field}):O.valueOptions},[O]),F=s.useCallback(k=>{let G=k.target.value;G=Po(G,x,M),D(String(G)),u(w({},d,{value:G}))},[x,M,u,d]);if(s.useEffect(()=>{var k;let G;if(x!==void 0){if(G=Po(d.value,x,M),G!==d.value){u(w({},d,{value:G}));return}}else G=d.value;G=(k=G)!=null?k:"",D(String(G))},[d,x,u,M]),!Bt(O)||!Bt(O))return null;const T=p??f.current.getLocaleText("filterPanelInputLabel");return P.jsxs(fg,{children:[P.jsxs($.slots.baseFormControl,{children:[P.jsx($.slots.baseInputLabel,w({},(i=$.slotProps)==null?void 0:i.baseInputLabel,{id:L,htmlFor:R,shrink:!0,variant:y,children:T}
9)),P.jsx($.slots.baseSelect,w({id:R,label:T,labelId:L,value:I,onChange:F,variant:y,type:g||"text",inputProps:{tabIndex:b,ref:m,placeholder:v??f.current.getLocaleText("filterPanelInputPlaceholder")},native:H,notched:y==="outlined"?!0:void 0},_,(c=$.slotProps)==null?void 0:c.baseSelect,{children:gg({column:O,OptionComponent:$.slots.baseSelectOption,getOptionLabel:S,getOptionValue:M,isSelectNative:H,baseSelectOptionProps:(a=$.slotProps)==null?void 0:a.baseSelectOption})}))]}),E]})}const hg=["item","applyValue","apiRef","focusElementRef","isFilterActive","clearButton","tabIndex","label","variant","InputLabelProps"],mg=Re("div")({display:"flex",alignItems:"center",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function Cg(e){var t,n,o,r;const{item:l,applyValue:i,apiRef:c,focusElementRef:a,clearButton:d,tabIndex:u,label:g,variant:f="standard"}=e,m=te(e,hg),[h,C]=s.useState(l.value||""),v=ne(),b=$e(),p=$e(),y=((t=v.slotProps)==null?void 0:t.baseSelect)||{},E=(n=y.native)!=null?n:!0,_=((o=v.slotProps)==null?void 0:o.baseSelectOption)||{},I=s.useCallback(R=>{const L=R.target.value;C(L),i(w({},l,{value:L}))},[i,l]);s.useEffect(()=>{C(l.value||"")},[l.value]);const D=g??c.current.getLocaleText("filterPanelInputLabel");return P.jsxs(mg,{children:[P.jsxs(v.slots.baseFormControl,{fullWidth:!0,children:[P.jsx(v.slots.baseInputLabel,w({},(r=v.slotProps)==null?void 0:r.baseInputLabel,{id:b,shrink:!0,variant:f,children:D})),P.jsxs(v.slots.baseSelect,w({labelId:b,id:p,label:D,value:h,onChange:I,variant:f,notched:f==="outlined"?!0:void 0,native:E,displayEmpty:!0,inputProps:{ref:a,tabIndex:u}},m,y,{children:[P.jsx(v.slots.baseSelectOption,w({},_,{native:E,value:"",children:c.current.getLocaleText("filterValueAny")})),P.jsx(v.slots.baseSelectOption,w({},_,{native:E,value:"true",children:c.current.getLocaleText("filterValueTrue")})),P.jsx(v.slots.baseSelectOption,w({},_,{native:E,value:"false",children:c.current.getLocaleText("filterValueFalse")}))]}))]}),d]})}const pg=["logicOperators","columnsSort","filterFormProps","getColumnForNewFilter","children","disableAddFilterButton","disableRemoveAllButton"],yo=e=>({field:e.field,operator:e.filterOperators[0].value,id:Math.round(Math.random()*1e5)}),wg=s.forwardRef(function(t,n){var o,r;const l=he(),i=ne(),c=q(l,Ve),a=q(l,Ol),d=s.useRef(null),u=s.useRef(null),{logicOperators:g=[Ye.And,Ye.Or],columnsSort:f,filterFormProps:m,getColumnForNewFilter:h,disableAddFilterButton:C=!1,disableRemoveAllButton:v=!1}=t,b=te(t,pg),p=l.current.upsertFilterItem,y=s.useCallback(H=>{l.current.setFilterLogicOperator(H)},[l]),E=s.useCallback(()=>{let H;if(h&&typeof h=="function"){const O=h({currentFilters:c?.items||[],columns:a});if(O===null)return null;H=a.find(({field:M})=>M===O)}else H=a.find(O=>{var M;return(M=O.filterOperators)==null?void 0:M.length});return H?yo(H):null},[c?.items,a,h]),_=s.useCallback(()=>{if(h===void 0||typeof h!="function")return E();const H=c.items.length?c.items:[E()].filter(Boolean),O=h({currentFilters:H,columns:a});if(O===null)return null;const M=a.find(({field:S})=>S===O);return M?yo(M):null},[c.items,a,h,E]),I=s.useMemo(()=>c.items.length?c.items:(u.current||(u.current=E()),u.current?[u.current]:[]),[c.items,E]),D=I.length>1,R=()=>{const H=_();H&&l.current.upsertFilterItems([...I,H])},L=s.useCallback(H=>{const O=I.length===1;l.current.deleteFilterItem(H),O&&l.current.hideFilterPanel()},[l,I.length]),$=()=>{I.length===1&&I[0].value===void 0&&(l.current.deleteFilterItem(I[0]),l.current.hideFilterPanel()),l.current.setFilterModel(w({},c,{items:[]}))};return s.useEffect(()=>{g.length>0&&c.logicOperator&&!g.includes(c.logicOperator)&&y(g[0])},[g,y,c.logicOperator]),s.useEffect(()=>{I.length>0&&d.current.focus()},[I.length]),P.jsxs(vs,w({ref:n},b,{children:[P.jsx(ws,{children:I.map((H,O)=>P.jsx(cg,w({item:H,applyFilterChanges:p,deleteFilter:L,hasMultipleFilters:D,showMultiFilterOperators:O>0,multiFilterOperator:c.logicOperator,disableMultiFilterOperator:O!==1,applyMultiFilterOperatorChanges:y,focusElementRef:O===I.length-1?d:null,logicOperators:g,columnsSort:f},m),H.id==null?O:H.id))}),!i.disableMultipleColumnsFiltering&&!(C&&v)?P.jsxs(bs,{children:[C?P.jsx("span",{}):P.jsx(i.slots.baseButton,w({onClick:R,startIcon:P.jsx(i.slots.filterPanelAddIcon,{})},(o=i.slotProps)==null?void 0:o.baseButton,{children:l.current.getLocaleText("filterPanelAddFilter")})),v?null:P.jsx(i.slots.baseButton,w({onClick:$,startIcon:P.jsx(i.slots.filterPanelRemoveAllIcon,{})},(r=i.slotProps)==null?void 0:r.baseButton,{children:l.current.getLocaleText("filterPanelRemoveAll")}))]}):null]}))}),bg=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"];function xs(e){const{item:t,applyValue:n,type:o,apiRef:r,focusElementRef:l,color:i,error:c,helperText:a,size:d,variant:u}=e,g=te(e,bg),f={color:i,error:c,helperText:a,size:d,variant:u},[m,h]=s.useState(t.value||[]),C=$e(),v=ne();s.useEffect(()=>{var p;const y=(p=t.value)!=null?p:[];h(y.map(String))},[t.value]);const b=s.useCallback((p,y)=>{h(y.map(String)),n(w({},t,{value:[...y]}))},[n,t]);return P.jsx(El,w({multiple:!0,freeSolo:!0,options:[],filterOptions:(p,y)=>{const{inputValue:E}=y;return E==null||E===""?[]:[E]},id:C,value:m,onChange:b,renderTags:(p,y)=>p.map((E,_)=>P.jsx(v.slots.baseChip,w({variant:"outlined",size:"small",label:E},y({index:_})))),renderInput:p=>{var y;return P.jsx(v.slots.baseTextField,w({},p,{label:r.current.getLocaleText("filterPanelInputLabel"),placeholder:r.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:w({},p.InputLabelProps,{shrink:!0}),inputRef:l,type:o||"text"},f,(y=v.slotProps)==null?void 0:y.baseTextField))}},g))}const vg=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant","getOptionLabel","getOptionValue"],xg=Si();function Sg(e){var t,n;const{item:o,applyValue:r,apiRef:l,focusElementRef:i,color:c,error:a,helperText:d,size:u,variant:g="standard",getOptionLabel:f,getOptionValue:m}=e,h=te(e,vg),C={color:c,error:a,helperText:d,size:u,variant:g},v=$e(),b=ne();let p=null;if(o.field){const $=l.current.getColumn(o.field);Bt($)&&(p=$)}const y=m||((t=p)==null?void 0:t.getOptionValue),E=f||((n=p)==null?void 0:n.getOptionLabel),_=s.useCallback(($,H)=>y($)===y(H),[y]),I=s.useMemo(()=>{var $;return($=p)!=null&&$.valueOptions?typeof p.valueOptions=="function"?p.valueOptions({field:p.field}):p.valueOptions:[]},[p]),D=s.useMemo(()=>I?.map(y),[I,y]),R=s.useMemo(()=>Array.isArray(o.value)?I!==void 0?o.value.map(H=>D?.findIndex(O=>O===H)).filter(H=>H>=0).map(H=>I[H]):o.value:[],[o.value,I,D]);s.useEffect(()=>{(!Array.isArray(o.value)||R.length!==o.value.length)&&r(w({},o,{value:R.map(y)}))},[o,R,r,y]);const L=s.useCallback(($,H)=>{r(w({},o,{value:H.map(y)}))},[r,o,y]);return P.jsx(El,w({multiple:!0,options:I,isOptionEqualToValue:_,filterOptions:xg,id:v,value:R,onChange:L,getOptionLabel:E,renderTags:($,H)=>$.map((O,M)=>P.jsx(b.slots.baseChip,w({variant:"outlined",size:"small",label:E(O)},H({index:M})))),renderInput:$=>{var H;return P.jsx(b.slots.baseTextField,w({},$,{label:l.current.getLocaleText("filterPanelInputLabel"),placeholder:l.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:w({},$.InputLabelProps,{shrink:!0}
9),inputRef:i,type:"singleSelect"},C,(H=b.slotProps)==null?void 0:H.baseTextField))}},h))}const Pg=["children","onClick"],yg=s.forwardRef(function(t,n){var o;const{children:r,onClick:l}=t,i=te(t,Pg),c=he(),a=ne(),d=$e(),u=$e(),[g,f]=s.useState(!1),m=s.useRef(null),h=Ft(n,m),C=p=>{f(y=>!y),l?.(p)},v=()=>f(!1),b=p=>{qo(p.key)&&p.preventDefault(),Xl(p.key)&&v()};return r==null?null:P.jsxs(s.Fragment,{children:[P.jsx(a.slots.baseButton,w({ref:h,size:"small",startIcon:P.jsx(a.slots.exportIcon,{}),"aria-expanded":g,"aria-label":c.current.getLocaleText("toolbarExportLabel"),"aria-haspopup":"menu","aria-controls":g?u:void 0,id:d},i,{onClick:C},(o=a.slotProps)==null?void 0:o.baseButton,{children:c.current.getLocaleText("toolbarExport")})),P.jsx(so,{open:g,target:m.current,onClose:v,position:"bottom-start",children:P.jsx(Yn,{id:u,className:V.menuList,"aria-labelledby":d,onKeyDown:b,autoFocusItem:g,children:s.Children.map(r,p=>s.isValidElement(p)?s.cloneElement(p,{hideMenu:v}):p)})})]})}),Ig=["hideMenu","options"],Mg=["hideMenu","options"],Fg=["csvOptions","printOptions","excelOptions"];function kg(e){const t=he(),{hideMenu:n,options:o}=e,r=te(e,Ig);return P.jsx(Ze,w({onClick:()=>{t.current.exportDataAsCsv(o),n?.()}},r,{children:t.current.getLocaleText("toolbarExportCSV")}))}function Eg(e){const t=he(),{hideMenu:n,options:o}=e,r=te(e,Mg);return P.jsx(Ze,w({onClick:()=>{t.current.exportDataAsPrint(o),n?.()}},r,{children:t.current.getLocaleText("toolbarExportPrint")}))}const Vp=s.forwardRef(function(t,n){const{csvOptions:o={},printOptions:r={},excelOptions:l}=t,i=te(t,Fg),a=he().current.unstable_applyPipeProcessors("exportMenu",[],{excelOptions:l,csvOptions:o,printOptions:r}).sort((d,u)=>d.componentName>u.componentName?1:-1);return a.length===0?null:P.jsx(yg,w({},i,{ref:n,children:a.map((d,u)=>s.cloneElement(d.component,{key:u}))}))}),Dg=["className","selectedRowCount"],Rg=e=>{const{classes:t}=e;return ae({root:["selectedRowCount"]},de,t)},Tg=ze("div",{name:"MuiDataGrid",slot:"SelectedRowCount",overridesResolver:(e,t)=>t.selectedRowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2),visibility:"hidden",width:0,height:0,[e.breakpoints.up("sm")]:{visibility:"visible",width:"auto",height:"auto"}})),Hg=s.forwardRef(function(t,n){const{className:o,selectedRowCount:r}=t,l=te(t,Dg),i=he(),c=ne(),a=Rg(c),d=i.current.getLocaleText("footerRowSelected")(r);return P.jsx(Tg,w({ref:n,className:Se(a.root,o),ownerState:c},l,{children:d}))}),Og=s.forwardRef(function(t,n){var o,r;const l=he(),i=ne(),c=q(l,nc),a=q(l,Ea),d=q(l,to),u=!i.hideFooterSelectedRowCount&&a>0?P.jsx(Hg,{selectedRowCount:a}):P.jsx("div",{}),g=!i.hideFooterRowCount&&!i.pagination?P.jsx(i.slots.footerRowCount,w({},(o=i.slotProps)==null?void 0:o.footerRowCount,{rowCount:c,visibleRowCount:d})):null,f=i.pagination&&!i.hideFooterPagination&&i.slots.pagination&&P.jsx(i.slots.pagination,w({},(r=i.slotProps)==null?void 0:r.pagination));return P.jsxs(_u,w({ref:n},t,{children:[u,g,f]}))});function $g(){var e,t;const n=ne();return P.jsxs(s.Fragment,{children:[P.jsx(n.slots.preferencesPanel,w({},(e=n.slotProps)==null?void 0:e.preferencesPanel)),n.slots.toolbar&&P.jsx(n.slots.toolbar,w({},(t=n.slotProps)==null?void 0:t.toolbar))]})}const Gg=s.forwardRef(function(t,n){return P.jsx(Qo,w({ref:n},t,{children:P.jsx(Pi,{})}))}),Lg=s.forwardRef(function(t,n){const r=he().current.getLocaleText("noRowsLabel");return P.jsx(Qo,w({ref:n},t,{children:r}))}),_g=Re(yi)(({theme:e})=>({[`& .${wr.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${wr.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),Vg=s.forwardRef(function(t,n){const o=he(),r=ne(),l=q(o,rt),i=q(o,to),c=s.useMemo(()=>{var m,h;return(m=(h=r.rowCount)!=null?h:i)!=null?m:0},[r.rowCount,i]),a=s.useMemo(()=>Math.floor(c/(l.pageSize||1)),[c,l.pageSize]),d=s.useCallback(m=>{const h=Number(m.target.value);o.current.setPageSize(h)},[o]),u=s.useCallback((m,h)=>{o.current.setPage(h)},[o]),f=(m=>{for(let h=0;h<r.pageSizeOptions.length;h+=1){const C=r.pageSizeOptions[h];if(typeof C=="number"){if(C===m)return!0}else if(C.value===m)return!0}return!1})(l.pageSize)?r.pageSizeOptions:[];return P.jsx(_g,w({ref:n,component:"div",count:c,page:l.page<=a?l.page:a,rowsPerPageOptions:f,rowsPerPage:l.pageSize,onPageChange:u,onRowsPerPageChange:d},o.current.getLocaleText("MuiTablePagination"),t))}),Ag=["className","rowCount","visibleRowCount"],zg=e=>{const{classes:t}=e;return ae({root:["rowCount"]},de,t)},jg=ze("div",{name:"MuiDataGrid",slot:"RowCount",overridesResolver:(e,t)=>t.rowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2)})),Ng=s.forwardRef(function(t,n){const{className:o,rowCount:r,visibleRowCount:l}=t,i=te(t,Ag),c=he(),a=ne(),d=zg(a);if(r===0)return null;const u=l<r?c.current.getLocaleText("footerTotalVisibleRows")(l,r):r.toLocaleStr
9ing();return P.jsxs(jg,w({ref:n,className:Se(d.root,o),ownerState:a},i,{children:[c.current.getLocaleText("footerTotalRows")," ",u]}))}),Kn=(e,t)=>{let n,o;return t.pagination&&t.paginationMode==="client"?(o=Xo(e),n=ka(e)):(n=_t(e),n.length===0?o=null:o={firstRowIndex:0,lastRowIndex:n.length-1}),{rows:n,range:o}},kt=(e,t)=>{const n=Kn(e,t);return s.useMemo(()=>({rows:n.rows,range:n.range}),[n.rows,n.range])},Io={current:null};function Rn(e){return e.isInternal=!0,e}function qn(e){return e!==void 0&&e.isInternal===!0}function Bg(e){return Rn((t,n)=>{const o=e(t,n);return o&&(r=>o(r.value,r.row,n,Io.current))})}function Tn(e){return e.map(t=>w({},t,{getApplyFilterFn:Bg(t.getApplyFilterFnV7),getApplyFilterFnV7:Rn(t.getApplyFilterFnV7)}))}function Ss(e){return Rn((t,n,o)=>{const r=e(t,n,o);return r&&(l=>r(l.value,l.row,n,o))})}function Ps(e){return{current:e.current.getPublicApi()}}let Cn;function Ug(){if(Cn!==void 0)return Cn;try{Cn=new Function("return true")()}catch{Cn=!1}return Cn}const Mo=(e,t)=>{const n=w({},e);if(n.id==null&&(n.id=Math.round(Math.random()*1e5)),n.operator==null){const o=Zt(t)[n.field];n.operator=o&&o.filterOperators[0].value}return n},Wg=bt(["MUI: The `filterModel` can only contain a single item when the `disableMultipleColumnsFiltering` prop is set to `true`.","If you are using the community version of the `DataGrid`, this prop is always `true`."],"error"),Kg=bt("MUI: The `id` field is required on `filterModel.items` when you use multiple filters.","error"),qg=bt("MUI: The `operator` field is required on `filterModel.items`, one or more of your filtering item has no `operator` provided.","error"),ys=(e,t,n)=>{const o=e.items.length>1;let r;o&&t?(Wg(),r=[e.items[0]]):r=e.items;const l=o&&r.some(c=>c.id==null),i=r.some(c=>c.operator==null);return l&&Kg(),i&&qg(),i||l?w({},e,{items:r.map(c=>Mo(c,n))}):e.items!==r?w({},e,{items:r}):e},Lr=(e,t,n)=>o=>w({},o,{filterModel:ys(e,t,n)}),Tt=e=>typeof e=="string"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,Is=(e,t)=>{if(!e.field||!e.operator)return null;const n=t.current.getColumn(e.field);if(!n)return null;let o;if(n.valueParser){var r;const m=n.valueParser;o=Array.isArray(e.value)?(r=e.value)==null?void 0:r.map(h=>m(h)):m(e.value)}else o=e.value;const{ignoreDiacritics:l}=t.current.rootProps;l&&(o=Tt(o));const i=w({},e,{value:o}),c=n.filterOperators;if(!(c!=null&&c.length))throw new Error(`MUI: No filter operators found for column '${n.field}'.`);const a=c.find(m=>m.value===i.operator);if(!a)throw new Error(`MUI: No filter operator found for column '${n.field}' and operator value '${i.operator}'.`);const d=!qn(a.getApplyFilterFn),u=!qn(a.getApplyFilterFnV7),g=Ps(t);if(a.getApplyFilterFnV7&&!(d&&!u)){const m=a.getApplyFilterFnV7(i,n);return typeof m!="function"?null:{v7:!0,item:i,fn:h=>{let C=t.current.getRowValue(h,n);return l&&(C=Tt(C)),m(C,h,n,g)}}}const f=a.getApplyFilterFn(i,n);return typeof f!="function"?null:{v7:!1,item:i,fn:m=>{const h=t.current.getCellParams(m,i.field);Io.current=g,l&&(h.value=Tt(h.value));const C=f(h);return Io.current=null,C}}};let _r=1;const Qg=(e,t,n)=>{const{items:o}=e,r=o.map(c=>Is(c,t)).filter(c=>!!c);if(r.length===0)return null;if(n||!Ug())return(c,a)=>{const d={};for(let u=0;u<r.length;u+=1){const g=r[u];(!a||a(g.item.field))&&(d[g.item.id]=g.v7?g.fn(c):g.fn(t.current.getRowId(c)))}return d};const l=new Function("getRowId","appliers","row","shouldApplyFilter",`"use strict"; 10${r.map((c,a)=>`const shouldApply${a} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(c.item.field)});`).join(` 11`)} 12 13const result$$ = { 14${r.map((c,a)=>` ${JSON.stringify(String(c.item.id))}: !shouldApply${a} 15 ? false 16 : ${c.v7?`appliers[${a}].fn(row)`:`appliers[${a}].fn(getRowId(row))`},`).join(` 17`)} 18}; 19 20return result$$;`.replaceAll("$$",String(_r)));return _r+=1,(c,a)=>l(t.current.getRowId,r,c,a)},Zg=(e,t)=>{var n,o,r;const l=(n=(o=e.quickFilterValues)==null?void 0:o.filter(Boolean))!=null?n:[];if(l.length===0)return null;const c=((r=e.quickFilterExcludeHiddenColumns)!=null?r:!1)?Lt(t):at(t),a=[],{ignoreDiacritics:d}=t.current.rootProps,u=Ps(t);
20return c.forEach(g=>{const f=t.current.getColumn(g),m=f?.getApplyQuickFilterFn,h=f?.getApplyQuickFilterFnV7,C=!qn(m),v=!qn(h);h&&!(C&&!v)?a.push({column:f,appliers:l.map(b=>{const p=d?Tt(b):b;return{v7:!0,fn:h(p,f,u)}})}):m&&a.push({column:f,appliers:l.map(b=>{const p=d?Tt(b):b;return{v7:!1,fn:m(p,f,u)}})})}),function(f,m){const h={},C={};e:for(let b=0;b<l.length;b+=1){const p=l[b];for(let y=0;y<a.length;y+=1){const{column:E,appliers:_}=a[y],{field:I}=E;if(m&&!m(I))continue;const D=_[b];let R=t.current.getRowValue(f,E);if(D.fn!==null)if(D.v7){if(d&&(R=Tt(R)),D.fn(R,f,E,u)){h[p]=!0;continue e}}else{var v;const L=(v=C[I])!=null?v:t.current.getCellParams(t.current.getRowId(f),I);if(d&&(L.value=Tt(L.value)),C[I]=L,D.fn(L)){h[p]=!0;continue e}}}h[p]=!1}return h}},Yg=(e,t,n)=>{const o=Qg(e,t,n),r=Zg(e,t);return function(i,c,a){var d,u;a.passingFilterItems=(d=o?.(i,c))!=null?d:null,a.passingQuickFilterValues=(u=r?.(i,c))!=null?u:null}},Vr=e=>e!=null,Xg=(e,t,n)=>(e.cleanedFilterItems||(e.cleanedFilterItems=n.filter(o=>Is(o,t)!==null)),e.cleanedFilterItems),Ms=(e,t,n,o,r)=>{const l=Xg(r,o,n.items),i=e.filter(Vr),c=t.filter(Vr);if(i.length>0){var a;const u=f=>i.some(m=>m[f.id]);if(((a=n.logicOperator)!=null?a:Sn().logicOperator)===Ye.And){if(!l.every(u))return!1}else if(!l.some(u))return!1}if(c.length>0&&n.quickFilterValues!=null){var d;const u=f=>c.some(m=>m[f]);if(((d=n.quickFilterLogicOperator)!=null?d:Sn().quickFilterLogicOperator)===Ye.And){if(!n.quickFilterValues.every(u))return!1}else if(!n.quickFilterValues.some(u))return!1}return!0},Ar=Rn(e=>{if(!e)return null;const t=new RegExp(Ln(e),"i");return(n,o,r,l)=>{let i=l.current.getRowFormattedValue(o,r);return l.current.ignoreDiacritics&&(i=Tt(i)),i!=null?t.test(i.toString()):!1}}),Jg=(e=!1)=>Tn([{value:"contains",getApplyFilterFnV7:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),o=new RegExp(Ln(n),"i");return r=>r!=null?o.test(String(r)):!1},InputComponent:ft},{value:"equals",getApplyFilterFnV7:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),o=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return r=>r!=null?o.compare(n,r.toString())===0:!1},InputComponent:ft},{value:"startsWith",getApplyFilterFnV7:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),o=new RegExp(`^${Ln(n)}.*$`,"i");return r=>r!=null?o.test(r.toString()):!1},InputComponent:ft},{value:"endsWith",getApplyFilterFnV7:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),o=new RegExp(`.*${Ln(n)}$`,"i");return r=>r!=null?o.test(r.toString()):!1},InputComponent:ft},{value:"isEmpty",getApplyFilterFnV7:()=>t=>t===""||t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFnV7:()=>t=>t!==""&&t!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFnV7:t=>{if(!Array.isArray(t.value)||t.value.length===0)return null;const n=e?t.value:t.value.map(r=>r.trim()),o=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return r=>r!=null?n.some(l=>o.compare(l,r.toString()||"")===0):!1},InputComponent:xs}]),Xe={width:100,minWidth:50,maxWidth:1/0,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,editable:!1,sortComparator:La,type:"string",align:"left",filterOperators:Jg(),renderEditCell:su,getApplyQuickFilterFn:Ss(Ar),getApplyQuickFilterFnV7:Ar},ef=()=>Tn([{value:"is",getApplyFilterFnV7:e=>{if(!e.value)return null;const t=e.value==="true";return n=>!!n===t},InputComponent:Cg}]);function tf({value:e,api:t}){return e?t.getLocaleText("booleanCellTrueLabel"):t.getLocaleText("booleanCellFalseLabel")}const nf=e=>{switch(e.toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case"null":case"undefined":return!1;default:return}},Fs=w({},Xe,{type:"boolean",align:"center",headerAlign:"center",renderCell:Kc,renderEditCell:Yc,sortComparator:as,valueFormatter:tf,filterOperators:ef(),getApplyQuickFilterFn:void 0,getApplyQuickFilterFnV7:void 0,aggregable:!1,pastedValueParser:e=>nf(e)}),St="__check__",fn=w({},Fs,{field:St,type:"checkboxSelection",width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:void 0,getApplyQuickFilterFnV7:void 0,valueGetter:e=>Wn(e.api.state,e.api.instanceId)[e.id]!==void 0,renderHeader:e=>P.jsx(Qa,w({},e)),renderCell:e=>P.jsx(Wa,w({},e))}),io="actions",of=w({},Xe,{sortable:!1,filterable:!1,aggregable:!1,width:100,align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:yu,getApplyQuickFilterFn:void 0,getApplyQuickFilterFnV7:void 0}),or="__detail_panel_toggle__",Ne=e=>e.editRows,rf=["selected","hovered","rowId","row","index","style","position","rowHeight","className","visibleColumns","renderedColumns","containerWidth","firstColumnToRender","lastColumnToRender","isLastVisible","focusedCellColumnIndexNotInRange","isNot
20Visible","focusedCell","tabbableCell","onClick","onDoubleClick","onMouseEnter","onMouseLeave","onMouseOut","onMouseOver"],lf=e=>{const{editable:t,editing:n,selected:o,isLastVisible:r,rowHeight:l,classes:i}=e;return ae({root:["row",o&&"selected",t&&"row--editable",n&&"row--editing",r&&"row--lastVisible",l==="auto"&&"row--dynamicHeight"]},de,i)};function sf({width:e}){if(!e)return null;const t={width:e};return P.jsx("div",{className:`${V.cell} ${V.withBorderColor}`,style:t})}const cf=s.forwardRef(function(t,n){const{selected:o,hovered:r,rowId:l,row:i,index:c,style:a,position:d,rowHeight:u,className:g,visibleColumns:f,renderedColumns:m,containerWidth:h,firstColumnToRender:C,isLastVisible:v=!1,focusedCellColumnIndexNotInRange:b,isNotVisible:p,focusedCell:y,onClick:E,onDoubleClick:_,onMouseEnter:I,onMouseLeave:D,onMouseOut:R,onMouseOver:L}=t,$=te(t,rf),H=he(),O=s.useRef(null),M=ne(),S=kt(H,M),x=q(H,kn),F=q(H,Qe),T=q(H,an),k=q(H,En),G=q(H,Ne),z=Ft(O,n),N=c+k+2,j={selected:o,isLastVisible:v,classes:M.classes,editing:H.current.getRowMode(l)===Te.Edit,editable:M.editMode===wt.Row,rowHeight:u},B=lf(j);s.useLayoutEffect(()=>{u==="auto"&&O.current&&typeof ResizeObserver>"u"&&H.current.unstable_storeRowHeightMeasurement(l,O.current.clientHeight,d)},[H,u,l,d]),s.useLayoutEffect(()=>{if(S.range){const xe=H.current.getRowIndexRelativeToVisibleRows(l);xe!=null&&H.current.unstable_setLastMeasuredRowIndex(xe)}const X=O.current;if(!X||u!=="auto"||typeof ResizeObserver>"u")return;const re=new ResizeObserver(xe=>{const[Oe]=xe,Je=Oe.borderBoxSize&&Oe.borderBoxSize.length>0?Oe.borderBoxSize[0].blockSize:Oe.contentRect.height;H.current.unstable_storeRowHeightMeasurement(l,Je,d)});return re.observe(X),()=>re.disconnect()},[H,S.range,c,u,l,d]);const Z=s.useCallback((X,oe)=>re=>{dn(re)||H.current.getRow(l)&&(H.current.publishEvent(X,H.current.getRowParams(l),re),oe&&oe(re))},[H,l]),W=s.useCallback(X=>{const oe=Nn(X.target,V.cell),re=oe?.getAttribute("data-field");if(re){if(re===fn.field||re===or||re==="__reorder__"||H.current.getCellMode(l,re)===ke.Edit)return;const xe=H.current.getColumn(re);if(xe?.type===io)return}Z("rowClick",E)(X)},[H,E,Z,l]),{slots:ee,slotProps:K,disableColumnReorder:ce}=M,we=ee.cell===So?So:zc,ue=M.rowReordering,se=(X,oe)=>{var re,xe;const Oe=ce&&X.disableReorder||!ue&&!!F.length&&T>1&&Object.keys(G).length>0,Je=(re=(xe=G[l])==null?void 0:xe[X.field])!=null?re:null;let et=!1;return b!==void 0&&f[b].field===X.field&&(et=!0),P.jsx(we,w({column:X,width:oe.width,rowId:l,height:u,showRightBorder:oe.showRightBorder,align:X.align||"left",colIndex:oe.indexRelativeToAllColumns,colSpan:oe.colSpan,disableDragEvents:Oe,editCellState:Je,isNotVisible:et},K?.cell),X.field)},pe=q(H,()=>w({},H.current.unstable_getRowInternalSizes(l)),zo);let be=u;if(be==="auto"&&pe){let X=0;const oe=Object.entries(pe).reduce((re,[xe,Oe])=>/^base[A-Z]/.test(xe)?(X+=1,Oe>re?Oe:re):re,0);oe>0&&X>1&&(be=oe)}const ye=s.useMemo(()=>{if(p)return{opacity:0,width:0,height:0};const X=w({}
20,a,{maxHeight:u==="auto"?"none":u,minHeight:be});if(pe!=null&&pe.spacingTop){const oe=M.rowSpacingType==="border"?"borderTopWidth":"marginTop";X[oe]=pe.spacingTop}if(pe!=null&&pe.spacingBottom){const oe=M.rowSpacingType==="border"?"borderBottomWidth":"marginBottom";let re=X[oe];typeof re!="number"&&(re=parseInt(re||"0",10)),re+=pe.spacingBottom,X[oe]=re}return X},[p,u,a,be,pe,M.rowSpacingType]),Pe=H.current.unstable_applyPipeProcessors("rowClassName",[],l);if(typeof M.getRowClassName=="function"){var Y;const X=c-(((Y=S.range)==null?void 0:Y.firstRowIndex)||0),oe=w({},H.current.getRowParams(l),{isFirstVisible:X===0,isLastVisible:X===S.rows.length-1,indexRelativeToCurrentPage:X});Pe.push(M.getRowClassName(oe))}const J=Sa(1e4,20,80),ie=H.current.getRowNode(l);if(!ie)return null;const me=ie.type,Ce=[];for(let X=0;X<m.length;X+=1){const oe=m[X];let re=C+X;b!==void 0&&y&&(f[b].field===oe.field?re=b:re-=1);const xe=H.current.unstable_getCellColSpanInfo(l,re);if(xe&&!xe.spannedByColSpan)if(me!=="skeletonRow"){const{colSpan:Oe,width:Je}=xe.cellProps,et={width:Je,colSpan:Oe,showRightBorder:M.showCellVerticalBorder,indexRelativeToAllColumns:re};Ce.push(se(oe,et))}else{const{width:Oe}=xe.cellProps,Je=Math.round(J());Ce.push(P.jsx(ee.skeletonCell,{width:Oe,contentWidth:Je,field:oe.field,align:oe.align},oe.field))}}const ve=h-x,le=i?{onClick:W,onDoubleClick:Z("rowDoubleClick",_),onMouseEnter:Z("rowMouseEnter",I),onMouseLeave:Z("rowMouseLeave",D),onMouseOut:Z("rowMouseOut",R),onMouseOver:Z("rowMouseOver",L)}:null;return P.jsxs("div",w({ref:z,"data-id":l,"data-rowindex":c,role:"row",className:Se(...Pe,B.root,g,r&&"Mui-hovered"),"aria-rowindex":N,"aria-selected":o,style:ye},le,$,{children:[Ce,ve>0&&P.jsx(sf,{width:ve})]}))}),uf=lo(cf),af={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",toolbarDensity:"Density",toolbarDensityLabel:"Density",toolbarDensityCompact:"Compact",toolbarDensityStandard:"Standard",toolbarDensityComfortable:"Comfortable",toolbarColumns:"Columns",toolbarColumnsLabel:"Select columns",toolbarFilters:"Filters",toolbarFiltersLabel:"Show filters",toolbarFiltersTooltipHide:"Hide filters",toolbarFiltersTooltipShow:"Show filters",toolbarFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,toolbarQuickFilterPlaceholder:"Search…",toolbarQuickFilterLabel:"Search",toolbarQuickFilterDeleteIconLabel:"Clear",toolbarExport:"Export",toolbarExportLabel:"Export",toolbarExportCSV:"Download as CSV",toolbarExportPrint:"Print",toolbarExportExcel:"Download as Excel",columnsPanelTextFieldLabel:"Find column",columnsPanelTextFieldPlaceholder:"Column title",columnsPanelDragIconLabel:"Reorder column",columnsPanelShowAllButton:"Show all",columnsPanelHideAllButton:"Hide all",filterPanelAddFilter:"Add filter",filterPanelRemoveAll:"Remove all",filterPanelDeleteIconLabel:"Delete",filterPanelLogicOperator:"Logic operator",filterPanelOperator:"Operator",filterPanelOperatorAnd:"And",filterPanelOperatorOr:"Or",filterPanelColumns:"Columns",filterPanelInputLabel:"Value",filterPanelInputPlaceholder:"Filter value",filterOperatorContains:"contains",filterOperatorEquals:"equals",filterOperatorStartsWith:"starts with",filterOperatorEndsWith:"ends with",filterOperatorIs:"is",filterOperatorNot:"is not",filterOperatorAfter:"is after",filterOperatorOnOrAfter:"is on or after",filterOperatorBefore:"is before",filterOperatorOnOrBefore:"is on or before",filterOperatorIsEmpty:"is empty",filterOperatorIsNotEmpty:"is not empty",filterOperatorIsAnyOf:"is any of","filterOperator=":"=","filterOperator!=":"!=","filterOperator>":">","filterOperator>=":">=","filterOperator<":"<","filterOperator<=":"<=",headerFilterOperatorContains:"Contains",headerFilterOperatorEquals:"Equals",headerFilterOperatorStartsWith:"Starts with",headerFilterOperatorEndsWith:"Ends with",headerFilterOperatorIs:"Is",headerFilterOperatorNot:"Is not",headerFilterOperatorAfter:"Is after",headerFilterOperatorOnOrAfter:"Is on or after",headerFilterOperatorBefore:"Is before",headerFilterOperatorOnOrBefore:"Is on or before",headerFilterOperatorIsEmpty:"Is empty",headerFilterOperatorIsNotEmpty:"Is not empty",headerFilterOperatorIsAnyOf:"Is any of","headerFilterOperator=":"Equals","headerFilterOperator!=":"Not equals","headerFilterOperator>":"Greater than","headerFilterOperator>=":"Greater than or equal to","headerFilterOperator<":"Less than","headerFilterOperator<=":"Less than or equal to",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuShowColumns:"Show columns",columnMenuManageColumns:"Manage columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide column",columnMenuUnsort:"Unsort",columnMenuSortAsc:"Sort by ASC",columnMenuSortDesc:"Sort by DESC",columnHeaderFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,columnHeaderFiltersLabel:"Show filters",columnHeaderSortIconLabel:"Sort",footerRowSelected:e=>
20e!==1?`${e.toLocaleString()} rows selected`:`${e.toLocaleString()} row selected`,footerTotalRows:"Total Rows:",footerTotalVisibleRows:(e,t)=>`${e.toLocaleString()} of ${t.toLocaleString()}`,checkboxSelectionHeaderName:"Checkbox selection",checkboxSelectionSelectAllRows:"Select all rows",checkboxSelectionUnselectAllRows:"Unselect all rows",checkboxSelectionSelectRow:"Select row",checkboxSelectionUnselectRow:"Unselect row",booleanCellTrueLabel:"yes",booleanCellFalseLabel:"no",actionsCellMore:"more",pinToLeft:"Pin to left",pinToRight:"Pin to right",unpin:"Unpin",treeDataGroupingHeaderName:"Group",treeDataExpand:"see children",treeDataCollapse:"hide children",groupingColumnHeaderName:"Group",groupColumn:e=>`Group by ${e}`,unGroupColumn:e=>`Stop grouping by ${e}`,detailPanelToggle:"Detail panel toggle",expandDetailPanel:"Expand",collapseDetailPanel:"Collapse",MuiTablePagination:{},rowReorderingHeaderName:"Row reordering",aggregationMenuItemHeader:"Aggregation",aggregationFunctionLabelSum:"sum",aggregationFunctionLabelAvg:"avg",aggregationFunctionLabelMin:"min",aggregationFunctionLabelMax:"max",aggregationFunctionLabelSize:"size"};function df({privateApiRef:e,props:t,children:n}){const o=s.useRef(e.current.getPublicApi());return P.jsx(Hl.Provider,{value:t,children:P.jsx(Rl.Provider,{value:e,children:P.jsx(jl.Provider,{value:o,children:n})})})}const gf=/(\d+)-(\d+)-(\d+)/,ff=/(\d+)-(\d+)-(\d+)T(\d+):(\d+)/;function en(e,t,n,o){if(!e.value)return null;const[r,l,i,c,a]=e.value.match(n?ff:gf).slice(1).map(Number),d=new Date(r,l-1,i,c||0,a||0).getTime();return u=>{if(!u)return!1;if(o)return t(u.getTime(),d);const f=new Date(u).setHours(n?u.getHours():0,n?u.getMinutes():0,0,0);return t(f,d)}}const ks=e=>Tn([{value:"is",getApplyFilterFnV7:t=>en(t,(n,o)=>n===o,e),InputComponent:Jt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFnV7:t=>en(t,(n,o)=>n!==o,e),InputComponent:Jt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFnV7:t=>en(t,(n,o)=>n>o,e),InputComponent:Jt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFnV7:t=>en(t,(n,o)=>n>=o,e),InputComponent:Jt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFnV7:t=>en(t,(n,o)=>n<o,e,!e),InputComponent:Jt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrBefore",getApplyFilterFnV7:t=>en(t,(n,o)=>n<=o,e),InputComponent:Jt,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFnV7:()=>t=>t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFnV7:()=>t=>t!=null,requiresFilterValue:!1}]);function Es({value:e,columnType:t,rowId:n,field:o}){if(!(e instanceof Date))throw new Error([`MUI: \`${t}\` column type only accepts \`Date\` objects as values.`,"Use `valueGetter` to transform the value into a `Date` object.",`Row ID: ${n}, field: "${o}".`].join(` 21`))}function hf({value:e,field:t,id:n}){return e?(Es({value:e,columnType:"date",rowId:n,field:t}),e.toLocaleDateString()):""}function mf({value:e,field:t,id:n}){return e?(Es({value:e,columnType:"dateTime",rowId:n,field:t}),e.toLocaleString()):""}const Cf=w({},Xe,{type:"date",sortComparator:ds,valueFormatter:hf,filterOperators:ks(),renderEditCell:Ql,pastedValueParser:e=>new Date(e)}),pf=w({},Xe,{type:"dateTime",sortComparator:ds,valueFormatter:mf,filterOperators:ks(!0),renderEditCell:Ql,pastedValueParser:e=>new Date(e)}),Rt=e=>e==null?null:Number(e),zr=Rn(e=>e==null||Number.isNaN(e)||e===""?null:t=>Rt(t)===Rt(e)),wf=()=>Tn([{value:"=",getApplyFilterFnV7:e=>e.value==null||Number.isNaN(e.value)?null:t=>Rt(t)===e.value,InputComponent:ft,InputComponentProps:{type:"number"}},{value:"!=",getApplyFilterFnV7:e=>e.value==null||Number.isNaN(e.value)?null:t=>Rt(t)!==e.value,InputComponent:ft,InputComponentProps:{type:"number"}},{value:">",getApplyFilterFnV7:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Rt(t)>e.value,InputComponent:ft,InputComponentProps:{type:"number"}},{value:">=",getApplyFilterFnV7:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Rt(t)>=e.value,InputComponent:ft,InputComponentProps:{type:"number"}},{value:"<",getApplyFilterFnV7:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Rt(t)<e.value,InputComponent:ft,InputComponentProps:{type:"number"}},{value:"<=",getApplyFilterFnV7:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Rt(t)<=e.value,InputComponent:ft,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFnV7:()=>e=>e==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFnV7:()=>e=>e!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFnV7:e=>!Array.isArray(e.value)||e.value.length===0?null:t=>t!=null&&e.value.includes(Number(t)),InputComponent:xs,InputComponentProps:{type:"number"}}]),bf=w({},Xe,{type:"number",align:"right",headerAlign:"right",sortComparator:as,valueParser:e=>e===""?null:Number(e),valueFormatter:({value:e})=>
21ba(e)?e.toLocaleString():e||"",filterOperators:wf(),getApplyQuickFilterFn:Ss(zr),getApplyQuickFilterFnV7:zr}),tn=e=>e==null||!Yo(e)?e:e.value,vf=()=>Tn([{value:"is",getApplyFilterFnV7:e=>e.value==null||e.value===""?null:t=>tn(t)===tn(e.value),InputComponent:Gr},{value:"not",getApplyFilterFnV7:e=>e.value==null||e.value===""?null:t=>tn(t)!==tn(e.value),InputComponent:Gr},{value:"isAnyOf",getApplyFilterFnV7:e=>{if(!Array.isArray(e.value)||e.value.length===0)return null;const t=e.value.map(tn);return n=>t.includes(tn(n))},InputComponent:Sg}]),xf=e=>typeof e[0]=="object",Sf=e=>Yo(e)?e.value:e,Pf=e=>Yo(e)?e.label:String(e),yf=w({},Xe,{type:"singleSelect",getOptionLabel:Pf,getOptionValue:Sf,valueFormatter(e){const{id:t,field:n,value:o,api:r}=e,l=e.api.getColumn(n);if(!Bt(l))return"";let i;if(typeof l.valueOptions=="function"?i=l.valueOptions({id:t,row:t?r.getRow(t):null,field:n}):i=l.valueOptions,o==null)return"";if(!i)return o;if(!xf(i))return l.getOptionLabel(o);const c=i.find(a=>l.getOptionValue(a)===o);return c?l.getOptionLabel(c):""},renderEditCell:Cu,filterOperators:vf(),pastedValueParser:(e,t)=>{const n=t.colDef,o=n.valueOptions,r=typeof o=="function"?o({field:n.field}):o||[],l=n.getOptionValue;if(r.find(c=>l(c)===e))return e}}),Ds="__default__",If=()=>({string:Xe,number:bf,date:Cf,dateTime:pf,boolean:Fs,singleSelect:yf,[io]:of,[Ds]:Xe}),Mf=()=>s.useRef({}),Ff=va()&&window.localStorage.getItem("DEBUG")!=null,wn=()=>{},kf={debug:wn,info:wn,warn:wn,error:wn},jr=["debug","info","warn","error"];function Nr(e,t,n=console){const o=jr.indexOf(t);if(o===-1)throw new Error(`MUI: Log level ${t} not recognized.`);return jr.reduce((l,i,c)=>(c>=o?l[i]=(...a)=>{const[d,...u]=a;n[i](`MUI: ${e} - ${d}`,...u)}:l[i]=wn,l),{})}const Ef=(e,t)=>{const n=s.useCallback(o=>Ff?Nr(o,"debug",t.logger):t.logLevel?Nr(o,t.logLevel.toString(),t.logger):kf,[t.logLevel,t.logger]);ge(e,{getLogger:n},"private")};class rr{static create(t){return new rr(t)}constructor(t){this.value=void 0,this.listeners=void 0,this.subscribe=n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}),this.getSnapshot=()=>this.value,this.update=n=>{this.value=n,this.listeners.forEach(o=>o(n))},this.value=t,this.listeners=new Set}}class Df{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,n,o={}){let r=this.events[t];r||(r={highPriority:new Map,regular:new Map},this.events[t]=r),o.isFirst?r.highPriority.set(n,!0):r.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const o=this.events[t];if(!o)return;const r=Array.from(o.highPriority.keys()),l=Array.from(o.regular.keys());for(let i=r.length-1;i>=0;i-=1){const c=r[i];o.highPriority.has(c)&&c.apply(this,n)}for(let i=0;i<l.length;i+=1){const c=l[i];o.regular.has(c)&&c.apply(this,n)}}once(t,n){const o=this;this.on(t,function r(...l){o.removeListener(t,r),n.apply(o,l)})}}const Rs=Symbol("mui.api_private"),Rf=e=>e.isPropagationStopped!==void 0;let Br=0;function Tf(e){var t;const n=(t=e.current)==null?void 0:t[Rs];if(n)return n;const o={},r={state:o,store:rr.create(o),instanceId:{id:Br}};return Br+=1,r.getPublicApi=()=>e.current,r.register=(l,i)=>
21{Object.keys(i).forEach(c=>{const a=i[c],d=r[c];if(d?.spying===!0?d.target=a:r[c]=a,l==="public"){const u=e.current,g=u[c];g?.spying===!0?g.target=a:u[c]=a}})},r.register("private",{caches:{},eventManager:new Df}),r}function Hf(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[Rs]:e.current}}function Of(e,t){const n=s.useRef(),o=s.useRef();o.current||(o.current=Tf(n)),n.current||(n.current=Hf(o));const r=s.useCallback((...i)=>{const[c,a,d={}]=i;if(d.defaultMuiPrevented=!1,Rf(d)&&d.isPropagationStopped())return;const u=t.signature===Ct.DataGridPro?{api:o.current.getPublicApi()}:{};o.current.eventManager.emit(c,a,d,u)},[o,t.signature]),l=s.useCallback((i,c,a)=>{o.current.eventManager.on(i,c,a);const d=o.current;return()=>{d.eventManager.removeListener(i,c)}},[o]);return ge(o,{subscribeEvent:l,publishEvent:r},"public"),s.useImperativeHandle(e,()=>n.current,[n]),s.useEffect(()=>{const i=o.current;return()=>{i.publishEvent("unmount")}},[o]),o}const $f=(e,t)=>{const n=s.useCallback(o=>{if(t.localeText[o]==null)throw new Error(`Missing translation for key ${o}.`);return t.localeText[o]},[t.localeText]);e.current.register("public",{getLocaleText:n})};function yn(e){"@babel/helpers - typeof";return yn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yn(e)}function Gf(e,t){if(yn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(yn(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function In(e){var t=Gf(e,"string");return yn(t)=="symbol"?t:t+""}const Lf=e=>{const t=s.useRef({}),n=s.useRef(!1),o=s.useCallback(u=>{n.current||!u||(n.current=!0,Object.values(u.appliers).forEach(g=>{g()}),n.current=!1)},[]),r=s.useCallback((u,g,f)=>{t.current[u]||(t.current[u]={processors:new Map,appliers:{}});const m=t.current[u];return m.processors.get(g)!==f&&(m.processors.set(g,f),o(m)),()=>{t.current[u].processors.set(g,null)}},[o]),l=s.useCallback((u,g,f)=>(t.current[u]||(t.current[u]={processors:new Map,appliers:{}}),t.current[u].appliers[g]=f,()=>{const m=t.current[u].appliers,h=te(m,[g].map(In));t.current[u].appliers=h}),[]),i=s.useCallback(u=>{const g=t.current[u];o(g)},[o]),c=s.useCallback((...u)=>{const[g,f,m]=u;return t.current[g]?Array.from(t.current[g].processors.values()).reduce((C,v)=>v?v(C,m):C,f):f},[]),a={registerPipeProcessor:r,registerPipeApplier:l,requestPipeProcessorsApplication:i},d={unstable_applyPipeProcessors:c};ge(e,a,"private"),ge(e,d,"public")},Ie=(e,t,n)=>{const o=s.useRef(),r=s.useRef(`mui-${Math.round(Math.random()*1e9)}`),l=s.useCallback(()=>{o.current=e.current.registerPipeProcessor(t,r.current,n)},[e,n,t]);gn(()=>{l()});const i=s.useRef(!0);s.useEffect(()=>(i.current?i.current=!1:l(),()=>{o.current&&(o.current(),o.current=null)}),[l])},lr=(e,t,n)=>{const o=s.useRef(),r=s.useRef(`mui-${Math.round(Math.random()*1e9)}`),l=s.useCallback(()=>{o.current=e.current.registerPipeApplier(t,r.current,n)},[e,n,t]);gn(()=>{l()});const i=s.useRef(!0);s.useEffect(()=>(i.current?i.current=!1:l(),()=>{o.current&&(o.current(),o.current=null)}),[l])},Ht=(e,t,n,o)=>{const r=s.useCallback(()=>{e.current.registerStrategyProcessor(t,n,o)},[e,o,n,t]);gn(()=>{r()});const l=s.useRef(!0);s.useEffect(()=>{l.current?l.current=!1:r()},[r])},qt="none",Ur={rowTreeCreation:"rowTree",filtering:"rowTree",sorting:"rowTree",visibleRowsLookupCreation:"rowTree"},_f=e=>{const t=s.useRef(new Map),n=s.useRef({}),o=s.useCallback((a,d,u)=>{const g=()=>{const h=n.current[d],C=te(h,[a].map(In));n.current[d]=C};n.current[d]||(n.current[d]={});const f=n.current[d],m=f[a];return f[a]=u,!m||m===u||a===e.current.getActiveStrategy(Ur[d])&&e.current.publishEvent("activeStrategyProcessorChange",d),g},[e]),r=s.useCallback((a,d)=>{const u=e.current.getActiveStrategy(Ur[a]);if(u==null)throw new Error("Can't apply a strategy processor before defining an active strategy");const g=n.current[a];if(!g||!g[u])throw new Error(`No processor found for processor "${a}" on strategy "${u}"`);const f=g[u];return f(d)},[e]),l=s.useCallback(a=>{var d;const g=Array.from(t.current.entries()).find(([,f])=>f.group!==a?!1:f.isAvailable());return(d=g?.[0])!=null?d:qt},[]),i=s.useCallback((a,d,u)=>{t.current.set(d,{group:a,isAvailable:u}),e.current.publishEvent("strategyAvailabilityChange")},[e]);ge(e,{registerStrategyProcessor:o,applyStrategyProcessor:r,getActiveStrategy:l,setStrategyAvailability:i},"private")},Vf=(e,t)=>
21{const n=s.useRef({}),[,o]=s.useState(),r=s.useCallback(u=>{n.current[u.stateId]=u},[]),l=s.useCallback((u,g)=>{let f;if(ts(u)?f=u(e.current.state):f=u,e.current.state===f)return!1;let m=!1;const h=[];if(Object.keys(n.current).forEach(C=>{const v=n.current[C],b=v.stateSelector(e.current.state,e.current.instanceId),p=v.stateSelector(f,e.current.instanceId);p!==b&&(h.push({stateId:v.stateId,hasPropChanged:p!==v.propModel}),v.propModel!==void 0&&p!==v.propModel&&(m=!0))}),h.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${h[0].stateId}, therefore, you're not allowed to update ${h.map(C=>C.stateId).join(", ")} in the same transaction.`);if(m||(e.current.state=f,e.current.publishEvent&&e.current.publishEvent("stateChange",f),e.current.store.update(f)),h.length===1){const{stateId:C,hasPropChanged:v}=h[0],b=n.current[C],p=b.stateSelector(f,e.current.instanceId);if(b.propOnChange&&v){const y=t.signature===Ct.DataGridPro?{api:e.current,reason:g}:{reason:g};b.propOnChange(p,y)}m||e.current.publishEvent(b.changeEvent,p,{reason:g})}return!m},[e,t.signature]),i=s.useCallback((u,g,f)=>e.current.setState(m=>w({},m,{[u]:g(m[u])}),f),[e]),c=s.useCallback(()=>o(()=>e.current.state),[e]),a={setState:l,forceUpdate:c},d={updateControlState:i,registerControlState:r};ge(e,a,"public"),ge(e,d,"private")},Af=(e,t)=>{const n=Of(e,t);return Ef(n,t),Vf(n,t),Lf(n),_f(n),$f(n,t),n.current.register("private",{rootProps:t}),n},_e=(e,t,n)=>{const o=s.useRef(!1);o.current||(t.current.state=e(t.current.state,n,t),o.current=!0)};
21function Fo(e,t,n){return typeof e=="string"&&[t,` 22`,"\r",'"'].some(o=>e.includes(o))?n?`"${e.replace(/"/g,'""')}"`:`${e.replace(/"/g,'""')}`:e}const Ts=(e,t)=>{const{delimiterCharacter:n,ignoreValueFormatter:o,shouldAppendQuotes:r}=t;let l;if(o){var i;const a=e.colDef.type;if(a==="number")l=String(e.value);else if(a==="date"||a==="dateTime"){var c;l=(c=e.value)==null?void 0:c.toISOString()}else typeof((i=e.value)==null?void 0:i.toString)=="function"?l=e.value.toString():l=e.value}else l=e.formattedValue;return Fo(l,n,r)};bt(["MUI: When the value of a field is an object or a `renderCell` is provided, the CSV export might not display the value correctly.","You can provide a `valueFormatter` with a string representation to be used."]);class ko{constructor(t){this.options=void 0,this.rowString="",this.isEmpty=!0,this.options=t}addValue(t){this.isEmpty||(this.rowString+=this.options.delimiterCharacter),t==null?this.rowString+="":typeof this.options.sanitizeCellValue=="function"?this.rowString+=this.options.sanitizeCellValue(t,this.options.delimiterCharacter,this.options.shouldAppendQuotes):this.rowString+=t,this.isEmpty=!1}getRowString(){return this.rowString}}const zf=({id:e,columns:t,getCellParams:n,delimiterCharacter:o,ignoreValueFormatter:r,shouldAppendQuotes:l})=>{const i=new ko({delimiterCharacter:o,shouldAppendQuotes:l});return t.forEach(c=>{const a=n(e,c.field);i.addValue(Ts(a,{delimiterCharacter:o,ignoreValueFormatter:r,shouldAppendQuotes:l}))}),i.getRowString()};function jf(e){const{columns:t,rowIds:n,delimiterCharacter:o,includeHeaders:r,includeColumnGroupsHeaders:l,ignoreValueFormatter:i,apiRef:c,shouldAppendQuotes:a}=e,d=n.reduce((h,C)=>`${h}${zf({id:C,columns:t,getCellParams:c.current.getCellParams,delimiterCharacter:o,ignoreValueFormatter:i,shouldAppendQuotes:a})}\r 23`,"").trim();if(!r)return d;const u=t.filter(h=>h.field!==fn.field),g=[];if(l){const h=c.current.unstable_getAllGroupDetails();let C=0;const v=u.reduce((b,p)=>{const y=c.current.unstable_getColumnGroupPath(p.field);return b[p.field]=y,C=Math.max(C,y.length),b},{});for(let b=0;b<C;b+=1){const p=new ko({delimiterCharacter:o,sanitizeCellValue:Fo,shouldAppendQuotes:a});g.push(p),u.forEach(y=>{const E=(v[y.field]||[])[b],_=h[E];p.addValue(_?_.headerName||_.groupId:"")})}}const f=new ko({delimiterCharacter:o,sanitizeCellValue:Fo,shouldAppendQuotes:a});return u.forEach(h=>{f.addValue(h.headerName||h.field)}),g.push(f),`${`${g.map(h=>h.getRowString()).join(`\r 24`)}\r 25`}${d}`.trim()}function Wr(e){const t=document.createElement("span");t.style.whiteSpace="pre",t.style.userSelect="all",t.style.opacity="0px",t.textContent=e,document.body.appendChild(t);const n=document.createRange();n.selectNode(t);const o=window.getSelection();o.removeAllRanges(),o.addRange(n);try{document.execCommand("copy")}finally{document.body.removeChild(t)}}function Nf(e){navigator.clipboard?navigator.clipboard.writeText(e).catch(()=>{Wr(e)}):Wr(e)}function Bf(e){var t;return!!((t=window.getSelection())!=null&&t.toString()||e&&(e.selectionEnd||0)-(e.selectionStart||0)>0)}const Uf=(e,t)=>{const n=t.unstable_ignoreValueFormatterDuringExport,o=(typeof n=="object"?n?.clipboardExport:n)||!1,r=t.clipboardCopyCellDelimiter,l=s.useCallback(i=>{if(!((i.ctrlKey||i.metaKey)&&i.key==="c")||Bf(i.target))return;let c="";if(e.current.getSelectedRows().size>0)c=e.current.getDataAsCsv({includeHeaders:!1,delimiter:r,shouldAppendQuotes:!1});else{const d=tt(e);if(d){const u=e.current.getCellParams(d.id,d.field);c=Ts(u,{delimiterCharacter:r,ignoreValueFormatter:o,shouldAppendQuotes:!1})}}c=e.current.unstable_applyPipeProcessors("clipboardCopy",c),c&&(Nf(c),e.current.publishEvent("clipboardCopy",c))},[e,o,r]);os(e,e.current.rootElementRef,"keydown",l),Me(e,"clipboardCopy",t.onClipboardCopy)},Wf=e=>w({},e,{columnMenu:{open:!1}}),Kf=e=>{const t=je(e,"useGridColumnMenu"),n=s.useCallback(i=>{e.current.setState(a=>a.columnMenu.open&&a.columnMenu.field===i?a:(t.debug("Opening Column Menu"),w({},a,{columnMenu:{open:!0,field:i}})))&&(e.current.hidePreferences(),e.current.forceUpdate())},[e,t]),o=s.useCallback(()=>{const i=xo(e.current.state);if(i.field){const a=Zt(e),d=lt(e),u=at(e);let g=i.field;if(a[g]||(g=u[0]),d[g]===!1){const f=u.filter(h=>h===g?!0:d[h]!==!1),m=f.indexOf(g);g=f[m+1]||f[m-1]}e.current.setColumnHeaderFocus(g)}e.current.setState(a=>!a.columnMenu.open&&a.columnMenu.field===void 0?a:(t.debug("Hiding Column Menu"),w({},a,{columnMenu:w({},a.columnMenu,{open:!1,field:void 0})})))&&e.current.forceUpdate()},[e,t]),r=s.useCallback(i=>{t.debug("Toggle Column Menu");const c=xo(e.current.state);!c.open||c.field!==i?n(i):o()},[e,t,n,o]);ge(e,{showColumnMenu:n,hideColumnMenu:o,toggleColumnMenu:r},"public"),Q(e,"columnResizeStart",o),Q(e,"virtualScrollerWheel",e.current.hideColumnMenu),Q(e,"virtualScrollerTouchMove",e.current.hideColumnMenu)},Hs=["maxWidth","minWidth","width","flex"];function qf({initialFreeSpace:e,totalFlexUnits:t,flexColumns:n}){const o=new Set(n.map(i=>
25i.field)),r={all:{},frozenFields:[],freeze:i=>{const c=r.all[i];c&&c.frozen!==!0&&(r.all[i].frozen=!0,r.frozenFields.push(i))}};function l(){if(r.frozenFields.length===o.size)return;const i={min:{},max:{}};let c=e,a=t,d=0;r.frozenFields.forEach(u=>{c-=r.all[u].computedWidth,a-=r.all[u].flex});for(let u=0;u<n.length;u+=1){const g=n[u];if(r.all[g.field]&&r.all[g.field].frozen===!0)continue;let m=c/a*g.flex;m<g.minWidth?(d+=g.minWidth-m,m=g.minWidth,i.min[g.field]=!0):m>g.maxWidth&&(d+=g.maxWidth-m,m=g.maxWidth,i.max[g.field]=!0),r.all[g.field]={frozen:!1,computedWidth:m,flex:g.flex}}d<0?Object.keys(i.max).forEach(u=>{r.freeze(u)}):d>0?Object.keys(i.min).forEach(u=>{r.freeze(u)}):n.forEach(({field:u})=>{r.freeze(u)}),l()}return l(),r.all}const Eo=(e,t)=>{const n={};let o=0,r=0;const l=[];e.orderedFields.forEach(c=>{const a=w({},e.lookup[c]);if(e.columnVisibilityModel[c]===!1)a.computedWidth=0;else{let d;a.flex&&a.flex>0?(o+=a.flex,d=0,l.push(a)):d=Mt(a.width||Xe.width,a.minWidth||Xe.minWidth,a.maxWidth||Xe.maxWidth),r+=d,a.computedWidth=d}n[c]=a});const i=Math.max(t-r,0);if(o>0&&t>0){const c=qf({initialFreeSpace:i,totalFlexUnits:o,flexColumns:l});Object.keys(c).forEach(a=>{n[a].computedWidth=c[a].computedWidth})}return w({},e,{lookup:n})},Qf=(e,t)=>
25{if(!t)return e;const{orderedFields:n=[],dimensions:o={}}=t,r=Object.keys(o);if(r.length===0&&n.length===0)return e;const l={},i=[];for(let u=0;u<n.length;u+=1){const g=n[u];e.lookup[g]&&(l[g]=!0,i.push(g))}const c=i.length===0?e.orderedFields:[...i,...e.orderedFields.filter(u=>!l[u])],a=w({},e.lookup);for(let u=0;u<r.length;u+=1){const g=r[u],f=w({},a[g],{hasBeenResized:!0});Object.entries(o[g]).forEach(([m,h])=>{f[m]=h===-1?1/0:h}),a[g]=f}return w({},e,{orderedFields:c,lookup:a})};function Kr(e,t){let n=e[Ds];return t&&e[t]&&(n=e[t]),n}const on=({apiRef:e,columnsToUpsert:t,initialState:n,columnTypes:o,columnVisibilityModel:r=lt(e),keepOnlyColumnsToUpsert:l=!1})=>{var i,c,a;const d=!e.current.state.columns;let u;if(d)u={orderedFields:[],lookup:{},columnVisibilityModel:r};else{const h=$t(e.current.state);u={orderedFields:l?[]:[...h.orderedFields],lookup:w({},h.lookup),columnVisibilityModel:r}}let g={};l&&!d&&(g=Object.keys(u.lookup).reduce((h,C)=>w({},h,{[C]:!1}),{})),t.forEach(h=>{const{field:C}=h;g[C]=!0;let v=u.lookup[C];v==null?(v=w({},Kr(o,h.type),{field:C,hasBeenResized:!1}),u.orderedFields.push(C)):l&&u.orderedFields.push(C),v&&v.type!==h.type&&(v=w({},Kr(o,h.type),{field:C}));let b=v.hasBeenResized;Hs.forEach(p=>{h[p]!==void 0&&(b=!0,h[p]===-1&&(h[p]=1/0))}),u.lookup[C]=w({},v,h,{hasBeenResized:b})}),l&&!d&&Object.keys(u.lookup).forEach(h=>{g[h]||delete u.lookup[h]});const f=e.current.unstable_applyPipeProcessors("hydrateColumns",u),m=Qf(f,n);return Eo(m,(i=(c=(a=e.current).getRootDimensions)==null||(c=c.call(a))==null?void 0:c.viewportInnerSize.width)!=null?i:0)},qr=e=>t=>w({},t,{columns:e});function Do({firstColumnToRender:e,apiRef:t,firstRowToRender:n,lastRowToRender:o,visibleRows:r}){let l=e;for(let i=n;i<o;i+=1)if(r[i]){const a=r[i].id,d=t.current.unstable_getCellColSpanInfo(a,e);d&&d.spannedByColSpan&&(l=d.leftVisibleCellIndex)}return l}function Zf({firstColumnIndex:e,minColumnIndex:t,columnBuffer:n,firstRowToRender:o,lastRowToRender:r,apiRef:l,visibleRows:i}){const c=Math.max(e-n,t);return Do({firstColumnToRender:c,apiRef:l,firstRowToRender:o,lastRowToRender:r,visibleRows:i})}function Hn(e,t){const n=Xt(e),o=En(e);return Math.floor(t*n)*((o??0)+1)}const Os=If(),Yf=(e,t,n)=>{var o,r,l,i;const c=on({apiRef:n,columnTypes:Os,columnsToUpsert:t.columns,initialState:(o=t.initialState)==null?void 0:o.columns,columnVisibilityModel:(r=(l=t.columnVisibilityModel)!=null?l:(i=t.initialState)==null||(i=i.columns)==null?void 0:i.columnVisibilityModel)!=null?r:{},keepOnlyColumnsToUpsert:!0});return w({},e,{columns:c})};function Xf(e,t){var n,o;const r=je(e,"useGridColumns"),l=Os,i=s.useRef(t.columns),c=s.useRef(l);e.current.registerControlState({stateId:"visibleColumns",propModel:t.columnVisibilityModel,propOnChange:t.onColumnVisibilityModelChange,stateSelector:lt,changeEvent:"columnVisibilityModelChange"});const a=s.useCallback(S=>{r.debug("Updating columns state."),e.current.setState(qr(S)),e.current.forceUpdate(),e.current.publishEvent("columnsChange",S.orderedFields)},[r,e]),d=s.useCallback(S=>Zt(e)[S],[e]),u=s.useCallback(()=>mt(e),[e]),g=s.useCallback(()=>Ae(e),[e]),f=s.useCallback((S,x=!0)=>(x?Ae(e):mt(e)).findIndex(T=>T.field===S),[e]),m=s.useCallback(S=>{const x=f(S);return Ut(e)[x]},[e,f]),h=s.useCallback(S=>{lt(e)!==S&&(e.current.setState(F=>w({},F,{columns:on({apiRef:e,columnTypes:l,columnsToUpsert:[],initialState:void 0,columnVisibilityModel:S,keepOnlyColumnsToUpsert:!1})})),e.current.forceUpdate())},[e,l]),C=s.useCallback(S=>{const x=on({apiRef:e,columnTypes:l,columnsToUpsert:S,initialState:void 0,keepOnlyColumnsToUpsert:!1});a(x)},[e,a,l]),v=s.useCallback((S,x)=>{var F;const T=lt(e),k=(F=T[S])!=null?F:!0;if(x!==k){const G=w({},T,{[S]:x});e.current.setColumnVisibilityModel(G)}},[e]),b=s.useCallback(S=>at(e).findIndex(F=>F===S),[e]),p=s.useCallback((S,x)=>{const F=at(e),T=b(S);if(T===x)return;r.debug(`Moving column ${S} to index ${x}`);const k=[...F],G=k.splice(T,1)[0];k.splice(x,0,G),a(w({},$t(e.current.state),{orderedFields:k}));const z={column:e.current.getColumn(S),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(S),oldIndex:T};e.current.publishEvent("columnIndexChange",z)},[e,r,a,b]),y=s.useCallback((S,x)=>{var F,T;
25r.debug(`Updating column ${S} width to ${x}`);const k=$t(e.current.state),G=k.lookup[S],z=w({},G,{width:x,hasBeenResized:!0});a(Eo(w({},k,{lookup:w({},k.lookup,{[S]:z})}),(F=(T=e.current.getRootDimensions())==null?void 0:T.viewportInnerSize.width)!=null?F:0)),e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(S),colDef:z,width:x})},[e,r,a]),E={getColumn:d,getAllColumns:u,getColumnIndex:f,getColumnPosition:m,getVisibleColumns:g,getColumnIndexRelativeToVisibleColumns:b,updateColumns:C,setColumnVisibilityModel:h,setColumnVisibility:v,setColumnWidth:y},_={setColumnIndex:p};ge(e,E,"public"),ge(e,_,t.signature===Ct.DataGrid?"private":"public");const I=s.useCallback((S,x)=>{var F,T;const k={},G=lt(e);(!x.exportOnlyDirtyModels||t.columnVisibilityModel!=null||Object.keys((F=(T=t.initialState)==null||(T=T.columns)==null?void 0:T.columnVisibilityModel)!=null?F:{}).length>0||Object.keys(G).length>0)&&(k.columnVisibilityModel=G),k.orderedFields=at(e);const N=mt(e),j={};return N.forEach(B=>{if(B.hasBeenResized){const Z={};Hs.forEach(W=>{let ee=B[W];ee===1/0&&(ee=-1),Z[W]=ee}),j[B.field]=Z}}),Object.keys(j).length>0&&(k.dimensions=j),w({},S,{columns:k})},[e,t.columnVisibilityModel,(n=t.initialState)==null?void 0:n.columns]),D=s.useCallback((S,x)=>{var F;const T=(F=x.stateToRestore.columns)==null?void 0:F.columnVisibilityModel,k=x.stateToRestore.columns;if(T==null&&k==null)return S;const G=on({apiRef:e,columnTypes:l,columnsToUpsert:[],initialState:k,columnVisibilityModel:T,keepOnlyColumnsToUpsert:!1});return e.current.setState(qr(G)),k!=null&&e.current.publishEvent("columnsChange",G.orderedFields),S},[e,l]),R=s.useCallback((S,x)=>{if(x===Wt.columns){var F;const T=t.slots.columnsPanel;return P.jsx(T,w({},(F=t.slotProps)==null?void 0:F.columnsPanel))}return S},[t.slots.columnsPanel,(o=t.slotProps)==null?void 0:o.columnsPanel]),L=s.useCallback(S=>t.disableColumnSelector?S:[...S,"columnMenuColumnsItem"],[t.disableColumnSelector]);Ie(e,"columnMenu",L),Ie(e,"exportState",I),Ie(e,"restoreState",D),Ie(e,"preferencePanel",R);const $=s.useRef(null);Q(e,"viewportInnerSizeChange",S=>{$.current!==S.width&&($.current=S.width,a(Eo($t(e.current.state),S.width)))});const O=s.useCallback(()=>{r.info("Columns pipe processing have changed, regenerating the columns");const S=on({apiRef:e,columnTypes:l,columnsToUpsert:[],initialState:void 0,keepOnlyColumnsToUpsert:!1});a(S)},[e,r,a,l]);lr(e,"hydrateColumns",O);const M=s.useRef(!0);s.useEffect(()=>{if(M.current){M.current=!1;return}if(r.info(`GridColumns have changed, new length ${t.columns.length}`),i.current===t.columns&&c.current===l)return;const S=on({apiRef:e,columnTypes:l,initialState:void 0,columnsToUpsert:t.columns,keepOnlyColumnsToUpsert:!0});i.current=t.columns,c.current=l,a(S)},[r,e,a,t.columns,l]),s.useEffect(()=>{t.columnVisibilityModel!==void 0&&e.current.setColumnVisibilityModel(t.columnVisibilityModel)},[e,r,t.columnVisibilityModel])}const Jf=.7,eh=1.3,$s={compact:Jf,comfortable:eh,standard:1},th=(e,t)=>w({},e,{density:{value:t.density,factor:$s[t.density]}}),nh=(e,t)=>{const n=je(e,"useDensity"),o=s.useCallback(l=>{n.debug(`Set grid density to ${l}`),e.current.setState(i=>{const c=Uo(i),a={value:l,factor:$s[l]};return Gt(c,a)?i:w({},i,{density:a})}),e.current.forceUpdate()},[n,e]);s.useEffect(()=>{e.current.setDensity(t.density)},[e,t.density]),ge(e,{setDensity:o},"public")};function oh(e,t="csv",n=document.title||"untitled"){const o=`${n}.${t}`;if("download"in HTMLAnchorElement.prototype){const r=URL.createObjectURL(e),l=document.createElement("a");l.href=r,l.download=o,l.click(),setTimeout(()=>{URL.revokeObjectURL(r)});return}throw new Error("MUI: exportAs not supported")}const Gs=({apiRef:e,options:t})=>{const n=mt(e);return t.fields?t.fields.reduce((r,l)=>{const i=n.find(c=>c.field===l);return i&&r.push(i),r},[]):(t.allColumns?n:Ae(e)).filter(r=>!r.disableExport)},rh=({apiRef:e})=>{var t,n;const o=fc(e),r=nt(e),l=e.current.getSelectedRows(),i=o.filter(u=>r[u].type!=="footer"),c=Yt(e),a=(c==null||(t=c.top)==null?void 0:t.map(u=>u.id))||[],d=(c==null||(n=c.bottom)==null?void 0:n.map(u=>u.id))||[];return i.unshift(...a),i.push(...d),l.size>0?i.filter(u=>l.has(u)):i},lh=(e,t)=>{const n=je(e,"useGridCsvExport"),o=t.unstable_ignoreValueFormatterDuringExport,r=(typeof o=="object"?o?.csvExport:o)||!1,l=s.useCallback((d={})=>{var u,g,f,m;n.debug("Get data as CSV");const h=Gs({apiRef:e,options:d}),v=((u=d.getRowsToExport)!=null?u:rh)({apiRef:e});return jf({columns:h,rowIds:v,delimiterCharacter:d.delimiter||",",includeHeaders:(g=d.includeHeaders)!=null?g:!0,includeColumnGroupsHeaders:(f=d.includeColumnGroupsHeaders)!=null?f:!0,ignoreValueFormatter:r,apiRef:e,shouldAppendQuotes:(m=d.shouldAppendQuotes)!=null?m:!0})},[n,e,r]),i=s.useCallback(d=>{n.debug("Export data as CSV");const u=l(d),g=new Blob([d!=null&&d.utf8WithBom?new Uint8Array([239,187,191]):"",u],{type:"text/csv"});oh(g,"csv",d?.fileName)},[n,l]);ge(e,{getDataAsCsv:l,exportDataAsCsv:i},"public");const a=s.useCallback((d,u)=>{var g;return(g=u.csvOptions)!=null&&g.disableToolbarButton?d:[...d,{component:P.jsx(kg,{options:u.csvOptions}),componentName:"csvExport"}]},[]);Ie(e,"exportMenu",a)},sh=(e,t)=>{var n,o;const r=w({},ls(t.autoPageSize),(n=t.paginationModel)!=null?n:(o=t.initialState)==null||(o=o.pagination)==null?void 0:o.paginationModel);return ss(r.pageSize,t.signature),w({},e,{pagination:{paginationModel:r}})},_n=(e,t,n)=>o=>{var r;let l=o.paginationModel;const i=(r=n?.pageSize)!=null?r:l.pageSize,c=rs(e,i);n&&(n?.page!==l.page||n?.pageSize!==l.pageSize)&&(l=n);const a=Ia(l.page,c);return a!==l.page&&(l=w({},l,{page:a})),ss(l.pageSize,t),{paginationModel:l}},ih=(e,t)=>{var n;const o=je(e,"useGridPagination"),r=q(e,to),l=q(e,Xt),i=Math.floor(t.rowHeight*l);e.current.registerControlState({stateId:"pagination",propModel:t.paginationModel,propOnChange:t.onPaginationModelChange,stateSelector:rt,changeEvent:"paginationModelChange"});const c=s.useCallback(C=>{const v=rt(e);C!==v.page&&(o.debug(`Setting page to ${C}`),e.current.setPaginationModel({page:C,pageSize:v.pageSize}))},[e,o]),a=s.useCallback(C=>{const v=rt(e);C!==v.pageSize&&(o.debug(`Setting page size to ${C}`),e.current.setPaginationModel({pageSize:C,page:v.page}))},[e,o]),d=s.useCallback(C=>{var v;const b=rt(e);C!==b&&(o.debug("Setting 'paginationModel' to",C),e.current.updateControlState("pagination",_n((v=t.rowCount)!=null?v:r,t.signature,C),"setPaginationModel"),e.current.forceUpdate())},[e,o,t.rowCount,t.signature,r]);ge(e,{setPage:c,setPageSize:a,setPaginationModel:d},"public");const g=s.useCallback((C,v)=>{var b;const p=rt(e);return!v.exportOnlyDirtyModels||t.paginationModel!=null||((b=t.initialState)==null||(b=b.pagination)==null?void 0:b.paginationModel)!=null||p.page!==0&&p.pageSize!==ya(t.autoPageSize)?w({},C,{pagination:w({},C.pagination,{paginationModel:p})}):C},[e,t.paginationModel,(n=t.initialState)==null||(n=n.pagination)==null?void 0:n.paginationModel,t.autoPageSize]),f=s.useCallback((C,v)=>{var b,p,y;const E=(b=v.stateToRestore.pagination)!=null&&b.paginationModel?w({},ls(t.autoPageSize),(p=v.stateToRestore.pagination)==null?void 0:p.paginationModel):rt(e);return e.current.updateControlState("pagination",_n((y=t.rowCount)!=null?y:r,t.signature,E),"stateRestorePreProcessing"),C},[e,t.autoPageSize,t.rowCount,t.signature,r]);Ie(e,"exportState",g),Ie(e,"restoreState",f);const m=()=>{var C;const v=rt(e);(C=e.current.virtualScrollerRef)!=null&&C.current&&e.current.scrollToIndexes({rowIndex:v.page*v.pageSize}),e.current.forceUpdate()},h=s.useCallback(()=>{const C=e.current.getRootDimensions();if(!t.autoPageSize||!C)return;const v=Wo(e),b=Math.floor((C.viewportInnerSize.height-v.top-v.bottom)/i);e.current.setPageSize(b)},[e,t.autoPageSize,i]);Q(e,"viewportInnerSizeChange",h),Q(e,"paginationModelChange",m),s.useEffect(()=>{},[t.rowCount,t.paginationMode]),s.useEffect(()=>{var C;e.current.updateControlState("pagination",_n((C=t.rowCount)!=null?C:r,t.signature,t.paginationModel))},[e,t.paginationModel,t.rowCount,t.paginationMode,r,t.signature]),s.useEffect(()=>{h()}
25,[h])};function ch(){return new Promise(e=>{requestAnimationFrame(()=>{e()})})}function uh(e){const t=document.createElement("iframe");return t.style.position="absolute",t.style.width="0px",t.style.height="0px",t.title=e||document.title,t}const ah=(e,t)=>{const n=je(e,"useGridPrintExport"),o=s.useRef(null),r=s.useRef(null),l=s.useRef({}),i=s.useRef([]);s.useEffect(()=>{o.current=Nt(e.current.rootElementRef.current)},[e]);const c=s.useCallback((h,C,v)=>new Promise(b=>{const p=Gs({apiRef:e,options:{fields:h,allColumns:C}}).map(_=>_.field),y=mt(e),E={};y.forEach(_=>{E[_.field]=p.includes(_.field)}),v&&(E[fn.field]=!0),e.current.setColumnVisibilityModel(E),b()}),[e]),a=s.useCallback(h=>{const v=h({apiRef:e}).map(b=>e.current.getRow(b));e.current.setRows(v)},[e]),d=s.useCallback((h,C)=>{var v,b;const p=w({copyStyles:!0,hideToolbar:!1,hideFooter:!1,includeCheckboxes:!1},C),y=h.contentDocument;if(!y)return;const E=Kt(e.current.state),_=e.current.rootElementRef.current,I=_.cloneNode(!0),D=I.querySelector(`.${V.main}`);D.style.overflow="visible",I.style.contain="size";const L=I.querySelector(`.${V.columnHeaders}`).querySelector(`.${V.columnHeadersInner}`);L.style.width="100%";let $=((v=_.querySelector(`.${V.toolbarContainer}`))==null?void 0:v.offsetHeight)||0,H=((b=_.querySelector(`.${V.footerContainer}`))==null?void 0:b.offsetHeight)||0;if(p.hideToolbar){var O;(O=I.querySelector(`.${V.toolbarContainer}`))==null||O.remove(),$=0}if(p.hideFooter){var M;(M=I.querySelector(`.${V.footerContainer}`))==null||M.remove(),H=0}const S=E.currentPageTotalHeight+Hn(e,t.columnHeaderHeight)+$+H;if(I.style.height=`${S}px`,I.style.boxSizing="content-box",C!=null&&C.getRowsToExport){const k=I.querySelector(`.${V.footerContainer}`);k.style.position="absolute",k.style.width="100%",k.style.top=`${S-H}px`}const x=document.createElement("div");x.appendChild(I),y.body.innerHTML=x.innerHTML;const F=typeof p.pageStyle=="function"?p.pageStyle():p.pageStyle;if(typeof F=="string"){const k=y.createElement("style");k.appendChild(y.createTextNode(F)),y.head.appendChild(k)}p.bodyClassName&&y.body.classList.add(...p.bodyClassName.split(" "));const T=[];if(p.copyStyles){const k=_.getRootNode(),z=(k.constructor.name==="ShadowRoot"?k:o.current).querySelectorAll("style, link[rel='stylesheet']");for(let N=0;N<z.length;N+=1){const j=z[N];if(j.tagName==="STYLE"){const B=y.createElement(j.tagName),Z=j.sheet;if(Z){let W="";for(let ee=0;ee<Z.cssRules.length;ee+=1)typeof Z.cssRules[ee].cssText=="string"&&(W+=`${Z.cssRules[ee].cssText}\r 26`);B.appendChild(y.createTextNode(W)),y.head.appendChild(B)}}else if(j.getAttribute("href")){const B=y.createElement(j.tagName);for(let Z=0;Z<j.attributes.length;Z+=1){const W=j.attributes[Z];W&&B.setAttribute(W.nodeName,W.nodeValue||"")}T.push(new Promise(Z=>{B.addEventListener("load",()=>Z())})),y.head.appendChild(B)}}}Promise.all(T).then(()=>{h.contentWindow.print()})},[e,o,t.columnHeaderHeight]),u=s.useCallback(h=>{var C;o.current.body.removeChild(h),e.current.restoreState(r.current||{}),(C=r.current)!=null&&(C=C.columns)!=null&&C.columnVisibilityModel||e.current.setColumnVisibilityModel(l.current),e.current.unstable_setVirtualization(!0),e.current.setRows(i.current),r.current=null,l.current={},i.current=[]},[e]),f={exportDataAsPrint:s.useCallback(async h=>{if(n.debug("Export data as Print"),!e.current.rootElementRef.current)throw new Error("MUI: No grid root element available.");r.current=e.current.exportState(),l.current=lt(e);const C=It(e);if(i.current=rn(e).map(b=>C[b]),t.pagination){const b=Al(e),p={page:0,pageSize:b};e.current.updateControlState("pagination",_n(b,"DataGridPro",p)),e.current.forceUpdate()}await c(h?.fields,h?.allColumns,h?.includeCheckboxes),h!=null&&h.getRowsToExport&&a(h.getRowsToExport),e.current.unstable_setVirtualization(!1),await ch();const v=uh(h?.fileName);v.onload=()=>{d(v,h),v.contentWindow.matchMedia("print").addEventListener("change",p=>{p.matches===!1&&u(v)})},o.current.body.appendChild(v)},[t,n,e,d,u,c,a])};ge(e,f,"public");const m=s.useCallback((h,C)=>{var v;return(v=C.printOptions)!=null&&v.disableToolbarButton?h:[...h,{component:P.jsx(Eg,{options:C.printOptions}),componentName:"printExport"}]},[]);Ie(e,"exportMenu",m)},dh=(e,t,n)=>{var o,r,l;const i=(o=(r=t.filterModel)!=null?r:(l=t.initialState)==null||(l=l.filter)==null?void 0:l.filterModel)!=null?o:Sn();return w({},e,{filter:{filterModel:ys(i,t.disableMultipleColumnsFiltering,n),filteredRowsLookup:{},filteredDescendantCountLookup:{}},visibleRowsLookup:{}})},gh=e=>e.filteredRowsLookup;function Qr(e,t){return e.current.applyStrategyProcessor("visibleRowsLookupCreation",{tree:t.rows.tree,filteredRowsLookup:t.filter.filteredRowsLookup})}function fh(){return Xn(Object.values)}const hh=(e,t)=>{var n,o;const r=je(e,"useGridFilter");e.current.registerControlState({stateId:"filter",propModel:t.filterModel,propOnChange:t.onFilterModelChange,stateSelector:Ve,changeEvent:"filterModelChange"});const l=s.useCallback(()=>{e.current.setState($=>{const H=Ve($,e.current.instanceId),O=t.filterMode==="client"?Yg(H,e,t.disableEval):null,M=e.current.applyStrategyProcessor("filtering",{isRowMatchingFilters:O,filterModel:H??Sn()}),S=w({},$,{filter:w({},$.filter,M)}),x=Qr(e,S);return w({},S,{visibleRowsLookup:x})}),e.current.publishEvent("filteredRowsSet")},[e,t.filterMode,t.disableEval]),i=s.useCallback(($,H)=>H==null||H.filterable===!1||t.disableColumnFilter?$:[...$,"columnMenuFilterItem"],[t.disableColumnFilter]),c=s.useCallback(()=>
26{l(),e.current.forceUpdate()},[e,l]),a=s.useCallback($=>{const H=Ve(e),O=[...H.items],M=O.findIndex(S=>S.id===$.id);M===-1?O.push($):O[M]=$,e.current.setFilterModel(w({},H,{items:O}),"upsertFilterItem")},[e]),d=s.useCallback($=>{const H=Ve(e),O=[...H.items];$.forEach(M=>{const S=$.findIndex(x=>x.id===M.id);S===-1?O.push(M):O[S]=M}),e.current.setFilterModel(w({},H,{items:$}),"upsertFilterItems")},[e]),u=s.useCallback($=>{const H=Ve(e),O=H.items.filter(M=>M.id!==$.id);O.length!==H.items.length&&e.current.setFilterModel(w({},H,{items:O}),"deleteFilterItem")},[e]),g=s.useCallback(($,H,O)=>{if(r.debug("Displaying filter panel"),$){const M=Ve(e),S=M.items.filter(k=>{var G;if(k.value!==void 0)return!(Array.isArray(k.value)&&k.value.length===0);const N=(G=e.current.getColumn(k.field).filterOperators)==null?void 0:G.find(B=>B.value===k.operator);return!(typeof N?.requiresFilterValue>"u"?!0:N?.requiresFilterValue)});let x;const F=S.find(k=>k.field===$),T=e.current.getColumn($);F?x=S:t.disableMultipleColumnsFiltering?x=[Mo({field:$,operator:T.filterOperators[0].value},e)]:x=[...S,Mo({field:$,operator:T.filterOperators[0].value},e)],e.current.setFilterModel(w({},M,{items:x}))}e.current.showPreferences(Wt.filters,H,O)},[e,r,t.disableMultipleColumnsFiltering]),f=s.useCallback(()=>{r.debug("Hiding filter panel"),e.current.hidePreferences()},[e,r]),m=s.useCallback($=>{const H=Ve(e);H.logicOperator!==$&&e.current.setFilterModel(w({},H,{logicOperator:$}),"changeLogicOperator")},[e]),h=s.useCallback($=>{const H=Ve(e);Gt(H.quickFilterValues,$)||e.current.setFilterModel(w({},H,{quickFilterValues:[...$]}))},[e]),C=s.useCallback(($,H)=>{Ve(e)!==$&&(r.debug("Setting filter model"),e.current.updateControlState("filter",Lr($,t.disableMultipleColumnsFiltering,e),H),e.current.unstable_applyFilters())},[e,r,t.disableMultipleColumnsFiltering]),v={setFilterLogicOperator:m,unstable_applyFilters:c,deleteFilterItem:u,upsertFilterItem:a,upsertFilterItems:d,setFilterModel:C,showFilterPanel:g,hideFilterPanel:f,setQuickFilterValues:h,ignoreDiacritics:t.ignoreDiacritics};ge(e,v,"public");const b=s.useCallback(($,H)=>{var O;const M=Ve(e);return!H.exportOnlyDirtyModels||t.filterModel!=null||((O=t.initialState)==null||(O=O.filter)==null?void 0:O.filterModel)!=null||!Gt(M,Sn())?w({},$,{filter:{filterModel:M}}):$},[e,t.filterModel,(n=t.initialState)==null||(n=n.filter)==null?void 0:n.filterModel]),p=s.useCallback(($,H)=>{var O;const M=(O=H.stateToRestore.filter)==null?void 0:O.filterModel;return M==null?$:(e.current.updateControlState("filter",Lr(M,t.disableMultipleColumnsFiltering,e),"restoreState"),w({},$,{callbacks:[...$.callbacks,e.current.unstable_applyFilters]}))},[e,t.disableMultipleColumnsFiltering]),y=s.useCallback(($,H)=>{if(H===Wt.filters){var O;const M=t.slots.filterPanel;return P.jsx(M,w({},(O=t.slotProps)==null?void 0:O.filterPanel))}return $},[t.slots.filterPanel,(o=t.slotProps)==null?void 0:o.filterPanel]),{getRowId:E}=t,_=Vo(fh),I=s.useCallback($=>{if(t.filterMode!=="client"||!$.isRowMatchingFilters)return{filteredRowsLookup:{},filteredDescendantCountLookup:{}};const H=It(e),O={},{isRowMatchingFilters:M}=$,S={},x={passingFilterItems:null,passingQuickFilterValues:null}
26,F=_.current(e.current.state.rows.dataRowIdToModelLookup);for(let G=0;G<F.length;G+=1){const z=F[G],N=E?E(z):z.id;M(z,void 0,x);const j=Ms([x.passingFilterItems],[x.passingQuickFilterValues],$.filterModel,e,S);O[N]=j}const T="auto-generated-group-footer-root";return H[T]&&(O[T]=!0),{filteredRowsLookup:O,filteredDescendantCountLookup:{}}},[e,t.filterMode,E,_]);Ie(e,"columnMenu",i),Ie(e,"exportState",b),Ie(e,"restoreState",p),Ie(e,"preferencePanel",y),Ht(e,qt,"filtering",I),Ht(e,qt,"visibleRowsLookupCreation",gh);const D=s.useCallback(()=>{r.debug("onColUpdated - GridColumns changed, applying filters");const $=Ve(e),H=Xi(e),O=$.items.filter(M=>M.field&&H[M.field]);O.length<$.items.length&&e.current.setFilterModel(w({},$,{items:O}))},[e,r]),R=s.useCallback($=>{$==="filtering"&&e.current.unstable_applyFilters()},[e]),L=s.useCallback(()=>{e.current.setState($=>w({},$,{visibleRowsLookup:Qr(e,$)})),e.current.forceUpdate()},[e]);Q(e,"rowsSet",l),Q(e,"columnsChange",D),Q(e,"activeStrategyProcessorChange",R),Q(e,"rowExpansionChange",L),Q(e,"columnVisibilityModelChange",()=>{const $=Ve(e);$.quickFilterValues&&$.quickFilterExcludeHiddenColumns&&e.current.unstable_applyFilters()}),gn(()=>{e.current.unstable_applyFilters()}),We(()=>{t.filterModel!==void 0&&e.current.setFilterModel(t.filterModel)},[e,r,t.filterModel])},mh=e=>w({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},tabIndex:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}),Ch=(e,t)=>{const n=je(e,"useGridFocus"),o=s.useRef(null),r=s.useCallback((D,R)=>{D&&e.current.getRow(D.id)&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(D.id,D.field),R)},[e]),l=s.useCallback((D,R)=>{const L=tt(e);L?.id===D&&L?.field===R||(e.current.setState($=>(n.debug(`Focusing on cell with id=${D} and field=${R}`),w({},$,{tabIndex:{cell:{id:D,field:R},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},focus:{cell:{id:D,field:R},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))),e.current.forceUpdate(),e.current.getRow(D)&&(L&&r(L,{}),e.current.publishEvent("cellFocusIn",e.current.getCellParams(D,R))))},[e,n,r]),i=s.useCallback((D,R={})=>{const L=tt(e);r(L,R),e.current.setState($=>(n.debug(`Focusing on column header with colIndex=${D}`),w({},$,{tabIndex:{columnHeader:{field:D},columnHeaderFilter:null,cell:null,columnGroupHeader:null},focus:{columnHeader:{field:D},columnHeaderFilter:null,cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,r]),c=s.useCallback((D,R={})=>{const L=tt(e);r(L,R),e.current.setState($=>(n.debug(`Focusing on column header filter with colIndex=${D}`),w({},$,{tabIndex:{columnHeader:null,columnHeaderFilter:{field:D},cell:null,columnGroupHeader:null},focus:{columnHeader:null,columnHeaderFilter:{field:D},cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,r]),a=s.useCallback((D,R,L={})=>{const $=tt(e);$&&e.current.publishEvent("cellFocusOut",e.current.getCellParams($.id,$.field),L),e.current.setState(H=>w({},H,{tabIndex:{columnGroupHeader:{field:D,depth:R},columnHeader:null,columnHeaderFilter:null,cell:null},focus:{columnGroupHeader:{field:D,depth:R},columnHeader:null,columnHeaderFilter:null,cell:null}})),e.current.forceUpdate()},[e]),d=s.useCallback(()=>zn(e),[e]),u=s.useCallback((D,R,L)=>{let $=e.current.getColumnIndex(R);const H=Ae(e),O=Kn(e,{pagination:t.pagination,paginationMode:t.paginationMode}),M=Yt(e),S=[].concat(M.top||[],O.rows,M.bottom||[]);let x=S.findIndex(G=>G.id===D);L==="right"?$+=1:L==="left"?$-=1:x+=1,$>=H.length?(x+=1,x<S.length&&($=0)):$<0&&(x-=1,x>=0&&($=H.length-1)),x=Mt(x,0,S.length-1);const F=S[x];if(!F)return;const T=e.current.unstable_getCellColSpanInfo(F.id,$);T&&T.spannedByColSpan&&(L==="left"||L==="below"?$=T.leftVisibleCellIndex:L==="right"&&($=T.rightVisibleCellIndex)),$=Mt($,0,H.length-1);const k=H[$];e.current.setCellFocus(F.id,k.field)},[e,t.pagination,t.paginationMode]),g=s.useCallback(({id:D,field:R})=>{e.current.setCellFocus(D,R)},[e]),f=s.useCallback((D,R)=>{R.key==="Enter"||R.key==="Tab"||R.key==="Shift"||xn(R.key)||e.current.setCellFocus(D.id,D.field)},[e]),m=s.useCallback(({field:D},R)=>{R.target===R.currentTarget&&e.current.setColumnHeaderFocus(D,R)},[e]),h=s.useCallback(({fields:D,depth:R},L)=>{if(L.target!==L.currentTarget)return;const $=zn(e);$!==null&&$.depth===R&&D.includes($.field)||e.current.setColumnGroupHeaderFocus(D[0],R,L)},[e]),C=s.useCallback((D,R)=>{var L;(L=R.relatedTarget)!=null&&L.className.includes(V.columnHeader)||(n.debug("Clearing focus"),e.current.setState($=>w({},$,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})))},[n,e]),v=s.useCallback(D=>{o.current=D},[]),b=s.useCallback(D=>{const R=o.current;o.current=null;const L=tt(e);
26if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:D,cell:R}))return;if(!L){R&&e.current.setCellFocus(R.id,R.field);return}if(R?.id===L.id&&R?.field===L.field)return;const H=e.current.getCellElement(L.id,L.field);H!=null&&H.contains(D.target)||(R?e.current.setCellFocus(R.id,R.field):(e.current.setState(O=>w({},O,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})),e.current.forceUpdate(),r(L,D)))},[e,r]),p=s.useCallback(D=>{if(D.cellMode==="view")return;const R=tt(e);(R?.id!==D.id||R?.field!==D.field)&&e.current.setCellFocus(D.id,D.field)},[e]),y=s.useCallback(()=>{const D=tt(e);D&&!e.current.getRow(D.id)&&e.current.setState(R=>w({},R,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))},[e]),E=Ge(()=>{const D=tt(e);if(!D)return;const R=Kn(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(R.rows.find(H=>H.id===D.id))return;const $=Ae(e);e.current.setState(H=>w({},H,{tabIndex:{cell:{id:R.rows[0].id,field:$[0].field},columnGroupHeader:null,columnHeader:null,columnHeaderFilter:null}}))}),_={setCellFocus:l,setColumnHeaderFocus:i,setColumnHeaderFilterFocus:c},I={moveFocusToRelativeCell:u,setColumnGroupHeaderFocus:a,getColumnGroupHeaderFocus:d};ge(e,_,"public"),ge(e,I,"private"),s.useEffect(()=>{const D=Nt(e.current.rootElementRef.current);return D.addEventListener("mouseup",b),()=>{D.removeEventListener("mouseup",b)}},[e,b]),Q(e,"columnHeaderBlur",C),Q(e,"cellDoubleClick",g),Q(e,"cellMouseDown",v),Q(e,"cellKeyDown",f),Q(e,"cellModeChange",p),Q(e,"columnHeaderFocus",m),Q(e,"columnGroupHeaderFocus",h),Q(e,"rowsSet",y),Q(e,"paginationModelChange",E)};function ph(e,t){const n=Yt(e)||{};return[...n.top||[],...t,...n.bottom||[]]}const mo=({currentColIndex:e,firstColIndex:t,lastColIndex:n,direction:o})=>{if(o==="rtl"){if(e<n)return e+1}else if(o==="ltr"&&e>t)return e-1;return null},Co=({currentColIndex:e,firstColIndex:t,lastColIndex:n,direction:o})=>{if(o==="rtl"){if(e>t)return e-1}else if(o==="ltr"&&e<n)return e+1;return null},wh=(e,t)=>{const n=je(e,"useGridKeyboardNavigation"),o=kt(e,t).rows,r=st(),l=s.useMemo(()=>ph(e,o),[e,o]),i=t.signature!=="DataGrid"&&t.unstable_headerFilters,c=s.useCallback((b,p,y="left")=>{const E=_t(e),_=e.current.unstable_getCellColSpanInfo(p,b);_&&_.spannedByColSpan&&(y==="left"?b=_.leftVisibleCellIndex:y==="right"&&(b=_.rightVisibleCellIndex));const I=E.findIndex(R=>R.id===p);n.debug(`Navigating to cell row ${I}, col ${b}`),e.current.scrollToIndexes({colIndex:b,rowIndex:I});const D=e.current.getVisibleColumns()[b].field;e.current.setCellFocus(p,D)},[e,n]),a=s.useCallback((b,p)=>{n.debug(`Navigating to header col ${b}`),e.current.scrollToIndexes({colIndex:b});const y=e.current.getVisibleColumns()[b].field;e.current.setColumnHeaderFocus(y,p)},[e,n]),d=s.useCallback((b,p)=>{n.debug(`Navigating to header filter col ${b}`),e.current.scrollToIndexes({colIndex:b});const y=e.current.getVisibleColumns()[b].field;e.current.setColumnHeaderFilterFocus(y,p)},[e,n]),u=s.useCallback((b,p,y)=>{n.debug(`Navigating to header col ${b}`),e.current.scrollToIndexes({colIndex:b});const{field:E}=e.current.getVisibleColumns()[b];e.current.setColumnGroupHeaderFocus(E,p,y)},[e,n]),g=s.useCallback(b=>{var p;return(p=l[b])==null?void 0:p.id},[l]),f=s.useCallback((b,p)=>{const y=p.currentTarget.querySelector(`.${V.columnHeaderTitleContainerContent}`);if(!!y&&y.contains(p.target)&&b.field!==fn.field||!e.current.getRootDimensions())return;const I=e.current.getViewportPageSize(),D=b.field?e.current.getColumnIndex(b.field):0,R=l.length>0?0:null,L=l.length-1,$=0,H=Ae(e).length-1,O=En(e);let M=!0;switch(p.key){case"ArrowDown":{R!==null&&(i?d(D,p):c(D,g(R)));break}case"ArrowRight":{const S=Co({currentColIndex:D,firstColIndex:$,lastColIndex:H,direction:r.direction});S!==null&&a(S,p);break}case"ArrowLeft":{const S=mo({currentColIndex:D,firstColIndex:$,lastColIndex:H,direction:r.direction});S!==null&&a(S,p);break}case"ArrowUp":{O>0&&u(D,O-1,p);break}case"PageDown":{R!==null&&L!==null&&c(D,g(Math.min(R+I,L)));break}case"Home":{a($,p);break}case"End":{a(H,p);break}case"Enter":{(p.ctrlKey||p.metaKey)&&e.current.toggleColumnMenu(b.field);break}case" ":break;default:M=!1}M&&p.preventDefault()},[e,l.length,i,d,c,g,r.direction,a,u]),m=s.useCallback((b,p)=>
26{if(!e.current.getRootDimensions())return;const E=fs(e)===b.field,_=er(e)===b.field;if(E||_||!xn(p.key))return;const I=e.current.getViewportPageSize(),D=b.field?e.current.getColumnIndex(b.field):0,R=0,L=l.length-1,$=0,H=Ae(e).length-1;let O=!0;switch(p.key){case"ArrowDown":{const M=g(R);M!=null&&c(D,M);break}case"ArrowRight":{const M=Co({currentColIndex:D,firstColIndex:$,lastColIndex:H,direction:r.direction});M!==null&&d(M,p);break}case"ArrowLeft":{const M=mo({currentColIndex:D,firstColIndex:$,lastColIndex:H,direction:r.direction});M!==null?d(M,p):e.current.setColumnHeaderFilterFocus(b.field,p);break}case"ArrowUp":{a(D,p);break}case"PageDown":{L!==null&&c(D,g(Math.min(R+I,L)));break}case"Home":{d($,p);break}case"End":{d(H,p);break}case" ":break;default:O=!1}O&&p.preventDefault()},[e,l.length,d,r.direction,a,c,g]),h=s.useCallback((b,p)=>{if(!e.current.getRootDimensions())return;const E=zn(e);if(E===null)return;const{field:_,depth:I}=E,{fields:D,depth:R,maxDepth:L}=b,$=e.current.getViewportPageSize(),H=e.current.getColumnIndex(_),O=_?e.current.getColumnIndex(_):0,M=0,S=l.length-1,x=0,F=Ae(e).length-1;let T=!0;switch(p.key){case"ArrowDown":{R===L-1?a(H,p):u(H,I+1,p);break}case"ArrowUp":{R>0&&u(H,I-1,p);break}case"ArrowRight":{const k=D.length-D.indexOf(_)-1;H+k+1<=F&&u(H+k+1,I,p);break}case"ArrowLeft":{const k=D.indexOf(_);H-k-1>=x&&u(H-k-1,I,p);break}case"PageDown":{S!==null&&c(O,g(Math.min(M+$,S)));break}case"Home":{u(x,I,p);break}case"End":{u(F,I,p);break}case" ":break;default:T=!1}T&&p.preventDefault()},[e,l.length,a,u,c,g]),C=s.useCallback((b,p)=>{if(dn(p))return;const y=e.current.getCellParams(b.id,b.field);if(y.cellMode===ke.Edit||!xn(p.key)||!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:p,cell:y}))return;const _=e.current.getRootDimensions();if(l.length===0||!_)return;const I=r.direction,D=e.current.getViewportPageSize(),R=b.field?e.current.getColumnIndex(b.field):0,L=l.findIndex(x=>x.id===b.id),$=0,H=l.length-1,O=0,M=Ae(e).length-1;let S=!0;switch(p.key){case"ArrowDown":{L<H&&c(R,g(L+1));break}case"ArrowUp":{L>$?c(R,g(L-1)):i?d(R,p):a(R,p);break}case"ArrowRight":{const x=Co({currentColIndex:R,firstColIndex:O,lastColIndex:M,direction:I});x!==null&&c(x,g(L),I==="rtl"?"left":"right");break}case"ArrowLeft":{const x=mo({currentColIndex:R,firstColIndex:O,lastColIndex:M,direction:I});x!==null&&c(x,g(L),I==="rtl"?"right":"left");break}case"Tab":{p.shiftKey&&R>
26O?c(R-1,g(L),"left"):!p.shiftKey&&R<M&&c(R+1,g(L),"right");break}case" ":{if(b.field===or)break;const F=b.colDef;if(F&&F.type==="treeDataGroup")break;!p.shiftKey&&L<H&&c(R,g(Math.min(L+D,H)));break}case"PageDown":{L<H&&c(R,g(Math.min(L+D,H)));break}case"PageUp":{const x=Math.max(L-D,$);x!==L&&x>=$?c(R,g(x)):a(R,p);break}case"Home":{p.ctrlKey||p.metaKey||p.shiftKey?c(O,g($)):c(O,g(L));break}case"End":{p.ctrlKey||p.metaKey||p.shiftKey?c(M,g(H)):c(M,g(L));break}default:S=!1}S&&p.preventDefault()},[e,l,r.direction,c,g,i,d,a]),v=s.useCallback((b,{event:p})=>p.key===" "?!1:b,[]);Ie(e,"canStartEditing",v),Q(e,"columnHeaderKeyDown",f),Q(e,"headerFilterKeyDown",m),Q(e,"columnGroupHeaderKeyDown",h),Q(e,"cellKeyDown",C)},bh=(e,t)=>{var n,o;return w({},e,{preferencePanel:(n=(o=t.initialState)==null?void 0:o.preferencePanel)!=null?n:{open:!1}})},vh=(e,t)=>{var n;const o=je(e,"useGridPreferencesPanel"),r=s.useRef(),l=s.useRef(),i=s.useCallback(()=>{o.debug("Hiding Preferences Panel");const f=Pn(e.current.state);f.openedPanelValue&&e.current.publishEvent("preferencePanelClose",{openedPanelValue:f.openedPanelValue}),e.current.setState(m=>w({},m,{preferencePanel:{open:!1}})),e.current.forceUpdate()},[e,o]),c=s.useCallback(()=>{l.current=setTimeout(()=>clearTimeout(r.current),0)},[]),a=s.useCallback(()=>{r.current=setTimeout(i,100)},[i]),d=s.useCallback((f,m,h)=>{o.debug("Opening Preferences Panel"),c(),e.current.setState(C=>w({},C,{preferencePanel:w({},C.preferencePanel,{open:!0,openedPanelValue:f,panelId:m,labelId:h})})),e.current.publishEvent("preferencePanelOpen",{openedPanelValue:f}),e.current.forceUpdate()},[o,c,e]);ge(e,{showPreferences:d,hidePreferences:a},"public");const u=s.useCallback((f,m)=>{var h;const C=Pn(e.current.state);return!m.exportOnlyDirtyModels||((h=t.initialState)==null?void 0:h.preferencePanel)!=null||C.open?w({},f,{preferencePanel:C}):f},[e,(n=t.initialState)==null?void 0:n.preferencePanel]),g=s.useCallback((f,m)=>{const h=m.stateToRestore.preferencePanel;return h!=null&&e.current.setState(C=>w({},C,{preferencePanel:h})),f},[e]);Ie(e,"exportState",u),Ie(e,"restoreState",g),s.useEffect(()=>()=>{clearTimeout(r.current),clearTimeout(l.current)},[])},xh=["id","field"],Sh=["id","field"],Ph=bt(["MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.","To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.","For more detail, see http://mui.com/components/data-grid/editing/#server-side-persistence."],"error"),yh=(e,t)=>{const[n,o]=s.useState({}),r=s.useRef(n),l=s.useRef({}),{processRowUpdate:i,onProcessRowUpdateError:c,cellModesModel:a,onCellModesModelChange:d}=t,u=S=>(...x)=>{t.editMode===wt.Cell&&S(...x)},g=s.useCallback((S,x)=>{const F=e.current.getCellParams(S,x);if(!e.current.isCellEditable(F))throw new Error(`MUI: The cell with id=${S} and field=${x} is not editable.`)},[e]),f=s.useCallback((S,x,F)=>{if(e.current.getCellMode(S,x)!==F)throw new Error(`MUI: The cell with id=${S} and field=${x} is not in ${F} mode.`)},[e]),m=s.useCallback((S,x)=>{if(!S.isEditable||S.cellMode===ke.Edit)return;const F=w({},S,{reason:vt.cellDoubleClick});e.current.publishEvent("cellEditStart",F,x)},[e]),h=s.useCallback((S,x)=>{if(S.cellMode===ke.View||e.current.getCellMode(S.id,S.field)===ke.View)return;const F=w({},S,{reason:ct.cellFocusOut});e.current.publishEvent("cellEditStop",F,x)},[e]),C=s.useCallback((S,x)=>{if(S.cellMode===ke.Edit){if(x.which===229)return;let F;if(x.key==="Escape"?F=ct.escapeKeyDown:x.key==="Enter"?F=ct.enterKeyDown:x.key==="Tab"&&(F=x.shiftKey?ct.shiftTabKeyDown:ct.tabKeyDown,x.preventDefault()),F){const T=w({},S,{reason:F});e.current.publishEvent("cellEditStop",T,x)}}else if(S.isEditable){let F;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:x,cellParams:S,editMode:"cell"}))return;if(Yl(x)?F=vt.printableKeyDown:(x.ctrlKey||x.metaKey)&&x.key==="v"?F=vt.pasteKeyDown:x.key==="Enter"?F=vt.enterKeyDown:(x.key==="Delete"||x.key==="Backspace")&&(F=vt.deleteKeyDown),F){const k=w({},S,{reason:F,key:x.key});e.current.publishEvent("cellEditStart",k,x)}}},[e]),v=s.useCallback(S=>{const{id:x,field:F,reason:T}=S,k={id:x,field:F};(T===vt.printableKeyDown||T===vt.deleteKeyDown||T===vt.pasteKeyDown)&&(k.deleteValue=!0),e.current.startCellEditMode(k)},[e]),b=s.useCallback(S=>{const{id:x,field:F,reason:T}=S;e.current.runPendingEditCellValueMutation(x,F);let k;T===ct.enterKeyDown?k="below":T===ct.tabKeyDown?k="right":T===ct.shiftTabKeyDown&&(k="left");const G=T==="escapeKeyDown";e.current.stopCellEditMode({id:x,field:F,ignoreModifications:G,cellToFocusAfter:k})},[e]);Q(e,"cellDoubleClick",u(m)),Q(e,"cellFocusOut",u(h)),Q(e,"cellKeyDown",u(C)),Q(e,"cellEditStart",u(v)),Q(e,"cellEditStop",u(b)),Me(e,"cellEditStart",t.onCellEditStart),Me(e,"cellEditStop",t.onCellEditStop);const p=s.useCallback((S,x)=>{const F=Ne(e.current.state);return F[S]&&F[S][x]?ke.Edit:ke.View},[e]),y=Ge(S=>{const x=S!==t.cellModesModel;d&&x&&d(S,{}),!(t.cellModesModel&&x)&&(o(S),r.current=S,e.current.publishEvent("cellModesModelChange",S))}),E=s.useCallback((S,x,F)=>{const T=w({},r.current);if(F!==null)T[S]=w({},T[S],{[x]:w({},F)});
26else{const k=T[S],G=te(k,[x].map(In));T[S]=G,Object.keys(T[S]).length===0&&delete T[S]}y(T)},[y]),_=s.useCallback((S,x,F)=>{e.current.setState(T=>{const k=w({},T.editRows);return F!==null?k[S]=w({},k[S],{[x]:w({},F)}):(delete k[S][x],Object.keys(k[S]).length===0&&delete k[S]),w({},T,{editRows:k})}),e.current.forceUpdate()},[e]),I=s.useCallback(S=>{const{id:x,field:F}=S,T=te(S,xh);g(x,F),f(x,F,ke.View),E(x,F,w({mode:ke.Edit},T))},[g,f,E]),D=Ge(S=>{const{id:x,field:F,deleteValue:T,initialValue:k}=S;let G=e.current.getCellValue(x,F);(T||k)&&(G=T?"":k),_(x,F,{value:G,error:!1,isProcessingProps:!1}),e.current.setCellFocus(x,F)}),R=s.useCallback(S=>{const{id:x,field:F}=S,T=te(S,Sh);f(x,F,ke.Edit),E(x,F,w({mode:ke.View},T))},[f,E]),L=Ge(async S=>{const{id:x,field:F,ignoreModifications:T,cellToFocusAfter:k="none"}=S;f(x,F,ke.Edit),e.current.runPendingEditCellValueMutation(x,F);const G=()=>{_(x,F,null),E(x,F,null),k!=="none"&&e.current.moveFocusToRelativeCell(x,F,k)};if(T){G();return}const z=Ne(e.current.state),{error:N,isProcessingProps:j}=z[x][F];if(N||j){l.current[x][F].mode=ke.Edit,E(x,F,{mode:ke.Edit});return}const B=e.current.getRowWithUpdatedValuesFromCellEditing(x,F);if(i){const Z=W=>{l.current[x][F].mode=ke.Edit,E(x,F,{mode:ke.Edit}),c?c(W):Ph()};try{const W=e.current.getRow(x);Promise.resolve(i(B,W)).then(ee=>{e.current.updateRows([ee]),G()}).catch(Z)}catch(W){Z(W)}}else e.current.updateRows([B]),G()}),$=s.useCallback(async S=>{var x;const{id:F,field:T,value:k,debounceMs:G,unstable_skipValueParser:z}=S;g(F,T),f(F,T,ke.Edit);const N=e.current.getColumn(T),j=e.current.getRow(F);let B=k;N.valueParser&&!z&&(B=N.valueParser(k,e.current.getCellParams(F,T)));let Z=Ne(e.current.state),W=w({},Z[F][T],{value:B,changeReason:G?"debouncedSetEditCellValue":"setEditCellValue"});if(N.preProcessEditCellProps){const ee=k!==Z[F][T].value;W=w({},W,{isProcessingProps:!0}),_(F,T,W),W=await Promise.resolve(N.preProcessEditCellProps({id:F,row:j,props:W,hasChanged:ee}))}return e.current.getCellMode(F,T)===ke.View?!1:(Z=Ne(e.current.state),W=w({},W,{isProcessingProps:!1}),W.value=N.preProcessEditCellProps?Z[F][T].value:B,_(F,T,W),Z=Ne(e.current.state),!((x=Z[F])!=null&&(x=x[T])!=null&&x.error))},[e,g,f,_]),H=s.useCallback((S,x)=>{const F=e.current.getColumn(x),T=Ne(e.current.state),k=e.current.getRow(S);if(!T[S]||!T[S][x])return e.current.getRow(S);const{value:G}=T[S][x];return F.valueSetter?F.valueSetter({value:G,row:k}):w({},k,{[x]:G})},[e]),O={getCellMode:p,startCellEditMode:I,stopCellEditMode:R},M={setCellEditingEditCellValue:$,getRowWithUpdatedValuesFromCellEditing:H};ge(e,O,"public"),ge(e,M,"private"),s.useEffect(()=>{a&&y(a)},[a,y]),We(()=>{const S=An(e),x=l.current;l.current=ns(n),Object.entries(n).forEach(([F,T])=>{Object.entries(T).forEach(([k,G])=>{var z,N;const j=((z=x[F])==null||(z=z[k])==null?void 0:z.mode)||ke.View,B=(N=S[F])!=null?N:F;G.mode===ke.Edit&&j===ke.View?D(w({id:B,field:k},G)):G.mode===ke.View&&j===ke.Edit&&L(w({id:B,field:k},G))})})},[e,n,D,L])},Ih=["id"],Mh=["id"],Fh=bt(["MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.","To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.","For more detail, see http://mui.com/components/data-grid/editing/#server-side-persistence."],"error"),kh=(e,t)=>{const[n,o]=s.useState({}),r=s.useRef(n),l=s.useRef({}),i=s.useRef(null),c=s.useRef(null),{processRowUpdate:a,onProcessRowUpdateError:d,rowModesModel:u,onRowModesModelChange:g}=t,f=k=>(...G)=>{t.editMode===wt.Row&&k(...G)},m=s.useCallback((k,G)=>{const z=e.current.getCellParams(k,G);if(!e.current.isCellEditable(z))throw new Error(`MUI: The cell with id=${k} and field=${G} is not editable.`)},[e]),h=s.useCallback((k,G)=>{if(e.current.getRowMode(k)!==G)throw new Error(`MUI: The row with id=${k} is not in ${G} mode.`)},[e]),C=s.useCallback((k,G)=>{if(!k.isEditable||e.current.getRowMode(k.id)===Te.Edit)return;const z=e.current.getRowParams(k.id),N=w({},z,{field:k.field,reason:Dt.cellDoubleClick});e.current.publishEvent("rowEditStart",N,G)},[e]),v=s.useCallback(k=>{c.current=k},[]),b=s.useCallback((k,G)=>
26{k.isEditable&&e.current.getRowMode(k.id)!==Te.View&&(c.current=null,i.current=setTimeout(()=>{var z;if(i.current=null,((z=c.current)==null?void 0:z.id)!==k.id){if(!e.current.getRow(k.id)||e.current.getRowMode(k.id)===Te.View)return;const N=e.current.getRowParams(k.id),j=w({},N,{field:k.field,reason:xt.rowFocusOut});e.current.publishEvent("rowEditStop",j,G)}}))},[e]);s.useEffect(()=>()=>{clearTimeout(i.current)},[]);const p=s.useCallback((k,G)=>{if(k.cellMode===Te.Edit){if(G.which===229)return;let z;if(G.key==="Escape")z=xt.escapeKeyDown;else if(G.key==="Enter")z=xt.enterKeyDown;else if(G.key==="Tab"){const N=Lt(e).filter(j=>e.current.getColumn(j).type===io?!0:e.current.isCellEditable(e.current.getCellParams(k.id,j)));if(G.shiftKey?k.field===N[0]&&(z=xt.shiftTabKeyDown):k.field===N[N.length-1]&&(z=xt.tabKeyDown),G.preventDefault(),!z){const j=N.findIndex(Z=>Z===k.field),B=N[G.shiftKey?j-1:j+1];e.current.setCellFocus(k.id,B)}}if(z){const N=w({},e.current.getRowParams(k.id),{reason:z,field:k.field});e.current.publishEvent("rowEditStop",N,G)}}else if(k.isEditable){let z;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:G,cellParams:k,editMode:"row"}))return;if(Yl(G)||(G.ctrlKey||G.metaKey)&&G.key==="v"?z=Dt.printableKeyDown:G.key==="Enter"?z=Dt.enterKeyDown:(G.key==="Delete"||G.key==="Backspace")&&(z=Dt.deleteKeyDown),z){const j=e.current.getRowParams(k.id),B=w({},j,{field:k.field,reason:z});e.current.publishEvent("rowEditStart",B,G)}}},[e]),y=s.useCallback(k=>{const{id:G,field:z,reason:N}=k,j={id:G,fieldToFocus:z};(N===Dt.printableKeyDown||N===Dt.deleteKeyDown)&&(j.deleteValue=!!z),e.current.startRowEditMode(j)},[e]),E=s.useCallback(k=>{const{id:G,reason:z,field:N}=k;e.current.runPendingEditCellValueMutation(G);let j;z===xt.enterKeyDown?j="below":z===xt.tabKeyDown?j="right":z===xt.shiftTabKeyDown&&(j="left");const B=z==="escapeKeyDown";e.current.stopRowEditMode({id:G,ignoreModifications:B,field:N,cellToFocusAfter:j})},[e]);Q(e,"cellDoubleClick",f(C)),Q(e,"cellFocusIn",f(v)),Q(e,"cellFocusOut",f(b)),Q(e,"cellKeyDown",f(p)),Q(e,"rowEditStart",f(y)),Q(e,"rowEditStop",f(E)),Me(e,"rowEditStart",t.onRowEditStart),Me(e,"rowEditStop",t.onRowEditStop);const _=s.useCallback(k=>{if(t.editMode===wt.Cell)return Te.View;const G=Ne(e.current.state);return G[k]&&Object.keys(G[k]).length>0?Te.Edit:Te.View},[e,t.editMode]),I=Ge(k=>{const G=k!==t.rowModesModel;g&&G&&g(k,{}),!(t.rowModesModel&&G)&&(o(k),r.current=k,e.current.publishEvent("rowModesModelChange",k))}),D=s.useCallback((k,G)=>{const z=w({},r.current);G!==null?z[k]=w({},G):delete z[k],I(z)},[I]),R=s.useCallback((k,G)=>{e.current.setState(z=>{const N=w({},z.editRows);return G!==null?N[k]=G:delete N[k],w({},z,{editRows:N})}),e.current.forceUpdate()},[e]),L=s.useCallback((k,G,z)=>{e.current.setState(N=>{const j=w({},N.editRows);return z!==null?j[k]=w({},j[k],{[G]:w({},z)}):(delete j[k][G],Object.keys(j[k]).length===0&&delete j[k]),w({},N,{editRows:j})}),e.current.forceUpdate()},[e]),$=s.useCallback(k=>{const{id:G}=k,z=te(k,Ih);h(G,Te.View),D(G,w({mode:Te.Edit},z))},[h,D]),H=Ge(k=>{const{id:G,fieldToFocus:z,deleteValue:N,initialValue:j}=k,Z=at(e).reduce((W,ee)=>{if(!e.current.getCellParams(G,ee).isEditable)return W;let ce=e.current.getCellValue(G,ee);return z===ee&&(N||j)&&(ce=N?"":j),W[ee]={value:ce,error:!1,isProcessingProps:!1},W},{});R(G,Z),z&&e.current.setCellFocus(G,z)}),O=s.useCallback(k=>{const{id:G}=k,z=te(k,Mh);h(G,Te.Edit),D(G,w({mode:Te.View},z))},[h,D]),M=Ge(k=>{const{id:G,ignoreModifications:z,field:N,cellToFocusAfter:j="none"}=k;e.current.runPendingEditCellValueMutation(G);const B=()=>{j!=="none"&&N&&e.current.moveFocusToRelativeCell(G,N,j),R(G,null),D(G,null)};if(z){B();return}const Z=Ne(e.current.state),W=e.current.getRow(G);if(Object.values(Z[G]).some(we=>we.isProcessingProps)){l.current[G].mode=Te.Edit;return}if(Object.values(Z[G]).some(we=>we.error)){l.current[G].mode=Te.Edit,D(G,{mode:Te.Edit});return}const ce=e.current.getRowWithUpdatedValuesFromRowEditing(G);if(a){const we=ue=>{l.current[G].mode=Te.Edit,D(G,{mode:Te.Edit}),d?d(ue):Fh()};try{Promise.resolve(a(ce,W)).then(ue=>{e.current.updateRows([ue]),B()}).catch(we)}catch(ue){we(ue)}}else e.current.updateRows([ce]),B()}),S=s.useCallback(k=>{const{id:G,field:z,value:N,debounceMs:j,unstable_skipValueParser:B}=k;m(G,z);const Z=e.current.getColumn(z),W=e.current.getRow(G);let ee=N;Z.valueParser&&!B&&(ee=Z.valueParser(N,e.current.getCellParams(G,z)));let K=Ne(e.current.state),ce=w({},K[G][z],{value:ee,changeReason:j?"debouncedSetEditCellValue":"setEditCellValue"});return Z.preProcessEditCellProps||L(G,z,ce),new Promise(we=>{const ue=[];
26if(Z.preProcessEditCellProps){const se=ce.value!==K[G][z].value;ce=w({},ce,{isProcessingProps:!0}),L(G,z,ce);const pe=K[G],be=te(pe,[z].map(In)),ye=Promise.resolve(Z.preProcessEditCellProps({id:G,row:W,props:ce,hasChanged:se,otherFieldsProps:be})).then(Pe=>{if(e.current.getRowMode(G)===Te.View){we(!1);return}K=Ne(e.current.state),Pe=w({},Pe,{isProcessingProps:!1}),Pe.value=Z.preProcessEditCellProps?K[G][z].value:ee,L(G,z,Pe)});ue.push(ye)}Object.entries(K[G]).forEach(([se,pe])=>{if(se===z)return;const be=e.current.getColumn(se);if(!be.preProcessEditCellProps)return;pe=w({},pe,{isProcessingProps:!0}),L(G,se,pe),K=Ne(e.current.state);const ye=K[G],Pe=te(ye,[se].map(In)),Y=Promise.resolve(be.preProcessEditCellProps({id:G,row:W,props:pe,hasChanged:!1,otherFieldsProps:Pe})).then(J=>{if(e.current.getRowMode(G)===Te.View){we(!1);return}J=w({},J,{isProcessingProps:!1}),L(G,se,J)});ue.push(Y)}),Promise.all(ue).then(()=>{e.current.getRowMode(G)===Te.Edit?(K=Ne(e.current.state),we(!K[G][z].error)):we(!1)})})},[e,m,L]),x=s.useCallback(k=>{const G=Ne(e.current.state),z=e.current.getRow(k);if(!G[k])return e.current.getRow(k);let N=w({},z);return Object.entries(G[k]).forEach(([j,B])=>{const Z=e.current.getColumn(j);Z.valueSetter?N=Z.valueSetter({value:B.value,row:N}):N[j]=B.value}),N},[e]),F={getRowMode:_,startRowEditMode:$,stopRowEditMode:O},T={setRowEditingEditCellValue:S,getRowWithUpdatedValuesFromRowEditing:x};ge(e,F,"public"),ge(e,T,"private"),s.useEffect(()=>{u&&I(u)},[u,I]),We(()=>{const k=An(e),G=l.current;l.current=ns(n),Object.entries(n).forEach(([z,N])=>{var j,B;const Z=((j=G[z])==null?void 0:j.mode)||Te.View,W=(B=k[z])!=null?B:z;N.mode===Te.Edit&&Z===Te.View?H(w({id:W}
26,N)):N.mode===Te.View&&Z===Te.Edit&&M(w({id:W},N))})},[e,n,H,M])},Eh=e=>w({},e,{editRows:{}}),Dh=(e,t)=>{yh(e,t),kh(e,t);const n=s.useRef({}),{isCellEditable:o}=t,r=s.useCallback(f=>vn(f.rowNode)||!f.colDef.editable||!f.colDef.renderEditCell?!1:o?o(f):!0,[o]),l=(f,m,h,C)=>{if(!h){C();return}if(n.current[f]||(n.current[f]={}),n.current[f][m]){const[p]=n.current[f][m];clearTimeout(p)}const v=()=>{const[p]=n.current[f][m];clearTimeout(p),C(),delete n.current[f][m]},b=setTimeout(()=>{C(),delete n.current[f][m]},h);n.current[f][m]=[b,v]};s.useEffect(()=>{const f=n.current;return()=>{Object.entries(f).forEach(([m,h])=>{Object.keys(h).forEach(C=>{const[v]=f[m][C];clearTimeout(v),delete f[m][C]})})}},[]);const i=s.useCallback((f,m)=>{if(n.current[f]){if(!m)Object.keys(n.current[f]).forEach(h=>{const[,C]=n.current[f][h];C()});else if(n.current[f][m]){const[,h]=n.current[f][m];h()}}},[]),c=s.useCallback(f=>{const{id:m,field:h,debounceMs:C}=f;return new Promise(v=>{l(m,h,C,async()=>{const b=t.editMode===wt.Row?e.current.setRowEditingEditCellValue:e.current.setCellEditingEditCellValue;if(e.current.getCellMode(m,h)===ke.Edit){const p=await b(f);v(p)}})})},[e,t.editMode]),a=s.useCallback((f,m)=>t.editMode===wt.Cell?e.current.getRowWithUpdatedValuesFromCellEditing(f,m):e.current.getRowWithUpdatedValuesFromRowEditing(f),[e,t.editMode]),d=s.useCallback((f,m)=>{var h,C;return(h=(C=Ne(e.current.state)[f])==null?void 0:C[m])!=null?h:null},[e]),u={isCellEditable:r,setEditCellValue:c,getRowWithUpdatedValues:a,unstable_getEditCellMeta:d},g={runPendingEditCellValueMutation:i};ge(e,u,"public"),ge(e,g,"private")},Rh=(e,t,n)=>(n.current.caches.rows=Gn({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),w({},e,{rows:Ul({apiRef:n,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:null,previousTreeDepths:null})})),Th=(e,t)=>{const n=je(e,"useGridRows"),o=kt(e,t),r=s.useRef(Date.now()),l=Dn(),i=s.useCallback(M=>{const S=It(e)[M];if(S)return S;const x=e.current.getRowNode(M);return x&&vn(x)?{[sn]:M}:null},[e]),c=t.getRowId,a=s.useCallback(M=>sn in M?M[sn]:c?c(M):M.id,[c]),d=s.useMemo(()=>o.rows.reduce((M,{id:S},x)=>(M[S]=x,M),{}),[o.rows]),u=s.useCallback(({cache:M,throttle:S})=>{const x=()=>{r.current=Date.now(),e.current.setState(T=>w({},T,{rows:Ul({apiRef:e,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:nt(e),previousTreeDepths:xr(e)})})),e.current.publishEvent("rowsSet"),e.current.forceUpdate()};if(l.clear(),e.current.caches.rows=M,!S){x();return}const F=t.throttleRowsMs-(Date.now()-r.current);if(F>0){l.start(F,x);return}x()},[t.throttleRowsMs,t.rowCount,t.loading,e,l]),g=s.useCallback(M=>{n.debug(`Updating all rows, new length ${M.length}`);const S=Gn({rows:M,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),x=e.current.caches.rows;S.rowsBeforePartialUpdates=x.rowsBeforePartialUpdates,u({cache:S,throttle:!0})},[n,t.getRowId,t.loading,t.rowCount,u,e]),f=s.useCallback(M=>{if(t.signature===Ct.DataGrid&&M.length>1)throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(` 27`));const S=[];M.forEach(F=>{const T=un(F,t.getRowId,"A row was provided without id when calling updateRows():"),k=e.current.getRowNode(T);if(k?.type==="pinnedRow"){const G=e.current.caches.pinnedRows,z=G.idLookup[T];z&&(G.idLookup[T]=w({},z,F))}else S.push(F)});const x=yc({updates:S,getRowId:t.getRowId,previousCache:e.current.caches.rows});u({cache:x,throttle:!0})},[t.signature,t.getRowId,u,e]),m=s.useCallback(()=>{const M=rn(e),S=It(e);return new Map(M.map(x=>{var F;return[x,(F=S[x])!=null?F:{}]}))},[e]),h=s.useCallback(()=>eo(e),[e]),C=s.useCallback(()=>rn(e),[e]),v=s.useCallback(M=>d[M],[d]),b=s.useCallback((M,S)=>{const x=e.current.getRowNode(M);if(!x)throw new Error(`MUI: No row with id #${M} found`);if(x.type!=="group")throw new Error("MUI: Only group nodes can be expanded or collapsed");const F=w({},x,{childrenExpanded:S});e.current.setState(T=>w({},T,{rows:w({},T.rows,{tree:w({},T.rows.tree,{[M]:F})})})),e.current.forceUpdate(),e.current.publishEvent("rowExpansionChange",F)},[e]),p=s.useCallback(M=>{var S;return(S=nt(e)[M])!=null?S:null},[e]),y=s.useCallback(({skipAutoGeneratedRows:M=!0,groupId:S,applySorting:x,applyFiltering:F})=>{const T=nt(e);let k;if(x){const G=T[S];if(!G)return[];const z=jo(e);k=[];const N=z.findIndex(j=>j===S)+1;for(let j=N;j<z.length&&T[z[j]].depth>
27G.depth;j+=1){const B=z[j];(!M||!vn(T[B]))&&k.push(B)}}else k=ro(T,S,M);if(F){const G=_l(e);k=k.filter(z=>G[z]!==!1)}return k},[e]),E=s.useCallback((M,S)=>{const x=e.current.getRowNode(M);if(!x)throw new Error(`MUI: No row with id #${M} found`);if(x.parent!==Ee)throw new Error("MUI: The row reordering do not support reordering of grouped rows yet");if(x.type!=="leaf")throw new Error("MUI: The row reordering do not support reordering of footer or grouping rows");e.current.setState(F=>{const T=nt(F,e.current.instanceId)[Ee],k=T.children,G=k.findIndex(N=>N===M);if(G===-1||G===S)return F;n.debug(`Moving row ${M} to index ${S}`);const z=[...k];return z.splice(S,0,z.splice(G,1)[0]),w({},F,{rows:w({},F.rows,{tree:w({},F.rows.tree,{[Ee]:w({},T,{children:z})})})})}),e.current.publishEvent("rowsSet")},[e,n]),_=s.useCallback((M,S)=>{if(t.signature===Ct.DataGrid&&S.length>1)throw new Error(["MUI: You can't replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(` 28`));if(S.length===0)return;if(an(e)>1)throw new Error("`apiRef.current.unstable_replaceRows` is not compatible with tree data and row grouping");const F=w({},nt(e)),T=w({},It(e)),k=w({},An(e)),G=F[Ee],z=[...G.children],N=new Set;for(let B=0;B<S.length;B+=1){const Z=S[B],W=un(Z,t.getRowId,"A row was provided without id when calling replaceRows()."),[ee]=z.splice(M+B,1,W);N.has(ee)||(delete T[ee],delete k[ee],delete F[ee]);const K={id:W,depth:0,parent:Ee,type:"leaf",groupingKey:null};T[W]=Z,k[W]=W,F[W]=K,N.add(W)}F[Ee]=w({},G,{children:z});const j=z.filter(B=>F[B].type==="leaf");
28e.current.caches.rows.dataRowIdToModelLookup=T,e.current.caches.rows.dataRowIdToIdLookup=k,e.current.setState(B=>w({},B,{rows:w({},B.rows,{dataRowIdToModelLookup:T,dataRowIdToIdLookup:k,dataRowIds:j,tree:F})})),e.current.publishEvent("rowsSet")},[e,t.signature,t.getRowId]),I={getRow:i,getRowId:a,getRowModels:m,getRowsCount:h,getAllRowIds:C,setRows:g,updateRows:f,getRowNode:p,getRowIndexRelativeToVisibleRows:v,unstable_replaceRows:_},D={setRowIndex:E,setRowChildrenExpansion:b,getRowGroupChildren:y},R=s.useCallback(()=>{n.info("Row grouping pre-processing have changed, regenerating the row tree");let M;e.current.caches.rows.rowsBeforePartialUpdates===t.rows?M=w({},e.current.caches.rows,{updates:{type:"full",rows:rn(e)}}):M=Gn({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),u({cache:M,throttle:!1})},[n,e,t.rows,t.getRowId,t.loading,t.rowCount,u]),L=s.useCallback(M=>{M==="rowTreeCreation"&&R()},[R]),$=s.useCallback(()=>{e.current.getActiveStrategy("rowTree")!==oc(e)&&R()},[e,R]);Q(e,"activeStrategyProcessorChange",L),Q(e,"strategyAvailabilityChange",$);const H=s.useCallback(()=>{e.current.setState(M=>{const S=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:nt(M,e.current.instanceId),treeDepths:xr(M,e.current.instanceId),dataRowIds:rn(M,e.current.instanceId),dataRowIdToModelLo
28okup:It(M,e.current.instanceId),dataRowIdToIdLookup:An(M,e.current.instanceId)});return w({},M,{rows:w({},M.rows,S,{totalTopLevelRowCount:Bl({tree:S.tree,rowCountProp:t.rowCount})})})}),e.current.publishEvent("rowsSet"),e.current.forceUpdate()},[e,t.rowCount]);lr(e,"hydrateRows",H),ge(e,I,"public"),ge(e,D,t.signature===Ct.DataGrid?"private":"public");const O=s.useRef(!0);s.useEffect(()=>{if(O.current){O.current=!1;return}const M=e.current.caches.rows.rowsBeforePartialUpdates===t.rows,S=e.current.caches.rows.loadingPropBeforePartialUpdates===t.loading,x=e.current.caches.rows.rowCountPropBeforePartialUpdates===t.rowCount;if(M){S||(e.current.setState(F=>w({},F,{rows:w({},F.rows,{loading:t.loading})})),e.current.caches.rows.loadingPropBeforePartialUpdates=t.loading,e.current.forceUpdate()),x||(e.current.setState(F=>w({},F,{rows:w({},F.rows,{totalRowCount:Math.max(t.rowCount||0,F.rows.totalRowCount),totalTopLevelRowCount:Math.max(t.rowCount||0,F.rows.totalTopLevelRowCount)})})),e.current.caches.rows.rowCountPropBeforePartialUpdates=t.rowCount,e.current.forceUpdate());return}n.debug(`Updating all rows, new length ${t.rows.length}`),u({cache:Gn({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),throttle:!1})},[t.rows,t.rowCount,t.getRowId,t.loading,n,u,e])},Hh=e=>{const t={[Ee]:w({},Nl(),{children:e})};for(let n=0;n<e.length;n+=1){const o=e[n];t[o]={id:o,depth:0,parent:Ee,type:"leaf",groupingKey:null}}return{groupingName:qt,tree:t,treeDepths:{0:e.length},dataRowIds:e}},Oh=({previousTree:e,actions:t})=>{const n=w({},e),o={};for(let i=0;i<t.remove.length;i+=1){const c=t.remove[i];o[c]=!0,delete n[c]}for(let i=0;i<t.insert.length;i+=1){const c=t.insert[i];n[c]={id:c,depth:0,parent:Ee,type:"leaf",groupingKey:null}}const r=n[Ee];let l=[...r.children,...t.insert];return Object.values(o).length&&(l=l.filter(i=>!o[i])),n[Ee]=w({},r,{children:l}),{groupingName:qt,tree:n,treeDepths:{0:l.length},dataRowIds:l}},$h=e=>e.updates.type==="full"?Hh(e.updates.rows):Oh({previousTree:e.previousTree,actions:e.updates.actions}),Gh=e=>{Ht(e,qt,"rowTreeCreation",$h)},Ls=(e,t)=>e==null||Array.isArray(e)?e:t&&t[0]===e?t:[e],Lh=(e,t)=>{var n;return w({},e,{rowSelection:t.rowSelection?(n=Ls(t.rowSelectionModel))!=null?n:[]:[]})},_h=(e,t)=>{const n=je(e,"useGridSelection"),o=S=>(...x)=>{t.rowSelection&&S(...x)},r=s.useMemo(()=>Ls(t.rowSelectionModel,ot(e.current.state)),[e,t.rowSelectionModel]),l=s.useRef(null);e.current.registerControlState({stateId:"rowSelection",propModel:r,propOnChange:t.onRowSelectionModelChange,stateSelector:ot,changeEvent:"rowSelectionChange"});const{checkboxSelection:i,disableMultipleRowSelection:c,disableRowSelectionOnClick:a,isRowSelectable:d}=t,u=!c||i,g=kt(e,t),f=s.useCallback(S=>{var x;let F=S;const T=(x=l.current)!=null?x:S,k=e.current.isRowSelected(S);if(k){const G=bn(e),z=G.findIndex(j=>j===T),N=G.findIndex(j=>j===F);if(z===N)return;z>N?F=G[N+1]:F=G[N-1]}l.current=S,e.current.selectRowRange({startId:T,endId:F},!k)},[e]),m=s.useCallback(S=>{if(t.signature===Ct.DataGrid&&!t.checkboxSelection&&Array.isArray(S)&&S.length>1)throw new Error(["MUI: `rowSelectionModel` can only contain 1 item in DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection."].join(` 29`));ot(e.current.state)!==S&&(n.debug("Setting selection model"),e.current.setState(F=>w({},F,{rowSelection:t.rowSelection?S:[]})),e.current.forceUpdate())},[e,n,t.rowSelection,t.signature,t.checkboxSelection]),h=s.useCallback(S=>ot(e.current.state).includes(S),[e]),C=s.useCallback(S=>{if(d&&!d(e.current.getRowParams(S)))return!1;const x=e.current.getRowNode(S);return!(x?.type==="footer"||x?.type==="pinnedRow")},[e,d]),v=s.useCallback(()=>Da(e),[e]),b=s.useCallback((S,x=!0,F=!1)=>{if(e.current.isRowSelectable(S))if(l.current=S,F)n.debug(`Setting selection for row ${S}`),e.current.setRowSelectionModel(x?[S]:[]);else{n.debug(`Toggling selection for row ${S}`);const k=ot(e.current.state).filter(z=>z!==S);x&&k.push(S),(k.length<2||u)&&e.current.setRowSelectionModel(k)}},[e,n,u]),p=s.useCallback((S,x=!0,F=!1)=>{n.debug("Setting selection for several rows");const T=S.filter(z=>e.current.isRowSelectable(z));let k;if(F)k=x?T:[];else{const z=w({},Wn(e));T.forEach(N=>{x?z[N]=N:delete z[N]}),k=Object.values(z)}(k.length<2||u)&&e.current.setRowSelectionModel(k)},[e,n,u]),y=s.useCallback(({startId:S,endId:x},F=!0,T=!1)=>
29{if(!e.current.getRow(S)||!e.current.getRow(x))return;n.debug(`Expanding selection from row ${S} to row ${x}`);const k=bn(e),G=k.indexOf(S),z=k.indexOf(x),[N,j]=G>z?[z,G]:[G,z],B=k.slice(N,j+1);e.current.selectRows(B,F,T)},[e,n]),E={selectRow:b,setRowSelectionModel:m,getSelectedRows:v,isRowSelected:h,isRowSelectable:C},_={selectRows:p,selectRowRange:y};ge(e,E,"public"),ge(e,_,t.signature===Ct.DataGrid?"private":"public");const I=s.useCallback(()=>{if(t.keepNonExistentRowsSelected)return;const S=ot(e.current.state),x=It(e),F=w({},Wn(e));let T=!1;S.forEach(k=>{x[k]||(delete F[k],T=!0)}),T&&e.current.setRowSelectionModel(Object.values(F))},[e,t.keepNonExistentRowsSelected]),D=s.useCallback((S,x)=>{const F=x.metaKey||x.ctrlKey,T=!i&&!F&&!du(x),k=!u||T,G=e.current.isRowSelected(S);k?e.current.selectRow(S,T?!0:!G,!0):e.current.selectRow(S,!G,!1)},[e,u,i]),R=s.useCallback((S,x)=>{var F;if(a)return;const T=(F=x.target.closest(`.${V.cell}`))==null?void 0:F.getAttribute("data-field");if(T===fn.field||T===or)return;if(T){const G=e.current.getColumn(T);if(G?.type===io)return}e.current.getRowNode(S.id).type!=="pinnedRow"&&(x.shiftKey&&(u||i)?f(S.id):D(S.id,x))},[a,u,i,e,f,D]),L=s.useCallback((S,x)=>{if(u&&x.shiftKey){var F;(F=window.getSelection())==null||F.removeAllRanges()}},[u]),$=s.useCallback((S,x)=>{x.nativeEvent.shiftKey?f(S.id):e.current.selectRow(S.id,S.value)},[e,f]),H=s.useCallback(S=>{const F=t.checkboxSelectionVisibleOnly&&t.pagination?cs(e):bn(e),T=Ve(e);e.current.selectRows(F,S.value,T?.items.length>0)},[e,t.checkboxSelectionVisibleOnly,t.pagination]),O=s.useCallback((S,x)=>{if(e.current.getCellMode(S.id,S.field)!==ke.Edit&&!dn(x)){if(xn(x.key)&&x.shiftKey){const F=tt(e);if(F&&F.id!==S.id){x.preventDefault();const T=e.current.isRowSelected(F.id);if(!u){e.current.selectRow(F.id,!T,!0);return}const k=e.current.getRowIndexRelativeToVisibleRows(F.id),G=e.current.getRowIndexRelativeToVisibleRows(S.id);let z,N;k>G?T?(z=G,N=k-1):(z=G,N=k):T?(z=k+1,N=G):(z=k,N=G);const j=g.rows.slice(z,N+1).map(B=>B.id);e.current.selectRows(j,!T);return}}if(x.key===" "&&x.shiftKey){x.preventDefault(),D(S.id,x);return}x.key==="a"&&(x.ctrlKey||x.metaKey)&&(x.preventDefault(),p(e.current.getAllRowIds(),!0))}},[e,D,p,g.rows,u]);Q(e,"sortedRowsSet",o(I)),Q(e,"rowClick",o(R)),Q(e,"rowSelectionCheckboxChange",o($)),Q(e,"headerSelectionCheckboxChange",H),Q(e,"cellMouseDown",o(L)),Q(e,"cellKeyDown",o(O)),s.useEffect(()=>{r!==void 0&&e.current.setRowSelectionModel(r)},[e,r,t.rowSelection]),s.useEffect(()=>{t.rowSelection||e.current.setRowSelectionModel([])},[e,t.rowSelection]);const M=r!=null;s.useEffect(()=>{if(M||!t.rowSelection)return;const S=ot(e.current.state);if(C){const x=S.filter(F=>C(F));x.length<S.length&&e.current.setRowSelectionModel(x)}},[e,C,M,t.rowSelection]),s.useEffect(()=>{if(!t.rowSelection||M)return;const S=ot(e.current.state);!u&&S.length>1&&e.current.setRowSelectionModel([])},[e,u,i,M,t.rowSelection])},Vh=e=>{const{classes:t}=e;return s.useMemo(()=>ae({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},de,t),[t])},Ah=(e,t)=>{const n={classes:t.classes},o=Vh(n),r=s.useCallback(l=>{const i=w({},fn,{cellClassName:o.cellCheckbox,headerClassName:o.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),c=t.checkboxSelection,a=l.lookup[St]!=null;return c&&!a?(l.lookup[St]=i,l.orderedFields=[St,...l.orderedFields]):!c&&a?(delete l.lookup[St],l.orderedFields=l.orderedFields.filter(d=>d!==St)):c&&a&&(l.lookup[St]=w({},i,l.lookup[St])),l},[e,o,t.checkboxSelection]);Ie(e,"hydrateColumns",r)},zh=(e,t)=>{var n,o,r;const l=(n=(o=t.sortModel)!=null?o:(r=t.initialState)==null||(r=r.sorting)==null?void 0:r.sortModel)!=null?n:[];return w({},e,{sorting:{sortModel:us(l,t.disableMultipleColumnsSorting),sortedRows:[]}})},jh=(e,t)=>{var n;const o=je(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:Qe,changeEvent:"sortModelChange"});const r=s.useCallback((I,D)=>{const R=Qe(e),L=R.findIndex(H=>H.field===I);let $=[...R];return L>-1?D?$.splice(L,1,D):$.splice(L,1):$=[...R,D],$},[e]),l=s.useCallback((I,D)=>{var R;const $=Qe(e).find(O=>O.field===I.field);if($){var H;const O=D===void 0?Mr((H=I.sortingOrder)!=null?H:t.sortingOrder,$.sort):D;return O==null?void 0:w({},$,{sort:O})}return{field:I.field,sort:D===void 0?Mr((R=I.sortingOrder)!=null?R:t.sortingOrder):D}},[e,t.sortingOrder]),i=s.useCallback((I,D)=>D==null||D.sortable===!1?I:(D.sortingOrder||t.sortingOrder).some(L=>!!L)?[...I,"columnMenuSortItem"]:I,[t.sortingOrder]),c=s.useCallback(()=>{e.current.setState(I=>{if(t.sortingMode==="server")return o.debug("Skipping sorting rows as sortingMode = server"),w({},I,{sorting:w({},I.sorting,{sortedRows:ro(nt(e),Ee,!1)})});const D=Qe(I,e.current.instanceId),R=$a(D,e),L=e.current.applyStrategyProcessor("sorting",{sortRowList:R});return w({},I,{sorting:w({},I.sorting,{sortedRows:L})})}),e.current.publishEvent("sortedRowsSet"),e.current.forceUpdate()},[e,o,t.sortingMode]),a=s.useCallback(I=>{Qe(e)!==I&&(o.debug("Setting sort model"),e.current.setState(Ir(I,t.disableMultipleColumnsSorting)),e.current.forceUpdate(),e.current.applySorting())},[e,o,t.disableMultipleColumnsSorting]),d=s.useCallback((I,D,R)=>
29{if(!I.sortable)return;const L=l(I,D);let $;!R||t.disableMultipleColumnsSorting?$=L?[L]:[]:$=r(I.field,L),e.current.setSortModel($)},[e,r,l,t.disableMultipleColumnsSorting]),u=s.useCallback(()=>Qe(e),[e]),g=s.useCallback(()=>No(e).map(D=>D.model),[e]),f=s.useCallback(()=>jo(e),[e]),m=s.useCallback(I=>e.current.getSortedRowIds()[I],[e]);ge(e,{getSortModel:u,getSortedRows:g,getSortedRowIds:f,getRowIdFromRowIndex:m,setSortModel:a,sortColumn:d,applySorting:c},"public");const C=s.useCallback((I,D)=>{var R;const L=Qe(e);return!D.exportOnlyDirtyModels||t.sortModel!=null||((R=t.initialState)==null||(R=R.sorting)==null?void 0:R.sortModel)!=null||L.length>0?w({},I,{sorting:{sortModel:L}}):I},[e,t.sortModel,(n=t.initialState)==null||(n=n.sorting)==null?void 0:n.sortModel]),v=s.useCallback((I,D)=>{var R;const L=(R=D.stateToRestore.sorting)==null?void 0:R.sortModel;return L==null?I:(e.current.setState(Ir(L,t.disableMultipleColumnsSorting)),w({},I,{callbacks:[...I.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),b=s.useCallback(I=>{const D=nt(e),R=D[Ee],L=I.sortRowList?I.sortRowList(R.children.map($=>D[$])):[...R.children];return R.footerId!=null&&L.push(R.footerId),L},[e]);Ie(e,"exportState",C),Ie(e,"restoreState",v),Ht(e,qt,"sorting",b);const p=s.useCallback(({colDef:I},D)=>{const R=D.shiftKey||D.metaKey||D.ctrlKey;d(I,void 0,R)},[d]),y=s.useCallback(({colDef:I},D)=>{iu(D.key)&&!D.ctrlKey&&!D.metaKey&&d(I,void 0,D.shiftKey)},[d]),E=s.useCallback(()=>{const I=Qe(e),D=Zt(e);if(I.length>0){const R=I.filter(L=>D[L.field]);R.length<I.length&&e.current.setSortModel(R)}},[e]),_=s.useCallback(I=>{I==="sorting"&&e.current.applySorting()},[e]);Ie(e,"columnMenu",i),Q(e,"columnHeaderClick",p),Q(e,"columnHeaderKeyDown",y),Q(e,"rowsSet",e.current.applySorting),Q(e,"columnsChange",E),Q(e,"activeStrategyProcessorChange",_),gn(()=>{e.current.applySorting()}),We(()=>{t.sortModel!==void 0&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])};function Zr(e){const{clientHeight:t,scrollTop:n,offsetHeight:o,offsetTop:r}=e,l=r+o;if(o>t)return r;if(l-t>n)return l-t;if(r<n)return r}const Nh=(e,t)=>{const n=st(),o=je(e,"useGridScroll"),r=e.current.columnHeadersElementRef,l=e.current.virtualScrollerRef,i=q(e,_t),c=s.useCallback(g=>{const f=eo(e),m=Ae(e);if(!(g.rowIndex==null)&&f===0||m.length===0)return!1;o.debug(`Scrolling to cell at row ${g.rowIndex}, col: ${g.colIndex} `);let C={};if(g.colIndex!=null){const y=Ut(e);let E;if(typeof g.rowIndex<"u"){var v;const _=(v=i[g.rowIndex])==null?void 0:v.id,I=e.current.unstable_getCellColSpanInfo(_,g.colIndex);I&&!I.spannedByColSpan&&(E=I.cellProps.width)}typeof E>"u"&&(E=m[g.colIndex].computedWidth),C.left=Zr({clientHeight:l.current.clientWidth,scrollTop:Math.abs(l.current.scrollLeft),offsetHeight:E,offsetTop:y[g.colIndex]})}if(g.rowIndex!=null){var b,p;const y=Kt(e.current.state),E=Ma(e),_=Fa(e),I=t.pagination?g.rowIndex-E*_:g.rowIndex,D=y.positions[I+1]?y.positions[I+1]-y.positions[I]:y.currentPageTotalHeight-y.positions[I],R=((b=l.current.querySelector(`.${V["pinnedRows--top"]}`))==null?void 0:b.clientHeight)||0,L=((p=l.current.querySelector(`.${V["pinnedRows--bottom"]}`))==null?void 0:p.clientHeight)||0;C.top=Zr({clientHeight:l.current.clientHeight-R-L,scrollTop:l.current.scrollTop,offsetHeight:D,offsetTop:y.positions[I]})}return C=e.current.unstable_applyPipeProcessors("scrollToIndexes",C,g),typeof C.left!==void 0||typeof C.top!==void 0?(e.current.scroll(C),!0):!1},[o,e,l,t.pagination,i]),a=s.useCallback(g=>{if(l.current&&g.left!=null&&r.current){const f=n.direction==="rtl"?-1:1;r.current.scrollLeft=g.left,l.current.scrollLeft=f*g.left,o.debug(`Scrolling left: ${g.left}`)}l.current&&g.top!=null&&(l.current.scrollTop=g.top,o.debug(`Scrolling top: ${g.top}`)),o.debug("Scrolling, updating container, and viewport")},[l,n.direction,r,o]),d=s.useCallback(()=>l!=null&&l.current?{top:l.current.scrollTop,left:l.current.scrollLeft}:{top:0,left:0},[l]);ge(e,{scroll:a,scrollToIndexes:c,getScrollPosition:d},"public")};function Bh(e,t){Me(e,"columnHeaderClick",t.onColumnHeaderClick),Me(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),Me(e,"columnHeaderOver",t.onColumnHeaderOver),Me(e,"columnHeaderOut",t.onColumnHeaderOut),Me(e,"columnHeaderEnter",t.onColumnHeaderEnter),Me(e,"columnHeaderLeave",t.onColumnHeaderLeave),Me(e,"cellClick",t.onCellClick),Me(e,"cellDoubleClick",t.onCellDoubleClick),Me(e,"cellKeyDown",t.onCellKeyDown),Me(e,"preferencePanelClose",t.onPreferencePanelClose),Me(e,"preferencePanelOpen",t.onPreferencePanelOpen),Me(e,"menuOpen",t.onMenuOpen),Me(e,"menuClose",t.onMenuClose),Me(e,"rowDoubleClick",t.onRowDoubleClick),Me(e,"rowClick",t.onRowClick),Me(e,"stateChange",t.onStateChange)}const Uh=({content:e,container:t,scrollBarSize:n})=>{const o=e.width>t.width,r=e.height>t.height;let l=!1,i=!1;return(o||r)&&(l=o,i=e.height+(l?n:0)>t.height,i&&(l=e.width+n>t.width)),{hasScrollX:l,hasScrollY:i}};function Wh(e,t){const n=je(e,"useResizeContainer"),o=s.useRef(!1),r=s.useRef(null),l=s.useRef(null),i=q(e,Kt),c=q(e,Xt),a=Math.floor(t.rowHeight*c),d=Hn(e,t.columnHeaderHeight),u=s.useCallback(()=>{var D;const R=(D=e.current.rootElementRef)==null?void 0:D.current,L=kn(e),$=Wo(e);if(!r.current)return;let H;if(t.scrollbarSize!=null)H=t.scrollbarSize;
29else if(!L||!R)H=0;else{const G=Nt(R).createElement("div");G.style.width="99px",G.style.height="99px",G.style.position="absolute",G.style.overflow="scroll",G.className="scrollDiv",R.appendChild(G),H=G.offsetWidth-G.clientWidth,R.removeChild(G)}let O,M,S;if(t.autoHeight)S=!1,M=Math.round(L)>Math.round(r.current.width),O={width:r.current.width,height:i.currentPageTotalHeight+(M?H:0)};else{O={width:r.current.width,height:Math.max(r.current.height-d,0)};const k=Uh({content:{width:Math.round(L),height:i.currentPageTotalHeight},container:{width:Math.round(O.width),height:O.height-$.top-$.bottom},scrollBarSize:H});S=k.hasScrollY,M=k.hasScrollX}const x={width:O.width-(S?H:0),height:O.height-(M?H:0)},F={viewportOuterSize:O,viewportInnerSize:x,hasScrollX:M,hasScrollY:S,scrollBarSize:H},T=l.current;l.current=F,(F.viewportInnerSize.width!==T?.viewportInnerSize.width||F.viewportInnerSize.height!==T?.viewportInnerSize.height)&&e.current.publishEvent("viewportInnerSizeChange",F.viewportInnerSize)},[e,t.scrollbarSize,t.autoHeight,i.currentPageTotalHeight,d]),[g,f]=s.useState(),m=s.useMemo(()=>Pl(f,60),[]),h=s.useRef();We(()=>{g&&(u(),e.current.publishEvent("debouncedResize",r.current))},[e,g,u]);const C=s.useCallback(()=>{e.current.computeSizeAndPublishResizeEvent()},[e]),v=s.useCallback(()=>l.current,[]),b=s.useCallback(()=>{const D=e.current.getRootDimensions();if(!D)return 0;const R=Kn(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(t.getRowHeight){const $=e.current.getRenderContext(),H=$.lastRowIndex-$.firstRowIndex;return Math.min(H-1,R.rows.length)}const L=Math.floor(D.viewportInnerSize.height/a);return Math.min(L,R.rows.length)},[e,t.pagination,t.paginationMode,t.getRowHeight,a]),p=s.useCallback(()=>{var D,R,L;const $=(D=e.current.mainElementRef)==null?void 0:D.current;if(!$)return;const O=mi($).getComputedStyle($),M=parseFloat(O.height)||0,S=parseFloat(O.width)||0,x=M!==((R=h.current)==null?void 0:R.height),F=S!==((L=h.current)==null?void 0:L.width);if(!h.current||x||F){const T={width:S,height:M};e.current.publishEvent("resize",T),h.current=T}},[e]),y={resize:C,getRootDimensions:v},E={getViewportPageSize:b,updateGridDimensionsRef:u,computeSizeAndPublishResizeEvent:p};ge(e,y,"public"),ge(e,E,"private");const _=s.useRef(!0),I=s.useCallback(D=>{r.current=D;const R=/jsdom/.test(window.navigator.userAgent);if(D.height===0&&!o.current&&!t.autoHeight&&!R&&(n.error(["The parent DOM element of the data grid has an empty height.","Please make sure that this element has an intrinsic height.","The grid displays with a height of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(` 30`)),o.current=!0),D.width===0&&!o.current&&!R&&(n.error(["The parent DOM element of the data grid has an empty width.","Please make sure that this element has an intrinsic width.","The grid displays with a width of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(` 31`)),o.current=!0),_.current){f(D),_.current=!1;return}m(D)},[t.autoHeight,m,n]);We(()=>u(),[u]),Me(e,"sortedRowsSet",u),Me(e,"paginationModelChange",u),Me(e,"columnsChange",u),Q(e,"resize",I),Me(e,"debouncedResize",t.onResize)}const Kh=["style"],qh=["style"];function cn(e,t,n=0,o=t.length){if(t.length<=0)return-1;if(n>=o)return n;const r=n+Math.floor((o-n)/2),l=t[r];return e<=l?cn(e,t,n,r):cn(e,t,r+1,o)}function Qh(e,t,n){let o=1;for(;n<t.length&&Math.abs(t[n])<e;)n+=o,o*=2;return cn(e,t,Math.floor(n/2),Math.min(n,t.length))}const Pt=({firstIndex:e,lastIndex:t,buffer:n,minFirstIndex:o,maxLastIndex:r})=>[Mt(e-n,o,r),Mt(t+n,o,r)],_s=(e,t)=>e===t?!0:e.firstRowIndex===t.firstRowIndex&&e.lastRowIndex===t.lastRowIndex&&e.firstColumnIndex===t.firstColumnIndex&&e.lastColumnIndex===t.lastColumnIndex,Zh={maxSize:3},Yh=e=>{var t,n;const o=dt(),r=ne(),l=q(o,Ae),i=q(o,Aa),c=q(o,tr),{ref:a,onRenderZonePositioning:d,renderZoneMinColumnIndex:u=0,renderZoneMaxColumnIndex:g=l.length,getRowProps:f}=e,m=st(),h=q(o,Ut),C=q(o,kn),v=q(o,tt),b=q(o,jn),p=q(o,Kt),y=q(o,Wn),E=kt(o,r),_=s.useRef(null),I=s.useRef(null),D=Ft(a,I),[R,L]=s.useState(null),$=s.useRef(R),H=s.useRef({top:0,left:0}),[O,M]=s.useState({width:null,height:null}),S=s.useRef(C),[x,F]=s.useState(null),T=s.useRef(Object.create(null)),k=s.useRef(),G=s.useRef(),z=s.useRef(Xn((Y,J,ie,me,Ce,ve)=>{let le;const X=Y.slice(J,ie);return ve>-1&&(J>ve&&ve>=me||ie<ve&&ve<Ce)&&(le=ve),{focusedCellColumnIndexNotInRange:le,renderedColumns:X}},Zh)),N=s.useMemo(()=>v!==null?l.findIndex(Y=>Y.field===v.field):-1,[v,l]),j=s.useCallback(Y=>{var J,ie;const me=o.current.getLastMeasuredRowIndex();let Ce=me===1/0;(J=E.range)!=null&&J.lastRowIndex&&!Ce&&(Ce=me>=E.range.lastRowIndex);const ve=Mt(me-(((ie=E.range)==null?void 0:ie.firstRowIndex)||0),0,p.positions.length);return Ce||p.positions[ve]>=Y?cn(Y,p.positions):Qh(Y,p.positions,ve)},[o,(t=E.range)==null?void 0:t.firstRowIndex,(n=E.range)==null?void 0:n.lastRowIndex,p.positions]),B=s.useCallback(()=>
31{if(!i)return{firstRowIndex:0,lastRowIndex:E.rows.length,firstColumnIndex:0,lastColumnIndex:l.length};const{top:Y,left:J}=H.current,ie=Math.min(j(Y),p.positions.length-1),me=r.autoHeight?ie+E.rows.length:j(Y+O.height);let Ce=0,ve=h.length;if(c){let le=!1;const[X,oe]=Pt({firstIndex:ie,lastIndex:me,minFirstIndex:0,maxLastIndex:E.rows.length,buffer:r.rowBuffer});for(let re=X;re<oe&&!le;re+=1){const xe=E.rows[re];le=o.current.rowHasAutoHeight(xe.id)}le||(Ce=cn(Math.abs(J),h),ve=cn(Math.abs(J)+O.width,h))}return{firstRowIndex:ie,lastRowIndex:me,firstColumnIndex:Ce,lastColumnIndex:ve}},[i,c,j,p.positions.length,r.autoHeight,r.rowBuffer,E.rows,h,l.length,o,O]);We(()=>{i?(I.current.scrollLeft=0,I.current.scrollTop=0):_.current.style.transform="translate3d(0px, 0px, 0px)"},[i]),We(()=>{M({width:I.current.clientWidth,height:I.current.clientHeight})},[p.currentPageTotalHeight]);const Z=s.useCallback(()=>{I.current&&M({width:I.current.clientWidth,height:I.current.clientHeight})},[]);Q(o,"debouncedResize",Z);const W=s.useCallback(Y=>{const[J,ie]=Pt({firstIndex:Y.firstRowIndex,lastIndex:Y.lastRowIndex,minFirstIndex:0,maxLastIndex:E.rows.length,buffer:r.rowBuffer}),[me]=Pt({firstIndex:Y.firstColumnIndex,lastIndex:Y.lastColumnIndex,minFirstIndex:u,maxLastIndex:g,buffer:r.columnBuffer}),Ce=Do({firstColumnToRender:me,apiRef:o,firstRowToRender:J,lastRowToRender:ie,visibleRows:E.rows}),ve=m.direction==="ltr"?1:-1,le=Kt(o.current.state).positions[J],X=ve*Ut(o)[Ce];_.current.style.transform=`translate3d(${X}px, ${le}px, 0px)`,typeof d=="function"&&d({top:le,left:X})},[o,E.rows,d,u,g,r.columnBuffer,r.rowBuffer,m.direction]),ee=s.useCallback(()=>$.current,[]),K=s.useCallback(Y=>{if($.current&&_s(Y,$.current)){W(Y);return}L(Y),W(Y);const[J,ie]=Pt({firstIndex:Y.firstRowIndex,lastIndex:Y.lastRowIndex,minFirstIndex:0,maxLastIndex:E.rows.length,buffer:r.rowBuffer});o.current.publishEvent("renderedRowsIntervalChange",{firstRowToRender:J,lastRowToRender:ie}),$.current=Y},[o,L,$,E.rows.length,r.rowBuffer,W]);We(()=>{if(O.width==null)return;const Y=B();K(Y);const{top:J,left:ie}=H.current,me={top:J,left:ie,renderContext:Y};o.current.publishEvent("scrollPositionChange",me)},[o,B,O.width,K]);const ce=Ge(Y=>{const{scrollTop:J,scrollLeft:ie}=Y.currentTarget;if(H.current.top=J,H.current.left=ie,!$.current||J<0||m.direction==="ltr"&&ie<0||m.direction==="rtl"&&ie>0)return;const me=i?B():$.current,Ce=Math.abs(me.firstRowIndex-$.current.firstRowIndex),ve=Math.abs(me.lastRowIndex-$.current.lastRowIndex),le=Math.abs(me.firstColumnIndex-$.current.firstColumnIndex),X=Math.abs(me.lastColumnIndex-$.current.lastColumnIndex),oe=Ce>=r.rowThreshold||ve>=r.rowThreshold||le>=r.columnThreshold||X>=r.columnThreshold||S.current!==C;o.current.publishEvent("scrollPositionChange",{top:J,left:ie,renderContext:oe?me:$.current},Y),oe&&(Dl.flushSync(()=>{K(me)}),S.current=C)}),we=Ge(Y=>{o.current.publishEvent("virtualScrollerWheel",{},Y)}),ue=Ge(Y=>{o.current.publishEvent("virtualScrollerTouchMove",{},Y)}),se=s.useMemo(()=>v!==null?E.rows.findIndex(Y=>Y.id===v.id):-1,[v,E.rows]);Q(o,"rowMouseOver",(Y,J)=>{var ie;J.currentTarget.contains(J.relatedTarget)||F((ie=Y.id)!=null?ie:null)}),Q(o,"rowMouseOut",(Y,J)=>{J.currentTarget.contains(J.relatedTarget)||F(null)});const pe=(Y={renderContext:R})=>{var J;const{onRowRender:ie,renderContext:me,minFirstColumn:Ce=u,maxLastColumn:ve=g,availableSpace:le=O.width,rowIndexOffset:X=0,position:oe="center"}=Y;if(!me||le==null)return null;const re=i?r.rowBuffer:0,xe=i?r.columnBuffer:0,[Oe,Je]=Pt({firstIndex:me.firstRowIndex,lastIndex:me.lastRowIndex,minFirstIndex:0,maxLastIndex:E.rows.length,buffer:re}),et=[];if(Y.rows)Y.rows.forEach(Ue=>{et.push(Ue),o.current.calculateColSpan({rowId:Ue.id,minFirstColumn:Ce,maxLastColumn:ve,columns:l})});else{if(!E.range)return null;for(let Ue=Oe;Ue<Je;Ue+=1){const Le=E.rows[Ue];et.push(Le),o.current.calculateColSpan({rowId:Le.id,minFirstColumn:Ce,maxLastColumn:ve,columns:l})}}let Vt=!1;if(se>-1){const Ue=E.rows[se];(Oe>se||Je<se)&&(Vt=!0,se>Oe?et.push(Ue):et.unshift(Ue),o.current.calculateColSpan({rowId:Ue.id,minFirstColumn:Ce,maxLastColumn:ve,columns:l}))}const[uo,Ke]=Pt({firstIndex:me.firstColumnIndex,lastIndex:me.lastColumnIndex,minFirstIndex:Ce,maxLastIndex:ve,buffer:xe}),Be=Do({firstColumnToRender:uo,apiRef:o,firstRowToRender:Oe,lastRowToRender:Je,visibleRows:E.rows});let At=!1;(Be>N||Ke<N)&&(At=!0);const{focusedCellColumnIndexNotInRange:zt,renderedColumns:On}
31=z.current(l,Be,Ke,Ce,ve,At?N:-1),$n=((J=r.slotProps)==null?void 0:J.row)||{},{style:hn}=$n,li=te($n,Kh);(k.current!==f||G.current!==hn)&&(T.current=Object.create(null));const ur=[];let ar=!1;for(let Ue=0;Ue<et.length;Ue+=1){var dr;const{id:Le,model:gr}=et[Ue],si=Vt&&v.id===Le,ii=Vt?Oe+Ue===E.rows.length:Oe+Ue===E.rows.length-1,ci=o.current.rowHasAutoHeight(Le)?"auto":o.current.unstable_getRowHeight(Le);let ao;y[Le]==null?ao=!1:ao=o.current.isRowSelectable(Le),ie&&ie(Le);const fr=v!==null&&v.id===Le?v.field:null,hr=zt!==void 0&&l[zt],ui=hr&&fr?[hr,...On]:On;let mr=null;b!==null&&b.id===Le&&(mr=o.current.getCellParams(Le,b.field).cellMode==="view"?b.field:null);const Cr=typeof f=="function"&&f(Le,gr)||{},{style:ai}=Cr,di=te(Cr,qh);if(!T.current[Le]){const pr=w({},ai,hn);T.current[Le]=pr}let go=X+((E==null||(dr=E.range)==null?void 0:dr.firstRowIndex)||0)+Oe+Ue;Vt&&v?.id===Le?(go=se,ar=!0):ar&&(go-=1),ur.push(P.jsx(r.slots.row,w({row:gr,rowId:Le,focusedCellColumnIndexNotInRange:zt,isNotVisible:si,rowHeight:ci,focusedCell:fr,tabbableCell:mr,renderedColumns:ui,visibleColumns:l,firstColumnToRender:Be,lastColumnToRender:Ke,selected:ao,index:go,containerWidth:le,isLastVisible:ii,position:oe},di,li,{hovered:x===Le,style:T.current[Le]}),Le))}return k.current=f,G.current=hn,ur},be=O.width&&C>=O.width,ye=s.useMemo(()=>{const Y=Math.max(p.currentPageTotalHeight,1);let J=!1;I!=null&&I.current&&Y<=I?.current.clientHeight&&(J=!0);const ie={width:be?C:"auto",height:Y,minHeight:J?"100%":"auto"};return r.autoHeight&&E.rows.length===0&&(ie.height=Wl(o,r.rowHeight)),ie},[o,I,C,p.currentPageTotalHeight,be,r.autoHeight,r.rowHeight,E.rows.length]);s.useEffect(()=>{o.current.publishEvent("virtualScrollerContentSizeChange")},[o,ye]);const Pe=s.useMemo(()=>{const Y={};return be||(Y.overflowX="hidden"),r.autoHeight&&(Y.overflowY="hidden"),Y},[be,r.autoHeight]);return o.current.register("private",{getRenderContext:ee}),{renderContext:R,updateRenderZonePosition:W,getRows:pe,getRootProps:(Y={})=>w({ref:D,onScroll:ce,onWheel:we,onTouchMove:ue},Y,{style:Y.style?w({},Y.style,Pe):Pe,role:"presentation"}),getContentProps:({style:Y}={})=>({style:Y?w({},Y,ye):ye,role:"presentation"}),getRenderZoneProps:()=>({ref:_,role:"rowgroup"})}},Xh=e=>{const{classes:t,headerAlign:n,isDragging:o,showColumnBorder:r,groupId:l}=e;return ae({root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",o&&"columnHeader--moving",r&&"columnHeader--showColumnBorder",r&&"columnHeader--withRightBorder","withBorderColor",l===null?"columnHeader--emptyGroup":"columnHeader--filledGroup"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]},de,t)};function Jh(e){var t;const{groupId:n,width:o,depth:r,maxDepth:l,fields:i,height:c,colIndex:a,hasFocus:d,tabIndex:u,isLastColumn:g}=e,f=ne(),m=s.useRef(null),h=he(),C=q(h,$l),v=n?C[n]:{},{headerName:b=n??"",description:p="",headerAlign:y=void 0}=v;let E;const _=n&&((t=C[n])==null?void 0:t.renderHeaderGroup),I=s.useMemo(()=>({groupId:n,headerName:b,description:p,depth:r,maxDepth:l,fields:i,colIndex:a,isLastColumn:g}),[n,b,p,r,l,i,a,g]);n&&_&&(E=_(I));const D=f.showColumnVerticalBorder,R=w({},e,{classes:f.classes,showColumnBorder:D,headerAlign:y,depth:r,isDragging:!1}),L=b??n,$=$e(),H=n===null?`empty-group-cell-${$}`:n,O=Xh(R);s.useLayoutEffect(()=>{if(d){const T=m.current.querySelector('[tabindex="0"]')||m.current;T?.focus()}},[h,d]);const M=s.useCallback(F=>T=>{dn(T)||h.current.publishEvent(F,I,T)},[h,I]),S=s.useMemo(()=>({onKeyDown:M("columnGroupHeaderKeyDown"),onFocus:M("columnGroupHeaderFocus"),onBlur:M("columnGroupHeaderBlur")}),[M]),x=typeof v.headerClassName=="function"?v.headerClassName(I):v.headerClassName;return P.jsx(es,w({ref:m,classes:O,columnMenuOpen:!1,colIndex:a,height:c,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:u,isDraggable:!1,headerComponent:E,headerClassName:x,description:p,elementId:H,width:o,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:L,"aria-colspan":i.length,"data-fields":`|-${i.join("-|-")}-|`},S))}const Yr=Re("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(e,t)=>t.columnHeaderRow})(()=>({display:"flex"}));function em(e){return!!e.target}const Vs=e=>{const{innerRef:t,minColumnIndex:n=0,visibleColumns:o,sortColumnLookup:r,filterColumnLookup:l,columnPositions:i,columnHeaderTabIndexState:c,columnGroupHeaderTabIndexState:a,columnHeaderFocus:d,columnGroupHeaderFocus:u,densityFactor:g,headerGroupingMaxDepth:f,columnMenuState:m,columnVisibility:h,columnGroupsHeaderStructure:C,hasOtherElementInTabSequence:v}=e,b=st(),[p,y]=s.useState(""),[E,_]=s.useState(""),I=dt(),D=q(I,tr),R=ne(),L=s.useRef(null),$=Ft(t,L),[H,O]=s.useState(null),M=s.useRef(H),S=s.useRef(0),x=kt(I,R),F=Hn(I,R.columnHeaderHeight),T=Math.floor(R.columnHeaderHeight*g),k=s.useCallback(ue=>{H&&ue&&_s(H,ue)||O(ue)},[H]);s.useEffect(()=>{I.current.columnHeadersContainerElementRef.current.scrollLeft=0},[I]);const G=s.useRef(Xn(Zf,{equalityCheck:(ue,se)=>["firstColumnIndex","minColumnIndex","columnBuffer"].every(pe=>ue[pe]===se[pe])})),z=s.useCallback(ue=>{const[se,pe]=Pt({firstIndex:ue.firstRowIndex,lastIndex:ue.lastRowIndex,minFirstIndex:0,maxLastIndex:x.rows.length,buffer:R.rowBuffer}),be=G.current({firstColumnIndex:ue.firstColumnIndex,minColumnIndex:n,columnBuffer:R.columnBuffer,firstRowToRender:se,lastRowToRender:pe,apiRef:I,visibleRows:x.rows}),ye=b.direction==="ltr"?1:-1,Pe=be>0?S.current-ye*i[be]:S.current;L.current.style.transform=`translate3d(${-Pe}px, 0px, 0px)`},[i,n,R.columnBuffer,I,x.rows,R.rowBuffer,b.direction]);s.useLayoutEffect(()=>{H&&z(H)},[H,z]);const N=s.useCallback(({left:ue,renderContext:se=null},pe)=>{var be,ye;if(!L.current||S.current===ue&&((be=M.current)==null?void 0:be.firstColumnIndex)===se?.firstColumnIndex&&((ye=M.current)==null?void 0:ye.last
31ColumnIndex)===se?.lastColumnIndex)return;S.current=ue;let Pe=!1;se!==M.current||!M.current?(em(pe)?(Dl.flushSync(()=>{k(se)}),Pe=!0):k(se),M.current=se):Pe=!0,se&&Pe&&z(se)},[z,k]),j=s.useCallback(ue=>_(ue.field),[]),B=s.useCallback(()=>_(""),[]),Z=s.useCallback(ue=>y(ue.field),[]),W=s.useCallback(()=>y(""),[]);Q(I,"columnResizeStart",j),Q(I,"columnResizeStop",B),Q(I,"columnHeaderDragStart",Z),Q(I,"columnHeaderDragEnd",W),Q(I,"scrollPositionChange",N);const ee=ue=>{const{renderContext:se=H,minFirstColumn:pe=n,maxLastColumn:be=o.length}=ue||{};if(!se)return null;const[ye,Pe]=Pt({firstIndex:se.firstRowIndex,lastIndex:se.lastRowIndex,minFirstIndex:0,maxLastIndex:x.rows.length,buffer:R.rowBuffer}),Y=D?G.current({firstColumnIndex:se.firstColumnIndex,minColumnIndex:pe,columnBuffer:R.columnBuffer,apiRef:I,firstRowToRender:ye,lastRowToRender:Pe,visibleRows:x.rows}):0,J=D?Math.min(se.lastColumnIndex+R.columnBuffer,be):be;return{renderedColumns:o.slice(Y,J),firstColumnToRender:Y,lastColumnToRender:J,minFirstColumn:pe,maxLastColumn:be}},K=(ue,se={})=>{const pe=ee(ue);if(pe==null)return null;const{renderedColumns:be,firstColumnToRender:ye}=pe,Pe=[];for(let Y=0;Y<be.length;Y+=1){const J=be[Y],ie=ye+Y,me=ie===0,Ce=c!==null&&c.field===J.field||me&&!v?0:-1,ve=d!==null&&d.field===J.field,le=m.open&&m.field===J.field;Pe.push(P.jsx(ga,w({},r[J.field],{columnMenuOpen:le,filterItemsCounter:l[J.field]&&l[J.field].length,headerHeight:T,isDragging:J.field===p,colDef:J,colIndex:ie,isResizing:E===J.field,hasFocus:ve,tabIndex:Ce},se),J.field))}return P.jsx(Yr,{role:"row","aria-rowindex":f+1,ownerState:R,children:Pe})},ce=ue=>{if(f===0)return null;const se=ee(ue);if(se==null||se.renderedColumns.length===0)return null;const{firstColumnToRender:pe,lastColumnToRender:be}=se,ye=[],Pe=[];for(let ie=0;ie<f;ie+=1){var Y,J;const me=C[ie],Ce=o[pe].field,ve=(Y=I.current.unstable_getColumnGroupPath(Ce)[ie])!=null?Y:null,le=me.findIndex(({groupId:Ke,columnFields:Be})=>Ke===ve&&Be.includes(Ce)),X=o[be-1].field,oe=(J=I.current.unstable_getColumnGroupPath(X)[ie])!=null?J:null,re=me.findIndex(({groupId:Ke,columnFields:Be})=>Ke===oe&&Be.includes(X)),xe=me.slice(le,re+1).map(Ke=>w({},Ke,{columnFields:Ke.columnFields.filter(Be=>h[Be]!==!1)})).filter(Ke=>Ke.columnFields.length>0),Oe=xe[0].columnFields.indexOf(Ce),et=xe[0].columnFields.slice(0,Oe).reduce((Ke,Be)=>{var At;const zt=I.current.getColumn(Be);return Ke+((At=zt.computedWidth)!=null?At:0)},0);let Vt=pe;const uo=xe.map(({groupId:Ke,columnFields:Be})=>{const At=u!==null&&u.depth===ie&&Be.includes(u.field),zt=a!==null&&a.depth===ie&&Be.includes(a.field)?0:-1,On={groupId:Ke,width:Be.reduce(($n,hn)=>$n+I.current.getColumn(hn).computedWidth,0),fields:Be,colIndex:Vt,hasFocus:At,tabIndex:zt};return Vt+=Be.length,On});Pe.push({leftOverflow:et,elements:uo})}return Pe.forEach((ie,me)=>{ye.push(P.jsx(Yr,{style:{height:`${T}px`,transform:`translateX(-${ie.leftOverflow}px)`},role:"row","aria-rowindex":me+1,ownerState:R,children:ie.elements.map(({groupId:Ce,width:ve,fields:le,colIndex:X,hasFocus:oe,tabIndex:re},xe)=>P.jsx(Jh,{groupId:Ce,width:ve,fields:le,colIndex:X,depth:me,isLastColumn:X===o.length-le.length,maxDepth:Pe.length,height:T,hasFocus:oe,tabIndex:re},xe))},me))}),ye},we={minHeight:F,maxHeight:F,lineHeight:`${T}px`};return{renderContext:H,getColumnHeaders:K,getColumnsToRender:ee,getColumnGroupHeaders:ce,isDragging:!!p,getRootProps:(ue={})=>w({style:we},ue),getInnerProps:()=>({ref:$,role:"rowgroup"}),headerHeight:T}},tm=["className"],nm=e=>{const{classes:t}=e;return ae({root:["columnHeaders","withBorderColor"]},de,t)},om=ze("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(e,t)=>t.columnHeaders})({position:"relative",overflow:"hidden",display:"flex",alignItems:"center",boxSizing:"border-box",borderBottom:"1px solid",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),As=s.forwardRef(function(t,n){const{className:o}=t,r=te(t,tm),l=ne(),i=nm(l);return P.jsx(om,w({ref:n,className:Se(o,i.root),ownerState:l},r,{role:"presentation"}))}),rm=["isDragging","className"],lm=e=>{const{isDragging:t,hasScrollX:n,classes:o}=e;return ae({root:["columnHeadersInner",t&&"columnHeaderDropZone",n&&"columnHeadersInner--scrollable"]},de,o)},sm=ze("div",{name:"MuiDataGrid",slot:"columnHeadersInner",overridesResolver:(e,t)=>[{[`&.${V.columnHeaderDropZone}`]:t.columnHeaderDropZone},t.columnHeadersInner]})(()=>({display:"flex",alignItems:"flex-start",flexDirection:"column",[`&.${V.columnHeaderDropZone} .${V.columnHeaderDraggableContainer}`]:{cursor:"move"},[`&.${V["columnHeadersInner--scrollable"]} .${V.columnHeader}:last-child`]:{borderRight:"none"}})),zs=s.forwardRef(function(t,n){var o,r;const{isDragging:l,className:i}=t,c=te(t,rm),a=he(),d=ne(),u=w({},d,{isDragging:l,hasScrollX:(o=(r=a.current.getRootDimensions())==null?void 0:r.hasScrollX)!=null?o:!1}),g=lm(u);return P.jsx(sm,w({ref:n,className:Se(i,g.root),ownerState:u},c))}),im=["innerRef","className","visibleColumns","sortColumnLookup","filterColumnLookup","columnPositions","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","densityFactor","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],cm=s.forwardRef(function(t,n){const{innerRef:o,visibleColumns:r,sortColumnLookup:l,filterColumnLookup:i,columnPositions:c,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:d,columnHeaderFocus:u,columnGroupHeaderFocus:g,densityFactor:f,headerGroupingMaxDepth:m,columnMenuState:h,columnVisibility:C,columnGroupsHeaderStructure:v,hasOtherElementInTabSequence:b}=t,p=te(t,im),{isDragging:y,getRootProps:E,getInnerProps:_,getColumnHeaders:I,getColumnGroupHeaders:D}=Vs({innerRef:o,visibleColumns:r,sortColumnLookup:l,filterColumnLookup:i,columnPositions:c,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:d,columnHeaderFocus:u,columnGroupHeaderFocus:g,densityFactor:f,headerGroupingMaxDepth:m,columnMenuState:h,columnVisibility:C,columnGroupsHeaderStructure:v,hasOtherElementInTabSequence:b});return P.jsx(As,w({ref:n},E(p),{children:P.jsxs(zs,w({isDragging:y},_(),{children:[D(),I()]}))}))}),um=lo(cm),am=s.forwardRef(function(t,n){const r=he().current.getLocaleText("noResultsOverlayLabel");return P.jsx(Qo,w({ref:n},t,{children:r}))}),dm=["sortingOrder"],gm=s.memo(function(t){const{sortingOrder:n}=t,o=te(t,dm),r=ne(),[l]=n,i=l==="asc"?r.slots.columnSortedAscendingIcon:r.slots.columnSortedDescendingIcon;return i?P.jsx(i,w({},o)):null}),fm=["native"];function hm(e){let{native:t}=e,n=te(e,fm);return t?P.jsx("option",w({},n)):P.jsx(Ze,w({},n))}const mm={BooleanCellTrueIcon:id,BooleanCellFalseIcon:ho,ColumnMenuIcon:od,OpenFilterButtonIcon:Za,FilterPanelDeleteIcon:ho,ColumnFilteredIcon:Rr,ColumnSelectorIcon:Xa,ColumnUnsortedIcon:gm,ColumnSortedAscendingIcon:Fr,ColumnSortedDescendingIcon:kr,ColumnResizeIcon:Ja,DensityCompactIcon:ed,DensityStandardIcon:td,DensityComfortableIcon:nd,ExportIcon:sd,MoreActionsIcon:cd,TreeDataCollapseIcon:Dr,TreeDataExpandIcon:Er,GroupingCriteriaCollapseIcon:Dr,GroupingCriteriaExpandIcon:Er,DetailPanelExpandIcon:Tr,DetailPanelCollapseIcon:rd,RowReorderIcon:Hr,QuickFilterIcon:Ya,QuickFilterClearIcon:ho,ColumnMenuHideIcon:ud,ColumnMenuSortAscendingIcon:Fr,ColumnMenuSortDescendingIcon:kr,ColumnMenuFilterIcon:Rr,ColumnMenuManageColumnsIcon:ad,ColumnMenuClearIcon:dd,LoadIcon:ld,FilterPanelAddIcon:Tr,FilterPanelRemoveAllIcon:gd,ColumnReorderIcon:Hr},Cm=w({}
31,mm,{BaseCheckbox:Oi,BaseTextField:Hi,BaseFormControl:Ti,BaseSelect:Ri,BaseSwitch:Di,BaseButton:Ei,BaseIconButton:kl,BaseInputAdornment:ki,BaseTooltip:Fi,BasePopper:_o,BaseInputLabel:Mi,BaseSelectOption:hm,BaseChip:Ii}),js=w({},Cm,{Cell:So,SkeletonCell:Eu,ColumnHeaderFilterIconButton:ja,ColumnMenu:yd,ColumnHeaders:um,Footer:Og,FooterRowCount:Ng,Toolbar:null,PreferencesPanel:Yd,LoadingOverlay:Gg,NoResultsOverlay:am,NoRowsOverlay:Lg,Pagination:Vg,FilterPanel:wg,ColumnsPanel:Ud,Panel:Zd,Row:uf}),sr=e=>{if(e!==void 0)return Object.keys(e).reduce((t,n)=>w({},t,{[`${n.charAt(0).toLowerCase()}${n.slice(1)}`]:e[n]}),{})};function pm({defaultSlots:e,slots:t,components:n}){const o=t??(n?sr(n):null);if(!o||Object.keys(o).length===0)return e;const r=w({},e);return Object.keys(o).forEach(l=>{const i=l;o[i]!==void 0&&(r[i]=o[i])}),r}const wm=["components","componentsProps"];function bm(e){var t;const n=Object.keys(e);if(!n.some(l=>l.startsWith("aria-")||l.startsWith("data-")))return e;const o={},r=(t=e.forwardedProps)!=null?t:{};for(let l=0;l<n.length;l+=1){const i=n[l];i.startsWith("aria-")||i.startsWith("data-")?r[i]=e[i]:o[i]=e[i]}return o.forwardedProps=r,o}function vm(e){return s.useMemo(()=>{const{components:t,componentsProps:n}=e,o=te(e,wm);return[t,n,bm(o)]},[e])}const Ns={autoHeight:!1,autoPageSize:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,columnBuffer:3,rowBuffer:3,columnThreshold:3,rowThreshold:3,rowSelection:!0,density:"standard",disableColumnFilter:!1,disableColumnMenu:!1,disableColumnSelector:!1,disableDensitySelector:!1,disableEval:!1,disableMultipleColumnsFiltering:!1,disableMultipleRowSelection:!1,disableMultipleColumnsSorting:!1,disableRowSelectionOnClick:!1,disableVirtualization:!1,editMode:wt.Cell,filterMode:"client",filterDebounceMs:150,columnHeaderHeight:56,hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,ignoreDiacritics:!1,logger:console,logLevel:"error",pagination:!1,paginationMode:"client",rowHeight:52,pageSizeOptions:[25,50,100],rowSpacingType:"margin",showCellVerticalBorder:!1,showColumnVerticalBorder:!1,sortingOrder:["asc","desc",null],sortingMode:"client",throttleRowsMs:0,disableColumnReorder:!1,disableColumnResize:!1,keepNonExistentRowsSelected:!1,keepColumnPositionIfDraggedOutside:!1,unstable_ignoreValueFormatterDuringExport:!1,clipboardCopyCellDelimiter:" ",rowPositionsDebounceMs:166};sr(js);const xm=e=>w({},e,{rowsMeta:{currentPageTotalHeight:0,positions:[]}}),Xr=(e,t,n)=>typeof e=="number"&&e>0?e:t,Sm=(e,t)=>{const{getRowHeight:n,getRowSpacing:o,getEstimatedRowHeight:r}=t,l=s.useRef(Object.create(null)),i=s.useRef(-1),c=s.useRef(!1),a=q(e,Xt),d=q(e,Ve),u=q(e,is),g=q(e,Qe),f=kt(e,t),m=q(e,Yt),h=Xr(t.rowHeight,Ns.rowHeight),C=Math.floor(h*a),v=s.useCallback(()=>{var O,M;c.current=!1;const S=T=>{l.current[T.id]||(l.current[T.id]={sizes:{baseCenter:C},isResized:!1,autoHeight:!1,needsFirstMeasurement:!0});const{isResized:k,needsFirstMeasurement:G,sizes:z}=l.current[T.id];let N=typeof C=="number"&&C>0?C:52;const j=z.baseCenter;if(k)N=j;else if(n){const K=n(w({},T,{densityFactor:a}));if(K==="auto"){if(G){const ce=r?r(w({},T,{densityFactor:a})):C;N=ce??C}else N=j;c.current=!0,l.current[T.id].autoHeight=!0}else N=Xr(K,C),l.current[T.id].needsFirstMeasurement=!1,l.current[T.id].autoHeight=!1}else l.current[T.id].needsFirstMeasurement=!1;const B={};for(const K in z)/^base[A-Z]/.test(K)&&(B[K]=z[K]);if(B.baseCenter=N,o){var Z,W;const K=e.current.getRowIndexRelativeToVisibleRows(T.id),ce=o(w({},T,{isFirstVisible:K===0,isLastVisible:K===f.rows.length-1,indexRelativeToCurrentPage:K}));B.spacingTop=(Z=ce.top)!=null?Z:0,B.spacingBottom=(W=ce.bottom)!=null?W:0}const ee=e.current.unstable_applyPipeProcessors("rowHeight",B,T);return l.current[T.id].sizes=ee,ee},x=[],F=f.rows.reduce((T,k)=>{x.push(T);let G=0,z=0;const N=S(k);for(const j in N){const B=N[j];/^base[A-Z]/.test(j)?G=B>G?B:G:z+=B}return T+G+z},0);m==null||(O=m.top)==null||O.forEach(T=>{S(T)}),m==null||(M=m.bottom)==null||M.forEach(T=>{S(T)}),e.current.setState(T=>w({},T,{rowsMeta:{currentPageTotalHeight:F,positions:x}})),c.current||(i.current=1/0),e.current.forceUpdate()},[e,f.rows,C,n,o,r,m,a]),b=s.useCallback(O=>{const M=l.current[O];return M?M.sizes.baseCenter:C},[C]),p=O=>{var M;return(M=l.current[O])==null?void 0:M.sizes},y=s.useCallback((O,M)=>{l.current[O].sizes.baseCenter=M,l.current[O].isResized=!0,l.current[O].needsFirstMeasurement=!1,v()},[v]),E=s.useMemo(()=>Pl(v,t.rowPositionsDebounceMs),[v,t.rowPositionsDebounceMs]),_=s.useCallback((O,M,S)=>{if(!l.current[O]||!l.current[O].autoHeight)return;const x=l.current[O].sizes[`base${pt(S)}`]!==M;l.current[O].needsFirstMeasurement=!1,l.current[O].sizes[`base${pt(S)}`]=M,x&&E()},[E]),I=s.useCallback(O=>{var M;return((M=l.current[O])==null?void 0:M.autoHeight)||!1},[]),D=s.useCallback(()=>i.current,[]),R=s.useCallback(O=>{c.current&&O>i.current&&(i.current=O)},[]),L=s.useCallback(()=>{l.current={},v()},[v]);s.useEffect(()=>
31{v()},[C,d,u,g,v]),lr(e,"rowHeight",v);const $={unstable_setLastMeasuredRowIndex:R,unstable_getRowHeight:b,unstable_getRowInternalSizes:p,unstable_setRowHeight:y,unstable_storeRowHeightMeasurement:_,resetRowHeights:L},H={getLastMeasuredRowIndex:D,rowHasAutoHeight:I};ge(e,$,"public"),ge(e,H,"private")},Pm=e=>{const t=s.useCallback((r={})=>e.current.unstable_applyPipeProcessors("exportState",{},r),[e]),n=s.useCallback(r=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:r}).callbacks.forEach(i=>{i()}),e.current.forceUpdate()},[e]);ge(e,{exportState:t,restoreState:n},"public")},ym=e=>{const t=s.useRef({}),n=s.useCallback((d,u,g)=>{const f=t.current;f[d]||(f[d]={}),f[d][u]=g},[]),o=s.useCallback((d,u)=>{var g;return(g=t.current[d])==null?void 0:g[u]},[]),r=s.useCallback(d=>{const{columnIndex:u,rowId:g,minFirstColumnIndex:f,maxLastColumnIndex:m,columns:h}=d,C=h.length,v=h[u],b=typeof v.colSpan=="function"?v.colSpan(e.current.getCellParams(g,v.field)):v.colSpan;if(!b||b===1)return n(g,u,{spannedByColSpan:!1,cellProps:{colSpan:1,width:v.computedWidth}}),{colSpan:1};let p=v.computedWidth;for(let y=1;y<b;y+=1){const E=u+y;if(E>=f&&E<m){const _=h[E];p+=_.computedWidth,n(g,u+y,{spannedByColSpan:!0,rightVisibleCellIndex:Math.min(u+b,C-1),leftVisibleCellIndex:u})}n(g,u,{spannedByColSpan:!1,cellProps:{colSpan:b,width:p}})}return{colSpan:b}},[e,n]),l=s.useCallback(({rowId:d,minFirstColumn:u,maxLastColumn:g,columns:f})=>{for(let m=u;m<g;m+=1){const h=r({columnIndex:m,rowId:d,minFirstColumnIndex:u,maxLastColumnIndex:g,columns:f});h.colSpan>1&&(m+=h.colSpan-1)}},[r]),i={unstable_getCellColSpanInfo:o},c={calculateColSpan:l};ge(e,i,"public"),ge(e,c,"private");const a=s.useCallback(()=>{t.current={}},[]);Q(e,"columnOrderChange",a)},Bs=(e,t,n)=>{if(Kl(e)){if(n[e.field]!==void 0)throw new Error(["MUI: columnGroupingModel contains duplicated field",`column field ${e.field} occurs two times in the grouping model:`,`- ${n[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join(` 32`));n[e.field]=t;return}const{groupId:o,children:r}=e;r.forEach(l=>{Bs(l,[...t,o],n)})},Ro=e=>{if(!e)return{};const t={};return e.forEach(n=>{Bs(n,[],t)}),t},To=(e,t,n)=>{const o=a=>{var d;return(d=t[a])!=null?d:[]},r=[],l=Math.max(...e.map(a=>o(a).length)),i=(a,d,u)=>Gt(o(a).slice(0,u+1),o(d).slice(0,u+1)),c=(a,d)=>!!(n!=null&&n.left&&n.left.includes(a)&&!n.left.includes(d)||n!=null&&n.right&&!n.right.includes(a)&&n.right.includes(d));for(let a=0;a<l;a+=1){const d=e.reduce((u,g)=>{var f;const m=(f=o(g)[a])!=null?f:null;if(u.length===0)return[{columnFields:[g],groupId:m}];const h=u[u.length-1],C=h.columnFields[h.columnFields.length-1];return h.groupId!==m||!i(C,g,a)||c(C,g)?[...u,{columnFields:[g],groupId:m}]:[...u.slice(0,u.length-1),{columnFields:[...h.columnFields,g],groupId:m}]},[]);r.push(d)}return r},Im=["groupId","children"],ir=e=>{let t={};return e.forEach(n=>{if(Kl(n))return;const{groupId:o,children:r}=n,l=te(n,Im);if(!o)throw new Error("MUI: An element of the columnGroupingModel does not have either `field` or `groupId`.");r||console.warn(`MUI: group groupId=${o} has no children.`);const i=w({},l,{groupId:o}),c=ir(r);if(c[o]!==void 0||t[o]!==void 0)throw new Error(`MUI: The groupId ${o} is used multiple times in the columnGroupingModel.`);t=w({},t,c,{[o]:i})}),w({},t)},Mm=(e,t,n)=>{var o,r,l,i;if(!((o=t.experimentalFeatures)!=null&&o.columnGrouping))return e;const c=at(n),a=Lt(n),d=ir((r=t.columnGroupingModel)!=null?r:[]),u=Ro((l=t.columnGroupingModel)!=null?l:[]),g=To(c,u,(i=n.current.state.pinnedColumns)!=null?i:{}),f=a.length===0?0:Math.max(...a.map(m=>{var h,C;return(h=(C=u[m])==null?void 0:C.length)!=null?h:0}));return w({},e,{columnGrouping:{lookup:d,unwrappedGroupingModel:u,headerStructure:g,maxDepth:f}})},Fm=(e,t)=>{var n;const o=s.useCallback(a=>{var d;return(d=Ji(e)[a])!=null?d:[]},[e]),r=s.useCallback(()=>$l(e),[e]);ge(e,{unstable_getColumnGroupPath:o,unstable_getAllGroupDetails:r},"public");const i=s.useCallback(()=>{var a;const d=Ro((a=t.columnGroupingModel)!=null?a:[]);e.current.setState(u=>{var g,f,m;const h=(g=(f=u.columns)==null?void 0:f.orderedFields)!=null?g:[],C=(m=u.pinnedColumns)!=null?m:{},v=To(h,d,C);return w({},u,{columnGrouping:w({},u.columnGrouping,{headerStructure:v})})})},[e,t.columnGroupingModel]),c=s.useCallback(a=>{var d,u,g,f;if(!((d=t.experimentalFeatures)!=null&&d.columnGrouping))return;const m=(u=(g=(f=e.current).getPinnedColumns)==null?void 0:g.call(f))!=null?u:{},h=at(e),C=Lt(e),v=ir(a??[]),b=Ro(a??[]),p=To(h,b,m),y=C.length===0?0:Math.max(...C.map(E=>{var _,I;return(_=(I=b[E])==null?void 0:I.length)!=null?_:0}));e.current.setState(E=>w({},E,{columnGrouping:{lookup:v,unwrappedGroupingModel:b,headerStructure:p,maxDepth:y}}))},[e,(n=t.experimentalFeatures)==null?void 0:n.columnGrouping]);
32Q(e,"columnIndexChange",i),Q(e,"columnsChange",()=>{c(t.columnGroupingModel)}),Q(e,"columnVisibilityModelChange",()=>{c(t.columnGroupingModel)}),s.useEffect(()=>{c(t.columnGroupingModel)},[c,t.columnGroupingModel])},km=e=>{const{classes:t}=e;return ae({root:["virtualScroller"]},de,t)},Em=ze("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(e,t)=>t.virtualScroller})({overflow:"auto",height:"100%",position:"relative","@media print":{overflow:"hidden"},zIndex:0}),Dm=s.forwardRef(function(t,n){const o=ne(),r=km(o);return P.jsx(Em,w({ref:n},t,{className:Se(r.root,t.className),ownerState:o}))}),Rm=(e,t)=>{const{classes:n}=e;return ae({root:["virtualScrollerContent",t&&"virtualScrollerContent--overflowed"]},de,n)},Tm=ze("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(e,t)=>t.virtualScrollerContent})({}),Hm=s.forwardRef(function(t,n){var o;const r=ne(),l=!r.autoHeight&&((o=t.style)==null?void 0:o.minHeight)==="auto",i=Rm(r,l);return P.jsx(Tm,w({ref:n},t,{ownerState:r,className:Se(i.root,t.className)}))}),Om=["className"],$m=e=>{const{classes:t}=e;return ae({root:["virtualScrollerRenderZone"]},de,t)},Gm=ze("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone",overridesResolver:(e,t)=>t.virtualScrollerRenderZone})({position:"absolute",display:"flex",flexDirection:"column"}),Lm=s.forwardRef(function(t,n){const{className:o}=t,r=te(t,Om),l=ne(),i=$m(l);return P.jsx(Gm,w({ref:n,className:Se(i.root,o),ownerState:l},r))}),_m=e=>w({},e,{headerFiltering:{editing:null,menuOpen:null}}),Vm=(e,t)=>{const n=je(e,"useGridHeaderFiltering"),o=s.useCallback(u=>{e.current.setState(g=>{var f,m;return t.signature==="DataGrid"?g:w({},g,{headerFiltering:{editing:(f=u.editing)!=null?f:null,menuOpen:(m=u.menuOpen)!=null?m:null}})}),e.current.forceUpdate()},[e,t.signature]),r=s.useCallback(u=>{n.debug(`Starting edit mode on header filter for field: ${u}`),e.current.setHeaderFilterState({editing:u})},[e,n]),l=s.useCallback(()=>{n.debug("Stopping edit mode on header filter"),e.current.setHeaderFilterState({editing:null})},[e,n]),i=s.useCallback(u=>{n.debug(`Opening header filter menu for field: ${u}`),e.current.setHeaderFilterState({menuOpen:u})},[e,n]),c=s.useCallback(()=>{n.debug("Hiding header filter menu for active field");let u=e.current.state.headerFiltering.menuOpen;if(u){const g=Zt(e),f=lt(e),m=at(e);if(g[u]||(u=m[0]),f[u]===!1){const h=m.filter(v=>v===u?!0:f[v]!==!1),C=h.indexOf(u);u=h[C+1]||h[C-1]}e.current.setHeaderFilterState({menuOpen:null}),e.current.setColumnHeaderFilterFocus(u)}},[e,n]),a={setHeaderFilterState:o};ge(e,{startHeaderFilterEditMode:r,stopHeaderFilterEditMode:l,showHeaderFilterMenu:i,hideHeaderFilterMenu:c},"public"),ge(e,a,"private")};function Am(){let e,t;const n=new Promise((o,r)=>{e=o,t=r});return n.resolve=e,n.reject=t,n}const zm=(e,t)=>{const n=q(e,Ae),o=kt(e,t),r=q(e,Kt),l=Math.max(r.currentPageTotalHeight,1),i=s.useRef(!1),c=s.useCallback(d=>{const u=e.current.getRootDimensions();if(!u||t.rowsLoadingMode!=="client")return;const g=d.top+u.viewportOuterSize.height,f=e.current.getViewportPageSize();if(g<l-t.scrollEndThreshold&&(i.current=!1),g>=l-t.scrollEndThreshold&&!i.current){const m={visibleColumns:n,viewportPageSize:f,visibleRowsCount:o.rows.length};e.current.publishEvent("rowsScrollEnd",m),i.current=!0}},[l,t.scrollEndThreshold,t.rowsLoadingMode,n,e,o.rows.length]),a=s.useCallback(({left:d,top:u})=>{c({left:d,top:u})},[c]);Q(e,"scrollPositionChange",a),Me(e,"rowsScrollEnd",t.onRowsScrollEnd)},jm=e=>e.columnReorder,Jr=fe(jm,e=>e.dragCol),Us="left",Ws="right",Nm=(e,t)=>e.x<=t.x?Ws:Us,Bm=(e,t)=>e.x!==t.x||e.y!==t.y,Um=e=>{const{classes:t}=e;return ae({columnHeaderDragging:["columnHeader--dragging"]},de,t)},Wm=e=>U({},e,{columnReorder:{dragCol:""}}),Km=(e,t)=>{const n=je(e,"useGridColumnReorder"),o=s.useRef(null),r=s.useRef({x:0,y:0}),l=s.useRef(null),i=s.useRef({}),c=s.useRef(),a={classes:t.classes},d=Um(a),u=st();s.useEffect(()=>()=>{clearTimeout(c.current)},[]);const g=s.useCallback((C,v)=>{if(t.disableColumnReorder||C.colDef.disableReorder)return;n.debug(`Start dragging col ${C.field}`),v.stopPropagation(),o.current=v.currentTarget,o.current.classList.add(d.columnHeaderDragging),v.dataTransfer&&(v.dataTransfer.effectAllowed="move"),e.current.setState(D=>U({},D,{columnReorder:U({},D.columnReorder,{dragCol:C.field})})),e.current.forceUpdate(),c.current=setTimeout(()=>{o.current.classList.remove(d.columnHeaderDragging)}),l.current=e.current.getColumnIndex(C.field,!1);const b=e.current.unstable_getColumnGroupPath(C.field),p=l.current,y=e.current.getAllColumns(),E=e.current.unstable_getAllGroupDetail
32s(),_=D=>{const R=y[D].field;return e.current.unstable_getColumnGroupPath(R)};let I=null;b.forEach(D=>{var R;(R=E[D])!=null&&R.freeReordering||(p>0&&_(p-1).includes(D)||p+1<y.length&&_(p+1).includes(D))&&(I=D)}),i.current={};for(let D=0;D<y.length;D+=1){const R=D<=p?D-1:D,L=D<p?D:D+1;if(I!==null){let $=!1;(R>=0&&_(R).includes(I)||L<y.length&&_(L).includes(I))&&($=!0),$||(i.current[D]=!0)}R>=0&&L<y.length&&_(L).forEach($=>{if(_(R).includes($)&&!b.includes($)){var H;(H=E[$])!=null&&H.freeReordering||(i.current[D]=!0)}})}},[t.disableColumnReorder,d.columnHeaderDragging,n,e]),f=s.useCallback((C,v)=>{v.preventDefault(),v.stopPropagation()},[]),m=s.useCallback((C,v)=>{const b=Jr(e);if(!b)return;n.debug(`Dragging over col ${C.field}`),v.preventDefault(),v.stopPropagation();const p={x:v.clientX,y:v.clientY};if(C.field!==b&&Bm(r.current,p)){const y=e.current.getColumnIndex(C.field,!1),E=e.current.getColumnIndex(C.field,!0),_=e.current.getColumn(C.field),I=e.current.getColumnIndex(b,!1),D=e.current.getVisibleColumns(),R=e.current.getAllColumns(),L=Nm(r.current,p),$=L===Us&&(u.direction==="rtl"?I<y:y<I),H=L===Ws&&(u.direction==="rtl"?y<I:I<y);if($||H){let O,M=0;if(_.disableReorder?$?O=E>0&&!D[E-1].disableReorder:O=E<D.length-1&&!D[E+1].disableReorder:O=!0,i.current[y]){let x,F=y+M;if($)for(x=E>0?D[E-1].field:null;F>0&&R[F].field!==x&&i.current[F];)M-=1,F=y+M;else for(x=E+1<D.length?D[E+1].field:null;F<R.length-1&&R[F].field!==x&&i.current[F];)M+=1,F=y+M;(i.current[F]||R[F].field===x)&&(O=!1)}e.current.unstable_applyPipeProcessors("canBeReordered",O,{targetIndex:E})&&e.current.setColumnIndex(b,y+M)}r.current=p}},[e,n,u.direction]),h=s.useCallback((C,v)=>{const b=Jr(e);if(!(t.disableColumnReorder||!b)){if(n.debug("End dragging col"),v.preventDefault(),v.stopPropagation(),clearTimeout(c.current),o.current=null,v.dataTransfer.dropEffect==="none"&&!t.keepColumnPositionIfDraggedOutside)e.current.setColumnIndex(b,l.current),l.current=null;else{const p={column:e.current.getColumn(b),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(b),oldIndex:l.current};e.current.publishEvent("columnOrderChange",p)}e.current.setState(p=>U({},p,{columnReorder:U({},p.columnReorder,{dragCol:""})})),e.current.forceUpdate()}},[t.disableColumnReorder,t.keepColumnPositionIfDraggedOutside,n,e]);Q(e,"columnHeaderDragStart",g),Q(e,"columnHeaderDragEnter",f),Q(e,"columnHeaderDragOver",m),Q(e,"columnHeaderDragEnd",h),Q(e,"cellDragEnter",f),Q(e,"cellDragOver",m),Me(e,"columnOrderChange",t.onColumnOrderChange)};function qm(e){return e.getAttribute("data-field")}function Qm(e,t){return e.querySelector(`[data-field="${t}"]`)}function el(e,t){var n;return Array.from((n=e.querySelectorAll(`[data-fields*="|-${t}-|"]`))!=null?n:[])}function tl(e,t){var n,o;if(!Nn(e,V.root))throw new Error("MUI: The root element is not found.");const l=e.getAttribute("aria-colindex");if(!l)return[];const i=Number(l)-1,c=[];return(n=t.virtualScrollerRef)!=null&&n.current?(((o=t.virtualScrollerRef)==null?void 0:o.current.querySelectorAll(`:scope > div > div > .${V.row}
32`)).forEach(d=>{const u=d.getAttribute("data-id");if(!u)return;let g=i;const f=t.unstable_getCellColSpanInfo(u,i);f&&f.spannedByColSpan&&(g=f.leftVisibleCellIndex);const m=d.querySelector(`[data-colindex="${g}"]`);m&&c.push(m)}),c):[]}function Zm(e,t){return e.columnHeadersContainerElementRef.current.querySelector(`:scope > div > div > [data-field="${t}"][role="columnheader"]`)}function Ym(e,t){const n=e.virtualScrollerRef.current,o=r=>`:scope > div > div > div > [data-field="${t}"][role="${r}"]`;return Array.from(n.querySelectorAll(`${o("cell")}, ${o("gridcell")}`))}const Xm={includeHeaders:!0,includeOutliers:!1,outliersFactor:1.5,expand:!1};let Jm=!1;function eC(){return Jm}function nl(e,t){if(t!==void 0&&e.changedTouches){for(let n=0;n<e.changedTouches.length;n+=1){const o=e.changedTouches[n];if(o.identifier===t)return{x:o.clientX,y:o.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function ol(e,t,n,o){let r=e;return o==="Right"?r+=t-n.left:r+=n.right-t,r}function rl(e,t,n){return n==="Left"?e-t.left:t.right-e}function tC(e){return e==="Right"?"Left":"Right"}function ll(e,t){const n=e.classList.contains(V["columnSeparator--sideRight"])?"Right":"Left";return t==="rtl"?tC(n):n}function sl(e){e.preventDefault(),e.stopImmediatePropagation()}function nC(e){const t=s.useRef(),n=()=>tr(e),o=q(e,n);return s.useEffect(()=>{t.current&&o===!1&&(t.current.resolve(),t.current=void 0)}),()=>{if(!t.current){if(n()===!1)return Promise.resolve();t.current=Am()}return t.current}}function oC(e,t){if(e.length<4)return e;const n=e.slice();n.sort((c,a)=>c-a);const o=n[Math.floor(n.length*.25)],r=n[Math.floor(n.length*.75)-1],l=r-o,i=l<5?5:l*t;return n.filter(c=>c>o-i&&c<r+i)}function rC(e,t,n){const o={},r=e.current.rootElementRef.current;return r.classList.add(V.autosizing),n.forEach(l=>{const c=Ym(e.current,l.field).map(h=>{var C,v;const b=window.getComputedStyle(h,null),p=parseInt(b.paddingLeft,10)+parseInt(b.paddingRight,10),y=(C=(v=h.firstElementChild)==null?void 0:v.getBoundingClientRect().width)!=null?C:0;return p+y}),a=t.includeOutliers?c:oC(c,t.outliersFactor);if(t.includeHeaders){const h=Zm(e.current,l.field);if(h){const C=h.querySelector(`.${V.columnHeaderTitle}`),v=h.querySelector(`.${V.columnHeaderTitleContainerContent}`),b=C??v,p=window.getComputedStyle(h,null),y=parseInt(p.paddingLeft,10)+parseInt(p.paddingRight,10),E=b.scrollWidth+1,_=y+E;a.push(_)}}const d=l.minWidth!==-1/0&&l.minWidth!==void 0,u=l.maxWidth!==1/0&&l.maxWidth!==void 0,g=d?l.minWidth:0,f=u?l.maxWidth:1/0,m=a.length===0?0:Math.max(...a);o[l.field]=Mt(m,g,f)}),r.classList.remove(V.autosizing),o}const lC=e=>U({},e,{columnResize:{resizingColumnField:""}}),sC=(e,t)=>{const n=je(e,"useGridColumnResize"),o=s.useRef(),r=s.useRef(),l=s.useRef(),i=s.useRef(),c=s.useRef(),a=st(),d=s.useRef(),u=s.useRef(),g=Dn(),f=s.useRef(),m=O=>{n.debug(`Updating width to ${O} for col ${o.current.field}`);const M=r.current.offsetWidth,S=O-M;o.current.computedWidth=O,o.current.width=O,o.current.flex=0,r.current.style.width=`${O}px`,r.current.style.minWidth=`${O}px`,r.current.style.maxWidth=`${O}px`;const x=l.current;x&&(x.style.width=`${O}px`,x.style.minWidth=`${O}px`,x.style.maxWidth=`${O}px`),[...c.current,...i.current].forEach(F=>{const T=F;let k;T.getAttribute("aria-colspan")==="1"?k=`${O}px`:k=`${T.offsetWidth+S}px`,T.style.width=k,T.style.minWidth=k,T.style.maxWidth=k})},h=O=>{E(),o.current&&(e.current.setColumnWidth(o.current.field,o.current.width),n.debug(`Updating col ${o.current.field} with new width: ${o.current.width}`)),g.start(0,()=>{e.current.publishEvent("columnResizeStop",null,O)})},C=Ge(h),v=Ge(O=>{if(O.buttons===0){C(O);return}let M=ol(d.current,O.clientX,r.current.getBoundingClientRect(),u.current);M=Mt(M,o.current.minWidth,o.current.maxWidth),m(M);const S={element:r.current,colDef:o.current,width:M};e.current.publishEvent("columnResize",S,O)}),b=Ge(O=>{nl(O,f.current)&&h(O)}),p=Ge(O=>{const M=nl(O,f.current);if(!M)return;if(O.type==="mousemove"&&O.buttons===0){b(O);return}let S=ol(d.current,M.x,r.current.getBoundingClientRect(),u.current);S=Mt(S,o.current.minWidth,o.current.maxWidth),m(S);const x={element:r.current,colDef:o.current,width:S};e.current.publishEvent("columnResize",x,O)}),y=Ge(O=>{var M,S;if(!Nn(O.target,V["columnSeparator--resizable"]))return;O.preventDefault();const F=O.changedTouches[0];F!=null&&(f.current=F.identifier),r.current=Nn(O.target,V.columnHeader);const T=qm(r.current),k=e.current.getColumn(T);i.current=el((M=e.current.columnHeadersContainerElementRef)==null?void 0:M.current,T),n.debug(`Start Resize on col ${k.field}`),e.current.publishEvent("columnResizeStart",{field:T},O),o.current=k,r.current=Qm((S=e.current.columnHeadersElementRef)==null?void 0:S.current,k.field),c.current=tl(r.current,e.current),u.current=ll(O.target,a.direction),d.current=rl(F.clientX,r.current.getBoundingClientRect(),u.current);const G=Nt(O.currentTarget);G.addEventListener("touchmove",p),G.addEventListener("touchend",b)}),E=s.useCallback(()=>{const O=Nt(e.current.rootElementRef.current);O.body.style.removeProperty("cursor"),O.removeEventListener("mousemove",v),O.removeEventListener("mouseup",C),O.removeEventListener("touchmove",p),O.removeEventListener("touchend",b),setTimeout(()=>
32{O.removeEventListener("click",sl,!0)},100),r.current&&(r.current.style.pointerEvents="unset")},[e,r,v,C,p,b]),_=s.useCallback(({field:O})=>{e.current.setState(M=>U({},M,{columnResize:U({},M.columnResize,{resizingColumnField:O})})),e.current.forceUpdate()},[e]),I=s.useCallback(()=>{e.current.setState(O=>U({},O,{columnResize:U({},O.columnResize,{resizingColumnField:""})})),e.current.forceUpdate()},[e]),D=Ge(({colDef:O},M)=>{var S,x,F;if(M.button!==0||!M.currentTarget.classList.contains(V["columnSeparator--resizable"]))return;M.preventDefault(),n.debug(`Start Resize on col ${O.field}`),e.current.publishEvent("columnResizeStart",{field:O.field},M),o.current=O,r.current=(S=e.current.columnHeadersContainerElementRef)==null?void 0:S.current.querySelector(`[data-field="${O.field}"]`);const T=(x=e.current.headerFiltersElementRef)==null?void 0:x.current;T&&(l.current=T.querySelector(`[data-field="${O.field}"]`)),i.current=el((F=e.current.columnHeadersContainerElementRef)==null?void 0:F.current,O.field),c.current=tl(r.current,e.current);const k=Nt(e.current.rootElementRef.current);k.body.style.cursor="col-resize",u.current=ll(M.currentTarget,a.direction),d.current=rl(M.clientX,r.current.getBoundingClientRect(),u.current),k.addEventListener("mousemove",v),k.addEventListener("mouseup",C),k.addEventListener("click",sl,!0)}),R=Ge((O,M)=>{if(t.disableAutosize||M.button!==0)return;const S=e.current.state.columns.lookup[O.field];S.resizable!==!1&&e.current.autosizeColumns(U({},t.autosizeOptions,{columns:[S.field]}))}),L=nC(e),$=s.useRef(!1),H=s.useCallback(async O=>{var M,S;if(!((M=e.current.rootElementRef)==null?void 0:M.current)||$.current)return;$.current=!0;const F=$t(e.current.state),T=U({},Xm,O,{columns:(S=O?.columns)!=null?S:F.orderedFields});T.columns=T.columns.filter(N=>F.columnVisibilityModel[N]!==!1);const k=T.columns.map(N=>e.current.state.columns.lookup[N]);try{e.current.unstable_setColumnVirtualization(!1),await L();const N=rC(e,T,k),j=k.map(B=>U({},B,{width:N[B.field],computedWidth:N[B.field]}));if(T.expand){var G,z;const Z=F.orderedFields.map(K=>F.lookup[K]).filter(K=>F.columnVisibilityModel[K.field]!==!1).reduce((K,ce)=>{var we,ue;return K+((we=(ue=N[ce.field])!=null?ue:ce.computedWidth)!=null?we:ce.width)},0),ee=((G=(z=e.current.getRootDimensions())==null?void 0:z.viewportInnerSize.width)!=null?G:0)-Z;if(ee>0){const K=ee/(j.length||1);j.forEach(ce=>{ce.width+=K,ce.computedWidth+=K})}}e.current.updateColumns(j)}finally{e.current.unstable_setColumnVirtualization(!0),$.current=!1}},[e,L]);s.useEffect(()=>E,[E]),Ao(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),os(e,()=>{var O;return(O=e.current.columnHeadersElementRef)==null?void 0:O.current},"touchstart",y,{passive:eC()}),ge(e,{autosizeColumns:H},"public"),Q(e,"columnResizeStop",I),Q(e,"columnResizeStart",_),Q(e,"columnSeparatorMouseDown",D),Q(e,"columnSeparatorDoubleClick",R),Me(e,"columnResize",t.onColumnResize),Me(e,"columnWidthChange",t.onColumnWidthChange)},iC=e=>{const t=s.useCallback((n,o)=>{if(e.current.getCellParams(n.id,n.field).colDef.type==="treeDataGroup"&&o.key===" "&&!o.shiftKey){if(n.rowNode.type!=="group")return;e.current.setRowChildrenExpansion(n.id,!n.rowNode.childrenExpanded)}},[e]);Q(e,"cellKeyDown",t)},cC=U({},Xe,{type:"treeDataGroup",sortable:!1,filterable:!1,disableColumnMenu:!0,disableReorder:!0,align:"left",width:200,valueGetter:e=>e.rowNode.type==="group"||e.rowNode.type==="leaf"?e.rowNode.groupingKey:void 0}),uC="__tree_data_group__",il={field:uC,editable:!1,groupable:!1},Et="tree-data",aC=e=>{const{apiRef:t,rowTree:n,disableChildrenFiltering:o,isRowMatchingFilters:r}=e,l={},i={},c={},a={passingFilterItems:null,passingQuickFilterValues:null},d=(g,f,m)=>{const h=o&&g.depth>0;let C;if(h)C=null;else if(!r||g.type==="footer")C=!0;else{const p=t.current.getRow(g.id);r(p,void 0,a),C=Ms([a.passingFilterItems],[a.passingQuickFilterValues],e.filterModel,e.apiRef,c)}let v=0;g.type==="group"&&g.children.forEach(p=>{var y;const E=n[p],_=d(E,(y=C)!=null?y:f,m&&!!g.childrenExpanded);v+=_});let b;switch(C){case!0:{b=!0;break}case!1:{b=v>0;break}default:{b=f;break}}return l[g.id]=b,b?(i[g.id]=v,g.type==="footer"?v:v+1):0},u=Object.values(n);for(let g=0;g<u.length;g+=1){const f=u[g];f.depth===0&&d(f,!0,!0)}return{filteredRowsLookup:l,filteredDescendantCountLookup:i}},it=ne,co=he,dC=e=>{const{classes:t}=e;return ae({root:["treeDataGroupingCell"],toggle:["treeDataGroupingCellToggle"]},de,t)};function gC(e){var t,n;const{id:o,field:r,formattedValue:l,rowNode:i,hideDescendantCount:c,offsetMultiplier:a=2}=e,d=it(),u=co(),g={classes:d.classes},f=dC(g),h=(t=q(u,dc)[i.id])!=null?t:0,C=i.childrenExpanded?d.slots.treeDataCollapseIcon:d.slots.treeDataExpandIcon,v=b=>{u.current.setRowChildrenExpansion(o,!i.childrenExpanded),u.current.setCellFocus(o,r),b.stopPropagation()};return P.jsxs($i,{className:f.root,sx:{ml:i.depth*a},children:[P.jsx("div",{className:f.toggle,children:h>0&&P.jsx(d.slots.baseIconButton,U({size:"small",onClick:v,tabIndex:-1,"aria-label":i.childrenExpanded?u.current.getLocaleText("treeDataCollapse"):u.current.getLocaleText("treeDataExpand")},d==null||(n=d.slotProps)==null?void 0:n.baseIconButton,{children:P.jsx(C,{fontSize:"inherit"})}))}),P.jsxs("span",{children:[l===void 0?i.groupingKey:l,!c&&h>0?` (${h})`:""]})]})}const Ot=e=>e.pinnedColumns;var De=(function(e){return e.left="left",e.right="right",e})(De||{});function fC(e){const{colDef:t,onClick:n}=e,o=co(),r=it(),l=st(),i=s.useCallback(g=>f=>{o.current.pinColumn(t.field,g),n(f)},[o,t.field,n]),c=g=>{o.current.unpinColumn(t.field),n(g)},a=P.jsxs(Ze,{onClick:i(De.left),children:[P.jsx(ut,{children:P.jsx(r.slots.columnMenuPinLeftIcon,{fontSize:"small"})}),P.jsx(ht,{children:o.current.getLocaleText("pinToLeft")})]}),d=P.jsxs(Ze,{onClick:i(De.right),children:[P.jsx(ut,{children:P.jsx(r.slots.columnMenuPinRightIcon,{fontSize:"small"})}),P.jsx(ht,{children:o.current.getLocaleText("pinToRight")})]});if(!t)return null;const u=o.current.isColumnPinned(t.field);if(u){const g=u===De.right?De.left:De.right,f=g===De.right?"pinToRight":"pinToLeft",m=u===De.right?r.slots.columnMenuPinLeftIcon:r.slots.columnMenuPinRightIcon;
32return P.jsxs(s.Fragment,{children:[P.jsxs(Ze,{onClick:i(g),children:[P.jsx(ut,{children:P.jsx(m,{fontSize:"small"})}),P.jsx(ht,{children:o.current.getLocaleText(f)})]}),P.jsxs(Ze,{onClick:c,children:[P.jsx(ut,{}),P.jsx(ht,{children:o.current.getLocaleText("unpin")})]})]})}return l.direction==="rtl"?P.jsxs(s.Fragment,{children:[d,a]}):P.jsxs(s.Fragment,{children:[a,d]})}const jt=e=>e.detailPanel.expandedRowIds,cr=e=>e.detailPanel.contentCache,Ho=e=>e.detailPanel.heightCache,Ks=He(Ho,e=>Object.entries(e).reduce((t,[n,{height:o}])=>(t[n]=o||0,t),{})),hC=e=>{const{classes:t,isExpanded:n}=e;return ae({root:["detailPanelToggleCell",n&&"detailPanelToggleCell--expanded"]},de,t)};function mC(e){var t;const{id:n,value:o}=e,r=it(),l=co(),i={classes:r.classes,isExpanded:o},c=hC(i),a=q(l,cr),d=s.isValidElement(a[n]),u=o?r.slots.detailPanelCollapseIcon:r.slots.detailPanelExpandIcon;return P.jsx(r.slots.baseIconButton,U({size:"small",tabIndex:-1,disabled:!d,className:c.root,"aria-label":o?l.current.getLocaleText("collapseDetailPanel"):l.current.getLocaleText("expandDetailPanel")},(t=r.slotProps)==null?void 0:t.baseIconButton,{children:P.jsx(u,{fontSize:"inherit"})}))}const CC=Fe(P.jsx("g",{transform:"rotate(-30 15 10)",children:P.jsx("path",{d:"M16,9V4l1,0c0.55,0,1-0.45,1-1v0c0-0.55-0.45-1-1-1H7C6.45,2,6,2.45,6,3v0 c0,0.55,0.45,1,1,1l1,0v5c0,1.66-1.34,3-3,3h0v2h5.97v7l1,1l1-1v-7H19v-2h0C17.34,12,16,10.66,16,9z",fillRule:"evenodd"})}),"PushPinRight"),pC=Fe(P.jsx("g",{transform:"rotate(30 8 12)",children:P.jsx("path",{d:"M16,9V4l1,0c0.55,0,1-0.45,1-1v0c0-0.55-0.45-1-1-1H7C6.45,2,6,2.45,6,3v0 c0,0.55,0.45,1,1,1l1,0v5c0,1.66-1.34,3-3,3h0v2h5.97v7l1,1l1-1v-7H19v-2h0C17.34,12,16,10.66,16,9z",fillRule:"evenodd"})}),"PushPinLeft"),wC=["operators","item","field","buttonRef","headerFilterMenuRef"],bC={width:22,height:22,margin:"auto 0 10px 5px"};function vC(e){var t;const{operators:n,item:o,field:r,buttonRef:l,headerFilterMenuRef:i}=e,c=Qt(e,wC),a=$e(),d=$e(),u=it(),g=he(),f=!!(er(g)===r&&i.current),m=h=>{i.current=h.currentTarget,g.current.showHeaderFilterMenu(r)};return u.slots.headerFilterMenu?P.jsxs(s.Fragment,{children:[P.jsx(u.slots.baseIconButton,U({id:a,ref:l,"aria-label":g.current.getLocaleText("filterPanelOperator"),title:g.current.getLocaleText("filterPanelOperator"),"aria-controls":d,"aria-expanded":f?"true":void 0,"aria-haspopup":"true",tabIndex:-1,size:"small",onClick:m,sx:bC},(t=u.slotProps)==null?void 0:t.baseIconButton,{children:P.jsx(u.slots.openFilterButtonIcon,{fontSize:"small"})})),P.jsx(u.slots.headerFilterMenu,U({field:r,open:f,item:o,target:i.current,operators:n,labelledBy:a,id:d},c))]}):null}const xC={padding:"2px"};function SC({onClick:e}){var t;const n=it();return P.jsx(n.slots.baseIconButton,U({tabIndex:-1,"aria-label":"Clear filter",size:"small",onClick:e,sx:xC},(t=n.slotProps)==null?void 0:t.baseIconButton,{children:P.jsx(n.slots.columnMenuClearIcon,{fontSize:"inherit"})}))}const PC=["colIndex","height","hasFocus","filterOperators","width","headerClassName","colDef","item","headerFilterMenuRef","InputComponentProps","showClearIcon"],yC=e=>{const{colDef:t,classes:n,showColumnVerticalBorder:o}=e,r={root:["columnHeader",t.headerAlign==="left"&&"columnHeader--alignLeft",t.headerAlign==="center"&&"columnHeader--alignCenter",t.headerAlign==="right"&&"columnHeader--alignRight","withBorderColor",o&&"columnHeader--withRightBorder"]};return ae(r,de,n)},IC={'& input[value=""]:not(:focus)':{color:"transparent"}},MC=s.forwardRef((e,t)=>{var n,o,r;const{colIndex:l,height:i,hasFocus:c,filterOperators:a,width:d,headerClassName:u,colDef:g,item:f,headerFilterMenuRef:m,InputComponentProps:h,showClearIcon:C=!0}=e,v=Qt(e,PC),b=dt(),p=Lt(b),y=it(),E=s.useRef(null),_=Ft(t,E),I=s.useRef(null),D=s.useRef(null),R=fs(b)===g.field,L=er(b)===g.field,$=a[0],H=g.filterable?$.InputComponent:null,O=s.useCallback(W=>{if(f.value&&!W.value){b.current.deleteFilterItem(W);return}b.current.upsertFilterItem(W)},[b,f]),M=s.useCallback(()=>{b.current.deleteFilterItem(f)},[b,f]);let S;g.renderHeaderFilter&&(S=g.renderHeaderFilter(e)),s.useLayoutEffect(()=>{if(c&&!L){let W=E.current.querySelector('[tabindex="0"]');R&&H&&(W=I.current);const ee=W||E.current;ee?.focus(),b.current.columnHeadersContainerElementRef.current.scrollLeft=0}},[H,b,c,R,L]);const x=s.useCallback(W=>{if(!(L||xn(W.key)))switch(W.key){case"Escape":R&&b.current.stopHeaderFilterEditMode();break;case"Enter":if(R){b.current.stopHeaderFilterEditMode();break}if(W.metaKey||W.ctrlKey){m.current=D.current,b.current.showHeaderFilterMenu(g.field);break}b.current.startHeaderFilterEditMode(g.field);break;
32case"Tab":{if(R){var ee;const K=(ee=p[l+(W.shiftKey?-1:1)])!=null?ee:null;K&&(b.current.startHeaderFilterEditMode(K),b.current.setColumnHeaderFilterFocus(K,W))}break}default:if(R||W.metaKey||W.ctrlKey||W.altKey||W.shiftKey)break;b.current.startHeaderFilterEditMode(g.field);break}},[b,g.field,l,p,m,R,L]),F=s.useCallback((W,ee)=>K=>{b.current.publishEvent(W,b.current.getColumnHeaderParams(g.field),K),ee&&ee(K)},[b,g.field]),T=s.useCallback(W=>{c||(I.current&&I.current.contains(W.target)&&I.current.focus(),b.current.setColumnHeaderFilterFocus(g.field,W))},[b,g.field,c]),k=s.useMemo(()=>({onKeyDown:F("headerFilterKeyDown",x),onClick:F("headerFilterClick"),onMouseDown:F("headerFilterMouseDown",T),onBlur:F("headerFilterBlur")}),[T,x,F]),G=U({},y,{colDef:g}),z=yC(G),N=(a==null||(n=a.find(({value:W})=>f.operator===W))==null?void 0:n.requiresFilterValue)===!1,j=!!f?.value||N,B=(o=$.headerLabel)!=null?o:b.current.getLocaleText(`headerFilterOperator${pt(f.operator)}`),Z=j||c;return P.jsxs("div",U({className:Se(z.root,u),ref:_,style:{height:i,width:d,minWidth:d,maxWidth:d},role:"columnheader","aria-colindex":l+1,"aria-label":S==null?(r=g.headerName)!=null?r:g.field:void 0},v,k,{children:[S,H&&S===void 0?P.jsxs(s.Fragment,{children:[P.jsx(H,U({apiRef:b,item:f,inputRef:I,applyValue:O,onFocus:()=>b.current.startHeaderFilterEditMode(g.field),onBlur:W=>{var ee;b.current.stopHeaderFilterEditMode(),(ee=W.relatedTarget)!=null&&ee.className.includes("columnHeader")||b.current.setState(K=>U({},K,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))},label:pt(B),placeholder:"",isFilterActive:Z,clearButton:C&&j?P.jsx(SC,{onClick:M}):null,disabled:N,tabIndex:-1,InputLabelProps:null,sx:g.type==="date"||g.type==="dateTime"?IC:void 0},N?{value:""}:{},$?.InputComponentProps,h)),P.jsx(vC,{operators:a,item:f,field:g.field,applyFilterChanges:O,headerFilterMenuRef:m,buttonRef:D})]}):null]}))});function FC({open:e,field:t,target:n,applyFilterChanges:o,operators:r,item:l,id:i,labelledBy:c}){const a=he(),d=s.useCallback(()=>{a.current.hideHeaderFilterMenu()},[a]),u=s.useCallback(g=>{g.key==="Tab"&&g.preventDefault(),(g.key==="Escape"||g.key==="Tab")&&d()},[d]);return n?P.jsx(so,{placement:"bottom-end",open:e,target:n,onClose:d,children:P.jsx(Yn,{"aria-labelledby":c,id:i,onKeyDown:u,children:r.map((g,f)=>{var m;const h=(m=g?.headerLabel)!=null?m:a.current.getLocaleText(`headerFilterOperator${pt(g.value)}`);return P.jsx(Ze,{onClick:()=>{o(U({},l,{operator:g.value})),d()},autoFocus:f===0?e:!1,selected:g.value===l.operator,children:h},`${t}-${g.value}`)})})}):null}const qs=e=>`auto-generated-row-${e.map(n=>`${n.field}/${n.key}`).join("-")}`,Qs=({id:e,tree:t})=>{const n=[];let o=t[e];for(;o.id!==Ee;)n.push({field:o.type==="leaf"?null:o.groupingField,key:o.groupingKey}),o=t[o.parent];return n.reverse(),n},cl=(e,t,n)=>{let o;return e.id===Ee?o=!0:n?o=n(e):o=t===-1||t>e.depth,e.childrenExpanded=o,e},Qn=(e,t,n,o)=>{var r;t[e.id]=e,n[e.depth]=((r=n[e.depth])!=null?r:0)+1;const l=t[e.parent];if(e.type==="group"||e.type==="leaf"){var i,c,a;const d=(i=e.groupingField)!=null?i:"__no_field__",u=(c=e.groupingKey)!=null?c:"__no_key__",g=(a=l.childrenFromPath)==null?void 0:a[d];o!==null&&o[l.id]===t[l.id]?l.children=[...l.children,e.id]:l.children.push(e.id),g==null?l.childrenFromPath[d]={[u.toString()]:e.id}:g[u.toString()]=e.id}else e.type==="footer"&&(l.footerId=e.id)},Oo=({node:e,tree:t,treeDepths:n})=>{delete t[e.id];const o=e.depth,r=n[o];r===1?delete n[o]:n[o]=r-1;const l=t[e.parent];if(e.type==="footer")t[l.id]=U({},l,{footerId:null});else{var i,c;const a=(i=e.groupingField)!=null?i:"__no_field__",d=(c=e.groupingKey)!=null?c:"__no_key__",u=l.children.filter(f=>f!==e.id),g=l.childrenFromPath;delete g[a][d.toString()],t[l.id]=U({},l,{children:u,childrenFromPath:g})}},Zs=({node:e,updatedNode:t,previousTree:n,tree:o,treeDepths:r})=>{e.children.forEach(i=>{o[i]=U({},o[i],{parent:t.id})}),Oo({node:e,tree:o,treeDepths:r});const l=U({},e,t);Qn(l,o,r,n)},kC=()=>({value:{},addAction(e,t){this.value[e]||(this.value[e]={}),this.value[e][t]=!0}}),EC=({tree:e,filteredRowsLookup:t})=>{if(!t)return{};const n={},o=(l,i)=>{const c=t[l.id];
32l.type==="group"&&l.children.forEach(a=>{const d=e[a];o(d,i&&!!l.childrenExpanded)}),n[l.id]=c&&i,l.type==="group"&&l.footerId!=null&&(n[l.footerId]=c&&i&&!!l.childrenExpanded)},r=Object.values(e);for(let l=0;l<r.length;l+=1){const i=r[l];i.depth===0&&o(i,!0)}return n},$o=({id:e,path:t,updatedGroupsManager:n,previousTree:o,tree:r,treeDepths:l,onDuplicatePath:i,isGroupExpandedByDefault:c,defaultGroupingExpansionDepth:a})=>{let d=Ee;for(let g=0;g<t.length;g+=1){var u;const{key:f,field:m}=t[g],h=m??"__no_field__",C=f??"__no_key__",v=(u=r[d].childrenFromPath)==null||(u=u[h])==null?void 0:u[C.toString()];if(g===t.length-1)if(v==null){const b={type:"leaf",id:e,depth:g,parent:d,groupingKey:f};n?.addAction(d,"insertChildren"),Qn(b,r,l,o)}else{const b=r[v];b.type==="group"&&b.isAutoGenerated?(n?.addAction(d,"removeChildren"),n?.addAction(d,"insertChildren"),Zs({tree:r,previousTree:o,treeDepths:l,node:b,updatedNode:{id:e,isAutoGenerated:!1}})):i?.(v,e,t)}else if(v==null){const b=qs(t.slice(0,g+1)),p={type:"group",id:b,parent:d,depth:g,isAutoGenerated:!0,groupingKey:f,groupingField:m,children:[],childrenFromPath:{},childrenExpanded:!1};n?.addAction(d,"insertChildren"),Qn(cl(p,a,c),r,l,o),d=b}else{const b=r[v];if(b.type!=="group"){const p={type:"group",id:b.id,parent:b.parent,depth:b.depth,isAutoGenerated:!1,groupingKey:f,groupingField:m,children:[],childrenFromPath:{},childrenExpanded:!1};r[v]=cl(p,a,c)}d=b.id}}},DC=e=>{const t=[],n={[Ee]:Nl()},o={};for(let r=0;r<e.nodes.length;r+=1){const l=e.nodes[r];t.push(l.id),$o({tree:n,previousTree:e.previousTree,id:l.id,path:l.path,onDuplicatePath:e.onDuplicatePath,treeDepths:o,isGroupExpandedByDefault:e.isGroupExpandedByDefault,defaultGroupingExpansionDepth:e.defaultGroupingExpansionDepth})}return{tree:n,treeDepths:o,groupingName:e.groupingName,dataRowIds:t}};class ul{constructor(t,n){this.next=void 0,this.data=void 0,this.next=n,this.data=t}insertAfter(t){if(!t.first||!t.last)return;const n=this.next;this.next=t.first,t.last.next=n}}class Mn{constructor(t,n){this.first=void 0,this.last=void 0,this.first=t,this.last=n}data(){const t=[];return this.forEach(n=>{t.push(n.data)}),t}forEach(t){let n=this.first;for(;n!==null;)t(n),n=n.next}static from(t){if(t.length===0)return new Mn(null,null);let n=0;const o=new ul(t[n],null);let r=o;for(;n+1<t.length;){n+=1;const l=new ul(t[n],null);r.next=l,r=l}return new Mn(o,r)}}const RC=e=>{const{rowTree:t,disableChildrenSorting:n,sortRowList:o}=e,r=new Map,l=c=>{const a=!!o&&(!n||c.depth===-1);let d;if(a){for(let u=0;u<c.children.length;u+=1){const g=t[c.children[u]];g.type==="group"&&l(g)}d=o(c.children.map(u=>t[u]))}else{for(let u=0;u<c.children.length;u+=1){const g=t[c.children[u]];g.type==="group"&&l(g)}d=[...c.children]}c.footerId!=null&&d.push(c.footerId),r.set(c.id,d)};l(t[Ee]);const i=Mn.from(r.get(Ee));return i.forEach(c=>{const a=r.get(c.data);a!=null&&a.length&&c.insertAfter(Mn.from(a))}),i.data()},Ys=({node:e,tree:t,treeDepths:n,updatedGroupsManager:o})=>{Oo({node:e,tree:t,treeDepths:n}),e.type==="group"&&e.footerId!=null&&Oo({node:t[e.footerId],tree:t,treeDepths:n});const r=t[e.parent];o?.addAction(r.id,"removeChildren"),r.id!==Ee&&r.children.length===0&&(r.isAutoGenerated?Ys({node:r,tree:t,treeDepths:n}):t[r.id]={type:"leaf",id:r.id,depth:r.depth,parent:r.parent,groupingKey:r.groupingKey})},TC=({node:e,tree:t,treeDepths:n,updatedGroupsManager:o})=>{o?.addAction(e.parent,"removeChildren"),o?.addAction(e.parent,"insertChildren"),Zs({previousTree:null,tree:t,treeDepths:n,node:e,updatedNode:{id:qs(Qs({id:e.id,tree:t})),isAutoGenerated:!0}})},al=({id:e,tree:t,treeDepths:n,updatedGroupsManager:o})=>{const r=t[e];r.type==="group"&&r.children.length>0?TC({node:r,tree:t,treeDepths:n,updatedGroupsManager:o}):Ys({node:r,tree:t,treeDepths:n,updatedGroupsManager:o})},HC=e=>{const t=U({},e.previousTree),n=U({},e.previousTreeDepth),o=kC();for(let l=0;l<e.nodes.inserted.length;l+=1){const{id:i,path:c}=e.nodes.inserted[l];$o({previousTree:e.previousTree,tree:t,treeDepths:n,updatedGroupsManager:o,id:i,path:c,onDuplicatePath:e.onDuplicatePath,isGroupExpandedByDefault:e.isGroupExpandedByDefault,defaultGroupingExpansionDepth:e.defaultGroupingExpansionDepth})}for(let l=0;l<e.nodes.removed.length;l+=1){const i=e.nodes.removed[l];al({tree:t,treeDepths:n,updatedGroupsManager:o,id:i})}for(let l=0;l<e.nodes.modified.length;l+=1){const{id:i,path:c}=e.nodes.modified[l],a=Qs({tree:t,id:i});Gt(a,c)?o?.addAction(t[i].parent,"modifyChildren"):(al({tree:t,treeDepths:n,updatedGroupsManager:o,id:i}),$o({previousTree:e.previousTree,tree:t,treeDepths:n,updatedGroupsManager:o,id:i,path:c,onDuplicatePath:e.onDuplicatePath,isGroupExpandedByDefault:e.isGroupExpandedByDefault,defaultGroupingExpansionDepth:e.defaultGroupingExpansionDepth}))}const r=ro(t,Ee,!0);return{tree:t,treeDepths:n,groupingName:e.groupingName,dataRowIds:r,updatedGroupsManager:o}},OC=["hideDescendantCount"],$C=(e,t)=>{const n=s.useCallback(()=>{e.current.setStrategyAvailability("rowTree",Et,t.treeData?()=>!0:()=>!1)},[e,t.treeData]),o=s.useCallback(()=>{var d;const u=t.groupingColDef;let g;typeof u=="function"?g=u({groupingName:Et,fields:[]}):g=u;
32const f=(d=g)!=null?d:{},{hideDescendantCount:m}=f,h=Qt(f,OC),C=U({},cC,{renderCell:v=>P.jsx(gC,U({},v,{hideDescendantCount:m})),headerName:e.current.getLocaleText("treeDataGroupingHeaderName")});return U({},C,h,il)},[e,t.groupingColDef]),r=s.useCallback(d=>{const u=il.field,g=t.treeData,f=d.lookup[u];if(g){const m=o();if(f&&(m.width=f.width,m.flex=f.flex),d.lookup[u]=m,f==null){const h=d.orderedFields[0]===St?1:0;d.orderedFields=[...d.orderedFields.slice(0,h),u,...d.orderedFields.slice(h)]}}else!g&&f&&(delete d.lookup[u],d.orderedFields=d.orderedFields.filter(m=>m!==u));return d},[t.treeData,o]),l=s.useCallback(d=>{if(!t.getTreeDataPath)throw new Error("MUI: No getTreeDataPath given.");const u=f=>({id:f,path:t.getTreeDataPath(d.dataRowIdToModelLookup[f]).map(m=>({key:m,field:null}))}),g=(f,m,h)=>{throw new Error(["MUI: The path returned by `getTreeDataPath` should be unique.",`The rows with id #${f} and #${m} have the same.`,`Path: ${JSON.stringify(h.map(C=>C.key))}.`].join(` 33`))};return d.updates.type==="full"?DC({previousTree:d.previousTree,nodes:d.updates.rows.map(u),defaultGroupingExpansionDepth:t.defaultGroupingExpansionDepth,isGroupExpandedByDefault:t.isGroupExpandedByDefault,groupingName:Et,onDuplicatePath:g}):HC({nodes:{inserted:d.updates.actions.insert.map(u),modified:d.updates.actions.modify.map(u),removed:d.updates.actions.remove},previousTree:d.previousTree,previousTreeDepth:d.previousTreeDepths,defaultGroupingExpansionDepth:t.defaultGroupingExpansionDepth,isGroupExpandedByDefault:t.isGroupExpandedByDefault,groupingName:Et})},[t.getTreeDataPath,t.defaultGroupingExpansionDepth,t.isGroupExpandedByDefault]),i=s.useCallback(d=>{const u=nt(e);return aC({rowTree:u,isRowMatchingFilters:d.isRowMatchingFilters,disableChildrenFiltering:t.disableChildrenFiltering,filterModel:d.filterModel,apiRef:e})},[e,t.disableChildrenFiltering]),c=s.useCallback(d=>{const u=nt(e);return RC({rowTree:u,sortRowList:d.sortRowList,disableChildrenSorting:t.disableChildrenSorting})},[e,t.disableChildrenSorting]);Ie(e,"hydrateColumns",r),Ht(e,Et,"rowTreeCreation",l),Ht(e,Et,"filtering",i),Ht(e,Et,"sorting",c),Ht(e,Et,"visibleRowsLookupCreation",EC),gn(()=>{n()});const a=s.useRef(!0);s.useEffect(()=>{a.current?a.current=!1:n()},[n])},Xs=dt,yt="__detail_panel_toggle__",GC=U({},Xe,{field:yt,type:"detailPanelToggle",editable:!1,sortable:!1,filterable:!1,resizable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,align:"left",width:40,valueGetter:e=>jt(e.api.state).includes(e.id),renderCell:e=>P.jsx(mC,U({},e)),renderHeader:()=>null}),LC=["rowId","height","style"],_C=Re("div",{name:"MuiDataGrid",slot:"DetailPanel",overridesResolver:(e,t)=>t.detailPanel})(({theme:e})=>({zIndex:2,width:"100%",position:"absolute",backgroundColor:(e.vars||e).palette.background.default,overflow:"auto"}));function VC(e){const{rowId:t,height:n,style:o={}}=e,r=Qt(e,LC),l=Xs(),i=s.useRef(null),a=it();s.useLayoutEffect(()=>{n==="auto"&&typeof ResizeObserver>"u"&&l.current.storeDetailPanelHeight(t,i.current.clientHeight)},[l,n,t]),s.useLayoutEffect(()=>{if(n!=="auto"||typeof ResizeObserver>"u")return;const g=new ResizeObserver(f=>{const[m]=f,h=m.borderBoxSize&&m.borderBoxSize.length>0?m.borderBoxSize[0].blockSize:m.contentRect.height;l.current.storeDetailPanelHeight(t,h)});return g.observe(i.current),()=>g.disconnect()},[l,n,t]);const d=U({},o,{height:n});return P.jsx(_C,U({ref:i,ownerState:a,style:d},r))}const AC=["className","disableVirtualization"],Fn=(e,t,n)=>{var o,r;if(!Array.isArray(e.left)&&!Array.isArray(e.right))return[[],[]];if(((o=e.left)==null?void 0:o.length)===0&&((r=e.right)==null?void 0:r.length)===0)return[[],[]];const l=(d,u)=>Array.isArray(d)?d.filter(g=>u.includes(g)):[],i=l(e.left,t),c=t.filter(d=>!i.includes(d)),a=l(e.right,c);return n?[a,i]:[i,a]},zC=e=>{const{classes:t}=e;return ae({leftPinnedColumns:["pinnedColumns","pinnedColumns--left"],rightPinnedColumns:["pinnedColumns","pinnedColumns--right","withBorderColor"],topPinnedRows:["pinnedRows","pinnedRows--top"],bottomPinnedRows:["pinnedRows","pinnedRows--bottom"],pinnedRowsRenderZone:["pinnedRowsRenderZone"],detailPanels:["detailPanels"],detailPanel:["detailPanel"]},de,t)},dl=e=>{let t;return t=4.5*Math.log(e+1)+2,t/100},Js=e=>e.vars?"rgba(0 0 0 / 0.21)":qe(e.palette.common.black,.21),jC=Re("div",{name:"MuiDataGrid",slot:"DetailPanels",overridesResolver:(e,t)=>t.detailPanels})({position:"relative"}),ei=`linear-gradient(${qe("#fff",dl(2))}, ${qe("#fff",dl(2))})`,nn=Re("div",{name:"MuiDataGrid",slot:"PinnedColumns",overridesResolver:(e,t)=>[{[`&.${V["pinnedColumns--left"]}`]:t["pinnedColumns--left"]},{[`&.${V["pinnedColumns--right"]}`]:t["pinnedColumns--right"]},t.pinnedColumns]})(({theme:e,ownerState:t})=>{var n;const o=Js(e);return U({position:"sticky",overflow:"hidden",zIndex:1,backgroundColor:(e.vars||e).palette.background.default},e.vars?{backgroundImage:(n=e.vars.overlays)==null?void 0:n[2]}:U({},e.palette.mode==="dark"&&{backgroundImage:ei}),t.side===De.left&&{left:0,float:"left",boxShadow:`2px 0px 4px -2px ${o}`},t.side===De.right&&{right:0,float:"right",boxShadow:`-2px 0px 4px -2px ${o}`},t.side===De.right&&t.showCellVerticalBorder&&{borderLeftWidth:"1px",borderLeftStyle:"solid"})});var Zn=(function(e){return e.top="top",e.bottom="bottom",e})(Zn||{});const gl=Re("div",{name:"MuiDataGrid",slot:"PinnedRows",overridesResolver:(e,t)=>[{[`&.${V["pinnedRows--top"]}`]:t["pinnedRows--top"]},{[`&.${V["pinnedRows--bottom"]}`]:t["pinnedRows--bottom"]},t.pinnedRows]})(({theme:e,ownerState:t})=>{var n;const o=Js(e);return U({position:"sticky",zIndex:4,backgroundColor:(e.vars||e).palette.background.default},e.vars?{backgroundImage:(n=e.vars.overlays)==null?void 0:n[2]}:U({},e.palette.mode==="dark"&&{backgroundImage:ei}),t.position==="top"&&{top:0,boxShadow:`0px 3px 4px -2px ${o}`},t.position===Zn.bottom&&{boxShadow:`0px -3px 4px -2px ${o}`,bottom:0})}),fl=Re("div")({position:"absolute"}),NC=s.forwardRef(function(t,n){const o=Qt(t,AC),r=Xs(),l=it(),i=q(r,Lt),c=q(r,jt),a=q(r,cr),d=q(r,Ks),u=s.useRef(null),g=s.useRef(null),f=s.useRef(null),m=s.useRef(null),h=st(),C=s.useCallback(({top:K,left:ce})=>{u.current&&(u.current.style.transform=`translate3d(0px, ${K}px, 0px)`),g.current&&(g.current.style.transform=`translate3d(0px, ${K}px, 0px)`),f.current&&(f.current.style.transform=`translate3d(${ce}px, 0px, 0px)`),m.current&&(m.current.style.transform=`translate3d(${ce}px, 0px, 0px)`)},[]),v=s.useMemo(()=>{const K=new Set;
33return c.forEach(ce=>{K.add(ce)}),K},[c]),b=s.useCallback(K=>v.has(K)?{style:{marginBottom:d[K]}}:null,[d,v]),p=q(r,Ot),[y,E]=Fn(p,i,h.direction==="rtl"),_=q(r,Yt),I=s.useMemo(()=>_?.top||[],[_?.top]),D=s.useMemo(()=>_?.bottom||[],[_?.bottom]),R=U({},l,{classes:l.classes}),L=zC(R),{renderContext:$,getRows:H,getRootProps:O,getContentProps:M,getRenderZoneProps:S,updateRenderZonePosition:x}=Yh(U({ref:n,renderZoneMinColumnIndex:y.length,renderZoneMaxColumnIndex:i.length-E.length,onRenderZonePositioning:C,getRowProps:b},t)),F=s.useCallback(()=>{$&&x($)},[$,x]);Q(r,"columnWidthChange",F),Q(r,"columnOrderChange",F),Q(r,"rowOrderChange",F);const T=$&&y.length>0?U({},$,{firstColumnIndex:0,lastColumnIndex:y.length}):null,k=$&&E.length>0?U({},$,{firstColumnIndex:i.length-E.length,lastColumnIndex:i.length}):null,G=K=>{const ce=Kt(r.current.state),we=a[K],ue=r.current.getRowIndexRelativeToVisibleRows(K),se=ue!==void 0;if(s.isValidElement(we)&&se){const be=r.current.detailPanelHasAutoHeight(K)?"auto":d[K],ye=r.current.unstable_getRowInternalSizes(K),Pe=ye?.spacingTop||0,Y=ce.positions[ue]+r.current.unstable_getRowHeight(K)+Pe;return P.jsx(VC,{rowId:K,style:{top:Y},height:be,className:L.detailPanel,children:we},K)}return null},z=[],N=H({renderContext:$,rows:I,position:"center"}),j=Wo(r),B=H({renderContext:$,rowIndexOffset:I.length,position:"center",onRowRender:K=>{if(l.getDetailPanelContent==null||!v.has(K))return;const ce=G(K);ce&&z.push(ce)}}),Z=H({renderContext:$,rows:D,rowIndexOffset:I.length+(B?B.length:0),position:"center"}),W=M(),ee={minHeight:W.style.minHeight};return W.style.minHeight&&W.style.minHeight==="100%"&&(W.style.minHeight=`calc(100% - ${j.top}px - ${j.bottom}px)`),P.jsxs(Dm,U({},O(o),{children:[P.jsx(Ec,{}),I.length>0?P.jsxs(gl,{className:L.topPinnedRows,ownerState:U({},R,{position:Zn.top}),style:{width:W.style.width,height:j.top},role:"rowgroup",children:[T&&P.jsx(nn,{className:L.leftPinnedColumns,ownerState:U({},R,{side:De.left,showCellVerticalBorder:l.showCellVerticalBorder}),children:H({renderContext:T,minFirstColumn:T.firstColumnIndex,maxLastColumn:T.lastColumnIndex,availableSpace:0,rows:I,position:"left"})}),P.jsx(fl,{className:L.pinnedRowsRenderZone,ref:f,role:"presentation",children:N}),k&&P.jsx(nn,{className:L.rightPinnedColumns,ownerState:U({},R,{side:De.right,showCellVerticalBorder:l.showCellVerticalBorder}),children:H({renderContext:k,minFirstColumn:k.firstColumnIndex,maxLastColumn:k.lastColumnIndex,availableSpace:0,rows:I,position:"right"})})]}):null,P.jsxs(Hm,U({},W,{children:[T&&P.jsx(nn,{ref:u,className:L.leftPinnedColumns,ownerState:U({},R,{side:De.left,showCellVerticalBorder:l.showCellVerticalBorder}),style:ee,children:H({renderContext:T,minFirstColumn:T.firstColumnIndex,maxLastColumn:T.lastColumnIndex,availableSpace:0,rowIndexOffset:I.length,position:"left"})}),P.jsx(Lm,U({},S(),{children:B})),k&&P.jsx(nn,{ref:g,ownerState:U({},R,{side:De.right,showCellVerticalBorder:l.showCellVerticalBorder}),className:L.rightPinnedColumns,style:ee,children:H({renderContext:k,minFirstColumn:k.firstColumnIndex,maxLastColumn:k.lastColumnIndex,availableSpace:0,rowIndexOffset:I.length,position:"right"})}),z.length>0&&P.jsx(jC,{className:L.detailPanels,ownerState:R,children:z})]})),D.length>0?P.jsxs(gl,{className:L.bottomPinnedRows,ownerState:U({},R,{position:Zn.bottom}),style:{width:W.style.width,height:j.bottom},role:"rowgroup",children:[T&&P.jsx(nn,{className:L.leftPinnedColumns,ownerState:U({},R,{side:De.left,showCellVerticalBorder:l.showCellVerticalBorder}),children:H({renderContext:T,minFirstColumn:T.firstColumnIndex,maxLastColumn:T.lastColumnIndex,availableSpace:0,rows:D,rowIndexOffset:I.length+(B?B.length:0),position:"left"})}),P.jsx(fl,{className:L.pinnedRowsRenderZone,ref:m,role:"presentation",children:Z}),k&&P.jsx(nn,{className:L.rightPinnedColumns,ownerState:U({},R,{side:De.right,showCellVerticalBorder:l.showCellVerticalBorder}),children:H({renderContext:k,minFirstColumn:k.firstColumnIndex,maxLastColumn:k.lastColumnIndex,availableSpace:0,rows:D,rowIndexOffset:I.length+(B?B.length:0),position:"right"})})]}):null]}))}),ti=(e,t,n)=>{var o;n.current.caches.columnPinning={orderedFieldsBeforePinningColumns:null};let r;if(t.disableColumnPinning)r={};else if(t.pinnedColumns)r=t.pinnedColumns;else if((o=t.initialState)!=null&&o.pinnedColumns){var l;r=(l=t.initialState)==null?void 0:l.pinnedColumns}else r={};return U({},e,{pinnedColumns:r})},hl=e=>t=>U({},t,{pinnedColumns:e}),BC=(e,t)=>{var n;const o=q(e,Ot),r=st(),l=s.useCallback((p,y)=>{if(t.disableColumnPinning)return p;const E=Lt(e),[_,I]=Fn(o,E,r.direction==="rtl");
33if(!y.colIndex||_.length===0&&I.length===0)return p;const D=Ae(e),R=kn(e),L=Ut(e),$=e.current.virtualScrollerRef.current.clientWidth,H=Math.abs(e.current.virtualScrollerRef.current.scrollLeft),O=D[y.colIndex].computedWidth,M=L[y.colIndex],S=L[_.length],x=R-L[L.length-I.length],F=M+O;if(F-($-x)>H){const T=F-($-x);return U({},p,{left:T})}if(M<H+S){const T=M-S;return U({},p,{left:T})}return p},[e,o,t.disableColumnPinning,r.direction]),i=s.useCallback((p,y)=>t.disableColumnPinning||y.pinnable===!1?p:[...p,"columnMenuPinningItem"],[t.disableColumnPinning]),c=s.useCallback((p,{targetIndex:y})=>{const E=Lt(e),[_,I]=Fn(o,E,r.direction==="rtl");if(_.length===0&&I.length===0)return p;if(_.length>0&&y<_.length)return!1;if(I.length>0){const R=Ae(e).length-I.length;return y>=R?!1:p}return p},[e,o,r.direction]),a=s.useCallback((p,y)=>{var E,_,I;const D=Ot(e.current.state);return!y.exportOnlyDirtyModels||t.pinnedColumns!=null||((E=t.initialState)==null?void 0:E.pinnedColumns)!=null||((_=D.left)!=null?_:[]).length>0||((I=D.right)!=null?I:[]).length>0?U({},p,{pinnedColumns:D}):p},[e,t.pinnedColumns,(n=t.initialState)==null?void 0:n.pinnedColumns]),d=s.useCallback((p,y)=>{const E=y.stateToRestore.pinnedColumns;return E!=null&&e.current.setState(hl(E)),p},[e]);Ie(e,"scrollToIndexes",l),Ie(e,"columnMenu",i),Ie(e,"canBeReordered",c),Ie(e,"exportState",a),Ie(e,"restoreState",d),e.current.registerControlState({stateId:"pinnedColumns",propModel:t.pinnedColumns,propOnChange:t.onPinnedColumnsChange,stateSelector:Ot,changeEvent:"pinnedColumnsChange"});const u=s.useCallback(p=>{if(t.disableColumnPinning)throw new Error(`MUI: You cannot call \`apiRef.current.${p}\` when \`disableColumnPinning\` is true.`)},[t.disableColumnPinning]),g=s.useCallback((p,y)=>{if(u("pinColumn"),e.current.isColumnPinned(p)===y)return;const E=y===De.right?De.left:De.right,_={[y]:[...o[y]||[],p],[E]:(o[E]||[]).filter(I=>I!==p)};e.current.setPinnedColumns(_)},[e,u,o]),f=s.useCallback(p=>{u("unpinColumn"),e.current.setPinnedColumns({left:(o.left||[]).filter(y=>y!==p),right:(o.right||[]).filter(y=>y!==p)})},[e,u,o.left,o.right]),m=s.useCallback(()=>(u("getPinnedColumns"),Ot(e.current.state)),[e,u]),h=s.useCallback(p=>{u("setPinnedColumns"),e.current.setState(hl(p)),e.current.forceUpdate()},[e,u]),C=s.useCallback(p=>(u("isColumnPinned"),(o.left||[]).includes(p)?De.left:(o.right||[]).includes(p)?De.right:!1),[o.left,o.right,u]);ge(e,{pinColumn:g,unpinColumn:f,getPinnedColumns:m,setPinnedColumns:h,isColumnPinned:C},"public");const b=s.useCallback(p=>{if(!e.current.caches.columnPinning.orderedFieldsBeforePinningColumns)return;const{column:y,targetIndex:E,oldIndex:_}=p,I=E>_?1:-1,R=at(e)[E-I],L=[...e.current.caches.columnPinning.orderedFieldsBeforePinningColumns];let $=L.findIndex(M=>M===y.field),H=$+I;const O=L.findIndex(M=>M===R);for(;I>0?$<O:$>O;){for(;e.current.isColumnPinned(L[H]);)H+=I;const M=L[$];L[$]=L[H],L[H]=M,$=H,H=$+I}e.current.caches.columnPinning.orderedFieldsBeforePinningColumns=L},[e]);Q(e,"columnOrderChange",b),s.useEffect(()=>{t.pinnedColumns&&e.current.setPinnedColumns(t.pinnedColumns)},[e,t.pinnedColumns])},UC=(e,t)=>{const{disableColumnPinning:n,pinnedColumns:o,initialState:r}=t,l=st();let i=Ot(e.current.state);if(i==null){const d=ti(e.current.state,{disableColumnPinning:n,pinnedColumns:o,initialState:r},e);i=Ot(d)}const c=s.useRef([]),a=s.useCallback(d=>{if(d.orderedFields.length===0||n)return d;const[u,g]=Fn(i,d.orderedFields,l.direction==="rtl");let f;const m=[...u,...g],{orderedFieldsBeforePinningColumns:h}=e.current.caches.columnPinning;if(h){f=new Array(d.orderedFields.length).fill(null);const v=[...f],b=[...d.orderedFields];c.current.forEach(y=>{if(!m.includes(y)&&d.lookup[y]){const E=h.indexOf(y);f[E]=y,v[E]=y,b.splice(b.indexOf(y),1)}}),m.forEach(y=>{let E=h.indexOf(y);if((E===-1||E>=v.length)&&(E=d.orderedFields.indexOf(y)),v[E]!==null)for(E=0;v[E]!==null;)E+=1;f[E]=y,v[E]=y,b.splice(b.indexOf(y),1)});let p=0;b.forEach(y=>{for(;v[p]!==null;)p+=1;v[p]=y,f[p]=y}),e.current.caches.columnPinning.orderedFieldsBeforePinningColumns=v}else f=[...d.orderedFields],e.current.caches.columnPinning.orderedFieldsBeforePinningColumns=[...d.orderedFields];c.current=m;const C=f.filter(v=>!u.includes(v)&&!g.includes(v));return U({},d,{orderedFields:[...u,...C,...g]})},[e,n,i,l.direction]);Ie(e,"hydrateColumns",a)},WC=(e,t)=>{var n,o,r;return U({},e,{detailPanel:{heightCache:{},expandedRowIds:(n=(o=t.detailPanelExpandedRowIds)!=null?o:(r=t.initialState)==null||(r=r.detailPanel)==null?void 0:r.expandedRowIds)!=null?n:[]}})};function ml(e,t,n,o){if(typeof t!="function")return{};const r=rn(e),l=r.reduce((c,a)=>{const d=e.current.getRowParams(a);return c[a]=t(d),c},{}),i=r.reduce((c,a)=>{var d;if(l[a]==null)return c;const u=e.current.getRowParams(a),g=n(u),f=g==="auto";return c[a]={autoHeight:f,height:f?(d=o[a])==null?void 0:d.height:g},c},{});
33return{contentCache:l,heightCache:i}}const KC=(e,t)=>{const n=q(e,jt),o=q(e,cr),r=s.useCallback((y,E)=>{if(y.field!==yt||t.getDetailPanelContent==null)return;const _=o[y.id];s.isValidElement(_)&&E.target!==E.currentTarget&&e.current.toggleDetailPanel(y.id)},[e,o,t.getDetailPanelContent]),l=s.useCallback((y,E)=>{t.getDetailPanelContent!=null&&y.field===yt&&E.key===" "&&e.current.toggleDetailPanel(y.id)},[e,t.getDetailPanelContent]);Q(e,"cellClick",r),Q(e,"cellKeyDown",l),e.current.registerControlState({stateId:"detailPanels",propModel:t.detailPanelExpandedRowIds,propOnChange:t.onDetailPanelExpandedRowIdsChange,stateSelector:jt,changeEvent:"detailPanelsExpandedRowIdsChange"});const i=s.useCallback(y=>{if(t.getDetailPanelContent==null)return;const E=o[y];if(!s.isValidElement(E))return;const _=e.current.getExpandedDetailPanels();e.current.setExpandedDetailPanels(_.includes(y)?_.filter(I=>I!==y):[..._,y])},[e,o,t.getDetailPanelContent]),c=s.useCallback(()=>jt(e.current.state),[e]),a=s.useCallback(y=>{e.current.setState(E=>U({},E,{detailPanel:U({},E.detailPanel,{expandedRowIds:y})})),e.current.forceUpdate()},[e]),d=s.useCallback((y,E)=>{const _=Ho(e.current.state);!_[y]||_[y].height===E||(e.current.setState(I=>U({},I,{detailPanel:U({},I.detailPanel,{heightCache:U({},_,{[y]:U({},_[y],{height:E})})})})),e.current.requestPipeProcessorsApplication("rowHeight"))},[e]),u=s.useCallback(y=>{const E=Ho(e.current.state);return E[y]?E[y].autoHeight:!1},[e]),g={toggleDetailPanel:i,getExpandedDetailPanels:c,setExpandedDetailPanels:a},f={storeDetailPanelHeight:d,detailPanelHasAutoHeight:u};ge(e,g,"public"),ge(e,f,"private"),s.useEffect(()=>{t.detailPanelExpandedRowIds&&jt(e.current.state)!==t.detailPanelExpandedRowIds&&e.current.setExpandedDetailPanels(t.detailPanelExpandedRowIds)},[e,t.detailPanelExpandedRowIds]);const m=s.useCallback(()=>{e.current.setState(y=>U({},y,{detailPanel:U({},y.detailPanel,ml(e,t.getDetailPanelContent,t.getDetailPanelHeight,y.detailPanel.heightCache))})),e.current.forceUpdate()},[e,t.getDetailPanelContent,t.getDetailPanelHeight]);Q(e,"sortedRowsSet",m);const h=s.useRef(),C=s.useRef(),v=s.useCallback(()=>{t.getDetailPanelContent===h.current&&t.getDetailPanelHeight===C.current||(e.current.setState(y=>U({},y,{detailPanel:U({},y.detailPanel,ml(e,t.getDetailPanelContent,t.getDetailPanelHeight,y.detailPanel.heightCache))})),h.current=t.getDetailPanelContent,C.current=t.getDetailPanelHeight)},[e,t.getDetailPanelContent,t.getDetailPanelHeight]),b=s.useCallback((y,E)=>{var _;if(!n||n.length===0||!n.includes(E.id))return y.detail=0,y;v();const I=Ks(e);return y.detail=(_=I[E.id])!=null?_:0,y},[e,n,v]);Ie(e,"rowHeight",b);const p=s.useRef(!0);p.current&&(p.current=!1,v())},qC=(e,t)=>{const n=s.useCallback(r=>t.getDetailPanelContent==null?(r.lookup[yt]&&(delete r.lookup[yt],r.orderedFields=r.orderedFields.filter(l=>l!==yt)),r):(r.lookup[yt]||(r.orderedFields=[yt,...r.orderedFields],r.lookup[yt]=U({},GC,{headerName:e.current.getLocaleText("detailPanelToggle")})),r),[e,t.getDetailPanelContent]),o=s.useCallback((r,l)=>t.getDetailPanelContent==null||!jt(e.current.state).includes(l)?r:[...r,V["row--detailPanelExpanded"]],[e,t.getDetailPanelContent]);Ie(e,"hydrateColumns",n),Ie(e,"rowClassName",o)},QC=e=>{const{isDraggable:t,classes:n}=e;return ae({root:["rowReorderCell",t&&"rowReorderCell--draggable"],placeholder:["rowReorderCellPlaceholder"]},de,n)};function ZC(e){const t=he(),n=it(),o=q(t,Qe),r=q(t,an),l=q(t,Ne),i=e.row.__reorder__||e.id,c=s.useMemo(()=>!!n.rowReordering&&!o.length&&r===1&&Object.keys(l).length===0,[n.rowReordering,o,r,l]),a={isDraggable:c,classes:n.classes},d=QC(a),u=s.useCallback((f,m)=>h=>{dn(h)||t.current.getRow(e.id)&&(t.current.publishEvent(f,t.current.getRowParams(e.id),h),m&&m(h))},[t,e.id]),g=c?{onDragStart:u("rowDragStart"),onDragOver:u("rowDragOver"),onDragEnd:u("rowDragEnd")}:null;return e.rowNode.type==="footer"?null:P.jsxs("div",U({className:d.root,draggable:c},g,{children:[P.jsx(n.slots.rowReorderIcon,{}),P.jsx("div",{className:d.placeholder,children:i})]}))}const YC=e=>e.rowNode.type==="footer"||e.rowNode.type==="pinnedRow"?null:P.jsx(ZC,U({},e)),ni=U({},Xe,{field:"__reorder__",type:"reorder",sortable:!1,filterable:!1,width:50,align:"center",headerAlign:"center",disableColumnMenu:!0,disableExport:!0,disableReorder:!0,resizable:!1,aggregable:!1,renderHeader:()=>" ",renderCell:YC});var Go=(function(e){return e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e})(Go||{});let po=null,pn={previousTargetId:null,dragDirection:null};const XC=e=>{const{classes:t}=e;return ae({rowDragging:["row--dragging"]},de,t)},JC=(e,t)=>{const n=je(e,"useGridRowReorder"),o=q(e,Qe),r=q(e,an),l=s.useRef(null),i=s.useRef(null),c=s.useRef(),a={classes:t.classes},d=XC(a),[u,g]=s.useState("");s.useEffect(()=>()=>{clearTimeout(c.current)},[]);const f=s.useMemo(()=>!t.rowReordering||!!o.length||r!==1,[t.rowReordering,o,r]),m=s.useCallback((v,b)=>{const p=Ne(e.current.state);f||Object.keys(p).length!==0||(n.debug(`Start dragging row ${v.id}`),b.stopPropagation(),l.current=b.currentTarget,l.current.classList.add(d.rowDragging),g(v.id),c.current=setTimeout(()=>{l.current.classList.remove(d.rowDragging)}),i.current=e.current.getRowIndexRelativeToVisibleRows(v.id),e.current.setCellFocus(v.id,ni.field))},[f,d.rowDragging,n,e]),h=s.useCallback((v,b)=>{if(u==="")return;const p=e.current.getRowNode(v.id);if(!p||p.type==="footer"||p.type==="pinnedRow")return;n.debug(`Dragging over row ${v.id}`),b.preventDefault(),b.stopPropagation();const y=po?po.y-b.clientY:b.clientY;if(v.id!==u){const E=e.current.getRowIndexRelativeToVisibleRows(v.id),I={dragDirection:y>0?Go.DOWN:Go.UP,previousTargetId:v.id},D=I.dragDirection!==pn.dragDirection||I.previousTargetId!==pn.previousTargetId;(pn.dragDirection===null||Math.abs(y)>=1&&D)&&(e.current.setRowIndex(u,E),pn=I)}po={x:b.clientX,y:b.clientY}},[e,n,u]),C=s.useCallback((v,b)=>{const p=Ne(e.current.state);
33if(!(u===""||f||Object.keys(p).length!==0)){if(n.debug("End dragging row"),b.preventDefault(),b.stopPropagation(),clearTimeout(c.current),l.current=null,pn.dragDirection=null,b.dataTransfer.dropEffect==="none")e.current.setRowIndex(u,i.current),i.current=null;else{const y={row:e.current.getRow(u),targetIndex:e.current.getRowIndexRelativeToVisibleRows(v.id),oldIndex:i.current};e.current.publishEvent("rowOrderChange",y)}g("")}},[f,n,e,u]);Q(e,"rowDragStart",m),Q(e,"rowDragOver",h),Q(e,"rowDragEnd",C),Q(e,"cellDragOver",h),Me(e,"rowOrderChange",t.onRowOrderChange)},ep=e=>{const{classes:t}=e;return s.useMemo(()=>ae({rowReorderCellContainer:["rowReorderCellContainer"],columnHeaderReorder:["columnHeaderReorder"]},de,t),[t])},tp=(e,t)=>{const n={classes:t.classes},o=ep(n),r=s.useCallback(l=>{const i=U({},ni,{cellClassName:o.rowReorderCellContainer,headerClassName:o.columnHeaderReorder,headerName:e.current.getLocaleText("rowReorderingHeaderName")}),c=t.rowReordering,a=l.lookup[i.field]!=null;return c&&a||(c&&!a?(l.lookup[i.field]=i,l.orderedFields=[i.field,...l.orderedFields]):!c&&a&&(delete l.lookup[i.field],l.orderedFields=l.orderedFields.filter(d=>d!==i.field))),l},[e,o,t.rowReordering]);Ie(e,"hydrateColumns",r)};function np({apiRef:e,visibleRows:t,range:n}){let{firstRowIndex:o,lastRowIndex:r}=n;const l=t.slice(n.firstRowIndex,n.lastRowIndex);let i=0,c=l.length-1,a=!1;for(;!a&&o<r;){var d,u;const g=((d=e.current.getRowNode(l[i].id))==null?void 0:d.type)==="skeletonRow",f=((u=e.current.getRowNode(l[c].id))==null?void 0:u.type)==="skeletonRow";g&&f&&(a=!0),g||(i+=1,o+=1),f||(c-=1,r-=1)}return a?{firstRowIndex:o,lastRowIndex:r}:void 0}function wo({lazyLoadingFeatureFlag:e,rowsLoadingMode:t,gridDimensions:n}){return!e||!n||t!=="server"}const op=(e,t)=>{var n;const o=kt(e,t),r=q(e,Qe),l=q(e,Ve),i=s.useRef({firstRowToRender:0,lastRowToRender:0}),{lazyLoading:c}=(n=t.experimentalFeatures)!=null?n:{},a=s.useCallback(()=>{const f=e.current.getRenderContext(),[m,h]=Pt({firstIndex:f.firstRowIndex,lastIndex:f.lastRowIndex,minFirstIndex:0,maxLastIndex:o.rows.length,buffer:t.rowBuffer});return{firstRowToRender:m,lastRowToRender:h}},[e,t.rowBuffer,o.rows.length]),d=s.useCallback(f=>{const m=e.current.getRootDimensions();if(wo({lazyLoadingFeatureFlag:c,rowsLoadingMode:t.rowsLoadingMode,gridDimensions:m}))return;const h={firstRowToRender:f.firstRowToRender,lastRowToRender:f.lastRowToRender,sortModel:r,filterModel:l};if(!(i.current.firstRowToRender===f.firstRowToRender&&i.current.lastRowToRender===f.lastRowToRender)){if(r.length===0&&l.items.length===0){const C=np({apiRef:e,visibleRows:o.rows,range:{firstRowIndex:f.firstRowToRender,lastRowIndex:f.lastRowToRender}});if(!C)return;h.firstRowToRender=C.firstRowIndex,h.lastRowToRender=C.lastRowIndex}i.current=f,e.current.publishEvent("fetchRows",h)}},[e,t.rowsLoadingMode,r,l,o.rows,c]),u=s.useCallback(f=>{const m=e.current.getRootDimensions();if(wo({lazyLoadingFeatureFlag:c,rowsLoadingMode:t.rowsLoadingMode,gridDimensions:m}))return;e.current.requestPipeProcessorsApplication("hydrateRows");const{firstRowToRender:h,lastRowToRender:C}=a(),v={firstRowToRender:h,lastRowToRender:C,sortModel:f,filterModel:l};e.current.publishEvent("fetchRows",v)},[e,t.rowsLoadingMode,l,c,a]),g=s.useCallback(f=>{const m=e.current.getRootDimensions();if(wo({lazyLoadingFeatureFlag:c,rowsLoadingMode:t.rowsLoadingMode,gridDimensions:m}))return;e.current.requestPipeProcessorsApplication("hydrateRows");const{firstRowToRender:h,lastRowToRender:C}=a(),v={firstRowToRender:h,lastRowToRender:C,sortModel:r,filterModel:f};e.current.publishEvent("fetchRows",v)},[e,t.rowsLoadingMode,r,c,a]);Q(e,"renderedRowsIntervalChange",d),Q(e,"sortModelChange",u),Q(e,"filterModelChange",g),Me(e,"fetchRows",t.onFetchRows)},rp="auto-generated-skeleton-row-root",lp=e=>`${rp}-${e}`,sp=(e,t)=>{var n;const{lazyLoading:o}=(n=t.experimentalFeatures)!=null?n:{},r=s.useCallback(l=>{const i=l.tree[Ee];if(!o||t.rowsLoadingMode!=="server"||!t.rowCount||i.children.length>=t.rowCount)return l;const c=U({},l.tree),a=[...i.children];for(let d=0;d<t.rowCount-i.children.length;d+=1){const u=lp(d);a.push(u);const g={type:"skeletonRow",id:u,parent:Ee,depth:0};c[u]=g}return c[Ee]=U({},i,{children:a}),U({},l,{tree:c})},[t.rowCount,t.rowsLoadingMode,o]);Ie(e,"hydrateRows",r)};function oi(e,t){var n,o;const r={topIds:[],bottomIds:[],idLookup:{}};
33return e==null||(n=e.top)==null||n.forEach(l=>{const i=un(l,t);r.topIds.push(i),r.idLookup[i]=l}),e==null||(o=e.bottom)==null||o.forEach(l=>{const i=un(l,t);r.bottomIds.push(i),r.idLookup[i]=l}),r}const ip=(e,t,n)=>{var o;return n.current.caches.pinnedRows=oi(t.pinnedRows,t.getRowId),U({},e,{rows:U({},e.rows,{additionalRowGroups:U({},(o=e.rows)==null?void 0:o.additionalRowGroups,{pinnedRows:{top:[],bottom:[]}})})})},cp=(e,t)=>{const n=s.useCallback(r=>{e.current.caches.pinnedRows=oi(r,t.getRowId),e.current.requestPipeProcessorsApplication("hydrateRows")},[e,t.getRowId]);ge(e,{unstable_setPinnedRows:n},"public");const o=s.useRef(!0);s.useEffect(()=>{if(o.current){o.current=!1;return}e.current.unstable_setPinnedRows(t.pinnedRows)},[e,t.pinnedRows])};function Cl({groupingParams:e,rowModel:t,rowId:n,position:o,apiRef:r,isAutoGenerated:l}){var i,c;const a=U({},e.dataRowIdToModelLookup),d=U({},e.dataRowIdToIdLookup),u=U({},e.tree),g=U({},e.treeDepths);Qn({type:"pinnedRow",id:n,depth:0,parent:Ee,isAutoGenerated:l},u,g,null),a[n]=t,d[n]=n,r.current.caches.rows.dataRowIdToModelLo
33okup[n]=U({},t),r.current.caches.rows.dataRowIdToIdLookup[n]=n;const m=((i=e.additionalRowGroups)==null?void 0:i.pinnedRows)||{},h={id:n,model:t};return(c=e.additionalRowGroups)!=null&&(c=c.pinnedRows)!=null&&(c=c[o])!=null&&c.includes(h)?U({},e,{dataRowIdToModelLookup:a,dataRowIdToIdLookup:d,tree:u,treeDepths:g}):U({},e,{dataRowIdToModelLookup:a,dataRowIdToIdLookup:d,tree:u,treeDepths:g,additionalRowGroups:U({},e.additionalRowGroups,{pinnedRows:U({},m,{[o]:[...m[o]||[],h]})})})}const up=e=>{const t=s.useCallback(n=>{var o,r,l,i;const c=e.current.caches.pinnedRows||{};let a=U({},n,{additionalRowGroups:U({},n.additionalRowGroups,{pinnedRows:{}})});if((o=c.topIds)==null||o.forEach(d=>{a=Cl({groupingParams:a,rowModel:c.idLookup[d],rowId:d,position:"top",apiRef:e,isAutoGenerated:!1})}),(r=c.bottomIds)==null||r.forEach(d=>{a=Cl({groupingParams:a,rowModel:c.idLookup[d],rowId:d,position:"bottom",apiRef:e,isAutoGenerated:!1})}),(l=c.bottomIds)!=null&&l.length||(i=c.topIds)!=null&&i.length){const d=g=>!(a.tree[g]&&a.tree[g].type==="pinnedRow"),u=a.tree[Ee];a.tree[Ee]=U({},u,{children:u.children.filter(d)}),a.dataRowIds=a.dataRowIds.filter(d)}return a},[e]);Ie(e,"hydrateRows",t)},ap=(e,t)=>{const n=Af(e,t);return Ah(n,t),tp(n,t),$C(n,t),sp(n,t),up(n),qC(n,t),UC(n,t),Gh(n),_e(_m,n,t),_e(Lh,n,t),_e(WC,n,t),_e(ti,n,t),_e(Yf,n,t),_e(ip,n,t),_e(Rh,n,t),_e(Eh,n,t),_e(mh,n,t),_e(zh,n,t),_e(bh,n,t),_e(dh,n,t),_e(th,n,t),_e(Wm,n,t),_e(lC,n,t),_e(sh,n,t),_e(xm,n,t),_e(Wf,n,t),_e(Mm,n,t),_e(_a,n,t),Vm(n,t),iC(n),wh(n,t),_h(n,t),BC(n,t),cp(n,t),Xf(n,t),Th(n,t),$c(n,t),KC(n,t),ym(n),Fm(n,t),Dh(n,t),Ch(n,t),vh(n,t),hh(n,t),jh(n,t),nh(n,t),Km(n,t),sC(n,t),ih(n,t),Sm(n,t),JC(n,t),Nh(n,t),zm(n,t),op(n,t),Kf(n),lh(n,t),ah(n,t),Uf(n,t),Wh(n,t),Bh(n,t),Pm(n),Va(n,t),n},dp=U({},ms,{columnMenuPinningItem:fC}),gp=U({},Cs,{columnMenuPinningItem:{displayOrder:15}}),fp=s.forwardRef(function(t,n){return P.jsx(ps,U({ref:n},t,{defaultSlots:dp,defaultSlotProps:gp}))}),hp=["getColumnsToRender","getRootProps"],mp=e=>{const{classes:t}=e;return s.useMemo(()=>ae({headerFilterRow:["headerFilterRow"]},de,t),[t])},Cp=ze("div",{name:"MuiDataGrid",slot:"HeaderFilterRow",overridesResolver:(e,t)=>t.headerFilterRow})(()=>({display:"flex"})),pl=Object.create(null),pp=e=>{const t=dt(),{headerGroupingMaxDepth:n,hasOtherElementInTabSequence:o}=e,r=q(t,wc),l=Vs(U({},e,{hasOtherElementInTabSequence:o||r!==null})),{getColumnsToRender:i,getRootProps:c}=l,a=Qt(l,hp),d=s.useRef(null);t.current.register("private",{headerFiltersElementRef:d});const u=s.useRef(null),g=it(),f=mp(g),m=!g.unstable_headerFilters,h=Math.floor(g.columnHeaderHeight*e.densityFactor),C=q(t,Ve),v=Hn(t,g.columnHeaderHeight)+(m?0:h),b=q(t,pc),p=s.useCallback(_=>{const I=C?.items.find(L=>L.field===_.field&&L.operator!=="isAnyOf");if(I!=null)return I;const D=pl[_.field];if(D!=null)return D;const R=yo(_);return pl[_.field]=R,R},[C]),y=(_,I={})=>
33{if(m)return null;const D=i(_);if(D==null)return null;const{renderedColumns:R,firstColumnToRender:L}=D,$=[];for(let S=0;S<R.length;S+=1){var H,O,M;const x=R[S],F=L+S,T=b?.field===x.field,k=F===0,z=r?.field===x.field||k&&!e.hasOtherElementInTabSequence?0:-1,N=typeof x.headerClassName=="function"?x.headerClassName({field:x.field,colDef:x}):x.headerClassName,j=(H=(O=x.filterOperators)==null?void 0:O.filter(Z=>Z.value!=="isAnyOf"))!=null?H:[],B=p(x);$.push(P.jsx(g.slots.headerFilterCell,U({colIndex:F,height:h,width:x.computedWidth,colDef:x,hasFocus:T,tabIndex:z,headerFilterMenuRef:u,headerClassName:N,filterOperators:j,"data-field":x.field,item:B},(M=g.slotProps)==null?void 0:M.headerFilterCell,I),`${x.field}-filter`))}return P.jsx(Cp,{ref:d,ownerState:g,className:f.headerFilterRow,role:"row","aria-rowindex":n+2,children:$})},E={minHeight:v,maxHeight:v,lineHeight:`${h}px`};return U({},a,{getColumnFilters:y,getRootProps:m?c:(_={})=>U({style:E},_)})},wl=1,wp=1.5,bp=e=>{const{scrollDirection:t,classes:n}=e,o={root:["scrollArea",`scrollArea--${t}`]};return ae(o,de,n)},vp=ze("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(e,t)=>[{[`&.${V["scrollArea--left"]}`]:t["scrollArea--left"]},{[`&.${V["scrollArea--right"]}`]:t["scrollArea--right"]},t.scrollArea]})(()=>({position:"absolute",top:0,zIndex:101,width:20,bottom:0,[`&.${V["scrollArea--left"]}`]:{left:0},[`&.${V["scrollArea--right"]}`]:{right:0}}));function xp(e){const{scrollDirection:t}=e,n=s.useRef(null),o=he(),r=Dn(),[l,i]=s.useState(!1),[c,a]=s.useState(!0),d=q(o,Xt),u=q(o,kn),g=s.useRef({left:0,top:0}),f=it(),m=U({},f,{scrollDirection:t}),h=bp(m),C=Hn(o,f.columnHeaderHeight),v=Math.floor(f.columnHeaderHeight*d),b=s.useCallback(_=>{g.current=_;const I=o.current.getRootDimensions();a(()=>{if(t==="left")return g.current.left>0;if(t==="right"){const D=u-I.viewportInnerSize.width;return g.current.left<D}return!1})},[o,u,t]),p=s.useCallback(_=>{let I;if(_.preventDefault(),t==="left")I=_.clientX-n.current.getBoundingClientRect().right;else if(t==="right")I=Math.max(1,_.clientX-n.current.getBoundingClientRect().left);else throw new Error("MUI: Wrong drag direction");I=(I-wl)*wp+wl,r.start(0,()=>{o.current.scroll({left:g.current.left+I,top:g.current.top})})},[t,o,r]),y=Ge(()=>{i(!0)}),E=Ge(()=>{i(!1)});return Q(o,"scrollPositionChange",b),Q(o,"columnHeaderDragStart",y),Q(o,"columnHeaderDragEnd",E),!l||!c?null:P.jsx(vp,{ref:n,className:Se(h.root),ownerState:m,onDragOver:p,style:{height:v,top:C-v}})}const bl=s.memo(xp),Sp=["style","className","innerRef","visibleColumns","sortColumnLookup","filterColumnLookup","columnPositions","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","densityFactor","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence","pinnedColumns"],Pp=e=>{const{leftPinnedColumns:t,rightPinnedColumns:n,classes:o}=e,r={leftPinnedColumns:["pinnedColumnHeaders",t&&t.length>0&&"pinnedColumnHeaders--left"],rightPinnedColumns:["pinnedColumnHeaders",n&&n.length>0&&"pinnedColumnHeaders--right","withBorderColor"]};return ae(r,de,o)},vl=e=>{let t;return t=4.5*Math.log(e+1)+2,t/100},Lo=Re("div",{name:"MuiDataGrid",slot:"PinnedColumnHeaders",overridesResolver:(e,t)=>[{[`&.${V["pinnedColumnHeaders--left"]}`]:t["pinnedColumnHeaders--left"]},{[`&.${V["pinnedColumnHeaders--right"]}`]:t["pinnedColumnHeaders--right"]},t.pinnedColumnHeaders]})(({theme:e,ownerState:t})=>{var n;return U({position:"absolute",top:0,overflow:"hidden",zIndex:1,display:"flex",flexDirection:"column",boxShadow:e.shadows[2],backgroundColor:(e.vars||e).palette.background.default},e.vars?{backgroundImage:(n=e.vars.overlays)==null?void 0:n[2]}:U({},e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${qe("#fff",vl(2))}, ${qe("#fff",vl(2))})`}),t.side===De.left&&{left:0},t.side===De.right&&{right:0},t.side===De.right&&t.showCellVerticalBorder&&{borderLeftWidth:"1px",borderLeftStyle:"solid"})});Lo.propTypes={ownerState:A.object.isRequired};const yp=s.forwardRef(function(t,n){const{className:o,innerRef:r,visibleColumns:l,sortColumnLookup:i,filterColumnLookup:c,columnPositions:a,columnHeaderTabIndexState:d,columnGroupHeaderTabIndexState:u,columnHeaderFocus:g,columnGroupHeaderFocus:f,densityFactor:m,headerGroupingMaxDepth:h,columnMenuState:C,columnVisibility:v,columnGroupsHeaderStructure:b,hasOtherElementInTabSequence:p,pinnedColumns:y}=t,E=Qt(t,Sp),_=it(),I=co(),[D,R]=s.useState(0),L=st(),$=Ge(()=>{const K=I.current.getRootDimensions();if(!K)return;const ce=K.hasScrollY?K.scrollBarSize:0;D!==ce&&R(ce)});Q(I,"virtualScrollerContentSizeChange",$);const H=s.useMemo(()=>l.map(({field:K})=>K),[l]),[O,M]=Fn(y,H,L.direction==="rtl"),{isDragging:S,renderContext:x,getRootProps:F,getInnerProps:T,getColumnHeaders:k,getColumnFilters:G,getColumnGroupHeaders:z}=pp({innerRef:r,visibleColumns:l,sortColumnLookup:i,filterColumnLookup:c,columnPositions:a,columnHeaderTabIndexState:d,hasOtherElementInTabSequence:p,columnGroupHeaderTabIndexState:u,columnHeaderFocus:g,columnGroupHeaderFocus:f,densityFactor:m,headerGroupingMaxDepth:h,columnMenuState:C,columnVisibility:v,columnGroupsHeaderStructure:b,minColumnIndex:O.length}),N=U({},_,{leftPinnedColumns:O,rightPinnedColumns:M,classes:_.classes}),j=Pp(N),B=x&&O.length?U({},x,{firstColumnIndex:0,lastColumnIndex:O.length}):null,Z=x&&M.length?U({},x,{firstColumnIndex:H.length-M.length,lastColumnIndex:H.length}):null,W=T(),ee={role:W.role};return P.jsxs(As,U({ref:n,className:o},F(E),{children:[B&&P.jsxs(Lo,U({className:j.leftPinnedColumns,ownerState:U({},N,{side:De.left,showCellVerticalBorder:_.showCellVerticalBorder})},ee,{children:[z({renderContext:B,minFirstColumn:B.firstColumnIndex,maxLastColumn:B.lastColumnIndex}),k({renderContext:B,minFirstColumn:B.firstColumnIndex,maxLastColumn:B.lastColumnIndex},{disableReorder:!0}),G({renderContext:B,minFirstColumn:B.firstColumnIndex,maxLastColumn:B.lastColumnIndex})]})),P.jsx(bl,{scrollDirection:"left"}),P.jsxs(zs,U({isDragging:S},W,{children:[z({renderContext:x,minFirstColumn:O.length,maxLastColumn:H.length-M.length}),k({renderContext:x,minFirstColumn:O.length,maxLastColumn:H.length-M.length}),G({renderContext:x,minFirstColumn:O.length,maxLastColumn:H.length-M.length})]})),P.jsx(bl,{scrollDirection:"right"}),Z&&P.jsxs(Lo,U({ownerState:U({},N,{side:De.right,showCellVerticalBorder:_.showCellVerticalBorder}),className:j.rightPinnedColumns,style:{paddingRight:D}},ee,{children:[z({renderContext:Z,minFirstColumn:Z.firstColumnIndex,maxLastColumn:Z.lastColumnIndex}),k({renderContext:Z,minFirstColumn:Z.firstColumnIndex,maxLastColumn:Z.lastColumnIndex},{disableReorder:!0,separatorSide:Zo.Left}),G({renderContext:Z,minFirstColumn:Z.firstColumnIndex,maxLastColumn:Z.lastColumnIndex})]}))]}))}),Ip={ColumnMenuPinRightIcon:CC,ColumnMenuPinLeftIcon:pC},Mp=U({},Ip),Fp=U({},js,Mp,{ColumnMenu:fp,ColumnHeaders:yp,HeaderFilterCell:MC,HeaderFilterMenu:FC}),kp=U({},Ns,{scrollEndThreshold:80,treeData:!1,defaultGroupingExpansionDepth:0,autosizeOnMount:!1,disableAutosize:!1,disableColumnPinning:!1,keepColumnPositionIfDraggedOutside:!1,disableChildrenFiltering:!1,disableChildrenSorting:!1,rowReordering:!1,rowsLoadingMode:"client",getDetailPanelHeight:()=>500,unstable_headerFilters:!1}),Ep=sr(Fp),Dp=e=>{const[t,n,o]=vm(Gi({props:e,name:"MuiDataGrid"})),r=s.useMemo(()=>U({},af,o.localeText),[o.localeText]),l=s.useMemo(()=>pm({defaultSlots:Ep,slots:o.slots,components:t}),[t,o.slots]);return s.useMemo(()=>{var i;return U({},kp,o,{localeText:r,slots:l,slotProps:(i=o.slotProps)!=null?i:n,signature:"DataGridPro"})},[o,r,l,n])},Rp=()=>"MTcxMjI2NDQwMDAwMA==",xl=Rp(),ri=s.forwardRef(function(t,n){const o=Dp(t),r=ap(o.apiRef,o);Li("x-data-grid-pro",xl);const l=q(r,Ot);return P.jsx(df,{privateApiRef:r,props:o,children:P.jsxs(Ou,U({className:o.className,style:o.style,sx:o.sx,ref:n},o.forwardedProps,{children:[P.jsx($g,{}
33),P.jsx(xc,{VirtualScrollerComponent:NC,ColumnHeadersProps:{pinnedColumns:l},children:P.jsx(_i,{packageName:"x-data-grid-pro",releaseInfo:xl})}),P.jsx(Sc,{})]}))})}),Ap=s.memo(ri);ri.propTypes={apiRef:A.shape({current:A.object.isRequired}),"aria-label":A.string,"aria-labelledby":A.string,autoHeight:A.bool,autoPageSize:A.bool,autosizeOnMount:A.bool,autosizeOptions:A.shape({columns:A.arrayOf(A.string),expand:A.bool,includeHeaders:A.bool,includeOutliers:A.bool,outliersFactor:A.number}),cellModesModel:A.object,checkboxSelection:A.bool,checkboxSelectionVisibleOnly:A.bool,classes:A.object,clipboardCopyCellDelimiter:A.string,columnBuffer:A.number,columnGroupingModel:A.arrayOf(A.object),columnHeaderHeight:A.number,columns:A.arrayOf(A.object).isRequired,columnThreshold:A.number,columnVisibilityModel:A.object,components:A.object,componentsProps:A.object,defaultGroupingExpansionDepth:A.number,density:A.oneOf(["comfortable","compact","standard"]),detailPanelExpandedRowIds:A.arrayOf(A.oneOfType([A.number,A.string]).isRequired),disableAutosize:A.bool,disableChildrenFiltering:A.bool,disableChildrenSorting:A.bool,disableColumnFilter:A.bool,disableColumnMenu:A.bool,disableColumnPinning:A.bool,disableColumnReorder:A.bool,disableColumnResize:A.bool,disableColumnSelector:A.bool,disableDensitySelector:A.bool,disableEval:A.bool,disableMultipleColumnsFiltering:A.bool,disableMultipleColumnsSorting:A.bool,disableMultipleRowSelection:A.bool,disableRowSelectionOnClick:A.bool,disableVirtualization:A.bool,editMode:A.oneOf(["cell","row"]),experimentalFeatures:A.shape({ariaV7:A.bool,columnGrouping:A.bool,lazyLoading:A.bool,warnIfFocusStateIsNotSynced:A.bool}),filterDebounceMs:A.number,filterMode:A.oneOf(["client","server"]),filterModel:A.shape({items:A.arrayOf(A.shape({field:A.string.isRequired,id:A.oneOfType([A.number,A.string]),operator:A.string.isRequired,value:A.any})).isRequired,logicOperator:A.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:A.bool,quickFilterLogicOperator:A.oneOf(["and","or"]),quickFilterValues:A.array}),forwardedProps:A.object,getCellClassName:A.func,getDetailPanelContent:A.func,getDetailPanelHeight:A.func,getEstimatedRowHeight:A.func,getRowClassName:A.func,getRowHeight:A.func,getRowId:A.func,getRowSpacing:A.func,getTreeDataPath:A.func,groupingColDef:A.oneOfType([A.func,A.object]),hideFooter:A.bool,hideFooterPagination:A.bool,hideFooterRowCount:A.bool,hideFooterSelectedRowCount:A.bool,ignoreDiacritics:A.bool,initialState:A.object,isCellEditable:A.func,isGroupExpandedByDefault:A.func,isRowSelectable:A.func,keepColumnPositionIfDraggedOutside:A.bool,keepNonExistentRowsSelected:A.bool,loading:A.bool,localeText:A.object,logger:A.shape({debug:A.func.isRequired,error:A.func.isRequired,info:A.func.isRequired,warn:A.func.isRequired}),logLevel:A.oneOf(["debug","error","info","warn",!1]),nonce:A.string,onCellClick:A.func,onCellDoubleClick:A.func,onCellEditStart:A.func,onCellEditStop:A.func,onCellKeyDown:A.func,onCellModesModelChange:A.func,onClipboardCopy:A.func,onColumnHeaderClick:A.func,onColumnHeaderDoubleClick:A.func,onColumnHeaderEnter:A.func,onColumnHeaderLeave:A.func,onColumnHeaderOut:A.func,onColumnHeaderOver:A.func,onColumnOrderChange:A.func,onColumnResize:A.func,onColumnVisibilityModelChange:A.func,onColumnWidthChange:A.func,onDetailPanelExpandedRowIdsChange:A.func,onFetchRows:A.func,onFilterModelChange:A.func,onMenuClose:A.func,onMenuOpen:A.func,onPaginationModelChange:A.func,onPinnedColumnsChange:A.func,onPreferencePanelClose:A.func,onPreferencePanelOpen:A.func,onProcessRowUpdateError:A.func,onResize:A.func,onRowClick:A.func,onRowDoubleClick:A.func,onRowEditStart:A.func,onRowEditStop:A.func,onRowModesModelChange:A.func,onRowOrderChange:A.func,onRowSelectionModelChange:A.func,onRowsScrollEnd:A.func,onSortModelChange:A.func,onStateChange:A.func,pageSizeOptions:A.arrayOf(A.oneOfType([A.number,A.shape({label:A.string.isRequired,value:A.number.isRequired})]).isRequired),pagination:A.bool,paginationMode:A.oneOf(["client","server"]),paginationModel:A.shape({page:A.number.isRequired,pageSize:A.number.isRequired}),pinnedColumns:A.shape({left:A.arrayOf(A.string),right:A.arrayOf(A.string)}),pinnedRows:A.shape({bottom:A.arrayOf(A.object),top:A.arrayOf(A.object)}),processRowUpdate:A.func,rowBuffer:A.number,rowCount:A.number,rowHeight:A.number,rowModesModel:A.object,rowPositionsDebounceMs:A.number,rowReordering:A.bool,rows:A.arrayOf(A.object).isRequired,rowSelection:A.bool,rowSelectionModel:A.oneOfType([A.arrayOf(A.oneOfType([A.number,A.
33string]).isRequired),A.number,A.string]),rowsLoadingMode:A.oneOf(["client","server"]),rowSpacingType:A.oneOf(["border","margin"]),rowThreshold:A.number,scrollbarSize:A.number,scrollEndThreshold:A.number,showCellVerticalBorder:A.bool,showColumnVerticalBorder:A.bool,slotProps:A.object,slots:A.object,sortingMode:A.oneOf(["client","server"]),sortingOrder:A.arrayOf(A.oneOf(["asc","desc"])),sortModel:A.arrayOf(A.shape({field:A.string.isRequired,sort:A.oneOf(["asc","desc"])})),sx:A.oneOfType([A.arrayOf(A.oneOfType([A.func,A.object,A.bool])),A.func,A.object]),throttleRowsMs:A.number,treeData:A.bool,unstable_headerFilters:A.bool,unstable_ignoreValueFormatterDuringExport:A.oneOfType([A.shape({clipboardExport:A.bool,csvExport:A.bool}),A.bool])};const zp=Mf;export{Ap as D,_p as G,yn as _,Vp as a,Ye as b,wg as c,ke as d,Jg as e,wf as f,V as g,ef as h,Lp as i,co as j,fn as k,vf as l,In as t,zp as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.