vendor: 8,500 bytes, lines 1-4
1import{r as f,j as R,F as ie,a2 as He,dU as je,c$ as Be,dW as L,cf as Ue,dX as W,s as _e,ci as ze,q as Ne}from"./elements-5kxJS_4j.js";import{_ as Y,a as $e,b as pe,M as K,B as We,d as qe,e as G,f as Xe,g as Ye,h as Ke,i as Qe,j as le,k as Ze,u as Je,A as et,C as tt,S as st,l as ot,m as rt,R as it,n as lt,E as at}from"./grids-DGmfp9GI.js";import{D as nt}from"./datepicker-B9D4iLeH.js";function ct(h,e){var t;(t=h.clipboardService)==null||t.copyToClipboard(e)}function ut(h,e){var t;(t=h.clipboardService)==null||t.cutToClipboard(e)}function dt(h,e){var t;(t=h.clipboardService)==null||t.copySelectedRowsToClipboard(e)}function pt(h,e){var t;(t=h.clipboardService)==null||t.copySelectedRangeToClipboard(e)}function ht(h){var e;(e=h.clipboardService)==null||e.copyRangeDown()}function gt(h){var e;(e=h.clipboardService)==null||e.pasteFromClipboard()}var q="paste",X="dragCopy",ae="clipboard",ne=h=>`AG Grid: Unable to use the Clipboard API (navigator.clipboard.${h}()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.`,ft=class he extends We{constructor(){super(...arguments),this.beanName="clipboardService",this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}wireBeans(e){this.csvCreator=e.csvCreator,this.selectionService=e.selectionService,this.rowModel=e.rowModel,this.ctrlsService=e.ctrlsService,this.valueService=e.valueService,this.focusService=e.focusService,this.rowRenderer=e.rowRenderer,this.visibleColsService=e.visibleColsService,this.funcColsService=e.funcColsService,this.cellNavigationService=e.cellNavigationService,this.cellPositionUtils=e.cellPositionUtils,this.rowPositionUtils=e.rowPositionUtils,this.rangeService=e.rangeService}postConstruct(){qe(this.gos)&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(this,e=>{this.gridCtrl=e.gridCtrl})}pasteFromClipboard(){!this.gos.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard&&navigator.clipboard.readText?navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch(t=>{G(`${t} 2${ne("readText")}`),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()}):this.pasteFromClipboardLegacy()}pasteFromClipboardLegacy(){let e=!1;const t=s=>{const o=new Date().getTime();o-this.lastPasteOperationTime<50&&(e=!0,s.preventDefault()),this.lastPasteOperationTime=o};this.executeOnTempElement(s=>{s.addEventListener("paste",t),s.focus({preventScroll:!0})},s=>{const o=s.value;e?this.refocusLastFocusedCell():this.processClipboardData(o),s.removeEventListener("paste",t)})}refocusLastFocusedCell(){const e=this.focusService.getFocusedCell();e&&this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){const e=this.gos.get("clipboardDelimiter");return Xe(e)?e:" "}processClipboardData(e){if(e==null)return;let t=he.stringToArray(e,this.getClipboardDelimiter());const s=this.gos.getCallback("processDataFromClipboard");if(s&&(t=s({data:t})),t==null)return;this.gos.get("suppressLastEmptyLineOnPaste")&&this.removeLastLineIfBlank(t);const o=(r,l,a,n)=>{var d;((d=this.rangeService)==null?void 0:d.isMoreThanOneCell())&&!this.hasOnlyOneValueToPaste(t)?this.pasteIntoActiveRange(this.rangeService,t,r,l,n):this.pasteStartingFromFocusedCell(t,r,l,a,n)};this.doPasteOperation(o)}static stringToArray(e,t=","){const s=[],o=l=>l==="\r"||l===` 3`;let r=!1;if(e==="")return[[""]];for(let l=0,a=0,n=0;n<e.length;n++){const u=e[n-1],g=e[n],d=e[n+1],m=()=>{s[l]||(s[l]=[]),s[l][a]||(s[l][a]="")};if(m(),g==='"'&&(r?d==='"'?(s[l][a]+='"',n++):r=!1:(u===void 0||u===t||o(u))&&(r=!0)),!r&&g!=='"'){if(g===t){a++,m();continue}else if(o(g)){a=0,l++,m(),g==="\r"&&d===` 4`&&n++;continue}}s[l][a]+=g}return s}doPasteOperation(e){const t="clipboard";this.eventService.dispatchEvent({type:"pasteStart",source:t});let s;if(this.clientSideRowModel){const n=this.gos.get("aggregateOnlyChangedColumns");s=new Ye(n,this.clientSideRowModel.getRootNode())}const o={},r=[],l=this.focusService.getFocusedCell();e(o,r,l,s);const a=[...r];s&&(this.clientSideRowModel.doAggregate(s),s.forEachChangedNodeDepthFirst(n=>{a.push(n)})),this.rowRenderer.refreshCells({rowNodes:a}),this.dispatchFlashCells(o),this.fireRowChanged(r),this.refocusLastFocusedCell(),this.eventService.dispatchEvent({type:"pasteEnd",source:t})}pasteIntoActiveRange(e,t,s,o,r){const l=this.getRangeSize(e)%t.length!=0;let a=0,n=0;const u=(g,d,m,C)=>{if(C-a>=t.length){if(l)return;a+=n,n=0}const P=t[C-a];o.push(d);const v=this.gos.getCallback("processCellFromClipboard");m.forEach((b,y)=>{if(!b.isCellEditable(d)||b.isSuppressPaste(d))return;y>=P.length&&(y=y%P.length);const x=this.processCell(d,b,P[y],X,v,!0);d.setDataValue(b,x,q),r&&r.addParentNode(d.parent,[b]);const{rowIndex:F,rowPinned:H}=g,j=this.cellPositionUtils.createIdFromValues({rowIndex:F,column:b,rowPinned:H});s[j]=!0}),n++};this.iterateActiveRanges(!1,u)}getDisplayedColumnsStartingAt(e){let t=e;const s=[];for(;t!=null;)s.push(t),t=this.visibleColsService.getColAfter(t);return s}pasteStartingFromFocusedCell(e,t,s,o,r){if(!o)return;const l={rowIndex:o.rowIndex,rowPinned:o.rowPinned},a=this.getDisplayedColumnsStartingAt(o.column);this.isPasteSingleValueIntoRange(e)?this.pasteSingleValueIntoRange(e,s,t,r):this.pasteMultipleValues(e,l,s,a,t,ae,r)}isPasteSingleValueIntoRange(e){return this.hasOnlyOneValueToPaste(e)&&this.rangeService!=null&&!this.rangeService.isEmpty()}pasteSingleValueIntoRange(e,t,s,o){const r=e[0][0],l=(a,n,u)=>{t.push(n),u.forEach(g=>this.updateCellValue(n,g,r,s,ae,o))};this.iterateActiveRanges(!1,l)}hasOnlyOneValueToPaste(e){return e.length===1&&e[0].length===1}copyRangeDown(){if(!this.rangeService||this.rangeService.isEmpty())return;const e=[],t=(s,o,r,l)=>{const a=this.gos.getCallback("processCellForClipboard"),n=this.gos.getCallback("processCellFromClipboard"),u=(g,d,m)=>{e.length?(o.push(d),m.forEach((C,S)=>{if(!C.isCellEditable(d)||C.isSuppressPaste(d))return;const P=this.processCell(d,C,e[S],X,n,!0);d.setDataValue(C,P,q),l&&l.addParentNode(d.parent,[C]);const{rowIndex:v,rowPinned:b}=g,y=this.cellPositionUtils.createIdFromValues({rowIndex:v,column:C,rowPinned:b});s[y]=!0})):m.forEach(C=>{const S=this.processCell(d,C,this.valueService.getValue(C,d),X,a,!1,!0);e.push(S)})};this.iterateActiveRanges(!0,u)};this.doPasteOperation(t)}removeLastLineIfBlank(e){const t=Ke(e);if(t&&t.length===1&&t[0]===""){if(e.length===1)return;Qe(e,t)}}fireRowChanged(e){this.gos.get("editType")==="fullRow"&&e.forEach(t=>{this.eventService.dispatchEvent({type:"rowValueChanged",node:t,data:t.data,rowIndex:t.rowIndex,rowPinned:t.rowPinned})})}pasteMultipleValues(e,t,s,o,r,l,a){let n=t;const u=this.clientSideRowModel!=null&&!this.gos.get("enableGroupEdit")&&!this.gos.get("treeData"),g=()=>{for(;;){if(!n)return null;const d=this.rowPositionUtils.getRowNode(n);if(n=this.cellNavigationService.getRowBelow({rowPinned:n.rowPinned,rowIndex:n.rowIndex}),d==null)return null;if(!(d.detail||d.footer||u&&d.group))return d}};e.forEach(d=>{const m=g();m&&(d.forEach((C,S)=>this.updateCellValue(m,o[S],C,r,l,a)),s.push(m))})}updateCellValue(e,t,s,o,r,l){if(!e||!t||!t.isCellEditable(e)||t.isSuppressPaste(e))return;const a=this.processCell(e,t,s,r,this.gos.getCallback("processCellFromClipboard"),!0);e.setDataValue(t,a,q);const{rowIndex:n,rowPinned:u}=e,g=this.cellPositionUtils.createIdFromValues({rowIndex:n,column:t,rowPinned:u});o[g]=!0,l&&l.addParentNode(e.parent,[t])}copyToClipboard(e={}){this.copyOrCutToClipboard(e)}cutToClipboard(e={},t="api"){this.gos.get("suppressCutToClipboard")||(this.eventService.dispatchEvent({type:"cutStart",source:t}),this.copyOrCutToClipboard(e,!0),this.eventService.dispatchEvent({type:"cutEnd",source:t}))}copyOrCutToClipboard(e,t){let{includeHeaders:s,includeGroupHeaders:o}=e;s==null&&(s=this.gos.get("copyHeadersToClipboard")),o==null&&(o=this.gos.get("copyGroupHeadersToClipboard"));const r={includeHeaders:s,includeGroupHeaders:o},l=this.gos.get("rowSelection"),a=this.gos.get("cellSelection");let n=null;this.shouldCopyCells(a,l)?(this.copySelectedRangeToClipboard(r),n=0):this.shouldCopyRows(l)?(this.copySelectedRowsToClipboard(r),n=1):this.focusService.isAnyCellFocused()&&(this.copyFocusedCellToCl
vendor: 5,868 bytes, lines 4-5
4ipboard(r),n=2),t&&n!==null&&this.clearCellsAfterCopy(n)}shouldCopyCells(e,t){if(!this.rangeService||this.rangeService.isEmpty())return!1;if(e)return!(typeof t=="object"&&t.copySelectedRows&&!this.selectionService.isEmpty());{const s=this.gos.get("suppressCopySingleCellRanges");return!(!this.rangeService.isMoreThanOneCell()&&s)}}shouldCopyRows(e){return this.selectionService.isEmpty()?!1:e&&typeof e!="string"?e.copySelectedRows??!1:!this.gos.get("suppressCopyRowsToClipboard")}clearCellsAfterCopy(e){if(this.eventService.dispatchEvent({type:"keyShortcutChangedCellStart"}),e===0)this.rangeService.clearCellRangeCellValues({cellEventSource:"clipboardService"});else if(e===1)this.clearSelectedRows();else{const t=this.focusService.getFocusedCell();if(t==null)return;const s=this.rowPositionUtils.getRowNode(t);s&&this.clearCellValue(s,t.column)}this.eventService.dispatchEvent({type:"keyShortcutChangedCellEnd"})}clearSelectedRows(){const e=this.selectionService.getSelectedNodes(),t=this.visibleColsService.getAllCols();for(const s of e)for(const o of t)this.clearCellValue(s,o)}clearCellValue(e,t){if(!t.isCellEditable(e))return;const s=this.valueService.getDeleteValue(t,e);e.setDataValue(t,s,"clipboardService")}iterateActiveRanges(e,t,s){if(!this.rangeService||this.rangeService.isEmpty())return;const o=this.rangeService.getCellRanges();e?this.iterateActiveRange(o[0],t,s,!0):o.forEach((r,l)=>this.iterateActiveRange(r,t,s,l===o.length-1))}iterateActiveRange(e,t,s,o){if(!this.rangeService)return;let r=this.rangeService.getRangeStartRow(e);const l=this.rangeService.getRangeEndRow(e);s&&e.columns&&s(e.columns);let a=0,n=!1;for(;!n&&r!=null;){const u=this.rowPositionUtils.getRowNode(r);n=this.rowPositionUtils.sameRow(r,l),t(r,u,e.columns,a++,n&&o),r=this.cellNavigationService.getRowBelow(r)}}copySelectedRangeToClipboard(e={}){if(!this.rangeService||this.rangeService.isEmpty())return;const t=this.rangeService.areAllRangesAbleToMerge(),{data:s,cellsToFlash:o}=t?this.buildDataFromMergedRanges(this.rangeService,e):this.buildDataFromRanges(this.rangeService,e);this.copyDataToClipboard(s),this.dispatchFlashCells(o)}buildDataFromMergedRanges(e,t){const s=new Set,o=e.getCellRanges(),r=new Map,l=[],a={};o.forEach(d=>{d.columns.forEach(S=>s.add(S));const{rowPositions:m,cellsToFlash:C}=this.getRangeRowPositionsAndCellsToFlash(e,d);m.forEach(S=>{const P=`${S.rowIndex}-${S.rowPinned||"null"}`;r.get(P)||(r.set(P,!0),l.push(S))}),Object.assign(a,C)});const n=this.visibleColsService.getAllCols(),u=Array.from(s);return u.sort((d,m)=>{const C=n.indexOf(d),S=n.indexOf(m);return C-S}),{data:this.buildExportParams({columns:u,rowPositions:l,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}),cellsToFlash:a}}buildDataFromRanges(e,t){const s=e.getCellRanges(),o=[],r={};return s.forEach(l=>{const{rowPositions:a,cellsToFlash:n}=this.getRangeRowPositionsAndCellsToFlash(e,l);Object.assign(r,n),o.push(this.buildExportParams({columns:l.columns,rowPositions:a,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}))}),{data:o.join(` 5`),cellsToFlash:r}}getRangeRowPositionsAndCellsToFlash(e,t){const s=[],o={},r=e.getRangeStartRow(t),l=e.getRangeEndRow(t);let a=r;for(;a&&(s.push(a),t.columns.forEach(n=>{const{rowIndex:u,rowPinned:g}=a,d=this.cellPositionUtils.createIdFromValues({rowIndex:u,column:n,rowPinned:g});o[d]=!0}),!this.rowPositionUtils.sameRow(a,l));)a=this.cellNavigationService.getRowBelow(a);return{rowPositions:s,cellsToFlash:o}}getCellsToFlashFromRowNodes(e){const t=this.visibleColsService.getAllCols(),s={};for(let o=0;o<e.length;o++){const{rowIndex:r,rowPinned:l}=e[o];if(r!=null)for(let a=0;a<t.length;a++){const n=t[a],u=this.cellPositionUtils.createIdFromValues({rowIndex:r,column:n,rowPinned:l});s[u]=!0}}return s}copyFocusedCellToClipboard(e={}){const t=this.focusService.getFocusedCell();if(t==null)return;const s=this.cellPositionUtils.createId(t),o={rowPinned:t.rowPinned,rowIndex:t.rowIndex},r=t.column,l=this.buildExportParams({columns:[r],rowPositions:[o],includeHeaders:e.includeHeaders,includeGroupHeaders:e.includeGroupHeaders});this.copyDataToClipboard(l),this.dispatchFlashCells({[s]:!0})}copySelectedRowsToClipboard(e={}){const{columnKeys:t,includeHeaders:s,includeGroupHeaders:o}=e,r=this.buildExportParams({columns:t,includeHeaders:s,includeGroupHeaders:o});this.copyDataToClipboard(r);const l=this.selectionService.getSelectedNodes()||[];this.dispatchFlashCells(this.getCellsToFlashFromRowNodes(l))}buildExportParams(e){const{columns:t,rowPositions:s,includeHeaders:o=!1,includeGroupHeaders:r=!1}=e,l={columnKeys:t,rowPositions:s,skipColumnHeaders:!o,skipColumnGroupHeaders:!r,suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!s,processCellCallback:this.gos.getCallback("processCellForClipboard"),processRowGroupCallback:a=>this.processRowGroupCallback(a),processHeaderCallback:this.gos.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:this.gos.getCallback("processGroupHeaderForClipboard")};return this.csvCreator.getDataAsCsv(l,!0)}processRowGroupCallback(e){const{node:t,column:s}=e,o=this.gos.get("treeData"),r=this.gos.get("suppressGroupMaintainValueType");let a=(()=>{var g;if(o||r||!s)return t.key;const u=(g=t.groupData)==null?void 0:g[s.getId()];return!u||!t.rowGroupColumn||t.rowGroupColumn.getColDef().useValueFormatterForExport===!1?u:this.valueService.formatValue(t.rowGroupColumn,t,u)??u})();if(e.node.footer){let u="";a&&a.length&&(u=` ${a}`),a=`Total${u}`}const n=this.gos.getCallback("processCellForClipboard");if(n){let u=t.rowGroupColumn;return!u&&t.footer&&t.level===-1&&(u=this.funcColsService.getRowGroupColumns()[0]),n({value:a,node:t,column:u,type:"clipboard",formatValue:g=>this.valueService.formatValue(u,t,g)??g,parseValue:g=>this.valueService.parseValue(u,t,g,this.valueService.getValue(u,t))})}return a}
5dispatchFlashCells(e){window.setTimeout(()=>{this.eventService.dispatchEvent({type:"flashCells",cells:e})},0)}processCell(e,t,s,o,r,l,a){return r?r({column:t,node:e,value:s,type:o,formatValue:u=>this.valueService.formatValue(t,e??null,u)??u,parseValue:u=>this.valueService.parseValue(t,e??null,u,this.valueService.getValue(t,e))}):l&&t.getColDef().useValueParserForImport!==!1?this.valueService.parseValue(t,e??null,s,this.valueService.getValue(t,e)):a&&t.getColDef().useValueFormatterForExport!==!1?this.valueService.formatValue(t,e??null,s)??s:s}copyDataToClipboard(e){const t=this.gos.getCallback("sendToClipboard");if(t){t({data:e});return}if(!this.gos.get("suppressClipboardApi")&&navigator.clipboard){navigator.clipboard.writeText(e).catch(o=>{G(`${o} 6${ne("writeText")}`),this.copyDataToClipboardLegacy(e)});return}this.copyDataToClipboardLegacy(e)}copyDataToClipboardLegacy(e){this.executeOnTempElement(t=>{const s=le(this.gos),o=Ze(this.gos);t.value=e||" ",t.select(),t.focus({preventScroll:!0}),s.execCommand("copy")||G("Browser did not allow document.execCommand('copy'). Ensure api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons."),o!=null&&o.focus!=null&&o.focus({preventScroll:!0})})}executeOnTempElement(e,t){const s=le(this.gos),o=s.createElement("textarea");o.style.width="1px",o.style.height="1px",o.style.top=s.documentElement.scrollTop+"px",o.style.left=s.documentElement.scrollLeft+"px",o.style.position="absolute",o.style.opacity="0";const r=this.gridCtrl.getGui();r.appendChild(o);try{e(o)}catch{G("Browser does not support document.execCommand('copy') for clipboard operations")}t?window.setTimeout(()=>{t(o),r.removeChild(o)},100):r.removeChild(o)}getRangeSize(e){const t=e.getCellRanges();let s=0,o=0;return t.length>0&&(s=e.getRangeStartRow(t[0]).rowIndex,o=e.getRangeEndRow(t[0]).rowIndex),s-o+1}},Q="32.3.2",ge=Y({version:Q,moduleName:`${K.ClipboardModule}-core`,beans:[ft],dependantModules:[$e,pe]}),Ct=Y({version:Q,moduleName:`${K.ClipboardModule}-api`,apiFunctions:{copyToClipboard:ct,cutToClipboard:ut,copySelectedRowsToClipboard:dt,copySelectedRangeToClipboard:pt,copySelectedRangeDown:ht,pasteFromClipboard:gt},dependantModules:[ge]}),vt=Y({version:Q,moduleName:K.ClipboardModule,dependantModules:[ge,Ct]});const ce="mm/dd/yyyy",ue=h=>{if(!h)return null;if(h instanceof Date)return h;const e=new Date(`${h}T00:00:00`);return Number.isNaN(e.getTime())?null:e},de=h=>{const e=h==null?void 0:h.getDate();return e instanceof Date?e:null},mt=({date:h,onDateChange:e,filterParams:t})=>{const s=f.useRef(null),o=f.useRef(null),r=f.useRef(!1),[l,a]=f.useState(!1),[n,u]=f.useState(ce),[g,d]=f.useState("Date Filter Input"),m=f.useRef(e);m.current=e;const C=f.useCallback(()=>{r.current||m.current(de(o.current))},[]);f.useEffect(()=>{var y;const v=s.current;if(!v)return;const b=new nt(v,{autohide:!0,format:ce,showOnFocus:!1,container:"body",todayButton:!0,todayHighlight:!0,clearButton:!0});return(y=b.pickerElement)==null||y.classList.add("ag-custom-component-popup","ag-vantaca-date-filter-calendar"),o.current=b,v.addEventListener("changeDate",C),()=>{v.removeEventListener("changeDate",C),b.destroy(),o.current=null}},[C]);const{minValidDate:S,maxValidDate:P}=t??{};return f.useEffect(()=>{var v;(v=o.current)==null||v.setOptions({minDate:ue(S),maxDate:ue(P)})},[S,P]),f.useEffect(()=>{const v=o.current;if(v){r.current=!0;try{const b=de(v);h?(b==null?void 0:b.getTime())!==h.getTime()&&v.setDate(h):b&&v.setDate({clear:!0})}finally{r.current=!1}}},[h]),Je({setDisabled:a,setInputPlaceholder:u,setInputAriaLabel:d}),R.jsx("div",{className:"ag-date-field ag-input-field",role:"presentation",children:R.jsxs("div",{className:"ag-wrapper ag-input-wrapper ag-date-field-input-wrapper",children:[R.jsx("input",{ref:s,type:"text",className:"ag-input-field-input ag-date-field-input ag-vantaca-date-filter-input",readOnly:!0,"data-qa":"table-date-filter","aria-label":g,placeholder:n,disabled:l}),h&&R.jsx("button",{type:"button",className:"ag-vantaca-date-filter-button",onClick:()=>e(null),disabled:l,"aria-label":"Clear date filter",children:R.jsx(ie,{icon:He})}),R.jsx("button",{type:"button",className:"ag-vantaca-date-filter-button",onClick:()=>{var v;return(v=o.current)==null?void 0:v.show()},disabled:l,"aria-label":"Open date picker",children:R.jsx(ie,{icon:je})})]})})},St={agDateInput:mt},Pt=f.forwardRef(({pagination:h=!0,rowData:e,columnDefs:t=[],pageSizeFromParent:s=L,defaultPageSize:o=L,serverSideDatasource:r,showH
6orizontalScrollbar:l=!1,suppressLoadingOverlay:a=!1,resetPaginationOnDataChange:n=!1,overlayNoRowsTemplate:u="There is no data to display.",enableExport:g=!0,loading:d=!1,rowSelection:m,onRowSelected:C,getGridRef:S,onFirstDataRendered:P,onFilterChanged:v,getRowId:b,getRowHeight:y,loadingRowHeight:x,onRowClicked:F,rowHeight:H=50,useCustomTheme:j=!0,isMobile:Z=!1,rowGroupPanelShow:fe,suppressRowGroupHidesColumns:Ce,columnMenu:ve,defaultColDef:me,enableClipboard:Se=!1,"data-qa":be,"data-qa-value":we},ye)=>{const p=f.useRef(null),A=f.useRef(null),B=W(o)?o:L,[D,J]=f.useState(W(s)?s:B),[Re,U]=f.useState(0),[Pe,Te]=f.useState(0),[ee,Ee]=f.useState(0),{width:M}=_e(),[_,Fe]=f.useState(0),xe={rowHeight:H,getRowId:b,suppressCopyRowsToClipboard:!0,groupRowRendererParams:{suppressCount:!1,innerRenderer:void 0}},Ie=f.useCallback(i=>{var c;i.node.group&&i.node.setExpanded(!i.node.expanded),!ze((c=i.event)==null?void 0:c.target)&&(F==null||F(i))},[F]),Ae=!!y||!!r&&x!=null,De=f.useCallback(i=>{const c=y==null?void 0:y(i);if(c!=null)return c;if(r&&x!=null&&i.data==null)return x},[y,r,x]);f.useImperativeHandle(ye,()=>({refresh(){var i,c;(c=(i=p.current)==null?void 0:i.api)==null||c.refreshServerSide({purge:!0})},exportCsv(){var i,c;(c=(i=p.current)==null?void 0:i.api)==null||c.exportDataAsCsv()},exportExcel(i){var c,w;(w=(c=p.current)==null?void 0:c.api)==null||w.exportDataAsExcel(i)},hideOverlay(){var i,c;(c=(i=p.current)==null?void 0:i.api)==null||c.hideOverlay()},showLoadingOverlay(){var i,c;(c=(i=p.current)==null?void 0:i.api)==null||c.showLoadingOverlay()},deselectAll(){var i,c;(c=(i=p.current)==null?void 0:i.api)==null||c.deselectAll()},applyColumnState(i){var c,w;(w=(c=p.current)==null?void 0:c.api)==null||w.applyColumnState(i)},setRowData(i){var c,w;(w=(c=p.current)==null?void 0:c.api)==null||w.setGridOption("rowData",i)},getColumnState(){var i,c;return((c=(i=p.current)==null?void 0:i.api)==null?void 0:c.getColumnState())||[]},getDisplayedRows(){var c,w;const i=[];return(w=(c=p.current)==null?void 0:c.api)==null||w.forEachNodeAfterFilterAndSort(E=>{E.data!=null&&i.push(E.data)}),i},resetColumnState(){var i,c;(c=(i=p.current)==null?void 0:i.api)==null||c.resetColumnState()},sizeColumnsToFit(){var i,c;(c=(i=p.current)==null?void 0:i.api)==null||c.sizeColumnsToFit()},getPageSize(){return D},applyPageSize(i){W(i)&&i!==D&&z(i)},resetPageSize(){z(B)}})),f.useEffect(()=>{const i=new ResizeObserver(()=>{A.current&&Fe(A.current.offsetWidth)});return A.current&&i.observe(A.current),()=>{i.disconnect()}},[]),f.useEffect(()=>{var i,c;M>1024&&((i=p.current)!=null&&i.api)&&((c=p.current)==null||c.api.sizeColumnsToFit())},[M,_]);const Ve=f.useCallback(()=>{var c;const i=(c=p==null?void 0:p.current)==null?void 0:c.api.getSelectedRows();i&&C&&C(i)},[C]),T=f.useCallback(()=>{var i,c,w,E,te,se,oe,re;if(M>1024&&((i=p.current)!=null&&i.api)){const O=p.current.api.getColumns(),Me=_;if(O){const Ge=O.reduce((I,$)=>{const k=$.getColDef();return k.width!==void 0&&typeof k.width=="number"?I+k.width:I},0),Le=Me-Ge,N=O==null?void 0:O.filter(I=>I.getColDef().width===void 0);if(N.length>0){const I=Le/N.length,$=N.map(k=>({key:k,newWidth:I}));(c=p.current)==null||c.api.setColumnWidths($,!0)}}}(w=p.current)!=null&&w.api&&(Te(((E=p.current)==null?void 0:E.api.paginationGetTotalPages())||0),Ee(((te=p.current)==null?void 0:te.api.paginationGetRowCount())||0),U(((se=p.current)==null?void 0:se.api.paginationGetCurrentPage())||0)),S&&(p!=null&&p.current)&&S(p.current),(re=(oe=p.current)==null?void 0:oe.api)==null||re.sizeColumnsToFit()},[S,_,M]);f.useEffect(()=>T(),[T,e]);const V=f.useCallback(()=>{p.current&&(p.current.api.paginationGoToFirstPage(),U(0))},[]),z=f.useCallback(i=>{var c,w,E;V(),r?((c=p.current)==null||c.api.updateGridOptions({paginationPageSize:i,cacheBlockSize:i}),J(i),(w=p.current)==null||w.api.refreshServerSide({purge:!0})):((E=p.current)==null||E.api.updateGridOptions({paginationPageSize:i}),J(i)),T()},[V,T,r]),Oe=f.useCallback(i=>{var c;(c=p.current)==null||c.api.paginationGoToPage(i),U(i),T()},[T]),ke=i=>{V(),T(),v==null||v(i)};return f.useEffect(()=>{var i;n&&((i=p==null?void 0:p.current)!=null&&i.api)&&V()},[V,n,e,r]),R.jsxs("div",{ref:A,className:"flex flex-col w-full","data-qa":be,"data-qa-value":we,children:[R.jsx("div",{className:Ne("ag-theme-alpine",j&&"ag-theme-ve","col-span-12 w-full h-full",F&&"[&_.ag-row]:cursor-pointer"),children:R.jsx(et,{popupParent:document.body,domLayout:"autoHeight",ref:p,rowData:e,columnDefs:t,defaultColDef:me,loading:d,pagination:h,paginationPageSize:D,cacheBlockSize:D,getRowHeight:Ae?De:void 0,groupDisplayType:"groupRows",rowGroupPanelShow:fe,suppressRowGroupHidesColumns:Ce,columnMenu:ve,components:St,onGridReady:T,onPaginationChanged:T,onColumnVisible:T,gridOptions:xe,suppressPaginationPanel:!0,animateRows:!0,rowSelection:m,onSelectionChanged:Ve,onRowClicked:Ie,onFilterChanged:ke,suppressLoadingOverlay:a,alwaysShowHorizontalScroll:l,overlayNoRowsTemplate:u,rowModelType:e?"clientSide":"serverSide",serverSideDatasource:r,excelStyles:[{id:"header",interior:{color:"#44546A",pattern:"Solid"},font:{color:"#FFFFFF",bold:!0}}],modules:[tt,st,ot,rt,it,...Z?[]:[lt],...g?[pe,at]:[],...Se?[vt]:[]],onFirstDataRendered:P})}),h&&(r?ee>0:((e==null?void 0:e.length)??0)>0)&&R.jsx(bt,{onPageSizeUpdate:z,onPageNumberUpdate:Oe,currentPage:Re,paginationPageSize:D,defaultPageSize:B,totalPages:Pe,totalCount:ee,isMobile:Z})]})}),bt=({onPageSizeUpdate:h,onPageNumberUpdate:e,currentPage:t,paginationPageSize:s,defaultPageSize:o=L,totalPages:r,totalCount:l,isMobile:a})=>R.jsxs("div",{"data-qa":"table-paginator",className:"ag-theme-alpine flex justify-between items-center gap-2 flex-wrap py-4",children:[R.jsx(Be,{onChangePageSize:h,currentPage:t,paginationPageSize:s,defaultPageSize:o,totalPages:r,totalCount:l}),R.jsx(Ue,{numberOfPages:r,currentPage:t,onChangePage:e,isMobile:a})]});
6export{Pt as Table,bt as TablePaginator};
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.