UNPKG

ag-grid-community

Version:

Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue

4 lines 1.21 MB
import{LocalEventService as Fm,_escapeString as xm}from"ag-stack";var da={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};import{_doOnce as Em,_missing as ca}from"ag-stack";import{_areEqual as Pm}from"ag-stack";var qs=e=>e==="__proto__"||e==="constructor"||e==="prototype",yo=e=>{const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Ro=e=>e!==null&&typeof e=="object"&&yo(e),ua=(e,t,i,o,s)=>{let r=e[t];if(r!==i){if(i===null||typeof i!="object"){(o||i!==void 0)&&(e[t]=i);return}s&&r==null&&yo(i)&&(r={},e[t]=r),r!==null&&typeof r=="object"&&!Array.isArray(r)?ue(r,i,o,s):e[t]=i}},ue=(e,t,i=!0,o=!1)=>{if(!(t==null||t==="")){if(Array.isArray(t)){for(let s=0,r=t.length;s<r;++s)ua(e,s,t[s],i,o);return}for(const s of Object.keys(t))qs(s)||ua(e,s,t[s],i,o)}},Si=(e,t,i)=>{if(e===t)return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;const o=Array.isArray(e);if(o!==Array.isArray(t))return!1;if(o)return Pm(e,t);if(!yo(e)||!yo(t))return!1;const s=Object.keys(e),r=Object.keys(t),n=s.length,l=r.length;if(i===void 0){if(n!==l)return!1;for(let c=0;c<n;++c){const u=s[c];if(!(u in t)||!Si(e[u],t[u]))return!1}return!0}let a=0;for(let c=0;c<n;++c){const u=s[c];if(a===0&&u===i){a=1;continue}if(!(u in t)||!Si(e[u],t[u]))return!1}const d=i in t?1:0;return n-a===l-d},$s=class tt{static applyGlobalGridOptions(t){if(!tt.gridOptions)return{...t};let i={};return ue(i,tt.gridOptions,!0,!0),tt.mergeStrategy==="deep"?ue(i,t,!0,!0):i={...i,...t},tt.gridOptions.context&&(i.context=tt.gridOptions.context),t.context&&(tt.mergeStrategy==="deep"&&i.context&&ue(t.context,i.context,!0,!0),i.context=t.context),i}static applyGlobalGridOption(t,i){if(tt.mergeStrategy==="deep"){const o=Ks(t);if(o&&typeof o=="object"&&typeof i=="object")return tt.applyGlobalGridOptions({[t]:i})[t]}return i}};$s.gridOptions=void 0,$s.mergeStrategy="shallow";var yi=$s;function Dm(e,t="shallow"){yi.gridOptions=e,yi.mergeStrategy=t}function Ks(e){return yi.gridOptions?.[e]}var ha={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipSwitchShowDelay:200,tooltipHideDelay:1e4,noteTrigger:"hover",noteShowDelay:180,noteHideDelay:220,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,refreshAfterGroupEdit:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupHideColumnsUntilExpanded:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,suppressContentVisibilityAuto:!0,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,enableFilterHandlers:!1};function Fo(e){return typeof e=="number"&&Number.isFinite(e)}function ga(e){const t=Number(e);return Number.isFinite(t)?t:null}function Ft(e,t,i){return Math.max(t,Math.min(e,i))}function pa(e,t){if(typeof e!="number")return"";const i=t(),o=i("thousandSeparator",","),s=i("decimalSeparator",".");return e.toString().replace(".",s).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${o}`)}var fa="https://www.ag-grid.com";import{_doOnce as ma}from"ag-stack";function it(e,t,...i){e.get("debug")&&console.log("AG Grid: "+t,...i)}function qe(e,...t){ma(()=>va(e,...t),e+t?.join(""))}function Yt(e,...t){ma(()=>Ca(e,...t),e+t?.join(""))}function Ca(e,...t){console.error("AG Grid: "+e,...t)}function va(e,...t){console.warn("AG Grid: "+e,...t)}var wa=new Set,xo={},xt={},Eo,ba=!1,Sa=!1;function Mm(e){const[t,i]=e.version.split(".")||[],[o,s]=Eo.split(".")||[];return t===o&&i===s}function Am(e){Eo||(Eo=e.version);const t=o=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${o} Please update all modules to the same version.`;e.version?Mm(e)||Yt(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${Eo}.`)):Yt(t(`'${e.moduleName}' is incompatible.`));const i=e.validate?.();i&&!i.isValid&&Yt(`${i.message}`)}function Et(e,t){Am(e);const i=e.rowModels??["all"];wa.add(e);let o;t!==void 0?(ba=!0,xt[t]===void 0&&(xt[t]={}),o=xt[t]):o=xo;for(const s of i)o[s]===void 0&&(o[s]={}),o[s][e.moduleName]=e;if(e.dependsOn)for(const s of e.dependsOn)Et(s,t)}function Im(e){delete xt[e]}function ya(e,t,i){const o=s=>!!xo[s]?.[e]||!!xt[t]?.[s]?.[e];return o(i)||o("all")}function js(){return ba}function Tm(e,t){const i=xt[e]??{};return[...Object.values(xo.all??{}),...Object.values(i.all??{}),...Object.values(xo[t]??{}),...Object.values(i[t]??{})]}function km(){return new Set(wa)}function Lm(e,t){const i=xt[e]??{};return[...Object.values(i.all??{}),...Object.values(i[t]??{})]}function Qs(){return Sa}function Hm(){Sa=!0}var Ra=class{static register(e){Et(e,void 0)}static registerModules(e){for(const t of e)Et(t,void 0)}};function Fa(e){for(const t of e){if("setLicenseKey"in t)return t;if(t.dependsOn){const i=Fa(t.dependsOn);if(i)return i}}}var E="36.0.2",xa=2e3,Ea=100,Pa="_version_",Da=null,Jt=`${fa}/javascript-data-grid`;function Vm(e){Da=e}function Bm(e){Jt=e}function Ma(e,t,i){return Da?.(e,t)??[zm(e,t,i)]}function Po(e,t,i,o,s){e(`${o?"warning":"error"} #${t}`,...Ma(t,i,s))}function Om(e){if(!e)return String(e);const t={};for(const i of Object.keys(e))typeof e[i]!="object"&&typeof e[i]!="function"&&(t[i]=e[i]);return JSON.stringify(t)}function Gm(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=Om(e)),t}function Do(e){return e===void 0?"undefined":e===null?"null":e}function Zs(e,t){return`${e}?${t.toString()}`}function Nm(e,t,i){const o=Array.from(t.entries()).sort((r,n)=>n[1].length-r[1].length);let s=Zs(e,t);for(const[r,n]of o){if(r===Pa)continue;const l=s.length-i;if(l<=0)break;const a="...",d=l+a.length,c=n.length-d>Ea?n.slice(0,n.length-d)+a:n.slice(0,Ea)+a;t.set(r,c),s=Zs(e,t)}return s}function Aa(e,t){const i=new URLSearchParams;if(i.append(Pa,E),t)for(const r of Object.keys(t))i.append(r,Gm(t[r]));const o=`${Jt}/errors/${e}`,s=Zs(o,i);return s.length<=xa?s:Nm(o,i,xa)}var zm=(e,t,i)=>{const o=Aa(e,t),s=`${i?i+` `:""}Visit ${o}`;return Qs()?s:`${s}${i?"":` Alternatively register the ValidationModule to see the full message in the console.`}`};function R(...e){Po(qe,e[0],e[1],!0)}function U(...e){Po(Yt,e[0],e[1],!1)}function Ys(e,t,i){Po(Yt,e,t,!1,i)}function _m(e,t,i){Po(qe,e,t,!0,i)}function Ia(e,t){const i=t[0];return`error #${i} `+Ma(i,t[1],e).join(" ")}function Ie(...e){return Ia(void 0,e)}function Wm(...e){return Ia(` `,e)}function Ta(e,t){return e.get("rowModelType")===t}function J(e,t){return Ta(e,"clientSide")}function Xt(e,t){return Ta(e,"serverSide")}function oe(e,t){return e.get("domLayout")===t}function ot(e){return Ei(e)!==void 0}function Js(e){return typeof e.get("getRowHeight")=="function"}function Um(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function ka({gos:e,formula:t}){const i=e.get("rowNumbers");return i||!!t?.active&&i!==!1}function $e(e,t,i=!1,o){const{gos:s,environment:r}=e;if(o==null&&(o=r.getDefaultRowHeight()),Js(s)){if(i)return{height:o,estimated:!0};const a={node:t,data:t.data},d=s.getCallback("getRowHeight")(a);if(Fo(d))return d===0&&R(23),{height:Math.max(1,d),estimated:!1}}if(t.detail&&s.get("masterDetail"))return qm(s);const n=s.get("rowHeight");return{height:n&&Fo(n)?n:o,estimated:!1}}function qm(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return Fo(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function st(e){const{environment:t,gos:i}=e,o=i.get("rowHeight");if(!o||ca(o))return t.getDefaultRowHeight();const s=t.refreshRowHeightVariable();return s!==-1?s:(R(24),t.getDefaultRowHeight())}function La(e,t,i){const o=t[e.getDomDataKey()];return o?o[i]:void 0}function Pt(e,t,i,o){const s=e.getDomDataKey();let r=t[s];ca(r)&&(r={},t[s]=r),r[i]=o}function Dt(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function Xs(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||oe(e,"print"))}function Ke(e){return!e.get("autoGroupColumnDef")?.comparator&&!e.get("treeData")}function Ri(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function er(e){return e.get("grandTotalRow")}function Ha(e){switch(e){case"pinnedTop":return"top";case"pinnedBottom":return"bottom";default:return null}}function $m(e){const t=e.get("groupTotalRow");return typeof t=="function"?e.getCallback("groupTotalRow"):()=>t??void 0}function Va(e){return e.get("groupHideOpenParents")?!0:e.get("groupDisplayType")==="multipleColumns"}function Ba(e){return Va(e)&&e.get("groupHideColumnsUntilExpanded")&&J(e)}function tr(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function ir(e,t,i){return!!t.group&&!t.footer&&tr(e,i)}function Mt(e){const t=e.getCallback("getRowId");return t===void 0?t:i=>{let o=t(i);return typeof o!="string"&&(Em(()=>R(25,{id:o}),"getRowIdString"),o=String(o)),o}}function Oa(e,t){const i=e.get("groupHideParentOfSingleChild");return!!(i===!0||i==="leafGroupsOnly"&&t.leafGroup||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)}function Ga(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}function Km(e,t){const i=e.get("suppressGroupChangesColumnVisibility");if(i===!0||t&&i==="suppressHideOnGroup"||!t&&i==="suppressShowOnUngroup")return!1;const o=e.get("suppressRowGroupHidesColumns");if(t&&o===!0)return!1;const s=e.get("suppressMakeColumnVisibleAfterUnGroup");return!(!t&&s===!0)}function At(e){return e?.checkboxes??!0}function Fi(e){return e?.mode==="multiRow"&&(e.headerCheckbox??!0)}function xi(e){if(typeof e=="object")return e.checkboxLocation??"selectionColumn"}function or(e){return e?.hideDisabledCheckboxes??!1}function Na(e){return typeof e.get("rowSelection")!="string"}function jm(e){return e.get("cellSelection")!==void 0}function Qm(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t?.suppressMultiRanges??!1:!1:e.get("suppressMultiRangeSelection")}function Be(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function Zm(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"&&t.handle?.mode==="fill"?t.handle:void 0:{mode:"fill",setFillValue:e.get("fillOperation"),direction:e.get("fillHandleDirection"),suppressClearOnFillReduction:e.get("suppressClearOnFillReduction")}}function rt(e){const t=e.get("cellSelection")??!1;return(typeof t=="object"&&t.enableColumnSelection)??!1}function za(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const i=e.get("suppressRowClickSelection"),o=e.get("suppressRowDeselection");return i&&o?!1:i?"enableDeselection":o?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function Ym(e){const t=za(e);return t===!0||t==="enableSelection"}function Jm(e){const t=za(e);return t===!0||t==="enableDeselection"}function Mo(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t?.isRowSelectable}function Ei(e){const t="beanName"in e&&e.beanName==="gos"?e.get("rowSelection"):e.rowSelection;if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(t?.mode){case"multiRow":case"singleRow":return t.mode;default:return}}function ei(e){return Ei(e)==="multiRow"}function Xm(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):t?.enableSelectionWithoutKeys??!1}function Pi(e){const t=e.get("rowSelection");if(typeof t=="string"){const i=e.get("groupSelectsChildren"),o=e.get("groupSelectsFiltered");return i&&o?"filteredDescendants":i?"descendants":"self"}return t?.mode==="multiRow"?t.groupSelects:void 0}function _a(e,t=!0){const i=e.get("rowSelection");return typeof i!="object"?t?"all":void 0:i.mode==="multiRow"?i.selectAll:"all"}function eC(e){const t=e.get("rowSelection");return typeof t=="string"?!1:t?.mode==="multiRow"?t.ctrlASelectsRows??!1:!1}function ti(e){const t=Pi(e);return t==="descendants"||t==="filteredDescendants"}function Wa(e){const t=e.get("rowSelection");return typeof t=="object"&&t.masterSelects||"self"}function Ua(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function he(e){return e.get("columnMenu")==="legacy"}function qa(e){return!he(e)}function $a(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}function tC(e,t,i){typeof e!="object"&&(e={});const o={...e};for(const s of i){const r=t[s];typeof r<"u"&&(o[s]=r)}return o}function iC(e,t){if(!e)return;const i={};let o=!1;for(const n of Object.keys(e))i[n]=e[n],o=!0;if(!o)return;const s={type:"gridOptionsChanged",options:i};t.dispatchEvent(s);const r={type:"componentStateChanged",...i};t.dispatchEvent(r)}function H(e,t){return e.addCommon(t)}function oC(e,t){return e[t]??e.gridOptions?.[t]??Ks(t)??ha[t]}function Ka({gos:e},t){return t.button===2||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}function sr(e,t,i,o,s){const r=Ao(e,t,i),n=new Tt(r,t,i,o,"user");return n.buildToken=s,e.context.createBean(n),n}function Ao(e,t,i,o){const{gos:s,dataTypeSvc:r}=e,n={},l=s.get("defaultColDef");ue(n,l,!1,!0);const a=r?.updateColDefAndGetColumnType(n,t,i),d=t.type??a??n.type;n.type=d,d&&sC(e,Lo(d),n);const c=n.cellDataType;ue(n,t,!1,!0),c!==void 0&&(n.cellDataType=c);const u=s.get("autoGroupColumnDef");return u&&t.rowGroup&&Ke(s)&&ue(n,{sort:u.sort,initialSort:u.initialSort},!1,!0),r?.postProcess(n),r?.validateColDef(n,t,l,i),s.validateColDef(n,i,o),n}function sC(e,t,i){const o=t.length;if(o===0)return;const s=e.gos.get("columnTypes");if(s==null){ja(i,t,o,da);return}const r={...da},n=Object.keys(s);for(let l=0,a=n.length;l<a;++l){const d=n[l],c=s[d];d in r?R(34,{key:d}):(c.type&&R(35),r[d]=c)}ja(i,t,o,r)}function ja(e,t,i,o){for(let s=0;s<i;++s){const r=t[s].trim(),n=o[r];n?ue(e,n,!1,!0):R(36,{t:r})}}import{_areEqual as rC,_symmetricDiff as nC}from"ag-stack";import{_indexMap as lC}from"ag-stack";import{AgBeanStub as aC}from"ag-stack";var S=aC;function Di(e){return e instanceof Mi}var Mi=class extends S{constructor(e,t,i,o){super(),this.colGroupDef=e,this.groupId=t,this.padding=i,this.level=o,this.isColumn=!1,this.expandable=!1,this.expanded=!1,this.buildToken=0,this.displayInstances=null,this.lastVisible=!1,this.instanceId=hd(),this.expanded=!!e?.openByDefault}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){const e=this.children;for(let t=0,i=e.length;t<i;++t)if(e[t].isVisible())return!0;return!1}isPadding(){return this.padding}setExpanded(e){return e=!!e,this.expanded===e?!1:(this.expanded=e,this.dispatchLocalEvent({type:"expandedChanged"}),!0)}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.groupId}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(e){const t=this.children;for(let i=0,o=t.length;i<o;++i){const s=t[i];s.isColumn?e.push(s):s.addLeafColumns(e)}}getColumnGroupShow(){return this.colGroupDef?.columnGroupShow}setExpandable(){if(this.padding)return!0;const e=Xa(this.children,0),t=e===Ja;this.expandable!==t&&(this.expandable=t,this.dispatchLocalEvent({type:"expandableChanged"}));const i=e!==0;return this.lastVisible===i?!1:(this.lastVisible=i,!0)}},Qa=1,Za=2,Ya=4,Ja=7,Xa=(e,t)=>{for(let i=0,o=e.length;i<o;++i){const s=e[i];if(Di(s)&&s.padding)t=Xa(s.children,t);else if(s.isVisible()){const r=s.getColumnGroupShow();r==="open"?t|=Qa|Ya:r==="closed"?t|=Za|Ya:t|=Qa|Za}if(t===Ja)return t}return t};function ed(e,t){let i=0,o=0;const s=e.length;let r=s,n=-1,l=s,a=-1;for(let g=0;g<s;++g){const p=e[g].colDef.lockPosition;p==="right"?(++o,l===s&&(l=g),a=g):(p==="left"||p===!0)&&(++i,r===s&&(r=g),n=g)}if(i===0&&o===0)return e;let d,c,u;if(t.get("enableRtl")){if(a===o-1&&r===s-i)return e;u=0,c=o,d=s-i}else{if(n===i-1&&l===s-o)return e;d=0,c=i,u=s-o}const h=new Array(s);for(let g=0;g<s;++g){const p=e[g],f=p.colDef.lockPosition;let m;f==="right"?m=u++:f==="left"||f===!0?m=d++:m=c++,h[m]=p}return h}function td(e,t){const i=lC(e);let o=0,s=0,r=0;const n=a=>{for(let d=0,c=a.length;d<c;++d){const u=a[d];if(Di(u)){n(u.children);continue}const h=i.get(u)??-1;r===0?(o=h,s=h):h<o?o=h:h>s&&(s=h),++r}},l=a=>{for(let d=0,c=a.length;d<c;++d){const u=a[d];if(Di(u)&&(u.colGroupDef?.marryChildren&&(r=0,n(u.children),r>1&&s-o>r-1)||!l(u.children)))return!1}return!0};return l(t)}function id(e,t){if(!e||e.length==0)return;const i=t(e[0]);for(let o=1;o<e.length;o++)if(i!==t(e[o]))return;return i}function od(e,t,i){if(!t.length)return;const o=t.length===1?t[0]:null,s=id(t,r=>r.getPinned());e.dispatchEvent({type:"columnPinned",pinned:s??null,columns:t,column:o,source:i})}function rr(e,t,i){if(!t.length)return;const o=t.length===1?t[0]:null,s=id(t,r=>r.isVisible());e.dispatchEvent({type:"columnVisible",visible:s,columns:t,column:o,source:i})}function nr(e,t,i,o){e.dispatchEvent({type:t,columns:i,column:i?.length==1?i[0]:null,source:o})}function ii(e,t,i,o,s=null){t?.length&&e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:s,finished:i,source:o})}var sd=(e,t,i,o,s,r,n,l)=>{const{sortSvc:a,pinnedCols:d,colFlex:c}=e;i!==void 0&&t.setVisible(!i,l),a&&(a.updateColSort(t,o,l),s!==void 0&&a.setColSortIndex(t,s)),r!==void 0&&d?.setColPinned(t,r),n!==void 0&&c?.setColFlex(t,n)};function Ai(e,t,i=!1,o,s=!1){const r=e.colModel,n=i===!0;let l=null;for(let a=0,d=t.length;a<d;++a){const c=t[a],u=typeof c=="string"?r.getCol(c):c;u===void 0||s&&u.colDef.lockVisible||u.visible!==n&&(u.setVisible(n,o),l??(l=[]),l.push(u))}if(l){const{colAnimation:a,eventSvc:d}=e;a?.start(),r.refreshColsDerivedState(),e.visibleCols.refresh(o,!1),d.dispatchEvent({type:"columnEverythingChanged",source:o}),rr(d,l,o),a?.finish()}}function je(e,t,i){const{colModel:o,colAnimation:s,calculatedColsSvc:r}=e,n=t.state;if(n&&!Array.isArray(n))return R(32),!1;n&&r?.restoreDynamicColumnDefs(n)&&r.refreshDynamicColumns(i);const l=o.colDefList,a=e.selectionColSvc?.column;if(!l.length&&!a)return!1;s?.start();const d=ar(e);let c=lr(e,n??null,l,t,i,!0);if(c!==null||t.defaultState){const u=e.pivotResultCols?.pivotCols;c=lr(e,c,u,t,i,!1)}return ld(e,t,i,d),s?.finish(),c===null}function lr(e,t,i,o,s,r){const n=e.colModel,l=o.defaultState;let a=null,d=null,c=null;const u=l?new Set:null;if(t)for(let h=0,g=t.length;h<g;++h){const p=t[h],f=p.colId;let m;if(f!=null){if(f.startsWith(Lt)){a??(a=[]),a.push(p);continue}if(f.startsWith(ko)){d??(d=[]),d.push(p);continue}if(r)m=n.getNonPivotColById(f);else{const C=n.getCol(f);m=C?.colDef.pivotKeys==null?null:C}}m?(Io(e,m,p,l,s),u?.add(m)):(c??(c=[]),c.push(p))}if(u!==null&&i)for(let h=0,g=i.length;h<g;++h){const p=i[h];u.has(p)||Io(e,p,null,l,s)}return r&&dC(e,a,d,l,s),c}function dC(e,t,i,o,s){const{autoColSvc:r,selectionColSvc:n,rowGroupColsSvc:l,pivotColsSvc:a,valueColsSvc:d}=e;l?.sortByPendingState(),a?.sortByPendingState(),d?.sortByPendingState(),e.colModel.refreshCols(!1,s);const c=n?.column;rd(e,t,r?.columns??[],o,s),rd(e,i,c?[c]:[],o,s)}function rd(e,t,i,o,s){let r=null;if(t!==null){r=new Set;for(let n=0,l=t.length;n<l;++n){const a=t[n],d=a.colId;for(let c=0,u=i.length;c<u;++c){const h=i[c];if(h.colId===d){r.add(h),Io(e,h,a,o,s);break}}}}if(o)for(let n=0,l=i.length;n<l;++n){const a=i[n];r?.has(a)||Io(e,a,null,o,s)}}function Io(e,t,i,o,s){const r=It(i?.flex,o?.flex),n=It(i?.sort,o?.sort),l=It(i?.sortType,o?.sortType),d=lt(n)||cr(l)?{type:Oe(l),direction:To(n)}:void 0;if(sd(e,t,It(i?.hide,o?.hide),d,It(i?.sortIndex,o?.sortIndex),It(i?.pinned,o?.pinned),r,s),r==null){const c=It(i?.width,o?.width);if(c!=null){const u=t.colDef.minWidth??e.environment.getDefaultColumnMinWidth();u!=null&&c>=u&&t.setActualWidth(c,s)}}t.colKind==="auto-group"||!t.primary||(e.valueColsSvc?.syncColState(t,i,o,s),e.rowGroupColsSvc?.syncColState(t,i,o,s),e.pivotColsSvc?.syncColState(t,i,o,s),e.showValuesAsSvc?.syncColState(t,i,o,s))}function nd(e,t){const{colModel:i,autoColSvc:o,selectionColSvc:s,eventSvc:r,gos:n,colAnimation:l,calculatedColsSvc:a}=e;if(a?.resetDynamicColumnDefs(!0)&&a.refreshDynamicColumns(t),!i.colDefList.length)return;const d=s?.column??null,c=o?.columns,u=c?.length??0,h=new Array(u+(d?1:0)+i.colDefList.length);let g=0,p=-1,f=-1;const m=y=>{const x=ud(e,y),{rowGroupIndex:A,pivotIndex:V}=x;A!=null&&A>p&&(p=A),V!=null&&V>f&&(f=V),h[g++]=x};if(c)for(let y=0;y<u;++y)m(c[y]);d&&m(d),dr(i.colDefTree,m);for(let y=0,x=h.length;y<x;++y){const A=h[y];A.rowGroup&&A.rowGroupIndex==null&&(A.rowGroupIndex=++p),A.pivot&&A.pivotIndex==null&&(A.pivotIndex=++f)}l?.start();const C=ar(e);lr(e,h,i.colDefList,{},t,!0);const v=o?.columns,w=v?.length??0,b=new Array((d?1:0)+w+i.colDefList.length);let F=0;d&&(b[F++]={colId:d.colId});for(let y=0;y<w;++y)b[F++]={colId:v[y].colId};dr(i.colDefTree,y=>{b[F++]={colId:y.colId}}),ld(e,{state:b,applyOrder:!0},t,C),l?.finish(),r.dispatchEvent(H(n,{type:"columnsReset",source:t}))}function ld(e,t,i,o){cC(e,t),e.visibleCols.refresh(i,!1),e.eventSvc.dispatchEvent({type:"columnEverythingChanged",source:i}),ad(e,i,o)}function cC(e,t){const i=e.colModel,o=t.state;if(!t.applyOrder||!o||!i.ready)return;const s=i.colsById,r=i.colsList,n=new Set,l=[];for(let u=0,h=o.length;u<h;++u){const g=o[u].colId;if(g==null)continue;const p=s[g];p!=null&&p.inColsList&&!n.has(p)&&(l.push(p),n.add(p))}let a=null;for(let u=0,h=r.length;u<h;++u){const g=r[u];n.has(g)||(g.colKind==="auto-group"?(a??(a=[]),a.push(g)):l.push(g))}const d=a??l;if(a!==null)for(let u=0,h=l.length;u<h;++u)d.push(l[u]);const c=ed(d,e.gos);if(!rC(c,r)){if(i.hasMarryChildren&&!td(c,i.colsTree)){R(39);return}i.colsList=c,i.markColsListIndexDirty()}}function ar(e){const{rowGroupColsSvc:t,pivotColsSvc:i,colModel:o}=e,s=t?.columns,r=i?.columns,n=o.getColsInStateOrder(),l=new Map;for(let a=0,d=n.length;a<d;++a){const c=n[a],u=c.sortDef,h=u.direction;l.set(c.colId,{width:c.actualWidth,hide:!c.visible,pinned:c.pinned,sort:h,sortType:h?u.type:void 0,sortIndex:c.sortIndex??null,aggFunc:c.aggregationActive?c.aggFunc:null})}return{rowGroupColumns:s?.length?s.slice():void 0,pivotColumns:r?.length?r.slice():void 0,before:l,colsList:o.colsList}}function ad(e,t,i){const o=e.rowGroupColsSvc?.columns,s=e.pivotColsSvc?.columns;dd(e,t,"columnRowGroupChanged",i.rowGroupColumns,o),dd(e,t,"columnPivotChanged",i.pivotColumns,s),uC(e,t,i.before),hC(e,t,i)}function dd(e,t,i,o,s){fC(o,s)||nr(e.eventSvc,i,nC(o,s),t)}function uC(e,t,i){const{eventSvc:o,sortSvc:s}=e,r=e.colModel.getAllCols();let n=null,l=null,a=null,d=null,c=null;for(let u=0,h=r.length;u<h;++u){const g=r[u],p=i.get(g.colId);p&&(p.width!=g.actualWidth&&(l??(l=[]),l.push(g)),p.pinned!=g.pinned&&(a??(a=[]),a.push(g)),p.hide==g.visible&&(d??(d=[]),d.push(g)),gC(g,p)&&(n??(n=[]),n.push(g)),s&&pC(g,p)&&(c??(c=[]),c.push(g)))}n&&nr(o,"columnValueChanged",n,t),l&&ii(o,l,!0,t),a&&od(o,a,t),d&&rr(o,d,t),c&&s?.dispatchSortChangedEvents(t,c)}function hC(e,t,i){const o=e.colModel,s=o.colsList;if(s===i.colsList)return;const r=i.before,n=o.colsById;let l;for(const u of r.keys()){const h=n[u];h?.inColsList&&(l??(l=[]),l.push(h))}if(!l)return;let a=0,d;const c=l.length;for(let u=0,h=s.length;u<h&&a<c;++u){const g=s[u];if(r.has(g.colId)){const p=l[a++];p!==g&&(d??(d=[]),d.push(p))}}d&&e.eventSvc.dispatchEvent({type:"columnMoved",columns:d,column:d.length===1?d[0]:null,finished:!0,source:t})}var cd=e=>{const t=e.colModel;if(!t.isAlive())return[];const i=t.getColsInStateOrder(),o=new Array(i.length);for(let s=0,r=i.length;s<r;++s){const n=i[s],l=n.rowGroupActive,a=n.pivotActive,d=n.sortDef,c=d.direction;o[s]={colId:n.colId,width:n.actualWidth,hide:!n.visible,pinned:n.pinned,sort:c,sortType:c?d.type??null:null,sortIndex:n.sortIndex??null,aggFunc:n.aggregationActive?n.aggFunc:null,valueIndex:n.aggregationActive?n.aggregationActiveIndex:null,rowGroup:l,rowGroupIndex:l?n.rowGroupActiveIndex:null,pivot:a,pivotIndex:a?n.pivotActiveIndex:null,flex:n.flex??null,showValuesAs:e.showValuesAsSvc?.toColState(n)??null}}return o};function ud(e,t){const i=t.colDef,o=ve(i.sort??i.initialSort??null),s=i.rowGroupIndex??i.initialRowGroupIndex??null;let r=i.rowGroup??i.initialRowGroup??null;s==null&&r===!1&&(r=null);const n=i.pivotIndex??i.initialPivotIndex??null;let l=i.pivot??i.initialPivot??null;return n==null&&l===!1&&(l=null),{colId:t.colId,sort:o.direction,sortType:o.type,sortIndex:i.sortIndex??i.initialSortIndex??null,hide:i.hide??i.initialHide??null,pinned:i.pinned??i.initialPinned??null,width:i.width??i.initialWidth??null,flex:i.flex??i.initialFlex??null,rowGroup:r,rowGroupIndex:s,pivot:l,pivotIndex:n,aggFunc:i.aggFunc??i.initialAggFunc??null,showValuesAs:e.showValuesAsSvc?.colDefSelection(i)??null}}var It=(e,t)=>e!==void 0?e:t,dr=(e,t)=>{for(let i=0,o=e.length;i<o;++i){const s=e[i],r=s.children;r?dr(r,t):t(s)}},gC=(e,t)=>{const i=t.aggFunc,o=i!=null;return o!==e.aggregationActive||o&&i!=e.aggFunc},pC=(e,t)=>{if(t.sortIndex!=e.sortIndex)return!0;const i=e.getSortDef(),o=t.sortType??"default";return i?i.direction!==t.sort||i.type!==o:t.sort!==null},fC=(e,t)=>{if(e===t)return!0;const i=e?.length??0;if(i!==(t?.length??0))return!1;for(let o=0;o<i;++o){const s=e[o],r=t[o];if(s!==r&&s.colId!==r.colId)return!1}return!0},mC=0;function hd(){return mC++}var CC=e=>e instanceof Tt,nt=(e,t)=>{if(!t.group&&!t.rowPinned){const i=e.pivotValueColumn;if(i)return i}return e},vC=["asc","desc",null],wC=[{type:"absolute",direction:"asc"},{type:"absolute",direction:"desc"},null],Tt=class extends S{constructor(e,t,i,o,s){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=o,this.colKind=s,this.isColumn=!0,this.instanceId=hd(),this.aggFunc=void 0,this.isCalculatedCol=!1,this.field=void 0,this.fieldPath=null,this.valueGetter=void 0,this.allowFormula=!1,this.showRowGroup=void 0,this.pivotValueColumn=void 0,this.valueFormatter=void 0,this.refData=void 0,this.enableCellChangeFlash=void 0,this.colSpan=void 0,this.rowSpan=void 0,this.calculatedExpression=void 0,this.actualWidth=0,this.minWidth=0,this.maxWidth=0,this.flex=null,this.pinned=null,this.left=null,this.oldLeft=null,this.visible=!1,this.displayed=!1,this.filterActive=!1,this.sortDef=ve(),this.sortIndex=void 0,this.autoHeaderHeight=null,this.tooltipEnabled=!1,this.tooltipFieldContainsDots=!1,this.frameworkEventListenerService=void 0,this.colEventSvc=null,this.buildToken=0,this.allColsIndex=-1,this.inColsList=!1,this.ariaColIndex=0,this.colsListIndex=-1,this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.highlighted=null,this.formulaRef=null,this.showValuesAsDef=void 0,this.showValuesAs=null,this.anchoredToColId=void 0,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.rowGroupActive=!1,this.rowGroupActiveIndex=-1,this.pivotActive=!1,this.pivotActiveIndex=-1,this.aggregationActive=!1,this.aggregationActiveIndex=-1,this.showRowGroupCol=null,this.parent=null,this.originalParent=null,this.cachedSortTypes=null,this.colIdSanitised=xm(i)}destroy(){super.destroy(),this.allColsIndex=-1,this.displayed=!1,this.colsListIndex=-1,this.inColsList=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}initState(){const{beans:e,colDef:t}=this,{sortSvc:i,pinnedCols:o,colFlex:s}=e;i?.initCol(this);const r=t.hide;this.visible=r!==void 0?!r:!t.initialHide,o?.initCol(this),s?.initCol(this)}setColDef(e,t,i){const o=this.colDef;return this.userProvidedColDef=t,this.colDef=e,Si(e,o)?(this.initCalculatedColumnState(e),!1):(this.cachedSortTypes=null,this.initColDefHotFields(),this.beans.showValuesAsSvc?.resolveColumn(this,!1),this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),e.spanRows!==o.spanRows&&this.beans.rowSpanSvc?.columnRowSpanChanged(this),this.dispatchColEvent("colDefChanged",i),this.beans.pivotResultCols?.recreateColDefsForSource(this,i),!0)}reapplyColDef(e,t,i){const o=Ao(this.beans,e,this.colId);if(this.setColDef(o,e,t),i){sd(this.beans,this,o.hide,o.sort,o.sortIndex,o.pinned,o.flex,t);const s=this.flex;(s==null||s<=0)&&this.setActualWidth(o.width??this.actualWidth,t)}}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.initColDefHotFields(),this.beans.showValuesAsSvc?.resolveColumn(this,!0),this.initState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const{field:e,tooltipField:t}=this.colDef;this.field=e,this.gos.get("suppressFieldDotNotation")?(this.fieldPath=null,this.tooltipFieldContainsDots=!1):(this.fieldPath=typeof e=="string"&&e.includes(".")?e.split("."):null,this.tooltipFieldContainsDots=typeof t=="string"&&t.includes("."))}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.beans.tooltipSvc?.initCol(this)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){const t=e.width??e.initialWidth??200;return Ft(t,this.minWidth,this.maxWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){return this.beans.showRowGroupCols?.isRowGroupDisplayed(this,e)??!1}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldPath!==null}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}getColEventSvc(){let e=this.colEventSvc;return e||(e=new Fm,this.colEventSvc=e),e}__addEventListener(e,t){this.getColEventSvc().addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc?.removeEventListener(e,t)}addEventListener(e,t){const i=this.getColEventSvc();this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,i);const o=this.frameworkEventListenerService?.wrap(e,t)??t;i.addEventListener(e,o)}removeEventListener(e,t){const i=this.frameworkEventListenerService?.unwrap(e,t)??t;this.colEventSvc?.removeEventListener(e,i)}createColumnFunctionCallbackParams(e){return H(this.gos,{node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){return this.beans.cellNavigation?.isSuppressNavigable(this,e)??!1}isCellEditable(e){return this.beans.editSvc?.isCellEditable({rowNode:e,column:this})??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.beans.selectionSvc?.isCellCheckboxSelection(this,e)??!1}isSuppressPaste(e){return this.isCalculatedCol||this.isColumnFunc(e,this.colDef.suppressPaste??null)}initColDefHotFields(){const e=this.colDef;this.valueGetter=e.valueGetter,this.allowFormula=e.allowFormula===!0,this.showRowGroup=e.showRowGroup,this.pivotValueColumn=e.pivotValueColumn,this.valueFormatter=e.valueFormatter,this.refData=e.refData,this.enableCellChangeFlash=e.enableCellChangeFlash,this.colSpan=e.colSpan,this.rowSpan=e.rowSpan,this.initCalculatedColumnState(e)}initCalculatedColumnState(e){this.calculatedExpression=e.calculatedExpression,this.isCalculatedCol=this.calculatedExpression!==void 0&&this.beans.calculatedColsSvc?.isEnabled()===!0}isResizable(){return this.colDef.resizable??!0}isColumnFunc(e,t){return typeof t=="boolean"?t:typeof t=="function"&&t(this.createColumnFunctionCallbackParams(e))}isMoving(){return this.moving}getSort(){return this.sortDef.direction}getSortDef(){const e=this.sortDef;return e.direction?e:null}setSortDef(e){this.sortDef=e}isSortable(){return this.colDef.sortable??!0}isSortAscending(){return this.getSort()==="asc"}isSortDescending(){return this.getSort()==="desc"}isSortNone(){return!this.getSort()}isSorting(){return this.getSort()!=null}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getShowValuesAs(){return this.showValuesAs}getShowValuesAsDef(){return this.showValuesAsDef??null}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){const i=this.left;this.oldLeft=i,i!==e&&(this.left=e,this.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){return R(261),!!this.beans.colHover?.isHovered(this)}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.dispatchColEvent("lastLeftPinnedChanged",t))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const i=e===!0;if(this.visible!==i){this.visible=i;let o=this.originalParent;for(;o&&o.setExpandable();)o=o.originalParent;this.dispatchColEvent("visibleChanged",t)}this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.colDef.suppressSpanHeaderHeight}getFirstRealParent(){let e=this.originalParent;for(;e?.padding;)e=e.originalParent;return e}getColumnGroupPaddingInfo(){let e=this.parent;if(!e?.providedColumnGroup.padding)return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let i=!0;for(;e;){if(!e.providedColumnGroup.padding){i=!1;break}e=e.parent}return{numberOfParents:t,isSpanningTotal:i}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getDisplayName(e="columnDrop"){return this.beans.colNames.getDisplayNameForColumn(this,e)||this.colDef.headerName||this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){return this.autoHeaderHeight!==e?(this.autoHeaderHeight=e,!0):!1}getColSpan(e){const t=this.colSpan;if(t==null)return 1;const i=this.createColumnFunctionCallbackParams(e),o=t(i);return o<1?1:o}getRowSpan(e){const t=this.rowSpan;if(t==null)return 1;const i=this.createColumnFunctionCallbackParams(e),o=t(i);return o<1?1:o}setActualWidth(e,t,i=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex!=null&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.dispatchColEvent("widthChanged",e)}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.pivotActive||this.rowGroupActive||this.aggregationActive}isAnyFunctionAllowed(){const e=this.colDef;return e.enablePivot===!0||e.enableRowGroup===!0||e.enableValue===!0}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}isAllowFormula(){return this.allowFormula}dispatchColEvent(e,t,i){this.colEventSvc?.dispatchEvent(H(this.gos,{type:e,column:this,columns:[this],source:t,...i}))}dispatchStateUpdatedEvent(e){this.colEventSvc?.dispatchEvent({type:"columnStateUpdated",key:e})}},ve=e=>kt(e)?{direction:e.direction,type:e.type}:{direction:To(e),type:Oe(e)},gd=e=>{const t=[],{sort:i,initialSort:o}=e.colDef;return i!==null&&t.push(Oe(i?.type)),o!==null&&t.push(Oe(o?.type)),t},pd=(e,t,i)=>t.colDef.sortingOrder??e.get("sortingOrder")??(i.includes("absolute")?wC:vC),bC=(e,t)=>{const i=pd(e,t,gd(t)),o=new Array(i.length);for(let s=0,r=i.length;s<r;++s)o[s]=ve(i[s]);return o},SC=(e,t)=>{const i=e.get("sortingOrder")==null,o=t.cachedSortTypes;if(i&&o)return o;const s=gd(t),r=new Set(s),n=pd(e,t,s);for(let l=0,a=n.length;l<a;++l){const d=n[l];if(!kt(d)){To(d)&&r.add(Oe(d));continue}d.direction&&r.add(d.type)}return i&&(t.cachedSortTypes=r),r},lt=e=>e==="asc"||e==="desc"||e===null,cr=e=>e==="default"||e==="absolute",kt=e=>{if(!e||typeof e!="object")return!1;const t=e;return cr(t.type)&&lt(t.direction)},To=e=>lt(e)?e:null,Oe=e=>cr(e)?e:"default",fd=(e,t,i)=>{const s=i?.()??t.sortSvc?.getDisplaySort(e),r=Oe(s?.type),n=To(s?.direction),l=SC(t.gos,e);return{isDefaultSortAllowed:l.has("default"),isAbsoluteSortAllowed:l.has("absolute"),isAbsoluteSort:r==="absolute",isDefaultSort:r==="default",isAscending:n==="asc",isDescending:n==="desc",direction:n}},Lt="ag-Grid-AutoColumn",ko="ag-Grid-SelectionColumn",md="ag-Grid-RowNumbersColumn",yC="ag-Grid-HierarchyColumn";function at(e){let t=0;for(let i=0,o=e.length;i<o;++i)t+=e[i].actualWidth;return t}function ur(e){return e.colKind==="auto-group"}function Ii(e){return e.colKind==="selection"}function we(e){return e.colKind==="row-number"}function Cd(e){const t=e.colKind;return t==="selection"||t==="row-number"}function Lo(e){return Array.isArray(e)?e:typeof e=="string"?e.split(","):[]}function Ht(e){return e==="optionsUpdated"?"gridOptionsChanged":e}function vd(e,t,i){const o=wd(t),s=e.showValuesAsSvc?.colDefSelection(t)??void 0;return o?{...t,colId:i,sort:o.direction,sortType:o.type,showValuesAs:s}:{...t,colId:i,sort:void 0,showValuesAs:s}}function wd(e){const{sort:t,initialSort:i}=e,o=kt(t)||lt(t),s=kt(i)||lt(i);return o?ve(t):s?ve(i):null}var bd=(e,t)=>{if(e)for(let i=0,o=e.length;i<o;++i){const s=e[i];s.isAlive()&&s.destroy()}if(t)for(let i=0,o=t.length;i<o;++i){const s=t[i];s.isAlive()&&s.destroy()}},Sd=(e,t,i)=>{for(let o=0,s=e.length;o<s;++o){const r=e[o];r.buildToken!==i&&r.isAlive()&&r.destroy()}for(let o=0,s=t.length;o<s;++o){const r=t[o];r.buildToken!==i&&r.isAlive()&&r.destroy()}};function yd(e,t){for(let i=0,o=e.length;i<o;++i){const s=e[i];"children"in s?yd(s.children,t):t(s)}}import{_escapeString as RC}from"ag-stack";var be=e=>e instanceof oi,oi=class extends S{constructor(e,t,i,o){super(),this.providedColumnGroup=e,this.groupId=t,this.partId=i,this.pinned=o,this.isColumn=!1,this.children=null,this.displayedChildren=[],this.autoHeaderHeight=null,this.left=null,this.oldLeft=null,this.parent=null,this.buildToken=0,this.uniqueId=`${t}_${i}`,this.colIdSanitised=RC(this.uniqueId)}getParent(){return this.parent}getUniqueId(){return this.uniqueId}isEmptyGroup(){return!this.displayedChildren?.length}isMoving(){return Rd(this.providedColumnGroup)===!0}checkLeft(){const e=this.displayedChildren;let t=null;if(e)for(let i=0,o=e.length;i<o;++i){const s=e[i];be(s)&&s.checkLeft();const r=s.left;r!=null&&(t==null||r<t)&&(t=r)}this.setLeft(t)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getDisplayName(e="columnDrop"){return this.beans.colNames.getDisplayNameForColumnGroup(this,e)||this.getColGroupDef()?.headerName||this.getGroupId()}getPartId(){return this.partId}getActualWidth(){let e=0;const t=this.displayedChildren;if(t)for(let i=0,o=t.length;i<o;++i)e+=t[i].getActualWidth();return e}isResizable(){const e=this.displayedChildren;if(e){for(let t=0,i=e.length;t<i;++t)if(e[t].isResizable())return!0}return!1}getMinWidth(){const e=this.displayedChildren;if(!e)return 0;let t=0;for(let i=0,o=e.length;i<o;++i){const s=e[i];t+=s.getMinWidth()}return t}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}get ariaColIndex(){return Vt(this,!1,!1)?.ariaColIndex??0}getDefinition(){return this.providedColumnGroup.colGroupDef}getColGroupDef(){return this.providedColumnGroup.colGroupDef}isPadding(){return this.providedColumnGroup.padding}isExpandable(){return this.providedColumnGroup.expandable}isExpanded(){return!!this.providedColumnGroup.expanded}isAutoHeaderHeight(){return!!this.providedColumnGroup.colGroupDef?.autoHeaderHeight}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){return e===this.autoHeaderHeight?!1:(this.autoHeaderHeight=e,!0)}addDisplayedLeafColumns(e){const t=this.displayedChildren;if(t)for(let i=0,o=t.length;i<o;++i){const s=t[i];s.isColumn?e.push(s):be(s)&&s.addDisplayedLeafColumns(e)}}addLeafColumns(e){const t=this.children;if(t)for(let i=0,o=t.length;i<o;++i){const s=t[i];s.isColumn?e.push(s):be(s)&&s.addLeafColumns(e)}}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){let e=0,t=this;for(;t?.providedColumnGroup.padding&&t.parent?.providedColumnGroup.padding;)++e,t=t.parent;return e}},Vt=(e,t,i)=>{const o=t?e.displayedChildren:e.children;if(o)for(let s=0,r=o.length;s<r;++s){const n=o[i?r-1-s:s];if(n.isColumn)return n;const l=Vt(n,t,i);if(l)return l}return null},Rd=e=>{let t=!1;const i=e.children;for(let o=0,s=i.length;o<s;++o){const r=i[o];if(r.isColumn){if(t=!0,!r.moving)return!1;continue}const n=Rd(r);if(n===!1)return!1;n===!0&&(t=!0)}return t||null},Fd=(e,t)=>{let i=e.parent;if(i){let o=i.getPaddingLevel();for(;i&&i.providedColumnGroup.level+o>t;)i=i.parent,o=o>0?o-1:0}return i},Ho="ROOT_NODE_ID",Vo="rowGroupFooter_",hr="detail_",xd=Vo+Ho;import{AgPromise as FC,KeyCode as xC}from"ag-stack";import{BaseDragAndDropService as EC}from"ag-stack";function Ed(e){return typeof e=="object"&&!!e.component}import{AgPromise as PC}from"ag-stack";function DC(e){return e?e.prototype&&"getGui"in e.prototype:!1}function Pd(e,t,i,o){const{name:s}=i;let r,n,l,a,d,c;if(t){const u=t,h=u[s+"Selector"],g=h?h(o):null,p=f=>{typeof f=="string"?r=f:f!=null&&f!==!0&&(e.isFrameworkComponent(f)?l=f:n=f)};g?(p(g.component),a=g.params,d=g.popup,c=g.popupPosition):p(u[s])}return{compName:r,jsComp:n,fwComp:l,paramsFromSelector:a,popupFromSelector:d,popupPositionFromSelector:c}}var MC=class extends S{constructor(){super(...arguments),this.beanName="userCompFactory"}wireBeans(e){this.agCompUtils=e.agCompUtils,this.registry=e.registry,this.frameworkCompWrapper=e.frameworkCompWrapper,this.gridOptions=e.gridOptions}getCompDetailsFromGridOptions(e,t,i,o=!1){return this.getCompDetails(this.gridOptions,e,t,i,o)}getCompDetails(e,t,i,o,s=!1){const{name:r,cellRenderer:n}=t;let{compName:l,jsComp:a,fwComp:d,paramsFromSelector:c,popupFromSelector:u,popupPositionFromSelector:h}=Pd(this.beans.frameworkOverrides,e,t,o),g,p;const f=w=>{const b=this.registry.getUserComponent(r,w);b&&(a=b.componentFromFramework?void 0:b.component,d=b.componentFromFramework?b.component:void 0,g=b.params,p=b.processParams)};if(l!=null&&f(l),a==null&&d==null&&i!=null&&f(i),a&&n&&!DC(a)&&(a=this.agCompUtils?.adaptFunction(t,a)),!a&&!d){const{validation:w}=this.beans;s&&(l!==i||!i)?l?w?.isProvidedUserComp(l)||U(50,{compName:l}):i?w||U(260,{...this.gos.getModuleErrorParams(),propName:r,compName:i}):U(216,{name:r}):i&&!w&&U(146,{comp:i});return}const m=this.mergeParams(e,t,o,c,g,p),C=a==null,v=a??d;return{componentFromFramework:C,componentClass:v,params:m,type:t,popupFromSelector:u,popupPositionFromSelector:h,newAgStackInstance:()=>this.newAgStackInstance(v,C,m,t)}}newAgStackInstance(e,t,i,o){const s=!t;let r;s?r=new e:r=this.frameworkCompWrapper.wrap(e,o.mandatoryMethods,o.optionalMethods,o),this.createBean(r);const n=r.init?.(i);return n==null?PC.resolve(r):n.then(()=>r)}mergeParams(e,t,i,o=null,s,r){const n={...i,...s},a=e?.[t.name+"Params"];if(typeof a=="function"){const d=a(i);ue(n,d)}else typeof a=="object"&&ue(n,a);return ue(n,o),r?r(n):n}},AC={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},IC={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},TC={name:"headerComponent",optionalMethods:["refresh"]},kC={name:"innerHeaderComponent"},LC={name:"innerHeaderGroupComponent"},HC={name:"headerGroupComponent"},VC={name:"innerRenderer",cellRenderer:!0,optionalMethods:["afterGuiAttached"]},BC={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},OC={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},GC={name:"loadingCellRenderer",cellRenderer:!0},NC={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},zC={name:"tooltipComponent"},gr={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},_C={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},WC={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},UC={name:"loadingCellRenderer",cellRenderer:!0},qC={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},$C={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function KC(e,t){return e.getCompDetailsFromGridOptions(IC,"agDragAndDropImage",t,!0)}function jC(e,t,i){return e.getCompDetails(t,VC,void 0,i)}function QC(e,t,i){return e.getCompDetails(t,T