ag-grid-enterprise
Version:
Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
34 lines • 1.14 MB
JavaScript
var wn=Object.defineProperty,xp=Object.getOwnPropertyDescriptor,Mp=Object.getOwnPropertyNames,Ep=Object.prototype.hasOwnProperty,Sn=(e,t)=>{for(var s in t)wn(e,s,{get:t[s],enumerable:!0})},yn=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Mp(t))!Ep.call(e,r)&&r!==s&&wn(e,r,{get:()=>t[r],enumerable:!(i=xp(t,r))||i.enumerable});return e},bn=(e,t,s)=>(yn(e,t,"default"),s&&yn(s,t,"default")),xn={};Sn(xn,{AdvancedFilterModule:()=>wr,AgDialog:()=>Qe,AgGroupComponent:()=>ge,AgGroupComponentSelector:()=>G,AgMenuItemComponent:()=>Gt,AgMenuItemRenderer:()=>Ge,AgMenuList:()=>et,AgMenuPanel:()=>ir,AgPanel:()=>Vs,AgPrimaryCols:()=>xi,AgRichSelect:()=>Lt,ClipboardModule:()=>ga,ColumnsToolPanelModule:()=>Ba,EnterpriseCoreModule:()=>H,ExcelExportModule:()=>qa,FiltersToolPanelModule:()=>eo,GridChartsModule:()=>fi,GroupCellRenderer:()=>ut,GroupCellRendererCtrl:()=>Nt,LicenseManager:()=>Ji,MasterDetailModule:()=>ao,MenuModule:()=>po,MultiFilter:()=>Ss,MultiFilterModule:()=>vo,PillDragComp:()=>Bs,PillDropZonePanel:()=>Os,PivotDropZonePanel:()=>os,RangeSelectionModule:()=>Js,RichSelectModule:()=>Co,RowGroupDropZonePanel:()=>ns,RowGroupingModule:()=>Si,ServerSideRowModelModule:()=>Io,SetFilter:()=>Ni,SetFilterModule:()=>Ho,SideBarModule:()=>ds,SparklinesModule:()=>jo,StatusBarModule:()=>Jo,TabbedLayout:()=>Hs,ToolPanelColDefService:()=>Ta,ValuesDropZonePanel:()=>yi,ViewportRowModelModule:()=>Qo,VirtualList:()=>Be,VirtualListDragFeature:()=>zs,agCharts:()=>la,checkboxStyleDefault:()=>on,colorSchemeDark:()=>Uu,colorSchemeDarkBlue:()=>Ku,colorSchemeDarkWarm:()=>Wu,colorSchemeLight:()=>Ui,colorSchemeLightCold:()=>nn,colorSchemeLightWarm:()=>Hu,createPart:()=>Y,createTheme:()=>rn,exportMultipleSheetsAsExcel:()=>$a,getMultipleSheetsAsExcel:()=>Ai,getParamType:()=>en,iconSetAlpine:()=>Wi,iconSetMaterial:()=>ju,iconSetQuartz:()=>ln,iconSetQuartzBold:()=>Xu,iconSetQuartzLight:()=>Yu,iconSetQuartzRegular:()=>qu,inputStyleBase:()=>ji,inputStyleBordered:()=>ks,inputStyleUnderlined:()=>Zu,paramValueToCss:()=>sn,tabStyleAlpine:()=>dn,tabStyleBase:()=>kt,tabStyleMaterial:()=>Ju,tabStyleQuartz:()=>cn,tabStyleRolodex:()=>hn,themeAlpine:()=>ep,themeBalham:()=>tp,themeQuartz:()=>Qu});import{ClientSideRowModelModule as Tp}from"ag-grid-community";import{CommunityFeaturesModule as Pp,ModuleRegistry as Fp}from"ag-grid-community";import{CsvExportModule as Ap}from"ag-grid-community";import{InfiniteRowModelModule as kp}from"ag-grid-community";import{ModuleNames as qi,_FilterCoreModule as Rp,_defineModule as Xi}from"ag-grid-community";import{ModuleNames as Ip,_defineModule as Dp}from"ag-grid-community";import{BeanStub as Lp,_getDocument as Gp}from"ag-grid-community";import{_missingOrEmpty as Zi}from"ag-grid-community";var Bp=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(e,t){let s=e[0],i=e[1],r=e[2],a=e[3];s=this.ff(s,i,r,a,t[0],7,-680876936),a=this.ff(a,s,i,r,t[1],12,-389564586),r=this.ff(r,a,s,i,t[2],17,606105819),i=this.ff(i,r,a,s,t[3],22,-1044525330),s=this.ff(s,i,r,a,t[4],7,-176418897),a=this.ff(a,s,i,r,t[5],12,1200080426),r=this.ff(r,a,s,i,t[6],17,-1473231341),i=this.ff(i,r,a,s,t[7],22,-45705983),s=this.ff(s,i,r,a,t[8],7,1770035416),a=this.ff(a,s,i,r,t[9],12,-1958414417),r=this.ff(r,a,s,i,t[10],17,-42063),i=this.ff(i,r,a,s,t[11],22,-1990404162),s=this.ff(s,i,r,a,t[12],7,1804603682),a=this.ff(a,s,i,r,t[13],12,-40341101),r=this.ff(r,a,s,i,t[14],17,-1502002290),i=this.ff(i,r,a,s,t[15],22,1236535329),s=this.gg(s,i,r,a,t[1],5,-165796510),a=this.gg(a,s,i,r,t[6],9,-1069501632),r=this.gg(r,a,s,i,t[11],14,643717713),i=this.gg(i,r,a,s,t[0],20,-373897302),s=this.gg(s,i,r,a,t[5],5,-701558691),a=this.gg(a,s,i,r,t[10],9,38016083),r=this.gg(r,a,s,i,t[15],14,-660478335),i=this.gg(i,r,a,s,t[4],20,-405537848),s=this.gg(s,i,r,a,t[9],5,568446438),a=this.gg(a,s,i,r,t[14],9,-1019803690),r=this.gg(r,a,s,i,t[3],14,-187363961),i=this.gg(i,r,a,s,t[8],20,1163531501),s=this.gg(s,i,r,a,t[13],5,-1444681467),a=this.gg(a,s,i,r,t[2],9,-51403784),r=this.gg(r,a,s,i,t[7],14,1735328473),i=this.gg(i,r,a,s,t[12],20,-1926607734),s=this.hh(s,i,r,a,t[5],4,-378558),a=this.hh(a,s,i,r,t[8],11,-2022574463),r=this.hh(r,a,s,i,t[11],16,1839030562),i=this.hh(i,r,a,s,t[14],23,-35309556),s=this.hh(s,i,r,a,t[1],4,-1530992060),a=this.hh(a,s,i,r,t[4],11,1272893353),r=this.hh(r,a,s,i,t[7],16,-155497632),i=this.hh(i,r,a,s,t[10],23,-1094730640),s=this.hh(s,i,r,a,t[13],4,681279174),a=this.hh(a,s,i,r,t[0],11,-358537222),r=this.hh(r,a,s,i,t[3],16,-722521979),i=this.hh(i,r,a,s,t[6],23,76029189),s=this.hh(s,i,r,a,t[9],4,-640364487),a=this.hh(a,s,i,r,t[12],11,-421815835),r=this.hh(r,a,s,i,t[15],16,530742520),i=this.hh(i,r,a,s,t[2],23,-995338651),s=this.ii(s,i,r,a,t[0],6,-198630844),a=this.ii(a,s,i,r,t[7],10,1126891415),r=this.ii(r,a,s,i,t[14],15,-1416354905),i=this.ii(i,r,a,s,t[5],21,-57434055),s=this.ii(s,i,r,a,t[12],6,1700485571),a=this.ii(a,s,i,r,t[3],10,-1894986606),r=this.ii(r,a,s,i,t[10],15,-1051523),i=this.ii(i,r,a,s,t[1],21,-2054922799),s=this.ii(s,i,r,a,t[8],6,1873313359),a=this.ii(a,s,i,r,t[15],10,-30611744),r=this.ii(r,a,s,i,t[6],15,-1560198380),i=this.ii(i,r,a,s,t[13],21,1309151649),s=this.ii(s,i,r,a,t[4],6,-145523070),a=this.ii(a,s,i,r,t[11],10,-1120210379),r=this.ii(r,a,s,i,t[2],15,718787259),i=this.ii(i,r,a,s,t[9],21,-343485551),e[0]=this.add32(s,e[0]),e[1]=this.add32(i,e[1]),e[2]=this.add32(r,e[2]),e[3]=this.add32(a,e[3])}cmn(e,t,s,i,r,a){return t=this.add32(this.add32(t,e),this.add32(i,a)),this.add32(t<<r|t>>>32-r,s)}ff(e,t,s,i,r,a,o){return this.cmn(t&s|~t&i,e,t,r,a,o)}gg(e,t,s,i,r,a,o){return this.cmn(t&i|s&~i,e,t,r,a,o)}hh(e,t,s,i,r,a,o){return this.cmn(t^s^i,e,t,r,a,o)}ii(e,t,s,i,r,a,o){return this.cmn(s^(t|~i),e,t,r,a,o)}md51(e){const t=e.length,s=[1732584193,-271733879,-1732584194,271733878];let i;for(i=64;i<=e.length;i+=64)this.md5cycle(s,this.md5blk(e.substring(i-64,i)));e=e.substring(i-64);const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<e.length;i++)r[i>>2]|=e.charCodeAt(i)<<(i%4<<3);if(r[i>>2]|=128<<(i%4<<3),i>55)for(this.md5cycle(s,r),i=0;i<16;i++)r[i]=0;return r[14]=t*8,this.md5cycle(s,r),s}md5blk(e){const t=[];for(let s=0;s<64;s+=4)t[s>>2]=e.charCodeAt(s)+(e.charCodeAt(s+1)<<8)+(e.charCodeAt(s+2)<<16)+(e.charCodeAt(s+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let s="",i=0;for(;i<4;i++)s+=t[e>>i*8+4&15]+t[e>>i*8&15];return s}hex(e){for(let t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")}md5(e){return this.hex(this.md51(e))}add32(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)}add32Std(e,t){return e+t&4294967295}add32Compat(e,t){const s=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(s>>16)<<16|s&65535}},Rs={"01":"GRID","02":"CHARTS","0102":"BOTH"},Mn="https://ag-grid.com/licensing/",En=class oe{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new Bp,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(oe.licenseKey),s=`AG Grid ${t.currentLicenseType==="BOTH"?"and AG Charts ":""}Enterprise`,i=t.suppliedLicenseType===void 0?"":`AG ${t.suppliedLicenseType==="BOTH"?"Grid and AG Charts":t.suppliedLicenseType==="GRID"?"Grid":"Charts"} Enterprise`;if(t.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(s);else if(t.expired){const r=oe.getGridReleaseDate(),a=oe.formatDate(r);this.outputExpiredKey(t.expiry,a,s,i)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,s,i):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,s,i)}static extractExpiry(t){const s=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(oe.decode(s),10))}static extractLicenseComponents(t){let s=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(s=s.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const i=s.length-32,r=s.substring(i),a=s.substring(0,i),[o,n,l]=oe.extractBracketedInformation(s);return{md5:r,license:a,version:o,isTrial:n,type:l}}getLicenseDetails(t){const s=oe.chartsLicenseManager?"BOTH":"GRID";if(Zi(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:s};const i=oe.getGridReleaseDate(),{md5:r,license:a,version:o,isTrial:n,type:l}=oe.extractLicenseComponents(t);let c=r===this.md5.md5(a)&&t.indexOf("For_Trialing_ag-Grid_Only")===-1,d,h,u=null,p=!1,g;function m(){d=u<new Date,h=void 0}if(c&&(u=oe.extractExpiry(a),c=!isNaN(u.getTime()),c))switch(h=i>u,o){case"legacy":case"2":{n&&m();break}case"3":Zi(l)?c=!1:(g=l,l!==Rs["01"]&&l!==Rs["0102"]||s==="BOTH"&&g!=="BOTH"?(c=!1,p=!0):n&&m())}return c?{licenseKey:t,valid:c,expiry:oe.formatDate(u),expired:h,version:o,isTrial:n,trialExpired:d,incorrectLicenseType:p,currentLicenseType:s,suppliedLicenseType:g}:{licenseKey:t,valid:c,incorrectLicenseType:p,currentLicenseType:s,suppliedLicenseType:g}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!Zi(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){const s=(this.document.defaultView||window).location,{hostname:i=""}=s;return i}isForceWatermark(){const s=(this.document.defaultView||window).location,{pathname:i}=s;return i?i.indexOf("forceWatermark")!==-1:!1}isWebsiteUrl(){return this.getHostname().match(/^((?:[\w-]+\.)?ag-grid\.com)$/)!==null}isLocalhost(){return this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)!==null}static formatDate(t){const s=["January","February","March","April","May","June","July","August","September","October","November","December"],i=t.getDate(),r=t.getMonth(),a=t.getFullYear();return i+" "+s[r]+" "+a}static getGridReleaseDate(){return new Date(parseInt(oe.decode(oe.RELEASE_INFORMATION),10))}static decode(t){const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i="",r,a,o,n,l,c,d,h=0;const u=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;h<u.length;)n=s.indexOf(u.charAt(h++)),l=s.indexOf(u.charAt(h++)),c=s.indexOf(u.charAt(h++)),d=s.indexOf(u.charAt(h++)),r=n<<2|l>>4,a=(l&15)<<4|c>>2,o=(c&3)<<6|d,i=i+String.fromCharCode(r),c!=64&&(i=i+String.fromCharCode(a)),d!=64&&(i=i+String.fromCharCode(o));return i=oe.utf8_decode(i),i}static utf8_decode(t){t=t.replace(/rn/g,"n");let s="";for(let i=0;i<t.length;i++){const r=t.charCodeAt(i);r<128?s+=String.fromCharCode(r):r>127&&r<2048?(s+=String.fromCharCode(r>>6|192),s+=String.fromCharCode(r&63|128)):(s+=String.fromCharCode(r>>12|224),s+=String.fromCharCode(r>>6&63|128),s+=String.fromCharCode(r&63|128))}return s}static setChartsLicenseManager(t){this.chartsLicenseManager=t}static setLicenseKey(t){this.licenseKey=t,this.chartsLicenseManager&&this.chartsLicenseManager.setLicenseKey(t,!0)}static extractBracketedInformation(t){if(!t.includes("["))return["legacy",!1,void 0];const s=t.match(/\[(.*?)\]/g).map(n=>n.replace("[","").replace("]",""));if(!s||s.length===0)return["legacy",!1,void 0];const i=s.filter(n=>n==="TRIAL").length===1,r=s.filter(n=>n.indexOf("v")===0)[0],a=r?r.replace("v",""):"legacy",o=Rs[s.filter(n=>Rs[n])[0]];return[a,i,o]}centerPadAndOutput(t){const s=this.totalMessageLength-t.length;console.error(t.padStart(s/2+t.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(t,s="*",i=""){console.error(t.padEnd(this.totalMessageLength-i.length,s)+i)}outputInvalidLicenseKey(t,s,i){t?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${i} only and does not cover you for ${s}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${Mn}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${Mn}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,s,i){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${i} expired on ${t}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(t){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${t} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(t,s,i,r){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${r} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${s}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="License Expired"}};En.RELEASE_INFORMATION="MTcyNzI1NTEwMTc0NQ==";var Is=En;import{Component as Op,RefPlaceholder as Np}from"ag-grid-community";var Vp=class extends Op{constructor(){super(`<div class="ag-watermark">
<div data-ref="eLicenseTextRef" class="ag-watermark-text"></div>
</div>`),this.eLicenseTextRef=Np}wireBeans(e){this.licenseManager=e.licenseManager}postConstruct(){const e=this.shouldDisplayWatermark();this.setDisplayed(e),e&&(this.eLicenseTextRef.innerText=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCssClass("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5e3))}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}},zp={selector:"AG-WATERMARK",component:Vp},Ji=class extends Lp{constructor(){super(...arguments),this.beanName="licenseManager"}postConstruct(){this.validateLicense()}validateLicense(){this.licenseManager=new Is(Gp(this.gos)),this.licenseManager.validateLicense()}static getLicenseDetails(e){return new Is(null).getLicenseDetails(e)}getWatermarkSelector(){return zp}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(e){Is.setLicenseKey(e)}static setChartsLicenseManager(e){Is.setChartsLicenseManager(e)}},_p="32.2.1";import{Component as Hp,_createIconNoSpan as Tn,_isNodeOrElement as Up,_loadTemplate as Ds,_setAriaExpanded as Wp,_warnOnce as Kp}from"ag-grid-community";var Ge=class extends Hp{constructor(){super(),this.setTemplate("<div></div>")}init(e){this.params=e,this.cssClassPrefix=this.params.cssClassPrefix??"ag-menu-option",this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addIcon(){if(this.params.isCompact)return;const e=Ds(`<span data-ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`),{checked:t,icon:s}=this.params;t?e.appendChild(Tn("check",this.gos)):s&&(Up(s)?e.appendChild(s):typeof s=="string"?e.innerHTML=s:Kp("menu item icon must be DOM node or string")),this.getGui().appendChild(e)}addName(){const e=Ds(`<span data-ref="eName" class="${this.getClassName("part")} ${this.getClassName("text")}">${this.params.name||""}</span>`);this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;const e=Ds(`<span data-ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(e)}addSubMenu(){const e=Ds(`<span data-ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`),t=this.getGui();if(this.params.subMenu){const s=this.gos.get("enableRtl")?"smallLeft":"smallRight";Wp(t,!1),e.appendChild(Tn(s,this.gos))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}destroy(){super.destroy()}},H=Dp({version:_p,moduleName:Ip.EnterpriseCoreModule,beans:[Ji],userComponents:[{name:"agMenuItem",classImp:Ge}]});import{AgCheckboxSelector as jp,AgToggleButton as $p,Component as Ls,KeyCode as It,RefPlaceholder as ct,_createIcon as Pn,_setAriaExpanded as Yp,_setDisplayed as Je}from"ag-grid-community";function qp(e){const t=e.cssIdentifier||"default",s=e.direction||"vertical";return`
<div class="ag-group ag-${t}-group" role="presentation">
<div data-ref="eToolbar" class="ag-group-toolbar ag-${t}-group-toolbar">
<ag-checkbox data-ref="cbGroupEnabled"></ag-checkbox>
</div>
<div data-ref="eContainer" class="ag-group-container ag-group-container-${s} ag-${t}-group-container"></div>
</div>
`}var ge=class extends Ls{constructor(e={}){super(qp(e),[jp]),this.params=e,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1,this.eToolbar=ct,this.cbGroupEnabled=ct,this.eContainer=ct;const{enabled:t,items:s,suppressEnabledCheckbox:i,expanded:r,suppressToggleExpandOnEnableChange:a,useToggle:o}=e;this.cssIdentifier=e.cssIdentifier||"default",this.enabled=t??!0,this.items=s||[],this.useToggle=o??!1,this.alignItems=e.alignItems||"center",this.expanded=r??!0,i!=null&&(this.suppressEnabledCheckbox=i),a!=null&&(this.suppressToggleExpandOnEnableChange=a)}postConstruct(){if(this.setupTitleBar(),this.items.length){const r=this.items;this.items=[],this.addItems(r)}const e=this.localeService.getLocaleTextFunc();this.cbGroupEnabled.setLabel(e("enabled","Enabled")),this.enabled&&this.setEnabled(this.enabled,void 0,!0),this.setAlignItems(this.alignItems);const{onEnableChange:t,onExpandedChange:s,suppressOpenCloseIcons:i}=this.params;this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(i??!1),this.refreshChildDisplay(),Je(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(r=>{this.setEnabled(r,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(r)}),t!=null&&this.onEnableChange(t),s!=null&&this.onExpandedChange(s)}refreshChildDisplay(){Je(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),this.eTitleBar?.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){this.alignItems!==e&&this.removeCssClass(`ag-group-item-alignment-${this.alignItems}`),this.alignItems=e;const t=`ag-group-item-alignment-${this.alignItems}`;return this.addCssClass(t),this}toggleGroupExpand(e,t){if(this.eTitleBar?.isSuppressCollapse()&&!this.useToggle)e=!0,t=!0;else if(e=e??!this.expanded,this.expanded===e)return this;return this.expanded=e,this.refreshChildDisplay(),Je(this.eContainer,e),t||this.dispatchLocalEvent({type:e?"expanded":"collapsed"}),this}addItems(e){e.forEach(t=>this.addItem(t))}prependItem(e){this.insertItem(e,!0)}addItem(e){this.insertItem(e,!1)}insertItem(e,t){const s=this.eContainer,i=e instanceof Ls?e.getGui():e;i.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),t?(s.insertAdjacentElement("afterbegin",i),this.items.unshift(i)):(s.appendChild(i),this.items.push(i))}hideItem(e,t){const s=this.items[t];Je(s,!e)}getItemIndex(e){const t=e instanceof Ls?e.getGui():e;return this.items.indexOf(t)}setTitle(e){return this.eTitleBar?.setTitle(e),this}addTitleBarWidget(e){return this.eTitleBar?.addWidget(e),this}addCssClassToTitleBar(e){this.eTitleBar?.addCssClass(e)}dispatchEnableChangeEvent(e){const t={type:"enableChange",enabled:e};this.dispatchLocalEvent(t)}setEnabled(e,t,s){return this.enabled=e,this.refreshDisabledStyles(),s||this.toggleGroupExpand(e),t||(this.cbGroupEnabled.setValue(e),this.eToggle?.setValue(e)),this}isEnabled(){return this.enabled}onEnableChange(e){return this.addManagedListeners(this,{enableChange:t=>e(t.enabled)}),this}onExpandedChange(e){return this.addManagedListeners(this,{expanded:()=>e(!0),collapsed:()=>e(!1)}),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){return this.eTitleBar?.hideOpenCloseIcons(e),this}refreshDisabledStyles(){const e=!this.enabled;this.eContainer.classList.toggle("ag-disabled",e),this.eTitleBar?.refreshDisabledStyles(this.suppressEnabledCheckbox&&e),this.eContainer.classList.toggle("ag-disabled-group-container",e)}setupTitleBar(){const e=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",e.getGui())}createDefaultTitleBar(){const e=this.createManagedBean(new Zp(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListeners(e,{expandedChanged:t=>this.toggleGroupExpand(t.expanded)}),e}createToggleTitleBar(){const e=this.createManagedBean(new $p({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:t=>{this.setEnabled(t,!0),this.dispatchEnableChangeEvent(t)}}));return e.addCssClass("ag-group-title-bar"),e.addCssClass(`ag-${this.params.cssIdentifier??"default"}-group-title-bar ag-unselectable`),this.eToggle=e,this.toggleGroupExpand(this.enabled),e}},Qi="ag-disabled-group-title-bar";function Xp(e){const t=e.cssIdentifier??"default",s=e.suppressKeyboardNavigation?"presentation":"role";return`
<div class="ag-group-title-bar ag-${t}-group-title-bar ag-unselectable" role="${s}">
<span class="ag-group-title-bar-icon ag-${t}-group-title-bar-icon" data-ref="eGroupOpenedIcon" role="presentation"></span>
<span class="ag-group-title-bar-icon ag-${t}-group-title-bar-icon" data-ref="eGroupClosedIcon" role="presentation"></span>
<span data-ref="eTitle" class="ag-group-title ag-${t}-group-title"></span>
</div>
`}var Zp=class extends Ls{constructor(e={}){super(Xp(e)),this.suppressOpenCloseIcons=!1,this.suppressKeyboardNavigation=!1,this.eGroupOpenedIcon=ct,this.eGroupClosedIcon=ct,this.eTitle=ct;const{title:t,suppressOpenCloseIcons:s,suppressKeyboardNavigation:i}=e;t&&t.length>0&&(this.title=t),s!=null&&(this.suppressOpenCloseIcons=s),this.suppressKeyboardNavigation=i??!1}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){this.eGroupClosedIcon.appendChild(Pn("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(Pn("columnSelectOpen",this.gos,null)),this.addManagedElementListeners(this.getGui(),{click:()=>this.dispatchExpandChanged(),keydown:e=>{switch(e.key){case It.ENTER:case It.SPACE:e.preventDefault(),this.dispatchExpandChanged();break;case It.RIGHT:case It.LEFT:e.preventDefault(),this.dispatchExpandChanged(e.key===It.RIGHT);break}}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||Yp(this.getGui(),e)}refreshOpenCloseIcons(e){const t=!this.suppressOpenCloseIcons;Je(this.eGroupOpenedIcon,t&&e),Je(this.eGroupClosedIcon,t&&!e)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(e){const t={type:"expandedChanged",expanded:e};this.dispatchLocalEvent(t)}setTitle(e){const t=this.getGui(),s=!!e&&e.length>0;e=s?e:void 0,this.eTitle.textContent=e??"",Je(t,s),e!==this.title&&(this.title=e);const i=t.classList.contains(Qi);return this.refreshDisabledStyles(i),this}addWidget(e){return this.getGui().appendChild(e),this}hideOpenCloseIcons(e){return this.suppressOpenCloseIcons=e,e&&this.dispatchExpandChanged(!0),this}refreshDisabledStyles(e){const t=this.getGui();e?(t.classList.add(Qi),t.removeAttribute("tabindex")):(t.classList.remove(Qi),typeof this.title=="string"&&!this.suppressKeyboardNavigation?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex"))}},G={selector:"AG-GROUP-COMPONENT",component:ge};import{AgInputTextFieldSelector as Jp,AgPickerField as Qp,KeyCode as q,RefPlaceholder as Fn,_bindCellRendererToHtmlElement as eg,_clearElement as er,_createIconNoSpan as tg,_debounce as sg,_escapeString as ig,_exists as An,_fuzzySuggestions as rg,_getActiveDomElement as ag,_isEventFromPrintableCharacter as og,_isVisible as ng,_setAriaActiveDescendant as lg,_stopPropagationForAgGrid as cg}from"ag-grid-community";import{Component as dg,KeyCode as dt,_clearElement as hg,_getActiveDomElement as kn,_getDocument as ug,_setAriaPosInSet as pg,_setAriaSetSize as gg}from"ag-grid-community";import{RefPlaceholder as Rn}from"ag-grid-community";import{Component as mg}from"ag-grid-community";var fg=class extends mg{constructor(e){super(`
<div class="ag-pill" role="option">
<span class="ag-pill-text" data-ref="eText"></span>
<span class="ag-button ag-pill-button" data-ref="eButton" role="presentation"></span>
</div>
`),this.config=e,this.eText=Rn,this.eButton=Rn}postConstruct(){const{config:e,eButton:t}=this,{onKeyDown:s,onButtonClick:i}=e;this.getGui().setAttribute("tabindex",String(this.gos.get("tabIndex"))),this.addGuiEventListener("focus",()=>{this.eButton.focus()}),s&&this.addGuiEventListener("keydown",s),i&&this.addManagedElementListeners(t,{click:i})}toggleCloseButtonClass(e,t){this.eButton.classList.toggle(e,t)}setText(e){this.eText.textContent=e}getText(){return this.eText.textContent}},vg=class extends dg{constructor(){super(`
<div class="ag-pill-container" role="listbox"></div>
`),this.pills=[]}wireBeans(e){this.focusService=e.focusService}init(e){this.params=e,this.refresh()}refresh(){this.clearPills();const{params:e,onPillKeyDown:t}=this,s=e.getValue();if(!Array.isArray(s))return;const i=s.length;for(let r=0;r<i;r++){const a=s[r],o=this.createBean(new fg({onButtonClick:()=>this.onPillButtonClick(o),onKeyDown:t.bind(this)})),n=o.getGui();pg(n,r+1),gg(n,i),e.onPillMouseDown&&o.addGuiEventListener("mousedown",e.onPillMouseDown),e.announceItemFocus&&o.addGuiEventListener("focus",e.announceItemFocus),o.setText(a),o.toggleCloseButtonClass("ag-icon-cancel",!0),this.appendChild(n),this.pills.push(o)}}onNavigationKeyDown(e){const{key:t}=e;if(!this.pills.length||t!==dt.LEFT&&t!==dt.RIGHT)return;e.preventDefault();const s=kn(this.gos),i=this.getGui(),{params:r,focusService:a}=this;if(i.contains(s)){const o=a.findNextFocusableElement(i,!1,t===dt.LEFT);o?o.focus():r.eWrapper&&r.eWrapper.focus()}else{const o=a.findFocusableElements(i);o.length>0&&o[t===dt.RIGHT?0:o.length-1].focus()}}clearPills(){const e=this.getGui();e.contains(kn(this.gos))&&this.params.eWrapper&&this.params.eWrapper.focus(),hg(e),this.destroyBeans(this.pills),this.pills=[]}onPillButtonClick(e){this.deletePill(e)}onPillKeyDown(e){const t=e.key;if(t!==dt.DELETE&&t!==dt.BACKSPACE)return;e.preventDefault();const s=ug(this.gos),i=this.pills.findIndex(a=>a.getGui().contains(s.activeElement));if(i===-1)return;const r=this.pills[i];r&&this.deletePill(r,i)}deletePill(e,t){const s=e.getText(),i=(this.params.getValue()||[]).filter(r=>r!==s);if(this.params.setValue(i),!i.length&&this.params.eWrapper)this.params.eWrapper.focus();else if(t!=null){const r=this.pills[Math.min(t,this.pills.length-1)];r&&r.getFocusableElement().focus()}}destroy(){this.clearPills(),super.destroy()}};import{KeyCode as Cg,_getDocument as wg,_setAriaActiveDescendant as Sg,_setAriaControls as yg,_setAriaLabel as bg}from"ag-grid-community";import{Component as xg,_bindCellRendererToHtmlElement as Mg,_escapeString as Gs,_exists as Dt,_getDocument as Eg,_setAriaSelected as Tg}from"ag-grid-community";var Pg=class extends xg{constructor(e){super('<div class="ag-rich-select-row" role="presentation"></div>'),this.params=e}wireBeans(e){this.userComponentFactory=e.userComponentFactory}setState(e){let t="";const{params:s}=this;s.valueFormatter&&(t=s.valueFormatter(e)),this.populateWithRenderer(e,t)||this.populateWithoutRenderer(e,t),this.value=e}highlightString(e){const{parsedValue:t}=this;if(this.params.cellRenderer||!Dt(t))return;let s=Dt(e);if(s){const i=t?.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(i>=0){const r=i+e.length,a=Gs(t.slice(0,i),!0),o=Gs(t.slice(i,r),!0),n=Gs(t.slice(r));this.renderValueWithoutRenderer(`${a}<span class="ag-rich-select-row-text-highlight">${o}</span>${n}`)}else s=!1}s||this.renderValueWithoutRenderer(t)}updateSelected(e){const t=this.getGui();Tg(t.parentElement,e),this.addOrRemoveCssClass("ag-rich-select-row-selected",e)}getValue(){return this.value}toggleHighlighted(e){this.addOrRemoveCssClass("ag-rich-select-row-highlighted",e)}populateWithoutRenderer(e,t){const s=Eg(this.gos),i=this.getGui(),r=s.createElement("span");r.style.overflow="hidden",r.style.textOverflow="ellipsis";const a=Gs(Dt(t)?t:e,!0);this.parsedValue=Dt(a)?a:null,i.appendChild(r),this.renderValueWithoutRenderer(a),this.setTooltip({newTooltipText:this.parsedValue,shouldDisplayTooltip:()=>r.scrollWidth>r.clientWidth})}renderValueWithoutRenderer(e){const t=this.getGui().querySelector("span");t&&(t.innerHTML=Dt(e)?e:" ")}populateWithRenderer(e,t){let s,i;if(this.params.cellRenderer){const r=this.getParentComponent()?.getParentComponent();i=this.userComponentFactory.getEditorRendererDetails(this.params,{value:e,valueFormatted:t,getValue:()=>r?.getValue(),setValue:a=>{r?.setValue(a,!0)},setTooltip:(a,o)=>{this.setTooltip({newTooltipText:a,shouldDisplayTooltip:o})}})}return i&&(s=i.newAgStackInstance()),s&&Mg(s,this.getGui()),s?(s.then(r=>{this.addDestroyFunc(()=>{this.destroyBean(r)})}),!0):!1}};import{KeyCode as me,RefPlaceholder as Fg,TabGuardComp as Ag,_getAriaPosInSet as kg,_setAriaLabel as Rg,_setAriaPosInSet as Ig,_setAriaRole as In,_setAriaSetSize as Dg,_stopPropagationForAgGrid as Lg,_waitUntil as Gg,_warnOnce as Bg}from"ag-grid-community";function Og(e){return`<div class="ag-virtual-list-viewport ag-${e}-virtual-list-viewport" role="presentation">
<div class="ag-virtual-list-container ag-${e}-virtual-list-container" data-ref="eContainer"></div>
</div>`}var Be=class extends Ag{constructor(e){super(Og(e?.cssIdentifier||"default")),this.renderedRows=new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0,this.eContainer=Fg,this.awaitStableCallbacks=[];const{cssIdentifier:t="default",ariaRole:s="listbox",listName:i}=e||{};this.cssIdentifier=t,this.ariaRole=s,this.listName=i}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.animationFrameService=e.animationFrameService,this.environment=e.environment}postConstruct(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e),focusInnerElement:e=>this.focusInnerElement(e),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)}),this.setAriaProperties(),this.addManagedEventListeners({gridStylesChanged:this.onGridStylesChanged.bind(this)})}onGridStylesChanged(e){e.listItemHeightChanged&&(this.rowHeight=this.getItemHeight(),this.refresh())}setAriaProperties(){const t=this.localeService.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),s=this.eContainer;In(s,this.ariaRole),Rg(s,t)}addResizeObserver(){const e=()=>this.animationFrameService.requestAnimationFrame(()=>this.drawVirtualRows()),t=this.resizeObserverService.observeResize(this.getGui(),e);this.addDestroyFunc(t)}focusInnerElement(e){this.focusRow(e?this.model.getRowCount()-1:0)}onFocusIn(e){const t=e.target;t.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=kg(t)-1)}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){switch(e.key){case me.UP:case me.DOWN:this.navigate(e.key===me.UP)&&e.preventDefault();break;case me.PAGE_HOME:case me.PAGE_END:case me.PAGE_UP:case me.PAGE_DOWN:this.navigateToPage(e.key)!==null&&e.preventDefault();break}}onTabKeyDown(e){Lg(e),this.forceFocusOutOfContainer(e.shiftKey)}navigate(e){if(this.lastFocusedRowIndex==null)return!1;const t=this.lastFocusedRowIndex+(e?-1:1);return t<0||t>=this.model.getRowCount()?!1:(this.focusRow(t),!0)}navigateToPage(e,t="focused"){let s=!1;t==="focused"&&(t=this.getLastFocusedRow(),s=!0);const i=this.model.getRowCount()-1;let r=-1;return e===me.PAGE_HOME?r=0:e===me.PAGE_END?r=i:e===me.PAGE_DOWN?r=Math.min(t+this.pageSize,i):e===me.PAGE_UP&&(r=Math.max(t-this.pageSize,0)),r===-1?null:(s?this.focusRow(r):this.ensureIndexVisible(r),r)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.isScrolling||(this.isScrolling=!0,this.ensureIndexVisible(e),this.animationFrameService.requestAnimationFrame(()=>{if(this.isScrolling=!1,!this.isAlive())return;const t=this.renderedRows.get(e);t&&t.eDiv.focus()}))}getComponentAt(e){const t=this.renderedRows.get(e);return t&&t.rowComponent}forEachRenderedRow(e){this.renderedRows.forEach((t,s)=>e(t.rowComponent,s))}getItemHeight(){return this.isHeightFromTheme?this.environment.getDefaultListItemHeight():this.rowHeight}ensureIndexVisible(e,t=!0){const s=this.model.getRowCount();if(typeof e!="number"||e<0||e>=s)return Bg("invalid row index for ensureIndexVisible: ",e),!1;const i=e*this.rowHeight,r=i+this.rowHeight,a=this.getGui(),o=a.scrollTop,n=a.offsetHeight,l=o+n,c=t?0:this.rowHeight,d=o>i+c,h=l<r-c;if(d)return a.scrollTop=i,!0;if(h){const u=r-n;return a.scrollTop=u,!0}return!1}setComponentCreator(e){this.componentCreator=e}setComponentUpdater(e){this.componentUpdater=e}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(e){this.isHeightFromTheme=!1,this.rowHeight=e,this.refresh()}refresh(e){if(this.model==null||!this.isAlive())return;const t=this.model.getRowCount();this.eContainer.style.height=`${t*this.rowHeight}px`,this.awaitStable(()=>{this.isAlive()&&(this.canSoftRefresh(e)?this.drawVirtualRows(!0):(this.clearVirtualRows(),this.drawVirtualRows()))})}awaitStable(e){if(this.awaitStableCallbacks.push(e),this.awaitStableCallbacks.length>1)return;const t=this.model.getRowCount();Gg(()=>this.eContainer.clientHeight>=t*this.rowHeight,()=>{const s=this.awaitStableCallbacks;this.awaitStableCallbacks=[],s.forEach(i=>i())})}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&typeof this.model.areRowsEqual=="function"&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;const t=this.getGui(),s=t.scrollTop,i=s+t.offsetHeight,r=Math.floor(s/this.rowHeight),a=Math.floor(i/this.rowHeight);this.pageSize=Math.floor((i-s)/this.rowHeight),this.ensureRowsRendered(r,a,e)}ensureRowsRendered(e,t,s){this.renderedRows.forEach((i,r)=>{(r<e||r>t)&&r!==this.lastFocusedRowIndex&&this.removeRow(r)}),s&&this.refreshRows();for(let i=e;i<=t;i++)this.renderedRows.has(i)||i<this.model.getRowCount()&&this.insertRow(i)}insertRow(e){const t=this.model.getRow(e),s=document.createElement("div");s.classList.add("ag-virtual-list-item",`ag-${this.cssIdentifier}-virtual-list-item`),In(s,this.ariaRole==="tree"?"treeitem":"option"),Dg(s,this.model.getRowCount()),Ig(s,e+1),s.setAttribute("tabindex","-1"),s.style.height=`${this.rowHeight}px`,s.style.top=`${this.rowHeight*e}px`;const i=this.componentCreator(t,s);i.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=e),s.appendChild(i.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement("afterend",s):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement("beforebegin",s):this.eContainer.appendChild(s),this.renderedRows.set(e,{rowComponent:i,eDiv:s,value:t})}removeRow(e){const t=this.renderedRows.get(e);this.eContainer.removeChild(t.eDiv),this.destroyBean(t.rowComponent),this.renderedRows.delete(e)}refreshRows(){const e=this.model.getRowCount();this.renderedRows.forEach((t,s)=>{if(s>=e)this.removeRow(s);else{const i=this.model.getRow(s);this.model.areRowsEqual?.(t.value,i)?this.componentUpdater(i,t.rowComponent):this.removeRow(s)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(e){this.model=e}getAriaElement(){return this.eContainer}destroy(){this.isAlive()&&(this.clearVirtualRows(),this.awaitStableCallbacks.length=0,super.destroy())}},Dn="ag-rich-select-list",Ln="ag-rich-select-row",Ng=class extends Be{constructor(e,t,s){super({cssIdentifier:"rich-select"}),this.params=e,this.richSelectWrapper=t,this.getSearchString=s,this.lastRowHovered=-1,this.selectedItems=new Set,this.params=e,this.setComponentCreator(this.createRowComponent.bind(this)),this.setComponentUpdater(()=>{})}postConstruct(){super.postConstruct(),this.createLoadingElement();const{cellRowHeight:e,pickerAriaLabelKey:t,pickerAriaLabelValue:s}=this.params;e&&this.setRowHeight(e);const i=this.getGui(),r=this.getAriaElement();this.addManagedListeners(i,{mousemove:this.onMouseMove.bind(this),mouseout:this.onMouseOut.bind(this),mousedown:this.onMouseDown.bind(this),click:this.onClick.bind(this)}),i.classList.add(Dn);const a=`${Dn}-${this.getCompId()}`;r.setAttribute("id",a);const n=this.localeService.getLocaleTextFunc()(t,s);bg(r,n),yg(this.richSelectWrapper,r)}navigateToPage(e){const t=super.navigateToPage(e,this.lastRowHovered);return t!=null&&this.animationFrameService.requestAnimationFrame(()=>{if(!this.isAlive())return null;this.highlightIndex(t)}),t}drawVirtualRows(e){super.drawVirtualRows(e),this.refreshSelectedItems()}highlightFilterMatch(e){this.forEachRenderedRow(t=>{t.highlightString(e)})}onNavigationKeyDown(e,t){this.animationFrameService.requestAnimationFrame(()=>{if(!this.currentList||!this.isAlive())return;const s=this.currentList.length,i=this.lastRowHovered,r=e===Cg.DOWN?1:-1,a=Math.min(Math.max(i===-1?0:i+r,0),s-1);this.highlightIndex(a),t()})}selectValue(e){if(!this.currentList)return this.eLoading&&this.appendChild(this.eLoading),!1;if(this.eLoading?.offsetParent&&this.eLoading.parentElement?.removeChild(this.eLoading),e==null)return!1;const t=this.getIndicesForValues(e),s=t.length>0;return s&&(this.refresh(),this.ensureIndexVisible(t[0]),this.refresh(!0)),this.selectListItems(Array.isArray(e)?e:[e]),s}selectListItems(e,t=!1){t||this.selectedItems.clear();for(let s=0;s<e.length;s++){const i=e[s];this.selectedItems.has(i)||this.selectedItems.add(i)}this.refreshSelectedItems()}getCurrentList(){return this.currentList}setCurrentList(e){this.currentList=e,this.setModel({getRowCount:()=>e.length,getRow:t=>e[t],areRowsEqual:(t,s)=>t===s})}getSelectedItems(){return this.selectedItems}getLastItemHovered(){return this.currentList[this.lastRowHovered]}highlightIndex(e,t){this.currentList&&(e<0||e>=this.currentList.length?this.lastRowHovered=-1:(this.lastRowHovered=e,this.ensureIndexVisible(e,!t)&&!t&&this.refresh(!0)),this.forEachRenderedRow((s,i)=>{const r=e===i;if(s.toggleHighlighted(r),r){const a=`${Ln}-${s.getCompId()}`;Sg(this.richSelectWrapper,a),this.richSelectWrapper.setAttribute("data-active-option",a)}}))}getIndicesForValues(e){const{currentList:t}=this;if(!t||t.length===0||e==null)return[];if(Array.isArray(e)||(e=[e]),e.length===0)return[];const s=[];for(let i=0;i<e.length;i++){const r=t.indexOf(e[i]);r>=0&&s.push(r)}return s}toggleListItemSelection(e){this.selectedItems.has(e)?this.selectedItems.delete(e):this.selectedItems.add(e),this.refreshSelectedItems(),this.dispatchValueSelected()}refreshSelectedItems(){this.forEachRenderedRow(e=>{const t=this.selectedItems.has(e.getValue());e.updateSelected(t)})}createLoadingElement(){const e=wg(this.gos),t=this.localeService.getLocaleTextFunc(),s=e.createElement("div");s.classList.add("ag-loading-text"),s.innerText=t("loadingOoo","Loading..."),this.eLoading=s}createRowComponent(e,t){const s=new Pg(this.params);t.setAttribute("id",`${Ln}-${s.getCompId()}`),s.setParentComponent(this),this.createBean(s),s.setState(e);const{highlightMatch:i,searchType:r="fuzzy"}=this.params;return i&&r!=="fuzzy"&&s.highlightString(this.getSearchString()),s}getRowForMouseEvent(e){const s=this.getGui().getBoundingClientRect(),i=this.getScrollTop(),r=e.clientY-s.top+i;return Math.floor(r/this.getRowHeight())}onMouseMove(e){const t=this.getRowForMouseEvent(e);t!==-1&&t!=this.lastRowHovered&&(this.lastRowHovered=t,this.highlightIndex(t,!0))}onMouseDown(e){e.preventDefault()}onMouseOut(e){this.getGui().contains(e.relatedTarget)||this.highlightIndex(-1)}onClick(e){const{multiSelect:t}=this.params;if(!this.currentList)return;const s=this.getRowForMouseEvent(e),i=this.currentList[s];t?this.toggleListItemSelection(i):(this.selectListItems([i]),this.dispatchValueSelected())}dispatchValueSelected(){this.dispatchLocalEvent({type:"richSelectListRowSelected",fromEnterKey:!1,value:this.selectedItems})}destroy(){super.destroy(),this.eLoading=void 0}},Lt=class extends Qp{constructor(e){super({pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"ag-list",className:"ag-rich-select",pickerIcon:"smallDown",ariaRole:"combobox",template:e?.template??`
<div class="ag-picker-field" role="presentation">
<div data-ref="eLabel"></div>
<div data-ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed">
<span data-ref="eDisplayField" class="ag-picker-field-display"></span>
<ag-input-text-field data-ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>
<span data-ref="eDeselect" class="ag-rich-select-deselect-button ag-picker-field-icon" role="presentation"></span>
<span data-ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></span>
</div>
</div>`,agComponents:[Jp],modalPicker:!1,...e,maxPickerHeight:e?.maxPickerHeight??"calc(var(--ag-row-height) * 6.5)"}),this.searchString="",this.searchStringCreator=null,this.eInput=Fn,this.eDeselect=Fn,this.skipWrapperAnnouncement=!1;const{value:t,valueList:s,searchStringCreator:i}=e||{};t!==void 0&&(this.value=t),s!=null&&(this.values=s),i&&(this.searchStringCreator=i)}wireBeans(e){super.wireBeans(e),this.userComponentFactory=e.userComponentFactory,this.ariaAnnouncementService=e.ariaAnnouncementService}postConstruct(){super.postConstruct(),this.createListComponent(),this.eDeselect.appendChild(tg("cancel",this.gos));const{allowTyping:e,placeholder:t,suppressDeselectAll:s}=this.config;this.eDeselect.classList.add("ag-hidden"),e?(this.eInput.setAutoComplete(!1).setInputPlaceholder(t),this.eDisplayField.classList.add("ag-hidden")):this.eInput.setDisplayed(!1),this.setupAriaProperties();const{searchDebounceDelay:i=300}=this.config;this.clearSearchString=sg(this.clearSearchString,i),this.renderSelectedValue(),e&&this.eInput.onValueChange(r=>this.searchTextFromString(r)),this.addManagedElementListeners(this.eWrapper,{focus:this.onWrapperFocus.bind(this)}),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)}),s||this.addManagedElementListeners(this.eDeselect,{mousedown:this.onDeselectAllMouseDown.bind(this),click:this.onDeselectAllClick.bind(this)})}setupAriaProperties(){const{eWrapper:e,gos:t,localeService:s}=this;e.tabIndex=t.get("tabIndex");const i=s.getLocaleTextFunc();this.ariaDeleteSelection=i("ariaLabelRichSelectDeleteSelection","Press DELETE to deselect item"),this.ariaDeselectAllItems=i("ariaLabelRichSelectDeselectAllItems","Press DELETE to deselect all items"),this.ariaToggleSelection=i("ariaLabelRichSelectToggleSelection","Press SPACE to toggle selection")}createListComponent(){this.listComponent=this.createBean(new Ng(this.config,this.eWrapper,()=>this.searchString)),this.listComponent.setParentComponent(this),this.addManagedListeners(this.listComponent,{richSelectListRowSelected:e=>{this.onListValueSelected(e.value,e.fromEnterKey)}})}renderSelectedValue(){const{value:e,eDisplayField:t,config:s}=this,{allowTyping:i,cellRenderer:r,initialInputValue:a,multiSelect:o,suppressDeselectAll:n,suppressMultiSelectPillRenderer:l}=s,c=this.config.valueFormatter?this.config.valueFormatter(e):e;if(i){this.eInput.setValue(a??c);return}if(o&&!n){const u=e==null||Array.isArray(e)&&e.length===0;this.eDeselect.classList.toggle("ag-hidden",u)}let d;if(o&&!l){this.createOrUpdatePillContainer(t);return}r&&(d=this.userComponentFactory.getEditorRendererDetails(s,{value:e,valueFormatted:c,getValue:()=>this.getValue(),setValue:u=>{this.setValue(u,!0)},setTooltip:(u,p)=>{this.setTooltip({newTooltipText:u,shouldDisplayTooltip:p})}}));let h;if(d&&(h=d.newAgStackInstance()),h)er(t),eg(h,t),h.then(u=>{this.addDestroyFunc(()=>this.destroyBean(u))});else{if(An(this.value))t.innerText=c,t.classList.remove("ag-display-as-placeholder");else{const{placeholder:u}=s;An(u)?(t.innerHTML=`${ig(u)}`,t.classList.add("ag-display-as-placeholder")):er(t)}this.setTooltip({newTooltipText:c??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth})}}createPickerComponent(){const{values:e}=this;return e&&this.setValueList({valueList:e}),this.listComponent}setSearchStringCreator(e){this.searchStringCreator=e}setValueList(e){const{valueList:t,refresh:s}=e;!this.listComponent||this.listComponent.getCurrentList()===t||(this.listComponent.setCurrentList(t),s&&(this.values?this.listComponent.refresh(!0):(this.values=t,this.isPickerDisplayed&&(this.listComponent.selectValue(this.value)||this.listComponent.refresh())),this.alignPickerToComponent()))}showPicker(){super.showPicker();const{listComponent:e,value:t}=this;if(!e)return;let s=null;this.value!=null&&(e.selectValue(this.value),s=e.getIndicesForValues(Array.isArray(t)?t:[t])[0]),s!=null?e.highlightIndex(s):e.refresh(),this.displayOrHidePicker()}beforeHidePicker(){super.beforeHidePicker()}createOrUpdatePillContainer(e){if(!this.pillContainer){const t=this.pillContainer=this.createBean(new vg);this.addDestroyFunc(()=>{this.destroyBean(this.pillContainer),this.pillContainer=null}),er(e),e.appendChild(t.getGui()),t.init({eWrapper:this.eWrapper,onPillMouseDown:s=>{s.stopImmediatePropagation()},announceItemFocus:()=>{this.announceAriaValue(this.ariaDeleteSelection)},getValue:()=>this.getValue(),setValue:s=>this.setValue(s,!0)})}this.doWhileBlockingAnnouncement(()=>this.pillContainer?.refresh())}doWhileBlockingAnnouncement(e){this.skipWrapperAnnouncement=!0,e(),this.skipWrapperAnnouncement=!1}onWrapperFocus(){const{eInput:e,config:t}=this,{allowTyping:s,multiSelect:i,suppressDeselectAll:r}=t;if(s){const a=e.getFocusableElement();a.focus(),a.select()}else i&&!r&&!this.skipWrapperAnnouncement&&this.announceAriaValue(this.ariaDeselectAllItems)}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}onDeselectAllMouseDown(e){e.stopImmediatePropagation()}onDeselectAllClick(){this.setValue([],!0)}buildSearchStringFromKeyboardEvent(e){let{key:t}=e;if(t===q.BACKSPACE)this.searchString=this.searchString.slice(0,-1),t="";else if(!og(e))return;e.preventDefault(),this.searchTextFromCharacter(t)}searchTextFromCharacter(e){this.searchString+=e,this.runSearch(),this.clearSearchString()}searchTextFromString(e){e==null&&(e=""),this.searchString=e,this.runSearch()}buildSearchStrings(e){const{valueFormatter:t=i=>i}=this.config;let s;return typeof e[0]=="number"||typeof e[0]=="string"?s=e.map(i=>t(i)):typeof e[0]=="object"&&this.searchStringCreator&&(s=this.searchStringCreator(e)),s}filterListModel(e){const{filterList:t}=this.config;t&&this.setValueList({valueList:e,refresh:!0})}runSearch(){if(!this.listComponent)return;const{values:e}=this,t=this.buildSearchStrings(e);if(!t){this.listComponent.highlightIndex(-1);return}const{suggestions:s,filteredValues:i}=this.getSuggestionsAndFilteredValues(this.searchString,t),{filterList:r,highlightMatch:a,searchType:o="fuzzy"}=this.config,n=i.length,l=!!(r&&this.searchString!=="");if(this.filterListModel(l?i:e),s.length){const c=l?0:t.indexOf(s[0]);this.listComponent?.highlightIndex(c)}else if(this.listComponent?.highlightIndex(-1),!l||n)this.listComponent?.ensureIndexVisible(0);else if(l){this.getAriaElement().removeAttribute("data-active-option");const c=this.listComponent?.getAriaElement();c&&lg(c,null)}a&&o!=="fuzzy"&&this.listComponent?.highlightFilterMatch(this.searchString),this.displayOrHidePicker()}getSuggestionsAndFilteredValues(e,t){let s=[];const i=[];if(!e.length)return{suggestions:s,filteredValues:i};const{searchType:r="fuzzy",filterList:a}=this.config;if(r==="fuzzy"){const o=rg(e,t,!0);s=o.values;const n=o.indices;if(a&&n.length)for(let l=0;l<n.length;l++)i.push(this.values[n[l]])}else s=t.filter((o,n)=>{const l=o.toLocaleLowerCase(),c=this.searchString.toLocaleLowerCase(),d=r==="match"?l.startsWith(c):l.indexOf(c)!==-1;return a&&d&&i.push(this.values[n]),d});return{suggestions:s,filteredValues:i}}displayOrHidePicker(){if(!this.listComponent)return;const e=this.listComponent.getGui(),t=this.listComponent.getCurrentList(),s=t?t.length===0:!1;e.classList.toggle("ag-hidden",s)}clearSearchString(){this.searchString=""}setValue(e,t,s,i){if(this.value===e)return this;const r=Array.isArray(e);if(e!=null){if(!r){const a=this.listComponent?.getCurrentList();if((a?a.indexOf(e):-1)===-1)return this}s||this.listComponent?.selectValue(e)}return super.setValue(e,t),i||this.renderSelectedValue(),this}onNavigationKeyDown(e,t,s){e.preventDefault();const i=t===q.DOWN;if(!this.isPickerDisplayed&&i){this.showPicker();return}this.listComponent?.onNavigationKeyDown(t,s)}onEnterKeyDown(e){if(this.isPickerDisplayed&&(e.preventDefault(),this.listComponent?.getCurrentList())){const t=this.listComponent.getLastItemHovered();this.config.multiSelect||!t?this.dispatchPickerEventAndHidePicker(this.value,!0):this.onListValueSelected(new Set([t]),!0)}}onDeleteKeyDown(e){const{eWrapper:t,gos:s}=this;ag(s)===t&&(e.preventDefault(),this.setValue([],!0))}onTabKeyDown(){const{config:e,isPickerDisplayed:t,listCo