1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[8264],{68264:(hm,Dl,X)=>{X.r(Dl),X.d(Dl,{WorkRequestsPageModule:()=>um});var be=X(91368),Tt=X(44716),ee=X(83068),Ii=X(89192),q=X(73448),Uu=X(64940),d=X(32116),wo=X(87264),So=X(77816),Ar=X(2132),Tl=X(72852),zu=X(25720),Fr=X(64420),Ku=X(45552),$u=X(36032),qu=X(63528),bl=X(94292),Pl=X(55988);function Yu(e,t){if(1&e){const i=d.KQA();d.I0R(0,"div",22)(1,"div",23)(2,"div",32)(3,"ion-icon",33),d.qCj("click",function(){const r=d.usT(i).index,n=d.GaO();return d.CGJ(n.deleteImage(r))}),d.C$Y()()(),d.I0R(4,"p"),d.OEk(5),d.C$Y()()}if(2&e){const i=t.$implicit;d.yG2(5),d.cNF(i.name)}}function ju(e,t){1&e&&d.wR5(0,"ion-icon",34)}function Qu(e,t){if(1&e){const i=d.KQA();d.I0R(0,"input",35,36),d.qCj("change",function(o){d.usT(i);const r=d.GaO();return d.CGJ(r.onFileAdd(o))}),d.C$Y()}}function Xu(e,t){1&e&&d.wR5(0,"ion-spinner")}function Zu(e,t){if(1&e){const i=d.KQA();d.I0R(0,"div",37)(1,"button",38),d.qCj("click",function(){d.usT(i);const o=d.GaO();return d.CGJ(o.dismiss())}),d.I0R(2,"span"),d.OEk(3,"Cancel"),d.C$Y()()()}}function Ju(e,t){1&e&&(d.I0R(0,"span"),d.OEk(1,"Save Template"),d.C$Y())}function ec(e,t){1&e&&d.wR5(0,"ion-spinner")}function tc(e,t){if(1&e){const i=d.KQA();d.I0R(0,"div",39)(1,"button",40),d.qCj("click",function(){d.usT(i);const o=d.GaO();return d.CGJ(o.saveTemplate())}),d.yuY(2,Ju,2,0,"span",27)(3,ec,1,0,"ion-spinner",27),d.C$Y()()}if(2&e){const i=d.GaO();d.yG2(2),d.E7m("ngIf",!i.savingTemplate),d.yG2(),d.E7m("ngIf",i.savingTemplate)}}const Al=()=>({toolbar:"",height:300});let Fl=(()=>{class e{util;userProvider;firebaseApi;modalCtrl;photoService;componentProps;editorModel;_editorModel;proposal;templateName="";defaultTemplate=!1;templates=[];editTemp=!1;selectedTemplate=0;templateFiles=[];savingTemplate=!1;uploadingFile=!1;constructor(i,s,o,r,n){this.util=i,this.userProvider=s,this.firebaseApi=o,this.modalCtrl=r,this.photoService=n}ngOnInit(){var i=this;return(0,q.c)(function*(){i.editorModel=i.componentProps.temp?.message,i._editorModel=i.cleanMesage(i.editorModel),i.templateName=i.componentProps.temp?.name,i.defaultTemplate=i.componentProps.temp?.defaultTemplate,i.templateFiles=i.componentProps.temp?.templateFiles?i.componentProps.temp?.templateFiles:[]})()}dismiss(){this.modalCtrl.dismiss()}changedTempl(i){this.editorModel=this.templates[this.selectedTemplate].message,this.templateFiles=this.templates[this.selectedTemplate].templateFiles?this.templates[this.selectedTemplate].templateFiles:[]}onFileAdd(i){var s=this;return(0,q.c)(function*(){const o=i.target.files[0];try{s.uploadingFile=!0,yield s.uploadDocAWS(o)}catch{s.util.createErrorAlert(null,"Could not upload file")}finally{s.uploadingFile=!1}})()}uploadDocAWS(i){var s=this;return(0,q.c)(function*(){try{const o=new FormData;o.append("fi",i);const n=(yield s.photoService.uploadPhotoToS3(o)).Location;s.templateFiles.push({name:i.name,url:n,createdAt:new Date})}catch{s.util.createErrorAlert(null,"Error uploading file")}})()}addFile(){}deleteImage(i){var s=this;return(0,q.c)(function*(){try{s.templateFiles.splice(i,1)}catch{s.util.createErrorAlert(null,"Could not delete doc")}})()}saveTemplate(){var i=this;return(0,q.c)(function*(){let s={};if(i.defaultTemplate&&i.userProvider.myTemplates&&i.userProvider.myTemplates.length>0&&(s=i.userProvider.myTemplates.find(o=>o.defaultTemplate)),s&&s.id&&(s.defaultTemplate=!1,yield i.firebaseApi.updateOne("templates",s.id,s)),i.editorModel&&i.templateName)try{if(i.savingTemplate=!0,i.componentProps.temp.id)yield i.firebaseApi.updateOne("templates",i.componentProps.temp.id,{message:i.editorModel,name:i.templateName,templateFiles:i.templateFiles,defaultTemplate:!!i.defaultTemplate});else{const o={vendorId:i.userProvider.loggedInUser.id,name:i.templateName,message:i.editorModel,templateFiles:i.templateFiles,defaultTemplate:!!i.defaultTemplate};yield i.firebaseApi.insertOne("templates",o)}i.userProvider.myTemplates=yield i.firebaseApi.findAll("templates",o=>o.where("vendorId","==",i.userProvider.loggedInUser.id).orderBy("createdAt","desc")),i._editorModel=i.cleanMesage(i.editorModel),yield i.dism
1iss()}catch{i.util.createErrorAlert(null,"Could not save template")}finally{i.savingTemplate=!1}else i.util.createErrorAlert(null,"Please check your template name & content.")})()}onChangeText(){this._editorModel=this.cleanMesage(this.editorModel)}cleanMesage(i){if(!i)return;const s=this.userProvider.loggedInUser,o=this.componentProps.u.userInfo;return i.replace(/\(f\)/gi,s?.firstName?s.firstName:"").replace(/\(l\)/gi,s?.lastName?s.lastName:"").replace(/\(a\)/gi,s?.address?.line1?s.address.line1:"").replace(/\(c\)/gi,s?.address?.city?s.address.city:"").replace(/\(s\)/gi,s?.address?.state&&s?.address?.zipcode?s.address.state+" "+s.address.zipcode:"").replace(/\(p\)/gi,s?.phoneNumber).replace(/\(e\)/gi,s?.email).replace(/\(c_f\)/gi,o?.firstName?o.firstName:"").replace(/\(c_l\)/gi,o?.lastName?o.lastName:"").replace(/\(c_a\)/gi,o?.address?.line1?o.address.line1:"").replace(/\(c_c\)/gi,o?.address?.city?o.address.city:"").replace(/\(c_s\)/gi,o?.address?.state&&o?.address?.zipcode?o.address.state+" "+o.address.zipcode:"").replace(/\(c_p\)/gi,o?.phoneNumber?o.phoneNumber:"").replace(/\(c_e\)/gi,o?.email?o.email:"")}static \u0275fac=function(s){return new(s||e)(d.GI1(Ar.e),d.GI1(So.e),d.GI1(wo.H),d.GI1(ee.qS),d.GI1(bl.s))};static \u0275cmp=d.In1({type:e,selectors:[["app-submit-proposal"]],inputs:{componentProps:"componentProps"},decls:114,vars:14,consts:[[2,"--background","#e9e9e9"],[2,"padding","0 2rem"],[1,"ion-text-center"],[1,"bg-white",2,"padding","1rem 0.1rem 0.1rem 0.3rem"],[1,"input-container"],[1,"custom-label"],["name","name","type","text","required","","minlength","1",3,"ngModel","ngModelChange"],["name","ngModel"],[1,"f0-9"],[1,"margin-top-1"],[1,"center","light-grey","bold-500","bord"],[1,"bord","light-grey"],[1,"margin-top-05"],[1,"f1-0","bold-600"],["apiKey","p77xsed1rznknj5kf5my5ur0jh2aqd23x9bl8sns8tui6dc5","name","editme",3,"ngModel","init","ngModelChange"],[1,"bg-white"],[1,"center","purple"],[1,"flex-rowstart","purple"],[3,"ngModel","ngModelChange"],[1,"header-and-action"],["size","12",1,"image-list"],["class","media-item",4,"ngFor","ngForOf"],[1,"media-item"],[1,"media"],[1,"add-icon"],["class","other-icons","name","add","color","primary ","id","addButton",4,"ngIf"],["type","file","accept","image/*, application/msword, text/plain, application/pdf","class","file-upload-input",3,"change",4,"ngIf"],[4,"ngIf"],["size","6"],["size","3"],["id","cancelButton",4,"ngIf"],["id","submitButton",4,"ngIf"],[1,"delete-icon"],["name","trash-outline","color","danger ","id","deleteButton",1,"other-icons",3,"click"],["name","add","color","primary ","id","addButton",1,"other-icons"],["type","file","accept","image/*, application/msword, text/plain, application/pdf",1,"file-upload-input",3,"change"],["filePicker",""],["id","cancelButton"],[1,"custom-btn","white-btn",3,"click"],["id","submitButton"],[1,"custom-btn",3,"click"]],template:function(s,o){1&s&&(d.I0R(0,"ion-content",0)(1,"ion-grid",1)(2,"ion-row")(3,"ion-col",2)(4,"h4"),d.OEk(5,"Edit Template"),d.C$Y()()(),d.I0R(6,"div",3)(7,"div",4)(8,"span",5),d.OEk(9,"Template Name"),d.C$Y(),d.I0R(10,"ion-input",6,7),d.iHE("ngModelChange",function(n){return d.kNx(o.templateName,n)||(o.templateName=n),n}),d.C$Y()()(),d.I0R(12,"div",8),d.OEk(13," You may use the following "),d.I0R(14,"strong"),d.OEk(15,"(tags)"),d.C$Y(),d.OEk(16," in your template "),d.I0R(17,"ion-row",9)(18,"ion-col",10),d.OEk(19," Your Details "),d.C$Y(),d.I0R(20,"ion-col",10),d.OEk(21," Client Details "),d.C$Y()(),d.I0R(22,"ion-row")(23,"ion-col",11)(24,"ion-row",12)(25,"ion-col")(26,"span",13),d.OEk(27,"(f)"),d.C$Y(),d.OEk(28," : First Name "),d.wR5(29,"br"),d.I0R(30,"span",13),d.OEk(31,"(l)"),d.C$Y(),d.OEk(32," : Last Name "),d.C$Y(),d.I0R(33,"ion-col")(34,"span",13),d.OEk(35,"(a)"),d.C$Y(),d.OEk(36," : Address "),d.wR5(37,"br"),d.I0R(38,"span",13),d.OEk(39,"(c)"),d.C$Y(),d.OEk(40," : City "),d.C$Y(),d.I0R(41,"ion-col")(42,"span",13),d.OEk(43,"(s)"),d.C$Y(),d.OEk(44," : State "),d.wR5(45,"br"),d.I0R(46,"span",13),d.OEk(47,"(p)"),d.C$Y(),d.OEk(48," : Phone # "),d.C$Y(),d.I0R(49,"ion-col")(50,"span",13),d.OEk(51,"(e)"),d.C$Y(),d.OEk(52," : Email "),d.C$Y()()(),d.I0R(53,"
1ion-col",11)(54,"ion-row",12)(55,"ion-col")(56,"span",13),d.OEk(57,"(c_f)"),d.C$Y(),d.OEk(58," : First Name "),d.wR5(59,"br"),d.I0R(60,"span",13),d.OEk(61,"(c_l)"),d.C$Y(),d.OEk(62," : Last Name "),d.C$Y(),d.I0R(63,"ion-col")(64,"span",13),d.OEk(65,"(c_a)"),d.C$Y(),d.OEk(66," : Address "),d.wR5(67,"br"),d.I0R(68,"span",13),d.OEk(69,"(c_c)"),d.C$Y(),d.OEk(70," : City "),d.C$Y(),d.I0R(71,"ion-col")(72,"span",13),d.OEk(73,"(c_s)"),d.C$Y(),d.OEk(74," : State "),d.wR5(75,"br"),d.I0R(76,"span",13),d.OEk(77,"(c_p)"),d.C$Y(),d.OEk(78," : Phone # "),d.C$Y(),d.I0R(79,"ion-col")(80,"span",13),d.OEk(81,"(c_e)"),d.C$Y(),d.OEk(82," : Email "),d.C$Y()()()()(),d.I0R(83,"ion-row")(84,"ion-col")(85,"editor",14),d.iHE("ngModelChange",function(n){return d.kNx(o.editorModel,n)||(o.editorModel=n),n}),d.qCj("ngModelChange",function(){return o.onChangeText()}),d.C$Y()(),d.I0R(86,"ion-col",15)(87,"div",16),d.OEk(88,"Template preview"),d.C$Y(),d.I0R(89,"editor",14),d.iHE("ngModelChange",function(n){return d.kNx(o._editorModel,n)||(o._editorModel=n),n}),d.C$Y()()(),d.I0R(90,"ion-row")(91,"ion-col",17)(92,"ion-checkbox",18),d.iHE("ngModelChange",function(n){return d.kNx(o.defaultTemplate,n)||(o.defaultTemplate=n),n}),d.C$Y(),d.OEk(93," \xa0 Use as default template "),d.C$Y()(),d.I0R(94,"ion-row")(95,"ion-col")(96,"div",19)(97,"h4"),d.OEk(98,"Add Documents"),d.C$Y()()()(),d.I0R(99,"ion-row",15)(100,"ion-col",20),d.yuY(101,Yu,6,1,"div",21),d.I0R(102,"div",22)(103,"div",23)(104,"div",24),d.yuY(105,ju,1,0,"ion-icon",25),d.C$Y(),d.yuY(106,Qu,2,0,"input",26)(107,Xu,1,0,"ion-spinner",27),d.C$Y()()()(),d.I0R(108,"ion-row",15),d.wR5(109,"ion-col",28),d.I0R(110,"ion-col",29),d.yuY(111,Zu,4,0,"div",30),d.C$Y(),d.I0R(112,"ion-col",29),d.yuY(113,tc,4,2,"div",31),d.C$Y()()()()),2&s&&(d.yG2(10),d.OKB("ngModel",o.templateName),d.yG2(75),d.OKB("ngModel",o.editorModel),d.E7m("init",d.q4q(12,Al)),d.yG2(4),d.OKB("ngModel",o._editorModel),d.E7m("init",d.q4q(13,Al)),d.yG2(3),d.OKB("ngModel",o.defaultTemplate),d.yG2(9),d.E7m("ngForOf",o.templateFiles),d.yG2(4),d.E7m("ngIf",!o.uploadingFile),d.yG2(),d.E7m("ngIf",!o.uploadingFile),d.yG2(),d.E7m("ngIf",o.uploadingFile),d.yG2(4),d.E7m("ngIf",!o.proposal),d.yG2(2),d.E7m("ngIf",!o.proposal))},dependencies:[be.ay,be.u_,ee.ew,ee.Kk,ee._i,ee.YP,ee.Ko,ee.A5,ee.qo,ee.YA,ee.UJ,ee.qG,Tt.ue,Tt.eJ,Tt.El,Tt._G,Pl.gZ],styles:["ion-grid[_ngcontent-%COMP%]{margin:0}.input-container[_ngcontent-%COMP%]{width:160px}.ql-toolbar[_ngcontent-%COMP%]{display:flex;flex-wrap:nowrap;align-items:center}.input-with-actions[_ngcontent-%COMP%]{display:flex;align-items:center;
1min-width:200px}.input-with-actions[_ngcontent-%COMP%] .action[_ngcontent-%COMP%]{margin-left:10px}.input-with-actions[_ngcontent-%COMP%] .action[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{cursor:pointer}.media[_ngcontent-%COMP%]{width:80px;height:80px;border:2px dashed gray;border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer}.media[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{font-size:1.5rem}.image-list[_ngcontent-%COMP%]{display:flex}.image-list[_ngcontent-%COMP%] .media-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center}.image-list[_ngcontent-%COMP%] .media-item[_ngcontent-%COMP%] .media[_ngcontent-%COMP%]{margin-right:5px;position:relative}.image-list[_ngcontent-%COMP%] .media-item[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.6rem;color:gray}.file-upload-input[_ngcontent-%COMP%]{cursor:pointer;position:absolute;width:100%;height:100%;top:0;left:0;opacity:0;z-index:20}quill-editor[_ngcontent-%COMP%]{display:block}.ql-formats[_ngcontent-%COMP%]{display:flex}.custom-btn[_ngcontent-%COMP%]{margin-top:20px}.white-btn[_ngcontent-%COMP%]{background-color:transparent;color:gray;border:2px solid grey}.preview[_ngcontent-%COMP%]{height:233px;padding:0 1rem;font-size:.8rem}"]})}return e})();var ic=X(36716),sc=X(97048),oc=X(832);const rc=["autoCompleteBox"];function nc(e,t){1&e&&(d.I0R(0,"div",17),d.wR5(1,"div",18),d.C$Y())}function lc(e,t){if(1&e&&(d.I0R(0,"span",27),d.OEk(1),d.C$Y()),2&e){const i=d.GaO().$implicit;d.yG2(),d.oRS(" ",i.name," ")}}function ac(e,t){if(1&e&&(d.I0R(0,"div"),d.yuY(1,lc,2,1,"span",26),d.C$Y()),2&e){const i=t.$implicit;d.yG2(),d.E7m("ngIf",i.value)}}function dc(e,t){if(1&e&&(d.I0R(0,"ion-col",23)(1,"div",24)(2,"span"),d.OEk(3),d.C$Y()(),d.yuY(4,ac,2,1,"div",25),d.C$Y()),2&e){const i=d.GaO().$implicit,s=d.GaO();d.yG2(3),d.cNF(null!=i&&i.question?"Non-Profit Tax Return"!=(null==s.componentProps?null:s.componentProps.selected.requestType)?i.question.replace("Trustees","Number Of Shareholders"):i.question:null==i?null:i.question2),d.yG2(),d.E7m("ngForOf",i.answers)}}function uc(e,t){if(1&e&&(d.I0R(0,"div")(1,"span",27),d.OEk(2),d.C$Y()()),2&e){const i=t.$implicit;d.yG2(2),d.oRS(" ",i.value," ")}}function cc(e,t){if(1&e&&(d.I0R(0,"ion-col",23)(1,"div")(2,"span"),d.OEk(3),d.C$Y()(),d.yuY(4,uc,3,1,"div",25),d.C$Y()),2&e){const i=d.GaO().$implicit,s=d.GaO();d.yG2(3),d.cNF(null!=i&&i.question?"Non-Profit Tax Return"!=(null==s.componentProps?null:s.componentProps.selected.requestType)?i.question.replace("Trustees","Number Of Shareholders"):i.question:null==i?null:i.question2),d.yG2(),d.E7m("ngForOf",i.answers)}}function hc(e,t){if(1&e&&(d.I0R(0,"div",19)(1,"ion-row")(2,"ion-col",20)(3,"div",21),d.OEk(4),d.C$Y()(),d.yuY(5,dc,5,2,"ion-col",22)(6,cc,5,2,"ion-col",22),d.C$Y()()),2&e){const i=t.$implicit,s=t.index;d.yG2(4),d.oRS(" ",s+1," "),d.yG2(),d.E7m("ngIf",i.formType.indexOf("-one")>=0||i.formType.indexOf("-multi")>=0||i.formType.indexOf("autocomplete")>=0),d.yG2(),d.E7m("ngIf",i.formType.indexOf("input")>=0)}}function pc(e,t){1&e&&d.wR5(0,"ion-spinner",34)}function gc(e,t){if(1&e){const i=d.KQA();d.I0R(0,"div",36)(1,"div",41),d.qCj("click",function(){const r=d.usT(i).$implicit,n=d.GaO(3);return d.CGJ(n.chooseTemplate(r))}),d.OEk(2),d.C$Y(),d.I0R(3,"div",38)(4,"ion-icon",42),d.qCj("click",function(){const r=d.usT(i).$implicit,n=d.GaO(3);return d.CGJ(n.deleteTemplate(r.id))}),d.C$Y()()()}if(2&e){const i=t.$implicit;d.yG2(2),d.oRS(" ",i.name," ")}}function fc(e,t){if(1&e){const i=d.KQA();d.I0R(0,"div",35)(1,"div",36)(2,"div",37),d.OEk(3,"\xa0"),d.C$Y(),d.I0R(4,"div",38)(5,"ion-icon",39),d.qCj("click",function(){d.usT(i);const o=d.GaO(2);return d.CGJ(o.addTemplate())}),d.C$Y()()(),d.yuY(6,gc,5,1,"div",40),d.C$Y()}if(2&e){const i=d.GaO(2);d.yG2(6),d.E7m("ngForOf",i.userProvider.myTemplates)}}function mc(e,t){if(1&e){const i=d.KQA();d.I0R(0,"div",28,29)(2,"div",30)(3,"button",31),d.qCj("click",function(){d.usT(i);const o=d.GaO();return d.CGJ(o.showTemplateList=!o.showTemplateList)}),d.OEk(4),d.C$Y(),d.yuY(5,pc,1,0,"ion-spinner",32),d.C$Y(),d.yuY(6,fc,7,1,"div",33),d.C$Y()}if(2&e){const i=d.GaO();d.yG2(4),d.oRS(" ",i.selectedTemplate," "),d.yG2(),d.E7m("ngIf",i._spinner),d.yG2(),d.E7m("ngIf",i.showTemplateList)}}
1function Cc(e,t){1&e&&(d.I0R(0,"ion-row")(1,"ion-col")(2,"div",43)(3,"h4"),d.OEk(4,"Add Documents"),d.C$Y()()()())}function vc(e,t){if(1&e){const i=d.KQA();d.I0R(0,"div",46)(1,"div",47)(2,"div",51)(3,"ion-icon",42),d.qCj("click",function(){const r=d.usT(i).index,n=d.GaO(2);return d.CGJ(n.deleteImage(r))}),d.C$Y()()(),d.I0R(4,"p"),d.OEk(5),d.C$Y()()}if(2&e){const i=t.$implicit;d.yG2(5),d.cNF(i.name)}}function wc(e,t){1&e&&d.wR5(0,"ion-icon",52)}function Sc(e,t){if(1&e){const i=d.KQA();d.I0R(0,"input",53,54),d.qCj("change",function(o){d.usT(i);const r=d.GaO(2);return d.CGJ(r.onFileAdd(o))}),d.C$Y()}}function Ec(e,t){1&e&&d.wR5(0,"ion-spinner")}function yc(e,t){if(1&e&&(d.I0R(0,"ion-row")(1,"ion-col",44),d.yuY(2,vc,6,1,"div",45),d.I0R(3,"div",46)(4,"div",47)(5,"div",48),d.yuY(6,wc,1,0,"ion-icon",49),d.C$Y(),d.yuY(7,Sc,2,0,"input",50)(8,Ec,1,0,"ion-spinner",14),d.C$Y()()()()),2&e){const i=d.GaO();d.yG2(2),d.E7m("ngForOf",i.templateFiles),d.yG2(4),d.E7m("ngIf",!i.uploadingFile),d.yG2(),d.E7m("ngIf",!i.uploadingFile),d.yG2(),d.E7m("ngIf",i.uploadingFile)}}function Rc(e,t){if(1&e&&(d.I0R(0,"p",59),d.OEk(1),d.C$Y()),2&e){const i=d.GaO(2);d.yG2(),d.oRS(" Sending proposal as ",null==i.task?null:i.task.vendorName," ")}}function Dc(e,t){1&e&&d.wR5(0,"ion-spinner")}function Tc(e,t){1&e&&(d.I0R(0,"span"),d.OEk(1,"Send Proposal"),d.C$Y())}function bc(e,t){if(1&e){const i=d.KQA();d.I0R(0,"div",55),d.yuY(1,Rc,2,1,"p",56),d.wR5(2,"br"),d.I0R(3,"div",57)(4,"button",58),d.qCj("click",function(){d.usT(i);const o=d.GaO();return d.CGJ(o.submitProposal())}),d.yuY(5,Dc,1,0,"ion-spinner",14)(6,Tc,2,0,"span",14),d.C$Y()()()}if(2&e){const i=d.GaO();d.yG2(),d.E7m("ngIf",i.task&&(null==i.task?null:i.task.vendorId)!==i.userProvider.loggedInUser.id),d.yG2(4),d.E7m("ngIf",i.savingProposal),d.yG2(),d.E7m("ngIf",!i.savingProposal)}}function Pc(e,t){if(1&e&&(d.I0R(0,"div"),d.wR5(1,"br"),d.OEk(2),d.C$Y()),2&e){const i=d.GaO(2);d.yG2(2),d.oRS(" ",null==i.task||null==i.task.templateFiles?null:i.task.templateFiles.length," files sent ")}}function Ac(e,t){if(1&e&&(d.I0R(0,"div",60)(1,"div",61)(2,"h6",62),d.OEk(3," Your Proposal "),d.C$Y(),d.wR5(4,"div",63),d.yuY(5,Pc,3,1,"div",14),d.C$Y()()),2&e){const i=d.GaO();d.yG2(4),d.E7m("innerHtml",i.proposal,d.E3n),d.yG2(),d.E7m("ngIf",(null==i.task?null:i.task.templateFiles)&&(null==i.task||null==i.task.templateFiles?null:i.task.templateFiles.length)>0)}}const Fc=e=>({active:e});function Oc(e,t){if(1&e){const i=d.KQA();d.I0R(0,"p",70),d.qCj("click",function(){const r=d.usT(i).$implicit,n=d.GaO(2);return d.CGJ(n.reassign(r))}),d.OEk(1),d.C$Y()}if(2&e){const i=t.$implicit,s=d.GaO(2);d.E7m("ngClass",d.S45(2,Fc,i.id===(null==s.task?null:s.task.vendorId))),d.yG2(),d.oRS(" ",i.firstName," ")}}function Mc(e,t){if(1&e&&(d.I0R(0,"ion-row")(1,"ion-col",64)(2,"div",65)(3,"ion-row",66)(4,"ion-col",67)(5,"h2",68),d.OEk(6,"Assigned To"),d.C$Y(),d.yuY(7,Oc,2,4,"p",69),d.C$Y()()()()()),2&e){const i=d.GaO();d.yG2(7),d.E7m("ngForOf",i.allTeamMembers)}}const Ic=()=>({toolbar:"",height:300});let Lc=(()=>{class e{userProvider;util;firebaseApi;renderer;format;modalCtrl;http;photoService;leadWatcher;api;router;componentProps;slug;autoCompleteBox;editorModel;proposal;task;savingProposal;showTemplateList=!1;allTeamMembers=[];templateFiles=[];uploadingFile=!1;_cardConf=!1;_showMap=!1;modules={toolbar:[[{header:[1,2,!1]}],["bold","italic","underline"],["image","code-block"]]};_spinner=!1;subscription;selectedTemplate="Select Template";constructor(i,s,o,r,n,l,a,c,h,g,m){this.userProvider=i,this.util=s,this.firebaseApi=o,this.renderer=r,this.format=n,this.modalCtrl=l,this.http=a,this.photoService=c,this.leadWatcher=h,this.api=g,this.router=m,this.subscription=this.userProvider.notifyObservable$.subscribe(C=>{C&&"map"===C.target&&C.value&&this.showMap()})}ngOnChanges(){var i=this;return(0,q.c)(function*(){console.log("user --\x3e",i.componentProps?.selected?.userInfo);try{i._spinner=!0,i._showMap=!1;const s=yield i.firebaseApi.findAll("tasks",r=>r.where("workRequestId","==",i.componentProps.selected.id).where("vendorId","==",i.userProvider.loggedInUser.id).orderBy("createdAt","desc"));s.length>0&&(i.task=s[0]),i.userProvider.myTemplates=yield i.firebaseApi.findAll("templates",r=>r.where("vendorId","==",i.userProvider.loggedInUser.id).orderBy("createdAt","desc")),i.allTeamMembers=yield i.firebaseApi.findAll("users",r=>r.where("userId","in",i.userProvider.loggedInUser.teamArray)),i.initSearchFocusListener();const o=i.userProvider.myTemplates.filter(r=>r.defaultTemplate);o.length>0?(i.editorModel=i.cleanMesage(o[0].message),o[0].templateFiles&&o[0].templateFiles.length>0&&(i.templateFiles=o[0].templateFiles)):i.editorModel="",console.log("editorModel ->",i.editorModel)}catch(s){i._spinner=!1,console.log("e -0))",s)}finally{i._spinner=!1}})()}initMap(i){const s=new google.maps.Map(document.getElementById("map"),{zoom:15,center:i});new google.maps.Marker({position:i,map:s,title:"User Location"})}showMap(){var i=this;return(0,q.c)(function*(){if(i._showMap=!i._showMap,!i._showMap)return;
1const s=i.componentProps?.selected?.userInfo.address,o=s?.line1+" "+s?.city+" , "+s?.state+" "+s?.zipcode;s?.line1&&(yield i.getLatLng(o).then(r=>{console.log("2 lat lng ->"),r.lat&&r.lng&&i.initMap(r)}))})()}getLatLng(i){return(0,q.c)(function*(){console.log("Getting address: ",i);const s=new google.maps.Geocoder;return new Promise((o,r)=>{s.geocode({address:i},function(n,l){if(l===google.maps.GeocoderStatus.OK&&n&&!n.err){const a=n[0].geometry.location.lat(),c=n[0].geometry.location.lng();o({lat:a,lng:c})}else o("Error reversing location results")})})})()}deleteImage(i){var s=this;return(0,q.c)(function*(){try{s.templateFiles.splice(i,1)}catch{s.util.createErrorAlert(null,"Could not delete doc")}})()}dismissModal(){var i=this;return(0,q.c)(function*(){yield i.modalCtrl.dismiss()})()}reassign(i){var s=this;return(0,q.c)(function*(){try{const o=yield s.firebaseApi.findOneById("tasks",s.task.id);o.reassigns&&o.reassigns.length>0?o.reassigns.push({from:s.userProvider.loggedInUser.id,to:i.id,at:new Date}):o.reassigns=[{from:s.userProvider.loggedInUser.id,to:i.id,at:new Date}];const r={vendorName:i.firstName+" "+i.lastName,vendorId:i.id,vendorPhoto:i.profilePhoto?i.profilePhoto:"",reassigns:o.reassigns};yield s.firebaseApi.updateOne("tasks",s.task.id,r),s.task={...s.task,...r}}catch{s.util.createErrorAlert(null,"Could not reassign team member")}})()}get IsFriendlyPro(){return this.userProvider.loggedInUser.teamArray.includes(this.task.vendorId)}initSearchFocusListener(){this.renderer.listen("window","click",i=>{this.autoCompleteBox?.nativeElement?.contains(i.target)||(this.showTemplateList=!1)})}deleteTemplate(i){var s=this;return(0,q.c)(function*(){yield s.firebaseApi.delete("templates",i),s.userProvider.myTemplates=yield s.firebaseApi.findAll("templates",o=>o.where("vendorId","==",s.userProvider.loggedInUser.id).orderBy("createdAt","desc"))})()}addTemplate(){var i=this;return(0,q.c)(function*(){i.util.navigateRoot("/message-template")})()}chooseTemplate(i){this.selectedTemplate=i.name,this.editorModel=this.cleanMesage(i.message),this.templateFiles=i.templateFiles?i.templateFiles:[],this.showTemplateList=!1}cleanMesage(i){if(!i)return;const s=this.userProvider.loggedInUser,o=this.componentProps.selected.userInfo;return i.replace(/\(f\)/gi,s?.firstName?s.firstName:"").replace(/\(l\)/gi,s?.lastName?s.lastName:"").replace(/\(a\)/gi,s?.address?.line1?s.address.line1:"").replace(/\(c\)/gi,s?.address?.city?s.address.city:"").replace(/\(s\)/gi,s?.address?.state&&s?.address?.zipcode?s.address.state+" "+s.address.zipcode:"").replace(/\(p\)/gi,s?.phoneNumber).replace(/\(e\)/gi,s?.email).replace(/\(c_f\)/gi,o?.firstName?o.firstName:"").replace(/\(c_l\)/gi,o?.lastName?o.lastName:"").replace(/\(c_a\)/gi,o?.address?.line1?o.address.line1:"").replace(/\(c_c\)/gi,o?.address?.city?o.address.city:"").replace(/\(c_s\)/gi,o?.address?.state&&o?.address?.zipcode?o.address.state+" "+o.address.zipcode:"").replace(/\(c_p\)/gi,o?.phoneNumber?o.phoneNumber:"").replace(/\(c_e\)/gi,o?.email?o.email:"")}ionViewDidEnter(){var i=this;return(0,q.c)(function*(){const s=yield i.firebaseApi.findAll("tasks",o=>o.where("workRequestId","==",i.componentProps.selected.id).where("vendorId","in",i.userProvider.loggedInUser.teamArray).orderBy("createdAt","desc"));s.length>0&&(i.task=s[0],i.proposal=i.task?.messages?.find(o=>o.vend)?.vend)})()}goToSubmitProposal(i){var s=this;return(0,q.c)(function*(){const o={component:Fl,componentProps:{componentProps:{task:s.task,temp:i,u:s.componentProps.selected}},cssClass:"center-modal-2",animated:!0,showBackdrop:!0},r=yield s.modalCtrl.create(o);yield r.present(),r.onDidDismiss().then(function(){var n=(0,q.c)(function*(l){yield r.dismiss(),console.log("1 Dismiss"),s.ngOnChanges()});return function(l){return n.apply(this,arguments)}}())})()}submitProposal(){var i=this;return(0,q.c)(function*(){if(!i.editorModel)return void i.util.createErrorAlert(null,"Please fill out a proposal first");console.log("text ->",i.editorModel);const s=yield i.firebaseApi.findAll("tasks",n=>n.where("workRequestId","==",i.componentProps.selected.id)),o=s.find(n=>n.vendorId===i.userProvider.loggedInUser.id);if(s?.length>=5&&!o)return i.http.post(ic.O.apiBase+"purgeLeadsWhenFull",{}).subscribe(l=>{},l=>{}),void i.util.createErrorAlert(null,"This lead has been responded to the maximum amount of time by other vendors. Good luck next time!");
1if(i.leadWatcher.workRequests.hired.data.filter(n=>n.potentialVendors?.includes(i.userProvider.loggedInUser.id)&&n.tasks.find(l=>l.vendorId===i.userProvider.loggedInUser.id))?.length>=20)i.util.createErrorAlert(null,"You are already hired by your maximum amount of leads.");else try{if(i.savingProposal=!0,console.log("componentProps ->",i.componentProps),console.log("selected ->",i.componentProps.selected),i.task)yield i.firebaseApi.updateOne("tasks",i.task.id,{messages:[{vend:i.editorModel,postedDate:(new Date).toISOString()}],templateFiles:i.templateFiles});else{const n=i.userProvider.getVendorChargeAmount(i.componentProps.selected.packageType,i.componentProps.selected.requestType,i.componentProps.selected.payment.globalTotal),l=yield i.tryToChargeVendor(n);i.userProvider.loggedInUser.credits+=l,yield i.firebaseApi.updateOne("users",i.userProvider.loggedInUser.id,{credits:i.userProvider.loggedInUser.credits});const a={userId:i.componentProps.selected.userInfo.id,vendorId:i.userProvider.loggedInUser.id,messages:[{vend:i.editorModel,postedDate:(new Date).toISOString()}],templateFiles:i.templateFiles,workRequestId:i.componentProps.selected.id,vendorPhoto:i.userProvider.loggedInUser.profilePhoto?i.userProvider.loggedInUser.profilePhoto:"",vendorName:i.userProvider.loggedInUser.firstName+" "+i.userProvider.loggedInUser.lastName,hired:!1,charged:!0,createdAt:new Date,clientFirstMsg:"",requestType:i.componentProps.selected?.requestType?i.componentProps.selected.requestType:"",vendorFirstName:i.userProvider.loggedInUser.firstName?i.userProvider.loggedInUser.firstName:"",vendorLastName:i.userProvider.loggedInUser.lastName?i.userProvider.loggedInUser.lastName:"",vendorBusinessName:i.userProvider.loggedInUser?.business?.name?i.userProvider.loggedInUser.business.name:"",userFirstName:i.componentProps.selected.userInfo?.firstName?i.componentProps.selected.userInfo.firstName:"",userLastName:i.componentProps.selected.userInfo?.lastName?i.componentProps.selected.userInfo.lastName:"",userPhoto:i.componentProps.selected.userInfo?.profilePhoto?i.componentProps.selected.userInfo.profilePhoto:""};console.log("task to insert -=>",a);const c=yield i.firebaseApi.insertOne("tasks",a);yield i.firebaseApi.insertOne("leadpurchases",{userId:i.userProvider.loggedInUser.id,taskId:c,amount:n}),i.router.navigate(["work-requests","pending"])}i.proposal=i.editorModel,i.router.navigate(["work-requests","pending"])}catch(n){"Could not purchase lead"!==n&&i.util.createErrorAlert(null,"Error submitting proposal")}finally{i.savingProposal=!1}})()}onFileAdd(i){var s=this;return(0,q.c)(function*(){const o=i.target.files[0];try{s.uploadingFile=!0,yield s.uploadDocAWS(o)}catch{s.util.createErrorAlert(null,"Could not upload file")}finally{s.uploadingFile=!1}})()}uploadDocAWS(i){var s=this;return(0,q.c)(function*(){try{const o=new FormData;o.append("fi",i);const n=(yield s.photoService.uploadPhotoToS3(o)).Location;s.templateFiles.push({name:i.name,url:n,createdAt:new Date})}catch{s.util.createErrorAlert(null,"Error uploading file")}})()}tryToChargeVendor(i){var s=this;return(0,q.c)(function*(){return new Promise(function(){var o=(0,q.c)(function*(r,n){try{s.userProvider.loggedInUser.credits>=i?r(-i):s.userProvider.loggedInUser.autoTopOff?(yield s.placeOrder(s.userProvider.loggedInUser.autoTopOffAmount),r(s.userProvider.loggedInUser.autoTopOffAmount-i)):(yield s.notEnoughCreditsAlert(),n("Could not purchase lead"))}catch{n("Could not purchase lead")}});return function(r,n){return o.apply(this,arguments)}}())})()}notEnoughCreditsAlert(){var i=this;return(0,q.c)(function*(){var o;(yield i.util.createAlert("Not enough credits",null,"You do not have enough credits to purchase this lead, would you like to purchase more credits?",{text:"Cancel",handler:(o=(0,q.c)(function*(){}),function(){return o.apply(this,arguments)})},{text:"Yes",handler:function(){var o=(0,q.c)(function*(){yield i.util.presentCenterModal(qu.k,{})});return function(){return o.apply(this,arguments)}}()})).present()})()}placeOrder(i){var s=this;return(0,q.c)(function*(){return new Promise(function(){var o=(0,q.c)(function*(r,n){try{let l={amount:Math.round(100*i),currency:"usd",customer:s.userProvider.loggedInUser.stripeCustomerId,payment_method:s.userProvider.loggedInUser.payMethod.payment_method,confirm:"true",error_on_requires_action:"true"};console.log("pay --\x3e",l),s.api.stripePay(l,"https://api.stripe.com/v1/payment_intents").subscribe(function(){var a=(0,q.c)(function*(c){console.log("payment resp ->",c);const h={addressCity:s.userProvider.loggedInUser.address.city,addressLine1:s.userProvider.loggedInUser.address.line1,addressLine2:s.userProvider.loggedInUser.address.line2,addressState:s.userProvider.loggedInUser.address.state,addressZipcode:s.userProvider.loggedInUser.address.zipcode,email:s.userProvider.loggedInUser.email,firstName:s.userProvider.loggedInUser.firstName,id:s.userProvider.loggedInUser.id,lastName:s.userProvider.loggedInUser.lastName,phoneNumber:s.userProvider.loggedInUser.phoneNumber,paymentMethod:s.userProvider.loggedInUser.payMethod,profileImage:s.userProvider.loggedInUser.profilePhoto?s.userProvider.loggedInUser.profilePhoto:""},g={id:c.id,amount:c.amount,client_secret:c.client_secret,confirmation_method:c.confirmation_method,created:c.created,currency:c.currency,customer:c.customer,status:c.status,cc:s.userProvider.loggedInUser.payMethod,receipt:c.charges.data[0].receipt_url};let m={amount:i.toFixed(2),orderId:Math.round(1e11*Math.random()).toString(),receipt:c.charges.data[0].receipt_url,created:c.created,currency:c.currency,customer:c.customer,paymentId:c.id,cc:s.userProvider.loggedInUser.payMethod,status:c.status};const C={orderId:m.orderId,total:m.amount,createdAt:(new Date).toISOString(),userId:s.userProvider.loggedInUser.id,placed:!0,customer:h,payment:g};console.log("order->",C),yield s.firebaseApi.insertOne("orders",C),r(!0)});return function(c){return a.apply(this,arguments)}}(),a=>{s.util.showToast("We're not able to process your payment failed, please try again."),console.log("Payment err --\x3e>",a),n(a)})}catch(l){n(l)}});return function(r,n){return o.apply(this,arguments)}}())})()}static \u0275fac=function(s){return new(s||e)(d.GI1(So.e),d.GI1(Ar.e),d.GI1(wo.H),d.GI1(d.q87),d.GI1(Fr.M),d.GI1(ee.qS),d.GI1(sc.KK),d.GI1(bl.s),d.GI1(Tl.c),d.GI1(oc.W),d.GI1(Ii.E5))};static \u0275cmp=d.In1({type:e,selectors:[["app-contact-work-request"]],viewQuery:function(s,o){if(1&s&&d.CC$(rc,5),2&s){let r;d.wto(r=d.Gqi())&&(o.autoCompleteBox=r.first)}}
1,inputs:{componentProps:"componentProps",slug:"slug"},features:[d.SYr],decls:31,vars:13,consts:[["sizeLg","6","size","12"],[1,"inner-div-box","scroll"],[1,"ion-text-left"],[1,"margin-left","underline","blue","cursor",3,"click"],["id","wr-summary"],[1,"margin-top-1"],["class","border",4,"ngIf"],[1,"white-block","margin-top-2"],[1,"ion-justify-content-start","ion-align-items-center"],["class","numbers-box",4,"ngFor","ngForOf"],[1,"inner-div-box"],["class","custom-select-list-container",4,"ngIf"],["id","notSentProposal"],["apiKey","p77xsed1rznknj5kf5my5ur0jh2aqd23x9bl8sns8tui6dc5","name","editme",3,"ngModel","init","ngModelChange"],[4,"ngIf"],["id","addProposal",4,"ngIf"],["id","sentProposal",4,"ngIf"],[1,"border"],["id","map"],[1,"numbers-box"],["size","2",1,"flex","f-just-end"],[1,"number-img"],["size","10",4,"ngIf"],["size","10"],[1,"bold-500","capitalize"],[4,"ngFor","ngForOf"],["class","b-c",4,"ngIf"],[1,"b-c"],[1,"custom-select-list-container"],["autoCompleteBox",""],[1,"flex","f-align-center"],[1,"custom-btn","white-btn",3,"click"],["name","circles",4,"ngIf"],["class","custom-select-list",4,"ngIf"],["name","circles"],[1,"custom-select-list"],[1,"custom-select-item"],[1,"text"],[1,"action"],["name","add-circle-outline",3,"click"],["class","custom-select-item",4,"ngFor","ngForOf"],[1,"text",3,"click"],["name","trash-outline","color","danger ","id","deleteButton",1,"other-icons",3,"click"],[1,"header-and-action"],["size","12",1,"image-list"],["class","media-item",4,"ngFor","ngForOf"],[1,"media-item"],[1,"media"],[1,"add-icon"],["class","other-icons","name","add","color","primary ","id","addButton",4,"ngIf"],["type","file","accept","image/*, application/msword, text/plain, application/pdf","class","file-upload-input",3,"change",4,"ngIf"],[1,"delete-icon"],["name","add","color","primary ","id","addButton",1,"other-icons"],["type","file","accept","image/*, application/msword, text/plain, application/pdf",1,"file-upload-input",3,"change"],["filePicker",""],["id","addProposal"],["class","disclaimer",4,"ngIf"],["id","submitButton"],[1,"custom-btn",3,"click"],[1,"disclaimer"],["id","sentProposal"],[1,"p_top_botom"],[1,"font-700","custom_h6"],[3,"innerHtml"],["size","12",1,"lead"],[1,"white-block"],[1,"dashboard-row","bottom","ion-justify-content-around","ion-align-items-center"],["sizeLg","12","size","12",1,"details-nav-box"],[1,"ion-text-center"],["class","assigned-to",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"assigned-to",3,"ngClass","click"]],template:function(s,o){1&s&&(d.I0R(0,"ion-content")(1,"ion-row")(2,"ion-col",0)(3,"div",1)(4,"ion-row")(5,"ion-col")(6,"div",2)(7,"span",3),d.qCj("click",function(){return o.showMap()}),d.OEk(8),d.C$Y()()()(),d.I0R(9,"div",4)(10,"div",5)(11,"h3"),d.OEk(12),d.C$Y()()(),d.yuY(13,nc,2,0,"div",6),d.I0R(14,"div",7)(15,"ion-row",8)(16,"ion-col"),d.yuY(17,hc,7,3,"div",9),d.C$Y()()()()(),d.I0R(18,"ion-col",0)(19,"div",10)(20,"ion-row")(21,"ion-col")(22,"div",7),d.yuY(23,mc,7,3,"div",11),d.I0R(24,"div",12)(25,"editor",13),d.iHE("ngModelChange",function(n){return d.kNx(o.editorModel,n)||(o.editorModel=n),n}),d.C$Y()(),d.yuY(26,Cc,5,0,"ion-row",14)(27,yc,9,4,"ion-row",14)(28,bc,7,3,"div",15)(29,Ac,6,2,"div",16),d.C$Y()()(),d.yuY(30,Mc,8,1,"ion-row",14),d.C$Y()()()()),2&s&&(d.yG2(8),d.oRS("",o._showMap?"Hide Map":"View Map"," "),d.yG2(4),d.oRS(" ",o.format.getFullPackage(null==o.componentProps?null:o.componentProps.selected)," "),d.yG2(),d.E7m("ngIf",o._showMap),d.yG2(4),d.E7m("ngForOf",o.userProvider.getQuestions(null==o.componentProps?null:o.componentProps.selected)),d.yG2(6),d.E7m("ngIf",!o.proposal),d.yG2(2),d.OKB("ngModel",o.editorModel),d.E7m("init",d.q4q(12,Ic)),d.yG2(),d.E7m("ngIf",!o.proposal),d.yG2(),d.E7m("ngIf",!o.proposal),d.yG2(),d.E7m("ngIf",!o.proposal),d.yG2(),d.E7m("ngIf",o.proposal),d.yG2(),d.E7m("ngIf",o.task&&(null==o.userProvider.loggedInUser||null==o.userProvider.loggedInUser.teamArray?null:o.userProvider.loggedInUser.teamArray.length)>1))},dependencies:[be.QF,be.ay,be.u_,ee.Kk,ee._i,ee.Ko,ee.qo,ee.YA,Tt.ue,Tt._G,Pl.gZ],styles:["ion-content[_ngcontent-%COMP%]{--background: transparent}.container[_ngcontent-%COMP%]{background-color:#f0f2f8;margin-left:65px}#map[_ngcontent-%COMP%]{height:300px;width:100%}.profile-img[_ngcontent-%COMP%]{width:40px;height:40px}#chatIconClose[_ngcontent-%COMP%]{width:62px;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;position:fixed;top:20px;left:0;height:62px;background-color:var(--ion-color-primary);box-shadow:0 0 6px #00000040;border-radius:8px;transition:right .25s;cursor:pointer}#chatIconClose[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{font-size:2.5rem;color:#fff}#chatIconClose.active[_ngcontent-%COMP%]{right:0}
1#chatIconClose.close-chat[_ngcontent-%COMP%]{font-size:2rem;color:gray;cursor:pointer}#chatIconClose[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:30px}ion-row.section-block[_ngcontent-%COMP%]{margin:7px 14px}.headshot[_ngcontent-%COMP%]{margin-left:5px;margin-right:5px;display:inline-block;width:75px}.media[_ngcontent-%COMP%]{width:80px;height:80px;border:2px dashed gray;border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer}.media[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{font-size:1.5rem}.image-list[_ngcontent-%COMP%]{display:flex}.image-list[_ngcontent-%COMP%] .media-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center}.image-list[_ngcontent-%COMP%] .media-item[_ngcontent-%COMP%] .media[_ngcontent-%COMP%]{margin-right:5px;position:relative}.image-list[_ngcontent-%COMP%] .media-item[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.6rem;color:gray}.file-upload-input[_ngcontent-%COMP%]{cursor:pointer;position:absolute;width:100%;height:100%;top:0;left:0;opacity:0;z-index:20}ul.answers-list[_ngcontent-%COMP%]{margin:0;color:#04f;padding:0 0 0 30px;display:flex;flex-wrap:wrap}ul.answers-list[_ngcontent-%COMP%] .answer-list-item[_ngcontent-%COMP%]{margin:0 5px 0 0}.icon[_ngcontent-%COMP%]{width:20px;margin-left:0;margin-right:10px}.icon_1[_ngcontent-%COMP%]{width:20px}.verified[_ngcontent-%COMP%]{height:13px;padding-right:5px}.custom_slider[_ngcontent-%COMP%]{margin-left:0;margin-right:0}.verified[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:50%}#sentProposal[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.assigned-to.active[_ngcontent-%COMP%]{font-weight:700}.assigned-to[_ngcontent-%COMP%]:hover{cursor:pointer}.info-item[_ngcontent-%COMP%]{display:flex;align-items:center}.info-item[_ngcontent-%COMP%] .first-icon[_ngcontent-%COMP%]{margin-right:5px}.info-item[_ngcontent-%COMP%] .first-icon[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{color:gray}.info-item[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{font-size:.8rem;color:gray}.info-item[_ngcontent-%COMP%] .second-icon[_ngcontent-%COMP%]{margin-left:10px}.info-item[_ngcontent-%COMP%] .first-icon[_ngcontent-%COMP%], .info-item[_ngcontent-%COMP%] .second-icon[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center}.p_heading[_ngcontent-%COMP%]{padding-right:8px}#submitButton[_ngcontent-%COMP%]{margin-top:10px;display:flex;justify-content:space-between}#submitButton[_ngcontent-%COMP%] .custom-btn[_ngcontent-%COMP%]{width:150px}.white-btn[_ngcontent-%COMP%]{width:150px;background-color:transparent;color:gray;border:2px solid grey}.p_top_bottom[_ngcontent-%COMP%]{margin-top:10px;margin-bottom:10px}.custom-select-list-container[_ngcontent-%COMP%]{position:relative;margin-bottom:10px}.custom-select-list-container[_ngcontent-%COMP%] .custom-select-list[_ngcontent-%COMP%]{border:2px solid gray;border-radius:4px;position:absolute;top:40px;background-color:#fff;padding:10px;width:300px;z-index:20}.custom-select-list-container[_ngcontent-%COMP%] .custom-select-list[_ngcontent-%COMP%] .custom-select-item[_ngcontent-%COMP%]{color:var(--ion-color-primary);font-size:.8rem;display:flex;justify-content:space-between;align-items:center;padding:5px 0}.custom-select-list-container[_ngcontent-%COMP%] .custom-select-list[_ngcontent-%COMP%] .custom-select-item[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{font-weight:700;cursor:pointer}.custom-select-list-container[_ngcontent-%COMP%] .custom-select-list[_ngcontent-%COMP%] .custom-select-item[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{cursor:pointer;font-size:1.3rem}.white-block[_ngcontent-%COMP%]{border-bottom:1px solid rgb(230,230,230)}a[_ngcontent-%COMP%], p[_ngcontent-%COMP%], span[_ngcontent-%COMP%]{font-size:.8rem}.font-blue[_ngcontent-%COMP%]{color:#6c63ff}.font-black[_ngcontent-%COMP%]{color:#000}.font-500[_ngcontent-%COMP%]{font-weight:500}.font-600[_ngcontent-%COMP%]{font-weight:600}.font-700[_ngcontent-%COMP%]{font-weight:700}h1[_ngcontent-%COMP%]{margin:2px auto;font-size:1.4rem}
1h2[_ngcontent-%COMP%], h4[_ngcontent-%COMP%], h5[_ngcontent-%COMP%], span[_ngcontent-%COMP%], p[_ngcontent-%COMP%]{margin:2px auto;padding:0}.custom_h5[_ngcontent-%COMP%], .custom_h2[_ngcontent-%COMP%]{margin:10px}.custom_h6[_ngcontent-%COMP%]{margin:0}p[_ngcontent-%COMP%]{margin:0;color:#555}@media (max-width: 972px){#requests[_ngcontent-%COMP%]{padding:100px 25px;margin:auto;width:100%}}#addProposal[_ngcontent-%COMP%]{width:100%;height:100px;display:flex;flex-direction:column;align-items:center;justify-content:center}#addProposal[_ngcontent-%COMP%] #submitButton[_ngcontent-%COMP%]{margin-top:0}"]})}return e})();var _c=X(57460),Or=Object.defineProperty,xc=Object.defineProperties,Gc=Object.getOwnPropertyDescriptor,Nc=Object.getOwnPropertyDescriptors,Eo=Object.getOwnPropertySymbols,Ol=Object.prototype.hasOwnProperty,Ml=Object.prototype.propertyIsEnumerable,Il=(e,t,i)=>t in e?Or(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,L=(e,t)=>{for(var i in t||(t={}))Ol.call(t,i)&&Il(e,i,t[i]);if(Eo)for(var i of Eo(t))Ml.call(t,i)&&Il(e,i,t[i]);return e},ie=(e,t)=>xc(e,Nc(t)),Ce=(e,t)=>{for(var i in t)Or(e,i,{get:t[i],enumerable:!0})},u=(e,t,i,s)=>{for(var n,o=s>1?void 0:s?Gc(t,i):t,r=e.length-1;r>=0;r--)(n=e[r])&&(o=(s?n(t,i,o):n(o))||o);return s&&o&&Or(t,i,o),o},it=(e,t)=>(i,s)=>t(i,s,e),Ll={};function ht(e){return null==e||""===e?null:e}function R(e,t=!1){return null!=e&&(""!==e||t)}function G(e){return!R(e)}function Be(e){return null==e||0===e.length}function vs(e){return null!=e&&"function"==typeof e.toString?e.toString():null}function Gt(e){if(void 0===e)return;if(null===e||""===e)return null;if("number"==typeof e)return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function yo(e){if(void 0!==e)return null!==e&&""!==e&&("boolean"==typeof e?e:/true/i.test(e))}function Vc(e){if(null!=e&&""!==e)return e}function Mr(e,t){return(e?JSON.stringify(e):null)===(t?JSON.stringify(t):null)}function Hc(e,t,i=!1){const s=null==e,o=null==t;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),s&&o)return 0;if(s)return-1;if(o)return 1;function r(n,l){return n>l?1:n<l?-1:0}if("string"!=typeof e||!i)return r(e,t);try{return e.localeCompare(t)}catch{return r(e,t)}}function jt(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach(i=>t.push(i)),t}return Object.values(e)}Ce(Ll,{attrToBoolean:()=>yo,attrToNumber:()=>Gt,attrToString:()=>Vc,defaultComparator:()=>Hc,exists:()=>R,jsonEquals:()=>Mr,makeNull:()=>ht,missing:()=>G,missingOrEmpty:()=>Be,toStringOrNull:()=>vs,values:()=>jt});var Bc=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=vs(e);let i=0;for(;;){let s;if(e?(s=e,0!==i&&(s+="_"+i)):t?(s=t,0!==i&&(s+="_"+i)):s=i,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);i++}}},_l={};function Se(e,t){if(null!=e){if(Array.isArray(e)){for(let i=0;i<e.length;i++)t(i.toString(),e[i]);return}for(const[i,s]of Object.entries(e))t(i,s)}}function Ir(e){const t={},i=Object.keys(e);for(let s=0;s<i.length;s++){const o=i[s];t[o]=e[o]}return t}function Ro(e,t){if(!e)return;const i=e,s={};
1return Object.keys(i).forEach(o=>{if(t&&t.indexOf(o)>=0)return;const r=i[o];s[o]=Do(r)&&r.constructor===Object?Ro(r):r}),s}function Nt(e){if(!e)return[];const t=Object;if("function"==typeof t.values)return t.values(e);const i=[];for(const s in e)e.hasOwnProperty(s)&&e.propertyIsEnumerable(s)&&i.push(e[s]);return i}function We(e,t,i=!0,s=!1){R(t)&&Se(t,(o,r)=>{let n=e[o];n!==r&&(s&&null==n&&null!=r&&"object"==typeof r&&r.constructor===Object&&(n={},e[o]=n),Do(r)&&Do(n)&&!Array.isArray(n)?We(n,r,i,s):(i||void 0!==r)&&(e[o]=r))})}function Li(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let o=e;for(let r=0;r<s.length;r++){if(null==o)return;o=o[s[r]]}return o}function xl(e,t=[],i){Object.keys(e).forEach(n=>{"object"==typeof e[n]&&!t.includes(n)&&(e[n]=void 0)});const s=Object.getPrototypeOf(e),o={};Object.getOwnPropertyNames(s).forEach(n=>{if("function"==typeof s[n]&&!t.includes(n)){const a=()=>{console.warn((n=>`AG Grid: Grid API function ${n}() cannot be called as the grid has been destroyed.\n It is recommended to remove local references to the grid api. Alternatively, check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.\n To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${i}`)(n))};o[n]={value:a,writable:!0}}}),Object.defineProperties(e,o)}function Do(e){return"object"==typeof e&&null!==e}Ce(_l,{cloneObject:()=>Ir,deepCloneDefinition:()=>Ro,getAllValuesInObject:()=>Nt,getValueUsingField:()=>Li,isNonNullObject:()=>Do,iterateObject:()=>Se,mergeDeep:()=>We,removeAllReferences:()=>xl});var Gl={};Ce(Gl,{compose:()=>Wc,debounce:()=>Pe,doOnce:()=>Qt,errorOnce:()=>st,executeAfter:()=>Vl,executeInAWhile:()=>kl,executeNextVMTurn:()=>xr,getFunctionName:()=>To,isFunction:()=>bo,noop:()=>Uc,throttle:()=>Gr,waitUntil:()=>Nr,warnOnce:()=>x});var Nl={};function Qt(e,t){Nl[t]||(e(),Nl[t]=!0)}function x(e){Qt(()=>console.warn("AG Grid: "+e),e)}function st(e){Qt(()=>console.error("AG Grid: "+e),e)}function To(e){if(e.name)return e.name;const t=/function\s+([^\(]+)/.exec(e.toString());return t&&2===t.length?t[1].trim():null}function bo(e){return!!(e&&e.constructor&&e.call&&e.apply)}function kl(e){Vl(e,400)}var Lr=[],_r=!1;function xr(e){Lr.push(e),!_r&&(_r=!0,window.setTimeout(()=>{const t=Lr.slice();Lr.length=0,_r=!1,t.forEach(i=>i())},0))}function Vl(e,t=0){e.length>0&&window.setTimeout(()=>e.forEach(i=>i()),t)}function Pe(e,t){let i;return function(...s){const o=this;window.clearTimeout(i),i=window.setTimeout(function(){e.apply(o,s)},t)}}function Gr(e,t){let i=0;return function(...s){const r=(new Date).getTime();r-i<t||(i=r,e.apply(this,s))}}function Nr(e,t,i=100,s){const o=(new Date).getTime();let r=null,n=!1;const l=()=>{const a=(new Date).getTime()-o>i;(e()||a)&&(t(),n=!0,null!=r&&(window.clearInterval(r),r=null),a&&s&&console.warn(s))};l(),n||(r=window.setInterval(l,10))}function Wc(...e){return t=>e.reduce((i,s)=>s(i),t)}var Uc=()=>{},Hl=(e=>(e.CommunityCoreModule="@ag-grid-community/core",e.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",e.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",e.CsvExportModule="@ag-grid-community/csv-export",e.EnterpriseCoreModule="@ag-grid-enterprise/core",e.RowGroupingModule="@ag-grid-enterprise/row-grouping",e.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",e.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",e.MenuModule="@ag-grid-enterprise/menu",e.SetFilterModule="@ag-grid-enterprise/set-filter",e.MultiFilterModule="@ag-grid-enterprise/multi-filter",e.StatusBarModule="@ag-grid-enterprise/status-bar",e.SideBarModule="@ag-grid-enterprise/side-bar",e.RangeSelectionModule="@ag-grid-enterprise/range-selection",e.MasterDetailModule="@ag-grid-enterprise/master-detail",e.RichSelectModule="@ag-grid-enterprise/rich-select",e.GridChartsModule="@ag-grid-enterprise/charts",e.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",e.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",e.ExcelExportModule="@ag-grid-enterprise/excel-export",e.ClipboardModule="@ag-grid-enterprise/clipboard",e.SparklinesModule="@ag-grid-enterprise/sparklines",e.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",e.AngularModule="@ag-grid-community/angular",e.ReactModule="@ag-grid-community/react",e.VueModule="@ag-grid-community/vue",e))(
1Hl||{}),Po=class Q{static register(t){Q.__register(t,!0,void 0)}static registerModules(t){Q.__registerModules(t,!0,void 0)}static __register(t,i,s){Q.runVersionChecks(t),void 0!==s?(Q.areGridScopedModules=!0,void 0===Q.gridModulesMap[s]&&(Q.gridModulesMap[s]={}),Q.gridModulesMap[s][t.moduleName]=t):Q.globalModulesMap[t.moduleName]=t,Q.setModuleBased(i)}static __unRegisterGridModules(t){delete Q.gridModulesMap[t]}static __registerModules(t,i,s){Q.setModuleBased(i),t&&t.forEach(o=>Q.__register(o,i,s))}static isValidModuleVersion(t){const[i,s]=t.version.split(".")||[],[o,r]=Q.currentModuleVersion.split(".")||[];return i===o&&s===r}static runVersionChecks(t){if(Q.currentModuleVersion||(Q.currentModuleVersion=t.version),t.version?Q.isValidModuleVersion(t)||console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${t.moduleName}' is version ${t.version} but the other modules are version ${this.currentModuleVersion}. Please update all modules to the same version.`):console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${t.moduleName}' is incompatible. Please update all modules to the same version.`),t.validate){const i=t.validate();i.isValid||console.error(`AG Grid: ${i.message}`)}}static setModuleBased(t){void 0===Q.moduleBased?Q.moduleBased=t:Q.moduleBased!==t&&Qt(()=>{console.warn("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community)
1- you can only use one or the other of these mechanisms."),console.warn("Please see https://www.ag-grid.com/javascript-grid/packages-modules/ for more information.")},"ModulePackageCheck")}static __setIsBundled(){Q.isBundled=!0}static __assertRegistered(t,i,s){var o;if(this.__isRegistered(t,s))return!0;const r=i+t;let n;if(Q.isBundled)n=`AG Grid: unable to use ${i} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:\n \n <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script>\n \nFor more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(Q.moduleBased||void 0===Q.moduleBased){let l=null==(o=Object.entries(Hl).find(([a,c])=>c===t))?void 0:o[0];n=`AG Grid: unable to use ${i} as the ${l} is not registered${Q.areGridScopedModules?` for gridId: ${s}`:""}. Check if you have registered the module:\n \n import { ModuleRegistry } from '@ag-grid-community/core';\n import { ${l} } from '${t}';\n \n ModuleRegistry.registerModules([ ${l} ]);\n\nFor more info see: https://www.ag-grid.com/javascript-grid/modules/`}else n=`AG Grid: unable to use ${i} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:\n \n import 'ag-grid-enterprise';\n \nFor more info see: https://www.ag-grid.com/javascript-grid/packages/`;return Qt(()=>{console.warn(n)},r),!1}static __warnEnterpriseChartDisabled(t){const r=`AG Grid: the '${t}' chart type is not supported in AG Charts Community as 'ag-grid-charts-enterprise' or '@ag-grid-enterprise/charts-enterprise' hasn't been loaded. See https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/ for more details.`;Qt(()=>{console.warn(r)},"ag-charts-enterprise:"+t)}static __isRegistered(t,i){var s;return!!Q.globalModulesMap[t]||!(null==(s=Q.gridModulesMap[i])||!s[t])}static __getRegisteredModules(t){return[...jt(Q.globalModulesMap),...jt(Q.gridModulesMap[t]||{})]}static __getGridRegisteredModules(t){var i;return jt(null!=(i=Q.gridModulesMap[t])?i:{})||[]}static __isPackageBased(){return!Q.moduleBased}};Po.globalModulesMap={},Po.gridModulesMap={},Po.areGridScopedModules=!1;var Y=Po,zc=class{constructor(e,t){if(this.beanWrappers={}
1,this.destroyed=!1,!e||!e.beanClasses)return;this.contextParams=e,this.logger=t,this.logger.log(">> creating ag-Application Context"),this.createBeans();const i=this.getBeanInstances();this.wireBeans(i),this.logger.log(">> ag-Application Context ready - component is alive")}getBeanInstances(){return jt(this.beanWrappers).map(e=>e.beanInstance)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.wireBeans([e],t),e}wireBeans(e,t){this.autoWireBeans(e),this.methodWireBeans(e),this.callLifeCycleMethods(e,"preConstructMethods"),R(t)&&e.forEach(t),this.callLifeCycleMethods(e,"postConstructMethods")}createBeans(){this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)),Se(this.beanWrappers,(t,i)=>{let s;i.bean.__agBeanMetaData&&i.bean.__agBeanMetaData.autowireMethods&&i.bean.__agBeanMetaData.autowireMethods.agConstructor&&(s=i.bean.__agBeanMetaData.autowireMethods.agConstructor);const o=this.getBeansForParameters(s,i.bean.name),r=new(i.bean.bind.apply(i.bean,[null,...o]));i.beanInstance=r});const e=Object.keys(this.beanWrappers).join(", ");this.logger.log(`created beans: ${e}`)}createBeanWrapper(e){const t=e.__agBeanMetaData;if(!t){let s;return s=e.prototype.constructor?To(e.prototype.constructor):""+e,void console.error(`Context item ${s} is not a bean`)}this.beanWrappers[t.beanName]={bean:e,beanInstance:null,beanName:t.beanName}}autoWireBeans(e){e.forEach(t=>{this.forEachMetaDataInHierarchy(t,(i,s)=>{const o=i.agClassAttributes;o&&o.forEach(r=>{const n=this.lookupBeanInstance(s,r.beanName,r.optional);t[r.attributeName]=n})})})}methodWireBeans(e){e.forEach(t=>{this.forEachMetaDataInHierarchy(t,(i,s)=>{Se(i.autowireMethods,(o,r)=>{if("agConstructor"===o)return;const n=this.getBeansForParameters(r,s);t[o].apply(t,n)})})})}forEachMetaDataInHierarchy(e,t){let i=Object.getPrototypeOf(e);for(;null!=i;){const s=i.constructor;s.hasOwnProperty("__agBeanMetaData")&&t(s.__agBeanMetaData,this.getBeanName(s)),i=Object.getPrototypeOf(i)}}getBeanName(e){if(e.__agBeanMetaData&&e.__agBeanMetaData.beanName)return e.__agBeanMetaData.beanName;const t=e.toString();return t.substring(9,t.indexOf("("))}getBeansForParameters(e,t){const i=[];return e&&Se(e,(s,o)=>{const r=this.lookupBeanInstance(t,o);i[Number(s)]=r}),i}lookupBeanInstance(e,t,i=!1){if(this.destroyed)return this.logger.log(`AG Grid: bean reference ${t} is used after the grid is destroyed!`),null;if("context"===t)return this;if(this.contextParams.providedBeanInstances&&this.contextParams.providedBeanInstances.hasOwnProperty(t))return this.contextParams.providedBeanInstances[t];const s=this.beanWrappers[t];return s?s.beanInstance:(i||console.error(`AG Grid: unable to find bean reference ${t} while initialising ${e}`),null)}callLifeCycleMethods(e,t){e.forEach(i=>this.callLifeCycleMethodsOnBean(i,t))}callLifeCycleMethodsOnBean(e,t,i){const s={};this.forEachMetaDataInHierarchy(e,r=>{const n=r[t];n&&n.forEach(l=>{l!=i&&(s[l]=!0)})}),Object.keys(s).forEach(r=>e[r]())}getBean(e){return this.lookupBeanInstance("getBean",e,!0)}destroy(){if(this.destroyed)return;this.destroyed=!0,this.logger.log(">> Shutting down ag-Application Context");const e=this.getBeanInstances();this.destroyBeans(e),this.contextParams.providedBeanInstances=null,Y.__unRegisterGridModules(this.contextParams.gridId),this.logger.log(">> ag-Application Context shut down - component is dead")}destroyBean(e){e&&this.destroyBeans([e])}destroyBeans(e){return e?(e.forEach(t=>{this.callLifeCycleMethodsOnBean(t,"preDestroyMethods","destroy"),"function"==typeof t.destroy&&t.destroy()}),[]):[]}isDestroyed(){return this.destroyed}getGridId(){return this.contextParams.gridId}};function Bl(e,t,i){const s=Xt(e.constructor);s.preConstructMethods||(s.preConstructMethods=[]),s.preConstructMethods.push(t)}function b(e,t,i){const s=Xt(e.constructor);s.postConstructMethods||(s.postConstructMethods=[]),s.postConstructMethods.push(t)}function Ae(e,t,i){const s=Xt(e.constructor);s.preDestroyMethods||(s.preDestroyMethods=[]),s.preDestroyMethods.push(t)}function O(e){return t=>{Xt(t).beanName=e}}function f(e){return(t,i,s)=>{Wl(t,e,!1,0,i,null)}}function z(e){return(t,i,s)=>{Wl(t,e,!0,0,i,null)}}function Wl(e,t,i,s,o,r){if(null===t)return void console.error("AG Grid: Autowired name should not be null");if("number"==typeof r)return void console.error("AG Grid: Autowired should be on an attribute");const n=Xt(e.constructor);n.agClassAttributes||(n.agClassAttributes=[]),n.agClassAttributes.push({attributeName:o,beanName:t,optional:i})}function qe(e){return(t,i,s)=>{const o="function"==typeof t?t:t.constructor;let r;if("number"==typeof s){let n;i?(r=Xt(o),n=i):(r=Xt(o),n="agConstructor"),r.autowireMethods||(r.autowireMethods={}),r.autowireMethods[n]||(r.autowireMethods[n]={}),r.autowireMethods[n][s]=e}}}function Xt(e){return e.hasOwnProperty("__agBeanMetaData")||(e.__agBeanMetaData={}),e.__agBeanMetaData}var ot=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}
1setBeans(e,t,i=null,s=null){if(this.frameworkOverrides=t,this.gridOptionsService=e,i){const o=e.useAsyncEvents();this.addGlobalListener(i,o)}s&&this.addGlobalListener(s,!1)}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,i){const s=t?this.allAsyncListeners:this.allSyncListeners;let o=s.get(e);return!o&&i&&(o=new Set,s.set(e,o)),o}noRegisteredListenersExist(){return 0===this.allSyncListeners.size&&0===this.allAsyncListeners.size&&0===this.globalSyncListeners.size&&0===this.globalAsyncListeners.size}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const s=this.getListeners(e,i,!1);s&&(s.delete(t),0===s.size&&(i?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){let t=e;this.gridOptionsService&&this.gridOptionsService.addGridCommonParams(t),this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){var i;const s=e.type;if(t&&"event"in e){const a=e.event;a instanceof Event&&(e.eventPath=a.composedPath())}const r=null!=(i=this.getListeners(s,t,!1))?i:new Set,n=new Set(r);n.size>0&&((a,c)=>{a.forEach(h=>{if(!c.has(h))return;const g=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>h(e)):()=>h(e);t?this.dispatchAsync(g):g()})})(n,r),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(a=>{const c=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>a(s,e)):()=>a(s,e);t?this.dispatchAsync(c):c()})}dispatchAsync(e){this.asyncFunctionsQueue.push(e),this.scheduled||(this.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)}),this.scheduled=!0)}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(t=>t())}};u([it(0,qe("gridOptionsService")),it(1,qe("frameworkOverrides")),it(2,qe("globalEventListener")),it(3,qe("globalSyncEventListener"))],ot.prototype,"setBeans",1),ot=u([O("eventService")],ot);var kr=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=i=>{this.frameworkOverrides.wrapOutgoing(()=>e(i))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(i,s)=>{this.frameworkOverrides.wrapOutgoing(()=>e(i,s))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){var t;return null!=(t=this.wrappedListeners.get(e))?t:e}unwrapGlobal(e){var t;return null!=(t=this.wrappedGlobalListeners.get(e))?t:e}},Kc={resizable:!0,sortable:!0},$c=0;function Ul(){return $c++}var ue=class hu{constructor(t,i,s,o){this.instanceId=Ul(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.eventService=new ot,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=t,this.userProvidedColDef=i,this.colId=s,this.primary=o,this.setState(t)}getInstanceId(){return this.instanceId}setState(t){void 0!==t.sort?("asc"===t.sort||"desc"===t.sort)&&(this.sort=t.sort):("asc"===t.initialSort||"desc"===t.initialSort)&&(this.sort=t.initialSort);const i=t.sortIndex,s=t.initialSortIndex;void 0!==i?null!==i&&(this.sortIndex=i):null!==s&&(this.sortIndex=s);const o=t.hide;this.visible=void 0!==o?!o:!t.initialHide,this.setPinned(void 0!==t.pinned?t.pinned:t.initialPinned);const n=t.flex,l=t.initialFlex;void 0!==n?this.flex=n:void 0!==l&&(this.flex=l)}setColDef(t,i,s){this.colDef=t,this.userProvidedColDef=i,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.eventService.dispatchEvent(this.createColumnEvent("colDefChanged",s))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(t){this.parent=t}getParent(){return this.parent}setOriginalParent(t){this.originalParent=t}getOriginalParent(){return this.originalParent}initialise(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const t=this.gridOptionsService.get("suppressFieldDotNotation");this.fieldContainsDots=R(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!t,this.tooltipFieldContainsDots=R(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!t}initMinAndMaxWidths(){const t=this.colDef;this.minWidth=this.columnUtils.calculateColMinWidth(t),this.maxWidth=this.columnUtils.calculateColMaxWidth(t)}initTooltip(){this.tooltipEnabled=R(this.colDef.tooltipField)||R(this.colDef.tooltipValueGetter)||R(this.colDef.tooltipComponent)}resetActualWidth(t){const i=this.columnUtils.calculateColInitialWidth(this.colDef);this.setActualWidth(i,t,!0)}isEmptyGroup(){return!1}isRowGroupDisplayed(t){return!G(this.colDef)&&!G(this.colDef.showRowGroup)&&(!0===this.colDef.showRowGroup||this.colDef.showRowGroup===t)}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}addEventListener(t,i){var s,o;this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new kr(this.frameworkOverrides));const r=null!=(o=null==(s=this.frameworkEventListenerService)?void 0:s.wrap(i))?o:i;this.eventService.addEventListener(t,r)}removeEventListener(t,i){var s,o;const r=null!=(o=null==(s=this.frameworkEventListenerService)?void 0:s.unwrap(i))?o:i;this.eventService.removeEventListener(t,r)}createColumnFunctionCallbackParams(t){return this.gridOptionsService.addGridCommonParams({node:t,data:t.data,column:this,colDef:this.colDef})}isSuppressNavigable(t){if("boolean"==typeof this.colDef.suppressNavigable)return this.colDef.suppressNavigable;if("function"==typeof this.colDef.suppressNavigable){const i=this.createColumnFunctionCallbackParams(t);return(0,this.colDef.suppressNavigable)(i)}return!1}isCellEditable(t){return!(t.group&&!this.gridOptionsService.get("enableGroupEdit"))&&this.isColumnFunc(t,this.colDef.editable)}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(t){return this.isColumnFunc(t,this.colDef.rowDrag)}isDndSource(t){return this.isColumnFunc(t,this.colDef.dndSource)}isCellCheckboxSelection(t){return this.isColumnFunc(t,this.colDef.checkboxSelection)}isSuppressPaste(t){return this.isColumnFunc(t,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(t){var i;return null!=(i=this.colDef[t])?i:Kc[t]}isColumnFunc(t,i){return"boolean"==typeof i?i:"function"==typeof i&&i(this.createColumnFunctionCallbackParams(t))}setMoving(t,i){this.moving=t,this.eventService.dispatchEvent(this.createColumnEvent("movingChanged",i))}createColumnEvent(t,i){return this.gridOptionsService.addGridCommonParams({type:t,column:this,columns:[this],source:i})}isMoving(){return this.moving}getSort(){return this.sort}setSort(t,i){this.sort!==t&&(this.sort=t,this.eventService.dispatchEvent(this.createColumnEvent("sortChanged",i))),this.dispatchStateUpdatedEvent("sort")}setMenuVisible(t,i){this.menuVisible!==t&&(this.menuVisible=t,this.eventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",i)))}isMenuVisible(){return this.menuVisible}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return"asc"===this.sort}isSortDescending(){return"desc"===this.sort}isSortNone(){return G(this.sort)}isSorting(){return R(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(t){this.sortIndex=t,this.dispatchStateUpdatedEvent("sortIndex")}setAggFunc(t){this.aggFunc=t,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(t,i){this.oldLeft=this.left,this.left!==t&&(this.left=t,this.eventService.dispatchEvent(this.createColumnEvent("leftChanged",i)))}isFilterActive(){return this.filterActive}setFilterActive(t,i,s){this.filterActive!==t&&(this.filterActive=t,this.eventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",i)));const o=this.createColumnEvent("filterChanged",i);s&&We(o,s),this.eventService.dispatchEvent(o)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(t){this.pinned=!0===t||"left"===t?"left":"right"===t?"right":null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(t,i){this.firstRightPinned!==t&&(this.firstRightPinned=t,this.eventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",i)))}setLastLeftPinned(t,i){this.lastLeftPinned!==t&&(this.lastLeftPinned=t,this.eventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",i)))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return"left"===this.pinned||"right"===this.pinned}isPinnedLeft(){return"left"===this.pinned}isPinnedRight(){return"right"===this.pinned}getPinned(){return this.pinned}setVisible(t,i){const s=!0===t;this.visible!==s&&(this.visible=s,this.eventService.dispatchEvent(this.createColumnEvent("visibleChanged",i))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const t=this.getColDef();
1return!t.suppressSpanHeaderHeight&&!t.autoHeaderHeight}getColumnGroupPaddingInfo(){let t=this.getParent();if(!t||!t.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const i=t.getPaddingLevel()+1;let s=!0;for(;t;){if(!t.isPadding()){s=!1;break}t=t.getParent()}return{numberOfParents:i,isSpanningTotal:s}}getColDef(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getDefinition(){return this.colDef}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(t){const i=t!==this.autoHeaderHeight;return this.autoHeaderHeight=t,i}createBaseColDefParams(t){return this.gridOptionsService.addGridCommonParams({node:t,data:t.data,colDef:this.colDef,column:this})}getColSpan(t){if(G(this.colDef.colSpan))return 1;const i=this.createBaseColDefParams(t),s=this.colDef.colSpan(i);return Math.max(s,1)}getRowSpan(t){if(G(this.colDef.rowSpan))return 1;const i=this.createBaseColDefParams(t),s=this.colDef.rowSpan(i);return Math.max(s,1)}setActualWidth(t,i,s=!1){null!=this.minWidth&&(t=Math.max(t,this.minWidth)),null!=this.maxWidth&&(t=Math.min(t,this.maxWidth)),this.actualWidth!==t&&(this.actualWidth=t,this.flex&&"flex"!==i&&"gridInitializing"!==i&&(this.flex=null),s||this.fireColumnWidthChangedEvent(i)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(t){this.eventService.dispatchEvent(this.createColumnEvent("widthChanged",t))}isGreaterThanMax(t){return null!=this.maxWidth&&t>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(t){this.flex!==t&&(this.flex=t),this.dispatchStateUpdatedEvent("flex")}setMinimum(t){R(this.minWidth)&&this.setActualWidth(this.minWidth,t)}setRowGroupActive(t,i){this.rowGroupActive!==t&&(this.rowGroupActive=t,this.eventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",i))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(t,i){this.pivotActive!==t&&(this.pivotActive=t,this.eventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",i))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(t,i){this.aggregationActive!==t&&(this.aggregationActive=t,this.eventService.dispatchEvent(this.createColumnEvent("columnValueChanged",i)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return!0===this.colDef.enablePivot}isAllowValue(){return!0===this.colDef.enableValue}isAllowRowGroup(){return!0===this.colDef.enableRowGroup}getMenuTabs(t){x("As of v31.1, 'getMenuTabs' is deprecated. Use 'getColDef().menuTabs ?? defaultValues' instead.");let i=this.getColDef().menuTabs;return null==i&&(i=t),i}dispatchStateUpdatedEvent(t){this.eventService.dispatchEvent({type:hu.EVENT_STATE_UPDATED,key:t})}};ue.EVENT_MOVING_CHANGED="movingChanged",ue.EVENT_LEFT_CHANGED="leftChanged",ue.EVENT_WIDTH_CHANGED="widthChanged",ue.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged",ue.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged",ue.EVENT_VISIBLE_CHANGED="visibleChanged",ue.EVENT_FILTER_CHANGED="filterChanged",ue.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged",ue.EVENT_SORT_CHANGED="sortChanged",ue.EVENT_COL_DEF_CHANGED="colDefChanged",ue.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged",ue.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged",ue.EVENT_PIVOT_CHANGED="columnPivotChanged",ue.EVENT_VALUE_CHANGED="columnValueChanged",ue.EVENT_STATE_UPDATED="columnStateUpdated",u([f("gridOptionsService")],ue.prototype,"gridOptionsService",2),u([f("columnUtils")],ue.prototype,"columnUtils",2),u([f("columnHoverService")],ue.prototype,"columnHoverService",2),u([f("frameworkOverrides")],ue.prototype,"frameworkOverrides",2),u([b],ue.prototype,"initialise",1);var Z=ue,Ao=class go{constructor(t,i,s,o){this.localEventService=new ot,this.expandable=!1,this.instanceId=Ul(),this.expandableListenerRemoveCallback=null,this.colGroupDef=t,this.groupId=i,this.expanded=!!t&&!!t.openByDefault,this.padding=s,this.level=o}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0)}reset(t,i){this.colGroupDef=t,this.level=i,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(t){this.originalParent=t}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return!!this.children&&this.children.some(t=>t.isVisible())}isPadding(){return this.padding}setExpanded(t){this.expanded=void 0!==t&&t,this.localEventService.dispatchEvent({type:go.EVENT_EXPANDED_CHANGED})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(t){this.children=t}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const t=[];return this.addLeafColumns(t),t}
1addLeafColumns(t){this.children&&this.children.forEach(i=>{i instanceof Z?t.push(i):i instanceof go&&i.addLeafColumns(t)})}getColumnGroupShow(){const t=this.colGroupDef;if(t)return t.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const t=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach(i=>i.addEventListener("visibleChanged",t)),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach(i=>i.removeEventListener("visibleChanged",t)),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let t=!1,i=!1,s=!1;const o=this.findChildrenRemovingPadding();for(let n=0,l=o.length;n<l;n++){const a=o[n];if(!a.isVisible())continue;const c=a.getColumnGroupShow();"open"===c?(t=!0,s=!0):"closed"===c?(i=!0,s=!0):(t=!0,i=!0)}const r=t&&i&&s;this.expandable!==r&&(this.expandable=r,this.localEventService.dispatchEvent({type:go.EVENT_EXPANDABLE_CHANGED}))}findChildrenRemovingPadding(){const t=[],i=s=>{s.forEach(o=>{o instanceof go&&o.isPadding()?i(o.children):t.push(o)})};return i(this.children),t}onColumnVisibilityChanged(){this.setExpandable()}addEventListener(t,i){this.localEventService.addEventListener(t,i)}removeEventListener(t,i){this.localEventService.removeEventListener(t,i)}};Ao.EVENT_EXPANDED_CHANGED="expandedChanged",Ao.EVENT_EXPANDABLE_CHANGED="expandableChanged",u([Ae],Ao.prototype,"destroy",1);var le=Ao,qc={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},zl={};Ce(zl,{addSafePassiveEventListener:()=>ea,createEventPath:()=>Zl,getCtrlForEventTarget:()=>Fo,getEventPath:()=>Jl,isElementInEventPath:()=>Oo,isEventSupported:()=>zr,isStopPropagationForAgGrid:()=>nt,stopPropagationForAgGrid:()=>rt});var Kl={};function $l(e){return null!=e&&e.length>0}function K(e){if(e&&e.length)return e[e.length-1]}function pt(e,t,i){return null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every((s,o)=>i?i(s,t[o]):t[o]===s)}function Yc(e,t){return pt(e,t)}function ql(e){return e.sort((t,i)=>t-i)}function jc(e,t){if(e)for(let i=e.length-2;i>=0;i--)e[i]===t&&e[i+1]===t&&e.splice(i+1,1)}function Vr(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function Le(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function Yl(e,t){for(let i=0;i<t.length;i++)Vr(e,t[i])}function jl(e,t){for(let i=0;i<t.length;i++)Le(e,t[i])}function ws(e,t,i){e.splice(i,0,t)}function Hr(e,t,i){if(null!=e&&null!=t)for(let s=t.length-1;s>=0;s--)ws(e,t[s],i)}function Br(e,t,i){jl(e,t),t.slice().reverse().forEach(s=>ws(e,s,i))}function Ue(e,t){return e.indexOf(t)>-1}function Ql(e){return[].concat.apply([],e)}function Wr(e,t){null==t||null==e||t.forEach(i=>e.push(i))}function Qc(e){return e.map(vs)}function Xc(e,t){if(null!=e)for(let i=e.length-1;i>=0;i--)t(e[i],i)}Ce(Kl,{areEqual:()=>pt,existsAndNotEmpty:()=>$l,flatten:()=>Ql,forEachReverse:()=>Xc,includes:()=>Ue,insertArrayIntoArray:()=>Hr,insertIntoArray:()=>ws,last:()=>K,moveInArray:()=>Br,pushAll:()=>Wr,removeAllFromArray:()=>jl,removeAllFromUnorderedArray:()=>Yl,removeFromArray:()=>Le,removeFromUnorderedArray:()=>Vr,removeRepeatsFromArray:()=>jc,shallowCompare:()=>Yc,sortNumerically:()=>ql,toStrings:()=>Qc});var Xl="__ag_Grid_Stop_Propagation",Zc=["touchstart","touchend","touchmove","touchcancel","scroll"],Ur={};function rt(e){e[Xl]=!0}function nt(e){return!0===e[Xl]}var zr=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return i=>{if("boolean"==typeof Ur[i])return Ur[i];const s=document.createElement(e[i]||"div");return Ur[i="on"+i]=i in s}})();function Fo(e,t,i){let s=t;for(;s;){const o=e.getDomData(s,i);if(o)return o;s=s.parentElement}return null}function Oo(e,t){return!(!t||!e)&&Jl(t).indexOf(e)>=0}function Zl(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function Jl(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():Zl(t)}function ea(e,t,i,s){const r=Ue(Zc,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,s,r)}var bt=class pu{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.lastChangeSetIdLookup={},this.propertyListenerId=0,this.isAlive=()=>!this.destroyed}getFrameworkOverrides(){return this.frameworkOverrides}getContext(){return this.context}destroy(){this.destroyFunctions.forEach(t=>t()),this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchEvent({type:pu.EVENT_DESTROYED})}addEventListener(t,i){this.localEventService||(this.localEventService=new ot),this.localEventService.addEventListener(t,i)}removeEventListener(t,i){this.localEventService&&this.localEventService.removeEventListener(t,i)}dispatchEvent(t){this.localEventService&&this.localEventService.dispatchEvent(t)}addManagedListener(t,i,s){if(this.destroyed)return;t instanceof HTMLElement?ea(this.getFrameworkOverrides(),t,i,s):t.addEventListener(i,s);const o=()=>(t.removeEventListener(i,s),this.destroyFunctions=this.destroyFunctions.filter(r=>r!==o),null);return this.destroyFunctions.push(o),o}setupGridOptionListener(t,i){this.gridOptionsService.addEventListener(t,i);const s=()=>(this.gridOptionsService.removeEventListener(t,i),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),null);return this.destroyFunctions.push(s),s}addManagedPropertyListener(t,i){return this.destroyed?()=>
1null:this.setupGridOptionListener(t,i)}addManagedPropertyListeners(t,i){if(this.destroyed)return;const s=t.join("-")+this.propertyListenerId++,o=r=>{if(r.changeSet){if(r.changeSet&&r.changeSet.id===this.lastChangeSetIdLookup[s])return;this.lastChangeSetIdLookup[s]=r.changeSet.id}i({type:"gridPropertyChanged",changeSet:r.changeSet,source:r.source})};t.forEach(r=>this.setupGridOptionListener(r,o))}addDestroyFunc(t){this.isAlive()?this.destroyFunctions.push(t):t()}createManagedBean(t,i){const s=this.createBean(t,i);return this.addDestroyFunc(this.destroyBean.bind(this,t,i)),s}createBean(t,i,s){return(i||this.getContext()).createBean(t,s)}destroyBean(t,i){return(i||this.getContext()).destroyBean(t)}destroyBeans(t,i){return t&&t.forEach(s=>this.destroyBean(s,i)),[]}};bt.EVENT_DESTROYED="destroyed",u([f("frameworkOverrides")],bt.prototype,"frameworkOverrides",2),u([f("context")],bt.prototype,"context",2),u([f("eventService")],bt.prototype,"eventService",2),u([f("gridOptionsService")],bt.prototype,"gridOptionsService",2),u([f("localeService")],bt.prototype,"localeService",2),u([f("environment")],bt.prototype,"environment",2),u([Ae],bt.prototype,"destroy",1);var T=bt,_i=class extends T{setBeans(e){this.logger=e.create("ColumnFactory")}createColumnTree(e,t,i,s){const o=new Bc,{existingCols:r,existingGroups:n,existingColKeys:l}=this.extractExistingTreeData(i);o.addExistingKeys(l);const a=this.recursivelyCreateColumns(e,0,t,r,o,n,s),c=this.findMaxDept(a,0);this.logger.log("Number of levels for grouped columns is "+c);const h=this.balanceColumnTree(a,0,c,o);return this.columnUtils.depthFirstOriginalTreeSearch(null,h,(m,C)=>{m instanceof le&&m.setupExpandable(),m.setOriginalParent(C)}),{columnTree:h,treeDept:c}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&this.columnUtils.depthFirstOriginalTreeSearch(null,e,o=>{if(o instanceof le)i.push(o);else{const r=o;s.push(r.getId()),t.push(r)}}),{existingCols:t,existingGroups:i,existingColKeys:s}}createForAutoGroups(e,t){return e.map(i=>this.createAutoGroupTreeItem(t,i))}createAutoGroupTreeItem(e,t){const i=this.findDepth(e);let s=t;for(let o=i-1;o>=0;o--){const r=new le(null,`FAKE_PATH_${t.getId()}}_${o}`,!0,o);this.createBean(r),r.setChildren([s]),s.setOriginalParent(r),s=r}return 0===i&&t.setOriginalParent(null),s}findDepth(e){let t=0,i=e;for(;i&&i[0]&&i[0]instanceof le;)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,s){const o=[];for(let r=0;r<e.length;r++){const n=e[r];if(n instanceof le){const l=n,a=this.balanceColumnTree(l.getChildren(),t+1,i,s);l.setChildren(a),o.push(l)}else{let l,a;for(let c=i-1;c>=t;c--){const h=s.getUniqueKey(null,null),g=this.createMergedColGroupDef(null),m=new le(g,h,!0,t);this.createBean(m),a&&a.setChildren([m]),a=m,l||(l=a)}if(l&&a){if(o.push(l),e.some(h=>h instanceof le)){a.setChildren([n]);continue}a.setChildren(e);break}o.push(n)}}return o}findMaxDept(e,t){let i=t;for(let s=0;s<e.length;s++){const o=e[s];if(o instanceof le){const n=this.findMaxDept(o.getChildren(),t+1);i<n&&(i=n)}}return i}recursivelyCreateColumns(e,t,i,s,o,r,n){if(!e)return[];const l=new Array(e.length);for(let a=0;a<l.length;a++){const c=e[a];l[a]=this.isColumnGroup(c)?this.createColumnGroup(i,c,t,s,o,r,n):this.createColumn(i,c,s,o,n)}return l}createColumnGroup(e,t,i,s,o,r,n){const l=this.createMergedColGroupDef(t),a=o.getUniqueKey(l.groupId||null,null),c=new le(l,a,!1,i);this.createBean(c);const h=this.findExistingGroup(t,r);h&&r.splice(h.idx,1);let g=h?.group;g&&c.setExpanded(g.isExpanded());const m=this.recursivelyCreateColumns(l.children,i+1,e,s,o,r,n);return c.setChildren(m),c}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gridOptionsService.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,s,o){const r=this.findExistingColumn(t,i);r&&i?.splice(r.idx,1);let n=r?.column;if(n){const l=this.addColumnDefaultAndTypes(t,n.getColId());n.setColDef(l,t,o),this.applyColumnState(n,l,o)}else{const l=s.getUniqueKey(t.colId,t.field),a=this.addColumnDefaultAndTypes(t,l);n=new Z(a,t,l,e),this.context.createBean(n)}return this.dataTypeService.addColumnListeners(n),n}applyColumnState(e,t,i){const s=Gt(t.flex);if(void 0!==s&&e.setFlex(s),e.getFlex()<=0){const l=Gt(t.width);if(null!=l)e.setActualWidth(l,i);else{const a=e.getActualWidth();e.setActualWidth(a,i)}}void 0!==t.sort&&e.setSort("asc"==t.sort||"desc"==t.sort?t.sort:void 0,i);const r=Gt(t.sortIndex);void 0!==r&&e.setSortIndex(r);const n=yo(t.hide);void 0!==n&&e.setVisible(!n,i),void 0!==t.pinned&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let i=0;i<t.length;i++){const s=t[i].getUserProvidedColDef();if(s)if(null==e.colId){if(null==e.field){if(s===e)return{idx:i,column:t[i]}}else if(s.field===e.field)return{idx:i,column:t[i]}}else if(t[i].getId()===e.colId)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(null!=e.groupId)for(let s=0;s<t.length;s++){const o=t[s];if(o.getColGroupDef()&&o.getId()===e.groupId)return{idx:s,group:o}}}addColumnDefaultAndTypes(e,t){const i={};We(i,this.gridOptionsService.get("defaultColDef"),!1,!0);const o=this.dataTypeService.updateColDefAndGetColumnType(i,e,t);o&&this.assignColumnTypes(o,i),We(i,e,!1,!0);const r=this.gridOptionsService.get("autoGroupColumnDef"),n=this.gridOptionsService.isColumnsSortingCoupledToGroup();return e.rowGroup&&r&&n&&We(i,{sort:r.sort,initialSort:r.initialSort},!1,!0),this.dataTypeService.validateColDef(i),i}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},qc);
1Se(this.gridOptionsService.get("columnTypes")||{},(o,r)=>{o in i?console.warn(`AG Grid: the column type '${o}' is a default column type and cannot be overridden.`):(r.type&&x("Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type."),i[o]=r)}),e.forEach(o=>{const r=i[o.trim()];r?We(t,r,!1,!0):console.warn("AG Grid: colDef.type '"+o+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return void 0!==e.children}};u([f("columnUtils")],_i.prototype,"columnUtils",2),u([f("dataTypeService")],_i.prototype,"dataTypeService",2),u([it(0,qe("loggerFactory"))],_i.prototype,"setBeans",1),_i=u([O("columnFactory")],_i);var Mo=class Rt{constructor(t,i,s,o){this.displayedChildren=[],this.localEventService=new ot,this.groupId=i,this.partId=s,this.providedColumnGroup=t,this.pinned=o}static createUniqueId(t,i){return t+"_"+i}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(t){this.parent=t}getUniqueId(){return Rt.createUniqueId(this.groupId,this.partId)}isEmptyGroup(){return 0===this.displayedChildren.length}isMoving(){const t=this.getProvidedColumnGroup().getLeafColumns();return!(!t||0===t.length)&&t.every(i=>i.isMoving())}checkLeft(){if(this.displayedChildren.forEach(t=>{t instanceof Rt&&t.checkLeft()}),this.displayedChildren.length>0)if(this.gridOptionsService.get("enableRtl")){const i=K(this.displayedChildren).getLeft();this.setLeft(i)}else{const t=this.displayedChildren[0].getLeft();this.setLeft(t)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(t){this.oldLeft=this.left,this.left!==t&&(this.left=t,this.localEventService.dispatchEvent(this.createAgEvent(Rt.EVENT_LEFT_CHANGED)))}getPinned(){return this.pinned}createAgEvent(t){return{type:t}}addEventListener(t,i){this.localEventService.addEventListener(t,i)}removeEventListener(t,i){this.localEventService.removeEventListener(t,i)}getGroupId(){return this.groupId}getPartId(){return this.partId}isChildInThisGroupDeepSearch(t){let i=!1;return this.children.forEach(s=>{t===s&&(i=!0),s instanceof Rt&&s.isChildInThisGroupDeepSearch(t)&&(i=!0)}),i}getActualWidth(){let t=0;return this.displayedChildren&&this.displayedChildren.forEach(i=>{t+=i.getActualWidth()}),t}isResizable(){if(!this.displayedChildren)return!1;let t=!1;return this.displayedChildren.forEach(i=>{i.isResizable()&&(t=!0)}),t}getMinWidth(){let t=0;return this.displayedChildren.forEach(i=>{t+=i.getMinWidth()||0}),t}addChild(t){this.children||(this.children=[]),this.children.push(t)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const t=[];return this.addLeafColumns(t),t}getDisplayedLeafColumns(){const t=[];return this.addDisplayedLeafColumns(t),t}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(t){this.providedColumnGroup.setExpanded(t)}addDisplayedLeafColumns(t){this.displayedChildren.forEach(i=>{i instanceof Z?t.push(i):i instanceof Rt&&i.addDisplayedLeafColumns(t)})}addLeafColumns(t){this.children.forEach(i=>{i instanceof Z?t.push(i):i instanceof Rt&&i.addLeafColumns(t)})}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const t=this.getParent();return this.isPadding()&&t&&t.isPadding()?1+t.getPaddingLevel():0}calculateDisplayedColumns(){this.displayedChildren=[];let t=this;for(;null!=t&&t.isPadding();)t=t.getParent();if(!t||!t.providedColumnGroup.isExpandable())return this.displayedChildren=this.children,void this.localEventService.dispatchEvent(this.createAgEvent(Rt.EVENT_DISPLAYED_CHILDREN_CHANGED));
1this.children.forEach(s=>{if(!(s instanceof Rt)||s.displayedChildren&&s.displayedChildren.length)switch(s.getColumnGroupShow()){case"open":t.providedColumnGroup.isExpanded()&&this.displayedChildren.push(s);break;case"closed":t.providedColumnGroup.isExpanded()||this.displayedChildren.push(s);break;default:this.displayedChildren.push(s)}}),this.localEventService.dispatchEvent(this.createAgEvent(Rt.EVENT_DISPLAYED_CHILDREN_CHANGED))}};Mo.EVENT_LEFT_CHANGED="leftChanged",Mo.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged",u([f("gridOptionsService")],Mo.prototype,"gridOptionsService",2);var he=Mo,p=class{};p.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged",p.EVENT_NEW_COLUMNS_LOADED="newColumnsLoaded",p.EVENT_COLUMN_PIVOT_MODE_CHANGED="columnPivotModeChanged",p.EVENT_PIVOT_MAX_COLUMNS_EXCEEDED="pivotMaxColumnsExceeded",p.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged",p.EVENT_EXPAND_COLLAPSE_ALL="expandOrCollapseAll",p.EVENT_COLUMN_PIVOT_CHANGED="columnPivotChanged",p.EVENT_GRID_COLUMNS_CHANGED="gridColumnsChanged",p.EVENT_COLUMN_VALUE_CHANGED="columnValueChanged",p.EVENT_COLUMN_MOVED="columnMoved",p.EVENT_COLUMN_VISIBLE="columnVisible",p.EVENT_COLUMN_PINNED="columnPinned",p.EVENT_COLUMN_GROUP_OPENED="columnGroupOpened",p.EVENT_COLUMN_RESIZED="columnResized",p.EVENT_DISPLAYED_COLUMNS_CHANGED="displayedColumnsChanged",p.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED="suppressMovableColumns",p.EVENT_SUPPRESS_MENU_HIDE_CHANGED="suppressMenuHide",p.EVENT_SUPPRESS_FIELD_DOT_NOTATION="suppressFieldDotNotation",p.EVENT_VIRTUAL_COLUMNS_CHANGED="virtualColumnsChanged",p.EVENT_COLUMN_HEADER_MOUSE_OVER="columnHeaderMouseOver",p.EVENT_COLUMN_HEADER_MOUSE_LEAVE="columnHeaderMouseLeave",p.EVENT_COLUMN_HEADER_CLICKED="columnHeaderClicked",p.EVENT_COLUMN_HEADER_CONTEXT_MENU="columnHeaderContextMenu",p.EVENT_ASYNC_TRANSACTIONS_FLUSHED="asyncTransactionsFlushed",p.EVENT_ROW_GROUP_OPENED="rowGroupOpened",p.EVENT_ROW_DATA_UPDATED="rowDataUpdated",p.EVENT_PINNED_ROW_DATA_CHANGED="pinnedRowDataChanged",p.EVENT_RANGE_SELECTION_CHANGED="rangeSelectionChanged",p.EVENT_CHART_CREATED="chartCreated",p.EVENT_CHART_RANGE_SELECTION_CHANGED="chartRangeSelectionChanged",p.EVENT_CHART_OPTIONS_CHANGED="chartOptionsChanged",p.EVENT_CHART_DESTROYED="chartDestroyed",p.EVENT_TOOL_PANEL_VISIBLE_CHANGED="toolPanelVisibleChanged",p.EVENT_TOOL_PANEL_SIZE_CHANGED="toolPanelSizeChanged",p.EVENT_COLUMN_PANEL_ITEM_DRAG_START="columnPanelItemDragStart",p.EVENT_COLUMN_PANEL_ITEM_DRAG_END="columnPanelItemDragEnd",p.EVENT_MODEL_UPDATED="modelUpdated",p.EVENT_CUT_START="cutStart",p.EVENT_CUT_END="cutEnd",p.EVENT_PASTE_START="pasteStart",p.EVENT_PASTE_END="pasteEnd",p.EVENT_FILL_START="fillStart",p.EVENT_FILL_END="fillEnd",p.EVENT_RANGE_DELETE_START="rangeDeleteStart",p.EVENT_RANGE_DELETE_END="rangeDeleteEnd",p.EVENT_UNDO_STARTED="undoStarted",p.EVENT_UNDO_ENDED="undoEnded",p.EVENT_REDO_STARTED="redoStarted",p.EVENT_REDO_ENDED="redoEnded",p.EVENT_KEY_SHORTCUT_CHANGED_CELL_START="keyShortcutChangedCellStart",p.EVENT_KEY_SHORTCUT_CHANGED_CELL_END="keyShortcutChangedCellEnd",p.EVENT_CELL_CLICKED="cellClicked",p.EVENT_CELL_DOUBLE_CLICKED="cellDoubleClicked",p.EVENT_CELL_MOUSE_DOWN="cellMouseDown",p.EVENT_CELL_CONTEXT_MENU="cellContextMenu",p.EVENT_CELL_VALUE_CHANGED="cellValueChanged",p.EVENT_CELL_EDIT_REQUEST="cellEditRequest",p.EVENT_ROW_VALUE_CHANGED="rowValueChanged",p.EVENT_CELL_FOCUSED="cellFocused",p.EVENT_CELL_FOCUS_CLEARED="cellFocusCleared",p.EVENT_FULL_WIDTH_ROW_FOCUSED="fullWidthRowFocused",p.EVENT_ROW_SELECTED="rowSelected",p.EVENT_SELECTION_CHANGED="selectionChanged",p.EVENT_TOOLTIP_SHOW="tooltipShow",p.EVENT_TOOLTIP_HIDE="tooltipHide",p.EVENT_CELL_KEY_DOWN="cellKeyDown",p.EVENT_CELL_MOUSE_OVER="cellMouseOver",p.EVENT_CELL_MOUSE_OUT="cellMouseOut",p.EVENT_FILTER_CHANGED="filterChanged",p.EVENT_FILTER_MODIFIED="filterModified",p.EVENT_FILTER_OPENED="filterOpened",p.EVENT_ADVANCED_FILTER_BUILDER_VISIBLE_CHANGED="advancedFilterBuilderVisibleChanged",p.EVENT_SORT_CHANGED="sortChanged",p.EVENT_VIRTUAL_ROW_REMOVED="virtualRowRemoved",p.EVENT_ROW_CLICKED="rowClicked",p.EVENT_ROW_DOUBLE_CLICKED="rowDoubleClicked",p.EVENT_GRID_READY="gridReady",p.EVENT_GRID_PRE_DESTROYED="gridPreDestroyed",p.EVENT_GRID_SIZE_CHANGED="gridSizeChanged",p.EVENT_VIEWPORT_CHANGED="viewportChanged",p.EVENT_SCROLLBAR_WIDTH_CHANGED="scrollbarWidthChanged",p.EVENT_FIRST_DATA_RENDERED="firstDataRendered",p.EVENT_DRAG_STARTED="dragStarted",p.EVENT_DRAG_STOPPED="dragStopped",p.EVENT_CHECKBOX_CHANGED="checkboxChanged",p.EVENT_ROW_EDITING_STARTED="rowEditingStarted",p.EVENT_ROW_EDITING_STOPPED="rowEditingStopped",p.EVENT_CELL_EDITING_STARTED="cellEditingStarted",p.EVENT_CELL_EDITING_STOPPED="cellEditingStopped",p.EVENT_BODY_SCROLL="bodyScroll",p.EVENT_BODY_SCROLL_END="bodyScrollEnd",p.EVENT_HEIGHT_SCALE_CHANGED="heightScaleChanged",p.EVENT_PAGINATION_CHANGED="paginationChanged",p.EVENT_COMPONENT_STATE_CHANGED="componentStateChanged",p.EVENT_STORE_REFRESHED="storeRefreshed",p.EVENT_STATE_UPDATED="stateUpdated",p.EVENT_COLUMN_MENU_VISIBLE_CHANGED="columnMenuVisibleChanged",p.EVENT_BODY_HEIGHT_CHANGED="bodyHeightChanged",p.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED="columnContainerWidthChanged",p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED="displayedColumnsWidthChanged",p.EVENT_SCROLL_VISIBILITY_CHANGED="scrollVisibilityChanged",p.EVENT_COLUMN_HOVER_CHANGED="columnHoverChanged",p.EVENT_FLASH_CELLS="flashCells",p.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED="paginationPixelOff
1setChanged",p.EVENT_DISPLAYED_ROWS_CHANGED="displayedRowsChanged",p.EVENT_LEFT_PINNED_WIDTH_CHANGED="leftPinnedWidthChanged",p.EVENT_RIGHT_PINNED_WIDTH_CHANGED="rightPinnedWidthChanged",p.EVENT_ROW_CONTAINER_HEIGHT_CHANGED="rowContainerHeightChanged",p.EVENT_HEADER_HEIGHT_CHANGED="headerHeightChanged",p.EVENT_COLUMN_HEADER_HEIGHT_CHANGED="columnHeaderHeightChanged",p.EVENT_ROW_DRAG_ENTER="rowDragEnter",p.EVENT_ROW_DRAG_MOVE="rowDragMove",p.EVENT_ROW_DRAG_LEAVE="rowDragLeave",p.EVENT_ROW_DRAG_END="rowDragEnd",p.EVENT_GRID_STYLES_CHANGED="gridStylesChanged",p.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST="columnRowGroupChangeRequest",p.EVENT_COLUMN_PIVOT_CHANGE_REQUEST="columnPivotChangeRequest",p.EVENT_COLUMN_VALUE_CHANGE_REQUEST="columnValueChangeRequest",p.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST="columnAggFuncChangeRequest",p.EVENT_STORE_UPDATED="storeUpdated",p.EVENT_FILTER_DESTROYED="filterDestroyed",p.EVENT_ROW_DATA_UPDATE_STARTED="rowDataUpdateStarted",p.EVENT_ROW_COUNT_READY="rowCountReady",p.EVENT_ADVANCED_FILTER_ENABLED_CHANGED="advancedFilterEnabledChanged",p.EVENT_DATA_TYPES_INFERRED="dataTypesInferred",p.EVENT_FIELD_VALUE_CHANGED="fieldValueChanged",p.EVENT_FIELD_PICKER_VALUE_SELECTED="fieldPickerValueSelected",p.EVENT_SIDE_BAR_UPDATED="sideBarUpdated";var Io=new Set([p.EVENT_GRID_PRE_DESTROYED]),ta=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return i="number"!=typeof t?0:t+1,this.existingIds[e]=i,i}},xi="ag-Grid-AutoColumn",Ss=class extends T{createAutoGroupColumns(e){const t=[],i=this.gridOptionsService.get("treeData");let s=this.gridOptionsService.isGroupMultiAutoColumn();return i&&s&&(console.warn('AG Grid: you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),s=!1),s?e.forEach((o,r)=>{t.push(this.createOneAutoGroupColumn(o,r))}):t.push(this.createOneAutoGroupColumn()),t}updateAutoGroupColumns(e,t){e.forEach((i,s)=>this.updateOneAutoGroupColumn(i,s,t))}createOneAutoGroupColumn(e,t){let i;i=e?`${xi}-${e.getId()}`:xi;const s=this.createAutoGroupColDef(i,e,t);s.colId=i;const o=new Z(s,null,i,!0);return this.context.createBean(o),o}updateOneAutoGroupColumn(e,t,i){const s=e.getColDef(),o="string"==typeof s.showRowGroup?s.showRowGroup:void 0,r=null!=o?this.columnModel.getPrimaryColumn(o):void 0,n=this.createAutoGroupColDef(e.getId(),r??void 0,t);e.setColDef(n,null,i),this.columnFactory.applyColumnState(e,n,i)}createAutoGroupColDef(e,t,i){let s=this.createBaseColDef(t);return We(s,this.gridOptionsService.get("autoGroupColumnDef")),s=this.columnFactory.addColumnDefaultAndTypes(s,e),this.gridOptionsService.get("treeData")||G(s.field)&&G(s.valueGetter)&&G(s.filterValueGetter)&&"agGroupColumnFilter"!==s.filter&&(s.filter=!1),i&&i>0&&(s.headerCheckboxSelection=!1),this.gridOptionsService.isColumnsSortingCoupledToGroup()&&!(s.valueGetter||null!=s.field)&&(s.sortIndex=void 0,s.initialSort=void 0),s}createBaseColDef(e){const t=this.gridOptionsService.get("autoGroupColumnDef"),s={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(t&&(t.cellRenderer||t.cellRendererSelector)||(s.cellRenderer="agGroupCellRenderer"),e){const r=e.getColDef();Object.assign(s,{headerName:this.columnModel.getDisplayNameForColumn(e,"header"),headerValueGetter:r.headerValueGetter}),r.cellRenderer&&Object.assign(s,{cellRendererParams:{innerRenderer:r.cellRenderer,innerRendererParams:r.cellRendererParams}}),s.showRowGroup=e.getColId()}else s.showRowGroup=!0;return s}};u([f("columnModel")],Ss.prototype,"columnModel",2),u([f("columnFactory")],Ss.prototype,"columnFactory",2),Ss=u([O("autoGroupColService")],Ss);var ia={};Ce(ia,{camelCaseToHumanText:()=>sa,camelCaseToHyphenated:()=>oa,capitalise:()=>ih,escapeString:()=>pe,utf8_encode:()=>th});var Jc=/[&<>"']/g,eh={"&":"&","<":"<",">":">",'"':""","'":"'"};function th(e){const t=String.fromCharCode;function o(g,m){return t(g>>m&63|128)}function r(g){if(g>=0&&g<=31&&10!==g)return`_x${g.toString(16).toUpperCase().padStart(4,"0")}_`;if(!(4294967168&g))return t(g);let m="";return 4294965248&g?4294901760&g?4292870144&g||(m=t(g>>18&7|240),m+=o(g,12),m+=o(g,6)):(function s(g){if(g>=55296&&g<=57343)throw Error("Lone surrogate U+"+g.toString(16).toUpperCase()+" is not a scalar value")}(g),m=t(g>>12&15|224),m+=o(g,6)):m=t(g>>6&31|192),m+=t(63&g|128),m}const n=function i(g){const m=[];
1if(!g)return[];const C=g.length;let E,S,v=0;for(;v<C;)E=g.charCodeAt(v++),E>=55296&&E<=56319&&v<C?(S=g.charCodeAt(v++),56320==(64512&S)?m.push(((1023&E)<<10)+(1023&S)+65536):(m.push(E),v--)):m.push(E);return m}(e),l=n.length;let c,a=-1,h="";for(;++a<l;)c=n[a],h+=r(c);return h}function ih(e){return e[0].toUpperCase()+e.substring(1).toLowerCase()}function pe(e,t){if(null==e)return null;const i=e.toString().toString();return t?i:i.replace(Jc,s=>eh[s])}function sa(e){return e&&null!=e?e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z])([a-z])/g,"$1 $2$3").replace(/\./g," ").split(" ").map(o=>o.substring(0,1).toUpperCase()+(o.length>1?o.substring(1,o.length):"")).join(" "):null}function oa(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}var ra={};function kt(e){const t=new Map;return e.forEach(i=>t.set(i[0],i[1])),t}function sh(e,t){const i=new Map;return e.forEach(s=>i.set(t(s),s)),i}function oh(e){const t=[];return e.forEach((i,s)=>t.push(s)),t}Ce(ra,{convertToMap:()=>kt,keys:()=>oh,mapById:()=>sh});var fe=class extends T{constructor(){super(...arguments),this.primaryHeaderRowCount=0,this.secondaryHeaderRowCount=0,this.gridHeaderRowCount=0,this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.displayedColumnsAndGroupsMap={},this.viewportColumns=[],this.viewportColumnsHash="",this.headerViewportColumns=[],this.viewportColumnsCenter=[],this.headerViewportColumnsCenter=[],this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.autoHeightActiveAtLeastOnce=!1,this.rowGroupColumns=[],this.valueColumns=[],this.pivotColumns=[],this.ready=!1,this.changeEventsDispatching=!1,this.autoGroupsNeedBuilding=!1,this.forceRecreateAutoGroups=!1,this.pivotMode=!1,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}init(){this.suppressColumnVirtualisation=this.gridOptionsService.get("suppressColumnVirtualisation");const e=this.gridOptionsService.get("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],t=>this.buildAutoGroupColumns(Gi(t.source))),this.addManagedPropertyListener("autoGroupColumnDef",t=>this.onAutoGroupColumnDefChanged(Gi(t.source))),this.addManagedPropertyListeners(["defaultColDef","columnTypes","suppressFieldDotNotation"],t=>this.onSharedColDefChanged(Gi(t.source))),this.addManagedPropertyListener("pivotMode",t=>this.setPivotMode(this.gridOptionsService.get("pivotMode"),Gi(t.source))),this.addManagedListener(this.eventService,p.EVENT_FIRST_DATA_RENDERED,()=>this.onFirstDataRendered())}buildAutoGroupColumns(e){this.columnDefs&&(this.autoGroupsNeedBuilding=!0,this.forceRecreateAutoGroups=!0,this.updateGridColumns(),this.updateDisplayedColumns(e))}onAutoGroupColumnDefChanged(e){this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,e)}onSharedColDefChanged(e){this.gridColumns&&(this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,e),this.createColumnsFromColumnDefs(!0,e))}setColumnDefs(e,t){const i=!!this.columnDefs;this.columnDefs=e,this.createColumnsFromColumnDefs(i,t)}recreateColumnDefs(e){this.onSharedColDefChanged(e)}destroyOldColumns(e,t){const i={};if(!e)return;this.columnUtils.depthFirstOriginalTreeSearch(null,e,o=>{i[o.getInstanceId()]=o}),t&&this.columnUtils.depthFirstOriginalTreeSearch(null,t,o=>{i[o.getInstanceId()]=null});const s=Object.values(i).filter(o=>null!=o);this.destroyBeans(s)}destroyColumns(){this.destroyOldColumns(this.primaryColumnTree),this.destroyOldColumns(this.secondaryBalancedTree),this.destroyOldColumns(this.groupAutoColsBalancedTree)}createColumnsFromColumnDefs(e,t){const i=e?this.compareColumnStatesAndDispatchEvents(t):void 0;this.valueCache.expire(),this.autoGroupsNeedBuilding=!0;const s=this.primaryColumns,r=this.columnFactory.createColumnTree(this.columnDefs,!0,this.primaryColumnTree,t);this.destroyOldColumns(this.primaryColumnTree,r.columnTree),this.primaryColumnTree=r.columnTree,this.primaryHeaderRowCount=r.treeDept+1,this.primaryColumns=this.getColumnsFromTree(this.primaryColumnTree),this.primaryColumnsMap={},this.primaryColumns.forEach(a=>this.primaryColumnsMap[a.getId()]=a),this.extractRowGroupColumns(t,s),this.extractPivotColumns(t,s),this.extractValueColumns(t,s),this.ready=!0,(this.gridColsArePrimary||void 0===this.gridColsArePrimary||this.autoGroupsNeedBuilding)&&(this.updateGridColumns(),e&&this.gridColsArePrimary&&!this.gridOptionsService.get("maintainColumnOrder")&&this.orderGridColumnsLikePrimary(),this.updateDisplayedColumns(t),this.checkViewportColumns()),this.dispatchEverythingChanged(t),this.changeEventsDispat
1ching=!0,i&&i(),this.changeEventsDispatching=!1,this.dispatchNewColumnsLoaded(t)}shouldRowModelIgnoreRefresh(){return this.changeEventsDispatching}dispatchNewColumnsLoaded(e){this.eventService.dispatchEvent({type:p.EVENT_NEW_COLUMNS_LOADED,source:e}),"gridInitializing"===e&&this.onColumnsReady()}dispatchEverythingChanged(e){this.eventService.dispatchEvent({type:p.EVENT_COLUMN_EVERYTHING_CHANGED,source:e})}orderGridColumnsLikePrimary(){const e=this.primaryColumns;if(!e)return;const t=e.filter(s=>this.gridColumns.indexOf(s)>=0),i=this.gridColumns.filter(s=>t.indexOf(s)<0);this.gridColumns=[...i,...t],this.gridColumns=this.placeLockedColumns(this.gridColumns)}getAllDisplayedAutoHeightCols(){return this.displayedAutoHeightCols}setViewport(){this.gridOptionsService.get("enableRtl")?(this.viewportLeft=this.bodyWidth-this.scrollPosition-this.scrollWidth,this.viewportRight=this.bodyWidth-this.scrollPosition):(this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition)}getDisplayedColumnsStartingAt(e){let t=e;const i=[];for(;null!=t;)i.push(t),t=this.getDisplayedColAfter(t);return i}checkViewportColumns(e=!1){null!=this.displayedColumnsCenter&&this.extractViewport()&&this.eventService.dispatchEvent({type:p.EVENT_VIRTUAL_COLUMNS_CHANGED,afterScroll:e})}setViewportPosition(e,t,i=!1){(e!==this.scrollWidth||t!==this.scrollPosition||this.bodyWidthDirty)&&(this.scrollWidth=e,this.scrollPosition=t,this.bodyWidthDirty=!0,this.setViewport(),this.ready&&this.checkViewportColumns(i))}isPivotMode(){return this.pivotMode}isPivotSettingAllowed(e){return!e||!this.gridOptionsService.get("treeData")||(console.warn("AG Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'"),!1)}setPivotMode(e,t){e!==this.pivotMode&&this.isPivotSettingAllowed(this.pivotMode)&&(this.pivotMode=e,this.gridColumns)&&(this.autoGroupsNeedBuilding=!0,this.updateGridColumns(),this.updateDisplayedColumns(t),this.eventService.dispatchEvent({type:p.EVENT_COLUMN_PIVOT_MODE_CHANGED}))}getSecondaryPivotColumn(e,t){if(G(this.secondaryColumns))return null;const i=this.getPrimaryColumn(t);let s=null;return this.secondaryColumns.forEach(o=>{const r=o.getColDef().pivotKeys,n=o.getColDef().pivotValueColumn;pt(r,e)&&n===i&&(s=o)}),s}setBeans(e){this.logger=e.create("columnModel")}setFirstRightAndLastLeftPinned(e){let t,i;this.gridOptionsService.get("enableRtl")?(t=this.displayedColumnsLeft?this.displayedColumnsLeft[0]:null,i=this.displayedColumnsRight?K(this.displayedColumnsRight):null):(t=this.displayedColumnsLeft?K(this.displayedColumnsLeft):null,i=this.displayedColumnsRight?this.displayedColumnsRight[0]:null),this.gridColumns.forEach(s=>{s.setLastLeftPinned(s===t,e),s.setFirstRightPinned(s===i,e)})}autoSizeColumns(e){if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.autoSizeColumns(e));const{columns:t,skipHeader:i,skipHeaderGroups:s,stopAtGroup:o,source:r="api"}=e;this.animationFrameService.flushAllFrames();const n=[];let l=-1;const a=i??this.gridOptionsService.get("skipHeaderOnAutoSize"),c=s??a;for(;0!==l;)l=0,this.actionOnGridColumns(t,h=>{if(n.indexOf(h)>=0)return!1;const g=this.autoWidthCalculator.getPreferredWidthForColumn(h,a);if(g>0){const m=this.normaliseColumnWidth(h,g);h.setActualWidth(m,r),n.push(h),l++}return!0},r);c||this.autoSizeColumnGroupsByColumns(t,r,o),this.dispatchColumnResizedEvent(n,!0,"autosizeColumns")}dispatchColumnResizedEvent(e,t,i,s=null){e&&e.length&&this.eventService.dispatchEvent({type:p.EVENT_COLUMN_RESIZED,columns:e,column:1===e.length?e[0]:null,flexColumns:s,finished:t,source:i})}dispatchColumnChangedEvent(e,t,i){this.eventService.dispatchEvent({type:e,columns:t,column:t&&1==t.length?t[0]:null,source:i})}dispatchColumnMovedEvent(e){const{movedColumns:t,source:i,toIndex:s,finished:o}=e;this.eventService.dispatchEvent({type:p.EVENT_COLUMN_MOVED,columns:t,column:t&&1===t.length?t[0]:null,toIndex:s,finished:o,source:i})}dispatchColumnPinnedEvent(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,s=this.getCommonValue(e,r=>r.getPinned());this.eventService.dispatchEvent({type:p.EVENT_COLUMN_PINNED,pinned:s??null,columns:e,column:i,source:t})}dispatchColumnVisibleEvent(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,s=this.getCommonValue(e,r=>r.isVisible());this.eventService.dispatchEvent({type:p.EVENT_COLUMN_VISIBLE,visible:s,columns:e,column:i,source:t})}autoSizeColumn(e,t,i){e&&this.autoSizeColumns({columns:[e],skipHeader:i,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,i){const s=new Set;let r;this.getGridColumns(e).forEach(l=>{let a=l.getParent();for(;a&&a!=i;)a.isPadding()||s.add(a),a=a.getParent()});for(const l of s){for(const a of this.ctrlsService.getHeaderRowContainerCtrls())if(r=a.getHeaderCtrlForColumn(l),r)break;r&&r.resizeLeafColumnsToFit(t)}
1return[]}autoSizeAllColumns(e,t){if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.autoSizeAllColumns(e,t));const i=this.getAllDisplayedColumns();this.autoSizeColumns({columns:i,skipHeader:t,source:e})}getColumnsFromTree(e){const t=[],i=s=>{for(let o=0;o<s.length;o++){const r=s[o];r instanceof Z?t.push(r):r instanceof le&&i(r.getChildren())}};return i(e),t}getAllDisplayedTrees(){return this.displayedTreeLeft&&this.displayedTreeRight&&this.displayedTreeCentre?this.displayedTreeLeft.concat(this.displayedTreeCentre).concat(this.displayedTreeRight):null}getPrimaryColumnTree(){return this.primaryColumnTree}getHeaderRowCount(){return this.gridHeaderRowCount}getDisplayedTreeLeft(){return this.displayedTreeLeft}getDisplayedTreeRight(){return this.displayedTreeRight}getDisplayedTreeCentre(){return this.displayedTreeCentre}isColumnDisplayed(e){return this.getAllDisplayedColumns().indexOf(e)>=0}getAllDisplayedColumns(){return this.displayedColumns}getViewportColumns(){return this.viewportColumns}getDisplayedLeftColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsLeft):this.displayedColumnsLeft}getDisplayedRightColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsRight):this.displayedColumnsRight}isColSpanActive(){return this.colSpanActive}getDisplayedColumnsForRow(e,t,i,s){const o=[];let r=null;for(let n=0;n<t.length;n++){const l=t[n],a=t.length-n,c=Math.min(l.getColSpan(e),a),h=[l];if(c>1){const m=c-1;for(let C=1;C<=m;C++)h.push(t[n+C]);n+=m}let g;i?(g=!1,h.forEach(m=>{i(m)&&(g=!0)})):g=!0,g&&(0===o.length&&r&&s&&s(l)&&o.push(r),o.push(l)),r=l}return o}getViewportCenterColumnsForRow(e){if(!this.colSpanActive)return this.viewportColumnsCenter;const i=this.isColumnVirtualisationSuppressed()?null:this.isColumnInRowViewport.bind(this);return this.getDisplayedColumnsForRow(e,this.displayedColumnsCenter,i,s=>{const o=s.getLeft();return R(o)&&o>this.viewportLeft})}isColumnAtEdge(e,t){const i=this.getAllDisplayedColumns();if(!i.length)return!1;const s="first"===t;let o;if(e instanceof he){const r=e.getDisplayedLeafColumns();if(!r.length)return!1;o=s?r[0]:K(r)}else o=e;return(s?i[0]:K(i))===o}getAriaColumnIndex(e){let t;return t=e instanceof he?e.getLeafColumns()[0]:e,this.ariaOrderColumns.indexOf(t)+1}isColumnInHeaderViewport(e){return!!e.isAutoHeaderHeight()||this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),s=this.viewportLeft-200,o=this.viewportRight+200;return!(t<s&&i<s||t>o&&i>o)}getDisplayedColumnsLeftWidth(){return this.getWidthOfColsInList(this.displayedColumnsLeft)}getDisplayedColumnsRightWidth(){return this.getWidthOfColsInList(this.displayedColumnsRight)}updatePrimaryColumnList(e,t,i,s,o,r){if(!e||Be(e))return;let n=!1;e.forEach(a=>{if(!a)return;const c=this.getPrimaryColumn(a);if(c){if(i){if(t.indexOf(c)>=0)return;t.push(c)}else{if(t.indexOf(c)<0)return;Le(t,c)}s(c),n=!0}}),n&&(this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(r),this.eventService.dispatchEvent({type:o,columns:t,column:1===t.length?t[0]:null,source:r}))}setRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.setPrimaryColumnList(e,this.rowGroupColumns,p.EVENT_COLUMN_ROW_GROUP_CHANGED,!0,this.setRowGroupActive.bind(this),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gridOptionsService.get("suppressRowGroupHidesColumns")&&this.setColumnsVisible([t],!1,i),!e&&!this.gridOptionsService.get("suppressMakeColumnVisibleAfterUnGroup")&&this.setColumnsVisible([t],!0,i))}addRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!0,this.setRowGroupActive.bind(this,!0),p.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}removeRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!1,this.setRowGroupActive.bind(this,!1),p.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}addPivotColumns(e,t){this.updatePrimaryColumnList(e,this.pivotColumns,!0,i=>i.setPivotActive(!0,t),p.EVENT_COLUMN_PIVOT_CHANGED,t)}setPivotColumns(e,t){this.setPrimaryColumnList(e,this.pivotColumns,p.EVENT_COLUMN_PIVOT_CHANGED,!0,(i,s)=>{s.setPivotActive(i,t)},t)}removePivotColumns(e,t){this.updatePrimaryColumnList(e,this.pivotColumns,!1,i=>i.setPivotActive(!1,t),p.EVENT_COLUMN_PIVOT_CHANGED,t)}setPrimaryColumnList(e,t,i,s,o,r){if(!this.gridColumns)return;const n=new Map;t.forEach((l,a)=>n.set(l,a)),t.length=0,R(e)&&e.forEach(l=>{const a=this.getPrimaryColumn(l);a&&t.push(a)}),t.forEach((l,a)=>{const c=n.get(l);void 0!==c?s&&c!==a||n.delete(l):n.set(l,0)}
1),(this.primaryColumns||[]).forEach(l=>{const a=t.indexOf(l)>=0;o(a,l)}),this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(r),this.dispatchColumnChangedEvent(i,[...n.keys()],r)}setValueColumns(e,t){this.setPrimaryColumnList(e,this.valueColumns,p.EVENT_COLUMN_VALUE_CHANGED,!1,this.setValueActive.bind(this),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc())){const s=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(s)}}addValueColumns(e,t){this.updatePrimaryColumnList(e,this.valueColumns,!0,this.setValueActive.bind(this,!0),p.EVENT_COLUMN_VALUE_CHANGED,t)}removeValueColumns(e,t){this.updatePrimaryColumnList(e,this.valueColumns,!1,this.setValueActive.bind(this,!1),p.EVENT_COLUMN_VALUE_CHANGED,t)}normaliseColumnWidth(e,t){const i=e.getMinWidth();R(i)&&t<i&&(t=i);const s=e.getMaxWidth();return R(s)&&e.isGreaterThanMax(t)&&(t=s),t}getPrimaryOrGridColumn(e){return this.getPrimaryColumn(e)||this.getGridColumn(e)}setColumnWidths(e,t,i,s){const o=[];e.forEach(r=>{const n=this.getPrimaryOrGridColumn(r.key);if(n&&(o.push({width:r.newWidth,ratios:[1],columns:[n]}),"shift"===this.gridOptionsService.get("colResizeDefault")&&(t=!t),t)){const a=this.getDisplayedColAfter(n);if(!a)return;const c=n.getActualWidth()-r.newWidth,h=a.getActualWidth()+c;o.push({width:h,ratios:[1],columns:[a]})}}),0!==o.length&&this.resizeColumnSets({resizeSets:o,finished:i,source:s})}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let s=0,o=0,r=!0;return t.forEach(a=>{const c=a.getMinWidth();s+=c||0;const h=a.getMaxWidth();R(h)&&h>0?o+=h:r=!1}),i>=s&&(!r||i<=o)}resizeColumnSets(e){const{resizeSets:t,finished:i,source:s}=e;if(t&&!t.every(h=>this.checkMinAndMaxWidthsForSet(h)))return void(i&&this.dispatchColumnResizedEvent(t&&t.length>0?t[0].columns:null,i,s));const r=[],n=[];t.forEach(h=>{const{width:g,columns:m,ratios:C}=h,v={},E={};m.forEach(y=>n.push(y));let S=!0,D=0;for(;S;){if(D++,D>1e3){console.error("AG Grid: infinite loop in resizeColumnSets");break}S=!1;const y=[];let P=0,F=g;m.forEach((I,_)=>{E[I.getId()]?F-=v[I.getId()]:(y.push(I),P+=C[_])});const M=1/P;y.forEach((I,_)=>{let de;_===y.length-1?de=F:(de=Math.round(C[_]*g*M),F-=de);const tt=I.getMinWidth(),He=I.getMaxWidth();R(tt)&&de<tt?(de=tt,E[I.getId()]=!0,S=!0):R(He)&&He>0&&de>He&&(de=He,E[I.getId()]=!0,S=!0),v[I.getId()]=de})}m.forEach(y=>{const P=v[y.getId()];y.getActualWidth()!==P&&(y.setActualWidth(P,s),r.push(y))})});const l=r.length>0;let a=[];l&&(a=this.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0}),this.setLeftValues(s),this.updateBodyWidths(),this.checkViewportColumns());const c=n.concat(a);(l||i)&&this.dispatchColumnResizedEvent(c,i,s,a)}setColumnAggFunc(e,t,i){if(!e)return;const s=this.getPrimaryColumn(e);s&&(s.setAggFunc(t),this.dispatchColumnChangedEvent(p.EVENT_COLUMN_VALUE_CHANGED,[s],i))}moveRowGroupColumn(e,t,i){if(this.isRowGroupEmpty())return;const s=this.rowGroupColumns[e],o=this.rowGroupColumns.slice(e,t);this.rowGroupColumns.splice(e,1),this.rowGroupColumns.splice(t,0,s),this.eventService.dispatchEvent({type:p.EVENT_COLUMN_ROW_GROUP_CHANGED,columns:o,column:1===o.length?o[0]:null,source:i})}moveColumns(e,t,i,s=!0){if(!this.gridColumns)return;if(this.columnAnimationService.start(),t>this.gridColumns.length-e.length)return console.warn("AG Grid: tried to insert columns in invalid location, toIndex = "+t),void console.warn("AG Grid: remember that you should not count the moving columns when calculating the new index");const o=this.getGridColumns(e);this.doesMovePassRules(o,t)&&(Br(this.gridColumns,o,t),this.updateDisplayedColumns(i),this.dispatchColumnMovedEvent({movedColumns:o,source:i,toIndex:t,finished:s}),this.columnAnimationService.finish())}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!(!this.doesMovePassMarryChildren(e)||!this.doesMovePassLockedPositions(e))}getProposedColumnOrder(e,t){const i=this.gridColumns.slice();return Br(i,e,t),i}sortColumnsLikeGridColumns(e){!e||e.length<=1||e.filter(i=>this.gridColumns.indexOf(i)<0).length>0||e.sort((i,s)=>this.gridColumns.indexOf(i)-this.gridColumns.indexOf(s))}doesMovePassLockedPositions(e){let t=0,i=!0;return e.forEach(o=>{const r=(o=>o?!0===o||"left"===o?0:2:1)(o.getColDef().lockPosition);r<t&&(i=!1),t=r}),i}doesMovePassMarryChildren(e){let t=!0;return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,i=>{if(!(i instanceof le))return;const s=i,o=s.getColGroupDef();if(!o||!o.marryChildren)return;const n=[];
1s.getLeafColumns().forEach(g=>{const m=e.indexOf(g);n.push(m)}),Math.max.apply(Math,n)-Math.min.apply(Math,n)>s.getLeafColumns().length-1&&(t=!1)}),t}moveColumnByIndex(e,t,i){this.gridColumns&&this.moveColumns([this.gridColumns[e]],t,i)}getColumnDefs(){if(!this.primaryColumns)return;const e=this.primaryColumns.slice();return this.gridColsArePrimary?e.sort((t,i)=>this.gridColumns.indexOf(t)-this.gridColumns.indexOf(i)):this.lastPrimaryOrder&&e.sort((t,i)=>this.lastPrimaryOrder.indexOf(t)-this.lastPrimaryOrder.indexOf(i)),this.columnDefFactory.buildColumnDefs(e,this.rowGroupColumns,this.pivotColumns)}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}updateBodyWidths(){const e=this.getWidthOfColsInList(this.displayedColumnsCenter),t=this.getWidthOfColsInList(this.displayedColumnsLeft),i=this.getWidthOfColsInList(this.displayedColumnsRight);this.bodyWidthDirty=this.bodyWidth!==e,(this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i)&&(this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i,this.eventService.dispatchEvent({type:p.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED}),this.eventService.dispatchEvent({type:p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED}))}getValueColumns(){return this.valueColumns?this.valueColumns:[]}getPivotColumns(){return this.pivotColumns?this.pivotColumns:[]}isPivotActive(){return this.pivotColumns&&this.pivotColumns.length>0&&this.pivotMode}getRowGroupColumns(){return this.rowGroupColumns?this.rowGroupColumns:[]}getDisplayedCenterColumns(){return this.displayedColumnsCenter}getDisplayedLeftColumns(){return this.displayedColumnsLeft}getDisplayedRightColumns(){return this.displayedColumnsRight}getDisplayedColumns(e){switch(e){case"left":return this.getDisplayedLeftColumns();case"right":return this.getDisplayedRightColumns();default:return this.getDisplayedCenterColumns()}}getAllPrimaryColumns(){return this.primaryColumns?this.primaryColumns:null}getSecondaryColumns(){return this.secondaryColumns?this.secondaryColumns:null}getAllColumnsForQuickFilter(){return this.columnsForQuickFilter}getAllGridColumns(){var e;return null!=(e=this.gridColumns)?e:[]}isEmpty(){return Be(this.gridColumns)}isRowGroupEmpty(){return Be(this.rowGroupColumns)}setColumnsVisible(e,t=!1,i){this.applyColumnState({state:e.map(s=>({colId:"string"==typeof s?s:s.getColId(),hide:!t}))},i)}setColumnsPinned(e,t,i){if(!this.gridColumns)return;if(this.gridOptionsService.isDomLayout("print"))return void console.warn("AG Grid: Changing the column pinning status is not allowed with domLayout='print'");let s;this.columnAnimationService.start(),s=!0===t||"left"===t?"left":"right"===t?"right":null,this.actionOnGridColumns(e,o=>o.getPinned()!==s&&(o.setPinned(s),!0),i,()=>({type:p.EVENT_COLUMN_PINNED,pinned:s,column:null,columns:null,source:i})),this.columnAnimationService.finish()}actionOnGridColumns(e,t,i,s){if(Be(e))return;const o=[];if(e.forEach(r=>{if(!r)return;const n=this.getGridColumn(r);n&&!1!==t(n)&&o.push(n)}),o.length&&(this.updateDisplayedColumns(i),R(s)&&s)){const r=s();r.columns=o,r.column=1===o.length?o[0]:null,this.eventService.dispatchEvent(r)}}getDisplayedColBefore(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i>0?t[i-1]:null}getDisplayedColAfter(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}getDisplayedGroupAfter(e){return this.getDisplayedGroupAtDirection(e,"After")}getDisplayedGroupBefore(e){return this.getDisplayedGroupAtDirection(e,"Before")}getDisplayedGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),s=e.getDisplayedLeafColumns(),o="After"===t?K(s):s[0],r=`getDisplayedCol${t}`;for(;;){const n=this[r](o);if(!n)return null;const l=this.getColumnGroupAtLevel(n,i);if(l!==e)return l}}getColumnGroupAtLevel(e,t){let s,o,i=e.getParent();for(;s=i.getProvidedColumnGroup().getLevel(),o=i.getPaddingLevel(),!(s+o<=t);)i=i.getParent();return i}isPinningLeft(){return this.displayedColumnsLeft.length>0}isPinningRight(){return this.displayedColumnsRight.length>0}getPrimaryAndSecondaryAndAutoColumns(){return[].concat(this.primaryColumns||[],this.groupAutoColumns||[],this.secondaryColumns||[])}createStateItemFromColumn(e){const t=e.isRowGroupActive()?this.rowGroupColumns.indexOf(e):null,i=e.isPivotActive()?this.pivotColumns.indexOf(e):null,s=e.isValueActive()?e.getAggFunc():null,o=null!=e.getSort()?e.getSort():null,r=null!=e.getSortIndex()?e.getSortIndex():null,n=null!=e.getFlex()&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:o,sortIndex:r,aggFunc:s,rowGroup:e.isRowGroupActive(),rowGroupIndex:t,pivot:e.isPivotActive(),pivotIndex:i,flex:n}}getColumnState(){if(G(this.primaryColumns)||!this.isAlive())return[];const t=this.getPrimaryAndSecondaryAndAutoColumns().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(t),t}orderColumnStateList(e){const t=kt(this.gridColumns.map((i,s)=>[i.getColId(),s]));e.sort((i,s)=>(t.has(i.colId)?t.get(i.colId):-1)-(t.has(s.colId)?t.get(s.colId):-1))}resetColumnState(e){if(Be(this.primaryColumns))return;const t=this.getColumnsFromTree(this.primaryColumnTree),i=[];let s=1e3,o=1e3,r=[];this.groupAutoColumns&&(r=r.concat(this.groupAutoColumns)),t&&(r=r.concat(t)),r.forEach(n=>{const l=this.getColumnStateFromColDef(n);G(l.rowGroupIndex)&&l.rowGroup&&(l.rowGroupIndex=s++),G(l.pivotIndex)&&l.pivot&&(l.pivotIndex=o++),i.push(l)}),this.applyColumnState({state:i,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(v,E)=>v??E??null,i=e.getColDef(),s=t(i.sort,i.initialSort),o=t(i.sortIndex,i.initialSortIndex),r=t(i.hide,i.initialHide),n=t(i.pinned,i.initialPinned),l=t(i.width,i.initialWidth),a=t(i.flex,i.initialFlex);let c=t(i.rowGroupIndex,i.initialRowGroupIndex),h=t(i.rowGroup,i.initialRowGroup);null==c&&(null==h||0==h)&&(c=null,h=null);let g=t(i.pivotIndex,i.initialPivotIndex),m=t(i.pivot,i.initialPivot);null==g&&(null==m||0==m)&&(g=null,m=null);const C=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:o,hide:r,pinned:n,width:l,flex:a,rowGroup:h,rowGroupIndex:c,pivot:m,pivotIndex:g,aggFunc:C}}applyColumnState(e,t){if(Be(this.primaryColumns))return!1;if(e&&e.state&&!e.state.forEach)return console.warn("AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;const i=(r,n,l)=>{const a=this.compareColumnStatesAndDispatchEvents(t);this.autoGroupsNeedBuilding=!0;const c=n.slice(),h={},g={},m=[],C=[];let v=0;const E=this.rowGroupColumns.slice(),S=this.pivotColumns.slice();r.forEach(F=>{const M=F.colId||"";if(M.startsWith(xi))return m.push(F),void C.push(F);const _=l(M);_?(this.syncColumnWithStateItem(_,F,e.defaultState,h,g,!1,t),Le(c,_)):(C.push(F),v+=1)});const D=F=>this.syncColumnWithStateItem(F,null,e.defaultState,h,g,!1,t);
1c.forEach(D);const y=(F,M,I,_)=>{const j=F[I.getId()],de=F[_.getId()],tt=null!=j,He=null!=de;if(tt&&He)return j-de;if(tt)return-1;if(He)return 1;const ps=M.indexOf(I),yt=M.indexOf(_),cu=ps>=0;return cu&&yt>=0?ps-yt:cu?-1:1};this.rowGroupColumns.sort(y.bind(this,h,E)),this.pivotColumns.sort(y.bind(this,g,S)),this.updateGridColumns();const P=this.groupAutoColumns?this.groupAutoColumns.slice():[];return m.forEach(F=>{const M=this.getAutoColumn(F.colId);Le(P,M),this.syncColumnWithStateItem(M,F,e.defaultState,null,null,!0,t)}),P.forEach(D),this.applyOrderAfterApplyState(e),this.updateDisplayedColumns(t),this.dispatchEverythingChanged(t),a(),{unmatchedAndAutoStates:C,unmatchedCount:v}};this.columnAnimationService.start();let{unmatchedAndAutoStates:s,unmatchedCount:o}=i(e.state||[],this.primaryColumns||[],r=>this.getPrimaryColumn(r));return(s.length>0||R(e.defaultState))&&(o=i(s,this.secondaryColumns||[],r=>this.getSecondaryColumn(r)).unmatchedCount),this.columnAnimationService.finish(),0===o}applyOrderAfterApplyState(e){if(!e.applyOrder||!e.state)return;let t=[];const i={};e.state.forEach(o=>{if(!o.colId||i[o.colId])return;const r=this.gridColumnsMap[o.colId];r&&(t.push(r),i[o.colId]=!0)});let s=0;this.gridColumns.forEach(o=>{const r=o.getColId();null==i[r]&&(r.startsWith(xi)?ws(t,o,s++):t.push(o))}),t=this.placeLockedColumns(t),this.doesMovePassMarryChildren(t)?this.gridColumns=t:console.warn("AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.")}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.rowGroupColumns.slice(),pivotColumns:this.pivotColumns.slice(),valueColumns:this.valueColumns.slice()},i=this.getColumnState(),s={};return i.forEach(o=>{s[o.colId]=o}),()=>{const o=this.getPrimaryAndSecondaryAndAutoColumns(),r=(E,S,D,y)=>{if(pt(S.map(y),D.map(y)))return;const I=new Set(S);D.forEach(de=>{I.delete(de)||I.add(de)});const _=[...I];this.eventService.dispatchEvent({type:E,columns:_,column:1===_.length?_[0]:null,source:e})},n=E=>{const S=[];return o.forEach(D=>{const y=s[D.getColId()];y&&E(y,D)&&S.push(D)}),S},l=E=>E.getColId();r(p.EVENT_COLUMN_ROW_GROUP_CHANGED,t.rowGroupColumns,this.rowGroupColumns,l),r(p.EVENT_COLUMN_PIVOT_CHANGED,t.pivotColumns,this.pivotColumns,l);const c=n((E,S)=>{const D=null!=E.aggFunc,y=D!=S.isValueActive(),P=D&&E.aggFunc!=S.getAggFunc();return y||P});c.length>0&&this.dispatchColumnChangedEvent(p.EVENT_COLUMN_VALUE_CHANGED,c,e),this.dispatchColumnResizedEvent(n((E,S)=>E.width!=S.getActualWidth()),!0,e),this.dispatchColumnPinnedEvent(n((E,S)=>E.pinned!=S.getPinned()),e),this.dispatchColumnVisibleEvent(n((E,S)=>E.hide==S.isVisible()),e);const v=n((E,S)=>E.sort!=S.getSort()||E.sortIndex!=S.getSortIndex());v.length>0&&this.sortController.dispatchSortChangedEvents(e,v),this.normaliseColumnMovedEventForColumnState(i,e)}}getCommonValue(e,t){if(!e||0==e.length)return;const i=t(e[0]);for(let s=1;s<e.length;s++)if(i!==t(e[s]))return;return i}normaliseColumnMovedEventForColumnState(e,t){const i=this.getColumnState(),s={};i.forEach(a=>s[a.colId]=a);const o={};e.forEach(a=>{s[a.colId]&&(o[a.colId]=!0)});const r=e.filter(a=>o[a.colId]),n=i.filter(a=>o[a.colId]),l=[];n.forEach((a,c)=>{const h=r&&r[c];if(h&&h.colId!==a.colId){const g=this.getGridColumn(h.colId);g&&l.push(g)}}),l.length&&this.dispatchColumnMovedEvent({movedColumns:l,source:t,finished:!0})}syncColumnWithStateItem(e,t,i,s,o,r,n){if(!e)return;const l=(P,F)=>{const M={value1:void 0,value2:void 0};let I=!1;return t&&(void 0!==t[P]&&(M.value1=t[P],I=!0),R(F)&&void 0!==t[F]&&(M.value2=t[F],I=!0)),!I&&i&&(void 0!==i[P]&&(M.value1=i[P]),R(F)&&void 0!==i[F]&&(M.value2=i[F])),M},a=l("hide").value1;void 0!==a&&e.setVisible(!a,n);const c=l("pinned").value1;void 0!==c&&e.setPinned(c);const h=this.columnUtils.calculateColMinWidth(e.getColDef()),g=l("flex").value1;if(void 0!==g&&e.setFlex(g),null==g){const P=l("width").value1;null!=P&&null!=h&&P>=h&&e.setActualWidth(P,n)}const m=l("sort").value1;void 0!==m&&e.setSort("desc"===m||"asc"===m?m:void 0,n);const C=l("sortIndex").value1;if(void 0!==C&&e.setSortIndex(C),r||!e.isPrimary())return;const v=l("aggFunc").value1;void 0!==v&&("string"==typeof v?(e.setAggFunc(v),e.isValueActive()||(e.setValueActive(!0,n),this.valueColumns.push(e))):(R(v)&&console.warn("AG Grid: stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),e.isValueActive()&&(e.setValueActive(!1,n),Le(this.valueColumns,e))));const{value1:E,value2:S}=l("rowGroup","rowGroupIndex");(void 0!==E||void 0!==S)&&("number"==typeof S||E?(e.isRowGroupActive()||(e.setRowGroupActive(!0,n),this.rowGroupColumns.push(e)),s&&"number"==typeof S&&(s[e.getId()]=S)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,n),Le(this.rowGroupColumns,e)));const{value1:D,value2:y}=l("pivot","pivotIndex");(void 0!==D||void 0!==y)&&("number"==typeof y||D?(e.isPivotActive()||(e.setPivotActive(!0,n),this.pivotColumns.push(e)),o&&"number"==typeof y&&(o[e.getId()]=y)):e.isPivotActive()&&(e.setPivotActive(!1,n),Le(this.pivotColumns,e)))}getGridColumns(e){return this.getColumns(e,this.getGridColumn.bind(this))}getColumns(e,t){const i=[];return e&&e.forEach(s=>{const o=t(s);o&&i.push(o)}),i}getColumnWithValidation(e){if(null==e)return null;const t=this.getGridColumn(e);return t||console.warn("AG Grid: could not find column "+e),t}getPrimaryColumn(e){return this.primaryColumns?this.getColumn(e,this.primaryColumns,this.primaryColumnsMap):null}getGridColumn(e){return this.getColumn(e,this.gridColumns,this.gridColumnsMap)}lookupGridColumn(e){return this.gridColumnsMap[e]}getSecondaryColumn(e){return this.secondaryColumns?this.getColumn(e,this.secondaryColumns,this.secondaryColumnsMap):null}getColumn(e,t,i){if(!e||!i)return null;if("string"==typeof e&&i[e])return i[e];for(let s=0;s<t.length;s++)if(this.columnsMatch(t[s],e))return t[s];return this.getAutoColumn(e)}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(!0===t)return this.rowGroupColumns.slice(0);const i=this.getPrimaryColumn(t);return i?[i]:null}getAutoColumn(e){return this.groupAutoColumns&&R(this.groupAutoColumns)&&!G(this.groupAutoColumns)&&this.groupAutoColumns.find(t=>this.columnsMatch(t,e))||null}columnsMatch(e,t){const i=e===t,s=e.getColDef()===t,o=e.getColId()==t;return i||s||o}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,i){const s=t?t.getColGroupDef():null;return s?this.getHeaderName(s,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,s,o){const r=e.headerValueGetter;if(r){const n=this.gridOptionsService.addGridCommonParams({colDef:e,column:t,columnGroup:i,providedColumnGroup:s,location:o});return"function"==typeof r?r(n):"string"==typeof r?this.expressionService.evaluate(r,n):(console.warn("AG Grid: headerValueGetter must be a function or a string"),"")}return null!=e.headerName?e.headerName:e.field?sa(e.field):""}wrapHeaderNameWithAggFunc(e,t){if(this.gridOptionsService.get("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn;let r,o=null;if(R(i)){const n=this.gridOptionsService.get("removePivotHeaderRowWhenSingleValueColumn")&&1===this.valueColumns.length,l=void 0!==e.getColDef().pivotTotalColumnIds;if(n&&!l)return t;o=i?i.getAggFunc():null,r=!0}else{const n=e.isValueActive(),l=this.pivotMode||!this.isRowGroupEmpty();n&&l?(o=e.getAggFunc(),r=!0):r=!1}if(r){const n="string"==typeof o?o:"func";return`${this.localeService.getLocaleTextFunc()(n,n)}(${t})`}return t}getColumnGroup(e,t){if(!e)return null;if(e instanceof he)return e;const i=this.getAllDisplayedTrees(),s="number"==typeof t;let o=null;return this.columnUtils.depthFirstAllColumnTreeSearch(i,r=>{if(r instanceof he){const n=r;let l;l=s?e===n.getGroupId()&&t===n.getPartId():e===n.getGroupId(),l&&(o=n)}}),o}isReady(){return this.ready}extractValueColumns(e,t){this.valueColumns=this.extractColumns(t,this.valueColumns,(i,s)=>i.setValueActive(s,e),()=>{},()=>{},i=>{const s=i.aggFunc;return null===s||""===s?null:void 0!==s?!!s:void 0},i=>null!=i.initialAggFunc&&""!=i.initialAggFunc),this.valueColumns.forEach(i=>
1{const s=i.getColDef();null!=s.aggFunc&&""!=s.aggFunc?i.setAggFunc(s.aggFunc):i.getAggFunc()||i.setAggFunc(s.initialAggFunc)})}extractRowGroupColumns(e,t){this.rowGroupColumns=this.extractColumns(t,this.rowGroupColumns,(i,s)=>i.setRowGroupActive(s,e),i=>i.rowGroupIndex,i=>i.initialRowGroupIndex,i=>i.rowGroup,i=>i.initialRowGroup)}extractColumns(e=[],t=[],i,s,o,r,n){const l=[],a=[];(this.primaryColumns||[]).forEach(g=>{const m=e.indexOf(g)<0,C=g.getColDef(),v=yo(r(C)),E=yo(n(C)),S=Gt(s(C)),D=Gt(o(C));let y;y=void 0!==v?v:void 0!==S?null!==S&&S>=0:m?void 0!==E?E:void 0!==D&&null!=D&&D>=0:t.indexOf(g)>=0,y&&((m?null!=S||null!=D:null!=S)?l.push(g):a.push(g))});const c=g=>{const m=s(g.getColDef()),C=o(g.getColDef());return m??C};l.sort((g,m)=>{const C=c(g),v=c(m);return C===v?0:C<v?-1:1});const h=[].concat(l);return t.forEach(g=>{a.indexOf(g)>=0&&h.push(g)}),a.forEach(g=>{h.indexOf(g)<0&&h.push(g)}),t.forEach(g=>{h.indexOf(g)<0&&i(g,!1)}),h.forEach(g=>{t.indexOf(g)<0&&i(g,!0)}),h}extractPivotColumns(e,t){this.pivotColumns=this.extractColumns(t,this.pivotColumns,(i,s)=>i.setPivotActive(s,e),i=>i.pivotIndex,i=>i.initialPivotIndex,i=>i.pivot,i=>i.initialPivot)}resetColumnGroupState(e){if(!this.primaryColumnTree)return;const t=[];this.columnUtils.depthFirstOriginalTreeSearch(null,this.primaryColumnTree,i=>{if(i instanceof le){const s=i.getColGroupDef(),o={groupId:i.getGroupId(),open:s?s.openByDefault:void 0};t.push(o)}}),this.setColumnGroupState(t,e)}getColumnGroupState(){const e=[];return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,t=>{t instanceof le&&e.push({groupId:t.getGroupId(),open:t.isExpanded()})}),e}setColumnGroupState(e,t){if(!this.gridBalancedTree)return;this.columnAnimationService.start();const i=[];e.forEach(s=>{const r=s.open,n=this.getProvidedColumnGroup(s.groupId);n&&n.isExpanded()!==r&&(this.logger.log("columnGroupOpened("+n.getGroupId()+","+r+")"),n.setExpanded(r),i.push(n))}),this.updateGroupsAndDisplayedColumns(t),this.setFirstRightAndLastLeftPinned(t),i.length&&this.eventService.dispatchEvent({type:p.EVENT_COLUMN_GROUP_OPENED,columnGroup:1===le.length?i[0]:void 0,columnGroups:i}),this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let s;s=e instanceof le?e.getId():e||"",this.setColumnGroupState([{groupId:s,open:t}],i)}getProvidedColumnGroup(e){"string"!=typeof e&&console.error("AG Grid: group key must be a string");let t=null;return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,i=>{i instanceof le&&i.getId()===e&&(t=i)}),t}calculateColumnsForDisplay(){let e;return e=this.pivotMode&&G(this.secondaryColumns)?this.gridColumns.filter(t=>{const i=this.groupAutoColumns&&Ue(this.groupAutoColumns,t),s=this.valueColumns&&Ue(this.valueColumns,t);return i||s}):this.gridColumns.filter(t=>this.groupAutoColumns&&Ue(this.groupAutoColumns,t)||t.isVisible()),e}checkColSpanActiveInCols(e){let t=!1;return e.forEach(i=>{R(i.getColDef().colSpan)&&(t=!0)}),t}calculateColumnsForGroupDisplay(){this.groupDisplayColumns=[],this.groupDisplayColumnsMap={},this.gridColumns.forEach(t=>{const i=t.getColDef(),s=i.showRowGroup;i&&R(s)&&(this.groupDisplayColumns.push(t),"string"==typeof s?this.groupDisplayColumnsMap[s]=t:!0===s&&this.getRowGroupColumns().forEach(o=>{this.groupDisplayColumnsMap[o.getId()]=t}))})}getGroupDisplayColumns(){return this.groupDisplayColumns}getGroupDisplayColumnForGroup(e){return this.groupDisplayColumnsMap[e]}updateDisplayedColumns(e){const t=this.calculateColumnsForDisplay();this.buildDisplayedTrees(t),this.updateGroupsAndDisplayedColumns(e),this.setFirstRightAndLastLeftPinned(e)}isSecondaryColumnsPresent(){return R(this.secondaryColumns)}setSecondaryColumns(e,t){if(!this.gridColumns)return;const i=e;if(i||!G(this.secondaryColumns)){if(i){this.processSecondaryColumnDefinitions(e);const s=this.columnFactory.createColumnTree(e,!1,this.secondaryBalancedTree||this.previousSecondaryColumns||void 0,t);this.destroyOldColumns(this.secondaryBalancedTree,s.columnTree),this.secondaryBalancedTree=s.columnTree,this.secondaryHeaderRowCount=s.treeDept+1,this.secondaryColumns=this.getColumnsFromTree(this.secondaryBalancedTree),this.secondaryColumnsMap={},this.secondaryColumns.forEach(o=>this.secondaryColumnsMap[o.getId()]=o),this.previousSecondaryColumns=null}else this.previousSecondaryColumns=this.secondaryBalancedTree,this.secondaryBalancedTree=null,this.secondaryHeaderRowCount=-1,this.secondaryColumns=null,this.secondaryColumnsMap={};this.updateGridColumns(),this.updateDisplayedColumns(t)}}processSecondaryColumnDefinitions(e){const t=this.gridOptionsService.get("processPivotResultColDef"),i=this.gridOptionsService.get("processPivotResultColGroupDef");if(!t&&!i)return;const s=o=>{o.forEach(r=>{if(R(r.children)){const l=r;i&&i(l),s(l.children)}else t&&t(r)})};e&&s(e)}updateGridColumns(){const e=this.gridBalancedTree;if(this.gridColsArePrimary?this.lastPrimaryOrder=this.gridColumns:this.lastSecondaryOrder=this.gridColumns,this.createGroupAutoColumnsIfNeeded()){const s=kt(this.groupAutoColumns.map(o=>[o,!0]));this.lastPrimaryOrder&&(this.lastPrimaryOrder=this.lastPrimaryOrder.filter(o=>!s.has(o)),this.lastPrimaryOrder=[...this.groupAutoColumns,...this.lastPrimaryOrder]),this.lastSecondaryOrder&&(this.lastSecondaryOrder=this.lastSecondaryOrder.filter(o=>!s.has(o)),this.lastSecondaryOrder=[...this.groupAutoColumns,...this.lastSecondaryOrder])}let i;if(this.secondaryColumns&&this.secondaryBalancedTree){const s=this.secondaryColumns.some(o=>void 0!==this.gridColumnsMap[o.getColId()]);this.gridBalancedTree=this.secondaryBalancedTree.slice(),this.gridHeaderRowCount=this.secondaryHeaderRowCount,this.gridColumns=this.secondaryColumns.slice(),this.gridColsArePrimary=!1,s&&(i=this.lastSecondaryOrder)}else this.primaryColumns&&(this.gridBalancedTree=this.primaryColumnTree.slice(),this.gridHeaderRowCount=this.primaryHeaderRowCount,this.gridColumns=this.primaryColumns.slice(),this.gridColsArePrimary=!0,i=this.lastPrimaryOrder);this.addAutoGroupToGridColumns(),this.orderGridColsLike(i),this.gridColumns=this.placeLockedColumns(this.gridColumns),this.calculateColumnsForGroupDisplay(),this.refreshQuickFilterColumns(),this.clearDisplayedAndViewportColumns(),this.colSpanActive=this.checkColSpanActiveInCols(this.gridColumns),this.gridColumnsMap={},this.gridColumns.forEach(s=>this.gridColumnsMap[s.getId()]=s),this.setAutoHeightActive(),pt(e,this.gridBalancedTree)||this.eventService.dispatchEvent({type:p.EVENT_GRID_COLUMNS_CHANGED})}setAutoHeightActive(){this.autoHeightActive=this.gridColumns.filter(e=>e.isAutoHeight()).length>0,this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,this.gridOptionsService.isRowModelType("clientSide")||this.gridOptionsService.isRowModelType("serverSide")||x("autoHeight columns only work with Client Side Row Model and Server Side Row Model."))}orderGridColsLike(e){if(G(e))return;const t=kt(e.map((a,c)=>[a,c]));let i=!0;if(this.gridColumns.forEach(a=>{t.has(a)&&(i=!1)}),i)return;const s=kt(this.gridColumns.map(a=>[a,!0])),o=e.filter(a=>s.has(a)),r=kt(o.map(a=>[a,!0])),n=this.gridColumns.filter(a=>!r.has(a)),l=o.slice();
1n.forEach(a=>{let c=a.getOriginalParent();if(!c)return void l.push(a);const h=[];for(;!h.length&&c;)c.getLeafColumns().forEach(v=>{const E=l.indexOf(v)>=0,S=h.indexOf(v)<0;E&&S&&h.push(v)}),c=c.getOriginalParent();if(!h.length)return void l.push(a);const g=h.map(C=>l.indexOf(C)),m=Math.max(...g);ws(l,a,m+1)}),this.gridColumns=l}isPrimaryColumnGroupsPresent(){return this.primaryHeaderRowCount>1}refreshQuickFilterColumns(){var e;let t=null!=(e=this.isPivotMode()?this.secondaryColumns:this.primaryColumns)?e:[];this.groupAutoColumns&&(t=t.concat(this.groupAutoColumns)),this.columnsForQuickFilter=this.gridOptionsService.get("includeHiddenColumnsInQuickFilter")?t:t.filter(i=>i.isVisible()||i.isRowGroupActive())}placeLockedColumns(e){const t=[],i=[],s=[];return e.forEach(o=>{const r=o.getColDef().lockPosition;"right"===r?s.push(o):"left"===r||!0===r?t.push(o):i.push(o)}),[...t,...i,...s]}addAutoGroupToGridColumns(){if(G(this.groupAutoColumns))return this.destroyOldColumns(this.groupAutoColsBalancedTree),void(this.groupAutoColsBalancedTree=null);this.gridColumns=this.groupAutoColumns?this.groupAutoColumns.concat(this.gridColumns):this.gridColumns;const e=this.columnFactory.createForAutoGroups(this.groupAutoColumns,this.gridBalancedTree);this.destroyOldColumns(this.groupAutoColsBalancedTree,e),this.groupAutoColsBalancedTree=e,this.gridBalancedTree=e.concat(this.gridBalancedTree)}clearDisplayedAndViewportColumns(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.ariaOrderColumns=[],this.viewportColumns=[],this.headerViewportColumns=[],this.viewportColumnsHash=""}updateGroupsAndDisplayedColumns(e){this.updateOpenClosedVisibilityInColumnGroups(),this.deriveDisplayedColumns(e),this.refreshFlexedColumns(),this.extractViewport(),this.updateBodyWidths(),this.eventService.dispatchEvent({type:p.EVENT_DISPLAYED_COLUMNS_CHANGED})}deriveDisplayedColumns(e){this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft,this.displayedColumnsLeft),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre,this.displayedColumnsCenter),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight,this.displayedColumnsRight),this.joinColumnsAriaOrder(),this.joinDisplayedColumns(),this.setLeftValues(e),this.displayedAutoHeightCols=this.displayedColumns.filter(t=>t.isAutoHeight())}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}joinColumnsAriaOrder(){const e=this.getAllGridColumns(),t=[],i=[],s=[];for(const o of e){const r=o.getPinned();r?!0===r||"left"===r?t.push(o):s.push(o):i.push(o)}this.ariaOrderColumns=t.concat(i).concat(s)}joinDisplayedColumns(){this.displayedColumns=this.gridOptionsService.get("enableRtl")?this.displayedColumnsRight.concat(this.displayedColumnsCenter).concat(this.displayedColumnsLeft):this.displayedColumnsLeft.concat(this.displayedColumnsCenter).concat(this.displayedColumnsRight)}setLeftValues(e){this.setLeftValuesOfColumns(e),this.setLeftValuesOfGroups()}setLeftValuesOfColumns(e){if(!this.primaryColumns)return;const t=this.getPrimaryAndSecondaryAndAutoColumns().slice(0),i=this.gridOptionsService.get("enableRtl");[this.displayedColumnsLeft,this.displayedColumnsRight,this.displayedColumnsCenter].forEach(s=>{if(i){let o=this.getWidthOfColsInList(s);s.forEach(r=>{o-=r.getActualWidth(),r.setLeft(o,e)})}else{let o=0;s.forEach(r=>{r.setLeft(o,e),o+=r.getActualWidth()})}Yl(t,s)}),t.forEach(s=>{s.setLeft(null,e)})}setLeftValuesOfGroups(){[this.displayedTreeLeft,this.displayedTreeRight,this.displayedTreeCentre].forEach(e=>{e.forEach(t=>{t instanceof he&&t.checkLeft()})})}derivedDisplayedColumnsFromDisplayedTree(e,t){t.length=0,this.columnUtils.depthFirstDisplayedColumnTreeSearch(e,i=>{i instanceof Z&&t.push(i)})}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||0===this.viewportRight}extractViewportColumns(){this.isColumnVirtualisationSuppressed()?(this.viewportColumnsCenter=this.displayedColumnsCenter,this.headerViewportColumnsCenter=this.displayedColumnsCenter):(this.viewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this)),this.headerViewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this))),this.viewportColumns=this.viewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight),this.headerViewportColumns=this.headerViewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight)}getVirtualHeaderGroupRow(e,t){let i;switch(e){case"left":i=this.viewportRowLeft[t];break;case"right":i=this.viewportRowRight[t];break;default:i=this.viewportRowCenter[t]}return G(i)&&(i=[]),i}calculateHeaderRows(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={};const e={};this.headerViewportColumns.forEach(i=>
1e[i.getId()]=!0);const t=(i,s,o)=>{let r=!1;for(let n=0;n<i.length;n++){const l=i[n];let a=!1;if(l instanceof Z)a=!0===e[l.getId()];else{const h=l.getDisplayedChildren();h&&(a=t(h,s,o+1))}a&&(r=!0,s[o]||(s[o]=[]),s[o].push(l))}return r};t(this.displayedTreeLeft,this.viewportRowLeft,0),t(this.displayedTreeRight,this.viewportRowRight,0),t(this.displayedTreeCentre,this.viewportRowCenter,0)}extractViewport(){this.extractViewportColumns();const t=this.viewportColumns.map(s=>`${s.getId()}-${s.getPinned()||"normal"}`).join("#"),i=this.viewportColumnsHash!==t;return i&&(this.viewportColumnsHash=t,this.calculateHeaderRows()),i}refreshFlexedColumns(e={}){var t;const i=e.source?e.source:"flex";if(null!=e.viewportWidth&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];let s=-1;if(e.resizingCols){const m=new Set(e.resizingCols);let C=this.displayedColumnsCenter;for(let v=C.length-1;v>=0;v--)if(m.has(C[v])){s=v;break}}let o=0,r=[],n=0,l=0;for(let m=0;m<this.displayedColumnsCenter.length;m++)this.displayedColumnsCenter[m].getFlex()&&m>s?(r.push(this.displayedColumnsCenter[m]),l+=this.displayedColumnsCenter[m].getFlex(),n+=null!=(t=this.displayedColumnsCenter[m].getMinWidth())?t:0):o+=this.displayedColumnsCenter[m].getActualWidth();if(!r.length)return[];let a=[];o+n>this.flexViewportWidth&&(r.forEach(m=>{var C;return m.setActualWidth(null!=(C=m.getMinWidth())?C:0,i)}),a=r,r=[]);const c=[];let h;e:for(;;){h=this.flexViewportWidth-o;const m=h/l;for(let C=0;C<r.length;C++){const v=r[C],E=m*v.getFlex();let S=0;const D=v.getMinWidth(),y=v.getMaxWidth();if(R(D)&&E<D?S=D:R(y)&&E>y&&(S=y),S){v.setActualWidth(S,i),Vr(r,v),l-=v.getFlex(),a.push(v),o+=v.getActualWidth();continue e}c[C]=Math.round(E)}break}let g=h;return r.forEach((m,C)=>{m.setActualWidth(Math.min(c[C],g),i),a.push(m),g-=c[C]}),e.skipSetLeft||this.setLeftValues(i),e.updateBodyWidths&&this.updateBodyWidths(),e.fireResizedEvent&&this.dispatchColumnResizedEvent(a,!0,i,r),r}sizeColumnsToFit(e,t="sizeColumnsToFit",i,s){var o,r,n,l,a;if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.sizeColumnsToFit(e,t,i,s));const c={};s&&(null==(o=s?.columnLimits)||o.forEach(D=>{var y=D,{key:P}=y,F=((e,t)=>{var i={};for(var s in e)Ol.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&Eo)for(var s of Eo(e))t.indexOf(s)<0&&Ml.call(e,s)&&(i[s]=e[s]);return i})(y,["key"]);c["string"==typeof P?P:P.getColId()]=F}));const h=this.getAllDisplayedColumns(),g=e===this.getWidthOfColsInList(h);if(e<=0||!h.length||g)return;const m=[],C=[];h.forEach(D=>{!0===D.getColDef().suppressSizeToFit?C.push(D):m.push(D)});const v=m.slice(0);let E=!1;const S=D=>{Le(m,D),C.push(D)};for(m.forEach(D=>{var y,P;D.resetActualWidth(t);const F=c?.[D.getId()],M=null!=(y=F?.minWidth)?y:s?.defaultMinWidth,I=null!=(P=F?.maxWidth)?P:s?.defaultMaxWidth,_=D.getActualWidth();"number"==typeof M&&_<M?D.setActualWidth(M,t,!0):"number"==typeof I&&_>I&&D.setActualWidth(I,t,!0)});!E;){E=!0;const D=e-this.getWidthOfColsInList(C);if(D<=0)m.forEach(y=>{var P,F;const M=null!=(F=null==(P=c?.[y.getId()])?void 0:P.minWidth)?F:s?.defaultMinWidth;"number"!=typeof M?y.setMinimum(t):y.setActualWidth(M,t,!0)});else{const y=D/this.getWidthOfColsInList(m);let P=D;for(let F=m.length-1;F>=0;F--){const M=m[F],I=c?.[M.getId()],_=null!=(r=I?.minWidth)?r:s?.defaultMinWidth,j=null!=(n=I?.maxWidth)?n:s?.defaultMaxWidth,de=null!=(l=M.getMinWidth())?l:0,tt=null!=(a=M.getMaxWidth())?a:Number.MAX_VALUE,He="number"==typeof _&&_>de?_:M.getMinWidth(),ps="number"==typeof j&&j<tt?j:M.getMaxWidth();let yt=Math.round(M.getActualWidth()*y);R(He)&&yt<He?(yt=He,S(M),E=!1):R(ps)&&yt>ps?(yt=ps,S(M),E=!1):0===F&&(yt=P),M.setActualWidth(yt,t,!0),P-=yt}}}v.forEach(D=>{D.fireColumnWidthChangedEvent(t)}),this.setLeftValues(t),this.updateBodyWidths(),!i&&this.dispatchColumnResizedEvent(v,!0,t)}buildDisplayedTrees(e){const t=[],i=[],s=[];e.forEach(r=>{switch(r.getPinned()){case"left":t.push(r);break;case"right":i.push(r);break;default:s.push(r)}});const o=new ta;this.displayedTreeLeft=this.displayedGroupCreator.createDisplayedGroups(t,o,"left",this.displayedTreeLeft),this.displayedTreeRight=this.displayedGroupCreator.createDisplayedGroups(i,o,"right",this.displayedTreeRight),this.displayedTreeCentre=this.displayedGroupCreator.createDisplayedGroups(s,o,null,this.displayedTreeCentre),this.updateDisplayedMap()}updateDisplayedMap(){this.displayedColumnsAndGroupsMap={};const e=t=>{this.displayedColumnsAndGroupsMap[t.getUniqueId()]=t};this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeCentre,e),this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeLeft,e),this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeRight,e)}isDisplayed(e){return this.displayedColumnsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){const e=this.getAllDisplayedTrees();this.columnUtils.depthFirstAllColumnTreeSearch(e,t=>{t instanceof he&&t.calculateDisplayedColumns()})}getGroupAutoColumns(){return this.groupAutoColumns}createGroupAutoColumnsIfNeeded(){const e=this.forceRecreateAutoGroups;if(this.forceRecreateAutoGroups=!1,!this.autoGroupsNeedBuilding)return!1;this.autoGroupsNeedBuilding=!1;const t=this.gridOptionsService.isGroupUseEntireRow(this.pivotMode),i=this.pivotMode?this.gridOptionsService.get("pivotSuppressAutoColumn"):this.isGroupSuppressAutoColumn();if(!(this.rowGroupColumns.length>0||this.gridOptionsService.get("treeData"))||i||t)this.groupAutoColumns=null;else{const r=this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);if(!this.autoColsEqual(r,this.groupAutoColumns)||e)return this.groupAutoColumns=r,!0}return!1}isGroupSuppressAutoColumn(){return"custom"===this.gridOptionsService.get("groupDisplayType")||"custom"===this.gridOptionsService.get("treeDataDisplayType")}autoColsEqual(e,t){return pt(e,t,(i,s)=>i.getColId()===s.getColId())}getWidthOfColsInList(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}getFirstDisplayedColumn(){const e=this.gridOptionsService.get("enableRtl"),t=["getDisplayedLeftColumns","getDisplayedCenterColumns","getDisplayedRightColumns"];e&&t.reverse();for(let i=0;i<t.length;i++){const s=this[t[i]]();if(s.length)return e?K(s):s[0]}return null}setColumnHeaderHeight(e,t){e.setAutoHeaderHeight(t)&&this.eventService.dispatchEvent({type:p.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,column:e,columns:[e],source:"autosizeColumnHeaderHeight"})}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),t=this.getAllDisplayedColumns().filter(i=>i.isAutoHeaderHeight()).map(i=>i.getAutoHeaderHeight()||0);return Math.max(e,...t)}getHeaderHeight(){var e;return null!=(e=this.gridOptionsService.get("headerHeight"))?e:this.environment.getFromTheme(25,"headerHeight")}getFloatingFiltersHeight(){var e;return null!=(e=this.gridOptionsService.get("floatingFiltersHeight"))?e:this.getHeaderHeight()}getGroupHeaderHeight(){var e;return null!=(e=this.gridOptionsService.get("groupHeaderHeight"))?e:this.getHeaderHeight()}getPivotHeaderHeight(){var e;return null!=(e=this.gridOptionsService.get("pivotHeaderHeight"))?e:this.getHeaderHeight()}getPivotGroupHeaderHeight(){var e;return null!=(e=this.gridOptionsService.get("pivotGroupHeaderHeight"))?e:this.getGroupHeaderHeight()}queueResizeOperations(){this.shouldQueueResizeOperations=!0}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperation
1Queue.forEach(e=>e()),this.resizeOperationQueue=[]}resetColumnDefIntoColumn(e,t){const i=e.getUserProvidedColDef();if(!i)return!1;const s=this.columnFactory.addColumnDefaultAndTypes(i,e.getColId());return e.setColDef(s,i,t),!0}isColumnGroupingLocked(e){const t=this.gridOptionsService.get("groupLockGroupColumns");return!(!e.isRowGroupActive()||0===t)&&(-1===t||t>this.rowGroupColumns.findIndex(s=>s.getColId()===e.getColId()))}generateColumnStateForRowGroupAndPivotIndexes(e,t){let i={};const s=(o,r,n,l,a,c)=>{if(!r.length||!this.primaryColumns)return[];const h=Object.keys(o),g=new Set(h),m=new Set(h),C=new Set(r.map(M=>{const I=M.getColId();return m.delete(I),I}).concat(h)),v=[],E={};let S=0;for(let M=0;M<this.primaryColumns.length;M++){const I=this.primaryColumns[M].getColId();C.has(I)&&(v.push(I),E[I]=S++)}let D=1e3,y=!1,P=0;const F=M=>{const I=E[M];for(let _=P;_<I;_++){const j=v[_];m.has(j)&&(o[j][a]=D++,m.delete(j))}P=I};r.forEach(M=>{const I=M.getColId();if(g.has(I))F(I),o[I][a]=D++;else{const _=M.getColDef();(null===_[a]||void 0===_[a]&&null==_[c])&&(y||(_[n]||void 0===_[n]&&_[l]?F(I):(m.forEach(tt=>{o[tt][a]=D+E[tt]}),D+=v.length,y=!0)),i[I]||(i[I]={colId:I}),i[I][a]=D++)}})};return s(e,this.rowGroupColumns,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),s(t,this.pivotColumns,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}onColumnsReady(){const e=this.gridOptionsService.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout(()=>{if("fitGridWidth"===t){const{columnLimits:i,defaultMinWidth:s,defaultMaxWidth:o}=e,r=i?.map(({colId:n,minWidth:l,maxWidth:a})=>({key:n,minWidth:l,maxWidth:a}));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:s,defaultMaxWidth:o,columnLimits:r})}else"fitProvidedWidth"===t&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")})}onFirstDataRendered(){const e=this.gridOptionsService.get("autoSizeStrategy");if("fitCellContents"!==e?.type)return;const{colIds:t,skipHeader:i}=e;setTimeout(()=>{t?this.autoSizeColumns({columns:t,skipHeader:i,source:"autosizeColumns"}):this.autoSizeAllColumns("autosizeColumns",i)})}};function Gi(e){return"gridOptionsUpdated"===e?"gridOptionsChanged":e}u([f("expressionService")],fe.prototype,"expressionService",2),u([f("columnFactory")],fe.prototype,"columnFactory",2),u([f("displayedGroupCreator")],fe.prototype,"displayedGroupCreator",2),u([f("ctrlsService")],fe.prototype,"ctrlsService",2),u([f("autoWidthCalculator")],fe.prototype,"autoWidthCalculator",2),u([f("columnUtils")],fe.prototype,"columnUtils",2),u([f("columnAnimationService")],fe.prototype,"columnAnimationService",2),u([f("autoGroupColService")],fe.prototype,"autoGroupColService",2),u([z("aggFuncService")],fe.prototype,"aggFuncService",2),u([z("valueCache")],fe.prototype,"valueCache",2),u([z("animationFrameService")],fe.prototype,"animationFrameService",2),u([f("sortController")],fe.prototype,"sortController",2),u([f("columnDefFactory")],fe.prototype,"columnDefFactory",2),u([b],fe.prototype,"init",1),u([Ae],fe.prototype,"destroyColumns",1),u([it(0,qe("loggerFactory"))],fe.prototype,"setBeans",1),fe=u([O("columnModel")],fe);var Kr=class extends T{calculateColMinWidth(e){return null!=e.minWidth?e.minWidth:this.environment.getMinColWidth()}calculateColMaxWidth(e){return null!=e.maxWidth?e.maxWidth:Number.MAX_SAFE_INTEGER}calculateColInitialWidth(e){const t=this.calculateColMinWidth(e),i=this.calculateColMaxWidth(e);let s;const o=Gt(e.width),r=Gt(e.initialWidth);return s=null!=o?o:null!=r?r:200,Math.max(Math.min(s,i),t)}getOriginalPathForColumn(e,t){const i=[];let s=!1;const o=(r,n)=>{for(let l=0;l<r.length;l++){if(s)return;const a=r[l];a instanceof le?(o(a.getChildren(),n+1),i[n]=a):a===e&&(s=!0)}};return o(t,0),s?i:null}depthFirstOriginalTreeSearch(e,t,i){t&&t.forEach(s=>{s instanceof le&&this.depthFirstOriginalTreeSearch(s,s.getChildren(),i),i(s,e)})}depthFirstAllColumnTreeSearch(e,t){e&&e.forEach(i=>{i instanceof he&&this.depthFirstAllColumnTreeSearch(i.getChildren(),t),t(i)})}depthFirstDisplayedColumnTreeSearch(e,t){e&&e.forEach(i=>{i instanceof he&&this.depthFirstDisplayedColumnTreeSearch(i.getDisplayedChildren(),t),t(i)})}};Kr=u([O("columnUtils")],Kr);var $r=class extends T{createDisplayedGroups(e,t,i,s){const o=this.mapOldGroupsById(s),r=[];let n=e;for(;n.length;){const l=n;n=[];let a=0;const c=h=>{const g=a;a=h;const m=l[g],v=(m instanceof he?m.getProvidedColumnGroup():m).getOriginalParent();if(null==v){for(let S=g;S<h;S++)r.push(l[S]);return}const E=this.createColumnGroup(v,t,o,i);for(let S=g;S<h;S++)E.addChild(l[S]);n.push(E)};for(let h=1;h<l.length;h++){const g=l[h],C=(g instanceof he?g.getProvidedColumnGroup():g).getOriginalParent(),v=l[a];C!==(v instanceof he?v.getProvidedColumnGroup():v).getOriginalParent()&&c(
1h)}a<l.length&&c(l.length)}return this.setupParentsIntoColumns(r,null),r}createColumnGroup(e,t,i,s){const o=e.getGroupId(),r=t.getInstanceIdForKey(o);let l=i[he.createUniqueId(o,r)];return l&&l.getProvidedColumnGroup()!==e&&(l=null),R(l)?l.reset():(l=new he(e,o,r,s),this.context.createBean(l)),l}mapOldGroupsById(e){const t={},i=s=>{s.forEach(o=>{if(o instanceof he){const r=o;t[o.getUniqueId()]=r,i(r.getChildren())}})};return e&&i(e),t}setupParentsIntoColumns(e,t){e.forEach(i=>{if(i.setParent(t),i instanceof he){const s=i;this.setupParentsIntoColumns(s.getChildren(),s)}})}};$r=u([O("displayedGroupCreator")],$r);var rh={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,excludeHiddenColumnsFromQuickFilter:!0,advancedFilterModel:!0,customChartThemes:!0,chartThemeOverrides:!0,enableChartToolPanelsButton:!0,suppressChartToolPanelsButton:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressParentsInRowNodes:!0,suppressTouch:!0,suppressAsyncEvents:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,suppressAggFuncInHeader:!0,suppressAggAtRootLevel:!0,removePivotHeaderRowWhenSingleValueColumn:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,suppressGroupMaintainValueType:!0,groupLockGroupColumns:!0,rowGroupPanelSuppressSort:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,suppressServerSideInfiniteScroll:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,functionsPassive:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,columnMenu:!0},ve=class{};ve.STRING_PROPERTIES=["rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode"],ve.OBJECT_PROPERTIES=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","statusBar","sideBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterModel","advancedFilterParent","advancedFilterBuilderParams","initialState","autoSizeStrategy"],ve.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"],ve.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns"],ve.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressParentsInRowNodes","suppressColumnMoveAnimation","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressAggAtRootLevel","suppressFocusAfterRefresh","functionsPassive","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","excludeHiddenColumnsFromQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterMovesDown","enterMovesDownAfterEdit","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","enableChartToolPanelsButton","suppressChartToolPanelsButton","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideFilterAllLevels","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","maintainColumnOrder","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","suppressGroupMaintainValueType","reactiveCustomComponents"],ve.FUNCTIONAL_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher"],ve.CALLBACK_PROPERTIES=["getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","
1sendToClipboard","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering","chartMenuItems"],ve.FUNCTION_PROPERTIES=[...ve.FUNCTIONAL_PROPERTIES,...ve.CALLBACK_PROPERTIES],ve.ALL_PROPERTIES=[...ve.ARRAY_PROPERTIES,...ve.OBJECT_PROPERTIES,...ve.STRING_PROPERTIES,...ve.NUMBER_PROPERTIES,...ve.FUNCTION_PROPERTIES,...ve.BOOLEAN_PROPERTIES];var gt=ve,ae=class Rr{static getCallbackForEvent(t){return!t||t.length<2?t:"on"+t[0].toUpperCase()+t.substring(1)}static getGridOptionKeys(){return this.ALL_PROPERTIES_AND_CALLBACKS}static combineAttributesAndGridOptions(t,i){"object"!=typeof t&&(t={});const s=L({},t);return Rr.getGridOptionKeys().forEach(r=>{const n=i[r];typeof n<"u"&&n!==Rr.VUE_OMITTED_PROPERTY&&(s[r]=n)}),s}static processOnChange(t,i){if(!t)return;const s={};let o=!1;if(Object.keys(t).filter(n=>Rr.ALL_PROPERTIES_AND_CALLBACKS_SET.has(n)).forEach(n=>{s[n]=t[n],o=!0}),!o)return;i.__internalUpdateGridOptions(s);const r={type:p.EVENT_COMPONENT_STATE_CHANGED};Se(s,(n,l)=>{r[n]=l}),i.dispatchEvent(r)}};ae.EVENTS=jt(p),ae.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY",ae.EXCLUDED_INTERNAL_EVENTS=[p.EVENT_SCROLLBAR_WIDTH_CHANGED,p.EVENT_CHECKBOX_CHANGED,p.EVENT_HEIGHT_SCALE_CHANGED,p.EVENT_BODY_HEIGHT_CHANGED,p.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,p.EVENT_SCROLL_VISIBILITY_CHANGED,p.EVENT_COLUMN_HOVER_CHANGED,p.EVENT_FLASH_CELLS,p.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,p.EVENT_DISPLAYED_ROWS_CHANGED,p.EVENT_LEFT_PINNED_WIDTH_CHANGED,p.EVENT_RIGHT_PINNED_WIDTH_CHANGED,p.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,p.EVENT_STORE_UPDATED,p.EVENT_COLUMN_PANEL_ITEM_DRAG_START,p.EVENT_COLUMN_PANEL_ITEM_DRAG_END,p.EVENT_FILL_START,p.EVENT_FILL_END,p.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,p.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,p.EVENT_FULL_WIDTH_ROW_FOCUSED,p.EVENT_HEADER_HEIGHT_CHANGED,p.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,p.EVENT_CELL_FOCUS_CLEARED,p.EVENT_GRID_STYLES_CHANGED,p.EVENT_FILTER_DESTROYED,p.EVENT_ROW_DATA_UPDATE_STARTED,p.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,p.EVENT_DATA_TYPES_INFERRED,p.EVENT_FIELD_VALUE_CHANGED,p.EVENT_FIELD_PICKER_VALUE_SELECTED,p.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,p.EVENT_SUPPRESS_MENU_HIDE_CHANGED,p.EVENT_SUPPRESS_FIELD_DOT_NOTATION,p.EVENT_ROW_COUNT_READY,p.EVENT_SIDE_BAR_UPDATED],ae.PUBLIC_EVENTS=ae.EVENTS.filter(e=>!Ue(ae.EXCLUDED_INTERNAL_EVENTS,e)),ae.EVENT_CALLBACKS=ae.EVENTS.map(e=>ae.getCallbackForEvent(e)),ae.STRING_PROPERTIES=gt.STRING_PROPERTIES,ae.OBJECT_PROPERTIES=gt.OBJECT_PROPERTIES,ae.ARRAY_PROPERTIES=gt.ARRAY_PROPERTIES,ae.NUMBER_PROPERTIES=gt.NUMBER_PROPERTIES,ae.BOOLEAN_PROPERTIES=gt.BOOLEAN_PROPERTIES,ae.FUNCTION_PROPERTIES=gt.FUNCTION_PROPERTIES,ae.ALL_PROPERTIES=gt.ALL_PROPERTIES,ae.ALL_PROPERTIES_AND_CALLBACKS=[...ae.ALL_PROPERTIES,...ae.EVENT_CALLBACKS],ae.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(ae.ALL_PROPERTIES_AND_CALLBACKS);var Lo=ae,qr=class extends T{constructor(){super(...arguments),this.componentsMappedByName={}}setupComponents(e){e&&e.forEach(t=>this.addComponent(t))}addComponent(e){const i=e.componentName.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().toUpperCase();this.componentsMappedByName[i]=e.componentClass}getComponentClass(e){return this.componentsMappedByName[e]}};qr=u([O("agStackComponentsRegistry")],qr);var na={};function Ye(e,t,i){null==i||"string"==typeof i&&""==i?Yr(e,t):je(e,t,i)}function je(e,t,i){e.setAttribute(la(t),i.toString())}function Yr(e,t){e.removeAttribute(la(t))}function la(e){return`aria-${e}`}function re(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function aa(e){let t;return t="asc"===e?"ascending":"desc"===e?"descending":"mixed"===e?"other":"none",t}function nh(e){return parseInt(e.getAttribute("aria-level"),10)}function da(e){return parseInt(e.getAttribute("aria-posinset"),10)}function ua(e){return e.getAttribute("aria-label")}function lt(e,t){Ye(e,"label",t)}function _o(e,t){Ye(e,"labelledby",t)}function lh(e,t){Ye(e,"describedby",t)}function jr(e,t){Ye(e,"live",t)}function ca(e,t){Ye(e,"atomic",t)}function ha(e,t){Ye(e,"relevant",t)}function pa(e,t){Ye(e,"level",t)}function Qr(e,t){Ye(e,"disabled",t)}function Es(e,t){Ye(e,"hidden",t)}function Xr(e,t){Ye(e,"activedescendant",t)}function Pt(e,t){je(e,"expanded",t)}function ga(e){Yr(e,"expanded")}function xo(e,t){je(e,"setsize",t)}function Go(e,t){je(e,"posinset",t)}function fa(e,t){je(e,"multiselectable",t)}function ma(e,t){je(e,"rowcount",t)}function Zr(e,t){je(e,"rowindex",t)}function Ca(e,t){je(e,"colcount",t)}function Jr(e,t){je(e,"colindex",t)}function va(e,t){je(e,"colspan",t)}function wa(e,t){je(e,"sort",t)}function Sa(e){Yr(e,"sort")}function Ni(e,t){Ye(e,"selected",t)}function ah(e,t){je(e,"checked",void 0===t?"mixed":t)}function en(e,t){Ye(e,"controls",t.id),_o(t,e.id)}function No(e,t){return void 0===t?e("ariaIndeterminate","indeterminate"):!0===t?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}Ce(na,{getAriaCheckboxStateName:()=>No,getAriaLabel:()=>ua,getAriaLevel:()=>nh,getAriaPosInSet:()=>da,getAriaSortState:()=>aa,removeAriaExpanded:()=>ga,removeAriaSort:()=>Sa,setAriaActiveDescendant:()=>Xr,setAriaAtomic:()=>ca,setAriaChecked:()=>ah,setAriaColCount:()=>Ca,setAriaColIndex:()=>Jr,setAriaColSpan:()=>
1va,setAriaControls:()=>en,setAriaDescribedBy:()=>lh,setAriaDisabled:()=>Qr,setAriaExpanded:()=>Pt,setAriaHidden:()=>Es,setAriaLabel:()=>lt,setAriaLabelledBy:()=>_o,setAriaLevel:()=>pa,setAriaLive:()=>jr,setAriaMultiSelectable:()=>fa,setAriaPosInSet:()=>Go,setAriaRelevant:()=>ha,setAriaRole:()=>re,setAriaRowCount:()=>ma,setAriaRowIndex:()=>Zr,setAriaSelected:()=>Ni,setAriaSetSize:()=>xo,setAriaSort:()=>wa});var tn,ko,sn,on,rn,nn,ln,an,Ea={};function ft(){return void 0===tn&&(tn=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),tn}function dn(){if(void 0===ko)if(ft()){const e=navigator.userAgent.match(/version\/(\d+)/i);e&&(ko=null!=e[1]?parseFloat(e[1]):0)}else ko=0;return ko}function Vo(){if(void 0===sn){const e=window;sn=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return sn}function un(){return void 0===on&&(on=/(firefox)/i.test(navigator.userAgent)),on}function cn(){return void 0===rn&&(rn=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),rn}function At(){return void 0===nn&&(nn=/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),nn}function hn(){return!ft()||dn()>=15}function Ho(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return-1!==t||null!==i&&(""!==i||un())?t.toString():null}function ya(){if(!document.body)return-1;let e=1e6;const t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const s=2*e;if(i.style.height=s+"px",s>t||i.clientHeight!==s)break;e=s}return document.body.removeChild(i),e}function Ra(){var e,t,i;return null!=(i=null==(e=document.body)?void 0:e.clientWidth)?i:window.innerHeight||(null==(t=document.documentElement)?void 0:t.clientWidth)||-1}function Da(){var e,t,i;return null!=(i=null==(e=document.body)?void 0:e.clientHeight)?i:window.innerHeight||(null==(t=document.documentElement)?void 0:t.clientHeight)||-1}function Ta(){return null==an&&ba(),an}function ba(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let i=t.offsetWidth-t.clientWidth;0===i&&0===t.clientWidth&&(i=null),t.parentNode&&t.parentNode.removeChild(t),null!=i&&(an=i,ln=0===i)}function pn(){return null==ln&&ba(),ln}Ce(Ea,{browserSupportsPreventScroll:()=>hn,getBodyHeight:()=>Da,getBodyWidth:()=>Ra,getMaxDivHeight:()=>ya,getSafariVersion:()=>dn,getScrollbarWidth:()=>Ta,getTabIndex:()=>Ho,isBrowserChrome:()=>Vo,isBrowserFirefox:()=>un,isBrowserSafari:()=>ft,isIOSUserAgent:()=>At,isInvisibleScrollbar:()=>pn,isMacOsUserAgent:()=>cn});var Pa={};Ce(Pa,{dateToFormattedString:()=>Vi,parseDateTimeFromString:()=>_e,serialiseDate:()=>Qe});var Aa={};function ki(e,t){return e.toString().padStart(t,"0")}function Fa(e,t){const i=[];for(let s=e;s<=t;s++)i.push(s);return i}function dh(e){return"string"==typeof e&&(e=parseInt(e,10)),"number"==typeof e?Math.floor(e):null}function uh(e,t){let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(255&e),e>>>=8;return i}function ch(e,t,i){return"number"!=typeof e?"":gn(Math.round(100*e)/100,t,i)}function gn(e,t,i){return"number"!=typeof e?"":e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${t}`)}function hh(e){return null==e?null:e.reduce((t,i)=>t+i,0)}function Qe(e,t=!0,i="-"){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(o=>ki(o,2)).join(i);return t&&(s+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map(o=>ki(o,2)).join(":")),s}Ce(Aa,{cleanNumber:()=>dh,createArrayOfNumbers:()=>Fa,decToHex:()=>uh,formatNumberCommas:()=>gn,formatNumberTwoDecimalPlacesAndCommas:()=>ch,padStartWidthZeros:()=>ki,sum:()=>hh});var fn=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function Vi(e,t="YYYY-MM-DD"){const i=ki(e.getFullYear(),4),s=["January","February","March","April","May","June","July","August","September","October","November","December"],o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
1ay","Saturday"],r={YYYY:()=>i.slice(i.length-4,i.length),YY:()=>i.slice(i.length-2,i.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>s[e.getMonth()],MMM:()=>s[e.getMonth()].slice(0,3),MM:()=>ki(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${fn(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${fn(e.getDate())}`,DD:()=>ki(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>o[e.getDay()],ddd:()=>o[e.getDay()].slice(0,3),dd:()=>o[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${fn(e.getDay())}`,d:()=>`${e.getDay()}`},n=new RegExp(Object.keys(r).join("|"),"g");return t.replace(n,l=>l in r?r[l]():l)}function _e(e){if(!e)return null;const[t,i]=e.split(" ");if(!t)return null;const s=t.split("-").map(g=>parseInt(g,10));if(3!==s.filter(g=>!isNaN(g)).length)return null;const[o,r,n]=s,l=new Date(o,r-1,n);if(l.getFullYear()!==o||l.getMonth()!==r-1||l.getDate()!==n)return null;if(!i||"00:00:00"===i)return l;const[a,c,h]=i.split(":").map(g=>parseInt(g,10));return a>=0&&a<24&&l.setHours(a),c>=0&&c<60&&l.setMinutes(c),h>=0&&h<60&&l.setSeconds(h),l}var Bo,Oa={};function mn(e,t,i){const s=e.parentElement;let o=s&&s.firstChild;for(;o;)t&&o.classList.toggle(t,o===e),i&&o.classList.toggle(i,o!==e),o=o.nextSibling}Ce(Oa,{FOCUSABLE_EXCLUDE:()=>Cn,FOCUSABLE_SELECTOR:()=>Ma,addOrRemoveAttribute:()=>mt,addStylesToElement:()=>Dn,bindCellRendererToHtmlElement:()=>bn,clearElement:()=>ce,copyNodeList:()=>Ga,ensureDomOrder:()=>yn,formatSize:()=>Wo,getAbsoluteHeight:()=>wn,getAbsoluteWidth:()=>Rs,getElementRectWithOffset:()=>Sn,getElementSize:()=>Vt,getInnerHeight:()=>ys,getInnerWidth:()=>Jt,getScrollLeft:()=>Ts,insertWithDomOrder:()=>La,isElementChildOfClass:()=>Zt,isFocusableFormField:()=>vn,isHorizontalScrollShowing:()=>_a,isInDOM:()=>En,isNodeOrElement:()=>As,isRtlNegativeScroll:()=>Ds,isVerticalScrollShowing:()=>xa,isVisible:()=>ze,iterateNamedNodeMap:()=>Na,loadTemplate:()=>xe,nodeListForEach:()=>Tn,radioCssClass:()=>mn,removeFromParent:()=>at,setDisabled:()=>Hi,setDisplayed:()=>U,setDomChildOrder:()=>Rn,setElementHeight:()=>ph,setElementWidth:()=>Ps,setFixedHeight:()=>ei,setFixedWidth:()=>Xe,setScrollLeft:()=>bs,setVisible:()=>Ia});var Ma="[tabindex], input, select, button, textarea, [href]",Cn="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function vn(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,s=t.call(e,"input, select, button, textarea"),o=t.call(e,Cn),r=ze(e);return s&&!o&&r}function U(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-hidden",!t),s||Es(e,!t)}function Ia(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-invisible",!t),s||Es(e,!t)}function Hi(e,t){const i="disabled",s=t?o=>o.setAttribute(i,""):o=>o.removeAttribute(i);s(e),Tn(e.querySelectorAll("input"),o=>s(o))}function Zt(e,t,i){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,"number"==typeof i){if(++s>i)break}else if(e===i)break}return!1}function Vt(e){const{height:t,width:i,borderTopWidth:s,borderRightWidth:o,borderBottomWidth:r,borderLeftWidth:n,paddingTop:l,paddingRight:a,paddingBottom:c,paddingLeft:h,marginTop:g,marginRight:m,marginBottom:C,marginLeft:v,boxSizing:E}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(i||"0"),borderTopWidth:parseFloat(s||"0"),borderRightWidth:parseFloat(o||"0"),borderBottomWidth:parseFloat(r||"0"),borderLeftWidth:parseFloat(n||"0"),paddingTop:parseFloat(l||"0"),paddingRight:parseFloat(a||"0"),paddingBottom:parseFloat(c||"0"),paddingLeft:parseFloat(h||"0"),marginTop:parseFloat(g||"0"),marginRight:parseFloat(m||"0"),marginBottom:parseFloat(C||"0"),marginLeft:parseFloat(v||"0"),boxSizing:E}}function ys(e){const t=Vt(e);return"border-box"===t.boxSizing?t.height-t.paddingTop-t.paddingBottom:t.height}function Jt(e){const t=Vt(e);return"border-box"===t.boxSizing?t.width-t.paddingLeft-t.paddingRight:t.width}function wn(e){const t=Vt(e);return Math.ceil(e.offsetHeight+(t.marginBottom+t.marginTop))}function Rs(e){const t=Vt(e);return Math.ceil(e.offsetWidth+(t.marginLeft+t.marginRight))}function Sn(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:s,borderRightWidth:o,borderBottomWidth:r}=Vt(e);
1return{top:t.top+(i||0),left:t.left+(s||0),right:t.right+(o||0),bottom:t.bottom+(r||0)}}function Ds(){if("boolean"==typeof Bo)return Bo;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML='<div style="width: 2px">\n <span style="display: inline-block; width: 1px"></span>\n <span style="display: inline-block; width: 1px"></span>\n </div>',document.body.appendChild(e),e.scrollLeft=1,Bo=0===Math.floor(e.scrollLeft),document.body.removeChild(e),Bo}function Ts(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),Vo()&&!Ds()&&(i=e.scrollWidth-e.clientWidth-i)),i}function bs(e,t,i){i&&(Ds()?t*=-1:(ft()||Vo())&&(t=e.scrollWidth-e.clientWidth-t)),e.scrollLeft=t}function ce(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function at(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function En(e){return!!e.offsetParent}function ze(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!En(e)||"visible"!==window.getComputedStyle(e).visibility)}function xe(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function yn(e,t,i){i&&i.nextSibling===t||(i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t))}function Rn(e,t){for(let i=0;i<t.length;i++){const s=t[i],o=e.children[i];o!==s&&e.insertBefore(s,o)}}function La(e,t,i){i?i.insertAdjacentElement("afterend",t):e.firstChild?e.insertAdjacentElement("afterbegin",t):e.appendChild(t)}function Dn(e,t){if(t)for(const[i,s]of Object.entries(t)){if(!i||!i.length||null==s)continue;const o=oa(i),r=s.toString(),n=r.replace(/\s*!important/g,"");e.style.setProperty(o,n,n.length!=r.length?"important":void 0)}}function _a(e){return e.clientWidth<e.scrollWidth}function xa(e){return e.clientHeight<e.scrollHeight}function Ps(e,t){"flex"===t?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):Xe(e,t)}function Xe(e,t){t=Wo(t),e.style.width=t.toString(),e.style.maxWidth=t.toString(),e.style.minWidth=t.toString()}function ph(e,t){"flex"===t?(e.style.removeProperty("height"),e.style.removeProperty("minHeight"),e.style.removeProperty("maxHeight"),e.style.flex="1 1 auto"):ei(e,t)}function ei(e,t){t=Wo(t),e.style.height=t.toString(),e.style.maxHeight=t.toString(),e.style.minHeight=t.toString()}function Wo(e){return"number"==typeof e?`${e}px`:e}function As(e){return e instanceof Node||e instanceof HTMLElement}function Ga(e){if(null==e)return[];const t=[];return Tn(e,i=>t.push(i)),t}function Na(e,t){if(e)for(let i=0;i<e.length;i++){const s=e[i];t(s.name,s.value)}}function mt(e,t,i){null==i?e.removeAttribute(t):e.setAttribute(t,i.toString())}function Tn(e,t){if(null!=e)for(let i=0;i<e.length;i++)t(e[i])}function bn(e,t){e.then(i=>{const s=i.getGui();null!=s&&("object"==typeof s?t.appendChild(s):t.innerHTML=s)})}var ka={};function Va(e,t,i){const s={},o=e.filter(r=>!t.some(n=>n===r));return o.length>0&&o.forEach(r=>s[r]=Fs(r,i).values),s}function Fs(e,t,i,s){let o=t.map((l,a)=>({value:l,relevance:gh(e.toLowerCase(),l.toLocaleLowerCase()),idx:a}));if(o.sort((l,a)=>a.relevance-l.relevance),i&&(o=o.filter(l=>0!==l.relevance)),o.length>0&&s&&s>0){const a=o[0].relevance*s;o=o.filter(c=>a-c.relevance<0)}const r=[],n=[];for(const l of o)r.push(l.value),n.push(l.idx);return{values:r,indices:n}}function gh(e,t){const i=e.replace(/\s/g,""),s=t.replace(/\s/g,"");let o=0,r=-1;for(let n=0;n<i.length;n++){const l=s.indexOf(i[n],r+1);-1!==l&&(r=l,o+=100-100*r/1e4*100)}return o}Ce(ka,{fuzzyCheckStrings:()=>Va,fuzzySuggestions:()=>Fs});var Ha={};Ce(Ha,{createIcon:()=>Ze,createIconNoSpan:()=>oe,iconNameClassMap:()=>Ba});var Ba={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",menuAlt:"menu-alt",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus"};function Ze(e,t,i){const s=oe(e,t,i);if(s){const{className:r}=s;if("string"==typeof r&&r.indexOf("ag-icon")>-1||"object"==typeof r&&r["ag-icon"])return s}const o=document.createElement("span");return o.appendChild(s),o}function oe(e,t,i,s){let o=null;const r=i&&i.getColDef().icons;
1if(r&&(o=r[e]),t&&!o){const n=t.get("icons");n&&(o=n[e])}if(!o){const n=document.createElement("span");let l=Ba[e];return l||(s?l=e:(console.warn(`AG Grid: Did not find icon ${e}`),l="")),n.setAttribute("class",`ag-icon ag-icon-${l}`),n.setAttribute("unselectable","on"),re(n,"presentation"),n}{let n;if("function"==typeof o)n=o();else{if("string"!=typeof o)throw new Error("icon from grid options needs to be a string or a function");n=o}if("string"==typeof n)return xe(n);if(As(n))return n;console.warn("AG Grid: iconRenderer should return back a string or a dom object")}}var Wa={};Ce(Wa,{isDeleteKey:()=>Ka,isEventFromPrintableCharacter:()=>Uo,isUserSuppressingHeaderKeyboardEvent:()=>Ua,isUserSuppressingKeyboardEvent:()=>zo,normaliseQwertyAzerty:()=>za});var w=class{};w.BACKSPACE="Backspace",w.TAB="Tab",w.ENTER="Enter",w.ESCAPE="Escape",w.SPACE=" ",w.LEFT="ArrowLeft",w.UP="ArrowUp",w.RIGHT="ArrowRight",w.DOWN="ArrowDown",w.DELETE="Delete",w.F2="F2",w.PAGE_UP="PageUp",w.PAGE_DOWN="PageDown",w.PAGE_HOME="Home",w.PAGE_END="End",w.A="KeyA",w.C="KeyC",w.D="KeyD",w.V="KeyV",w.X="KeyX",w.Y="KeyY",w.Z="KeyZ";var fh=65,mh=67,Ch=86,vh=68,wh=90,Sh=89;function Uo(e){return!(e.altKey||e.ctrlKey||e.metaKey)&&1===e.key.length}function zo(e,t,i,s,o){const r=s?s.getColDef().suppressKeyboardEvent:void 0;if(!r)return!1;const n=e.addGridCommonParams({event:t,editing:o,column:s,node:i,data:i.data,colDef:s.getColDef()});return!(!r||!r(n))}function Ua(e,t,i,s){const o=s.getDefinition(),r=o&&o.suppressHeaderKeyboardEvent;return!!R(r)&&!!r(e.addGridCommonParams({colDef:o,column:s,headerRowIndex:i,event:t}))}function za(e){const{keyCode:t}=e;let i;switch(t){case fh:i=w.A;break;case mh:i=w.C;break;case Ch:i=w.V;break;case vh:i=w.D;break;case wh:i=w.Z;break;case Sh:i=w.Y;break;default:i=e.code}return i}function Ka(e,t=!1){return e===w.DELETE||!t&&e===w.BACKSPACE&&cn()}var $a={};function Pn(e,t,i){if(0===i)return!1;const s=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(s,o)<=i}Ce($a,{areEventsNear:()=>Pn});var qa={};function Eh(e,t){if(!e)return!1;const i=(n,l)=>{const a=t[n.id],c=t[l.id],h=void 0!==a,g=void 0!==c;return h&&g?a-c:h||g?h?1:-1:n.__objectId-l.__objectId};let s,o,r=!1;for(let n=0;n<e.length-1;n++)if(s=e[n],o=e[n+1],i(s,o)>0){r=!0;break}return!!r&&(e.sort(i),!0)}Ce(qa,{sortRowNodesByOrder:()=>Eh});var Ya={};function An(e){const t=new Set;return e.forEach(i=>t.add(i)),t}Ce(Ya,{convertToSet:()=>An});var H=L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L({},na),Kl),Ea),Pa),Oa),zl),Gl),ka),Ll),Ha),Wa),ra),$a),Aa),_l),qa),Ya),ia),Bi=class{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue+=e}},Ge=class Dr{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(i=>this.onDone(i),i=>this.onReject(i))}static all(t){return new Dr(i=>{let s=t.length;const o=new Array(s);t.forEach((r,n)=>{r.then(l=>{o[n]=l,s--,0===s&&i(o)})})})}static resolve(t=null){return new Dr(i=>i(t))}then(t){return new Dr(i=>{1===this.status?i(t(this.resolution)):this.waiters.push(s=>i(t(s)))})}resolveNow(t,i){return 1===this.status?i(this.resolution):t}onDone(t){this.status=1,this.resolution=t,this.waiters.forEach(i=>i(t))}onReject(t){console.warn("TBI")}},Dh=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1)t.forEach(s=>this.addCssClass(s));else if(!0!==this.cssClassStates[e]&&e.length){const s=this.getGui();s&&s.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1)t.forEach(s=>this.removeCssClass(s));else if(!1!==this.cssClassStates[e]&&e.length){const s=this.getGui();s&&s.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return!!t&&t.classList.contains(e)}addOrRemoveCssClass(e,t){if(e){if(e.indexOf(" ")>=0){const s=(e||"").split(" ");if(s.length>1)return void s.forEach(o=>this.addOrRemoveCssClass(o,t))}if(this.cssClassStates[e]!==t&&e.length){const s=this.getGui();s&&s.classList.toggle(e,t),this.cssClassStates[e]=t}}}}
1,Os=class Oi extends T{constructor(t,i,s,o){super(),this.parentComp=t,this.tooltipShowDelayOverride=i,this.tooltipHideDelayOverride=s,this.shouldDisplayTooltip=o,this.SHOW_QUICK_TOOLTIP_DIFF=1e3,this.FADE_OUT_TOOLTIP_TIMEOUT=1e3,this.INTERACTIVE_HIDE_DELAY=100,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}postConstruct(){this.gridOptionsService.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gridOptionsService.get("tooltipMouseTrack");const t=this.parentComp.getGui();0===this.tooltipTrigger&&(this.addManagedListener(t,"mouseenter",this.onMouseEnter.bind(this)),this.addManagedListener(t,"mouseleave",this.onMouseLeave.bind(this))),1===this.tooltipTrigger&&(this.addManagedListener(t,"focusin",this.onFocusIn.bind(this)),this.addManagedListener(t,"focusout",this.onFocusOut.bind(this))),this.addManagedListener(t,"mousemove",this.onMouseMove.bind(this)),this.interactionEnabled||(this.addManagedListener(t,"mousedown",this.onMouseDown.bind(this)),this.addManagedListener(t,"keydown",this.onKeyDown.bind(this)))}getGridOptionsTooltipDelay(t){const i=this.gridOptionsService.get(t);return i<0&&x(`${t} should not be lower than 0`),Math.max(200,i)}getTooltipDelay(t){var i,s;return"show"===t?null!=(i=this.tooltipShowDelayOverride)?i:this.getGridOptionsTooltipDelay("tooltipShowDelay"):null!=(s=this.tooltipHideDelayOverride)?s:this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const t=this.gridOptionsService.get("tooltipTrigger");return t&&"hover"!==t?1:0}onMouseEnter(t){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),!At()&&(Oi.isLocked?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(t)},this.INTERACTIVE_HIDE_DELAY):this.prepareToShowTooltip(t))}onMouseMove(t){this.lastMouseEvent&&(this.lastMouseEvent=t),this.tooltipMouseTrack&&2===this.state&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(t){var i;const s=t.relatedTarget,o=this.parentComp.getGui(),r=null==(i=this.tooltipComp)?void 0:i.getGui();this.isInteractingWithTooltip||o.contains(s)||this.interactionEnabled&&r?.contains(s)||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(t){if(0!=this.state||Oi.isLocked)return;let i=0;t&&(i=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=t||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),i),this.state=1}isLastTooltipHiddenRecently(){return(new Date).getTime()-Oi.lastTooltipHideTime<this.SHOW_QUICK_TOOLTIP_DIFF}setToDoNothing(){2===this.state&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const t=L({},this.parentComp.getTooltipParams());if(!R(t.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip())return void this.setToDoNothing();this.state=2,this.tooltipInstanceCount++;const i=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(t).newAgStackInstance().then(i)}hideTooltip(t){if(!t&&this.isInteractingWithTooltip)return;this.tooltipComp&&(this.destroyTooltipComp(),Oi.lastTooltipHideTime=(new Date).getTime());const i={type:p.EVENT_TOOLTIP_HIDE,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(i),this.state=0}newTooltipComponentCallback(t,i){if(2!==this.state||this.tooltipInstanceCount!==t)return void this.getContext().destroyBean(i);const o=i.getGui();this.tooltipComp=i,o.classList.contains("ag-tooltip")||o.classList.add("ag-tooltip-custom"),0===this.tooltipTrigger&&o.classList.add("ag-tooltip-animate"),this.interactionEnabled&&o.classList.add("ag-tooltip-interactive");const r=this.localeService.getLocaleTextFunc(),n=this.popupService.addPopup({eChild:o,ariaLabel:r("ariaLabelTooltip","Tooltip")});n&&(this.tooltipPopupDestroyFunc=n.hideFunc),this.positionTooltip(),1===this.tooltipTrigger&&(this.onBodyScrollEventCallback=this.addManagedListener(this.eventService,p.EVENT_BODY_SCROLL,this.setToDoNothing.bind(this)),this.onColumnMovedEventCallback=this.addManagedListener(this.eventService,p.EVENT_COLUMN_MOVED,this.setToDoNothing.bind(this))),this.interactionEnabled&&(0===this.tooltipTrigger?(this.tooltipMouseEnterListener=this.addManagedListener(o,"mouseenter",this.onTooltipMouseEnter.bind(this))||null,this.tooltipMouseLeaveListener=this.addManagedListener(o,"mouseleave",this.onTooltipMouseLeave.bind(this))||null):(this.tooltipFocusInListener=this.addManagedListener(o,"focusin",this.onTooltipFocusIn.bind(this))||null,this.tooltipFocusOutListener=this.addManagedListener(o,"focusout",this.onTooltipFocusOut.bind(this))||null));const l={type:p.EVENT_TOOLTIP_SHOW,tooltipGui:o,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(l),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}onTooltipFocusOut(t){var i;const s=this.parentComp.getGui(),o=null==(i=this.tooltipComp)?void 0:i.getGui(),r=t.relatedTarget;o?.contains(r)||(this.isInteractingWithTooltip=!1,s.contains(r)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const t={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent(ie(L({},t),{mouseEvent:this.lastMouseEvent})):this.popupService.positionPopupByComponent(ie(L({},t),{eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5}))}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const t=this.tooltipPopupDestroyFunc,i=this.tooltipComp;window.setTimeout(()=>{t(),this.getContext().destroyBean(i)},0===this.tooltipTrigger?this.FADE_OUT_TOOLTIP_TIMEOUT:0),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach(t=>{t&&t()}),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){Oi.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},this.INTERACTIVE_HIDE_DELAY)}unlockService(){Oi.isLocked=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}};Os.isLocked=!1,u([f("popupService")],Os.prototype,"popupService",2),u([f("userComponentFactory")],Os.prototype,"userComponentFactory",2),u([b],Os.prototype,"postConstruct",1);var Th=Os,Ft=class extends T{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}postConstruct(){this.refreshToolTip()}setBrowserTooltip(e){const t="title",i=this.ctrl.getGui();i&&(null!=e&&""!=e?i.setAttribute(t,e):i.removeAttribute(t))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){var e,t,i,s;null==this.tooltipManager&&(this.tooltipManager=this.createBean(new Th({getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()},null==(t=(e=this.ctrl).getTooltipShowDelayOverride)?void 0:t.call(e),null==(s=(i=this.ctrl).getTooltipHideDelayOverride)?void 0:s.call(i),this.ctrl.
1shouldDisplayTooltip),this.beans.context))}refreshToolTip(){this.browserTooltips=this.beans.gridOptionsService.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context))):(this.setBrowserTooltip(null),this.createTooltipFeatureIfNeeded())}getTooltipParams(){const e=this.ctrl,t=e.getColumn?e.getColumn():void 0,i=e.getColDef?e.getColDef():void 0,s=e.getRowNode?e.getRowNode():void 0;return{location:e.getLocation(),colDef:i,column:t,rowIndex:e.getRowIndex?e.getRowIndex():void 0,node:s,data:s?s.data:void 0,value:this.getTooltipText(),valueFormatted:e.getValueFormatted?e.getValueFormatted():void 0,hideTooltipCallback:()=>{var o;return null==(o=this.tooltipManager)?void 0:o.hideTooltip(!0)}}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}};u([f("beans")],Ft.prototype,"beans",2),u([b],Ft.prototype,"postConstruct",1);var bh=new Bi,Ms=class wl extends T{constructor(t){super(),this.displayed=!0,this.visible=!0,this.compId=bh.next(),this.cssClassManager=new Dh(()=>this.eGui),t&&this.setTemplate(t)}preConstructOnComponent(){this.usingBrowserTooltips=this.gridOptionsService.get("enableBrowserTooltips")}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(t){const{newTooltipText:i,showDelayOverride:s,hideDelayOverride:o,location:r,shouldDisplayTooltip:n}=t||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==i&&(this.tooltipText=i),null!=i&&(this.tooltipFeature=this.createBean(new Ft({getTooltipValue:()=>this.tooltipText,getGui:()=>this.getGui(),getLocation:()=>r??"UNKNOWN",getTooltipShowDelayOverride:null!=s?()=>s:void 0,getTooltipHideDelayOverride:null!=o?()=>o:void 0,shouldDisplayTooltip:n})))}createChildComponentsFromTags(t,i){Ga(t.childNodes).forEach(o=>{if(!(o instanceof HTMLElement))return;const r=this.createComponentFromElement(o,n=>{n.getGui()&&this.copyAttributesFromNode(o,n.getGui())},i);if(r){if(r.addItems&&o.children.length){this.createChildComponentsFromTags(o,i);const n=Array.prototype.slice.call(o.children);r.addItems(n)}this.swapComponentForNode(r,t,o)}else o.childNodes&&this.createChildComponentsFromTags(o,i)})}createComponentFromElement(t,i,s){const o=t.nodeName,r=s?s[t.getAttribute("ref")]:void 0,n=this.agStackComponentsRegistry.getComponentClass(o);if(n){wl.elementGettingCreated=t;const l=new n(r);return l.setParentComponent(this),this.createBean(l,null,i),l}return null}copyAttributesFromNode(t,i){Na(t.attributes,(s,o)=>i.setAttribute(s,o))}swapComponentForNode(t,i,s){const o=t.getGui();i.replaceChild(o,s),i.insertBefore(document.createComment(s.nodeName),o),this.addDestroyFunc(this.destroyBean.bind(this,t)),this.swapInComponentForQuerySelectors(t,s)}swapInComponentForQuerySelectors(t,i){const s=this;this.iterateOverQuerySelectors(o=>{s[o.attributeName]===i&&(s[o.attributeName]=t)})}iterateOverQuerySelectors(t){let i=Object.getPrototypeOf(this);for(;null!=i;){const s=i.__agComponentMetaData,o=To(i.constructor);s&&s[o]&&s[o].querySelectors&&s[o].querySelectors.forEach(r=>t(r)),i=Object.getPrototypeOf(i)}}activateTabIndex(t){const i=this.gridOptionsService.get("tabIndex");t||(t=[]),t.length||t.push(this.getGui()),t.forEach(s=>s.setAttribute("tabindex",i.toString()))}setTemplate(t,i){const s=xe(t);this.setTemplateFromElement(s,i)}setTemplateFromElement(t,i){this.eGui=t,this.eGui.__agComponent=this,this.wireQuerySelectors(),this.getContext()&&this.createChildComponentsFromTags(this.getGui(),i)}createChildComponentsPreConstruct(){this.getGui()&&this.createChildComponentsFromTags(this.getGui())}wireQuerySelectors(){if(!this.eGui)return;const t=this;this.iterateOverQuerySelectors(i=>{const s=r=>t[i.attributeName]=r;if(i.refSelector&&this.getAttribute("ref")===i.refSelector)s(this.eGui);else{const r=this.eGui.querySelector(i.querySelector);r&&s(r.__agComponent||r)}})}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(t){this.parentComponent=t}getParentComponent(){return this.parentComponent}setGui(t){this.eGui=t}queryForHtmlElement(t){return this.eGui.querySelector(t)}queryForHtmlInputElement(t){return this.eGui.querySelector(t)}appendChild(t,i){null!=t&&(i||(i=this.eGui),As(t)?i.appendChild(t):i.appendChild(t.getGui()))}isDisplayed(){return this.displayed}setVisible(t,i={}){if(t!==this.visible){this.visible=t;const{skipAriaHidden:s}=i;Ia(this.eGui,t,{skipAriaHidden:s})}}setDisplayed(t,i={}){if(t!==this.displayed){this.displayed=t;const{skipAriaHidden:s}=i;U(this.eGui,t,{skipAriaHidden:s}),this.dispatchEvent({type:wl.EVENT_DISPLAYED_CHANGED,visible:this.displayed})}}destroy(){this.parentComponent&&(this.parentComponent=void 0),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const t=this.eGui;t&&t.__agComponent&&(t.__agComponent=void 0),super.destroy()}
1addGuiEventListener(t,i,s){this.eGui.addEventListener(t,i,s),this.addDestroyFunc(()=>this.eGui.removeEventListener(t,i))}addCssClass(t){this.cssClassManager.addCssClass(t)}removeCssClass(t){this.cssClassManager.removeCssClass(t)}containsCssClass(t){return this.cssClassManager.containsCssClass(t)}addOrRemoveCssClass(t,i){this.cssClassManager.addOrRemoveCssClass(t,i)}getAttribute(t){const{eGui:i}=this;return i?i.getAttribute(t):null}getRefElement(t){return this.queryForHtmlElement(`[ref="${t}"]`)}};Ms.EVENT_DISPLAYED_CHANGED="displayedChanged",u([f("agStackComponentsRegistry")],Ms.prototype,"agStackComponentsRegistry",2),u([Bl],Ms.prototype,"preConstructOnComponent",1),u([Bl],Ms.prototype,"createChildComponentsPreConstruct",1);var k=Ms;function A(e){return ja.bind(this,`[ref=${e}]`,e)}function ja(e,t,i,s,o){null!==e?"number"!=typeof o?function Ph(e,t,i){const s=function Ah(e,t){return e.__agComponentMetaData||(e.__agComponentMetaData={}),e.__agComponentMetaData[t]||(e.__agComponentMetaData[t]={}),e.__agComponentMetaData[t]}(e,To(e.constructor));s[t]||(s[t]=[]),s[t].push(i)}(i,"querySelectors",{attributeName:s,querySelector:e,refSelector:t}):console.error("AG Grid: QuerySelector should be on an attribute"):console.error("AG Grid: QuerySelector selector should not be null")}var Fn=class extends k{constructor(){super('\n <div class="ag-floating-filter-input" role="presentation">\n <ag-input-text-field ref="eFloatingFilterText"></ag-input-text-field>\n </div>')}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnModel.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){null!=e?this.params.parentFilterInstance(t=>{if(t.getModelAsString){const i=t.getModelAsString(e);this.eFloatingFilterText.setValue(i)}}):this.eFloatingFilterText.setValue("")}onParamsUpdated(e){this.refresh(e)}refresh(e){this.init(e)}};u([A("eFloatingFilterText")],Fn.prototype,"eFloatingFilterText",2),u([f("columnModel")],Fn.prototype,"columnModel",2);var Qa=class{constructor(e,t,i,s){this.alive=!0,this.context=e,this.eParent=s,t.getDateCompDetails(i).newAgStackInstance().then(n=>{this.alive?(this.dateComp=n,n&&(s.appendChild(n.getGui()),n.afterGuiAttached&&n.afterGuiAttached(),this.tempValue&&n.setDate(this.tempValue),null!=this.disabled&&this.setDateCompDisabled(this.disabled))):e.destroyBean(n)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){U(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&"function"==typeof this.dateComp.afterGuiAttached&&this.dateComp.afterGuiAttached(e)}updateParams(e){var t,i;let s=!1;null!=(t=this.dateComp)&&t.refresh&&"function"==typeof this.dateComp.refresh&&null!==this.dateComp.refresh(e)&&(s=!0),!s&&null!=(i=this.dateComp)&&i.onParamsUpdated&&"function"==typeof this.dateComp.onParamsUpdated&&null!==this.dateComp.onParamsUpdated(e)&&x("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}setDateCompDisabled(e){null!=this.dateComp&&null!=this.dateComp.setDisabled&&this.dateComp.setDisabled(e)}},Xa=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach(e=>{"string"!=typeof e&&([["displayKey"],["displayName"],["predicate","test"]].every(s=>!!s.some(o=>null!=e[o])||(console.warn(`AG Grid: ignoring FilterOptionDef as it doesn't contain one of '${s}'`),!1))?this.customFilterOptions[e.displayKey]=e:this.filterOptions=this.filterOptions.filter(s=>s===e)||[])})}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const t=this.filterOptions[0];"string"==typeof t?this.defaultOption=t:t.displayKey?this.defaultOption=t.displayKey:console.warn("AG Grid: invali
1d FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else console.warn("AG Grid: no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(e){return this.customFilterOptions[e]}},Za={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd"},Ko=class gu extends T{constructor(t,i={}){super(),this.eFocusableElement=t,this.callbacks=i,this.callbacks=L({shouldStopEventPropagation:()=>!1,onTabKeyDown:s=>{if(s.defaultPrevented)return;const o=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,s.shiftKey);o&&(o.focus(),s.preventDefault())}},i)}postConstruct(){this.eFocusableElement.classList.add(gu.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedListener(this.eFocusableElement,"focusin",this.callbacks.onFocusIn),this.callbacks.onFocusOut&&this.addManagedListener(this.eFocusableElement,"focusout",this.callbacks.onFocusOut)}addKeyDownListeners(t){this.addManagedListener(t,"keydown",i=>{if(!i.defaultPrevented&&!nt(i)){if(this.callbacks.shouldStopEventPropagation(i))return void rt(i);i.key===w.TAB?this.callbacks.onTabKeyDown(i):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(i)}})}};Ko.FOCUS_MANAGED_CLASS="ag-focus-managed",u([f("focusService")],Ko.prototype,"focusService",2),u([b],Ko.prototype,"postConstruct",1);var Ht=Ko,Ja="ag-resizer-wrapper",Fh=`<div class="${Ja}">\n <div ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>\n <div ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>\n <div ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>\n <div ref="eRightResizer" class="ag-resizer ag-resizer-right"></div>\n <div ref="eBottomRightResizer" class="ag-resizer ag-resizer-bottomRight"></div>\n <div ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>\n <div ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>\n <div ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>\n </div>`,Wi=class extends T{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},t)}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,s=e/2-this.getHeight()/2;this.offsetElement(i,s)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:s,minHeight:o,height:r,x:n,y:l}=this.config;this.offsetParent||this.setOffsetParent();let a=0,c=0;const h=ze(this.element);if(h){const g=this.findBoundaryElement(),m=window.getComputedStyle(g);if(null!=m.minWidth){const C=g.offsetWidth-this.element.offsetWidth;c=parseInt(m.minWidth,10)-C}if(null!=m.minHeight){const C=g.offsetHeight-this.element.offsetHeight;a=parseInt(m.minHeight,10)-C}}if(this.minHeight=o||a,this.minWidth=i||c,s&&this.setWidth(s),r&&this.setHeight(r),(!s||!r)&&this.refreshSize(),e)this.center();else if(n||l)this.offsetElement(n,l);else if(h&&t){let g=this.boundaryEl,m=!0;if(g||(g=this.findBoundaryElement(),m=!1),g){const C=parseFloat(g.style.top),v=parseFloat(g.style.left);m?this.offsetElement(isNaN(v)?0:v,isNaN(C)?0:C):this.setPosition(v,C)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const i=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(i),this.moveElementDragListener=i):(this.dragService.removeDragSource(i),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),"boolean"==typeof e){if(!1===e)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}Object.keys(e).forEach(t=>{const s=!!e[t],o=this.getResizerElement(t),r={dragStartPixels:0,eElement:o,onDragStart:n=>this.onResizeStart(n,t),onDragging:this.onResize.bind(this),onDragStop:n=>this.onResizeEnd(n,t)};(s||!this.isAlive()&&!s)&&(s?(this.dragService.addDragSource(r),this.resizeListeners.push(r),o.style.pointerEvents="all"):o.style.pointerEvents="none",this.resizable[t]=s)})}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;-1!==t&&(this.element.style.width=`${t}px`),-1!==e&&(this.element.style.height=`${e}px`)}
vendor: 10,180 bytes, line 1
1getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,i=this.element;let s=!1;if("string"==typeof e&&-1!==e.indexOf("%"))ei(i,e),e=wn(i),s=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const o=this.getAvailableHeight();o&&e>o&&(e=o)}this.getHeight()!==e&&(s?(i.style.maxHeight="unset",i.style.minHeight="unset"):t?ei(i,e):(i.style.height=`${e}px`,i.style.flex="0 0 auto",this.lastSize.height="number"==typeof e?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:i}=this.offsetParent;if(!i)return null;const s=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),r=e?this.position.y:s.top,n=e?0:o.top;let l=0;if(t){const c=this.element.parentElement;if(c){const{bottom:h}=c.getBoundingClientRect();l=h-s.bottom}}return i+n-r-l}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let s=!1;if("string"==typeof e&&-1!==e.indexOf("%"))Xe(t,e),e=Rs(t),s=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:o}=this.offsetParent,r=i?this.position.x:this.element.getBoundingClientRect().left;o&&e+r>o&&(e=o-r)}this.getWidth()!==e&&(s?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?Xe(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width="number"==typeof e?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:i}=this.config,s=i?this.boundaryEl:this.element;s&&(this.popupService.positionPopup({ePopup:s,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(s.style.left),parseFloat(s.style.top)))}constrainSizeToAvailableHeight(e){this.config.forcePopupParentAsOffsetParent&&(e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),()=>{const i=this.getAvailableHeight();this.element.style.setProperty("max-height",`${i}px`)}):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0)))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:i,isTop:s,anywhereWithin:o,topBuffer:r}=e,n=t.clientX-this.dragStartPosition.x,l=t.clientY-this.dragStartPosition.y;return{movementX:this.shouldSkipX(t,!!i,!!o,n)?0:n,movementY:this.shouldSkipY(t,!!s,r,l)?0:l}}shouldSkipX(e,t,i,s){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.x:o.left;let a=l<=0&&r.left>=e.clientX||r.right<=e.clientX&&r.right<=n.right;return!!a||(a=t?s<0&&e.clientX>l+r.left||s>0&&e.clientX<l+r.left:i?s<0&&e.clientX>n.right||s>0&&e.clientX<l+r.left:s<0&&e.clientX>n.right||s>0&&e.clientX<n.right,a)}shouldSkipY(e,t,i=0,s){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.y:o.top;let a=l<=0&&r.top>=e.clientY||r.bottom<=e.clientY&&r.bottom<=n.bottom;return!!a||(a=t?s<0&&e.clientY>l+r.top+i||s>0&&e.clientY<l+r.top:s<0&&e.clientY>n.bottom||s>0&&e.clientY<n.bottom,a)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[ref=eTopLeftResizer]")},top:{element:e.querySelector("[ref=eTopResizer]")},topRight:{element:e.querySelector("[ref=eTopRightResizer]")},right:{element:e.querySelector("[ref=eRightResizer]")},bottomRight:{element:e.querySelector("[ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[ref=eBottomLeftResizer]")},left:{element:e.querySelector("[ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const i=(new DOMParser).parseFromString(Fh,"text/html").body;e.appendChild(i.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${Ja}`);e&&this.element.removeChild(e),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:i,forcePopupParentAsOffsetParent:s}=this.config;!i&&!s&&this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const t=this.element.parentElement;return t?Array.prototype.slice.call(t.children).filter(i=>!i.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,i=0;for(let s=0;s<e.length;s++){const o=e[s],r=!!o.style.flex&&"0 0 auto"!==o.style.flex;if(o===this.element)continue;let n=this.minHeight||0,l=this.minWidth||0;if(r){const a=window.getComputedStyle(o);a.minHeight&&(n=parseInt(a.minHeight,10)),a.minWidth&&(l=parseInt(a.minWidth,10))}else n=o.offsetHeight,l=o.offsetWidth;t+=n,i+=l}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let s=0;s<i.length;s++){const o=i[s];o!==t&&(e?o.style.height=`${o.offsetHeight}px`:o.style.width=`${o.offsetWidth}px`,o.style.flex="0 0 auto",o===this.element&&(t=i[s+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:s,isRight:o,isBottom:r,isLeft:n}=this.currentResizer,l=o||n,a=r||s,{movementX:c,movementY:h}=this.calculateMouseMovement({e,isLeft:n,isTop:s}),g=this.position.x,m=this.position.y;let C=0,v=0;if(l&&c){const E=n?-1:1,S=this.getWidth(),D=S+c*E;let y=!1;n&&(C=S-D,(g+C<=0||D<=this.minWidth)&&(y=!0,C=0)),y||this.setWidth(D)}if(a&&h){const E=s?-1:1,S=this.getHeight(),D=S+h*E;let y=!1;s?(v=S-D,(m+v<=0||D<=this.minHeight)&&(y=!0,v=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&S<D&&this.getMinSizeOfSiblings().height+D>this.element.parentElement.offsetHeight&&(y=!0),y||this.setHeight(D)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&C||v)&&this.offsetElement(g+C,m+v)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:i}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:o,movementY:r}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(t+o,i+r),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.offsetParent=this.config.forcePopupParentAsOffsetParent?this.popupService.getPopupParent():this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if("static"!==window.getComputedStyle(e).position)return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}};u([f("popupService")],Wi.prototype,"popupService",2),u([f("resizeObserverService")],Wi.prototype,"resizeObserverService",2),u([f("dragService")],Wi.prototype,"dragService",2);var $o=class fo extends k{constructor(t){super(),this.filterNameKey=t,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.buttonListeners=[]}postConstruct(){this.resetTemplate(),this.createManagedBean(new Ht(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new Wi(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(t){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(t){let i=this.getGui();i&&i.removeEventListener("submit",this.onFormSubmit);const s=`\n <form class="ag-filter-wrapper">\n <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" ref="eFilterBody">\n ${this.createBodyTemplate()}\n </div>\n </form>`;this.setTemplate(s,t),i=this.getGui(),i&&i.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.providedFilterParams.readOnly}init(t){this.setParams(t),this.resetUiToDefaults(!0).then(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}setParams(t){this.providedFilterParams=t,this.applyActive=fo.isUseApplyButton(t),this.resetButtonsPanel()}updateParams(t){this.providedFilterParams=t,this.applyActive=fo.isUseApplyButton(t),this.resetUiToActiveModel(this.getModel(),()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}resetButtonsPanel(){const{buttons:t}=this.providedFilterParams,i=t&&t.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(ce(this.eButtonsPanel),this.buttonListeners.forEac
1h(r=>r?.()),this.buttonListeners=[]):i&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!i)return void(this.eButtonsPanel&&at(this.eButtonsPanel));const s=document.createDocumentFragment(),o=r=>{let n,l;switch(r){case"apply":n=this.translate("applyFilter"),l=h=>this.onBtApply(!1,!1,h);break;case"clear":n=this.translate("clearFilter"),l=()=>this.onBtClear();break;case"reset":n=this.translate("resetFilter"),l=()=>this.onBtReset();break;case"cancel":n=this.translate("cancelFilter"),l=h=>{this.onBtCancel(h)};break;default:return void console.warn("AG Grid: Unknown button type specified")}const c=xe(`<button\n type="${"apply"===r?"submit":"button"}"\n ref="${r}FilterButton"\n class="ag-button ag-standard-button ag-filter-apply-panel-button"\n >${n}\n </button>`);this.buttonListeners.push(this.addManagedListener(c,"click",l)),s.append(c)};An(t).forEach(r=>o(r)),this.eButtonsPanel.append(s),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const t=fo.getDebounceMs(this.providedFilterParams,this.getDefaultDebounceMs()),i=Pe(this.checkApplyDebounce.bind(this),t);this.onBtApplyDebounce=()=>{this.debouncePending=!0,i()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?this.appliedModel:null}setModel(t){return(null!=t?this.setModelIntoUi(t):this.resetUiToDefaults()).then(()=>{this.updateUiVisibility(),this.applyModel("api")})}onBtCancel(t){this.resetUiToActiveModel(this.getModel(),()=>{this.handleCancelEnd(t)})}handleCancelEnd(t){this.providedFilterParams.closeOnApply&&this.close(t)}resetUiToActiveModel(t,i){const s=()=>{this.onUiChanged(!1,"prevent"),i?.()};null!=t?this.setModelIntoUi(t).then(s):this.resetUiToDefaults().then(s)}onBtClear(){this.resetUiToDefaults().then(()=>this.onUiChanged())}onBtReset(){this.onBtClear(),this.onBtApply()}applyModel(t="api"){const i=this.getModelFromUi();if(!this.isModelValid(i))return!1;const s=this.appliedModel;return this.appliedModel=i,!this.areModelsEqual(s,i)}isModelValid(t){return!0}onFormSubmit(t){t.preventDefault()}onBtApply(t=!1,i=!1,s){s&&s.preventDefault(),this.applyModel(i?"rowDataUpdated":"ui")&&this.providedFilterParams.filterChangedCallback({afterFloatingFilter:t,afterDataChange:i,source:"columnFilter"});const{closeOnApply:o}=this.providedFilterParams;o&&this.applyActive&&!t&&!i&&this.close(s)}onNewRowsLoaded(){}close(t){if(!this.hidePopup)return;const s=t&&t.key;let o;("Enter"===s||"Space"===s)&&(o={keyboardEvent:t}),this.hidePopup(o),this.hidePopup=null}onUiChanged(t=!1,i){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const s=this.isModelValid(this.getModelFromUi()),o=this.getRefElement("applyFilterButton");o&&Hi(o,!s)}t&&!i||"immediately"===i?this.onBtApply(t):(!this.applyActive&&!i||"debounce"===i)&&this.onBtApplyDebounce()}afterGuiAttached(t){t&&(this.hidePopup=t.hidePopup),this.refreshFilterResizer(t?.container)}refreshFilterResizer(t){if(!this.positionableFeature||"toolPanel"===t)return;const i="floatingFilter"===t||"columnFilter"===t,{positionableFeature:s,gridOptionsService:o}=this;i?(s.restoreLastSize(),s.setResizable(o.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}static getDebounceMs(t,i){return fo.isUseApplyButton(t)?(null!=t.debounceMs&&console.warn("AG Grid: debounceMs is ignored when apply button is present"),0):null!=t.debounceMs?t.debounceMs:i}static isUseApplyButton(t){return!!t.buttons&&t.buttons.indexOf("apply")>=0}refresh(t){return this.providedFilterParams=t,!0}destroy(){const t=this.getGui();t&&t.removeEventListener("submit",this.onFormSubmit),this.hidePopup=null,this.positionableFeature&&(this.positionableFeature=this.destroyBean(this.positionableFeature)),this.appliedModel=null,super.destroy()}translate(t){return this.localeService.getLocaleTextFunc()(t,Za[t])}getCellValue(t){return this.providedFilterParams.getValue(t)}getPositionableElement(){return this.eFilterBody}};u([f("rowModel")],$o.prototype,"rowModel",2),u([A("eFilterBody")],$o.prototype,"eFilterBody",2),u([b],$o.prototype,"postConstruct",1);var qo=$o,On=class extends k{constructor(e,t){super(t),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:i,labelAlignment:s,disabled:o}=this.config;null!=o&&this.setDisabled(o),null!=e&&this.setLabelSeparator(e),null!=t&&this.setLabel(t),null!=i&&this.setLabelWidth(i),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){ce(this.eLabel),"string"==typeof this.label?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),""===this.label?(U(this.eLabel,!1),re(this.eLabel,"presentation")):(U(this.eLabel,!0),re(this.eLabel,null))}setLabelSeparator(e){return this.labelSeparator===e||(this.labelSeparator=e,null!=this.label&&this.refreshLabel()),this}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(e){return this.label===e||(this.label=e,this.refreshLabel()),this}setLabelAlignment(e){const i=this.getGui().classList;return i.toggle("ag-label-align-left","left"===e),i.toggle("ag-label-align-right","right"===e),i.toggle("ag-label-align-top","top"===e),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return null==this.label||Ps(this.eLabel,e),this}setDisabled(e){e=!!e;const t=this.getGui();return Hi(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}};u([b],On.prototype,"postConstruct",1);var ed=class extends On{constructor(e,t,i){super(e,t),this.className=i}
1postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:i}=this.config;null!=e&&this.setWidth(e),null!=t&&this.setValue(t),null!=i&&this.onValueChange(i),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId();null!==ua(e)?_o(e,""):_o(e,t??"")}setAriaLabel(e){return lt(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListener(this,p.EVENT_FIELD_VALUE_CHANGED,()=>e(this.getValue())),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return Xe(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e||(this.previousValue=this.value,this.value=e,t||this.dispatchEvent({type:p.EVENT_FIELD_VALUE_CHANGED})),this}},ti=class extends ed{constructor(e){if(super(e,e?.template||'\n <div class="ag-picker-field" role="presentation">\n <div ref="eLabel"></div>\n <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">\n <div ref="eDisplayField" class="ag-picker-field-display"></div>\n <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n </div>\n </div>',e?.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.ariaRole=e?.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:i,variableWidth:s,minPickerWidth:o,maxPickerWidth:r}=e;null!=t&&(this.pickerGap=t),this.variableWidth=!!s,null!=i&&this.setPickerMaxHeight(i),null!=o&&this.setPickerMinWidth(o),null!=r&&this.setPickerMaxWidth(r)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedListener(t,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(this.eLabel,"mousedown",this.onLabelOrWrapperMouseDown.bind(this)),this.addManagedListener(this.eWrapper,"mousedown",this.onLabelOrWrapperMouseDown.bind(this));const{pickerIcon:i,inputWidth:s}=this.config;if(i){const o=oe(i,this.gridOptionsService);o&&this.eIcon.appendChild(o)}null!=s&&this.setInputWidth(s)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gridOptionsService.get("tabIndex").toString()),Pt(e,!1),this.ariaRole&&re(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&e?.target===t)return;e.preventDefault(),this.getFocusableElement().focus()}this.skipClick?this.skipClick=!1:this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case w.UP:case w.DOWN:case w.ENTER:case w.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case w.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker())}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.gridOptionsService.getDocument(),t=this.pickerComponent.getGui();this.gridOptionsService.get("suppressScrollWhenPopupsAreOpen")||(this.destroyMouseWheelFunc=this.addManagedListener(this.eventService,p.EVENT_BODY_SCROLL,()=>{this.hidePicker()}));const i=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:s,pickerAriaLabelValue:o,modalPicker:r=!0}=this.config,n={modal:r,eChild:t,closeOnEsc:!0,closedCallback:()=>{const C=e.activeElement===e.body;this.beforeHidePicker(),C&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:i(s,o)},l=this.popupService.addPopup(n),{maxPickerHeight:a,minPickerWidth:c,maxPickerWidth:h,variableWidth:g}=this;
1g?(c&&(t.style.minWidth=c),t.style.width=Wo(Rs(this.eWrapper)),h&&(t.style.maxWidth=h)):Ps(t,h??Rs(this.eWrapper));const m=a??`${ys(this.popupService.getPopupParent())}px`;return t.style.setProperty("max-height",m),t.style.position="absolute",this.alignPickerToComponent(),l.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:e}=this.config,{pickerGap:t}=this,i=this.gridOptionsService.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:e,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:t})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){this.isAlive()&&(Pt(this.getAriaElement(),e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e))}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){var t;null!=(t=this.pickerComponent)&&t.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(e){return Ps(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return"number"==typeof e&&(e=`${e}px`),this.minPickerWidth=e??void 0,this}setPickerMaxWidth(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerWidth=e??void 0,this}setPickerMaxHeight(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerHeight=e??void 0,this}destroy(){this.hidePicker(),super.destroy()}};u([f("popupService")],ti.prototype,"popupService",2),u([A("eLabel")],ti.prototype,"eLabel",2),u([A("eWrapper")],ti.prototype,"eWrapper",2),u([A("eDisplayField")],ti.prototype,"eDisplayField",2),u([A("eIcon")],ti.prototype,"eIcon",2);var Yo=class Tr extends k{constructor(t="default",i=!1){super(`<div class="ag-list ag-${t}-list" role="listbox"></div>`),this.cssIdentifier=t,this.unFocusable=i,this.options=[],this.itemEls=[]}init(){const t=this.getGui();this.addManagedListener(t,"mouseleave",()=>this.clearHighlighted()),!this.unFocusable&&this.addManagedListener(t,"keydown",this.handleKeyDown.bind(this))}handleKeyDown(t){const i=t.key;switch(i){case w.ENTER:if(this.highlightedEl){const r=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(r)}else this.setValue(this.getValue());break;case w.DOWN:case w.UP:const s=i===w.DOWN;let o;if(t.preventDefault(),this.highlightedEl){let n=this.itemEls.indexOf(this.highlightedEl)+(s?1:-1);n=Math.min(Math.max(n,0),this.itemEls.length-1),o=this.itemEls[n]}else o=this.itemEls[s?0:this.itemEls.length-1];this.highlightItem(o)}}addOptions(t){return t.forEach(i=>this.addOption(i)),this}addOption(t){const{value:i,text:s}=t,o=s||i;return this.options.push({value:i,text:o}),this.renderOption(i,o),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0),this.itemEls.forEach(t=>{at(t)}),this.itemEls=[]}updateIndices(){const t=this.getGui().querySelectorAll(".ag-list-item");t.forEach((i,s)=>{Go(i,s+1),xo(i,t.length)})}renderOption(t,i){const s=this.gridOptionsService.getDocument(),o=s.createElement("div");re(o,"option"),o.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`);const r=s.createElement("span");o.appendChild(r),r.innerText=i,this.unFocusable||(o.tabIndex=-1),this.itemEls.push(o),this.addManagedListener(o,"mousemove",()=>this.highlightItem(o)),this.addManagedListener(o,"mousedown",n=>{n.preventDefault(),this.setValue(t)}),this.createManagedBean(new Ft({getTooltipValue:()=>i,getGui:()=>o,getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>r.scrollWidth>r.clientWidth})),this.getGui().appendChild(o)}setValue(t,i){if(this.value===t)return this.fireItemSelected(),this;if(null==t)return this.reset(i),this;const s=this.options.findIndex(o=>o.value===t);if(-1!==s){const o=this.options[s];this.value=o.value,this.displayValue=o.text,this.highlightItem(this.itemEls[s]),i||this.fireChangeEvent()}return this}setValueByIndex(t){return this.setValue(this.options[t].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const t=this.options.findIndex(i=>i.value===this.value);-1!==t&&this.highlightItem(this.itemEls[t])}reset(t){this.value=null,this.displayValue=null,this.clearHighlighted(),t||this.fireChangeEvent()}highlightItem(t){if(!ze(t))return;this.clearHighlighted(),this.highlightedEl=t,this.highlightedEl.classList.add(Tr.ACTIVE_CLASS),Ni(this.highlightedEl,!0);const i=this.getGui(),s=i.getBoundingClientRect(),o=s.top+i.scrollTop,r
1=s.height,{offsetTop:n,offsetHeight:l}=t;(n+l>o+r||n<o)&&this.highlightedEl.scrollIntoView({block:"nearest"}),this.unFocusable||this.highlightedEl.focus()}clearHighlighted(){!this.highlightedEl||!ze(this.highlightedEl)||(this.highlightedEl.classList.remove(Tr.ACTIVE_CLASS),Ni(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchEvent({type:p.EVENT_FIELD_VALUE_CHANGED}),this.fireItemSelected()}fireItemSelected(){this.dispatchEvent({type:Tr.EVENT_ITEM_SELECTED})}};Yo.EVENT_ITEM_SELECTED="selectedItem",Yo.ACTIVE_CLASS="ag-active-item",u([b],Yo.prototype,"init",1);var td=Yo,id=class fu extends ti{constructor(t){super(L({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"combobox"},t))}postConstruct(){super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gridOptionsService.get("tabIndex");const{options:t,value:i,placeholder:s}=this.config;null!=t&&this.addOptions(t),null!=i&&this.setValue(i,!0),s&&null==i&&(this.eDisplayField.textContent=s),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}onWrapperFocusOut(t){this.eWrapper.contains(t.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new td("select",!0)),this.listComponent.setParentComponent(this);const t=this.listComponent.getAriaElement(),i=`ag-select-list-${this.listComponent.getCompId()}`;t.setAttribute("id",i),en(this.getAriaElement(),t),this.listComponent.addManagedListener(this.listComponent,td.EVENT_ITEM_SELECTED,()=>{this.hidePicker(),this.dispatchEvent({type:fu.EVENT_ITEM_SELECTED})}),this.listComponent.addManagedListener(this.listComponent,p.EVENT_FIELD_VALUE_CHANGED,()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())})}createPickerComponent(){return this.listComponent}onKeyDown(t){var i;const{key:s}=t;s===w.TAB?this.hidePicker():!this.isPickerDisplayed||s!==w.ENTER&&s!==w.UP&&s!==w.DOWN?super.onKeyDown(t):null==(i=this.listComponent)||i.handleKeyDown(t)}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(t){return t.forEach(i=>this.addOption(i)),this}addOption(t){return this.listComponent.addOption(t),this}clearOptions(){var t;return null==(t=this.listComponent)||t.clearOptions(),this}setValue(t,i,s){if(this.value===t||!this.listComponent)return this;if(s||this.listComponent.setValue(t,!0),this.listComponent.getValue()===this.getValue())return this;let r=this.listComponent.getDisplayValue();return null==r&&this.config.placeholder&&(r=this.config.placeholder),this.eDisplayField.innerHTML=r,this.setTooltip({newTooltipText:r??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth}),super.setValue(t,i)}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),super.destroy()}};id.EVENT_ITEM_SELECTED="selectedItem";var jo=id,dt=class extends ed{constructor(e,t,i="text",s="input"){super(e,`\n <div role="presentation">\n <div ref="eLabel" class="ag-input-field-label"></div>\n <div ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">\n <${s} ref="eInput" class="ag-input-field-input"></${s}>\n </div>\n </div>`,t),this.inputType=i,this.displayFieldTag=s}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{inputName:e,inputWidth:t}=this.config;null!=e&&this.setInputName(e),null!=t&&this.setInputWidth(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}addInputListeners(){this.addManagedListener(this.eInput,"input",e=>this.setValue(e.target.value))}setInputType(){"input"===this.displayFieldTag&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(e){return Ps(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){return this.eInput.maxLength=e,this}setInputPlaceholder(e){return mt(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return lt(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return Hi(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){return mt(this.eInput,"autocomplete",!0===e?null:"string"==typeof e?e:"off"),this}};u([A("eLabel")],dt.prototype,"eLabel",2),u([A("eWrapper")],dt.prototype,"eWrapper",2),u([A("eInput")],dt.prototype,"eInput",2);var Qo=class extends dt{constructor(e,t="ag-checkbox",i="checkbox"){super(e,t,i),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}
1postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;"boolean"==typeof e&&this.setReadOnly(e),"boolean"==typeof t&&this.setPassive(t)}addInputListeners(){this.addManagedListener(this.eInput,"click",this.onCheckboxClick.bind(this)),this.addManagedListener(this.eLabel,"click",this.toggle.bind(this))}getNextValue(){return void 0===this.selected||!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){return this.getInputElement().name=e,this}isSelected(){return this.selected}setSelected(e,t){this.isSelected()!==e&&(this.previousValue=this.isSelected(),e=this.selected="boolean"==typeof e?e:void 0,this.eInput.checked=e,this.eInput.indeterminate=void 0===e,t||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(e,t,i){this.dispatchEvent({type:p.EVENT_FIELD_VALUE_CHANGED,selected:e,previousValue:t,event:i});const s=this.getInputElement();this.eventService.dispatchEvent({type:p.EVENT_CHECKBOX_CHANGED,id:s.id,name:s.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),i=this.selected=e.target.checked;this.refreshSelectedClass(i),this.dispatchChange(i,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",!0===e),this.eWrapper.classList.toggle("ag-indeterminate",null==e)}},sd=class extends Qo{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedListener(this.eventService,p.EVENT_CHECKBOX_CHANGED,this.onChange.bind(this))}onChange(e){e.selected&&e.name&&this.eInput.name&&this.eInput.name===e.name&&e.id&&this.eInput.id!==e.id&&this.setValue(!1,!0)}},Mn=class{constructor(e,t,i){this.localeService=e,this.optionsFactory=t,this.valueFormatter=i}getModelAsString(e){if(!e)return null;const t=null!=e.operator,i=this.localeService.getLocaleTextFunc();if(t){const s=e;let{conditions:o}=s;if(!o){const{condition1:l,condition2:a}=s;o=[l,a]}const r=o.map(l=>this.getModelAsString(l)),n="AND"===s.operator?"andCondition":"orCondition";return r.join(` ${i(n,Za[n])} `)}if(e.type===ne.BLANK||e.type===ne.NOT_BLANK)return i(e.type,e.type);{const s=e,o=this.optionsFactory.getCustomOption(s.type),{displayKey:r,displayName:n,numberOfInputs:l}=o||{};return r&&n&&0===l?(i(r,n),n):this.conditionToString(s,o)}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){var t;return this.valueFormatter?null!=(t=this.valueFormatter(e??null))?t:"":String(e)}},Fe=class gs extends qo{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(t){const i=this.optionsFactory.getCustomOption(t);if(i){const{numberOfInputs:o}=i;return o??1}return t&&[gs.EMPTY,gs.NOT_BLANK,gs.BLANK].indexOf(t)>=0?0:t===gs.IN_RANGE?2:1}onFloatingFilterChanged(t,i){this.setTypeFromFloatingFilter(t),this.setValueFromFloatingFilter(i),this.onUiChanged(!0)}setTypeFromFloatingFilter(t){this.eTypes.forEach((i,s)=>{i.setValue(0===s?t:this.optionsFactory.getDefaultOption(),!0)})}getModelFromUi(){const t=this.getUiCompleteConditions();return 0===t.length?null:this.maxNumConditions>1&&t.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),condition1:t[0],condition2:t[1],conditions:t}:t[0]}getConditionTypes(){return this.eTypes.map(t=>t.getValue())}getConditionType(t){return this.eTypes[t].getValue()}getJoinOperator(){return 0===this.eJoinOperatorsOr.length?this.defaultJoinOperator:!0===this.eJoinOperatorsOr[0].getValue()?"OR":"AND"}
1areModelsEqual(t,i){if(!t&&!i)return!0;if(!t&&i||t&&!i)return!1;const s=!t.operator,o=!i.operator;if(!s&&o||s&&!o)return!1;let n;return n=s?this.areSimpleModelsEqual(t,i):t.operator===i.operator&&pt(t.conditions,i.conditions,(c,h)=>this.areSimpleModelsEqual(c,h)),n}shouldRefresh(t){var i,s,o;const r=this.getModel(),n=r?null!=(i=r.conditions)?i:[r]:null,l=null!=(o=null==(s=t.filterOptions)?void 0:s.map(c=>"string"==typeof c?c:c.displayKey))?o:this.getDefaultFilterOptions();return!(n&&!n.every(c=>void 0!==l.find(h=>h===c.type))||"number"==typeof t.maxNumConditions&&n&&n.length>t.maxNumConditions)}refresh(t){return!(!this.shouldRefresh(t)||!super.refresh(t)||(this.setParams(t),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),0))}setModelIntoUi(t){if(t.operator){let s=t;s.conditions||(s.conditions=[s.condition1,s.condition2]);const o=this.validateAndUpdateConditions(s.conditions),r=this.getNumConditions();if(o<r)this.removeConditionsAndOperators(o);else if(o>r)for(let l=r;l<o;l++)this.createJoinOperatorPanel(),this.createOption();const n="OR"===s.operator;this.eJoinOperatorsAnd.forEach(l=>l.setValue(!n,!0)),this.eJoinOperatorsOr.forEach(l=>l.setValue(n,!0)),s.conditions.forEach((l,a)=>{this.eTypes[a].setValue(l.type,!0),this.setConditionIntoUi(l,a)})}else{const s=t;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(s.type,!0),this.setConditionIntoUi(s,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),Ge.resolve()}validateAndUpdateConditions(t){let i=t.length;return i>this.maxNumConditions&&(t.splice(this.maxNumConditions),x('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),i=this.maxNumConditions),i}doesFilterPass(t){var i;const s=this.getModel();if(null==s)return!0;const{operator:o}=s,r=[];return o?r.push(...null!=(i=s.conditions)?i:[]):r.push(s),r[o&&"OR"===o?"some":"every"](l=>this.individualConditionPasses(t,l))}setParams(t){super.setParams(t),this.setNumConditions(t),this.defaultJoinOperator=this.getDefaultJoinOperator(t.defaultJoinOperator),this.filterPlaceholder=t.filterPlaceholder,this.optionsFactory=new Xa,this.optionsFactory.init(t,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(t){var i,s;null!=t.suppressAndOrCondition&&x('Since v29.2 "filterParams.suppressAndOrCondition" is deprecated. Use "filterParams.maxNumConditions = 1" instead.'),null!=t.alwaysShowBothConditions&&x('Since v29.2 "filterParams.alwaysShowBothConditions" is deprecated. Use "filterParams.numAlwaysVisibleConditions = 2" instead.'),this.maxNumConditions=null!=(i=t.maxNumConditions)?i:t.suppressAndOrCondition?1:2,this.maxNumConditions<1&&(x('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=null!=(s=t.numAlwaysVisibleConditions)?s:t.alwaysShowBothConditions?2:1,this.numAlwaysVisibleConditions<1&&(x('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>
1this.maxNumConditions&&(x('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const t=this.createManagedBean(new jo);this.eTypes.push(t),t.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(t.getGui());const i=this.createValueElement();this.eConditionBodies.push(i),this.eFilterBody.appendChild(i),this.putOptionsIntoDropdown(t),this.resetType(t);const s=this.getNumConditions()-1;this.forEachPositionInput(s,o=>this.resetInput(o)),this.addChangedListeners(t,s)}createJoinOperatorPanel(){const t=document.createElement("div");this.eJoinOperatorPanels.push(t),t.classList.add("ag-filter-condition");const i=this.createJoinOperator(this.eJoinOperatorsAnd,t,"and"),s=this.createJoinOperator(this.eJoinOperatorsOr,t,"or");this.eFilterBody.appendChild(t);const o=this.eJoinOperatorPanels.length-1,r=this.joinOperatorId++;this.resetJoinOperatorAnd(i,o,r),this.resetJoinOperatorOr(s,o,r),this.isReadOnly()||(i.onValueChange(this.listener),s.onValueChange(this.listener))}createJoinOperator(t,i,s){const o=this.createManagedBean(new sd);return t.push(o),o.addCssClass("ag-filter-condition-operator"),o.addCssClass(`ag-filter-condition-operator-${s}`),i.appendChild(o.getGui()),o}getDefaultJoinOperator(t){return"AND"===t||"OR"===t?t:"AND"}createFilterListOptions(){const t=this.optionsFactory.getFilterOptions();this.filterListOptions=t.map(i=>"string"==typeof i?this.createBoilerplateListOption(i):this.createCustomListOption(i))}putOptionsIntoDropdown(t){this.filterListOptions.forEach(i=>{t.addOption(i)}),t.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(t){return{value:t,text:this.translate(t)}}createCustomListOption(t){const{displayKey:i}=t,s=this.optionsFactory.getCustomOption(t.displayKey);return{value:i,text:s?this.localeService.getLocaleTextFunc()(s.displayKey,s.displayName):this.translate(i)}}isAllowTwoConditions(){return this.maxNumConditions>=2}createBodyTemplate(){return""}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const t=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,t)}updateNumConditions(){var t;let i=-1,s=!0;for(let o=0;o<this.getNumConditions();o++)this.isConditionUiComplete(o)?i=o:s=!1;if(this.shouldAddNewConditionAtEnd(s))this.createJoinOperatorPanel(),this.createOption();else{const o=null!=(t=this.lastUiCompletePosition)?t:this.getNumConditions()-2;if(i<o){this.removeConditionsAndOperators(o+1);const r=i+1,n=o-r;n>0&&this.removeConditionsAndOperators(r,n),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=i}updateConditionStatusesAndValues(t,i){this.eTypes.forEach((o,r)=>{const n=this.isConditionDisabled(r,t);o.setDisabled(n||this.filterListOptions.length<=1),1===r&&(Hi(this.eJoinOperatorPanels[0],n),this.eJoinOperatorsAnd[0].setDisabled(n),this.eJoinOperatorsOr[0].setDisabled(n))}),this.eConditionBodies.forEach((o,r)=>{U(o,this.isConditionBodyVisible(r))});const s="OR"===(i??this.getJoinOperator());this.eJoinOperatorsAnd.forEach((o,r)=>{o.setValue(!s,!0)}),this.eJoinOperatorsOr.forEach((o,r)=>{o.setValue(s,!0)}),this.forEachInput((o,r,n,l)=>{this.setElementDisplayed(o,r<l),this.setElementDisabled(o,this.isConditionDisabled(n,t))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(t){return t&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(t,i){if(t>=this.getNumConditions())return;this.removeComponents(this.eTypes,t,i),this.removeElements(this.eConditionBodies,t,i),this.removeValueElements(t,i);const s=Math.max(t-1,0);this.removeElements(this.eJoinOperatorPanels,s,i),this.removeComponents(this.eJoinOperatorsAnd,s,i),this.removeComponents(this.eJoinOperatorsOr,s,i)}removeElements(t,i,s){this.removeItems(t,i,s).forEach(r=>at(r))}removeComponents(t,i,s){this.removeItems(t,i,s).forEach(r=>{at(r.getGui()),this.destroyBean(r)})}removeItems(t,i,s){return null==s?t.splice(i):t.splice(i,s)}afterGuiAttached(t){if(super.afterGuiAttached(t),this.resetPlaceholder(),!t?.suppressFocus)if(this.isReadOnly())this.eFilterBody.focus();else{const i=this.getInputs(0)[0];if(!i)return;i instanceof dt&&i.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const t=this.getModel();this.resetUiToActiveModel(t);let i=-1,s=-1,o=!1;const r=this.getJoinOperator();
1for(let l=this.getNumConditions()-1;l>=0;l--)if(this.isConditionUiComplete(l))-1===i&&(i=l,s=l);else{const c=l<i;(l>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(l-1)||c)&&(this.removeConditionsAndOperators(l,1),o=!0,c&&s--)}let n=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),n=!0),this.shouldAddNewConditionAtEnd(s===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),n=!0),n&&this.updateConditionStatusesAndValues(s,r),o&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=s}getPlaceholderText(t,i){let s=this.translate(t);if(bo(this.filterPlaceholder)){const o=this.filterPlaceholder,r=this.eTypes[i].getValue();s=o({filterOptionKey:r,filterOption:this.translate(r),placeholder:s})}else"string"==typeof this.filterPlaceholder&&(s=this.filterPlaceholder);return s}resetPlaceholder(){const t=this.localeService.getLocaleTextFunc();this.forEachInput((i,s,o,r)=>{if(!(i instanceof dt))return;const n=0===s&&r>1?"inRangeStart":0===s?"filterOoo":"inRangeEnd",l=0===s&&r>1?t("ariaFilterFromValue","Filter from value"):0===s?t("ariaFilterValue","Filter Value"):t("ariaFilterToValue","Filter to Value");i.setInputPlaceholder(this.getPlaceholderText(n,o)),i.setInputAriaLabel(l)})}setElementValue(t,i,s){t instanceof dt&&t.setValue(null!=i?String(i):null,!0)}setElementDisplayed(t,i){t instanceof k&&U(t.getGui(),i)}setElementDisabled(t,i){t instanceof k&&Hi(t.getGui(),i)}attachElementOnChange(t,i){t instanceof dt&&t.onValueChange(i)}forEachInput(t){this.getConditionTypes().forEach((i,s)=>{this.forEachPositionTypeInput(s,i,t)})}forEachPositionInput(t,i){const s=this.getConditionType(t);this.forEachPositionTypeInput(t,s,i)}forEachPositionTypeInput(t,i,s){const o=this.getNumberOfInputs(i),r=this.getInputs(t);for(let n=0;n<r.length;n++){const l=r[n];null!=l&&s(l,n,t,o)}}isConditionDisabled(t,i){return!!this.isReadOnly()||0!==t&&t>i+1}isConditionBodyVisible(t){const i=this.getConditionType(t);return this.getNumberOfInputs(i)>0}isConditionUiComplete(t){return!(t>=this.getNumConditions()||this.getConditionType(t)===gs.EMPTY||this.getValues(t).some(s=>null==s))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const t=[];for(let i=0;i<this.getNumConditions();i++)this.isConditionUiComplete(i)&&t.push(this.createCondition(i));return t}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let t=this.getNumConditions();t<this.numAlwaysVisibleConditions;t++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(t){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(i=>this.resetType(i)),this.eJoinOperatorsAnd.forEach((i,s)=>this.resetJoinOperatorAnd(i,s,this.joinOperatorId+s)),this.eJoinOperatorsOr.forEach((i,s)=>this.resetJoinOperatorOr(i,s,this.joinOperatorId+s)),this.joinOperatorId++,this.forEachInput(i=>this.resetInput(i)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,t||this.onUiChanged(),Ge.resolve()}resetType(t){const s=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");t.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(s).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(t,i,s){this.resetJoinOperator(t,i,this.isDefaultOperator("AND"),this.translate("andCondition"),s)}resetJoinOperatorOr(t,i,s){this.resetJoinOperator(t,i,this.isDefaultOperator("OR"),this.translate("orCondition"),s)}resetJoinOperator(t,i,s,o,r){this.updateJoinOperatorDisabled(t.setValue(s,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${r}`).setLabel(o),i)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach((t,i)=>this.updateJoinOperatorDisabled(t,i)),this.eJoinOperatorsOr.forEach((t,i)=>this.updateJoinOperatorDisabled(t,i))}updateJoinOperatorDisabled(t,i){t.setDisabled(this.isReadOnly()||i>0)}resetInput(t){this.setElementValue(t,null),this.setElementDisabled(t,this.isReadOnly())}setConditionIntoUi(t,i){const s=this.mapValuesFromModel(t);this.forEachInput((o,r,n,l)=>{n===i&&this.setElementValue(o,null!=s[r]?s[r]:null)})}setValueFromFloatingFilter(t){this.forEachInput((i,s,o,r)=>{this.setElementValue(i,0===s&&0===o?t:null,!0)})}isDefaultOperator(t){return t===this.defaultJoinOperator}addChangedListeners(t,i){this.isReadOnly()||(t.onValueChange(this.listener),this.forEachPositionInput(i,s=>{this.attachElementOnChange(s,this.listener)}))}individualConditionPasses(t,i){const s=this.getCellValue(t.node),o=this.mapValuesFromModel(i),r=this.optionsFactory.getCustomOption(i.type);return this.evaluateCustomFilter(r,o,s)??(null==s?this.evaluateNullV
1alue(i.type):this.evaluateNonNullValue(o,s,i,t))}evaluateCustomFilter(t,i,s){if(null==t)return;const{predicate:o}=t;return null==o||i.some(r=>null==r)?void 0:o(i,s)}isBlank(t){return null==t||"string"==typeof t&&0===t.trim().length}hasInvalidInputs(){return!1}};Fe.EMPTY="empty",Fe.BLANK="blank",Fe.NOT_BLANK="notBlank",Fe.EQUALS="equals",Fe.NOT_EQUAL="notEqual",Fe.LESS_THAN="lessThan",Fe.LESS_THAN_OR_EQUAL="lessThanOrEqual",Fe.GREATER_THAN="greaterThan",Fe.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",Fe.IN_RANGE="inRange",Fe.CONTAINS="contains",Fe.NOT_CONTAINS="notContains",Fe.STARTS_WITH="startsWith",Fe.ENDS_WITH="endsWith";var ne=Fe,ge=class me extends ne{setParams(t){super.setParams(t),this.scalarFilterParams=t}evaluateNullValue(t){switch(t){case me.EQUALS:case me.NOT_EQUAL:if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case me.GREATER_THAN:case me.GREATER_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case me.LESS_THAN:case me.LESS_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case me.IN_RANGE:if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case me.BLANK:return!0;case me.NOT_BLANK:return!1}return!1}evaluateNonNullValue(t,i,s){const o=this.comparator(),r=null!=t[0]?o(t[0],i):0;switch(s.type){case me.EQUALS:return 0===r;case me.NOT_EQUAL:return 0!==r;case me.GREATER_THAN:return r>0;case me.GREATER_THAN_OR_EQUAL:return r>=0;case me.LESS_THAN:return r<0;case me.LESS_THAN_OR_EQUAL:return r<=0;case me.IN_RANGE:{const n=o(t[1],i);return this.scalarFilterParams.inRangeInclusive?r>=0&&n<=0:r>0&&n<0}case me.BLANK:return this.isBlank(i);case me.NOT_BLANK:return!this.isBlank(i);default:return console.warn('AG Grid: Unexpected type of filter "'+s.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}},nd=class extends Mn{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:s}=t||{},o=i==ne.IN_RANGE||2===s,r=_e(e.dateFrom),n=_e(e.dateTo),l=this.dateFilterParams.inRangeFloatingFilterDateFormat;return o?`${null!==r?Vi(r,l):"null"}-${null!==n?Vi(n,l):"null"}`:null!=r?Vi(r,l):`${i}`}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}},In=class mu extends ge{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=1e3,this.maxValidYear=1/0,this.minValidDate=null,this.maxValidDate=null}afterGuiAttached(t){super.afterGuiAttached(t),this.dateConditionFromComps[0].afterGuiAttached(t)}mapValuesFromModel(t){const{dateFrom:i,dateTo:s,type:o}=t||{};return[i&&_e(i)||null,s&&_e(s)||null].slice(0,this.getNumberOfInputs(o))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(t,i){return null==i||i<t?-1:i>t?1:0}setParams(t){this.dateFilterParams=t,super.setParams(t);const i=(s,o)=>{if(null!=t[s]){if(!isNaN(t[s]))return null==t[s]?o:Number(t[s]);console.warn(`AG Grid: DateFilter ${s} is not a number`)}return o};this.minValidYear=i("minValidYear",1e3),this.maxValidYear=i("maxValidYear",1/0),this.minValidYear>this.maxValidYear&&console.warn("AG Grid: DateFilter minValidYear should be <= maxValidYear"),this.minValidDate=t.minValidDate?t.minValidDate instanceof Date?t.minValidDate:_e(t.minValidDate):null,this.maxValidDate=t.maxValidDate?t.maxValidDate instanceof Date?t.maxValidDate:_e(t.maxValidDate):null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&console.warn("AG Grid: DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new nd(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(t){const i=new Qa(this.getContext(),this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},t);return this.addDestroyFunc(()=>i.destroy()),i}setElementValue(t,i){t.setDate(i)}setElementDisplayed(t,i){t.setDisplayed(i)}setElementDisabled(t,i){t.setDisabled(i)}getDefaultFilterOptions(){return mu.DEFAULT_FILTER_OPTIONS}createValueElement(){const t=document.createElement("div");return t.classList.add("ag-filter-body"),this.createFromToElement(t,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(t,this.eConditionPanelsTo,this.dateConditionToComps,"to"),t}createFromToElement(t,i,s,o){const r=document.createElement("div");r.classList.add(`ag-filter-${o}`),r.classList.add(`ag-filter-date-${o}`),i.push(r),t.appendChild(r),s.push(this.createDateCompWrapper(r))}removeValueElements(t,i){this.removeDateComps(this.dateConditionFromComps,t,i),this.removeDateComps(this.dateConditionToComps,t,i),this.removeItems(this.eConditionPanelsFrom,t,i),this.removeItems(this.eConditionPanelsTo,t,i)}
1removeDateComps(t,i,s){this.removeItems(t,i,s).forEach(r=>r.destroy())}isValidDateValue(t){if(null===t)return!1;if(this.minValidDate){if(t<this.minValidDate)return!1}else if(t.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(t>this.maxValidDate)return!1}else if(t.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(t){if(!super.isConditionUiComplete(t))return!1;let i=!0;return this.forEachInput((s,o,r,n)=>{r!==t||!i||o>=n||(i=i&&this.isValidDateValue(s.getDate()))}),i}areSimpleModelsEqual(t,i){return t.dateFrom===i.dateFrom&&t.dateTo===i.dateTo&&t.type===i.type}getFilterType(){return"date"}createCondition(t){const i=this.getConditionType(t),s={},o=this.getValues(t);return o.length>0&&(s.dateFrom=Qe(o[0])),o.length>1&&(s.dateTo=Qe(o[1])),L({dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:i},s)}resetPlaceholder(){const t=this.localeService.getLocaleTextFunc(),i=this.translate("dateFormatOoo"),s=t("ariaFilterValue","Filter Value");this.forEachInput(o=>{o.setInputPlaceholder(i),o.setInputAriaLabel(s)})}getInputs(t){return t>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[t],this.dateConditionToComps[t]]}getValues(t){const i=[];return this.forEachPositionInput(t,(s,o,r,n)=>{o<n&&i.push(s.getDate())}),i}translate(t){return super.translate(t===ge.LESS_THAN?"before":t===ge.GREATER_THAN?"after":t)}getModelAsString(t){var i;return null!=(i=this.filterModelFormatter.getModelAsString(t))?i:""}};In.DEFAULT_FILTER_OPTIONS=[ge.EQUALS,ge.NOT_EQUAL,ge.LESS_THAN,ge.GREATER_THAN,ge.IN_RANGE,ge.BLANK,ge.NOT_BLANK],u([f("userComponentFactory")],In.prototype,"userComponentFactory",2);var ld=In,ad=class extends k{getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(e){return e&&e.afterFloatingFilter}isEventFromDataChange(e){return e?.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(e){if(!e)return void(this.lastType=this.optionsFactory.getDefaultOption());let i;i=e.operator?e.conditions[0]:e,this.lastType=i.type}canWeEditAfterModelFromParentFilter(e){return e?!e.operator&&this.isTypeEditable(e.type):this.isTypeEditable(this.lastType)}init(e){this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){this.optionsFactory=new Xa,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),t||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(i)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.setSimpleParams(e)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:i}=t||{};return null==i||1==i}isTypeEditable(e){const t=[ne.IN_RANGE,ne.EMPTY,ne.BLANK,ne.NOT_BLANK];return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&t.indexOf(e)<0}},Xo=class extends ad{constructor(){super('\n <div class="ag-floating-filter-input" role="presentation">\n <ag-input-text-field ref="eReadOnlyText"></ag-input-text-field>\n <div ref="eDateWrapper" style="display: flex;"></div>\n </div>')}getDefaultFilterOptions(){return ld.DEFAULT_FILTER_OPTIONS}init(e){super.init(e),this.params=e,this.filterParams=e.filterParams,this.createDateComponent(),this.filterModelFormatter=new nd(this.filterParams,this.localeService,this.optionsFactory);const t=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.params=e,this.filterParams=e.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams}),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(e);this.setEditable(t),t?(this.dateComp.setDate(e?_e(e.dateFrom):null),this.eReadOnlyText.setValue("")):(this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null))}setEditable(e){U(this.eDateWrapper,e),U(this.eReadOnlyText.getGui(),!e)}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(super.setLastTypeFromModel(e),this.updateCompOnModelChange(e))}onDateChanged(){const t=Qe(this.dateComp.getDate());this.params.parentFilterInstance(i=>{if(i){const s=_e(t);i.onFloatingFilterChanged(this.getLastType()||null,s)}})}getDateComponentParams(){const e=qo.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:Pe(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new Qa(this.getContext(),this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper),this.addDestroyFunc(()=>this.dateComp.destroy())}updateDateComponent(){const e=this.gridOptionsService.addGridCommonParams(this.getDateComponentParams());this.dateComp.updateParams(e)}getFilterModelFormatter(){return this.filterModelFormatter}};u([f("userComponentFactory")],Xo.prototype,"userComponentFactory",2),u([A("eReadOnlyText")],Xo.prototype,"eReadOnlyText",2),u([A("eDateWrapper")],Xo.prototype,"eDateWrapper",2);var dd=class extends k{constructor(){super('\n <div class="ag-filter-filter">\n <ag-input-text-field class="ag-date-filter" ref="eDateInput"></ag-input-text-field>\n </div>')}destroy(){super.destroy()}init(e){this.params=e,this.setParams(e);const t=this.gridOptionsService.getDocument(),i=this.eDateInput.getInputElement();this.addManagedListener(i,"mousedown",()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||i.focus()}),this.addManagedListener(i,"input",s=>{s.target===t.activeElement&&(this.eDateInput.isDisabled()||this.params.onDateChanged())})}setParams(e){const t=this.eDateInput.getInputElement(),i=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=i&&ft(),t.type=i?"date":"text";const{minValidYear:s,maxValidYear:o,minValidDate:r,maxValidDate:n}=e.filterParams||{};if(r&&s&&x("DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."),n&&o&&x("DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),r&&n){const[l,a]=[r,n].map(c=>c instanceof Date?c:_e(c));l&&a&&l.getTime()>a.getTime()&&x("DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.")}r?t.min=r instanceof Date?Vi(r):r:s&&(t.min=`${s}-01-01`),n?t.max=n instanceof Date?Vi(n):n:o&&(t.max=`${o}-12-31`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}getDate(){return _e(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue(Qe(e,!1))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){(!e||!e.suppressFocus)&&this.eDateInput.getInputElement().focus()}
1shouldUseBrowserDatePicker(e){return e.filterParams&&null!=e.filterParams.browserDatePicker?e.filterParams.browserDatePicker:Vo()||un()||ft()&&dn()>=14.1}};u([A("eDateInput")],dd.prototype,"eDateInput",2);var ii=class extends dt{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){return this.eInput.value!==e&&(this.eInput.value=R(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`);this.addManagedListener(this.eInput,"keydown",i=>{Uo(i)&&i.key&&!e.test(i.key)&&i.preventDefault()}),this.addManagedListener(this.eInput,"paste",i=>{var s;const o=null==(s=i.clipboardData)?void 0:s.getData("text");o&&o.split("").some(r=>!e.test(r))&&i.preventDefault()})}},Ln=class extends ii{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"blur",()=>{const o=parseFloat(this.eInput.value),r=isNaN(o)?"":this.normalizeValue(o.toString());this.value!==r&&this.setValue(r)}),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this)),this.eInput.step="any";const{precision:e,min:t,max:i,step:s}=this.config;"number"==typeof e&&this.setPrecision(e),"number"==typeof t&&this.setMin(t),"number"==typeof i&&this.setMax(i),"number"==typeof s&&this.setStep(s)}onWheel(e){document.activeElement===this.eInput&&e.preventDefault()}normalizeValue(e){if(""===e)return"";null!=this.precision&&(e=this.adjustPrecision(e));const t=parseFloat(e);return null!=this.min&&t<this.min?e=this.min.toString():null!=this.max&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(null==this.precision)return e;if(t){const s=parseFloat(e).toFixed(this.precision);return parseFloat(s).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=this.precision)return e;if(this.precision>0)return`${i[0]}.${i[1].slice(0,this.precision)}`}return i[0]}setMin(e){return this.min===e||(this.min=e,mt(this.eInput,"min",e)),this}setMax(e){return this.max===e||(this.max=e,mt(this.eInput,"max",e)),this}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e||(this.step=e,mt(this.eInput,"step",e)),this}setValue(e,t){return this.setValueOrInputValue(i=>super.setValue(i,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(t=>super.setValue(t,!0),t=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,i){if(R(i)){let s=this.isScientificNotation(i);if(s&&this.eInput.validity.valid)return e(i);if(s||(s=(i=this.adjustPrecision(i))!=this.normalizeValue(i)),s)return t(i)}return e(i)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return"string"==typeof e&&e.includes("e")}},ud=class extends Mn{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==ne.IN_RANGE||2===i?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}
1`:null!=e.filter?this.formatValue(e.filter):`${e.type}`}};function _n(e){const{allowedCharPattern:t}=e??{};return t??null}var cd=class Cu extends ge{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(t){return this.numberFilterParams.allowedCharPattern===t.allowedCharPattern&&super.refresh(t)}mapValuesFromModel(t){const{filter:i,filterTo:s,type:o}=t||{};return[this.processValue(i),this.processValue(s)].slice(0,this.getNumberOfInputs(o))}getDefaultDebounceMs(){return 500}comparator(){return(t,i)=>t===i?0:t<i?1:-1}setParams(t){this.numberFilterParams=t,super.setParams(t),this.filterModelFormatter=new ud(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return Cu.DEFAULT_FILTER_OPTIONS}setElementValue(t,i,s){const o=!s&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(i??null):i;super.setElementValue(t,o)}createValueElement(){const t=_n(this.numberFilterParams),i=document.createElement("div");return i.classList.add("ag-filter-body"),re(i,"presentation"),this.createFromToElement(i,this.eValuesFrom,"from",t),this.createFromToElement(i,this.eValuesTo,"to",t),i}createFromToElement(t,i,s,o){const r=this.createManagedBean(o?new ii({allowedCharPattern:o}):new Ln);r.addCssClass(`ag-filter-${s}`),r.addCssClass("ag-filter-filter"),i.push(r),t.appendChild(r.getGui())}removeValueElements(t,i){this.removeComponents(this.eValuesFrom,t,i),this.removeComponents(this.eValuesTo,t,i)}getValues(t){const i=[];return this.forEachPositionInput(t,(s,o,r,n)=>{o<n&&i.push(this.processValue(this.stringToFloat(s.getValue())))}),i}areSimpleModelsEqual(t,i){return t.filter===i.filter&&t.filterTo===i.filterTo&&t.type===i.type}getFilterType(){return"number"}processValue(t){return null==t||isNaN(t)?null:t}stringToFloat(t){if("number"==typeof t)return t;let i=ht(t);return null!=i&&""===i.trim()&&(i=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(i):null==i||"-"===i.trim()?null:parseFloat(i)}createCondition(t){const i=this.getConditionType(t),s={filterType:this.getFilterType(),type:i},o=this.getValues(t);return o.length>0&&(s.filter=o[0]),o.length>1&&(s.filterTo=o[1]),s}getInputs(t){return t>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[t],this.eValuesTo[t]]}getModelAsString(t){var i;return null!=(i=this.filterModelFormatter.getModelAsString(t))?i:""}hasInvalidInputs(){let t=!1;return this.forEachInput(i=>{i.getInputElement().validity.valid||(t=!0)}),t}};cd.DEFAULT_FILTER_OPTIONS=[ge.EQUALS,ge.NOT_EQUAL,ge.GREATER_THAN,ge.GREATER_THAN_OR_EQUAL,ge.LESS_THAN,ge.LESS_THAN_OR_EQUAL,ge.IN_RANGE,ge.BLANK,ge.NOT_BLANK];var hd=cd,pd=class extends Mn{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==ne.IN_RANGE||2===i?`${e.filter}-${e.filterTo}
1`:null!=e.filter?`${e.filter}`:`${e.type}`}},ut=class fs extends ne{constructor(){super("textFilter"),this.eValuesFrom=[],this.eValuesTo=[]}static trimInput(t){const i=t&&t.trim();return""===i?t:i}getDefaultDebounceMs(){return 500}setParams(t){this.textFilterParams=t,super.setParams(t),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?fs.DEFAULT_FORMATTER:fs.DEFAULT_LOWERCASE_FORMATTER),this.filterModelFormatter=new pd(this.localeService,this.optionsFactory)}getTextMatcher(){const t=this.textFilterParams.textCustomComparator;return t?(H.warnOnce("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:i,value:s,filterText:o})=>t(i,s,o)):this.textFilterParams.textMatcher||fs.DEFAULT_MATCHER}createCondition(t){const i=this.getConditionType(t),s={filterType:this.getFilterType(),type:i},o=this.getValuesWithSideEffects(t,!0);return o.length>0&&(s.filter=o[0]),o.length>1&&(s.filterTo=o[1]),s}getFilterType(){return"text"}areSimpleModelsEqual(t,i){return t.filter===i.filter&&t.filterTo===i.filterTo&&t.type===i.type}getInputs(t){return t>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[t],this.eValuesTo[t]]}getValues(t){return this.getValuesWithSideEffects(t,!1)}getValuesWithSideEffects(t,i){const s=[];return this.forEachPositionInput(t,(o,r,n,l)=>{var a;if(r<l){let c=ht(o.getValue());i&&this.textFilterParams.trimInput&&(c=null!=(a=fs.trimInput(c))?a:null,o.setValue(c,!0)),s.push(c)}}),s}getDefaultFilterOptions(){return fs.DEFAULT_FILTER_OPTIONS}createValueElement(){const t=document.createElement("div");return t.classList.add("ag-filter-body"),re(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from"),this.createFromToElement(t,this.eValuesTo,"to"),t}createFromToElement(t,i,s){const o=this.createManagedBean(new ii);o.addCssClass(`ag-filter-${s}`),o.addCssClass("ag-filter-filter"),i.push(o),t.appendChild(o.getGui())}removeValueElements(t,i){this.removeComponents(this.eValuesFrom,t,i),this.removeComponents(this.eValuesTo,t,i)}mapValuesFromModel(t){const{filter:i,filterTo:s,type:o}=t||{};return[i||null,s||null].slice(0,this.getNumberOfInputs(o))}evaluateNullValue(t){return!!t&&[ne.NOT_EQUAL,ne.NOT_CONTAINS,ne.BLANK].indexOf(t)>=0}evaluateNonNullValue(t,i,s,o){const r=t.map(v=>this.formatter(v))||[],n=this.formatter(i),{api:l,colDef:a,column:c,columnApi:h,context:g,textFormatter:m}=this.textFilterParams;if(s.type===ne.BLANK)return this.isBlank(i);if(s.type===ne.NOT_BLANK)return!this.isBlank(i);const C={api:l,colDef:a,column:c,columnApi:h,context:g,node:o.node,data:o.data,filterOption:s.type,value:n,textFormatter:m};return r.some(v=>this.matcher(ie(L({},C),{filterText:v})))}getModelAsString(t){var i;return null!=(i=this.filterModelFormatter.getModelAsString(t))?i:""}};ut.DEFAULT_FILTER_OPTIONS=[ne.CONTAINS,ne.NOT_CONTAINS,ne.EQUALS,ne.NOT_EQUAL,ne.STARTS_WITH,ne.ENDS_WITH,ne.BLANK,ne.NOT_BLANK],ut.DEFAULT_FORMATTER=e=>e,ut.DEFAULT_LOWERCASE_FORMATTER=e=>null==e?null:e.toString().toLowerCase(),ut.DEFAULT_MATCHER=({filterOption:e,value:t,filterText:i})=>{if(null==i)return!1;switch(e){case ut.CONTAINS:return t.indexOf(i)>=0;case ut.NOT_CONTAINS:return t.indexOf(i)<0;case ut.EQUALS:return t===i;case ut.NOT_EQUAL:return t!=i;case ut.STARTS_WITH:return 0===t.indexOf(i);case ut.ENDS_WITH:const s=t.lastIndexOf(i);return s>=0&&s===t.length-i.length;default:return!1}};var xn=ut,gd=class extends T{constructor(e){super(),this.params=e,this.valueChangedListener=()=>{}}setupGui(e){var t;this.eFloatingFilterTextInput=this.createManagedBean(new ii(null==(t=this.params)?void 0:t.config));const i=this.eFloatingFilterTextInput.getGui();e.appendChild(i),this.addManagedListener(i,"input",s=>this.valueChangedListener(s)),this.addManagedListener(i,"keydown",s=>this.valueChangedListener(s))}setEditable(e){this.eFloatingFilterTextInput.setDisabled(!e)}setAutoComplete(e){this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(e,t){this.eFloatingFilterTextInput.setValue(e,t)}setValueChangedListener(e){this.valueChangedListener=e}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterTextInput.setInputAriaLabel(e)}},Is=class extends ad{postConstruct(){this.setTemplate('\n <div class="ag-floating-filter-input" role="presentation" ref="eFloatingFilterInputContainer"></div>\n ')}getDefaultDebounceMs(){return 500}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(e)))}init(e){this.setupFloatingFilterInputService(e),super.init(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.floatingFilterInputService=this.createFloatingFilterInputService(e),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){var t;this.params=e;const i=null!=(t=e.browserAutoComplete)&&t;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:i}),this.applyActive=qo.isUseApplyButton(this.params.filterParams),!this.isReadOnly()){const s=qo.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),o=Pe(this.syncUpWithParentFilter.bind(this),s);this.floatingFilterInputService.setValueChangedListener(o)}}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const t=this.floatingFilterInputService.getValue();ce(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(e),this.floatingFilterInputService.setValue(t,!0)}getAriaLabel(e){return`${this.columnModel.getDisplayNameForColumn(e.column,"header",!0)} ${this.localeService.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}syncUpWithParentFilter(e){if(this.applyActive&&e.key!==w.ENTER)return;let i=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(i=xn.trimInput(i),this.floatingFilterInputService.setValue(i,!0)),this.params.parentFilterInstance(s=>{s&&s.onFloatingFilterChanged(this.getLastType()||null,i||null)})}setEditable(e){this.floatingFilterInputService.setEditable(e)}};u([f("columnModel")],Is.prototype,"columnModel",2),u([A("eFloatingFilterInputContainer")],Is.prototype,"eFloatingFilterInputContainer",2),u([b],Is.prototype,"postConstruct",1);var Mh=class extends T{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(e){this.eFloatingFilterNumberInput=this.createManagedBean(new Ln),this.eFloatingFilterTextInput=this.createManagedBean(new ii),this.eFloatingFilterTextInput.setDisabled(!0);const t=this.eFloatingFilterNumberInput.getGui(),i=this.eFloatingFilterTextInput.getGui();e.appendChild(t),e.appendChild(i),this.setupListeners(t,s=>this.valueChangedListener(s)),this.setupListeners(i,s=>this.valueChangedListener(s))}setEditable(e){this.numberInputActive=e,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eFloatingFilterNumberInput.setAutoComplete(e),this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(e){this.valueChangedListener=e}setupListeners(e,t){this.addManagedListener(e,"input",t),this.addManagedListener(e,"keydown",t)}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterNumberInput.setInputAriaLabel(e),this.eFloatingFilterTextInput.setInputAriaLabel(e)}},Ih=class extends Is{init(e){var t;super.init(e),this.filterModelFormatter=new ud(this.localeService,this.optionsFactory,null==(t=e.filterParams)?void 0:t.numberFormatter)}onParamsUpdated(e){this.refresh(e)}refresh(e){_n(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return hd.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){return this.allowedCharPattern=_n(e.filterParams),this.createManagedBean(this.allowedCharPattern?new gd({config:{allowedCharPattern:this.allowedCharPattern}}):new Mh)}},Lh=class extends Is{init(e){super.init(e),this.filterModelFormatter=new pd(this.localeService,this.optionsFactory)}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return xn.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new gd)}},Ls=class mo{constructor(t,i=!1){this.destroyFuncs=[],this.touching=!1,this.eventService=new ot,this.eElement=t,this.preventMouseClick=i;const s=this.onTouchStart.bind(this),o=this.onTouchMove.bind(this),r=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",s,{passive:!0}),this.eElement.addEventListener("touchmove",o,{passive:!0}),this.eElement.addEventListener("touchend",r,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",s,{passive:!0}),this.eElement.removeEventListener("touchmove",o,{passive:!0}),this.eElement.removeEventListener("touchend",r,{passive:!1})})}getActiveTouch(t){for(let i=0;i<t.length;i++)if(t[i].identifier===this.touchStart.identifier)return t[i];return null}addEventListener(t,i){this.eventService.addEventListener(t,i)}removeEventListener(t,i){this.eventService.removeEventListener(t,i)}onTouchStart(t){if(this.touching)return;this.touchStart=t.touches[0],this.touching=!0,this.moved=!1;const i=this.touchStart;window.setTimeout(()=>{this.touching&&this.touchStart===i&&!this.moved&&(this.moved=!0,this.eventService.dispatchEvent({type:mo.EVENT_LONG_TAP,touchStart:this.touchStart,touchEvent:t}))},500)}onTouchMove(t){if(!this.touching)return;const i=this.getActiveTouch(t.touches);i&&!Pn(i,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(t){this.touching&&(this.moved||(this.eventService.dispatchEvent({type:mo.EVENT_TAP,touchStart:this.touchStart}),this.checkForDoubleTap()),this.preventMouseClick&&t.cancelable&&t.preventDefault(),this.touching=!1)}checkForDoubleTap(){const t=(new Date).getTime();this.lastTapTime&&this.lastTapTime>0&&t-this.lastTapTime>mo.DOUBLE_TAP_MILLIS?(this.eventService.dispatchEvent({type:mo.EVENT_DOUBLE_TAP,touchStart:this.touchStart}),this.lastTapTime=null):this.lastTapTime=t}destroy(){this.destroyFuncs.forEach(t=>t())}};Ls.EVENT_TAP="tap",Ls.EVENT_DOUBLE_TAP="doubleTap",Ls.EVENT_LONG_TAP="longTap",Ls.DOUBLE_TAP_MILLIS=500;var we=Ls,Ot=class vu extends k{constructor(t){super(),t||this.setTemplate(vu.TEMPLATE)}attachCustomElements(t,i,s,o,r){this.eSortOrder=t,this.eSortAsc=i,this.eSortDe
1sc=s,this.eSortMixed=o,this.eSortNone=r}setupSort(t,i=!1){this.column=t,this.suppressOrder=i,this.setupMultiSortIndicator(),this.column.isSortable()&&(this.addInIcon("sortAscending",this.eSortAsc,t),this.addInIcon("sortDescending",this.eSortDesc,t),this.addInIcon("sortUnSort",this.eSortNone,t),this.addManagedPropertyListener("unSortIcon",()=>this.updateIcons()),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,()=>this.updateIcons()),this.addManagedListener(this.eventService,p.EVENT_SORT_CHANGED,()=>this.onSortChanged()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onSortChanged()),this.onSortChanged())}addInIcon(t,i,s){if(null==i)return;const o=oe(t,this.gridOptionsService,s);o&&i.appendChild(o)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const t=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc&&U(this.eSortAsc,"asc"===t,{skipAriaHidden:!0}),this.eSortDesc&&U(this.eSortDesc,"desc"===t,{skipAriaHidden:!0}),this.eSortNone){const i=!this.column.getColDef().unSortIcon&&!this.gridOptionsService.get("unSortIcon");U(this.eSortNone,!i&&null==t,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const t=this.column.getColDef().showRowGroup;this.gridOptionsService.isColumnsSortingCoupledToGroup()&&t&&(this.addManagedListener(this.eventService,p.EVENT_SORT_CHANGED,()=>this.updateMultiSortIndicator()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateMultiSortIndicator()),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const t="mixed"===this.sortController.getDisplaySortForColumn(this.column);U(this.eSortMixed,t,{skipAriaHidden:!0})}}updateSortOrder(){var t;if(!this.eSortOrder)return;const i=this.sortController.getColumnsWithSortingOrdered(),s=null!=(t=this.sortController.getDisplaySortIndexForColumn(this.column))?t:-1,o=i.some(n=>{var l;return null!=(l=this.sortController.getDisplaySortIndexForColumn(n))&&l});U(this.eSortOrder,s>=0&&o,{skipAriaHidden:!0}),s>=0?this.eSortOrder.textContent=(s+1).toString():ce(this.eSortOrder)}};Ot.TEMPLATE='<span class="ag-sort-indicator-container">\n <span ref="eSortOrder" class="ag-sort-indicator-icon ag-sort-order ag-hidden" aria-hidden="true"></span>\n <span ref="eSortAsc" class="ag-sort-indicator-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>\n <span ref="eSortDesc" class="ag-sort-indicator-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>\n <span ref="eSortMixed" class="ag-sort-indicator-icon ag-sort-mixed-icon ag-hidden" aria-hidden="true"></span>\n <span ref="eSortNone" class="ag-sort-indicator-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>\n </span>',u([A("eSortOrder")],Ot.prototype,"eSortOrder",2),u([A("eSortAsc")],Ot.prototype,"eSortAsc",2),u([A("eSortDesc")],Ot.prototype,"eSortDesc",2),u([A("eSortMixed")],Ot.prototype,"eSortMixed",2),u([A("eSortNone")],Ot.prototype,"eSortNone",2),u([f("columnModel")],Ot.prototype,"columnModel",2),u([f("sortController")],Ot.prototype,"sortController",2);var Gn=Ot,Ee=class wu extends k{constructor(){super(...arguments),this.lastMovingChanged=0}destroy(){super.destroy()}refresh(t){return this.params=t,this.workOutTemplate()==this.currentTemplate&&this.workOutShowMenu()==this.currentShowMenu&&this.workOutSort()==this.currentSort&&this.shouldSuppressMenuHide()==this.currentSuppressMenuHide&&(this.setDisplayName(t),!0)}workOutTemplate(){var t;let i=null!=(t=this.params.template)?t:wu.TEMPLATE;return i=i&&i.trim?i.trim():i,i}init(t){this.params=t,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate),this.setupTap(),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setupFilterButton(),this.setDisplayName(t)}setDisplayName(t){if(this.currentDisplayName!=t.displayName){this.currentDisplayName=t.displayName;const i=pe(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=i)}}
1addInIcon(t,i,s){if(null==i)return;const o=oe(t,this.gridOptionsService,s);o&&i.appendChild(o)}setupTap(){const{gridOptionsService:t}=this;if(t.get("suppressTouch"))return;const i=new we(this.getGui(),!0),s=this.shouldSuppressMenuHide(),o=s&&R(this.eMenu),r=o?new we(this.eMenu,!0):i;if(this.params.enableMenu&&this.addManagedListener(r,we[o?"EVENT_TAP":"EVENT_LONG_TAP"],a=>this.params.showColumnMenuAfterMouseClick(a.touchStart)),this.params.enableSorting&&this.addManagedListener(i,we.EVENT_TAP,l=>{var a,c;const h=l.touchStart.target;s&&(null!=(a=this.eMenu)&&a.contains(h)||null!=(c=this.eFilterButton)&&c.contains(h))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")}),this.params.enableFilterButton){const n=new we(this.eFilterButton,!0);this.addManagedListener(n,"tap",()=>this.params.showFilter(this.eFilterButton)),this.addDestroyFunc(()=>n.destroy())}this.addDestroyFunc(()=>i.destroy()),o&&this.addDestroyFunc(()=>r.destroy())}workOutShowMenu(){return this.params.enableMenu&&this.menuService.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return this.menuService.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu)return at(this.eMenu),void(this.eMenu=void 0);const t=this.menuService.isLegacyMenuEnabled();this.addInIcon(t?"menu":"menuAlt",this.eMenu,this.params.column),this.eMenu.classList.toggle("ag-header-menu-icon",!t),this.currentSuppressMenuHide=this.shouldSuppressMenuHide(),this.addManagedListener(this.eMenu,"click",()=>this.params.showColumnMenu(this.eMenu)),this.eMenu.classList.toggle("ag-header-menu-always-show",this.currentSuppressMenuHide)}onMenuKeyboardShortcut(t){var i,s,o,r;const{column:n}=this.params,l=this.menuService.isLegacyMenuEnabled();if(t&&!l){if(this.menuService.isFilterMenuInHeaderEnabled(n))return this.params.showFilter(null!=(s=null!=(i=this.eFilterButton)?i:this.eMenu)?s:this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu(null!=(r=null!=(o=this.eMenu)?o:this.eFilterButton)?r:this.getGui()),!0;return!1}workOutSort(){return this.params.enableSorting}setupSort(){if(this.currentSort=this.params.enableSorting,this.eSortIndicator||(this.eSortIndicator=this.context.createBean(new Gn(!0)),this.eSortIndicator.attachCustomElements(this.eSortOrder,this.eSortAsc,this.eSortDesc,this.eSortMixed,this.eSortNone)),this.eSortIndicator.setupSort(this.params.column),!this.currentSort)return;this.addManagedListener(this.params.column,Z.EVENT_MOVING_CHANGED,()=>{this.lastMovingChanged=(new Date).getTime()}),this.eLabel&&this.addManagedListener(this.eLabel,"click",i=>{const s=this.params.column.isMoving(),r=(new Date).getTime()-this.lastMovingChanged<50;if(!s&&!r){const a="ctrl"===this.gridOptionsService.get("multiSortKey")?i.ctrlKey||i.metaKey:i.shiftKey;this.params.progressSort(a)}});const t=()=>{if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc",this.params.column.isSortAscending()),this.addOrRemoveCssClass("ag-header-cell-sorted-desc",this.params.column.isSortDescending()),this.addOrRemoveCssClass("ag-header-cell-sorted-none",this.params.column.isSortNone()),this.params.column.getColDef().showRowGroup){const i=this.columnModel.getSourceColumnsForGroupColumn(this.params.column),o=!i?.every(r=>this.params.column.getSort()==r.getSort());this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",o)}};this.addManagedListener(this.eventService,p.EVENT_SORT_CHANGED,t),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){this.eFilterButton&&(this.configureFilter(this.params.enableFilterButton,this.eFilterButton,this.onFilterChangedButton.bind(this))?this.addManagedListener(this.eFilterButton,"click",()=>this.params.showFilter(this.eFilterButton)):this.eFilterButton=void 0)}configureFilter(t,i,s){if(!t)return at(i),!1;const{column:o}=this.params;return this.addInIcon("filter",i,o),this.addManagedListener(o,Z.EVENT_FILTER_CHANGED,s),s(),!0}onFilterChangedIcon(){const t=this.params.column.isFilterActive();U(this.eFilter,t,{skipAriaHidden:!0})}onFilterChangedButton(){const t=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",t)}getAnchorElementForMenu(t){var i,s,o,r;return t?null!=(s=null!=(i=this.eFilterButton)?i:this.eMenu)?s:this.getGui():null!=(r=null!=(o=this.eMenu)?o:this.eFilterButton)?r:this.getGui()}};Ee.TEMPLATE='<div class="ag-cell-label-container" role="presentation">
1\n <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>\n <span ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span>\n <div ref="eLabel" class="ag-header-cell-label" role="presentation">\n <span ref="eText" class="ag-header-cell-text"></span>\n <span ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>\n <ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>\n </div>\n </div>',u([f("sortController")],Ee.prototype,"sortController",2),u([f("menuService")],Ee.prototype,"menuService",2),u([f("columnModel")],Ee.prototype,"columnModel",2),u([A("eFilter")],Ee.prototype,"eFilter",2),u([A("eFilterButton")],Ee.prototype,"eFilterButton",2),u([A("eSortIndicator")],Ee.prototype,"eSortIndicator",2),u([A("eMenu")],Ee.prototype,"eMenu",2),u([A("eLabel")],Ee.prototype,"eLabel",2),u([A("eText")],Ee.prototype,"eText",2),u([A("eSortOrder")],Ee.prototype,"eSortOrder",2),u([A("eSortAsc")],Ee.prototype,"eSortAsc",2),u([A("eSortDesc")],Ee.prototype,"eSortDesc",2),u([A("eSortMixed")],Ee.prototype,"eSortMixed",2),u([A("eSortNone")],Ee.prototype,"eSortNone",2);var Nn=Ee,_s=class Su extends k{constructor(){super(Su.TEMPLATE)}destroy(){super.destroy()}init(t){this.params=t,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&x("A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)")}setupExpandIcons(){this.addInIcon("columnGroupOpened","agOpened"),this.addInIcon("columnGroupClosed","agClosed");const t=o=>{if(nt(o))return;const r=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),r,"uiColumnExpanded")};this.addTouchAndClickListeners(this.eCloseIcon,t),this.addTouchAndClickListeners(this.eOpenIcon,t);const i=o=>{rt(o)};this.addManagedListener(this.eCloseIcon,"dblclick",i),this.addManagedListener(this.eOpenIcon,"dblclick",i),this.addManagedListener(this.getGui(),"dblclick",t),this.updateIconVisibility();const s=this.params.columnGroup.getProvidedColumnGroup();this.addManagedListener(s,le.EVENT_EXPANDED_CHANGED,this.updateIconVisibility.bind(this)),this.addManagedListener(s,le.EVENT_EXPANDABLE_CHANGED,this.updateIconVisibility.bind(this))}addTouchAndClickListeners(t,i){const s=new we(t,!0);this.addManagedListener(s,we.EVENT_TAP,i),this.addDestroyFunc(()=>s.destroy()),this.addManagedListener(t,"click",i)}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const i=this.params.columnGroup.isExpanded();U(this.eOpenIcon,i),U(this.eCloseIcon,!i)}else U(this.eOpenIcon,!1),U(this.eCloseIcon,!1)}addInIcon(t,i){const s=oe(t,this.gridOptionsService,null);s&&this.getRefElement(i).appendChild(s)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable())return U(this.eOpenIcon,!1),void U(this.eCloseIcon,!1)}setupLabel(){var t;const{displayName:i,columnGroup:s}=this.params;if(R(i)){const o=pe(i,!0);this.getRefElement("agLabel").textContent=o}this.addOrRemoveCssClass("ag-sticky-label",!(null!=(t=s.getColGroupDef())&&t.suppressStickyLabel))}};_s.TEMPLATE='<div class="ag-header-group-cell-label" ref="agContainer" role="presentation">\n <span ref="agLabel" class="ag-header-group-text" role="presentation"></span>\n <span ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>\n <span ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>\n </div>',u([f("columnModel")],_s.prototype,"columnModel",2),u([A("agOpened")],_s.prototype,"eOpenIcon",2),u([A("agClosed")],_s.prototype,"eCloseIcon",2);var _h=_s,si=class extends k{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},kn=class Eu extends si{constructor(){super(Eu.TEMPLATE)}init(t){this.params=t,this.focusAfterAttached=t.cellStartedEdit,this.eTextArea.setMaxLength(t.maxLength||200).setCols(t.cols||60).setRows(t.rows||10),R(t.value,!0)&&this.eTextArea.setValue(t.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}onKeyDown(t){const i=t.key;(i===w.LEFT||i===w.UP||i===w.RIGHT||i===w.DOWN||t.shiftKey&&i===w.ENTER)&&t.stopPropagation()}afterGuiAttached(){const t=this.localeService.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(t("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()}getValue(){const t=this.eTextArea.getValue();return R(t)||R(this.params.value)?this.params.parseValue(t):this.params.value}};kn.TEMPLATE='<div class="ag-large-text">\n <ag-input-text-area ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>\n </div>',u([A("eTextArea")],kn.prototype,"eTextArea",2);var xh=kn,Vn=class extends si{constructor(){super('<div class="ag-cell-edit-wrapper">\n <ag-select class="ag-cell-editor" ref="eSelect"></ag-select>\n </div>'),this.startedByEnter=!1}init(e){this.focusAfterAttached=e.cellStartedEdit;const{eSelect:t,valueFormatterService:i,gridOptionsService:s}
1=this,{values:o,value:r,eventKey:n}=e;if(G(o))return void console.warn("AG Grid: no values found for select cellEditor");this.startedByEnter=null!=n&&n===w.ENTER;let l=!1;o.forEach(g=>{const m={value:g},C=i.formatValue(e.column,null,g);m.text=null!=C?C:g,t.addOption(m),l=l||r===g}),l?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:a,valueListMaxWidth:c,valueListMaxHeight:h}=e;null!=a&&t.setPickerGap(a),null!=h&&t.setPickerMaxHeight(h),null!=c&&t.setPickerMaxWidth(c),"fullRow"!==s.get("editType")&&this.addManagedListener(this.eSelect,jo.EVENT_ITEM_SELECTED,()=>e.stopEditing())}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eSelect.showPicker()})}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getValue()}isPopup(){return!1}};u([f("valueFormatterService")],Vn.prototype,"valueFormatterService",2),u([A("eSelect")],Vn.prototype,"eSelect",2);var xs=class extends si{constructor(e){super(`\n <div class="ag-cell-edit-wrapper">\n ${e.getTemplate()}\n </div>`),this.cellEditorInput=e}init(e){this.params=e;const t=this.eInput;let i;if(this.cellEditorInput.init(t,e),e.cellStartedEdit){this.focusAfterAttached=!0;const s=e.eventKey;s===w.BACKSPACE||e.eventKey===w.DELETE?i="":s&&1===s.length?i=s:(i=this.cellEditorInput.getStartValue(),s!==w.F2&&(this.highlightAllOnFocus=!0))}else this.focusAfterAttached=!1,i=this.cellEditorInput.getStartValue();null!=i&&t.setStartValue(i),this.addManagedListener(t.getGui(),"keydown",s=>{const{key:o}=s;(o===w.PAGE_UP||o===w.PAGE_DOWN)&&s.preventDefault()})}afterGuiAttached(){var e,t;const i=this.localeService.getLocaleTextFunc(),s=this.eInput;if(s.setInputAriaLabel(i("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;ft()||s.getFocusableElement().focus();const o=s.getInputElement();this.highlightAllOnFocus?o.select():null==(t=(e=this.cellEditorInput).setCaret)||t.call(e)}focusIn(){const e=this.eInput,t=e.getFocusableElement(),i=e.getInputElement();t.focus(),i.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}};u([A("eInput")],xs.prototype,"eInput",2);var Gh=class{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" ref="eInput"></ag-input-text-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.maxLength&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return R(e)||R(this.params.value)?this.params.parseValue(e):this.params.value}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const e=this.eInput.getValue(),t=R(e)&&e.length||0;t&&this.eInput.getInputElement().setSelectionRange(t,t)}},fd=class extends xs{constructor(){super(new Gh)}},md=class extends k{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-change-delta");const i=document.createElement("span");i.setAttribute("class","ag-value-change-value"),e.appendChild(t),e.appendChild(i),this.setTemplateFromElement(e)}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e,!0)}showDelta(e,t){const i=Math.abs(t),s=e.formatValue(i),o=R(s)?s:i,r=t>=0;this.eDelta.textContent=r?"\u2191"+o:"\u2193"+o,this.eDelta.classList.toggle("ag-value-change-delta-up",r),this.eDelta.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),ce(this.eDelta)}refresh(e,t=!1){const i=e.value;return i!==this.lastValue&&(R(e.valueFormatted)?this.eValue.textContent=e.valueFormatted:R(e.value)?this.eValue.textContent=i:ce(this.eValue),!this.filterManager.isSuppressFlashingCellsBecauseFiltering())&&
1("number"==typeof i&&"number"==typeof this.lastValue&&this.showDelta(e,i-this.lastValue),this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=i,!0)}};u([f("filterManager")],md.prototype,"filterManager",2);var Cd=class extends k{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-slide-current"),e.appendChild(t),this.setTemplateFromElement(e),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const t=document.createElement("span");t.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=t,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)},3e3)})}refresh(e,t=!1){let i=e.value;return G(i)&&(i=""),i!==this.lastValue&&!this.filterManager.isSuppressFlashingCellsBecauseFiltering()&&(t||this.addSlideAnimation(),this.lastValue=i,R(e.valueFormatted)?this.eCurrent.textContent=e.valueFormatted:R(e.value)?this.eCurrent.textContent=i:ce(this.eCurrent),!0)}};u([f("filterManager")],Cd.prototype,"filterManager",2);var se=class te{constructor(t){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=te.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=t}setData(t){this.setDataCommon(t,!1)}updateData(t){this.setDataCommon(t,!0)}setDataCommon(t,i){const s=this.data;this.data=t,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const o=this.createDataChangedEvent(t,s,i);this.dispatchLocalEvent(o)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(t,i,s){return{type:te.EVENT_DATA_CHANGED,node:this,oldData:i,newData:t,update:s}}createLocalRowEvent(t){return{type:t,node:this}}getRowIndexString(){return"top"===this.rowPinned?"t-"+this.rowIndex:"bottom"===this.rowPinned?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const t=new te(this.beans);return t.id=this.id,t.data=this.data,t.__daemon=!0,t.selected=this.selected,t.level=this.level,t}setDataAndId(t,i){const s=R(this.id)?this.createDaemonNode():null,o=this.data;this.data=t,this.updateDataOnDetailNode(),this.setId(i),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,s);const r=this.createDataChangedEvent(t,o,!1);this.dispatchLocalEvent(r)}checkRowSelectable(){const t=this.beans.gridOptionsService.get("isRowSelectable");this.setRowSelectable(!t||t(this))}setRowSelectable(t,i){if(this.selectable!==t){if(this.selectable=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_SELECTABLE_CHANGED)),i)return;if(this.beans.gridOptionsService.get("groupSelectsChildren")){const o=this.calculateSelectedFromChildren();return void this.setSelectedParams({newValue:o??!1,source:"selectableChanged"})}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(t){const i=this.beans.gridOptionsService.getCallback("getRowId");if(i)if(this.data){const s=this.getGroupKeys(!0);this.id=i({data:this.data,parentKeys:s.length>0?s:void 0,level:this.level}),null!==this.id&&"string"==typeof this.id&&this.id.startsWith(te.ID_PREFIX_ROW_GROUP)&&console.error(`AG Grid: Row IDs cannot start with ${te.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`),null!==this.id&&"string"!=typeof this.id&&(this.id=""+this.id)}else this.id=void 0;else this.id=t}getGroupKeys(t=!1){const i=[];let s=this;for(t&&(s=s.parent);s&&s.level>=0;)i.push(s.key),s=s.parent;return i.reverse(),i}isPixelInRange(t){return!(!R(this.rowTop)||!R(this.rowHeight))&&t>=this.rowTop&&t<this.rowTop+this.rowHeight}setFirstChild(t){this.firstChild!==t&&(this.firstChild=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_FIRST_CHILD_CHANGED)))}setLastChild(t){this.lastChild!==t&&(this.lastChild=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_LAST_CHILD_CHANGED)))}setChildIndex(t){this.childIndex!==t&&(this.childIndex=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_CHILD_INDEX_CHANGED)))}setRowTop(t){this.oldRowTop=this.rowTop,this.rowTop!==t&&(this.rowTop=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_TOP_CHANGED)),this.setDisplayed(null!==t))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(t){this.displayed!==t&&(this.displayed=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_DISPLAYED_CHANGED)))}setDragging(t){this.dragging!==t&&(this.dragging=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_DRAGGING_CHANGED)))}setHighlighted(t){t!==this.highlighted&&(this.highlighted=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_HIGHLIGHT_CHANGED)))}setHovered(t){this.hovered!==t&&(this.hovered=t)}isHovered(){return this.hovered}setAllChildrenCount(t){this.allChildrenCount!==t&&(this.allChildrenCount=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_ALL_CHILDREN_COUNT_CHANGED)))}setMaster(t){this.master!==t&&(this.master&&!t&&(this.expanded=!1),this.master=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_MASTER_CHANGED)))}setGroup(t){this.group!==t&&(this.group&&!t&&(this.expanded=!1),this.group=t,this.updateHasChildren(),this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_GROUP_CHANGED)))}setRowHeight(t,i=!1){this.rowHeight=t,this.rowHeightEstimated=i,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_HEIGHT_CHANGED))}setRowAutoHeight(t,i){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[i.getId()]=t,null!=t&&(null==this.checkAutoHeightsDebounced&&(this.checkAutoHeightsDebounced=Pe(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let t=!1,i=!0,s=0;const o=this.__autoHeights;if(null==o||(this.beans.columnModel.getAllDisplayedAutoHeightCols().forEac
1h(l=>{let a=o[l.getId()];if(null==a){if(!this.beans.columnModel.isColSpanActive())return void(t=!0);{let c=[];switch(l.getPinned()){case"left":c=this.beans.columnModel.getDisplayedLeftColumnsForRow(this);break;case"right":c=this.beans.columnModel.getDisplayedRightColumnsForRow(this);break;case null:c=this.beans.columnModel.getViewportCenterColumnsForRow(this)}if(c.includes(l))return void(t=!0);a=-1}}else i=!1;a>s&&(s=a)}),t)||((i||s<10)&&(s=this.beans.gridOptionsService.getRowHeightForNode(this).height),s==this.rowHeight))return;this.setRowHeight(s);const n=this.beans.rowModel;n.onRowHeightChangedDebounced&&n.onRowHeightChangedDebounced()}setRowIndex(t){this.rowIndex!==t&&(this.rowIndex=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_ROW_INDEX_CHANGED)))}setUiLevel(t){this.uiLevel!==t&&(this.uiLevel=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_UI_LEVEL_CHANGED)))}setExpanded(t,i){if(this.expanded===t)return;this.expanded=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_EXPANDED_CHANGED));const s=Object.assign({},this.createGlobalRowEvent(p.EVENT_ROW_GROUP_OPENED),{expanded:t,event:i||null});this.beans.rowNodeEventThrottle.dispatchExpanded(s),this.sibling&&this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(t){return this.beans.gridOptionsService.addGridCommonParams({type:t,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned})}dispatchLocalEvent(t){this.eventService&&this.eventService.dispatchEvent(t)}setDataValue(t,i,s){const r=(()=>{var a;return"string"!=typeof t?t:null!=(a=this.beans.columnModel.getGridColumn(t))?a:this.beans.columnModel.getPrimaryColumn(t)})(),n=this.getValueFromValueService(r);if(this.beans.gridOptionsService.get("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(r,n,i,s),!1;const l=this.beans.valueService.setValue(this,r,i,s);return this.dispatchCellChangedEvent(r,i,n),this.checkRowSelectable(),l}getValueFromValueService(t){const i=this.leafGroup&&this.beans.columnModel.isPivotMode(),s=this.group&&this.expanded&&!this.footer&&!i,r=this.beans.gridOptionsService.getGroupIncludeFooter()({node:this}),n=this.beans.gridOptionsService.get("groupSuppressBlankHeader");return this.beans.valueService.getValue(t,this,!1,s&&r&&!n)}dispatchEventForSaveValueReadOnly(t,i,s,o){const r=this.beans.gridOptionsService.addGridCommonParams({type:p.EVENT_CELL_EDIT_REQUEST,event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:t,colDef:t.getColDef(),data:this.data,node:this,oldValue:i,newValue:s,value:s,source:o});this.beans.eventService.dispatchEvent(r)}setGroupValue(t,i){const s=this.beans.columnModel.getGridColumn(t);G(this.groupData)&&(this.groupData={});const o=s.getColId(),r=this.groupData[o];r!==i&&(this.groupData[o]=i,this.dispatchCellChangedEvent(s,i,r))}setAggData(t){const i=this.aggData;if(this.aggData=t,this.eventService){const s=o=>{const r=this.aggData?this.aggData[o]:void 0,n=i?i[o]:void 0;if(r===n)return;const l=this.beans.columnModel.lookupGridColumn(o);l&&this.dispatchCellChangedEvent(l,r,n)};for(const o in this.aggData)s(o);for(const o in t)o in this.aggData||s(o)}}updateHasChildren(){let t=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gridOptionsService.isRowModelType("serverSide")){const s=this.beans.gridOptionsService.get("treeData"),o=this.beans.gridOptionsService.get("isServerSideGroup");t=!this.stub&&!this.footer&&(s?!!o&&o(this.data):!!this.group)}t!==this.__hasChildren&&(this.__hasChildren=!!t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(te.EVENT_HAS_CHILDREN_CHANGED)))}hasChildren(){return null==this.__hasChildren&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return this.group&&Be(this.childrenAfterGroup)}dispatchCellChangedEvent(t,i,s){this.dispatchLocalEvent({type:te.EVENT_CELL_CHANGED,node:this,column:t,newValue:i,oldValue:s})}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return!this.footer&&(this.beans.columnModel.isPivotMode()?this.hasChildren()&&!this.leafGroup:this.hasChildren()||
1!!this.master)}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(t){this.childrenAfterGroup&&this.childrenAfterGroup.forEach(i=>i.depthFirstSearch(t)),t(this)}calculateSelectedFromChildren(){var t;let i=!1,s=!1,o=!1;if(null==(t=this.childrenAfterGroup)||!t.length)return this.selectable?this.selected:null;for(let r=0;r<this.childrenAfterGroup.length;r++){const n=this.childrenAfterGroup[r];let l=n.isSelected();if(!n.selectable){const a=n.calculateSelectedFromChildren();if(null===a)continue;l=a}switch(l){case!0:i=!0;break;case!1:s=!0;break;default:o=!0}}return o||i&&s?void 0:!!i||!s&&(this.selectable?this.selected:null)}setSelectedInitialValue(t){this.selected=t}selectThisNode(t,i,s="api"){if(!this.selectable&&t||this.selected===t)return!1;if(this.selected=t,this.eventService){this.dispatchLocalEvent(this.createLocalRowEvent(te.EVENT_ROW_SELECTED));const l=this.sibling;l&&l.footer&&l.dispatchLocalEvent(l.createLocalRowEvent(te.EVENT_ROW_SELECTED))}const n=ie(L({},this.createGlobalRowEvent(p.EVENT_ROW_SELECTED)),{event:i||null,source:s});return this.beans.eventService.dispatchEvent(n),!0}setSelected(t,i=!1,s="api"){"boolean"!=typeof s?this.setSelectedParams({newValue:t,clearSelection:i,rangeSelect:!1,source:s}):console.warn("AG Grid: since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.")}setSelectedParams(t){return this.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),0):void 0===this.id?(console.warn("AG Grid: cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected(ie(L({},t),{nodes:[this.footer?this.sibling:this]}))}isRowPinned(){return"top"===this.rowPinned||"bottom"===this.rowPinned}isParentOfNode(t){let i=this.parent;for(;i;){if(i===t)return!0;i=i.parent}return!1}addEventListener(t,i){var s,o;this.eventService||(this.eventService=new ot),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new kr(this.beans.frameworkOverrides));const r=null!=(o=null==(s=this.frameworkEventListenerService)?void 0:s.wrap(i))?o:i;this.eventService.addEventListener(t,r)}removeEventListener(t,i){var s,o;if(!this.eventService)return;const r=null!=(o=null==(s=this.frameworkEventListenerService)?void 0:s.unwrap(i))?o:i;this.eventService.removeEventListener(t,r),this.eventService.noRegisteredListenersExist()&&(this.eventService=null)}onMouseEnter(){this.dispatchLocalEvent(this.createLocalRowEvent(te.EVENT_MOUSE_ENTER))}onMouseLeave(){this.dispatchLocalEvent(this.createLocalRowEvent(te.EVENT_MOUSE_LEAVE))}getFirstChildOfFirstChild(t){let i=this,s=!0,o=!1,r=null;for(;s&&!o;){const n=i.parent;R(n)&&i.firstChild?n.rowGroupColumn===t&&(o=!0,r=n):s=!1,i=n}return o?r:null}isFullWidthCell(){if(this.detail)return!0;const t=this.beans.gridOptionsService.getCallback("isFullWidthRow");return!!t&&t({rowNode:this})}getRoute(){if(null==this.key)return;const t=[];let i=this;for(;null!=i.key;)t.push(i.key),i=i.parent;return t.reverse()}createFooter(){if(this.sibling)return;const t=new Set(["eventService","__objectId","sticky"]),i=new te(this.beans);Object.keys(this).forEach(s=>{t.has(s)||(i[s]=this[s])}),i.footer=!0,i.setRowTop(null),i.setRowIndex(null),i.oldRowTop=null,i.id="rowGroupFooter_"+this.id,i.sibling=this,this.sibling=i}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}};se.ID_PREFIX_ROW_GROUP="row-group-",se.ID_PREFIX_TOP_PINNED="t-",se.ID_PREFIX_BOTTOM_PINNED="b-",se.OBJECT_ID_SEQUENCE=0,se.EVENT_ROW_SELECTED="rowSelected",se.EVENT_DATA_CHANGED="dataChanged",se.EVENT_CELL_CHANGED="cellChanged",se.EVENT_ALL_CHILDREN_COUNT_CHANGED="allChildrenCountChanged",se.EVENT_MASTER_CHANGED="masterChanged",se.EVENT_GROUP_CHANGED="groupChanged",se.EVENT_MOUSE_ENTER="mouseEnter",se.EVENT_MOUSE_LEAVE="mouseLeave",se.EVENT_HEIGHT_CHANGED="heightChanged",se.EVENT_TOP_CHANGED="topChanged",se.EVENT_DISPLAYED_CHANGED="displayedChanged",se.EVENT_FIRST_CHILD_CHANGED="firstChildCh
1anged",se.EVENT_LAST_CHILD_CHANGED="lastChildChanged",se.EVENT_CHILD_INDEX_CHANGED="childIndexChanged",se.EVENT_ROW_INDEX_CHANGED="rowIndexChanged",se.EVENT_EXPANDED_CHANGED="expandedChanged",se.EVENT_HAS_CHILDREN_CHANGED="hasChildrenChanged",se.EVENT_SELECTABLE_CHANGED="selectableChanged",se.EVENT_UI_LEVEL_CHANGED="uiLevelChanged",se.EVENT_HIGHLIGHT_CHANGED="rowHighlightChanged",se.EVENT_DRAGGING_CHANGED="draggingChanged";var B=se,Zo=class extends k{constructor(){super('\n <div class="ag-selection-checkbox" role="presentation">\n <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n </div>')}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),i=No(e,t),[s,o]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],r=e(s,o);this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${r} (${i})`)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListener(this.eCheckbox.getInputElement(),"dblclick",s=>{rt(s)}),this.addManagedListener(this.eCheckbox.getInputElement(),"click",s=>{rt(s);const o=this.gridOptionsService.get("groupSelectsFiltered"),r=this.eCheckbox.getValue();this.shouldHandleIndeterminateState(r,o)?0===this.onClicked(!0,o,s||{})&&this.onClicked(!1,o,s):r?this.onClicked(!1,o,s):this.onClicked(!0,o,s||{})}),this.addManagedListener(this.rowNode,B.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.rowNode,B.EVENT_DATA_CHANGED,this.onDataChanged.bind(this)),this.addManagedListener(this.rowNode,B.EVENT_SELECTABLE_CHANGED,this.onSelectableChanged.bind(this)),this.gridOptionsService.get("isRowSelectable")||"function"==typeof this.getIsVisible()){const s=this.showOrHideSelect.bind(this);this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,s),this.addManagedListener(this.rowNode,B.EVENT_DATA_CHANGED,s),this.addManagedListener(this.rowNode,B.EVENT_CELL_CHANGED,s),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(void 0===this.eCheckbox.getPreviousValue()||void 0===e)&&this.gridOptionsService.isRowModelType("clientSide")}showOrHideSelect(){var e,t,i;let s=this.rowNode.selectable;const o=this.getIsVisible();if(s)if("function"==typeof o){const n=null==(e=this.overrides)?void 0:e.callbackParams;if(this.column){const l=this.column.createColumnFunctionCallbackParams(this.rowNode);s=o(L(L({},n),l))}else s=o(ie(L({},n),{node:this.rowNode,data:this.rowNode.data}))}else s=o??!1;if(null==(t=this.column)?void 0:t.getColDef().showDisabledCheckboxes)return this.eCheckbox.setDisabled(!s),this.setVisible(!0),void this.setDisplayed(!0);null!=(i=this.overrides)&&i.removeHidden?this.setDisplayed(s):this.setVisible(s)}getIsVisible(){var e,t;return this.overrides?this.overrides.isVisible:null==(t=null==(e=this.column)?void 0:e.getColDef())?void 0:t.checkboxSelection}};u([A("eCheckbox")],Zo.prototype,"eCheckbox",2),u([b],Zo.prototype,"postConstruct",1);var vd=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(vd||{}),V=class extends T{constructor(){super(...arguments),this.dragSourceAndParamsList=[],this.dropTargets=[]}init(){this.ePinnedIcon=Ze("columnMovePin",this.gridOptionsService,null),this.eHideIcon=Ze("columnMoveHide",this.gridOptionsService,null),this.eMoveIcon=Ze("columnMoveMove",this.gridOptionsService,null),this.eLeftIcon=Ze("columnMoveLeft",this.gridOptionsService,null),this.eRightIcon=Ze("columnMoveRight",this.gridOptionsService,null),this.eGroupIcon=Ze("columnMoveGroup",this.gridOptionsService,null),this.eAggregateIcon=Ze("columnMoveValue",this.gridOptionsService,null),this.ePivotIcon=Ze("columnMovePivot",this.gridOptionsService,null),this.eDropNotAllowedIcon=Ze("dropNotAllowed",this.gridOptionsService,null)}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}removeDragSource(e){const t=this.dragSourceAndParamsList.find(i=>i.dragSource===e);t&&(this.dragService.removeDragSource(t.params),Le(this.dragSourceAndParamsList,t))}clearDragSourceParamsList(){this.dragSourceAndParamsList.forEach(e
1=>this.dragService.removeDragSource(e.params)),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(e){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const t=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(t)}this.lastDropTarget=null,this.dragItem=null,this.removeGhost()}onDragging(e,t){var i,s,o,r;const n=this.getHorizontalDirection(e),l=this.getVerticalDirection(e);this.eventLastTime=e,this.positionGhost(e);const a=this.dropTargets.filter(h=>this.isMouseOnDropTarget(e,h)),c=this.findCurrentDropTarget(e,a);if(c!==this.lastDropTarget)this.leaveLastTargetIfExists(e,n,l,t),null!==this.lastDropTarget&&null===c&&(null==(s=(i=this.dragSource).onGridExit)||s.call(i,this.dragItem)),null===this.lastDropTarget&&null!==c&&(null==(r=(o=this.dragSource).onGridEnter)||r.call(o,this.dragItem)),this.enterDragTargetIfExists(c,e,n,l,t),this.lastDropTarget=c;else if(c&&c.onDragging){const h=this.createDropTargetEvent(c,e,n,l,t);c.onDragging(h)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,i=[[e.getContainer()]];return t?i.concat(t):i}allContainersIntersect(e,t){for(const i of t){const s=i.getBoundingClientRect();if(0===s.width||0===s.height)return!1;if(!(e.clientX>=s.left&&e.clientX<s.right&&e.clientY>=s.top&&e.clientY<s.bottom))return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let s=!1;for(const o of i)if(this.allContainersIntersect(e,o)){s=!0;break}return!(t.targetContainsSource&&!t.getContainer().contains(this.dragSource.eElement))&&s&&t.isInterestedIn(this.dragSource.type,this.dragSource.eElement)}findCurrentDropTarget(e,t){const i=t.length;if(0===i)return null;if(1===i)return t[0];const o=this.gridOptionsService.getRootNode().elementsFromPoint(e.clientX,e.clientY);for(const r of o)for(const n of t)if(-1!==Ql(this.getAllContainersFromDropTarget(n)).indexOf(r))return n;return null}enterDragTargetIfExists(e,t,i,s,o){if(e){if(e.onDragEnter){const r=this.createDropTargetEvent(e,t,i,s,o);e.onDragEnter(r)}this.setGhostIcon(e.getIconName?e.getIconName():null)}}leaveLastTargetIfExists(e,t,i,s){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const o=this.createDropTargetEvent(this.lastDropTarget,e,t,i,s);this.lastDropTarget.onDragLeave(o)}this.setGhostIcon(null)}}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter(t=>t.getContainer()!==e.getContainer())}hasExternalDropZones(){return this.dropTargets.some(e=>e.external)}findExternalZone(e){return this.dropTargets.filter(i=>i.external).find(i=>i.getContainer()===e.getContainer())||null}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?0:1}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?0:1}createDropTargetEvent(e,t,i,s,o){const r=e.getContainer(),n=r.getBoundingClientRect(),{gridApi:l,columnApi:a,dragItem:c,dragSource:h}=this;return{event:t,x:t.clientX-n.left,y:t.clientY-n.top,vDirection:s,hDirection:i,dragSource:h,fromNudge:o,dragItem:c,api:l,columnApi:a,dropZoneTarget:r}}positionGhost(e){const t=this.eGhost;if(!t)return;const s=t.getBoundingClientRect().height,o=Ra()-2,r=Da()-2,n=Sn(t.offsetParent),{clientY:l,clientX:a}=e;let c=l-n.top-s/2,h=a-n.left-10;const g=this.gridOptionsService.getDocument(),m=g.defaultView||window,C=m.pageYOffset||g.documentElement.scrollTop,v=m.pageXOffset||g.documentElement.scrollLeft;o>0&&h+t.clientWidth>o+v&&(h=o+v-t.clientWidth),h<0&&(h=0),r>0&&c+t.clientHeight>r+C&&(c=r+C-t.clientHeight),c<0&&(c=0),t.style.left=`${h}px`,t.style.top=`${c}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=xe(V.GHOST_TEMPLATE),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost);const{theme:e}=this.environment.getTheme();e&&this.eGhost.classList.add(e),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const t=this.eGhost.querySelector(".ag-dnd-ghost-label");let i=this.dragSource.dragItemName;bo(i)&&(i=i()),t.innerHTML=pe(i)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const s=this.gridOptionsService.getDocument();let o=null,r=null;try{o=s.fullscreenElement}catch{}finally{o||(o=this.gridOptionsService.getRootNode());r=o.querySelector("body")||(o instanceof ShadowRoot?o:o instanceof Document?o?.documentElement:o)}this.eGhostParent=r,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):console.warn("AG Grid: could not find document body, it is needed for dragging columns")}setGhostIcon(e,t=!1){ce(this.eGhostIcon);let i=null;switch(e||(e=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():V.ICON_NOT_ALLOWED),e){case V.ICON_PINNED:i=this.ePinnedIcon;break;case V.ICON_MOVE:i=this.eMoveIcon;break;case V.ICON_LEFT:i=this.eLeftIcon;break;case V.ICON_RIGHT:i=this.eRightIcon;break;case V.ICON_GROUP:i=this.eGroupIcon;break;case V.ICON_AGGREGATE:i=this.eAggregateIcon;break;case V.ICON_PIVOT:i=this.ePivotIcon;break;case V.ICON_NOT_ALLOWED:i=this.eDropNotAllowedIcon;break;case V.ICON_HIDE:i=this.eHideIcon}this.eGhostIcon.classList.toggle("ag-shake-left-to-right",t),(i!==this.eHideIcon||!this.gridOptionsService.get("suppressDragLeaveHidesColumns"))&&i&&this.eGhostIcon.appendChild(i)}};V.ICON_PINNED="pinned",V.ICON_MOVE="move",V.ICON_LEFT="left",V.ICON_RIGHT="right",V.ICON_GROUP="group",V.ICON_AGGREGATE="aggregate",V.ICON_PIVOT="pivot",V.ICON_NOT_ALLOWED="notAllowed",V.ICON_HIDE="hide",V.GHOST_TEMPLATE='<div class="ag-dnd-ghost ag-unselectable">
1\n <span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>\n <div class="ag-dnd-ghost-label"></div>\n </div>',u([f("dragService")],V.prototype,"dragService",2),u([f("mouseEventService")],V.prototype,"mouseEventService",2),u([f("columnApi")],V.prototype,"columnApi",2),u([f("gridApi")],V.prototype,"gridApi",2),u([b],V.prototype,"init",1),u([Ae],V.prototype,"clearDragSourceParamsList",1),V=u([O("dragAndDropService")],V);var oi=class extends k{constructor(e,t,i,s,o,r){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=s,this.dragStartPixels=o,this.suppressVisibilityChange=r,this.dragSource=null}isCustomGui(){return null!=this.customGui}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(oe("rowDrag",this.gridOptionsService,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gridOptionsService.get("rowDragManaged")?new Ed(this,this.beans,this.rowNode,this.column):new Sd(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e),this.addDragSource(t)}getSelectedNodes(){if(!this.gridOptionsService.get("rowDragMultiRow"))return[this.rowNode];const t=this.beans.selectionService.getSelectedNodes();return-1!==t.indexOf(this.rowNode)?t:[this.rowNode]}checkCompatibility(){const e=this.gridOptionsService.get("rowDragManaged");this.gridOptionsService.get("treeData")&&e&&x("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gridOptionsService.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:this.getGui(),dragItemName:()=>{var i;const s=this.getDragItem(),o=(null==(i=s.rowNodes)?void 0:i.length)||1,r=this.getRowDragText(this.column);return r?r(s,o):1===o?this.cellValueFn():`${o} ${t("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gridOptionsService.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}removeDragSource(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null}};u([f("beans")],oi.prototype,"beans",2),u([b],oi.prototype,"postConstruct",1),u([Ae],oi.prototype,"removeDragSource",1);var wd=class extends T{constructor(e,t,i){super(),this.parent=e,this.rowNode=t,this.column=i}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let i=!0,s=!1;this.column&&(i=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),s=bo(this.column.getColDef().rowDrag)),s?(this.parent.setDisplayed(!0,t),this.parent.setVisible(i,t)):(this.parent.setDisplayed(i,t),this.parent.setVisible(!0,t))}}},Sd=class extends wd{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.addManagedListener(this.rowNode,B.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,B.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,B.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,p.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gridOptionsService.get("suppressRowDrag");this.setDisplayedOrVisible(e)}};u([b],Sd.prototype,"postConstruct",1);var Ed=class extends wd{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedListener(this.beans.eventService,p.EVENT_SORT_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,p.EVENT_FILTER_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,p.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,B.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,B.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const t=this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature
1(),i=t&&t.shouldPreventRowMove(),s=this.gridOptionsService.get("suppressRowDrag"),o=this.beans.dragAndDropService.hasExternalDropZones();this.setDisplayedOrVisible(i&&!o||s)}};u([b],Ed.prototype,"postConstruct",1);var Ui=class extends T{init(e,t,i,s,o,r,n){var l,a,c,h;this.params=n,this.eGui=t,this.eCheckbox=i,this.eExpanded=s,this.eContracted=o,this.comp=e,this.compClass=r;const{node:g,colDef:C}=n,v=this.isTopLevelFooter();if(!v){if(this.isEmbeddedRowMismatch())return;if(g.footer&&this.gridOptionsService.get("groupHideOpenParents")&&(C&&C.showRowGroup)!==(g.rowGroupColumn&&g.rowGroupColumn.getColId()))return}if(this.setupShowingValueForOpenedParent(),this.findDisplayedGroupNode(),!v){const E=n.node.footer&&n.node.rowGroupIndex===this.columnModel.getRowGroupColumns().findIndex(I=>{var _;return I.getColId()===(null==(_=n.colDef)?void 0:_.showRowGroup)}),D="multipleColumns"!=this.gridOptionsService.get("groupDisplayType")||this.gridOptionsService.get("treeData")||this.gridOptionsService.get("showOpenedGroup")&&!n.node.footer&&(!n.node.group||null!=n.node.rowGroupIndex&&n.node.rowGroupIndex>this.columnModel.getRowGroupColumns().findIndex(I=>{var _;return I.getColId()===(null==(_=n.colDef)?void 0:_.showRowGroup)})),y=!g.group&&((null==(l=this.params.colDef)?void 0:l.field)||(null==(a=this.params.colDef)?void 0:a.valueGetter)),P=this.isExpandable(),F=this.columnModel.isPivotMode()&&g.leafGroup&&(null==(c=g.rowGroupColumn)?void 0:c.getColId())===(null==(h=n.column)?void 0:h.getColDef().showRowGroup);if(!(this.showingValueForOpenedParent||P||y||D||E||F))return}this.addExpandAndContract(),this.addFullWidthRowDraggerIfNeeded(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded()}getCellAriaRole(){var e,t;const i=null==(e=this.params.colDef)?void 0:e.cellAriaRole,s=null==(t=this.params.column)?void 0:t.getColDef().cellAriaRole;return i||s||"gridcell"}destroy(){super.destroy(),this.expandListener=null}refreshAriaExpanded(){const{node:e,eGridCell:t}=this.params;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable())return void ga(t);const i=()=>{Pt(t,!!e.expanded)};this.expandListener=this.addManagedListener(e,B.EVENT_EXPANDED_CHANGED,i)||null,i()}isTopLevelFooter(){if(!this.gridOptionsService.get("groupIncludeTotalFooter")||null!=this.params.value||-1!=this.params.node.level)return!1;const e=this.params.colDef;if(null==e||!0===e.showRowGroup)return!0;const i=this.columnModel.getRowGroupColumns();return!i||0===i.length||i[0].getId()===e.showRowGroup}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gridOptionsService.get("embedFullWidthRows"))return!1;
1const e="left"===this.params.pinned,t="right"===this.params.pinned,i=!e&&!t;return this.gridOptionsService.get("enableRtl")?this.columnModel.isPinningLeft()?!t:!i:this.columnModel.isPinningLeft()?!e:!i}findDisplayedGroupNode(){const e=this.params.column,t=this.params.node;if(this.showingValueForOpenedParent){let i=t.parent;for(;null!=i;){if(i.rowGroupColumn&&e.isRowGroupDisplayed(i.rowGroupColumn.getId())){this.displayedGroupNode=i;break}i=i.parent}}G(this.displayedGroupNode)&&(this.displayedGroupNode=t)}setupShowingValueForOpenedParent(){const e=this.params.node,t=this.params.column;if(!this.gridOptionsService.get("groupHideOpenParents"))return void(this.showingValueForOpenedParent=!1);if(!e.groupData)return void(this.showingValueForOpenedParent=!1);if(null!=e.rowGroupColumn){const o=e.rowGroupColumn.getId();if(t.isRowGroupDisplayed(o))return void(this.showingValueForOpenedParent=!1)}const s=null!=e.groupData[t.getId()];this.showingValueForOpenedParent=s}addValueElement(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())}addGroupValue(){var e;const t=this.adjustParamsWithDetailsFromRelatedColumn(),i=this.getInnerCompDetails(t),{valueFormatted:s,value:o}=t;let r=s;if(null==r){const n=this.displayedGroupNode.rowGroupColumn&&(null==(e=this.params.column)?void 0:e.isRowGroupDisplayed(this.displayedGroupNode.rowGroupColumn.getId()));r=""===this.displayedGroupNode.key&&this.displayedGroupNode.group&&n?this.localeService.getLocaleTextFunc()("blanks","(Blanks)"):o??null}this.comp.setInnerRenderer(i,r)}adjustParamsWithDetailsFromRelatedColumn(){const e=this.displayedGroupNode.rowGroupColumn,t=this.params.column;if(!e)return this.params;if(null!=t&&!t.isRowGroupDisplayed(e.getId()))return this.params;const s=this.params,{value:o,node:r}=this.params,n=this.valueFormatterService.formatValue(e,r,o);return ie(L({},s),{valueFormatted:n})}addFooterValue(){const e=this.params.footerValueGetter;let t="";if(e){const s=Ir(this.params);s.value=this.params.value,"function"==typeof e?t=e(s):"string"==typeof e?t=this.expressionService.evaluate(e,s):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else t=this.localeService.getLocaleTextFunc()("footerTotal","Total")+" "+(null!=this.params.value?this.params.value:"");const i=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(i,t)}getInnerCompDetails(e){if(e.fullWidth)return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gridOptionsService.get("groupRowRendererParams"),e);const t=this.userComponentFactory.getInnerRendererDetails(e,e),i=n=>n&&n.componentClass==this.compClass;if(t&&!i(t))return t;const s=this.displayedGroupNode.rowGroupColumn,o=s?s.getColDef():void 0;if(!o)return;const r=this.userComponentFactory.getCellRendererDetails(o,e);return r&&!i(r)?r:i(r)&&o.cellRendererParams&&o.cellRendererParams.innerRenderer?this.userComponentFactory.getInnerRendererDetails(o.cellRendererParams,e):void 0}addChildCount(){this.params.suppressCount||(this.addManagedListener(this.displayedGroupNode,B.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())}updateChildCount(){const e=this.displayedGroupNode.allChildrenCount,s=this.isShowRowGroupForThisRow()&&null!=e&&e>=0?`(${e})`:"";this.comp.setChildCount(s)}isShowRowGroupForThisRow(){if(this.gridOptionsService.get("treeData"))return!0;const e=this.displayedGroupNode.rowGroupColumn;if(!e)return!1;const t=this.params.column;return null==t||t.isRowGroupDisplayed(e.getId())}addExpandAndContract(){var e;const t=this.params,i=oe("groupExpanded",this.gridOptionsService,null),s=oe("groupContracted",this.gridOptionsService,null);i&&this.eExpanded.appendChild(i),s&&this.eContracted.appendChild(s);const o=t.eGridCell;!((null==(e=this.params.column)?void 0:e.isCellEditable(t.node))&&this.gridOptionsService.get("enableGroupEdit"))&&this.isExpandable()&&!t.suppressDoubleClickExpand&&this.addManagedListener(o,"dblclick",this.onCellDblClicked.bind(this)),this.addManagedListener(this.eExpanded,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eContracted,"click",this.onExpandClicked.bind(this)),this.addManagedListener(o,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(t.node,B.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();const n=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,B.EVENT_ALL_CHILDREN_COUNT_CHANGED,n),this.addManagedListener(this.displayedGroupNode,B.EVENT_MASTER_CHANGED,n),this.addManagedListener(this.displayedGroupNode,B.EVENT_GROUP_CHANGED,n),this.addManagedListener(this.displayedGroupNode,B.EVENT_HAS_CHILDREN_CHANGED,n)}onExpandClicked(e){nt(e)||(rt(e),this.onExpandOrContract(e))}onExpandOrContract(e){const t=this.displayedGroupNode,i=!t.expanded;!i&&t.sticky&&this.scrollToStickyNode(t),t.setExpanded(i,e)}scrollToStickyNode(e){this.ctrlsService.getGridBodyCtrl().getScrollFeature
1().setVerticalScrollPosition(e.rowTop-e.stickyRowTop)}isExpandable(){if(this.showingValueForOpenedParent)return!0;const e=this.displayedGroupNode,t=this.columnModel.isPivotMode()&&e.leafGroup;if(!e.isExpandable()||e.footer||t)return!1;const s=this.params.column;return null==s||"string"!=typeof s.getColDef().showRowGroup||this.isShowRowGroupForThisRow()}showExpandAndContractIcons(){const{params:e,displayedGroupNode:t,columnModel:i}=this,{node:s}=e,o=this.isExpandable();if(o){const c=!!this.showingValueForOpenedParent||s.expanded;this.comp.setExpandedDisplayed(c),this.comp.setContractedDisplayed(!c)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);const r=i.isPivotMode(),n=r&&t.leafGroup,l=o&&!n,a=s.footer&&-1===s.level;this.comp.addOrRemoveCssClass("ag-cell-expandable",l),this.comp.addOrRemoveCssClass("ag-row-group",l),r?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",n):a||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!l)}onRowNodeIsExpandableChanged(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()}setupIndent(){this.params.suppressPadding||(this.addManagedListener(this.params.node,B.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())}setIndent(){if(this.gridOptionsService.get("groupHideOpenParents"))return;const e=this.params,t=e.node,i=!!e.colDef,s=this.gridOptionsService.get("treeData"),r=!i||s||!0===e.colDef.showRowGroup?t.uiLevel:0;this.indentClass&&this.comp.addOrRemoveCssClass(this.indentClass,!1),this.indentClass="ag-row-group-indent-"+r,this.comp.addOrRemoveCssClass(this.indentClass,!0)}addFullWidthRowDraggerIfNeeded(){if(!this.params.fullWidth||!this.params.rowDrag)return;const e=new oi(()=>this.params.value,this.params.node);this.createManagedBean(e,this.context),this.eGui.insertAdjacentElement("afterbegin",e.getGui())}isUserWantsSelected(){const e=this.params.checkbox;return"function"==typeof e||!0===e}addCheckboxIfNeeded(){const e=this.displayedGroupNode,t=this.isUserWantsSelected()&&!e.footer&&!e.rowPinned&&!e.detail;if(t){const i=new Zo;this.getContext().createBean(i),i.init({rowNode:this.params.node,column:this.params.column,overrides:{isVisible:this.params.checkbox,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(i.getGui()),this.addDestroyFunc(()=>this.getContext().destroyBean(i))}this.comp.setCheckboxVisible(t)}onKeyDown(e){e.key!==w.ENTER||this.params.suppressEnterExpand||this.params.column&&this.params.column.isCellEditable(this.params.node)||this.onExpandOrContract(e)}onCellDblClicked(e){nt(e)||Oo(this.eExpanded,e)||Oo(this.eContracted,e)||this.onExpandOrContract(e)}};u([f("expressionService")],Ui.prototype,"expressionService",2),u([f("valueFormatterService")],Ui.prototype,"valueFormatterService",2),u([f("columnModel")],Ui.prototype,"columnModel",2),u([f("userComponentFactory")],Ui.prototype,"userComponentFactory",2),u([f("ctrlsService")],Ui.prototype,"ctrlsService",2);var ri=class yu extends k{constructor(){super(yu.TEMPLATE)}init(t){const i={setInnerRenderer:(n,l)=>this.setRenderDetails(n,l),setChildCount:n=>this.eChildCount.textContent=n,addOrRemoveCssClass:(n,l)=>this.addOrRemoveCssClass(n,l),setContractedDisplayed:n=>U(this.eContracted,n),setExpandedDisplayed:n=>U(this.eExpanded,n),setCheckboxVisible:n=>this.eCheckbox.classList.toggle("ag-invisible",!n)},s=this.createManagedBean(new Ui),o=!t.colDef,r=this.getGui();s.init(i,r,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,t),o&&re(r,s.getCellAriaRole())}setRenderDetails(t,i){if(t){const s=t.newAgStackInstance();if(!s)return;s.then(o=>{if(!o)return;const r=()=>this.context.destroyBean(o);this.isAlive()?(this.eValue.appendChild(o.getGui()),this.addDestroyFunc(r)):r()})}else this.eValue.innerText=i}destroy(){this.getContext().destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}};ri.TEMPLATE='<span class="ag-cell-wrapper">\n <span class="ag-group-expanded" ref="eExpanded"></span>\n <span class="ag-group-contracted" ref="eContracted"></span>\n <span class="ag-group-checkbox ag-invisible" ref="eCheckbox"></span>
1\n <span class="ag-group-value" ref="eValue"></span>\n <span class="ag-group-child-count" ref="eChildCount"></span>\n </span>',u([A("eExpanded")],ri.prototype,"eExpanded",2),u([A("eContracted")],ri.prototype,"eContracted",2),u([A("eCheckbox")],ri.prototype,"eCheckbox",2),u([A("eValue")],ri.prototype,"eValue",2),u([A("eChildCount")],ri.prototype,"eChildCount",2);var yd=ri,Jo=class Ru extends k{constructor(){super(Ru.TEMPLATE)}init(t){t.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingError","ERR")}setupLoading(){const t=oe("groupLoading",this.gridOptionsService,null);t&&this.eLoadingIcon.appendChild(t);const i=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=i("loadingOoo","Loading")}refresh(t){return!1}destroy(){super.destroy()}};Jo.TEMPLATE='<div class="ag-loading">\n <span class="ag-loading-icon" ref="eLoadingIcon"></span>\n <span class="ag-loading-text" ref="eLoadingText"></span>\n </div>',u([A("eLoadingIcon")],Jo.prototype,"eLoadingIcon",2),u([A("eLoadingText")],Jo.prototype,"eLoadingText",2);var Bh=Jo,Rd=class Du extends k{constructor(){super()}destroy(){super.destroy()}init(t){const i=this.gridOptionsService.get("overlayLoadingTemplate");if(this.setTemplate(i??Du.DEFAULT_LOADING_OVERLAY_TEMPLATE),!i){const s=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=s("loadingOoo","Loading...")})}}};Rd.DEFAULT_LOADING_OVERLAY_TEMPLATE='<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>';var Wh=Rd,Dd=class Tu extends k{constructor(){super()}destroy(){super.destroy()}init(t){const i=this.gridOptionsService.get("overlayNoRowsTemplate");if(this.setTemplate(i??Tu.DEFAULT_NO_ROWS_TEMPLATE),!i){const s=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=s("noRowsToShow","No Rows To Show")})}}};Dd.DEFAULT_NO_ROWS_TEMPLATE='<span class="ag-overlay-no-rows-center"></span>';var Uh=Dd,zh=class extends si{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().textContent=pe(t,!0)}},Kh=class{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" ref="eInput"></ag-input-number-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.max&&e.setMax(t.max),null!=t.min&&e.setMin(t.min),null!=t.precision&&e.setPrecision(t.precision),null!=t.step&&e.setStep(t.step);const i=e.getInputElement();t.preventStepping?e.addManagedListener(i,"keydown",this.preventStepping):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}preventStepping(e){(e.key===w.UP||e.key===w.DOWN)&&e.preventDefault()}getValue(){const e=this.eInput.getValue();if(!R(e)&&!R(this.params.value))return this.params.value;let t=this.params.parseValue(e);if(null==t)return t;if("string"==typeof t){if(""===t)return null;t=Number(t)}return isNaN(t)?null:t}getStartValue(){return this.params.value}},$h=class extends xs{constructor(){super(new Kh)}},qh=class{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.eInput.getDate();return R(e)||R(this.params.value)?e??null:this.params.value}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Qe(e,!1)}},Yh=class extends xs{constructor(){super(new qh)}},jh=class{constructor(e){this.getDataTypeService=e}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.formatDate(this.eInput.getDate());return R(e)||R(this.params.value)?this.params.parseValue(e??""):this.params.value}getStartValue(){var e,t;return Qe(null!=(t=this.parseDate(null!=(e=this.params.value)?e:void 0))?t:null,!1)}parseDate(e){return this.getDataTypeService().getDateParserFunction(this.params.column)(e)}formatDate(e){return this.getDataTypeService().getDateFormatterFunction(this.params.column)(e)}},Td=class extends xs{constructor(){super(new jh(()=>this.dataTypeService))}};u([f("dataTypeService")],Td.prototype,"dataTypeService",2);var Hn=class bu extends k{constructor(){super(bu.TEMPLATE)}init(t){this.params=t,this.updateCheckbox(t);const i=this.eCheckbox.getInputElement();i.setAttribute("tabindex","-1"),jr(i,"polite"),this.addManagedListener(i,"click",o=>
1{if(rt(o),this.eCheckbox.isDisabled())return;const r=this.eCheckbox.getValue();this.onCheckboxChanged(r)}),this.addManagedListener(i,"dblclick",o=>{rt(o)});const s=this.gridOptionsService.getDocument();this.addManagedListener(this.params.eGridCell,"keydown",o=>{if(o.key===w.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===s.activeElement&&this.eCheckbox.toggle();const r=this.eCheckbox.getValue();this.onCheckboxChanged(r),o.preventDefault()}})}refresh(t){return this.params=t,this.updateCheckbox(t),!0}updateCheckbox(t){var i,s,o;let r,n=!0;if(t.node.group&&t.column){const g=t.column.getColId();g.startsWith(xi)?r=null==t.value||""===t.value?void 0:"true"===t.value:t.node.aggData&&void 0!==t.node.aggData[g]?r=null!=(i=t.value)?i:void 0:n=!1}else r=null!=(s=t.value)?s:void 0;if(!n)return void this.eCheckbox.setDisplayed(!1);this.eCheckbox.setValue(r);const l=null!=t.disabled?t.disabled:!(null!=(o=t.column)&&o.isCellEditable(t.node));this.eCheckbox.setDisabled(l);const a=this.localeService.getLocaleTextFunc(),c=No(a,r),h=l?c:`${a("ariaToggleCellValue","Press SPACE to toggle cell value")} (${c})`;this.eCheckbox.setInputAriaLabel(h)}onCheckboxChanged(t){const{column:i,node:s,rowIndex:o,value:r}=this.params,n={type:p.EVENT_CELL_EDITING_STARTED,column:i,colDef:i?.getColDef(),data:s.data,node:s,rowIndex:o,rowPinned:s.rowPinned,value:r};this.eventService.dispatchEvent(n);const l=this.params.node.setDataValue(this.params.column,t,"edit"),a={type:p.EVENT_CELL_EDITING_STOPPED,column:i,colDef:i?.getColDef(),data:s.data,node:s,rowIndex:o,rowPinned:s.rowPinned,value:r,oldValue:r,newValue:t,valueChanged:l};this.eventService.dispatchEvent(a)}};Hn.TEMPLATE='\n <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">\n <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n </div>',u([A("eCheckbox")],Hn.prototype,"eCheckbox",2);var Qh=Hn,bd=class extends si{constructor(){super('\n <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">\n <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n </div>')}init(e){var t;this.params=e;const i=null!=(t=e.value)?t:void 0;this.eCheckbox.setValue(i),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(i),this.addManagedListener(this.eCheckbox,p.EVENT_FIELD_VALUE_CHANGED,o=>this.setAriaLabel(o.selected))}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),i=No(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}};u([A("eCheckbox")],bd.prototype,"eCheckbox",2);var Xh=class extends k{constructor(){super(),this.setTemplate("<div></div>")}init(e){var t;this.params=e,this.cssClassPrefix=null!=(t=this.params.cssClassPrefix)?t:"ag-menu-option",this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addIcon(){if(this.params.isCompact)return;const e=xe(`<span ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`);this.params.checked?e.appendChild(oe("check",this.gridOptionsService)):this.params.icon&&(As(this.params.icon)?e.appendChild(this.params.icon):"string"==typeof this.params.icon?e.innerHTML=this.params.icon:console.warn("AG Grid: menu item icon must be DOM node or string")),this.getGui().appendChild(e)}addName(){const e=xe(`<span 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=xe(`<span ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(e)}addSubMenu(){const e=xe(`<span ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`),t=this.getGui();if(this.params.subMenu){const i=this.gridOptionsService.get("enableRtl")?"smallLeft":"smallRight";Pt(t,!1),e.appendChild(oe(i,this.gridOptionsService))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}destroy(){super.destroy()}},Gs=class extends T{constructor(){super(...arguments),this.agGridDefaults={agDateInput:dd,agColumnHeader:Nn,agColumnGroupHeader:_h,agSortIndicator:Gn,agTextColumnFloatingFilter:Lh,agNumberColumnFloatingFilter:Ih,agDateColumnFloatingFilter:Xo,agReadOnlyFloatingFilter:Fn,agAnimateShowChangeCellRenderer:md,agAnimateSlideCellRenderer:Cd,agGroupCellRenderer:yd,agGroupRowRenderer:yd,agLoadingCellRenderer:Bh,agCheckboxCellRenderer:Qh,agCellEditor:fd,agTextCellEditor:fd,agNumberCellEditor:$h,agDateCellEditor:Yh,agDateStringCellEditor:Td,agSelectCellEditor:Vn,agLargeTextCellEditor:xh,agCheckboxCellEditor:bd,agTextColumnFilter:xn,agNumberColumnFilter:hd,agDateColumnFilter:ld,agLo
1adingOverlay:Wh,agNoRowsOverlay:Uh,agTooltipComponent:zh,agMenuItem:Xh},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:"@ag-grid-enterprise/set-filter",agSetColumnFloatingFilter:"@ag-grid-enterprise/set-filter",agMultiColumnFilter:"@ag-grid-enterprise/multi-filter",agMultiColumnFloatingFilter:"@ag-grid-enterprise/multi-filter",agGroupColumnFilter:"@ag-grid-enterprise/row-grouping",agGroupColumnFloatingFilter:"@ag-grid-enterprise/row-grouping",agRichSelect:"@ag-grid-enterprise/rich-select",agRichSelectCellEditor:"@ag-grid-enterprise/rich-select",agDetailCellRenderer:"@ag-grid-enterprise/master-detail",agSparklineCellRenderer:"@ag-grid-enterprise/sparklines"},this.jsComps={}}init(){null!=this.gridOptions.components&&Se(this.gridOptions.components,(e,t)=>this.registerJsComponent(e,t))}registerDefaultComponent(e,t){this.agGridDefaults[e]?console.error("Trying to overwrite a default component. You should call registerComponent"):this.agGridDefaults[e]=t}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(l,a)=>({componentFromFramework:a,component:l}),s=this.getFrameworkOverrides().frameworkComponent(t,this.gridOptions.components);if(null!=s)return i(s,!0);const o=this.jsComps[t];if(o)return i(o,this.getFrameworkOverrides().isFrameworkComponent(o));const r=this.agGridDefaults[t];if(r)return i(r,!1);const n=this.enterpriseAgDefaultCompsModule[t];return n?Y.__assertRegistered(n,`AG Grid '${e}' component: ${t}`,this.context.getGridId()):Qt(()=>{this.warnAboutMissingComponent(e,t)},"MissingComp"+t),null}warnAboutMissingComponent(e,t){const s=Fs(t,[...Object.keys(this.agGridDefaults).filter(o=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(o)),...Object.keys(this.jsComps)],!0,.8).values;console.warn(`AG Grid: Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),s.length>0&&console.warn(` Did you mean: [${s.slice(0,3)}]?`),console.warn(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}};u([f("gridOptions")],Gs.prototype,"gridOptions",2),u([b],Gs.prototype,"init",1),Gs=u([O("userComponentRegistry")],Gs);var Zh={propertyName:"dateComponent",cellRenderer:!1},Jh={propertyName:"headerComponent",cellRenderer:!1},ep={propertyName:"headerGroupComponent",cellRenderer:!1},Pd={propertyName:"cellRenderer",cellRenderer:!0},tp={propertyName:"cellEditor",cellRenderer:!1},Ad={propertyName:"innerRenderer",cellRenderer:!0},ip={propertyName:"loadingOverlayComponent",cellRenderer:!1},sp={propertyName:"noRowsOverlayComponent",cellRenderer:!1},op={propertyName:"tooltipComponent",cellRenderer:!1},Bn={propertyName:"filter",cellRenderer:!1},rp={propertyName:"floatingFilterComponent",cellRenderer:!1},np={propertyName:"toolPanel",cellRenderer:!1},lp={propertyName:"statusPanel",cellRenderer:!1},ap={propertyName:"fullWidthCellRenderer",cellRenderer:!0},dp={propertyName:"loadingCellRenderer",cellRenderer:!0},up={propertyName:"groupRowRenderer",cellRenderer:!0},cp={propertyName:"detailCellRenderer",cellRenderer:!0},hp={propertyName:"menuItem",cellRenderer:!1},Fd=class{static getFloatingFilterType(e){return this.filterToFloatingFilterMapping[e]}};Fd.filterToFloatingFilterMapping={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"};var Bt=class extends T{getHeaderCompDetails(e,t){return this.getCompDetails(e,Jh,"agColumnHeader",t)}getHeaderGroupCompDetails(e){const t=e.columnGroup.getColGroupDef();return this.getCompDetails(t,ep,"agColumnGroupHeader",e)}getFullWidthCellRendererDetails(e){return this.getCompDetails(this.gridOptions,ap,null,e,!0)}getFullWidthLoadingCellRendererDetails(e){return this.getCompDetail
1s(this.gridOptions,dp,"agLoadingCellRenderer",e,!0)}getFullWidthGroupCellRendererDetails(e){return this.getCompDetails(this.gridOptions,up,"agGroupRowRenderer",e,!0)}getFullWidthDetailCellRendererDetails(e){return this.getCompDetails(this.gridOptions,cp,"agDetailCellRenderer",e,!0)}getInnerRendererDetails(e,t){return this.getCompDetails(e,Ad,null,t)}getFullWidthGroupRowInnerCellRenderer(e,t){return this.getCompDetails(e,Ad,null,t)}getCellRendererDetails(e,t){return this.getCompDetails(e,Pd,null,t)}getCellEditorDetails(e,t){return this.getCompDetails(e,tp,"agCellEditor",t,!0)}getFilterDetails(e,t,i){return this.getCompDetails(e,Bn,i,t,!0)}getDateCompDetails(e){return this.getCompDetails(this.gridOptions,Zh,"agDateInput",e,!0)}getLoadingOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,ip,"agLoadingOverlay",e,!0)}getNoRowsOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,sp,"agNoRowsOverlay",e,!0)}getTooltipCompDetails(e){return this.getCompDetails(e.colDef,op,"agTooltipComponent",e,!0)}getSetFilterCellRendererDetails(e,t){return this.getCompDetails(e,Pd,null,t)}getFloatingFilterCompDetails(e,t,i){return this.getCompDetails(e,rp,i,t)}getToolPanelCompDetails(e,t){return this.getCompDetails(e,np,null,t,!0)}getStatusPanelCompDetails(e,t){return this.getCompDetails(e,lp,null,t,!0)}getMenuItemCompDetails(e,t){return this.getCompDetails(e,hp,"agMenuItem",t,!0)}getCompDetails(e,t,i,s,o=!1){const{propertyName:r,cellRenderer:n}=t;let{compName:l,jsComp:a,fwComp:c,paramsFromSelector:h,popupFromSelector:g,popupPositionFromSelector:m}=this.getCompKeys(e,t,s);const C=D=>{const y=this.userComponentRegistry.retrieve(r,D);y&&(a=y.componentFromFramework?void 0:y.component,c=y.componentFromFramework?y.component:void 0)};if(null!=l&&C(l),null==a&&null==c&&null!=i&&C(i),a&&n&&!this.agComponentUtils.doesImplementIComponent(a)&&(a=this.agComponentUtils.adaptFunction(r,a)),!a&&!c)return void(o&&console.error(`AG Grid: Could not find component ${l}, did you forget to configure this component?`));
1const v=this.mergeParamsWithApplicationProvidedParams(e,t,s,h),E=null==a,S=a||c;return{componentFromFramework:E,componentClass:S,params:v,type:t,popupFromSelector:g,popupPositionFromSelector:m,newAgStackInstance:()=>this.newAgStackInstance(S,E,v,t)}}getCompKeys(e,t,i){const{propertyName:s}=t;let o,r,n,l,a,c;if(e){const h=e,g=h[s+"Selector"],m=g?g(i):null,C=v=>{"string"==typeof v?o=v:null!=v&&!0!==v&&(this.getFrameworkOverrides().isFrameworkComponent(v)?n=v:r=v)};m?(C(m.component),l=m.params,a=m.popup,c=m.popupPosition):C(h[s])}return{compName:o,jsComp:r,fwComp:n,paramsFromSelector:l,popupFromSelector:a,popupPositionFromSelector:c}}newAgStackInstance(e,t,i,s){let n;if(t){const a=this.componentMetadataProvider.retrieve(s.propertyName);n=this.frameworkComponentWrapper.wrap(e,a.mandatoryMethodList,a.optionalMethodList,s)}else n=new e;const l=this.initComponent(n,i);return null==l?Ge.resolve(n):l.then(()=>n)}mergeParamsWithApplicationProvidedParams(e,t,i,s=null){const o=this.gridOptionsService.getGridCommonParams();We(o,i);const n=e&&e[t.propertyName+"Params"];return"function"==typeof n?We(o,n(i)):"object"==typeof n&&We(o,n),We(o,s),o}initComponent(e,t){if(this.context.createBean(e),null!=e.init)return e.init(t)}getDefaultFloatingFilterType(e,t){if(null==e)return null;let i=null,{compName:s,jsComp:o,fwComp:r}=this.getCompKeys(e,Bn);return s?i=Fd.getFloatingFilterType(s):null==o&&null==r&&!0===e.filter&&(i=t()),i}};u([f("gridOptions")],Bt.prototype,"gridOptions",2),u([f("agComponentUtils")],Bt.prototype,"agComponentUtils",2),u([f("componentMetadataProvider")],Bt.prototype,"componentMetadataProvider",2),u([f("userComponentRegistry")],Bt.prototype,"userComponentRegistry",2),u([z("frameworkComponentWrapper")],Bt.prototype,"frameworkComponentWrapper",2),Bt=u([O("userComponentFactory")],Bt);var er=class{};er.ColDefPropertyMap={headerName:void 0,columnGroupShow:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnsMenuParams:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressCellFlash:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressMenu:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressS
1panHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0},er.ALL_PROPERTIES=Object.keys(er.ColDefPropertyMap);var pp=er,Od=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=-1!==e.scrollAxis.indexOf("x"),this.scrollVertically=-1!==e.scrollAxis.indexOf("y"),this.scrollByTick=null!=e.scrollByTick?e.scrollByTick:20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}check(e,t=!1){const i=t||this.shouldSkipVerticalScroll();if(i&&this.shouldSkipHorizontalScroll())return;const s=this.scrollContainer.getBoundingClientRect(),o=this.scrollByTick;this.tickLeft=e.clientX<s.left+o,this.tickRight=e.clientX>s.right-o,this.tickUp=e.clientY<s.top+o&&!i,this.tickDown=e.clientY>s.bottom-o&&!i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){null===this.tickingInterval&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){let e;if(this.tickCount++,e=this.tickCount>20?200:this.tickCount>10?80:40,this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Ke=class extends T{constructor(e){super(),this.isMultiRowDrag=!1,this.eContainer=e}postConstruct(){this.gridOptionsService.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(()=>{const e=this.ctrlsService.getGridBodyCtrl();this.autoScrollService=new Od({scrollContainer:e.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>e.getScrollFeature().getVScrollPosition().top,setVerticalPosition:t=>e.getScrollFeature().setVerticalScrollPosition(t),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})})}getContainer(){return this.eContainer}isInterestedIn(e){return 2===e}getIconName(){return this.gridOptionsService.get("rowDragManaged")&&this.shouldPreventRowMove()?V.ICON_NOT_ALLOWED:V.ICON_MOVE}shouldPreventRowMove(){return!!(this.columnModel.getRowGroupColumns().length||this.filterManager.isAnyFilterPresent()||this.sortController.isSortActive())}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=this.gridOptionsService.get("rowDragMultiRow"),i=[...this.selectionService.getSelectedNodes()].sort((o,r)=>null==o.rowIndex||null==r.rowIndex?0:this.getRowIndexNumber(o)-this.getRowIndexNumber(r)),s=e.dragItem.rowNode;return t&&-1!==i.indexOf(s)?(this.isMultiRowDrag=!0,i):(this.isMultiRowDrag=!1,[s])}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent(p.EVENT_ROW_DRAG_ENTER,e),this.getRowNodes(e).forEach(t=>{t.setDragging(!0)}),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gridOptionsService.getDomDataKey()}isDropZoneWithinThisGrid(e){const i=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:s}=e;return!i.contains(s)}onEnterOrDragging(e){this.dispatchGridEvent(p.EVENT_ROW_DRAG_MOVE,e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gridOptionsService.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),s=this.gridOptionsService.get("rowDragManaged"),o=e.dragItem.rowNodes;s&&this.shouldPreventRowMove()||(this.gridOptionsService.get("suppressMoveWhenRowDragging")||!i?this.isDropZoneWithinThisGrid(e)||this.clientSideRowModel.highlightRowAtPixel(o[0],t):this.moveRows(o,t))}getRowIndexNumber(e){return parseInt(K(e.getRowIndexString().split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&1===t.highlighted,s=this.mouseEventService.getNormalisedPosition(e).y,o=e.dragItem.rowNodes;let r=i?1:0;
1if(this.isFromThisGrid(e))o.forEach(n=>{n.rowTop<s&&(r-=1)}),this.moveRows(o,s,r);else{const n=this.gridOptionsService.getCallback("getRowId");let l=this.clientSideRowModel.getRowIndexAtPixel(s)+1;0===this.clientSideRowModel.getHighlightPosition(s)&&l--,this.clientSideRowModel.updateRowData({add:o.map(a=>a.data).filter(a=>!this.clientSideRowModel.getRowNode(n?n({data:a,level:0}):a.id)),addIndex:l})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),this.rangeService&&this.rangeService.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer())return void x("addRowDropZone - A container target needs to be provided");if(this.dragAndDropService.findExternalZone(e))return void console.warn("AG Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");let t={getContainer:e.getContainer};e.fromGrid?t=e:(e.onDragEnter&&(t.onDragEnter=i=>{e.onDragEnter(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_ENTER,i))}),e.onDragLeave&&(t.onDragLeave=i=>{e.onDragLeave(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_LEAVE,i))}),e.onDragging&&(t.onDragging=i=>{e.onDragging(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_MOVE,i))}),e.onDragStop&&(t.onDragStop=i=>{e.onDragStop(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_END,i))})),this.dragAndDropService.addDropTarget(L({isInterestedIn:i=>2===i,getIconName:()=>V.ICON_MOVE,external:!0},t))}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),s=this.onDragLeave.bind(this),o=this.onDragging.bind(this),r=this.onDragStop.bind(this);return e?{getContainer:t,onDragEnter:e.onDragEnter?n=>{i(n),e.onDragEnter(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_ENTER,n))}:i,onDragLeave:e.onDragLeave?n=>{s(n),e.onDragLeave(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_LEAVE,n))}:s,onDragging:e.onDragging?n=>{o(n),e.onDragging(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_MOVE,n))}:o,onDragStop:e.onDragStop?n=>{r(n),e.onDragStop(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_END,n))}:r,fromGrid:!0}:{getContainer:t,onDragEnter:i,onDragLeave:s,onDragging:o,onDragStop:r,fromGrid:!0}}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y;let r,n,o=-1;switch(i>this.paginationProxy.getCurrentPageHeight()||(o=this.rowModel.getRowIndexAtPixel(i),r=this.rowModel.getRow(o)),t.vDirection){case 1:n="down";break;case 0:n="up";break;default:n=null}return this.gridOptionsService.addGridCommonParams({type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:o,overNode:r,y:i,vDirection:n})}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent(p.EVENT_ROW_DRAG_LEAVE,e),this.stopDragging(e),this.gridOptionsService.get("rowDragManaged")&&this.clearRowHighlight(),this.isFromThisGrid(e)&&(this.isMultiRowDrag=!1)}onDragStop(e){this.dispatchGridEvent(p.EVENT_ROW_DRAG_END,e),this.stopDragging(e),this.gridOptionsService.get("rowDragManaged")&&(this.gridOptionsService.get("suppressMoveWhenRowDragging")||!this.isFromThisGrid(e))&&!this.isDropZoneWithinThisGrid(e)&&this.moveRowAndClearHighlight(e)}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach(t=>{t.setDragging(!1)})}};u([f("dragAndDropService")],Ke.prototype,"dragAndDropService",2),u([f("rowModel")],Ke.prototype,"rowModel",2),u([f("paginationProxy")],Ke.prototype,"paginationProxy",2),u([f("columnModel")],Ke.prototype,"columnModel",2),u([f("focusService")],Ke.prototype,"focusService",2),u([f("sortController")],Ke.prototype,"sortController",2),u([f("filterManager")],Ke.prototype,"filterManager",2),u([f("selectionService")],Ke.prototype,"selectionService",2),u([f("mou
1seEventService")],Ke.prototype,"mouseEventService",2),u([f("ctrlsService")],Ke.prototype,"ctrlsService",2),u([z("rangeService")],Ke.prototype,"rangeService",2),u([b],Ke.prototype,"postConstruct",1);var Ns=class extends T{constructor(){super(...arguments),this.dragEndFunctions=[],this.dragSources=[]}removeAllListeners(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0}removeListener(e){const t=e.dragSource.eElement;t.removeEventListener("mousedown",e.mouseDownListener),e.touchEnabled&&t.removeEventListener("touchstart",e.touchStartListener,{passive:!0})}removeDragSource(e){const t=this.dragSources.find(i=>i.dragSource===e);t&&(this.removeListener(t),Le(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:s,stopPropagationForTouch:o}=e;i.addEventListener("mousedown",t);let r=null;const n=this.gridOptionsService.get("suppressTouch");s&&!n&&(r=l=>{vn(l.target)||(l.cancelable&&(l.preventDefault(),o&&l.stopPropagation()),this.onTouchStart(e,l))},i.addEventListener("touchstart",r,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:r,touchEnabled:!!s})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const o=a=>this.onTouchUp(a,e.eElement),n=t.target,l=[{target:this.gridOptionsService.getRootNode(),type:"touchmove",listener:a=>{a.cancelable&&a.preventDefault()},options:{passive:!1}},{target:n,type:"touchmove",listener:a=>this.onTouchMove(a,e.eElement),options:{passive:!0}},{target:n,type:"touchend",listener:o,options:{passive:!0}},{target:n,type:"touchcancel",listener:o,options:{passive:!0}}];this.addTemporaryEvents(l),0===e.dragStartPixels&&this.onCommonMove(i,this.touchStart,e.eElement)}onMouseDown(e,t){const i=t;if(e.skipMouseEvent&&e.skipMouseEvent(t)||i._alreadyProcessedByDragService||(i._alreadyProcessedByDragService=!0,0!==t.button))return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const n=this.gridOptionsService.getRootNode();this.addTemporaryEvents([{target:n,type:"mousemove",listener:a=>this.onMouseMove(a,e.eElement)},{target:n,type:"mouseup",listener:a=>this.onMouseUp(a,e.eElement)},{target:n,type:"contextmenu",listener:a=>a.preventDefault()}]),0===e.dragStartPixels&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach(t=>{const{target:i,type:s,listener:o,options:r}=t;i.addEventListener(s,o,r)}),this.dragEndFunctions.push(()=>{e.forEach(t=>{const{target:i,type:s,listener:o,options:r}=t;i.removeEventListener(s,o,r)})})}isEventNearStartEvent(e,t){const{dragStartPixels:i}=this.currentDragParams;return Pn(e,t,R(i)?i:4)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,i){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(e,t))return;this.dragging=!0,this.eventService.dispatchEvent({type:p.EVENT_DRAG_STARTED,target:i}),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){var i;ft()&&(null==(i=this.gridOptionsService.getDocument().getSelection())||i.removeAllRanges()),this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){return this.gridOptionsService.get("enableCellTextSelection")&&"mousemove"===e.type&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){const t=e.target,i=t?.tagName.toLocaleLowerCase();return!!i?.match("^a$|textarea|input|select|button")}onTouchUp(e,t){let i=this.getFirstActiveTouch(e.changedTouches);i||(i=this.touchLastTime),this.onUpCommon(i,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){this.dragging&&(this.dragging=!1,this.currentDragParams.onDragStop(e),this.eventService.dispatchEvent({type:p.EVENT_DRAG_STOPPED,target:t})),this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach(i=>
1i()),this.dragEndFunctions.length=0}};u([f("mouseEventService")],Ns.prototype,"mouseEventService",2),u([Ae],Ns.prototype,"removeAllListeners",1),Ns=u([O("dragService")],Ns);var Wn="ag-list-item-hovered",Md=class extends T{constructor(e,t,i){super(),this.comp=e,this.virtualList=t,this.params=i,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.addManagedListener(this.params.eventSource,this.params.listItemDragStartEvent,this.listItemDragStart.bind(this)),this.addManagedListener(this.params.eventSource,this.params.listItemDragEndEvent,this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(e){this.currentDragValue=this.params.getCurrentDragValue(e),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){this.dragAndDropService.addDropTarget({isInterestedIn:t=>t===this.params.dragSourceType,getIconName:()=>this.moveBlocked?V.ICON_PINNED:V.ICON_MOVE,getContainer:()=>this.comp.getGui(),onDragging:t=>this.onDragging(t),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave()})}createAutoScrollService(){const e=this.virtualList.getGui();this.autoScrollService=new Od({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}onDragging(e){if(!this.currentDragValue||this.moveBlocked)return;const t=this.getListDragItem(e),i=this.virtualList.getComponentAt(t.rowIndex);if(!i)return;const s=i.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===t.rowIndex&&this.lastHoveredListItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredListItem=t,mn(s,Wn),mn(s,`ag-item-highlight-${t.position}`))}getListDragItem(e){const t=this.virtualList.getGui(),i=parseFloat(window.getComputedStyle(t).paddingTop),s=this.virtualList.getRowHeight(),o=this.virtualList.getScrollTop(),r=Math.max(0,(e.y-i+o)/s),n=this.params.getNumRows(this.comp)-1,l=0|Math.min(n,r);return{rowIndex:l,position:Math.round(r)>r||r>n?"bottom":"top",component:this.virtualList.getComponentAt(l)}}onDragStop(){this.moveBlocked||(this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearHoveredItems(),this.autoScrollService.ensureCleared())}onDragLeave(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){this.virtualList.getGui().querySelectorAll(`.${Wn}`).forEach(t=>{[Wn,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach(i=>{t.classList.remove(i)})}),this.lastHoveredListItem=null}};function ni(e){return null!=e&&null!=e.getFrameworkComponentInstance?e.getFrameworkComponentInstance():e}u([f("dragAndDropService")],Md.prototype,"dragAndDropService",2),u([b],Md.prototype,"postConstruct",1);var W=class{constructor(){this.detailGridInfoMap={},this.destroyCalled=!1}init(){switch(this.rowModel.getType()){case"clientSide":this.clientSideRowModel=this.rowModel;break;case"infinite":this.infiniteRowModel=this.rowModel;break;case"serverSide":this.serverSideRowModel=this.rowModel}this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl()})}__getAlignedGridService(){return this.alignedGridsService}__getContext(){return this.context}__getModel(){return this.rowModel}getGridId(){return this.context.getGridId()}addDetailGridInfo(e,t){this.detailGridInfoMap[e]=t}removeDetailGridInfo(e){this.detailGridInfoMap[e]=void 0}getDetailGridInfo(e){return this.detailGridInfoMap[e]}forEachDetailGridInfo(e){let t=0;Se(this.detailGridInfoMap,(i,s)=>{R(s)&&(e(s,t),t++)})}getDataAsCsv(e){if(Y.__assertRegistered("@ag-grid-community/csv-export","api.getDataAsCsv",this.context.getGridId()))return this.csvCreator.getDataAsCsv(e)}exportDataAsCsv(e){Y.__assertRegistered("@ag-grid-community/csv-export","api.exportDataAsCSv",this.context.getGridId())&&this.csvCreator.exportDataAsCsv(e)}assertNotExcelMultiSheet(e,t){return!(!Y.__assertRegistered("@ag-grid-enterprise/excel-export","api."+e,this.context.getGridId())||1===this.excelCreator.getFactoryMode()&&(console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel
1()'"),1))}getDataAsExcel(e){if(this.assertNotExcelMultiSheet("getDataAsExcel",e))return this.excelCreator.getDataAsExcel(e)}exportDataAsExcel(e){this.assertNotExcelMultiSheet("exportDataAsExcel",e)&&this.excelCreator.exportDataAsExcel(e)}getSheetDataForExcel(e){if(Y.__assertRegistered("@ag-grid-enterprise/excel-export","api.getSheetDataForExcel",this.context.getGridId()))return this.excelCreator.setFactoryMode(1),this.excelCreator.getSheetDataForExcel(e)}getMultipleSheetsAsExcel(e){if(Y.__assertRegistered("@ag-grid-enterprise/excel-export","api.getMultipleSheetsAsExcel",this.context.getGridId()))return this.excelCreator.getMultipleSheetsAsExcel(e)}exportMultipleSheetsAsExcel(e){Y.__assertRegistered("@ag-grid-enterprise/excel-export","api.exportMultipleSheetsAsExcel",this.context.getGridId())&&this.excelCreator.exportMultipleSheetsAsExcel(e)}setGridAriaProperty(e,t){if(!e)return;const i=this.ctrlsService.getGridBodyCtrl().getGui(),s=`aria-${e}`;null===t?i.removeAttribute(s):i.setAttribute(s,t)}logMissingRowModel(e,...t){console.error(`AG Grid: api.${e} can only be called when gridOptions.rowModelType is ${t.join(" or ")}`)}logDeprecation(e,t,i,s){x(`Since ${e} api.${t} is deprecated. Please use ${i} instead. ${s}`)}getPinnedTopRowCount(){return this.pinnedRowModel.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.pinnedRowModel.getPinnedBottomRowCount()}getPinnedTopRow(e){return this.pinnedRowModel.getPinnedTopRow(e)}getPinnedBottomRow(e){return this.pinnedRowModel.getPinnedBottomRow(e)}expireValueCache(){this.valueCache.expire()}getVerticalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getVScrollPosition()}getHorizontalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getHScrollPosition()}refreshCells(e={}){this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.refreshCells(e))}flashCells(e={}){const t=i=>x(`Since v31.1 api.flashCells parameter '${i}Delay' is deprecated. Please use '${i}Duration' instead.`);R(e.fadeDelay)&&t("fade"),R(e.flashDelay)&&t("flash"),this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.flashCells(e))}redrawRows(e={}){const t=e?e.rowNodes:void 0;this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.redrawRows(t))}refreshHeader(){this.frameworkOverrides.wrapIncoming(()=>this.ctrlsService.getHeaderRowContainerCtrls().forEach(e=>e.refresh()))}isAnyFilterPresent(){return this.filterManager.isAnyFilterPresent()}isColumnFilterPresent(){return this.filterManager.isColumnFilterPresent()||this.filterManager.isAggregateFilterPresent()}isQuickFilterPresent(){return this.filterManager.isQuickFilterPresent()}getModel(){return x("Since v31.1 getModel() is deprecated. Please use the appropriate grid API methods instead."),this.rowModel}setRowNodeExpanded(e,t,i){this.expansionService.setRowNodeExpanded(e,t,i)}onGroupExpandedOrCollapsed(){G(this.clientSideRowModel)?this.logMissingRowModel("onGroupExpandedOrCollapsed","clientSide"):this.expansionService.onGroupExpandedOrCollapsed()}refreshClientSideRowModel(e){G(this.clientSideRowModel)?this.logMissingRowModel("refreshClientSideRowModel","clientSide"):this.clientSideRowModel.refreshModel(e)}isAnimationFrameQueueEmpty(){return this.animationFrameService.isQueueEmpty()}flushAllAnimationFrames(){this.animationFrameService.flushAllFrames()}getRowNode(e){return this.rowModel.getRowNode(e)}getSizesForCurrentTheme(){return{rowHeight:this.gos.getRowHeightAsNumber(),headerHeight:this.columnModel.getHeaderHeight()}}expandAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!0):this.logMissingRowModel("expandAll","clientSide","serverSide")}collapseAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!1):this.logMissingRowModel("collapseAll","clientSide","serverSide")}addRenderedRowListener(e,t,i){this.rowRenderer.addRenderedRowListener(e,t,i)}getQuickFilter(){return this.gos.get("quickFilterText")}getAdvancedFilterModel(){return Y.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.getAdvancedFilterModel",this.context.getGridId())?this.filterManager.getAdvancedFilterModel():null}setAdvancedFilterModel(e){this.filterManager.setAdvancedFilterModel(e)}showAdvancedFilterBuilder(){Y.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.setAdvancedFilterModel",this.context.getGridId())&&this.filterManager.showAdvancedFilterBuilder("api")}setNodesSelected(e){if(!e.nodes.every(n=>n.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),!1):void 0!==n.id||(console.warn("AG Grid: cannot select node until id for node is known"),!1)))return;const{nodes:i,source:s,newValue:o}=e;this.selectionService.setNodesSelected({nodes:i,source:s??"api",newValue:o})}selectAll(e="apiSelectAll"){this.selectionService.selectAllRowNodes({source:e})}deselectAll(e="apiSelectAll"){this.selectionService.deselectAllRowNodes({source:e})}selectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.selectAllRowNodes({source:e,justFiltered:!0})}deselectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.deselectAllRowNodes({source:e,justFiltered:!0})}getServerSideSelectionState(){return G(this.serverSideRowModel)?(this.logMissingRowModel("getServerSideSelectionState","serverSide"),null):this.selectionService.getSelectionState()}setServerSideSelectionState(e){G(this.serverSideRowModel)?this.logMissingRowModel("setServerSideSelectionState","serverSide"):this.selectionService.setSelectionState(e,"api")}selectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.selectAllRowNodes({source:e,justCurrentPage:!0})}deselectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.deselectAllRowNodes({source:e,justCurrentPage:!0})}showLoadingOverlay(){this.overlayService.showLoadingOverlay()}showNoRowsOverlay(){this.overlayService.showNoRowsOverlay()}hideOverlay(){this.overlayService.hideOverlay()}getSelectedNodes(){return this.selectionService.getSelectedNodes()}getSelectedRows(){return this.selectionService.getSelectedRows()}getBestCostNodeSelection(){if(!G(this.clientSideRowModel))return this.selectionService.getBe
1stCostNodeSelection();this.logMissingRowModel("getBestCostNodeSelection","clientSide")}getRenderedNodes(){return this.rowRenderer.getRenderedNodes()}ensureColumnVisible(e,t="auto"){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureColumnVisible(e,t),"ensureVisible")}ensureIndexVisible(e,t){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(e,t),"ensureVisible")}ensureNodeVisible(e,t=null){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureNodeVisible(e,t),"ensureVisible")}forEachLeafNode(e){G(this.clientSideRowModel)?this.logMissingRowModel("forEachLeafNode","clientSide"):this.clientSideRowModel.forEachLeafNode(e)}forEachNode(e,t){this.rowModel.forEachNode(e,t)}forEachNodeAfterFilter(e){G(this.clientSideRowModel)?this.logMissingRowModel("forEachNodeAfterFilter","clientSide"):this.clientSideRowModel.forEachNodeAfterFilter(e)}forEachNodeAfterFilterAndSort(e){G(this.clientSideRowModel)?this.logMissingRowModel("forEachNodeAfterFilterAndSort","clientSide"):this.clientSideRowModel.forEachNodeAfterFilterAndSort(e)}getFilterInstance(e,t){return x("'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."),this.filterManager.getFilterInstance(e,t)}getColumnFilterInstance(e){return this.filterManager.getColumnFilterInstance(e)}destroyFilter(e){const t=this.columnModel.getPrimaryColumn(e);if(t)return this.filterManager.destroyFilter(t,"api")}getStatusPanel(e){if(Y.__assertRegistered("@ag-grid-enterprise/status-bar","api.getStatusPanel",this.context.getGridId()))return ni(this.statusBarService.getStatusPanel(e))}getColumnDef(e){const t=this.columnModel.getPrimaryColumn(e);return t?t.getColDef():null}getColumnDefs(){return this.columnModel.getColumnDefs()}onFilterChanged(e="api"){this.filterManager.onFilterChanged({source:e})}onSortChanged(){this.sortController.onSortChanged("api")}setFilterModel(e){this.frameworkOverrides.wrapIncoming(()=>this.filterManager.setFilterModel(e))}getFilterModel(){return this.filterManager.getFilterModel()}getColumnFilterModel(e){return this.filterManager.getColumnFilterModel(e)}setColumnFilterModel(e,t){return this.filterManager.setColumnFilterModel(e,t)}getFocusedCell(){return this.focusService.getFocusedCell()}clearFocusedCell(){return this.focusService.clearFocusedCell()}setFocusedCell(e,t,i){this.focusService.setFocusedCell({rowIndex:e,column:t,rowPinned:i,forceBrowserFocus:!0})}addRowDropZone(e){this.gridBodyCtrl.getRowDragFeature().addRowDropZone(e)}removeRowDropZone(e){const t=this.dragAndDropService.findExternalZone(e);t&&this.dragAndDropService.removeDropTarget(t)}getRowDropZoneParams(e){return this.gridBodyCtrl.getRowDragFeature().getRowDropZone(e)}assertSideBarLoaded(e){return Y.__assertRegistered("@ag-grid-enterprise/side-bar","api."+e,this.context.getGridId())}isSideBarVisible(){return this.assertSideBarLoaded("isSideBarVisible")&&this.sideBarService.getSideBarComp().isDisplayed()}setSideBarVisible(e){this.assertSideBarLoaded("setSideBarVisible")&&this.sideBarService.getSideBarComp().setDisplayed(e)}setSideBarPosition(e){this.assertSideBarLoaded("setSideBarPosition")&&this.sideBarService.getSideBarComp().setSideBarPosition(e)}openToolPanel(e){this.assertSideBarLoaded("openToolPanel")&&this.sideBarService.getSideBarComp().openToolPanel(e,"api")}closeToolPanel(){this.assertSideBarLoaded("closeToolPanel")&&this.sideBarService.getSideBarComp().close("api")}getOpenedToolPanel(){return this.assertSideBarLoaded("getOpenedToolPanel")?this.sideBarService.getSideBarComp().openedItem():null}refreshToolPanel(){this.assertSideBarLoaded("refreshToolPanel")&&this.sideBarService.getSideBarComp().refresh()}isToolPanelShowing(){return this.assertSideBarLoaded("isToolPanelShowing")&&this.sideBarService.getSideBarComp().isToolPanelShowing()}getToolPanelInstance(e){if(this.assertSideBarLoaded("getToolPanelInstance"))return ni(this.sideBarService.getSideBarComp().getToolPanelInstance(e))}getSideBar(){if(this.assertSideBarLoaded("getSideBar"))return this.sideBarService.getSideBarComp().getDef()}resetRowHeights(){if(R(this.clientSideRowModel)){if(this.columnModel.isAutoRowHeightActive())return void console.warn("AG Grid: calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");this.clientSideRowModel.resetRowHeights()}}setRowCount(e,t){if(this.serverSideRowModel)return this.columnModel.isRowGroupEmpty()?void this.serverSideRowModel.setRowCount(e,t):void console.error("AG Grid: setRowCount cannot be used while using row grouping.");this.infiniteRowModel?this.infiniteRowModel.setRowCount(e,t):this.logMissingRowModel("setRowCount","
1infinite","serverSide")}onRowHeightChanged(){this.clientSideRowModel?this.clientSideRowModel.onRowHeightChanged():this.serverSideRowModel&&this.serverSideRowModel.onRowHeightChanged()}getValue(e,t){let i=this.columnModel.getPrimaryColumn(e);return G(i)&&(i=this.columnModel.getGridColumn(e)),G(i)?null:this.valueService.getValue(i,t)}addEventListener(e,t){this.apiEventService.addEventListener(e,t)}addGlobalListener(e){this.apiEventService.addGlobalListener(e)}removeEventListener(e,t){this.apiEventService.removeEventListener(e,t)}removeGlobalListener(e){this.apiEventService.removeGlobalListener(e)}dispatchEvent(e){this.eventService.dispatchEvent(e)}destroy(){const e=`See ${this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}`;if(this.destroyCalled)return;const t={type:p.EVENT_GRID_PRE_DESTROYED,state:this.getState()};this.dispatchEvent(t),this.destroyCalled=!0;const i=this.ctrlsService.getGridCtrl();i&&i.destroyGridUi(),this.context.destroy(),xl(this,["isDestroyed"],e)}isDestroyed(){return this.destroyCalled}resetQuickFilter(){this.filterManager.resetQuickFilterCache()}getCellRanges(){return this.rangeService?this.rangeService.getCellRanges():(Y.__assertRegistered("@ag-grid-enterprise/range-selection","api.getCellRanges",this.context.getGridId()),null)}addCellRange(e){this.rangeService?this.rangeService.addCellRange(e):Y.__assertRegistered("@ag-grid-enterprise/range-selection","api.addCellRange",this.context.getGridId())}clearRangeSelection(){this.rangeService&&this.rangeService.removeAllCellRanges(),Y.__assertRegistered("@ag-grid-enterprise/range-selection","gridApi.clearRangeSelection",this.context.getGridId())}undoCellEditing(){this.undoRedoService.undo("api")}redoCellEditing(){this.undoRedoService.redo("api")}getCurrentUndoSize(){return this.undoRedoService.getCurrentUndoStackSize()}getCurrentRedoSize(){return this.undoRedoService.getCurrentRedoStackSize()}assertChart(e,t){if(Y.__assertRegistered("@ag-grid-enterprise/charts","api."+e,this.context.getGridId()))return this.frameworkOverrides.wrapIncoming(()=>t())}getChartModels(){return this.assertChart("getChartModels",()=>this.chartService.getChartModels())}getChartRef(e){return this.assertChart("getChartRef",()=>this.chartService.getChartRef(e))}getChartImageDataURL(e){return this.assertChart("getChartImageDataURL",()=>this.chartService.getChartImageDataURL(e))}downloadChart(e){return this.assertChart("downloadChart",()=>this.chartService.downloadChart(e))}openChartToolPanel(e){return this.assertChart("openChartToolPanel",()=>this.chartService.openChartToolPanel(e))}closeChartToolPanel(e){return this.assertChart("closeChartToolPanel",()=>this.chartService.closeChartToolPanel(e.chartId))}createRangeChart(e){return this.assertChart("createRangeChart",()=>this.chartService.createRangeChart(e))}createPivotChart(e){return this.assertChart("createPivotChart",()=>this.chartService.createPivotChart(e))}createCrossFilterChart(e){return this.assertChart("createCrossFilterChart",()=>this.chartService.createCrossFilterChart(e))}updateChart(e){return this.assertChart("updateChart",()=>this.chartService.updateChart(e))}restoreChart(e,t){return this.assertChart("restoreChart",()=>this.chartService.restoreChart(e,t))}assertClipboard(e,t){Y.__assertRegistered("@ag-grid-enterprise/clipboard","api"+e,this.context.getGridId())&&t()}copyToClipboard(e){this.assertClipboard("copyToClipboard",()=>this.clipboardService.copyToClipboard(e))}cutToClipboard(e){this.assertClipboard("cutToClipboard",()=>this.clipboardService.cutToClipboard(e))}copySelectedRowsToClipboard(e){this.assertClipboard("copySelectedRowsToClipboard",()=>this.clipboardService.copySelectedRowsToClipboard(e))}copySelectedRangeToClipboard(e){this.assertClipboard("copySelectedRangeToClipboard",()=>this.clipboardService.copySelectedRangeToClipboard(e))}copySelectedRangeDown(){this.assertClipboard("copySelectedRangeDown",()=>this.clipboardService.copyRangeDown())}pasteFromClipboard(){this.assertClipboard("pasteFromClipboard",()=>this.clipboardService.pasteFromClipboard())}showColumnMenuAfterButtonClick(e,t){x("'showColumnMenuAfterButtonClick' is deprecated. Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere.");const i=this.columnModel.getGridColumn(e);this.menuService.showColumnMenu({column:i,buttonElement:t,positionBy:"button"})}showColumnMenuAfterMouseClick(e,t){x("'showColumnMenuAfterMouseClick' is deprecated. Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere.");let i=this.columnModel.getGridColumn(e);i||(i=this.columnModel.getPrimaryColumn(e)),i?this.menuService.showColumnMenu({column:i,mouseEvent:t,positionBy:"mouse"}):console.error(`AG Grid: column '${e}' not found`)}showColumnChooser(e){this.menuService.showColumnChooser({chooserParams:e})}showColumnFilter(e){const t=this.columnModel.getGridColumn(e);t?this.menuService.showFilterMenu({column:t,containerType:"columnFilter",positionBy:"auto"}):console.error(`AG Grid: column '${e}' not found`)}showColumnMenu(e){const t=this.columnModel.getGridColumn(e);t?this.menuService.showColumnMenu({column:t,positionBy:"auto"}):console.error(`AG Grid: column '${e}' not found`)}hidePopupMenu(){this.menuService.hidePopupMenu()}hideColumnChooser(){this.menuService.hideColumnChooser()}tabToNextCell(e){return this.navigationService.tabToNextCell(!1,e)}tabToPreviousCell(e){return this.navigationService.tabToNextCell(!0,e)}getCellRendererInstances(e={}){return this.rowRenderer.getCellRendererInstances(e).map(ni)}getCellEditorInstances(e={}){return this.rowRenderer.getCellEditorInstances(e).map(ni)}getEditingCells(){return this.rowRenderer.getEditingCells()}stopEditing(e=!1){this.rowRenderer.stopEditing(e)}startEditingCell(e){const t=this.columnModel.getGridColumn(e.colKey);if(!t)return void console.warn(`AG Grid: no column found for ${e.colKey}`);const i={rowIndex:e.rowIndex,rowPinned:e.rowPinned||null,column:t};null==e.rowPinned&&this.ensureIndexVisible(e.rowIndex),this.ensureColumnVisible(e.colKey);const o=this.navigationService.getCellByPosition(i);o&&(this.focusService.isCellFocused(i)||this.focusService.setFocusedCell(i),o.startRowOrCellEdit(e.key))}addAggFunc(e,t){this.logDeprecation("v31.1","addAggFunc(key, func)","addAggFuncs({ key: func })"),this.aggFuncService&&this.aggFuncService.addAggFuncs({key:t})}addAggFuncs(e){this.aggFuncService&&this.aggFuncService.addAggFuncs(e)}clearAggFuncs(){this.aggFuncService&&this.aggFuncService.clear()}applyServerSideTransaction(e){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransaction(e);this.logMissingRowModel("applyServerSideTransaction","serverSide")}applyServerSideTransactionAsync(e,t){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransactionAsync(e,t);this.logMissingRowModel("applyServerSideTransactionAsync","serverSide")}applyServerSideRowData(e){var t,i;const s=null!=(t=e.startRow)?t:0,o=null!=(i=e.route)?i:[];
1s<0?console.warn(`AG Grid: invalid value ${e.startRow} for startRow, the value should be >= 0`):this.serverSideRowModel?this.serverSideRowModel.applyRowData(e.successParams,s,o):this.logMissingRowModel("setServerSideDatasource","serverSide")}retryServerSideLoads(){this.serverSideRowModel?this.serverSideRowModel.retryLoads():this.logMissingRowModel("retryServerSideLoads","serverSide")}flushServerSideAsyncTransactions(){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.flushAsyncTransactions();this.logMissingRowModel("flushServerSideAsyncTransactions","serverSide")}applyTransaction(e){if(this.clientSideRowModel)return this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.updateRowData(e));this.logMissingRowModel("applyTransaction","clientSide")}applyTransactionAsync(e,t){this.clientSideRowModel?this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.batchUpdateRowData(e,t)):this.logMissingRowModel("applyTransactionAsync","clientSide")}flushAsyncTransactions(){this.clientSideRowModel?this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.flushAsyncTransactions()):this.logMissingRowModel("flushAsyncTransactions","clientSide")}refreshInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.refreshCache():this.logMissingRowModel("refreshInfiniteCache","infinite")}purgeInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.purgeCache():this.logMissingRowModel("purgeInfiniteCache","infinite")}refreshServerSide(e){this.serverSideRowModel?this.serverSideRowModel.refreshStore(e):this.logMissingRowModel("refreshServerSide","serverSide")}getServerSideGroupLevelState(){return this.serverSideRowModel?this.serverSideRowModel.getStoreState():(this.logMissingRowModel("getServerSideGroupLevelState","serverSide"),[])}getInfiniteRowCount(){if(this.infiniteRowModel)return this.infiniteRowModel.getRowCount();this.logMissingRowModel("getInfiniteRowCount","infinite")}isLastRowIndexKnown(){if(this.infiniteRowModel)return this.infiniteRowModel.isLastRowIndexKnown();this.logMissingRowModel("isLastRowIndexKnown","infinite")}getCacheBlockState(){return this.rowNodeBlockLoader.getBlockState()}getFirstDisplayedRow(){return this.logDeprecation("v31.1","getFirstDisplayedRow","getFirstDisplayedRowIndex"),this.getFirstDisplayedRowIndex()}getFirstDisplayedRowIndex(){return this.rowRenderer.getFirstVirtualRenderedRow()}getLastDisplayedRow(){return this.logDeprecation("v31.1","getLastDisplayedRow","getLastDisplayedRowIndex"),this.getLastDisplayedRowIndex()}getLastDisplayedRowIndex(){return this.rowRenderer.getLastVirtualRenderedRow()}getDisplayedRowAtIndex(e){return this.rowModel.getRow(e)}getDisplayedRowCount(){return this.rowModel.getRowCount()}paginationIsLastPageFound(){return this.paginationProxy.isLastPageFound()}paginationGetPageSize(){return this.paginationProxy.getPageSize()}paginationGetCurrentPage(){return this.paginationProxy.getCurrentPage()}paginationGetTotalPages(){return this.paginationProxy.getTotalPages()}paginationGetRowCount(){return this.paginationProxy.getMasterRowCount()}paginationGoToNextPage(){this.paginationProxy.goToNextPage()}paginationGoToPreviousPage(){this.paginationProxy.goToPreviousPage()}paginationGoToFirstPage(){this.paginationProxy.goToFirstPage()}paginationGoToLastPage(){this.paginationProxy.goToLastPage()}paginationGoToPage(e){this.paginationProxy.goToPage(e)}sizeColumnsToFit(e){"number"==typeof e?this.columnModel.sizeColumnsToFit(e,"api"):this.gridBodyCtrl.sizeColumnsToFit(e)}setColumnGroupOpened(e,t){this.columnModel.setColumnGroupOpened(e,t,"api")}getColumnGroup(e,t){return this.columnModel.getColumnGroup(e,t)}getProvidedColumnGroup(e){return this.columnModel.getProvidedColumnGroup(e)}getDisplayNameForColumn(e,t){return this.columnModel.getDisplayNameForColumn(e,t)||""}getDisplayNameForColumnGroup(e,t){return this.columnModel.getDisplayNameForColumnGroup(e,t)||""}getColumn(e){return this.columnModel.getPrimaryColumn(e)}getColumns(){return this.columnModel.getAllPrimaryColumns()}applyColumnState(e){return this.columnModel.applyColumnState(e,"api")}getColumnState(){return this.columnModel.getColumnState()}resetColumnState(){this.columnModel.resetColumnState("api")}getColumnGroupState(){return this.columnModel.getColumnGroupState()}setColumnGroupState(e){this.columnModel.setColumnGroupState(e,"api")}resetColumnGroupState(){this.columnModel.resetColumnGroupState("api")}isPinning(){return this.columnModel.isPinningLeft()||this.columnModel.isPinningRight()}isPinningLeft(){return this.columnModel.isPinningLeft()}isPinningRight(){return this.columnModel.isPinningRight()}getDisplayedColAfter(e){return this.columnModel.getDisplayedColAfter(e)}getDisplayedColBefore(e){return this.columnModel.getDisplayedColBefore(e)}setColumnVisible(e,t){this.logDeprecation("v31.1","setColumnVisible(key,visible)","setColumnsVisible([key],visible)"),this.columnModel.setColumnsVisible([e],t,"api")}setColumnsVisible(e,t){this.columnModel.setColumnsVisible(e,t,"api")}setColumnPinned(e,t){this.logDeprecation("v31.1","setColumnPinned(key,pinned)","setColumnsPinned([key],pinned)"),this.columnModel.setColumnsPinned([e],t,"api")}setColumnsPinned(e,t){this.columnModel.setColumnsPinned(e,t,"api")}getAllGridColumns(){return this.columnModel.getAllGridColumns()}getDisplayedLeftColumns(){return this.columnModel.getDisplayedLeftColumns()}getDisplayedCenterColumns(){return this.columnModel.getDisplayedCenterColumns()}getDisplayedRightColumns(){return this.columnModel.getDisplayedRightColumns()}getAllDisplayedColumns(){return this.columnModel.getAllDisplayedColumns()}getAllDisplayedVirtualColumns(){return this.columnModel.getViewportColumns()}moveColumn(e,t){this.logDeprecation("v31.1","moveColumn(key, toIndex)","moveColumns([key], toIndex)"),this.columnModel.moveColumns([e],t,"api")}moveColumnByIndex(e,t){this.columnModel.moveColumnByIndex(e,t,"api")}moveColumns(e,t){this.columnModel.moveColumns(e,t,"api")}moveRowGroupColumn(e,t){this.columnModel.moveRowGroupColumn(e,t,"api")}
1setColumnAggFunc(e,t){this.columnModel.setColumnAggFunc(e,t,"api")}setColumnWidth(e,t,i=!0,s="api"){this.logDeprecation("v31.1","setColumnWidth(col, width)","setColumnWidths([{key: col, newWidth: width}])"),this.columnModel.setColumnWidths([{key:e,newWidth:t}],!1,i,s)}setColumnWidths(e,t=!0,i="api"){this.columnModel.setColumnWidths(e,!1,t,i)}isPivotMode(){return this.columnModel.isPivotMode()}getPivotResultColumn(e,t){return this.columnModel.getSecondaryPivotColumn(e,t)}setValueColumns(e){this.columnModel.setValueColumns(e,"api")}getValueColumns(){return this.columnModel.getValueColumns()}removeValueColumn(e){this.logDeprecation("v31.1","removeValueColumn(colKey)","removeValueColumns([colKey])"),this.columnModel.removeValueColumns([e],"api")}removeValueColumns(e){this.columnModel.removeValueColumns(e,"api")}addValueColumn(e){this.logDeprecation("v31.1","addValueColumn(colKey)","addValueColumns([colKey])"),this.columnModel.addValueColumns([e],"api")}addValueColumns(e){this.columnModel.addValueColumns(e,"api")}setRowGroupColumns(e){this.columnModel.setRowGroupColumns(e,"api")}removeRowGroupColumn(e){this.logDeprecation("v31.1","removeRowGroupColumn(colKey)","removeRowGroupColumns([colKey])"),this.columnModel.removeRowGroupColumns([e],"api")}removeRowGroupColumns(e){this.columnModel.removeRowGroupColumns(e,"api")}addRowGroupColumn(e){this.logDeprecation("v31.1","addRowGroupColumn(colKey)","addRowGroupColumns([colKey])"),this.columnModel.addRowGroupColumns([e],"api")}addRowGroupColumns(e){this.columnModel.addRowGroupColumns(e,"api")}getRowGroupColumns(){return this.columnModel.getRowGroupColumns()}setPivotColumns(e){this.columnModel.setPivotColumns(e,"api")}removePivotColumn(e){this.logDeprecation("v31.1","removePivotColumn(colKey)","removePivotColumns([colKey])"),this.columnModel.removePivotColumns([e],"api")}removePivotColumns(e){this.columnModel.removePivotColumns(e,"api")}addPivotColumn(e){this.logDeprecation("v31.1","addPivotColumn(colKey)","addPivotColumns([colKey])"),this.columnModel.addPivotColumns([e],"api")}addPivotColumns(e){this.columnModel.addPivotColumns(e,"api")}getPivotColumns(){return this.columnModel.getPivotColumns()}getLeftDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeLeft()}getCenterDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeCentre()}getRightDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeRight()}getAllDisplayedColumnGroups(){return this.columnModel.getAllDisplayedTrees()}autoSizeColumn(e,t){return this.logDeprecation("v31.1","autoSizeColumn(key, skipHeader)","autoSizeColumns([key], skipHeader)"),this.columnModel.autoSizeColumns({columns:[e],skipHeader:t,source:"api"})}autoSizeColumns(e,t){this.columnModel.autoSizeColumns({columns:e,skipHeader:t,source:"api"})}autoSizeAllColumns(e){this.columnModel.autoSizeAllColumns("api",e)}setPivotResultColumns(e){this.columnModel.setSecondaryColumns(e,"api")}getPivotResultColumns(){return this.columnModel.getSecondaryColumns()}getState(){return this.stateService.getState()}getGridOption(e){return this.gos.get(e)}setGridOption(e,t){this.updateGridOptions({[e]:t})}updateGridOptions(e){this.gos.updateGridOptions({options:e})}__internalUpdateGridOptions(e){this.gos.updateGridOptions({options:e,source:"gridOptionsUpdated"})}deprecatedUpdateGridOption(e,t){x(`set${e.charAt(0).toUpperCase()}${e.slice(1,e.length)} is deprecated. Please use 'api.setGridOption('${e}', newValue)' or 'api.updateGridOptions({ ${e}: newValue })' instead.`),this.setGridOption(e,t)}setPivotMode(e){this.deprecatedUpdateGridOption("pivotMode",e)}setPinnedTopRowData(e){this.deprecatedUpdateGridOption("pinnedTopRowData",e)}setPinnedBottomRowData(e){this.deprecatedUpdateGridOption("pinnedBottomRowData",e)}setPopupParent(e){this.deprecatedUpdateGridOption("popupParent",e)}setSuppressModelUpdateAfterUpdateTransaction(e){this.deprecatedUpdateGridOption("suppressModelUpdateAfterUpdateTransaction",e)}setDataTypeDefinitions(e){this.deprecatedUpdateGridOption("dataTypeDefinitions",e)}setPagination(e){this.deprecatedUpdateGridOption("pagination",e)}paginationSetPageSize(e){this.deprecatedUpdateGridOption("paginationPageSize",e)}setSideBar(e){this.deprecatedUpdateGridOption("sideBar",e)}setSuppressClipboardPaste(e){this.deprecatedUpdateGridOption("suppressClipboardPaste",e)}setGroupRemoveSingleChildren(e){this.deprecatedUpdateGridOption("groupRemoveSingleChildren",e)}setGroupRemoveLowestSingleChildren(e){this.deprecatedUpdateGridOption("groupRemoveLowestSingleChildren",e)}setGroupDisplayType(e){this.deprecatedUpdateGridOption("groupDisplayType",e)}setGroupIncludeFooter(e){this.deprecatedUpdateGridOption("groupIncludeFooter",e)}setGroupIncludeTotalFooter(e){this.deprecatedUpdateGridOption("groupIncludeTotalFooter",e)}setRowClass(e){this.deprecatedUpdateGridOption("rowClass",e)}setDeltaSort(e){this.deprecatedUpdateGridOption("deltaSort",e)}setSuppressRowDrag(e){this.deprecatedUpdateGridOption("suppressRowDrag",e)}setSuppressMoveWhenRowDragging(e){this.deprecatedUpdateGridOption("suppressMoveWhenRowDragging",e)}setSuppressRowClickSelection(e){this.deprecatedUpdateGridOption("suppressRowClickSelection",e)}setEnableAdvancedFilter(e){this.deprecatedUpdateGridOption("enableAdvancedFilter",e)}setIncludeHiddenColumnsInAdvancedFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInAdvancedFilter",e)}setAdvancedFilterParent(e){this.deprecatedUpdateGridOption("advancedFilterParent",e)}setAdvancedFilterBuilderParams(e){this.deprecatedUpdateGridOption("advancedFilterBuilderParams",e)}setQuickFilter(e){x("setQuickFilter is deprecated. Please use 'api.setGridOption('quickFilterText', newValue)' or 'api.updateGridOptions({ quickFilterText: newValue })' instead."),this.gos.updateGridOptions({options:{quickFilterText:e}})}setExcludeHiddenColumnsFromQuickFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",!e)}setIncludeHiddenColumnsInQuickFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",e)}setQuickFilterParser(e){this.deprecatedUpdateGridOption("quickFilterParser",e)}setQuickFilterMatcher(e){this.deprecatedUpdateGridOption("quickFilterMatcher",e)}setAlwaysShowHorizontalScroll(e){this.deprecatedUpdateGridOption("alwaysShowHorizontalScroll",e)}setAlwaysShowVerticalScroll(e){this.deprecatedUpdateGridOption("alwaysShowVerticalScroll",e)}setFunctionsReadOnly(e){this.deprecatedUpdateGridOption("functionsReadOnly",e)}setColumnDefs(e,t="api"){x("setColumnDefs is deprecated. Please use 'api.setGridOption('columnDefs', newValue)' or 'api.updateGridOptions({ columnDefs: newValue })' instead."),this.gos.updateGridOptions({options:{columnDefs:e},source:t})}setAutoGroupColumnDef(e,t="api"){x("setAutoGroupColumnDef is deprecated. Please use 'api.setGridOption('autoGroupColumnDef', newValue)' or 'api.updateGridOptions({ autoGroupColumnDef: newValue })' instead."),this.gos.updateGridOptions({options:{autoGroupColumnDef:e},source:t})}setDefaultColDef(e,t="api"){x("setDefaultColDef is deprecated. Please use 'api.setGridOption('defaultColDef', newValue)' or 'api.updateGridOptions({ defaultColDef: newValue })' instead."),this.gos.updateGridOptions({options:{defaultColDef:e},source:t})}setColumnTypes(e,t="api"){x("setColumnTypes is deprecated. Please use 'api.setGridOption('columnTypes', newValue)' or 'api.updateGridOptions({ columnTypes: newValue })' instead."),this.gos.updateGridOptions({options:{columnTypes:e},source:t})}setTreeData(e){this.deprecatedUpdateGridOption("treeData",e)}setServerSideDatasource(e){this.deprecatedUpdateGridOption("serverSideDatasource",e)}setCacheBlockSize(e){this.deprecatedUpdateGridOption("cacheBlockSize",e)}setDatasource(e){this.deprecatedUpdateGridOption("datasource",e)}setViewportDatasource(e){this.deprecatedUpdateGridOption("viewportDatasource",e)}setRowData(e){this.deprecatedUpdateGridOption("rowData",e)}setEnableCellTextSelection(e){this.deprecatedUpdateGridOption("enableCellTextSelection",e)}setHeaderHeight(e){this.deprecatedUpdateGridOption("headerHeight",e)}setDomLayout(e){this.deprecatedUpdateGridOption("domLayout",e)}setFillHandleDirection(e){this.deprecatedUpdateGridOption("fillHandleDirection",e)}setGroupHeaderHeight(e){this.deprecatedUpdateGridOption("groupHeaderHeight",e)}setFloatingFiltersHeight(e){this.deprecatedUpdateGridOption("floatingFiltersHeight",e)}setPivotHeaderHeight(e){this.deprecatedUpdateGridOption("pivotHeaderHeight",e)}setPivotGroupHeaderHeight(e){this.deprecatedUpdateGridOption("pivotGroupHeaderHeight",e)}setAnimateRows(e){this.deprecatedUpdateGridOption("animateRows",e)}setIsExternalFilterPresent(e){this.deprecatedUpdateGridOption("isExternalFilterPresent",e)}setDoesExternalFilterPass(e){this.deprecatedUpdateGridOption("doesExternalFilterPass",e)}setNavigateToNextCell(e){this.deprecatedUpdateGridOption("navigateToNextCell",e)}setTabToNextCell(e){this.deprecatedUpdateGridOption("tabToNextCell",e)}setTabToNextHeader(e){this.deprecatedUpdateGridOption("tabToNextHeader",e)}setNavigateToNextHeader(e){this.deprecatedUpdateGridOption("navigateToNextHeader",e)}setRowGroupPanelShow(e){this.deprecatedUpdateGridOption("rowGroupPanelShow",e)}setGetGroupRowAgg(e){this.deprecatedUpdateGridOption("getGroupRowAgg",e)}setGetBusinessKeyForNode(e){this.deprecatedUpdateGridOption("getBusinessKeyForNode",e)}setGetChildCount(e){this.deprecatedUpdateGridOption("getChildCount",e)}setProcessRowPostCreate(e){this.deprecatedUpdateGridOption("processRowPostCreate",e)}setGetRowId(e){x("getRowId is a static property and can no longer be updated.")}setGetRowClass(e){this.deprecatedUpdateGridOption("getRowClass",e)}setIsFullWidthRow(e){this.deprecatedUpdateGridOption("isFullWidthRow",e)}setIsRowSelectable(e){this.deprecatedUpdateGridOption("isRowSelectable",e)}setIsRowMaster(e){this.deprecatedUpdateGridOption("isRowMaster",e)}setPostSortRows(e){this.deprecatedUpdateGridOption("postSortRows",e)}setGetDocument(e){this.deprecatedUpdateGridOption("getDocument",e)}setGetContextMenuItems(e){this.deprecatedUpdateGridOption("getContextMenuItems",e)}setGetMainMenuItems(e){this.deprecatedUpdateGridOption("getMainMenuItems",e)}setProcessCellForClipboard(e){this.deprecatedUpdateGridOption("processCellForClipboard",e)}setSendToClipboard(e){this.deprecatedUpdateGridOption("sendToClipboard",e)}setProcessCellFromClipboard(e){this.deprecatedUpdateGridOption("processCellFromClipboard",e)}setProcessPivotResultColDef(e){this.deprecatedUpdateGridOption("processPivotResultColDef",e)}setProcessPivotResultColGroupDef(e){this.deprecatedUpdateGridOption("processPivotResultColGroupDef",e)}setPostProcessPopup(e){this.deprecatedUpdateGridOption("postProcessPopup",e)}setInitialGroupOrderComparator(e){this.deprecatedUpdateGridOption("initialGroupOrderComparator",e)}
1setGetChartToolbarItems(e){this.deprecatedUpdateGridOption("getChartToolbarItems",e)}setPaginationNumberFormatter(e){this.deprecatedUpdateGridOption("paginationNumberFormatter",e)}setGetServerSideGroupLevelParams(e){this.deprecatedUpdateGridOption("getServerSideGroupLevelParams",e)}setIsServerSideGroupOpenByDefault(e){this.deprecatedUpdateGridOption("isServerSideGroupOpenByDefault",e)}setIsApplyServerSideTransaction(e){this.deprecatedUpdateGridOption("isApplyServerSideTransaction",e)}setIsServerSideGroup(e){this.deprecatedUpdateGridOption("isServerSideGroup",e)}setGetServerSideGroupKey(e){this.deprecatedUpdateGridOption("getServerSideGroupKey",e)}setGetRowStyle(e){this.deprecatedUpdateGridOption("getRowStyle",e)}setGetRowHeight(e){this.deprecatedUpdateGridOption("getRowHeight",e)}};u([z("csvCreator")],W.prototype,"csvCreator",2),u([z("excelCreator")],W.prototype,"excelCreator",2),u([f("rowRenderer")],W.prototype,"rowRenderer",2),u([f("navigationService")],W.prototype,"navigationService",2),u([f("filterManager")],W.prototype,"filterManager",2),u([f("columnModel")],W.prototype,"columnModel",2),u([f("selectionService")],W.prototype,"selectionService",2),u([f("gridOptionsService")],W.prototype,"gos",2),u([f("valueService")],W.prototype,"valueService",2),u([f("alignedGridsService")],W.prototype,"alignedGridsService",2),u([f("eventService")],W.prototype,"eventService",2),u([f("pinnedRowModel")],W.prototype,"pinnedRowModel",2),u([f("context")],W.prototype,"context",2),u([f("rowModel")],W.prototype,"rowModel",2),u([f("sortController")],W.prototype,"sortController",2),u([f("paginationProxy")],W.prototype,"paginationProxy",2),u([f("focusService")],W.prototype,"focusService",2),u([f("dragAndDropService")],W.prototype,"dragAndDropService",2),u([z("rangeService")],W.prototype,"rangeService",2),u([z("clipboardService")],W.prototype,"clipboardService",2),u([z("aggFuncService")],W.prototype,"aggFuncService",2),u([f("menuService")],W.prototype,"menuService",2),u([f("valueCache")],W.prototype,"valueCache",2),u([f("animationFrameService")],W.prototype,"animationFrameService",2),u([z("statusBarService")],W.prototype,"statusBarService",2),u([z("chartService")],W.prototype,"chartService",2),u([z("undoRedoService")],W.prototype,"undoRedoService",2),u([z("rowNodeBlockLoader")],W.prototype,"rowNodeBlockLoader",2),u([z("ssrmTransactionManager")],W.prototype,"serverSideTransactionManager",2),u([f("ctrlsService")],W.prototype,"ctrlsService",2),u([f("overlayService")],W.prototype,"overlayService",2),u([z("sideBarService")],W.prototype,"sideBarService",2),u([f("stateService")],W.prototype,"stateService",2),u([f("expansionService")],W.prototype,"expansionService",2),u([f("apiEventService")],W.prototype,"apiEventService",2),u([f("frameworkOverrides")],W.prototype,"frameworkOverrides",2),u([b],W.prototype,"init",1),W=u([O("gridApi")],W);var Ne=class extends T{constructor(){super(...arguments),this.quickFilter=null,this.quickFilterParts=null}postConstruct(){this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VISIBLE,()=>{this.gridOptionsService.get("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}),this.addManagedPropertyListener("quickFilterText",e=>this.setQuickFilter(e.currentValue)),this.addManagedPropertyListener("includeHiddenColumnsInQuickFilter",()=>this.onIncludeHiddenColumnsInQuickFilterChanged()),this.quickFilter=this.parseQuickFilter(this.gridOptionsService.get("quickFilterText")),this.parser=this.gridOptionsService.get("quickFilterParser"),this.matcher=this.gridOptionsService.get("quickFilterMatcher"),this.setQuickFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setQuickFilterParserAndMatcher())}isQuickFilterPresent(){return null!==this.quickFilter}
1doesRowPassQuickFilter(e){const t=this.gridOptionsService.get("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(t,e):this.quickFilterParts.every(i=>t?this.doesRowPassQuickFilterCache(e,i):this.doesRowPassQuickFilterNoCache(e,i))}resetQuickFilterCache(){this.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}setQuickFilterParts(){const{quickFilter:e,parser:t}=this;this.quickFilterParts=e?t?t(e):e.split(" "):null}parseQuickFilter(e){return R(e)?this.gridOptionsService.isRowModelType("clientSide")?e.toUpperCase():(console.warn("AG Grid - Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(e){if(null!=e&&"string"!=typeof e)return void console.warn("AG Grid - Grid option quickFilterText only supports string inputs, received: "+typeof e);const t=this.parseQuickFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setQuickFilterParts(),this.dispatchEvent({type:Ne.EVENT_QUICK_FILTER_CHANGED}))}setQuickFilterParserAndMatcher(){const e=this.gridOptionsService.get("quickFilterParser"),t=this.gridOptionsService.get("quickFilterMatcher"),i=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,i&&(this.setQuickFilterParts(),this.dispatchEvent({type:Ne.EVENT_QUICK_FILTER_CHANGED}))}onIncludeHiddenColumnsInQuickFilterChanged(){this.columnModel.refreshQuickFilterColumns(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchEvent({type:Ne.EVENT_QUICK_FILTER_CHANGED})}doesRowPassQuickFilterNoCache(e,t){return this.columnModel.getAllColumnsForQuickFilter().some(s=>{const o=this.getQuickFilterTextForColumn(s,e);return R(o)&&o.indexOf(t)>=0})}doesRowPassQuickFilterCache(e,t){return this.checkGenerateQuickFilterAggregateText(e),e.quickFilterAggregateText.indexOf(t)>=0}doesRowPassQuickFilterMatcher(e,t){let i;e?(this.checkGenerateQuickFilterAggregateText(t),i=t.quickFilterAggregateText):i=this.getQuickFilterAggregateText(t);const{quickFilterParts:s,matcher:o}=this;return o(s,i)}checkGenerateQuickFilterAggregateText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getQuickFilterAggregateText(e))}getQuickFilterTextForColumn(e,t){let i=this.valueService.getValue(e,t,!0);const s=e.getColDef();if(s.getQuickFilterText){const o=this.gridOptionsService.addGridCommonParams({value:i,node:t,data:t.data,column:e,colDef:s});i=s.getQuickFilterText(o)}return R(i)?i.toString().toUpperCase():null}getQuickFilterAggregateText(e){const t=[];return this.columnModel.getAllColumnsForQuickFilter().forEach(s=>{const o=this.getQuickFilterTextForColumn(s,e);R(o)&&t.push(o)}),t.join(Ne.QUICK_FILTER_SEPARATOR)}};Ne.EVENT_QUICK_FILTER_CHANGED="quickFilterChanged",Ne.QUICK_FILTER_SEPARATOR="\n",u([f("valueService")],Ne.prototype,"valueService",2),u([f("columnModel")],Ne.prototype,"columnModel",2),u([f("rowModel")],Ne.prototype,"rowModel",2),u([b],Ne.prototype,"postConstruct",1),Ne=u([O("quickFilterService")],Ne);var Je=class extends T{constructor(){super(...arguments),this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue=[]}init(){var e,t,i;this.addManagedListener(this.eventService,p.EVENT_GRID_COLUMNS_CHANGED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VALUE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VISIBLE,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,p.EVENT_ROW_DATA_UPDATED,()=>this.onNewRowsLoaded("rowDataUpdated")),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.addManagedPropertyListener("advancedFilterModel",s=>this.setAdvancedFilterModel(s.currentValue)),this.addManagedListener(this.eventService,p.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,({enabled:s})=>this.onAdvancedFilterEnabledChanged(s)),this.addManagedListener(this.eventService,p.EVENT_DATA_TYPES_INFERRED,()=>this.processFilterModelUpdateQueue()),this.addManagedListener(this.quickFilterService,Ne.EVENT_QUICK_FILTER_CHANGED,(
1)=>this.onFilterChanged({source:"quickFilter"})),this.initialFilterModel=L({},null!=(i=null==(t=null==(e=this.gridOptionsService.get("initialState"))?void 0:e.filter)?void 0:t.filterModel)?i:{})}isExternalFilterPresentCallback(){const e=this.gridOptionsService.getCallback("isExternalFilterPresent");return"function"==typeof e&&e({})}doesExternalFilterPass(e){const t=this.gridOptionsService.get("doesExternalFilterPass");return"function"==typeof t&&t(e)}setFilterModel(e,t="api"){if(this.isAdvancedFilterEnabled())return void this.warnAdvancedFilters();if(this.dataTypeService.isPendingInference())return void this.filterModelUpdateQueue.push({model:e,source:t});const i=[],s=this.getFilterModel();if(e){const o=An(Object.keys(e));this.allColumnFilters.forEach((r,n)=>{i.push(this.setModelOnFilterWrapper(r.filterPromise,e[n])),o.delete(n)}),o.forEach(r=>{const n=this.columnModel.getPrimaryColumn(r)||this.columnModel.getGridColumn(r);if(!n)return void console.warn("AG Grid: setFilterModel() - no column found for colId: "+r);if(!n.isFilterAllowed())return void console.warn("AG Grid: setFilterModel() - unable to fully apply model, filtering disabled for colId: "+r);const l=this.getOrCreateFilterWrapper(n,"NO_UI");l?i.push(this.setModelOnFilterWrapper(l.filterPromise,e[r])):console.warn("AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: "+r)})}else this.allColumnFilters.forEach(o=>{i.push(this.setModelOnFilterWrapper(o.filterPromise,null))});Ge.all(i).then(()=>{const o=this.getFilterModel(),r=[];this.allColumnFilters.forEach((n,l)=>{H.jsonEquals(s?s[l]:null,o?o[l]:null)||r.push(n.column)}),r.length>0&&this.onFilterChanged({columns:r,source:t})})}setModelOnFilterWrapper(e,t){return new Ge(i=>{e.then(s=>{"function"!=typeof s.setModel&&(console.warn("AG Grid: filter missing setModel method, which is needed for setFilterModel"),i()),(s.setModel(t)||Ge.resolve()).then(()=>i())})})}getFilterModel(){const e={};return this.allColumnFilters.forEach((t,i)=>{const s=this.getModelFromFilterWrapper(t);R(s)&&(e[i]=s)}),e}getModelFromFilterWrapper(e){var t;const s=e.filterPromise.resolveNow(null,o=>o);return null==s?null!=(t=this.initialFilterModel[e.column.getColId()])?t:null:"function"!=typeof s.getModel?(console.warn("AG Grid: filter API missing getModel method, which is needed for getFilterModel"),null):s.getModel()}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){var t;e?this.allColumnFilters.size&&(this.allColumnFilters.forEach(i=>this.disposeFilterWrapper(i,"advancedFilterEnabled")),this.onFilterChanged({source:"advancedFilter"})):null!=(t=this.advancedFilterService)&&t.isFilterPresent()&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){var e;return!(null==(e=this.advancedFilterService)||!e.isEnabled())}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){this.activeColumnFilters.length=0,this.activeAggregateFilters.length=0;const e=s=>!!s&&(s.isFilterActive?s.isFilterActive():(console.warn("AG Grid: Filter is missing isFilterActive() method"),!1)),t=!!this.gridOptionsService.getGroupAggFiltering(),i=s=>{if(!s.isPrimary())return!0;const r=!this.columnModel.isPivotActive();return!(!s.isValueActive()||!r)&&(!!this.columnModel.isPivotMode()||t)};this.allColumnFilters.forEach(s=>{if(s.filterPromise.resolveNow(!1,e)){const o=s.filterPromise.resolveNow(null,r=>r);i(s.column)?this.activeAggregateFilters.push(o):this.activeColumnFilters.push(o)}})}
1updateFilterFlagInColumns(e,t){this.allColumnFilters.forEach(i=>{const s=i.filterPromise.resolveNow(!1,o=>o.isFilterActive());i.column.setFilterActive(s,e,t)})}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}doColumnFiltersPass(e,t,i){const{data:s,aggData:o}=e,r=i?this.activeAggregateFilters:this.activeColumnFilters,n=i?o:s;for(let l=0;l<r.length;l++){const a=r[l];if(null!=a&&a!==t){if("function"!=typeof a.doesFilterPass)throw new Error("Filter is missing method doesFilterPass");if(!a.doesFilterPass({node:e,data:n}))return!1}}return!0}resetQuickFilterCache(){this.quickFilterService.resetQuickFilterCache()}refreshFiltersForAggregations(){this.gridOptionsService.getGroupAggFiltering()&&this.onFilterChanged()}callOnFilterChangedOutsideRenderCycle(e){const t=()=>this.onFilterChanged(e);this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}onFilterChanged(e={}){const{source:t,filterInstance:i,additionalEventAttributes:s,columns:o}=e;this.updateDependantFilters(),this.updateActiveFilters(),this.updateFilterFlagInColumns("filterChanged",s),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.allColumnFilters.forEach(n=>{n.filterPromise&&n.filterPromise.then(l=>{l&&l!==i&&l.onAnyFilterChanged&&l.onAnyFilterChanged()})});const r={source:t,type:p.EVENT_FILTER_CHANGED,columns:o||[]};s&&We(r,s),this.processingFilterChange=!0,this.eventService.dispatchEvent(r),this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){var e;return!(null!=(e=this.gridOptionsService.get("allowShowChangeAfterFilter"))&&e)&&this.processingFilterChange}isQuickFilterPresent(){return this.quickFilterService.isQuickFilterPresent()}updateAggFiltering(){this.aggFiltering=!!this.gridOptionsService.getGroupAggFiltering()}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&(this.aggFiltering||this.columnModel.isPivotMode())}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!(this.aggFiltering||this.columnModel.isPivotMode())}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isAggregateFilterPresent()&&!this.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode)||this.isColumnFilterPresent()&&!this.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip)||this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))}onNewRowsLoaded(e){this.allColumnFilters.forEach(t=>{t.filterPromise.then(i=>{i.onNewRowsLoaded&&i.onNewRowsLoaded()})}),this.updateFilterFlagInColumns(e,{afterDataChange:!0}),this.updateActiveFilters()}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}createGetValue(e){return(t,i)=>{const s=i?this.columnModel.getGridColumn(i):e;return s?this.valueService.getValue(s,t,!0):void 0}}getFilterComponent(e,t,i=!0){var s;if(i)return(null==(s=this.getOrCreateFilterWrapper(e,t))?void 0:s.filterPromise)||null;const o=this.cachedFilter(e);return o?o.filterPromise:null}isFilterActive(e){const t=this.cachedFilter(e);return!!t&&t.filterPromise.resolveNow(!1,i=>i.isFilterActive())}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return null;let i=this.cachedFilter(e);return i?"NO_UI"!==t&&this.putIntoGui(i,t):(i=this.createFilterWrapper(e,t),this.setColumnFilterWrapper(e,i)),i}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){let t;if(Y.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))t="agSetColumnFilter";else{const i=this.dataTypeService.getBaseDataType(e);t="number"===i?"agNumberColumnFilter":"date"===i||"dateString"===i?"agDateColumnFilter":"agTextColumnFilter"}return t}getDefaultFloatingFilter(e){let t;if(Y.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))t="agSetColumnFloatingFilter";else{const i=this.dataTypeService.getBaseDataType(e);t="number"===i?"agNumberColumnFloatingFilter":"date"===i||"dateString"===i?"agDateColumnFloatingFilter":"agTextColumnFloatingFilter"}return t}createFilterInstance(e){const t=this.getDefaultFilter(e),i=e.getColDef();let s;const o=ie(L({},this.createFilterParams(e,i)),{filterModifiedCallback:()=>this.filterModifiedCallbackFactory(s,e)(),filterChangedCallback:n=>this.filterChangedCallbackFactory(s,e)(n),doesRowPassOtherFilter:n=>this.doesRowPassOtherFilters(s,n)}),r=this.userComponentFactory.getFilterDetails(i,o,t);return r?{filterPromise:()=>{const n=r.newAgStackInstance();return n&&n.then(l=>s=l),n}
1,compDetails:r}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return this.gridOptionsService.addGridCommonParams({column:e,colDef:Ir(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),getValue:this.createGetValue(e),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(e,t){var i;const s={column:e,filterPromise:null,compiledElement:null,guiPromise:Ge.resolve(null),compDetails:null},{filterPromise:o,compDetails:r}=this.createFilterInstance(e);return s.filterPromise=null!=(i=o?.())?i:null,s.compDetails=r,o&&this.putIntoGui(s,t),s}putIntoGui(e,t){const i=document.createElement("div");i.className="ag-filter",e.guiPromise=new Ge(s=>{e.filterPromise.then(o=>{let r=o.getGui();R(r)||console.warn(`AG Grid: getGui method from filter returned ${r}, it should be a DOM element or an HTML template string.`),"string"==typeof r&&(r=xe(r)),i.appendChild(r),s(i),this.eventService.dispatchEvent({type:p.EVENT_FILTER_OPENED,column:e.column,source:t,eGui:i})})})}onColumnsChanged(){const e=[];this.allColumnFilters.forEach((t,i)=>{let s;s=t.column.isPrimary()?this.columnModel.getPrimaryColumn(i):this.columnModel.getGridColumn(i),!s&&(e.push(t.column),this.disposeFilterWrapper(t,"columnChanged"),this.disposeColumnListener(i))}),e.length>0?this.onFilterChanged({columns:e,source:"api"}):this.updateDependantFilters()}updateDependantFilters(){const e=this.columnModel.getGroupAutoColumns();e?.forEach(t=>{"agGroupColumnFilter"===t.getColDef().filter&&this.getOrCreateFilterWrapper(t,"NO_UI")})}isFilterAllowed(e){var t,i;if(this.isAdvancedFilterEnabled()||!e.isFilterAllowed())return!1;const o=this.allColumnFilters.get(e.getColId());return null==(i=null==(t=o?.filterPromise)?void 0:t.resolveNow(!0,r=>"function"!=typeof r?.isFilterAllowed||r?.isFilterAllowed()))||i}getFloatingFilterCompDetails(e,t){const i=a=>{const c=this.getFilterComponent(e,"NO_UI");c?.then(h=>{a(ni(h))})},s=e.getColDef(),o=ie(L({},this.createFilterParams(e,s)),{filterChangedCallback:()=>i(a=>this.filterChangedCallbackFactory(a,e)())}),r=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(s,Bn,o);let n=this.userComponentFactory.getDefaultFloatingFilterType(s,()=>this.getDefaultFloatingFilter(e));return null==n&&(n="agReadOnlyFloatingFilter"),this.userComponentFactory.getFloatingFilterCompDetails(s,{column:e,filterParams:r,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t,suppressFilterButton:!1},n)}getCurrentFloatingFilterParentModel(e){const t=this.getFilterComponent(e,"NO_UI",!1);return t?t.resolveNow(null,i=>i&&i.getModel()):null}destroyFilter(e,t="api"){const i=e.getColId(),s=this.allColumnFilters.get(i);this.disposeColumnListener(i),delete this.initialFilterModel[i],s&&(this.disposeFilterWrapper(s,t),this.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then(i=>{this.getContext().destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId()),this.eventService.dispatchEvent({type:p.EVENT_FILTER_DESTROYED,source:t,column:e.column})})}filterModifiedCallbackFactory(e,t){return()=>{this.eventService.dispatchEvent({type:p.EVENT_FILTER_MODIFIED,column:t,filterInstance:e})}}filterChangedCallbackFactory(e,t){return i=>{var s;const o=null!=(s=i?.source)?s:"api";this.callOnFilterChangedOutsideRenderCycle({filter:e,additionalEventAttributes:i,columns:[t],source:o})}}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:s}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};if(this.areFilterCompsDifferent(t.compDetails,s))return void this.destroyFilter(i,"paramsUpdated");const o=i.getColDef().filterParams;t.filterPromise?t.filterPromise.then(r=>{!1===(!r?.refresh||r.refresh(L(ie(L({},this.createFilterParams(i,i.getColDef())),{filterModifiedCallback:this.filterModifiedCallbackFactory(r,
1i),filterChangedCallback:this.filterChangedCallbackFactory(r,i),doesRowPassOtherFilter:l=>this.doesRowPassOtherFilters(r,l)}),o)))&&this.destroyFilter(i,"paramsUpdated")}):this.destroyFilter(i,"paramsUpdated")}setColumnFilterWrapper(e,t){const i=e.getColId();this.allColumnFilters.set(i,t),this.allColumnListeners.set(i,this.addManagedListener(e,Z.EVENT_COL_DEF_CHANGED,()=>this.checkDestroyFilter(i)))}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:i}=e,{componentClass:s}=t;return!(i===s||i?.render&&s?.render&&i.render===s.render)}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){if(this.isAdvancedFilterEnabled()){if(this.dataTypeService.isPendingInference())return void this.advancedFilterModelUpdateQueue.push(e);this.advancedFilterService.setModel(e??null),this.onFilterChanged({source:"advancedFilter"})}}showAdvancedFilterBuilder(e){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder(e,!0)}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return!this.isAdvancedFilterEnabled()&&this.columnModel.getAllGridColumns().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e,t){if(this.isAdvancedFilterEnabled())return void this.warnAdvancedFilters();const i=this.getFilterInstanceImpl(e,o=>{if(!t)return;const r=ni(o);t(r)});return ni(i)}getColumnFilterInstance(e){return new Promise(t=>{this.getFilterInstance(e,i=>{t(i)})})}getFilterInstanceImpl(e,t){const i=this.columnModel.getPrimaryColumn(e);if(!i)return;const s=this.getFilterComponent(i,"NO_UI"),o=s&&s.resolveNow(null,r=>r);return o?setTimeout(t,0,o):s&&s.then(r=>{t(r)}),o}warnAdvancedFilters(){x("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(e){var t;null==(t=this.advancedFilterService)||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach(({model:e,source:t})=>this.setFilterModel(e,t)),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach(({key:e,model:t,resolve:i})=>{this.setColumnFilterModel(e,t).then(()=>i())}),this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue.forEach(e=>this.setAdvancedFilterModel(e)),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(e){const t=this.getFilterWrapper(e);return t?this.getModelFromFilterWrapper(t):null}setColumnFilterModel(e,t){if(this.isAdvancedFilterEnabled())return this.warnAdvancedFilters(),Promise.resolve();if(this.dataTypeService.isPendingInference()){let r=()=>{};const n=new Promise(l=>{r=l});return this.columnFilterModelUpdateQueue.push({key:e,model:t,resolve:r}),n}const i=this.columnModel.getPrimaryColumn(e),s=i?this.getOrCreateFilterWrapper(i,"NO_UI"):null;return s?(r=this.setModelOnFilterWrapper(s.filterPromise,t),new Promise(n=>{r.then(l=>n(l))})):Promise.resolve();var r}getFilterWrapper(e){var t;const i=this.columnModel.getPrimaryColumn(e);return i&&null!=(t=this.cachedFilter(i))?t:null}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear()}};u([f("valueService")],Je.prototype,"valueService",2),u([f("columnModel")],Je.prototype,"columnModel",2),u([f("rowModel")],Je.prototype,"rowModel",2),u([f("userComponentFactory")],Je.prototype,"userComponentFactory",2),u([f("rowRenderer")],Je.prototype,"rowRenderer",2),u([f("dataTypeService")],Je.prototype,"dataTypeService",2),u([f("quickFilterService")],Je.prototype,"quickFilterService",2),u([z("advancedFilterService")],Je.prototype,"advancedFilterService",2),u([b],Je.prototype,"init",1),Je=u([O("filterManager")],Je);var Un=class extends k{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},li=class Pu extends Un{constructor(t){super(Pu.TEMPLATE,t)}postConstruct(){const t=this.getGui();
1this.ctrl.setComp({addOrRemoveCssClass:(s,o)=>this.addOrRemoveCssClass(s,o),addOrRemoveBodyCssClass:(s,o)=>this.eFloatingFilterBody.classList.toggle(s,o),setButtonWrapperDisplayed:s=>U(this.eButtonWrapper,s),setCompDetails:s=>this.setCompDetails(s),getFloatingFilterComp:()=>this.compPromise,setWidth:s=>t.style.width=s,setMenuIcon:s=>this.eButtonShowMainFilter.appendChild(s)},t,this.eButtonShowMainFilter,this.eFloatingFilterBody)}setCompDetails(t){if(!t)return this.destroyFloatingFilterComp(),void(this.compPromise=null);this.compPromise=t.newAgStackInstance(),this.compPromise.then(i=>this.afterCompCreated(i))}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(t){if(t){if(!this.isAlive())return void this.destroyBean(t);this.destroyFloatingFilterComp(),this.floatingFilterComp=t,this.eFloatingFilterBody.appendChild(t.getGui()),t.afterGuiAttached&&t.afterGuiAttached()}}};li.TEMPLATE='<div class="ag-header-cell ag-floating-filter" role="gridcell">\n <div ref="eFloatingFilterBody" role="presentation"></div>\n <div class="ag-floating-filter-button ag-hidden" ref="eButtonWrapper" role="presentation">\n <button type="button" class="ag-button ag-floating-filter-button-button" ref="eButtonShowMainFilter" tabindex="-1"></button>\n </div>\n </div>',u([A("eFloatingFilterBody")],li.prototype,"eFloatingFilterBody",2),u([A("eButtonWrapper")],li.prototype,"eButtonWrapper",2),u([A("eButtonShowMainFilter")],li.prototype,"eButtonShowMainFilter",2),u([b],li.prototype,"postConstruct",1),u([Ae],li.prototype,"destroyFloatingFilterComp",1);var mp=li,tr=class extends T{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.getDomLayout(),t={autoHeight:"autoHeight"===e,normal:"normal"===e,print:"print"===e};this.view.updateLayoutClasses(t.autoHeight?"ag-layout-auto-height":t.print?"ag-layout-print":"ag-layout-normal",t)}getDomLayout(){var e;const t=null!=(e=this.gridOptionsService.get("domLayout"))?e:"normal";return-1===["normal","print","autoHeight"].indexOf(t)?(x(`${t} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"normal"):t}};u([b],tr.prototype,"postConstruct",1);var Mt=class extends T{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=Pe(()=>this.lastScrollSource[1]=null,500),this.resetLastVScrollDebounced=Pe(()=>this.lastScrollSource[0]=null,500)}postConstruct(){this.enableRtl=this.gridOptionsService.get("enableRtl"),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this)),this.ctrlsService.whenReady(e=>{this.centerRowContainerCtrl=e.centerRowContainerCtrl,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}addScrollListener(){const e=this.ctrlsService.getFakeHScrollComp(),t=this.ctrlsService.getFakeVScrollComp();this.addManagedListener(this.centerRowContainerCtrl.getViewportElement(),"scroll",this.onHScroll.bind(this)),e.onScrollCallback(this.onFakeHScroll.bind(this));const i=this.gridOptionsService.get("debounceVerticalScrollbar"),s=i?Pe(this.onVScroll.bind(this),100):this.onVScroll.bind(this),o=i?Pe(this.onFakeVScroll.bind(this),100):this.onFakeVScroll.bind(this);this.addManagedListener(this.eBodyViewport,"scroll",s),t.onScrollCallback(o)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){if(null==this.centerRowContainerCtrl)return;void 0===e&&(e=this.centerRowContainerCtrl.getCenterViewportScrollLeft());const i=this.enableRtl?e:-e,s=this.ctrlsService.getTopCenterRowContainerCtrl(),o=this.ctrlsService.getStickyTopCenterRowContainerCtrl(),r=this.ctrlsService.getBottomCenterRowContainerCtrl(),n=this.ctrlsService.getFakeHScrollComp();this.ctrlsService.getHeaderRowContainerCtrl().setHorizontalScroll(-i),r.setContainerTranslateX(i),s.setContainerTranslateX(i),o.setContainerTranslateX(i);const a=this.centerRowContainerCtrl.getViewportElement(),c=0===this.lastScrollSource[1];e=Math.abs(e),c?n.setScrollPosition(e):bs(a,e,this.enableRtl)}isControllingScroll(e,t){return null==this.lastScrollSource[t]?(this.lastScrollSource[t]=e,!0):this.lastScrollSource[t]===e}onFakeHScroll(){this.isControllingScroll(1,1)&&this.onHScrollCommon(1)}onHScroll(){this.isControllingScroll(0,1)&&this.onHScrollCommon(0)}onHScrollCommon(e){const t=this.centerRowContainerCtrl.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(1,i,!0))return;let s;s=0===e?Ts(t,this.enableRtl):this.ctrlsService.getFakeHScrollComp().getScrollPosition(),this.doHorizontalScroll(Math.round(s)),this.resetLastHScrollDebounced()}onFakeVScroll(){this.isControllingScroll(1,0)&&this.onVScrollCommon(1)}onVScroll(){this.isControllingScroll(0,0)&&this.onVScrollCommon(0)}onVScrollCommon(e){let t;t=0===e?this.eBodyViewport.scrollTop:this.ctrlsService.getFakeVScrollComp().getScrollPosition(),!this.shouldBlockScrollUpdate(0,t,!0)&&(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,0===e?this.ctrlsService.getFakeVScrollComp().setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gridOptionsService.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.getFakeHScrollComp().getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloating
1Center(e),this.centerRowContainerCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:p.EVENT_BODY_SCROLL,direction:1===e?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(()=>{const i=ie(L({},t),{type:p.EVENT_BODY_SCROLL_END});this.eventService.dispatchEvent(i)},100)}shouldBlockScrollUpdate(e,t,i=!1){return!(i&&!At())&&(0===e?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t))}shouldBlockVerticalScroll(e){const t=ys(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowContainerCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowContainerCtrl.getViewportElement();if(this.enableRtl&&Ds()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowContainerCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(0)}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const s=this.centerRowContainerCtrl.getViewportElement().scrollWidth-this.centerRowContainerCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(e=this.enableRtl&&Ds()?e>0?0:s:Math.min(Math.max(e,0),s)),bs(this.centerRowContainerCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){return this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight,{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowContainerCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowContainerCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowContainerCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowContainerCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const i=this.rowModel.getRowCount();let s=-1;for(let o=0;o<i;o++){const r=this.rowModel.getRow(o);if("function"==typeof e){if(r&&e(r)){s=o;break}}else if(e===r||e===r.data){s=o;break}}s>=0&&this.ensureIndexVisible(s,t)}ensureIndexVisible(e,t){if(this.gridOptionsService.isDomLayout("print"))return;const i=this.paginationProxy.getRowCount();if("number"!=typeof e||e<0||e>=i)return void console.warn("AG Grid: Invalid row index for ensureIndexVisible: "+e);const o=this.gridOptionsService.get("pagination")&&!this.gridOptionsService.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming(()=>{o||this.paginationProxy.goToPageWithIndex(e);const n=this.ctrlsService.getGridBodyCtrl().getStickyTopHeight(),l=this.paginationProxy.getRow(e);let a;do{const c=l.rowTop,h=l.rowHeight,g=this.paginationProxy.getPixelOffset(),m=l.rowTop-g,C=m+l.rowHeight,v=this.getVScrollPosition(),E=this.heightScaler.getDivStretchOffset(),S=v.top+E,D=v.bottom+E,y=D-S,P=this.heightScaler.getScrollPositionForPixel(m),F=this.heightScaler.getScrollPositionForPixel(C-y),M=Math.min((P+F)/2,m);let j=null;"top"===t?j=P:"bottom"===t?j=F:"middle"===t?j=M:S+n>m?j=P-n:D<C&&(j=F),null!==j&&(this.setVerticalScrollPosition(j),this.rowRenderer.redraw({afterScroll:!0})),a=c!==l.rowTop||h!==l.rowHeight}while(a);this.animationFrameService.flushAllFrames()})}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getGridColumn(e);if(!i||i.isPinned()||!this.columnModel.isColumnDisplayed(i))return;const s=this.getPositionedHorizontalScroll(i,t);this.getFrameworkOverrides().wrapIncoming(()=>{null!==s&&this.centerRowContainerCtrl.setCenterViewportScrollLeft(s),this.centerRowContainerCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()})}setScrollPosition(e,t){this.getFrameworkOverrides().wrapIncoming(()=>{this.centerRowContainerCtrl.setCenterViewportScrollLeft(t),this.setVerticalScrollPosition(e),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:s}=this.isColumnOutsideViewport(e),o=this.centerRowContainerCtrl.getCenterWidth()<e.getActualWidth(),r=this.centerRowContainerCtrl.getCenterWidth(),n=this.enableRtl;let l=(n?i:s)||o,a=n?s:i;"auto"!==t&&(l="start"===t,a="end"===t);const c="middle"===t;if(l||a||c){const{colLeft:h,colMiddle:g,colRight:m}=this.getColumnBounds(e);return c?g-r/2:l?n?m:h:n?h-r:m-r}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:s,colRight:o}=this.getColumnBounds(e),r=this.enableRtl;return{columnBeforeStart:r?t>o:i<o,columnAfterEnd:r?i<s:t>s}}getColumnBounds(e){const t=this.enableRtl,i=this.columnModel.getBodyContainerWidth(),s=e.getActualWidth(),o=e.getLeft(),r=t?-1:1,n=t?i-o:o;return{colLeft:n,colMiddle:n+s/2*r,colRight:n+s*r}}getViewportBounds(){const e=this.centerRowContainerCtrl.getCenterWidth(),t=this.centerRowContainerCtrl.getCenterViewportScrollLeft();return{start:t,end:e+t,width:e}}};u([f("ctrlsService")],Mt.prototype,"ctrlsService",2),u([f("animationFrameService")],Mt.prototype,"animationFrameService",2),u([f("paginationProxy")],Mt.prototype,"paginationProxy",2),u([f("rowModel")],Mt.prototype,"rowModel",2),u([f("rowContainerHeightService")],Mt.prototype,"heightScaler",2),u([f("rowRenderer")],Mt.prototype,"rowRenderer",2),u([f("columnModel")],Mt.prototype,"columnModel",2),u([b],Mt.prototype,"postConstruct",1);var Id="ag-force-vertical-scroll",Oe=class extends T{constructor(){super(...arguments),this.stickyTopHeight=0}
1getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,s,o,r){this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=s,this.eBottom=o,this.eStickyTop=r,this.setCellTextSelection(this.gridOptionsService.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",n=>this.setCellTextSelection(n.currentValue)),this.createManagedBean(new tr(this.comp)),this.bodyScrollFeature=this.createManagedBean(new Mt(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,i,o,r]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.filterManager.setupAdvancedFilterHeaderComp(s),this.ctrlsService.registerGridBodyCtrl(this)}getComp(){return this.comp}addEventListeners(){this.addManagedListener(this.eventService,p.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}addFocusListeners(e){e.forEach(t=>{this.addManagedListener(t,"focusin",i=>{const{target:s}=i,o=Zt(s,"ag-root",t);t.classList.toggle("ag-has-focus",!o)}),this.addManagedListener(t,"focusout",i=>{const{target:s,relatedTarget:o}=i,r=t.contains(o),n=Zt(o,"ag-root",t);Zt(s,"ag-root",t)||(!r||n)&&t.classList.remove("ag-has-focus")})})}setColumnMovingCss(e){this.comp.setColumnMovingCss("ag-column-moving",e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss("ag-selectable",e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyTopWidth(e);const s=`calc(100% + ${(e&&this.gridOptionsService.getScrollbarWidth()||0)+(pn()?16:0)}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setBodyViewportWidth(s))}onGridColumnsChanged(){const e=this.columnModel.getAllGridColumns();this.comp.setColumnCount(e.length)}disableBrowserDragging(){this.addManagedListener(this.eGridBody,"dragstart",e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1})}addStopEditingWhenGridLosesFocus(){if(!this.gridOptionsService.get("stopEditingWhenCellsLoseFocus"))return;const e=i=>{const s=i.relatedTarget;if(null===Ho(s))return void this.rowRenderer.stopEditing();let o=t.some(r=>r.contains(s))&&this.mouseEventService.isElementInThisGrid(s);if(!o){const r=this.popupService;o=r.getActivePopups().some(n=>n.contains(s))||r.isElementWithinCustomPopup(s)}o||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop];t.forEach(i=>this.addManagedListener(i,"focusout",e))}updateRowCount(){const e=this.headerNavigationService.getHeaderRowCount()+this.filterManager.getHeaderRowCount(),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1;this.comp.setRowCount(-1===t?-1:e+t)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){this.comp.setPinnedTopBottomOverflowY(e?"scroll":"hidden")}isVerticalScrollShowing(){const e=this.gridOptionsService.get("alwaysShowVerticalScroll"),t=e?Id:null,i=this.gridOptionsService.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&xa(this.eBodyViewport)}setupRowAnimationCssClass(){const e=()=>{const t=this.gridOptionsService.isAnimateRows()&&!this.rowContainerHeightService.isStretching();this.comp.setRowAnimationCssOnBodyViewport(t?"ag-row-animation":"ag-row-no-animation",t)};e(),this.addManagedListener(this.eventService,p.EVENT_HEIGHT_SCALE_CHANGED,e),this.addManagedPropertyListener("animateRows",e)}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedListener(this.eBodyViewport,"contextmenu",e),this.mockContextMenuForIPad(e),this.addManagedListener(this.eBodyViewport,"wheel",this.onBodyViewportWheel.bind(this)),this.addManagedListener(this.eStickyTop,"wheel",this.onStickyTopWheel.bind(this)),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const e=this.eBodyViewport.querySelector(".ag-full-width-container"),t=this.eBodyViewport.querySelector(".ag-center-cols-viewport");e&&t&&this.addManagedListener(e,"wheel",i=>this.onFullWidthContainerWheel(i,t))}onFullWidthContainerWheel(e,t){!e.deltaX||Math.abs(e.deltaY)>Math.abs(e.deltaX)||!this.mouseEventService.isEventFromThisGrid(e)||(e.preventDefault(),t.scrollBy({left:e.deltaX}))}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;this.gridOptionsService.get("preventDefaultOnContextMenu")&&(e||i).preventDefault();const{target:s}=e||t;(s===this.eBodyViewport||s===this.ctrlsService.getCenterRowContainerCtrl().getViewportElement())&&this.menuService.showContextMenu({mouseEvent:e,touchEvent:i,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(e){if(!At())return;const t=new we(this.eBodyViewport);this.addManagedListener(t,we.EVENT_LONG_TAP,s=>{e(void 0,s.touchStart,s.touchEvent)}),this.addDestroyFunc(()=>t.destroy())}onBodyViewportWheel(e){this.gridOptionsService.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}onStickyTopWheel(e){e.preventDefault(),e.offsetY&&this.scrollVertically(e.deltaY)}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new Ke(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}
1getRowDragFeature(){return this.rowDragFeature}onPinnedRowDataChanged(){this.setFloatingHeights()}setFloatingHeights(){const{pinnedRowModel:e}=this;let t=e.getPinnedTopTotalHeight(),i=e.getPinnedBottomTotalHeight();this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyTopWidth(e){if(e){const t=this.gridOptionsService.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${t}px)`)}else this.comp.setStickyTopWidth("100%")}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const t=this.ctrlsService.getGridHeaderCtrl().getHeaderHeight()+this.filterManager.getHeaderHeight(),i=this.pinnedRowModel.getPinnedTopTotalHeight();let s=0;t>0&&(s+=t+1),i>0&&(s+=i+1),this.comp.setStickyTopTop(`${s}px`)}sizeColumnsToFit(e,t){const s=this.isVerticalScrollShowing()?this.gridOptionsService.getScrollbarWidth():0,r=Jt(this.eGridBody)-s;r>0?this.columnModel.sizeColumnsToFit(r,"sizeColumnsToFit",!1,e):void 0===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,100)},0):100===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,500)},100):500===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,-1)},500):console.warn("AG Grid: tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}};u([f("animationFrameService")],Oe.prototype,"animationFrameService",2),u([f("rowContainerHeightService")],Oe.prototype,"rowContainerHeightService",2),u([f("ctrlsService")],Oe.prototype,"ctrlsService",2),u([f("columnModel")],Oe.prototype,"columnModel",2),u([f("scrollVisibleService")],Oe.prototype,"scrollVisibleService",2),u([f("menuService")],Oe.prototype,"menuService",2),u([f("headerNavigationService")],Oe.prototype,"headerNavigationService",2),u([f("dragAndDropService")],Oe.prototype,"dragAndDropService",2),u([f("pinnedRowModel")],Oe.prototype,"pinnedRowModel",2),u([f("rowRenderer")],Oe.prototype,"rowRenderer",2),u([f("popupService")],Oe.prototype,"popupService",2),u([f("mou
1seEventService")],Oe.prototype,"mouseEventService",2),u([f("rowModel")],Oe.prototype,"rowModel",2),u([f("filterManager")],Oe.prototype,"filterManager",2);var ks="ag-cell-range-selected",Mp=class{constructor(e,t){this.beans=e,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.beans.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(ks,0!==this.rangeCount),this.cellComp.addOrRemoveCssClass(`${ks}-1`,1===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${ks}-2`,2===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${ks}-3`,3===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${ks}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass("ag-cell-range-chart",this.hasChartRange),Ni(this.eGui,this.rangeCount>0||void 0),this.cellComp.addOrRemoveCssClass("ag-cell-range-single-cell",this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),s=!t&&e.right,o=!t&&e.bottom,r=!t&&e.left;this.cellComp.addOrRemoveCssClass("ag-cell-range-top",!t&&e.top),this.cellComp.addOrRemoveCssClass("ag-cell-range-right",s),this.cellComp.addOrRemoveCssClass("ag-cell-range-bottom",o),this.cellComp.addOrRemoveCssClass("ag-cell-range-left",r)}isSingleCell(){const{rangeService:e}=this.beans;return 1===this.rangeCount&&e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(i=>Ue([1,0],i.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gridOptionsService.get("enableRtl");let t=!1,i=!1,s=!1,o=!1;const r=this.cellCtrl.getCellPosition().column,{rangeService:n,columnModel:l}=this.beans;let a,c;e?(a=l.getDisplayedColAfter(r),c=l.getDisplayedColBefore(r)):(a=l.getDisplayedColBefore(r),c=l.getDisplayedColAfter(r));const h=n.getCellRanges().filter(g=>n.isCellInSpecificRange(this.cellCtrl.getCellPosition(),g));a||(o=!0),c||(i=!0);for(let g=0;g<h.length&&!(t&&i&&s&&o);g++){const m=h[g],C=n.getRangeStartRow(m),v=n.getRangeEndRow(m);!t&&this.beans.rowPositionUtils.sameRow(C,this.cellCtrl.getCellPosition())&&(t=!0),!s&&this.beans.rowPositionUtils.sameRow(v,this.cellCtrl.getCellPosition())&&(s=!0),!o&&a&&m.columns.indexOf(a)<0&&(o=!0),!i&&c&&m.columns.indexOf(c)<0&&(i=!0)}return{top:t,right:i,bottom:s,left:o}}refreshHandle(){if(!this.beans.rangeService||this.beans.context.isDestroyed())return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass("ag-cell-range-handle",!!this.selectionHandle)}shouldHaveSelectionHandle(){const{gridOptionsService:e,rangeService:t}=this.beans,i=t.getCellRanges(),s=i.length;if(this.rangeCount<1||s<1)return!1;const o=K(i),r=this.cellCtrl.getCellPosition(),n=e.get("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),l=e.get("enableRangeHandle");let a=1===s&&!this.cellCtrl.isEditing()&&(n||l);if(this.hasChartRange){const h=1===i[0].type&&t.isCellInSpecificRange(r,i[0]);this.cellComp.addOrRemoveCssClass("ag-cell-range-chart-category",h),a=0===o.type}return a&&null!=o.endRow&&t.isContiguousRange(o)&&t.isBottomRightCell(o,r)}addSelectionHandle(){const{gridOptionsService:e,rangeService:t}=this.beans,i=K(t.getCellRanges()).type,o=e.get("enableFillHandle")&&G(i)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==o&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.beans.selectionHandleFactory.createSelectionHandle(o)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},Ip=class extends T{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListener(this.beans.eventService,p.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}setComp(e){this.eGui=e,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this.applyRowSpan(!0))}
1onDisplayColumnsChanged(){const e=this.getColSpanningList();pt(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){null!=this.column.getColDef().colSpan&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListener(this.beans.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayColumnsChanged.bind(this)),this.addManagedListener(this.beans.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onWidthChanged.bind(this)))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(1===e)t.push(this.column);else{let i=this.column;const s=this.column.getPinned();for(let o=0;i&&o<e&&(t.push(i),i=this.beans.columnModel.getDisplayedColAfter(i),i&&!G(i)&&s===i.getPinned());o++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return e=this.beans.gridOptionsService.get("enableRtl")&&this.colsSpanning?K(this.colsSpanning):this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||"left"===this.column.getPinned())return e;const t=this.beans.columnModel.getDisplayedColumnsLeftWidth();return"right"===this.column.getPinned()?t+this.beans.columnModel.getBodyContainerWidth()+(e||0):t+(e||0)}applyRowSpan(e){if(1===this.rowSpan&&!e)return;const i=this.beans.gridOptionsService.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=`${i}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},Lp=class extends T{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),{cellClassRules:t}=e,i=this.beans.gridOptionsService.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(t===this.cellClassRules?void 0:this.cellClassRules,t,i,s=>this.cellComp.addOrRemoveCssClass(s,!0),s=>this.cellComp.addOrRemoveCssClass(s,!1)),this.cellClassRules=t}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if("function"==typeof e.cellStyle){const i=this.beans.gridOptionsService.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex});t=(0,e.cellStyle)(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t=this.beans.gridOptionsService.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach(i=>this.cellComp.addOrRemoveCssClass(i,!1)),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach(i=>this.cellComp.addOrRemoveCssClass(i,!0))}destroy(){super.destroy()}},N=class{postConstruct(){this.gridOptionsService.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.gridOptionsService.isRowModelType("serverSide")&&(this.serverSideRowModel=this.rowModel)}};u([f("resizeObserverService")],N.prototype,"resizeObserverService",2),u([f("paginationProxy")],N.prototype,"paginationProxy",2),u([f("context")],N.prototype,"context",2),u([f("columnApi")],N.prototype,"columnApi",2),u([f("gridApi")],N.prototype,"gridApi",2),u([f("gridOptionsService")],N.prototype,"gridOptionsService",2),u([f("expressionService")],N.prototype,"expressionService",2),u([f("environment")],N.prototype,"environment",2),u([f("rowRenderer")],N.prototype,"rowRenderer",2),u([f("templateService")],N.prototype,"templateService",2),u([f("valueService")],N.prototype,"valueService",2),u([f("eventService")],N.prototype,"eventService",2),u([f("columnModel")],N.prototype,"columnModel",2),u([f("headerNavigationService")],N.prototype,"headerNavigationService",2),u([f("navigationService")],N.prototype,"navigationService",2),u([f("columnAnimationService")],N.prototype,"columnAnimationService",2),u([z("rangeService")],N.prototype,"rangeService",2),u([f("focusService")],N.prototype,"focusService",2),u([f("popupService")],N.prototype,"popupService",2),u([f("valueFormatterService")],N.prototype,"valueFormatterService",2),u([f("stylingService")],N.prototype,"stylingService",2),u([f("columnHoverService")],N.prototype,"columnHoverService",2),u([f("userComponentFactory")],N.prototype,"userComponentFactory",2),u([f("userComponentRegistry")],N.prototype,"userComponentRegistry",2),u([f("animationFrameService")],N.prototype,"animationFrameService",2),u([f("dragService")],N.prototype,"dragService",2),u([f("dragAndDropService")],N.prototype,"dragAndDropService",2),u([f("sortController")],N.prototype,"sortController",2),u([f("filterManager")],N.prototype,"filterManager",2),u([f("rowContainerHeightService")],N.prototype,"rowContainerHeightService",2),u([f("frameworkOverrides")],N.prototype,"frameworkOverrides",2),u([f("cellPositionUtils")],N.prototype,"cellPositionUtils",2),u([f("rowPositionUtils")],N.prototype,"rowPositionUtils",2),u([f("selectionService")],N.prototype,"selectionService",2),u([z("selectionHandleFactory")],N.prototype,"selectionHandleFactory",2),u([f("rowCssClassCalculator")],N.prototype,"rowCssClassCalculator",2),u([f("rowModel")],N.prototype,"rowModel",2),u([f("ctrlsService")],N.prototype,"ctrlsService",2),u([f("ctrlsFactory")],N.prototype,"ctrlsFactory",2),u([f("agStackComponentsRegistry")],N.prototype,"agStackComponentsRegistry",2),u([f("valueCache")],N.prototype,"valueCache",2),u([f("rowNodeEventThrottle")],N.prototype,"rowNodeEventThrottle",2),u([f("localeService")],N.prototype,"localeService",2),u([f("valueParserService")],N.prototype,"valueParserService",2),u([f("syncService")],N.prototype,"syncService",2),u([f("ariaAnnouncementService")],N.prototype,"ariaAnnouncementService",2),u([b],N.prototype,"postConstruct",1),N=u([O("beans")],N);var _p=class extends N{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}onMouseEvent(e,t){if(!nt(t))switch(e){case"click":this.onCellClicked(t);break;case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t)}}onCellClicked(e){if(this.isDoubleClickOnIPad())return this.onCellDoubleClicked(e),void e.preventDefault();const{eventService:t,rangeService:i,gridOptionsService:s}=this.beans;i&&(e.ctrlKey||e.metaKey)&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const r=this.cellCtrl.createEvent(e,p.EVENT_CELL_CLICKED);t.dispatchEvent(r);const n=this.column.getColDef();n.onCellClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{n.onCellClicked(r)})},0),(s.get("singleClickEdit")||n.singleClickEdit)&&!s.get("suppressClickEdit")&&(!e.shiftKey||0==i?.getCellRanges().length)&&this.cellCtrl.
1startRowOrCellEdit()}isDoubleClickOnIPad(){if(!At()||zr("dblclick"))return!1;const e=(new Date).getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const t=this.column.getColDef(),i=this.cellCtrl.createEvent(e,p.EVENT_CELL_DOUBLE_CLICKED);this.beans.eventService.dispatchEvent(i),"function"==typeof t.onCellDoubleClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{t.onCellDoubleClicked(i)})},0),!this.beans.gridOptionsService.get("singleClickEdit")&&!this.beans.gridOptionsService.get("suppressClickEdit")&&this.cellCtrl.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:s}=e,o=e.target,{cellCtrl:r,beans:n}=this,{eventService:l,rangeService:a,focusService:c}=n;if(this.isRightClickInExistingRange(e))return;const h=a&&0!=a.getCellRanges().length;if(!s||!h){const g=ft()&&!r.isEditing()&&!vn(o);r.focusCell(g)}if(s&&h&&!c.isCellFocused(r.getCellPosition())){e.preventDefault();const g=c.getFocusedCell();if(g){const{column:m,rowIndex:C,rowPinned:v}=g,E=n.rowRenderer.getRowByPosition({rowIndex:C,rowPinned:v}),S=E?.getCellCtrl(m);S?.isEditing()&&S.stopEditing(),c.setFocusedCell({column:m,rowIndex:C,rowPinned:v,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(o)){if(a){const g=this.cellCtrl.getCellPosition();s?a.extendLatestRangeToCell(g):a.setRangeToCell(g,t||i)}l.dispatchEvent(this.cellCtrl.createEvent(e,p.EVENT_CELL_MOUSE_DOWN))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const i=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),s=2===e.button||e.ctrlKey&&this.beans.gridOptionsService.get("allowContextMenuWithControlKey");if(i&&s)return!0}return!1}containsWidget(e){return Zt(e,"ag-selection-checkbox",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,p.EVENT_CELL_MOUSE_OUT);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,p.EVENT_CELL_MOUSE_OVER);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),s=t.contains(e.relatedTarget);return i&&s}destroy(){}},xp=class extends T{constructor(e,t,i,s,o){super(),this.cellCtrl=e,this.beans=t,this.rowNode=s,this.rowCtrl=o}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case w.ENTER:this.onEnterKeyDown(e);break;case w.F2:this.onF2KeyDown(e);break;case w.ESCAPE:this.onEscapeKeyDown(e);break;case w.TAB:this.onTabKeyDown(e);break;case w.BACKSPACE:case w.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case w.DOWN:case w.UP:case w.RIGHT:case w.LEFT:this.onNavigationKeyDown(e,t)}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){const{cellCtrl:i,beans:s,rowNode:o}=this,{gridOptionsService:r,rangeService:n,eventService:l}=s;i.isEditing()||(l.dispatchEvent({type:p.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),Ka(e,r.get("enableCellEditingOnBackspace"))?n&&r.get("enableRangeSelection")?n.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"}):i.isCellEditable()&&o.setDataValue(i.getColumn(),null,"cellClear"):i.startRowOrCellEdit(e,t),l.dispatchEvent({type:p.EVENT_KEY_SHORTCUT_CHANGED_CELL_END}))}onEnterKeyDown(e){this.cellCtrl.isEditing()||this.rowCtrl.isEditing()?this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey):this.beans.gridOptionsService.get("enterNavigatesVertically")?this.beans.navigationService.navigateToNextCell(null,e.shiftKey?w.UP:w.DOW
1N,this.cellCtrl.getCellPosition(),!1):(this.cellCtrl.startRowOrCellEdit(w.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault())}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(w.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const s=e.key;" "===s?this.onSpaceKeyDown(e):(this.cellCtrl.startRowOrCellEdit(s,e),e.preventDefault())}onSpaceKeyDown(e){const{gridOptionsService:t}=this.beans;if(!this.cellCtrl.isEditing()&&t.isRowSelection()){const i=this.rowNode.isSelected(),s=!i;if(s||!t.get("suppressRowDeselection")){const o=this.beans.gridOptionsService.get("groupSelectsFiltered"),r=this.rowNode.setSelectedParams({newValue:s,rangeSelect:e.shiftKey,groupSelectsFiltered:o,event:e,source:"spaceKey"});void 0===i&&0===r&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:o,event:e,source:"spaceKey"})}}e.preventDefault()}destroy(){super.destroy()}},Ld=class extends k{constructor(e,t,i){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=e,this.column=t,this.eCell=i}postConstruct(){this.getGui().appendChild(oe("rowDrag",this.gridOptionsService,null)),this.addGuiEventListener("mousedown",t=>{t.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0),t?t(this.gridOptionsService.addGridCommonParams({rowNode:this.rowNode,dragEvent:e})):(()=>{try{const s=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",s),e.dataTransfer.setData("text/plain",s)}catch{}})()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}};u([b],Ld.prototype,"postConstruct",1);var ir=class{static getHeaderClassesFromColDef(e,t,i,s){return G(e)?[]:this.getColumnClassesFromCollDef(e.headerClass,e,t,i,s)}static getToolPanelClassesFromColDef(e,t,i,s){return G(e)?[]:this.getColumnClassesFromCollDef(e.toolPanelClass,e,t,i,s)}static refreshFirstAndLastStyles(e,t,i){e.addOrRemoveCssClass("ag-column-first",i.isColumnAtEdge(t,"first")),e.addOrRemoveCssClass("ag-column-last",i.isColumnAtEdge(t,"last"))}static getClassParams(e,t,i,s){return t.addGridCommonParams({colDef:e,column:i,columnGroup:s})}static getColumnClassesFromCollDef(e,t,i,s,o){if(G(e))return[];let r;return r="function"==typeof e?e(this.getClassParams(t,i,s,o)):e,"string"==typeof r?[r]:Array.isArray(r)?[...r]:[]}},qp=0,_d=class Sl extends T{constructor(t,i,s,o){super(),this.cellRangeFeature=null,this.cellPositionFeature=null,this.cellCustomStyleFeature=null,this.tooltipFeature=null,this.cellMouseListenerFeature=null,this.cellKeyboardListenerFeature=null,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.column=t,this.rowNode=i,this.beans=s,this.rowCtrl=o,this.instanceId=t.getId()+"-"+qp++,this.colIdSanitised=pe(this.column.getId()),s.gridOptionsService.get("suppressCellFocus")||(this.tabIndex=-1),this.createCellPosition(),this.addFeatures(),this.updateAndFormatValue(!1)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}addFeatures(){this.cellPositionFeature=new Ip(this,this.beans),this.addDestroyFunc(()=>{var i;null==(i=this.cellPositionFeature)||i.destroy(),this.cellPositionFeature=null}),this.cellCustomStyleFeature=new Lp(this,this.beans),this.addDestroyFunc(()=>{var i;null==(i=this.cellCustomStyleFeature)||i.destroy(),this.cellCustomStyleFeature=null}),this.cellMouseListenerFeature=new _p(this,this.beans,this.column),this.addDestroyFunc(()=>{var i;null==(i=this.cellMouseListenerFeature)||i.destroy(),this.cellMouseListenerFeature=null}),this.cellKeyboardListenerFeature=new xp(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc(()=>{var i;null==(i=this.cellKeyboardListenerFeature)||i.destroy(),this.cellKeyboardListenerFeature=null}),this.column.isTooltipEnabled()&&(this.enableTooltipFeature(),this.addDestroyFunc(()=>{this.disableTooltipFeature()})),this.beans.rangeService&&this.beans.gridOptionsService.get("enableRangeSelection")&&(this.cellRangeFeature=new Mp(this.beans,this),this.addDestroyFunc(()=>{var i;null==(i=this.cellRangeFeature)||i.destroy(),this.cellRangeFeature=null}))}enableTooltipFeature(t,i){const o="whenTruncated"===this.beans.gridOptionsService.get("tooltipShowMode");!i&&o&&!this.isCellRenderer()&&(i=()=>{const n=this.getGui(),l=0===n.children.length?n:n.querySelector(".ag-cell-value");return!l||l.scrollWidth>l.clientWidth}
1),this.tooltipFeature=new Ft({getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:null!=t?()=>t:()=>{const n=this.column.getColDef(),l=this.rowNode.data;if(n.tooltipField&&R(l))return Li(l,n.tooltipField,this.column.isTooltipFieldContainsDots());const a=n.tooltipValueGetter;return a?a(this.beans.gridOptionsService.addGridCommonParams({location:"cell",colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted})):null},getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:i},this.beans)}disableTooltipFeature(){this.tooltipFeature&&(this.tooltipFeature.destroy(),this.tooltipFeature=null)}setComp(t,i,s,o,r){var n,l,a,c;this.cellComp=t,this.eGui=i,this.printLayout=o,this.addDomData(),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(s),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),null==(n=this.cellPositionFeature)||n.setComp(i),null==(l=this.cellCustomStyleFeature)||l.setComp(t),null==(a=this.tooltipFeature)||a.refreshToolTip(),null==(c=this.cellKeyboardListenerFeature)||c.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(t,i),r&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach(h=>h()),this.onCellCompAttachedFuncs=[])}setupAutoHeight(t){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!t)return;const i=t.parentElement,s=this.beans.gridOptionsService.getRowHeightForNode(this.rowNode).height,o=l=>{if(this.editing||!this.isAlive())return;const{paddingTop:a,paddingBottom:c,borderBottomWidth:h,borderTopWidth:g}=Vt(i),v=t.offsetHeight+(a+c+h+g);if(l<5){const S=this.beans.gridOptionsService.getDocument();if(!S||!S.contains(t)||0==v)return void window.setTimeout(()=>o(l+1),0)}const E=Math.max(v,s);this.rowNode.setRowAutoHeight(E,this.column)},r=()=>o(0);r();const n=this.beans.resizeObserverService.observeResize(t,r);this.addDestroyFunc(()=>{n(),this.rowNode.setRowAutoHeight(void 0,this.column)})}getCellAriaRole(){var t;return null!=(t=this.column.getColDef().cellAriaRole)?t:"gridcell"}getInstanceId(){return this.instanceId}getIncludeSelection(){return this.includeSelection}getIncludeRowDrag(){return this.includeRowDrag}getIncludeDndSource(){return this.includeDndSource}getColumnIdSanitised(){return this.colIdSanitised}getTabIndex(){return this.tabIndex}isCellRenderer(){const t=this.column.getColDef();return null!=t.cellRenderer||null!=t.cellRendererSelector}getValueToDisplay(){return null!=this.valueFormatted?this.valueFormatted:this.value}showValue(t=!1){const i=this.getValueToDisplay();let s;if(this.isCellRenderer()){const o=this.createCellRendererParams();s=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),o)}this.cellComp.setRenderDetails(s,i,t),this.refreshHandle()}setupControlComps(){const t=this.column.getColDef();this.includeSelection=this.isIncludeControl(t.checkboxSelection),this.includeRowDrag=this.isIncludeControl(t.rowDrag),this.includeDndSource=this.isIncludeControl(t.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gridOptionsService.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(t){return null==this.rowNode.rowPinned&&("function"==typeof t||!0===t)}refreshShouldDestroy(){const t=this.column.getColDef(),i=this.includeSelection!=this.isIncludeControl(t.checkboxSelection),s=this.includeRowDrag!=this.isIncludeControl(t.rowDrag),o=this.includeDndSource!=this.isIncludeControl(t.dndSource);return i||s||o}startEditing(t=null,i=!1,s=null){if(!this.isCellEditable()||this.editing)return;if(!this.cellComp)return void this.onCellCompAttachedFuncs.push(()=>{this.startEditing(t,i,s)});const o=this.createCellEditorParams(t,i),r=this.column.getColDef(),n=this.beans.userComponentFactory.getCellEditorDetails(r,o);
1this.editCompDetails=n;const l=null!=n?.popupFromSelector?n.popupFromSelector:!!r.cellEditorPopup,a=null!=n?.popupPositionFromSelector?n.popupPositionFromSelector:r.cellEditorPopupPosition;this.setEditing(!0),this.cellComp.setEditDetails(n,l,a,this.beans.gridOptionsService.get("reactiveCustomComponents"));const c=this.createEvent(s,p.EVENT_CELL_EDITING_STARTED);this.beans.eventService.dispatchEvent(c)}setEditing(t){this.editing!==t&&(this.editing=t,this.refreshHandle())}stopRowOrCellEdit(t=!1){"fullRow"===this.beans.gridOptionsService.get("editType")?this.rowCtrl.stopEditing(t):this.stopEditing(t)}onPopupEditorClosed(){this.isEditing()&&this.stopEditingAndFocus()}takeValueFromCellEditor(t){const i={newValueExists:!1};if(t)return i;const s=this.cellComp.getCellEditor();return!s||s.isCancelAfterEnd&&s.isCancelAfterEnd()?i:{newValue:s.getValue(),newValueExists:!0}}saveNewValue(t,i){if(i===t)return!1;this.suppressRefreshCell=!0;const s=this.rowNode.setDataValue(this.column,i,"edit");return this.suppressRefreshCell=!1,s}stopEditing(t=!1){if(!this.editing)return!1;const{newValue:i,newValueExists:s}=this.takeValueFromCellEditor(t),o=this.rowNode.getValueFromValueService(this.column);let r=!1;return s&&(r=this.saveNewValue(o,i)),this.setEditing(!1),this.cellComp.setEditDetails(),this.editCompDetails=void 0,this.updateAndFormatValue(!1),this.refreshCell({forceRefresh:!0,suppressFlash:!0}),this.dispatchEditingStoppedEvent(o,i,!t&&!!r),r}dispatchEditingStoppedEvent(t,i,s){const o=ie(L({},this.createEvent(null,p.EVENT_CELL_EDITING_STOPPED)),{oldValue:t,newValue:i,valueChanged:s});this.beans.eventService.dispatchEvent(o)}createCellEditorParams(t,i){return this.beans.gridOptionsService.addGridCommonParams({value:this.rowNode.getValueFromValueService(this.column),eventKey:t,column:this.column,colDef:this.column.getColDef(),rowIndex:this.getCellPosition().rowIndex,node:this.rowNode,data:this.rowNode.data,cellStartedEdit:i,onKeyDown:this.onKeyDown.bind(this),stopEditing:this.stopEditingAndFocus.bind(this),eGridCell:this.getGui(),parseValue:this.parseValue.bind(this),formatValue:this.formatValue.bind(this)})}createCellRendererParams(){return this.beans.gridOptionsService.addGridCommonParams({value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.rowNode.getValueFromValueService(this.column),setValue:i=>this.beans.valueService.setValue(this.rowNode,this.column,i),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,rowIndex:this.getCellPosition().rowIndex,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(i,s,o,r)=>this.registerRowDragger(i,s,r),setTooltip:(i,s)=>{this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(i,s),this.refreshToolTip()}})}parseValue(t){return this.beans.valueParserService.parseValue(this.column,this.rowNode,t,this.getValue())}setFocusOutOnEditor(){if(!this.editing)return;const t=this.cellComp.getCellEditor();t&&t.focusOut&&t.focusOut()}setFocusInOnEditor(){if(!this.editing)return;const t=this.cellComp.getCellEditor();t&&t.focusIn?t.focusIn():this.focusCell(!0)}onCellChanged(t){t.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(t){var i;this.refreshShouldDestroy()?null==(i=this.rowCtrl)||i.refreshCell(this):this.refreshCell(t)}refreshCell(t){var i,s,o;if(this.suppressRefreshCell||this.editing)return;const r=this.column.getColDef(),n=null!=t&&!!t.newData,l=null!=t&&!!t.suppressFlash||!!r.suppressCellFlash,c=t&&t.forceRefresh||null==r.field&&null==r.valueGetter&&null==r.showRowGroup||n,h=!!this.cellComp,g=this.updateAndFormatValue(h);if(h){if(c||g){this.showValue(n);const C=this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();!l&&!C&&(this.beans.gridOptionsService.get("enableCellChangeFlash")||r.enableCellChangeFlash)&&this.flashCell(),null==(i=this.cellCustomStyleFeature)||i.applyUserStyles(),null==(s=this.cellCustomStyleFeature)||s.applyClassesFromColDef()}this.refreshToolTip(),null==(o=this.cellCustomStyleFeature)||o.applyCellClassRules()}}stopEditingAndFocus(t=!1,i=!1){this.stopRowOrCellEdit(),this.focusCell(!0),t||this.navigateAfterEdit(i)}navigateAfterEdit(t){this.beans.gridOptionsService.get("enterNavigatesVerticallyAfterEdit")&&this.beans.navigationService.navigateToNextCell(null,t?w.UP:w.DOW
1N,this.getCellPosition(),!1)}flashCell(t){var i,s;const o=null!=(i=t?.flashDuration)?i:t?.flashDelay,r=null!=(s=t?.fadeDuration)?s:t?.fadeDelay;this.animateCell("data-changed",o,r)}animateCell(t,i,s){if(!this.cellComp)return;const o=`ag-cell-${t}`,r=`ag-cell-${t}-animation`,{gridOptionsService:n}=this.beans;i||(i=n.get("cellFlashDuration")),R(s)||(s=n.get("cellFadeDuration")),this.cellComp.addOrRemoveCssClass(o,!0),this.cellComp.addOrRemoveCssClass(r,!1),this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(o,!1),this.cellComp.addOrRemoveCssClass(r,!0),this.eGui.style.transition=`background-color ${s}ms`,window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(r,!1),this.eGui.style.transition="")},s))},i)})}onFlashCells(t){if(!this.cellComp)return;const i=this.beans.cellPositionUtils.createId(this.getCellPosition());t.cells[i]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(t){var i;return null!=(i=this.callValueFormatter(t))?i:t}callValueFormatter(t){return this.beans.valueFormatterService.formatValue(this.column,this.rowNode,t)}updateAndFormatValue(t){const i=this.value,s=this.valueFormatted;return this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value),!t||!this.valuesAreEqual(i,this.value)||this.valueFormatted!=s}valuesAreEqual(t,i){const s=this.column.getColDef();return s.equals?s.equals(t,i):t===i}getComp(){return this.cellComp}getValue(){return this.value}getValueFormatted(){return this.valueFormatted}addDomData(){const t=this.getGui();this.beans.gridOptionsService.setDomData(t,Sl.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc(()=>this.beans.gridOptionsService.setDomData(t,Sl.DOM_DATA_KEY_CELL_CTRL,null))}createEvent(t,i){return this.beans.gridOptionsService.addGridCommonParams({type:i,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),rowPinned:this.rowNode.rowPinned,event:t,rowIndex:this.rowNode.rowIndex})}processCharacter(t){var i;null==(i=this.cellKeyboardListenerFeature)||i.processCharacter(t)}onKeyDown(t){var i;null==(i=this.cellKeyboardListenerFeature)||i.onKeyDown(t)}onMouseEvent(t,i){var s;null==(s=this.cellMouseListenerFeature)||s.onMouseEvent(t,i)}getGui(){return this.eGui}refreshToolTip(){var t;null==(t=this.tooltipFeature)||t.refreshToolTip()}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){var t;this.cellComp&&(null==(t=this.cellPositionFeature)||t.onLeftChanged())}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:t,column:i,beans:s}=this;ir.refreshFirstAndLastStyles(t,i,s.columnModel)}refreshAriaColIndex(){const t=this.beans.columnModel.getAriaColumnIndex(this.column);Jr(this.getGui(),t)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){var t;return null==(t=this.cellPositionFeature)?void 0:t.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}getBeans(){return this.beans}isPrintLayout(){return this.printLayout}appendChild(t){this.eGui.appendChild(t)}refreshHandle(){this.cellRangeFeature&&this.cellRangeFeature.refreshHandle()}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(t,i=null){this.cellComp?"fullRow"===this.beans.gridOptionsService.get("editType")?this.rowCtrl.startRowEditing(t,this):this.startEditing(t,!0,i):this.onCellCompAttachedFuncs.push(()=>{this.startRowOrCellEdit(t,i)})}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onRangeSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}isRangeSelectionEnabled(){return null!=this.cellRangeFeature}focusCell(t=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:t})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}onFirstRightPinnedChanged(){if(!this.cellComp)return;const t=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass("ag-cell-first-right-pinned",t)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const t=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass("ag-cell-last-left-pinned",t)}onCellFocused(t){if(this.beans.gridOptionsService.get("suppressCellFocus"))return;const i=this.beans.focusService.isCellFocused(this.cellPosition);
1if(!this.cellComp)return void(i&&t?.forceBrowserFocus&&(this.focusEventToRestore=t));this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass("ag-cell-focus",i),i&&t&&t.forceBrowserFocus&&this.cellComp.getFocusableElement().focus({preventScroll:!!t.preventScrollOnBrowserFocus});const s="fullRow"===this.beans.gridOptionsService.get("editType");!i&&!s&&this.editing&&this.stopRowOrCellEdit(),i&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:ht(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass("ag-cell",!0),this.cellComp.addOrRemoveCssClass("ag-cell-not-inline-editing",!0);const t=1==this.column.isAutoHeight();this.cellComp.addOrRemoveCssClass("ag-cell-auto-height",t),this.cellComp.addOrRemoveCssClass("ag-cell-normal-height",!t)}onColumnHover(){if(!this.cellComp||!this.beans.gridOptionsService.get("columnHoverHighlight"))return;const t=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass("ag-column-hover",t)}onColDefChanged(){var t;if(this.cellComp)if(this.column.isAutoHeight()!==this.isAutoHeight&&(null==(t=this.rowCtrl)||t.refreshCell(this)),this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editing){const o=this.getCellEditor();if(o?.refresh){const{eventKey:r,cellStartedEdit:n}=this.editCompDetails.params,l=this.createCellEditorParams(r,n),a=this.column.getColDef(),c=this.beans.userComponentFactory.getCellEditorDetails(a,l);o.refresh(c.params)}}else this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0})}setWrapText(){const t=1==this.column.getColDef().wrapText;this.cellComp.addOrRemoveCssClass("ag-cell-wrap-text",t)}dispatchCellContextMenuEvent(t){const i=this.column.getColDef(),s=this.createEvent(t,p.EVENT_CELL_CONTEXT_MENU);this.beans.eventService.dispatchEvent(s),i.onCellContextMenu&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{i.onCellContextMenu(s)})},0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const t=new Zo;return this.beans.context.createBean(t),t.init({rowNode:this.rowNode,column:this.column}),t}createDndSource(){const t=new Ld(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(t),t}registerRowDragger(t,i,s){if(this.customRowDragComp)return void this.customRowDragComp.setDragElement(t,i);const o=this.createRowDragComp(t,i,s);o&&(this.customRowDragComp=o,this.addDestroyFunc(()=>{this.beans.context.destroyBean(o),this.customRowDragComp=null}))}createRowDragComp(t,i,s){const o=this.beans.gridOptionsService.get("pagination"),r=this.beans.gridOptionsService.get("rowDragManaged"),n=this.beans.gridOptionsService.isRowModelType("clientSide");if(r){if(!n)return void x("managed row dragging is only allowed in the Client Side Row Model");if(o)return void x("managed row dragging is not possible when doing pagination")}const l=new oi(()=>this.value,this.rowNode,this.column,t,i,s);return this.beans.context.createBean(l),l}};_d.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var ai=_d,Yp=0,xd=class El extends T{constructor(t,i,s,o,r){super(),this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.businessKeySanitised=null,this.beans=i,this.gridOptionsService=i.gridOptionsService,this.rowNode=t,this.paginationPage=i.paginationProxy.getCurrentPage(),this.useAnimationFrameForCreate=o,this.printLayout=r,this.suppressRowTransform=this.gridOptionsService.get("suppressRowTransform"),this.instanceId=t.id+"-"+Yp++,this.rowId=pe(t.id),this.initRowBusinessKey(),this.rowFocused=i.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=i.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.setAnimateFlags(s),this.rowStyles=this.processStylesFromGridOptions(),this.isFullWidth()&&!this.gridOptionsService.get("suppressCellFocus")&&(this.tabIndex=-1),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gridOptionsService.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if("function"!=typeof this.businessKeyForNodeFunc)return;const t=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=pe(t)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}getTabIndex(){return this.tabIndex}isSticky(){return this.rowNode.sticky}getBeans(){return this.beans}getInstanceId(){return this.instanceId}
1setComp(t,i,s){const o={rowComp:t,element:i,containerType:s};this.allRowGuis.push(o),"left"===s?this.leftGui=o:"right"===s?this.rightGui=o:"fullWidth"===s?this.fullWidthGui=o:this.centerGui=o,this.initialiseRowComp(o),"FullWidthLoading"!==this.rowType&&!this.rowNode.rowPinned&&this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(t){switch(this.allRowGuis=this.allRowGuis.filter(i=>i.containerType!==t),t){case"left":this.leftGui=void 0;break;case"right":this.rightGui=void 0;break;case"fullWidth":this.fullWidthGui=void 0;break;case"center":this.centerGui=void 0}}isCacheable(){return"FullWidthDetail"===this.rowType&&this.gridOptionsService.get("keepDetailRows")}setCached(t){const i=t?"none":"";this.allRowGuis.forEach(s=>s.element.style.display=i)}initialiseRowComp(t){const i=this.gridOptionsService;this.listenOnDomOrder(t),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(t),this.updateRowIndexes(t),this.setFocusedClasses(t),this.setStylesFromGridOptions(!1,t),i.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(t),this.updateColumnLists(!this.useAnimationFrameForCreate);const s=t.rowComp;this.getInitialRowClasses(t.containerType).forEach(r=>s.addOrRemoveCssClass(r,!0)),this.executeSlideAndFadeAnimations(t),this.rowNode.group&&Pt(t.element,1==this.rowNode.expanded),this.setRowCompRowId(s),this.setRowCompRowBusinessKey(s),i.setDomData(t.element,El.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc(()=>i.setDomData(t.element,El.DOM_DATA_KEY_ROW_CTRL,null)),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,t.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(t.element),this.isFullWidth()&&this.setupFullWidth(t),i.get("rowDragEntireRow")&&this.addRowDraggerToRow(t),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask(()=>{this.isAlive()&&t.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(t){null!=this.businessKeySanitised&&t.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(t){this.rowId=pe(this.rowNode.id),null!=this.rowId&&t.setRowId(this.rowId)}executeSlideAndFadeAnimations(t){const{containerType:i}=t;this.slideInAnimation[i]&&(xr(()=>{this.onTopChanged()}),this.slideInAnimation[i]=!1),this.fadeInAnimation[i]&&(xr(()=>{t.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[i]=!1)}addRowDraggerToRow(t){if(this.gridOptionsService.get("enableRangeSelection"))return void x("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `enableRangeSelection: true`");const i=this.beans.localeService.getLocaleTextFunc(),s=new oi(()=>`1 ${i("rowDragRow","row")}`,this.rowNode,void 0,t.element,void 0,!0),o=this.createBean(s,this.beans.context);this.rowDragComps.push(o)}setupFullWidth(t){const i=this.getPinnedForContainer(t.containerType);if("FullWidthDetail"==this.rowType&&!Y.__assertRegistered("@ag-grid-enterprise/master-detail","cell renderer 'agDetailCellRenderer' (for master detail)",this.beans.context.getGridId()))return;const s=this.createFullWidthCompDetails(t.element,i);t.rowComp.showFullWidth(s)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){var t,i;return this.gridOptionsService.get("embedFullWidthRows")?this.allRowGuis.map(s=>{var o;return null==(o=s?.rowComp)?void 0:o.getFullWidthCellRenderer()}):[null==(i=null==(t=this.fullWidthGui)?void 0:t.rowComp)?void 0:i.getFullWidthCellRenderer()]}getCellElement(t){const i=this.getCellCtrl(t);return i?i.getGui():null}executeProcessRowPostCreateFunc(){const t=this.gridOptionsService.getCallback("processRowPostCreate");t&&this.areAllContainersReady()&&t({eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)})}areAllContainersReady(){const t=!!this.leftGui||!this.beans.columnModel.isPinningLeft(),i=!!this.centerGui,s=!!this.rightGui||!this.beans.columnModel.isPinningRight();return t&&i&&s}setRowType(){const t=this.rowNode.stub,i=this.rowNode.isFullWidthCell(),s=this.gridOptionsService.get("masterDetail")&&this.rowNode.detail,o=this.beans.columnModel.isPivotMode(),n=!!this.rowNode.group&&!this.rowNode.footer&&this.gridOptionsService.isGroupUseEntireRow(o);this.rowType=t?"FullWidthLoading":s?"FullWidthDetail":i?"FullWidth":n?"FullWidthGroup":"Normal"}updateColumnLists(t=!1,i=!1){this.isFullWidth()||(t||this.gridOptionsService.get("suppressAnimationFrame")||this.printLayout?this.updateColumnListsImpl(i):this.updateColumnListsPending||(this.beans.animationFrameService.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0))}createCellCtrls(t,i,s=null){const o={list:[],map:{}},r=(n,l)=>{o.list.push(l),o.map[n]=l};
1return i.forEach(n=>{const l=n.getInstanceId();let a=t.map[l];a||(a=new ai(n,this.rowNode,this.beans,this)),r(l,a)}),t.list.forEach(n=>{null==o.map[n.getColumn().getInstanceId()]&&(this.isCellEligibleToBeRemoved(n,s)?n.destroy():r(n.getColumn().getInstanceId(),n))}),o}updateColumnListsImpl(t){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(t)}setCellCtrls(t){this.allRowGuis.forEach(i=>{const s=this.getCellCtrlsForContainer(i.containerType);i.rowComp.setCellCtrls(s,t)})}getCellCtrlsForContainer(t){switch(t){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list;default:throw new Error(`Unhandled case: ${t}`)}}createAllCellCtrls(){const t=this.beans.columnModel;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,t.getAllDisplayedColumns()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const i=t.getViewportCenterColumnsForRow(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,i);const s=t.getDisplayedLeftColumnsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,s,"left");const o=t.getDisplayedRightColumnsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,o,"right")}}isCellEligibleToBeRemoved(t,i){if(t.getColumn().getPinned()!=i)return!0;const n=t.isEditing(),l=this.beans.focusService.isCellFocused(t.getCellPosition());if(n||l){const c=t.getColumn();return!(this.beans.columnModel.getAllDisplayedColumns().indexOf(c)>=0)}return!0}getDomOrder(){return this.gridOptionsService.get("ensureDomOrder")||this.gridOptionsService.isDomLayout("print")}listenOnDomOrder(t){const i=()=>{t.rowComp.setDomOrder(this.getDomOrder())};this.addManagedPropertyListener("domLayout",i),this.addManagedPropertyListener("ensureDomOrder",i)}setAnimateFlags(t){if(this.isSticky()||!t)return;const i=R(this.rowNode.oldRowTop),s=this.beans.columnModel.isPinningLeft(),o=this.beans.columnModel.isPinningRight();if(i){if(this.isFullWidth()&&!this.gridOptionsService.get("embedFullWidthRows"))return void(this.slideInAnimation.fullWidth=!0);this.slideInAnimation.center=!0,this.slideInAnimation.left=s,this.slideInAnimation.right=o}else{if(this.isFullWidth()&&!this.gridOptionsService.get("embedFullWidthRows"))return void(this.fadeInAnimation.fullWidth=!0);this.fadeInAnimation.center=!0,this.fadeInAnimation.left=s,this.fadeInAnimation.right=o}}isEditing(){return this.editingRow}isFullWidth(){return"Normal"!==this.rowType}getRowType(){return this.rowType}refreshFullWidth(){const t=(l,a)=>!l||l.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(l.element,a).params),i=t(this.fullWidthGui,null),s=t(this.centerGui,null),o=t(this.leftGui,"left"),r=t(this.rightGui,"right");return i&&s&&o&&r}addListeners(){this.addManagedListener(this.rowNode,B.EVENT_HEIGHT_CHANGED,()=>this.onRowHeightChanged()),this.addManagedListener(this.rowNode,B.EVENT_ROW_SELECTED,()=>this.onRowSelected()),this.addManagedListener(this.rowNode,B.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,B.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,B.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,B.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.rowNode.detail&&this.addManagedListener(this.rowNode.parent,B.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,B.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,B.EVENT_CELL_CHANGED,this.postProcessCss.bind(this)),this.addManagedListener(this.rowNode,B.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,B.EVENT_DRAGGING_CHANGED,this.postProcessRowDragging.bind(this)),this.addManagedListener(this.rowNode,B.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));const t=this.beans.eventService;this.addManagedListener(t,p.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOff
1setChanged.bind(this)),this.addManagedListener(t,p.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(t,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(t,p.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(t,p.EVENT_CELL_FOCUSED,this.onCellFocusChanged.bind(this)),this.addManagedListener(t,p.EVENT_CELL_FOCUS_CLEARED,this.onCellFocusChanged.bind(this)),this.addManagedListener(t,p.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(t,p.EVENT_MODEL_UPDATED,this.refreshFirstAndLastRowStyles.bind(this)),this.addManagedListener(t,p.EVENT_COLUMN_MOVED,this.updateColumnLists.bind(this)),this.addDestroyFunc(()=>{this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature,this.beans.context))}),this.addManagedPropertyListeners(["rowDragEntireRow"],()=>{this.gridOptionsService.get("rowDragEntireRow")?this.allRowGuis.forEach(s=>{this.addRowDraggerToRow(s)}):(this.destroyBeans(this.rowDragComps,this.beans.context),this.rowDragComps=[])}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListener(this.rowNode,B.EVENT_ROW_INDEX_CHANGED,()=>{this.getAllCellCtrls().forEach(t=>t.onRowIndexChanged())}),this.addManagedListener(this.rowNode,B.EVENT_CELL_CHANGED,t=>{this.getAllCellCtrls().forEach(i=>i.onCellChanged(t))})}onRowNodeDataChanged(t){this.isFullWidth()===!!this.rowNode.isFullWidthCell()?this.isFullWidth()?this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode):(this.getAllCellCtrls().forEach(s=>s.refreshCell({suppressFlash:!t.update,newData:!t.update})),this.allRowGuis.forEach(s=>{this.setRowCompRowId(s.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(s.rowComp)}),this.onRowSelected(),this.postProcessCss()):this.beans.rowRenderer.redrawRow(this.rowNode)}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const t=this.rowNode.highlighted;this.allRowGuis.forEach(i=>{const o=1===t;i.rowComp.addOrRemoveCssClass("ag-row-highlight-above",0===t),i.rowComp.addOrRemoveCssClass("ag-row-highlight-below",o)})}postProcessRowDragging(){const t=this.rowNode.dragging;this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass("ag-row-dragging",t))}updateExpandedCss(){const t=this.rowNode.isExpandable(),i=1==this.rowNode.expanded;this.allRowGuis.forEach(s=>{s.rowComp.addOrRemoveCssClass("ag-row-group",t),s.rowComp.addOrRemoveCssClass("ag-row-group-expanded",t&&i),s.rowComp.addOrRemoveCssClass("ag-row-group-contracted",t&&!i),Pt(s.element,t&&i)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:ht(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(t){const i=this.allRowGuis.find(a=>a.element.contains(t.target));if((i?i.element:null)!==t.target)return;const r=this.rowNode,n=this.beans.focusService.getFocusedCell();this.beans.navigationService.navigateToNextCell(t,t.key,{rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:n&&n.column},!0),t.preventDefault()}onTabKeyDown(t){if(t.defaultPrevented||nt(t))return;const i=this.allRowGuis.find(n=>n.element.contains(t.target)),s=i?i.element:null,o=s===t.target;let r=null;o||(r=this.beans.focusService.findNextFocusableElement(s,!1,t.shiftKey)),(this.isFullWidth()&&o||!r)&&this.beans.navigationService.onTabKeyDown(this,t)}onFullWidthRowFocused(t){var i;const s=this.rowNode,o=!!t&&this.isFullWidth()&&t.rowIndex===s.rowIndex&&t.rowPinned==s.rowPinned,r=this.fullWidthGui?this.fullWidthGui.element:null==(i=this.centerGui)?void 0:i.element;r&&(r.classList.toggle("ag-full-width-focus",o),o&&r.focus({preventScroll:!0}))}refreshCell(t){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,t),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,t),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,t),this.updateColumnLists()}removeCellCtrl(t,i){const s={list:[],map:{}};return t.list.forEach(o=>{o!==i&&(s.list.push(o),s.map[o.getInstanceId()]=o)}),s}onMouseEvent(t,i){switch(t){case"dblclick":this.onRowDblClick(i);break;case"click":this.onRowClick(i);break;case"touchstart":case"mousedown":this.onRowMouseDown(i)}}createRowEvent(t,i){return this.gridOptionsService.addGridCommonParams({type:t,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,event:i})}createRowEventWithSource(t,i){const s=this.createRowEvent(t,i);return s.source=this,s}onRowDblClick(t){if(nt(t))return;const i=this.createRowEventWithSource(p.EVENT_ROW_DOUBLE_CLICKED,t);this.beans.eventService.dispatchEvent(i)}onRowMouseDown(t){if(this.lastMouseDownOnDragger=Zt(t.target,"ag-row-drag",3),!this.isFullWidth())return;const i=this.rowNode,s=this.beans.columnModel;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges(),this.beans.focusService.setFocusedCell({rowIndex:i.rowIndex,column:s.getAllDisplayedColumns()[0],rowPinned:i.rowPinned,forceBrowserFocus:!0})}onRowClick(t){if(nt(t)||this.lastMouseDownOnDragger)return;const s=this.createRowEventWithSource(p.EVENT_ROW_CLICKED,t);this.beans.eventService.dispatchEvent(s);const o=t.ctrlKey||t.metaKey,r=t.shiftKey;if(this.gridOptionsService.get("groupSelectsChildren")&&this.rowNode.group||this.isRowSelectionBlocked()||this.gridOptionsService.get("suppressRowClickSelection"))return;const l=this.gridOptionsService.get("rowMultiSelectWithClick"),a=!this.gridOptionsService.get("suppressRowDeselection"),c="rowClicked";this.rowNode.isSelected()?l?this.rowNode.setSelectedParams({newValue:!1,event:t,source:c}):o?a&&this.rowNode.setSelectedParams({newValue:!1,event:t,source:c}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!r,rangeSelect:r,event:t,source:c}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!l&&!o,rangeSelect:r,event:t,source:c})}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!this.gridOptionsService.isRowSelection()}setupDetailRowAutoHeight(t){if("FullWidthDetail"!==this.rowType||!this.gridOptionsService.get("detailRowAutoHeight"))return;const i=()=>{const o=t.clientHeight;null!=o&&o>0&&window.setTimeout(()=>{this.rowNode.setRowHeight(o),this.beans.clientSideRowModel?this.beans.clientSideRowModel.onRowHeightChanged():this.beans.serverSideRowModel&&this.beans.serverSideRowModel.onRowHeightChanged()},0)},s=this.beans.resizeObserverService.observeResize(t,i);this.addDestroyFunc(s),i()}
1createFullWidthCompDetails(t,i){const s=this.gridOptionsService.addGridCommonParams({fullWidth:!0,data:this.rowNode.data,node:this.rowNode,value:this.rowNode.key,valueFormatted:this.rowNode.key,rowIndex:this.rowNode.rowIndex,eGridCell:t,eParentOfValue:t,pinned:i,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(o,r,n,l)=>this.addFullWidthRowDragging(o,r,n,l),setTooltip:(o,r)=>this.refreshRowTooltip(o,r)});switch(this.rowType){case"FullWidthDetail":return this.beans.userComponentFactory.getFullWidthDetailCellRendererDetails(s);case"FullWidthGroup":return this.beans.userComponentFactory.getFullWidthGroupCellRendererDetails(s);case"FullWidthLoading":return this.beans.userComponentFactory.getFullWidthLoadingCellRendererDetails(s);default:return this.beans.userComponentFactory.getFullWidthCellRendererDetails(s)}}refreshRowTooltip(t,i){if(!this.fullWidthGui)return;const s={getGui:()=>this.fullWidthGui.element,getTooltipValue:()=>t,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:i};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new Ft(s,this.beans))}addFullWidthRowDragging(t,i,s="",o){if(!this.isFullWidth())return;const r=new oi(()=>s,this.rowNode,void 0,t,i,o);this.createBean(r,this.beans.context),this.addDestroyFunc(()=>{this.destroyBean(r,this.beans.context)})}onUiLevelChanged(){const t=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=t){const i="ag-row-level-"+t,s="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(o=>{o.rowComp.addOrRemoveCssClass(i,!0),o.rowComp.addOrRemoveCssClass(s,!1)})}this.rowLevel=t}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageLastRow()}refreshFirstAndLastRowStyles(){const t=this.isFirstRowOnPage(),i=this.isLastRowOnPage();this.firstRowOnPage!==t&&(this.firstRowOnPage=t,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-first",t))),this.lastRowOnPage!==i&&(this.lastRowOnPage=i,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-last",i)))}stopEditing(t=!1){if(this.stoppingRowEdit)return;const i=this.getAllCellCtrls(),s=this.editingRow;this.stoppingRowEdit=!0;let o=!1;for(const r of i){const n=r.stopEditing(t);s&&!t&&!o&&n&&(o=!0)}if(o){const r=this.createRowEvent(p.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(r)}s&&this.setEditingRow(!1),this.stoppingRowEdit=!1}setInlineEditingCss(t){this.allRowGuis.forEach(i=>{i.rowComp.addOrRemoveCssClass("ag-row-inline-editing",t),i.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!t)})}setEditingRow(t){this.editingRow=t,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-editing",t));const i=this.createRowEvent(t?p.EVENT_ROW_EDITING_STARTED:p.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(i)}startRowEditing(t=null,i=null,s=null){this.editingRow||this.getAllCellCtrls().reduce((r,n)=>{const l=n===i;return n.startEditing(l?t:null,l,s),!!r||n.isEditing()},!1)&&this.setEditingRow(!0)}getAllCellCtrls(){return 0===this.leftCellCtrls.list.length&&0===this.rightCellCtrls.list.length?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const t=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);!t||!t.length||t.forEach(i=>{this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass(i,!0))})}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,t=>{this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass(t,!0))},t=>{this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass(t,!1))})}setStylesFromGridOptions(t,i){t&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(i,s=>s.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(t){return"left"===t?"left":"right"===t?"right":null}getInitialRowClasses(t){const i=this.getPinnedForContainer(t),s={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[t],rowIsEven:this.rowNode.rowIndex%2==0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:i};return this.beans.rowCssClassCalculator.getInitialRowClasses(s)}processStylesFromGridOptions(){const t=this.gridOptionsService.get("rowStyle");if(t&&"function"==typeof t)return void console.warn("AG Grid: rowStyle should be an object of
1key/value styles, not be a function, use getRowStyle() instead");const i=this.gridOptionsService.getCallback("getRowStyle");let s;return i&&(s=i({data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex})),s||t?Object.assign({},t,s):this.emptyStyle}onRowSelected(t){const i=this.beans.gridOptionsService.getDocument(),s=!!this.rowNode.isSelected();this.forEachGui(t,o=>{o.rowComp.addOrRemoveCssClass("ag-row-selected",s),Ni(o.element,s),o.element.contains(i.activeElement)&&(o===this.centerGui||o===this.fullWidthGui)&&this.announceDescription()})}announceDescription(){if(this.isRowSelectionBlocked())return;const t=this.rowNode.isSelected();if(t&&this.beans.gridOptionsService.get("suppressRowDeselection"))return;const s=this.beans.localeService.getLocaleTextFunc()(t?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${t?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(s)}isUseAnimationFrameForCreate(){return this.useAnimationFrameForCreate}addHoverFunctionality(t){this.active&&(this.addManagedListener(t,"mouseenter",()=>this.rowNode.onMouseEnter()),this.addManagedListener(t,"mouseleave",()=>this.rowNode.onMouseLeave()),this.addManagedListener(this.rowNode,B.EVENT_MOUSE_ENTER,()=>{!this.beans.dragService.isDragging()&&!this.gridOptionsService.get("suppressRowHoverHighlight")&&(t.classList.add("ag-row-hover"),this.rowNode.setHovered(!0))}),this.addManagedListener(this.rowNode,B.EVENT_MOUSE_LEAVE,()=>{t.classList.remove("ag-row-hover"),this.rowNode.setHovered(!1)}))}roundRowTopToBounds(t){const i=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),s=this.applyPaginationOffset(i.top,!0)-100,o=this.applyPaginationOffset(i.bottom,!0)+100;return Math.min(Math.max(s,t),o)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(t,i){t?i(t):this.allRowGuis.forEach(i)}onRowHeightChanged(t){if(null==this.rowNode.rowHeight)return;const i=this.rowNode.rowHeight,s=this.beans.environment.getDefaultRowHeight(),r=this.gridOptionsService.isGetRowHeightFunction()?this.gridOptionsService.getRowHeightForNode(this.rowNode).height:void 0,n=r?Math.min(s,r)-2+"px":void 0;this.forEachGui(t,l=>{l.element.style.height=`${i}px`,n&&l.element.style.setProperty("--ag-line-height",n)})}addEventListener(t,i){super.addEventListener(t,i)}removeEventListener(t,i){super.removeEventListener(t,i)}destroyFirstPass(t=!1){if(this.active=!1,!t&&this.gridOptionsService.isAnimateRows()&&!this.isSticky())if(null!=this.rowNode.rowTop){const o=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(o)}else this.allRowGuis.forEach(o=>o.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0));this.rowNode.setHovered(!1);const i=this.createRowEvent(p.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(i),this.beans.eventService.dispatchEvent(i),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const t=i=>(i.list.forEach(s=>s.destroy()),{list:[],map:{}});this.centerCellCtrls=t(this.centerCellCtrls),this.leftCellCtrls=t(this.leftCellCtrls),this.rightCellCtrls=t(this.rightCellCtrls)}setFocusedClasses(t){this.forEachGui(t,i=>{i.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),i.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){const t=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);t!==this.rowFocused&&(this.rowFocused=t,this.setFocusedClasses()),!t&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){const t=this.beans.paginationProxy.getCurrentPage();this.paginationPage!==t&&(this.paginationPage=t,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(t,i=!1){return this.rowNode.isRowPinned()||this.rowNode.sticky?t:t+this.beans.paginationProxy.getPixelOffset()*(i?1:-1)}setRowTop(t){if(!this.printLayout&&R(t)){const i=this.applyPaginationOffset(t),r=`${this.rowNode.isRowPinned()||this.rowNode.sticky?i:this.beans.rowContainerHeightService.getRealPixelPosition(i)}px`;this.setRowTopStyle(r)}}getInitialRowTop(t){return this.suppressRowTransform?this.getInitialRowTopShared(t):void 0}getInitialTransform(t){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(t)})`}getInitialRowTopShared(t){if(this.printLayout)return"";let i;if(this.isSticky())i=this.rowNode.stickyRowTop;else{const s=this.slideInAnimation[t]?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop,o=this.applyPaginationOffset(s);i=this.rowNode.isRowPinned()?o:this.beans.rowContainerHeightService.getRealPixelPosition(o)}return i+"px"}setRowTopStyle(t){this.allRowGuis.forEach(i=>
1this.suppressRowTransform?i.rowComp.setTop(t):i.rowComp.setTransform(`translateY(${t})`))}getRowNode(){return this.rowNode}getCellCtrl(t){let i=null;return this.getAllCellCtrls().forEach(s=>{s.getColumn()==t&&(i=s)}),null!=i||this.getAllCellCtrls().forEach(s=>{s.getColSpanningList().indexOf(t)>=0&&(i=s)}),i}onRowIndexChanged(){null!=this.rowNode.rowIndex&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(t){const i=this.rowNode.getRowIndexString(),s=this.beans.headerNavigationService.getHeaderRowCount()+this.beans.filterManager.getHeaderRowCount(),o=this.rowNode.rowIndex%2==0,r=s+this.rowNode.rowIndex+1;this.forEachGui(t,n=>{n.rowComp.setRowIndex(i),n.rowComp.addOrRemoveCssClass("ag-row-even",o),n.rowComp.addOrRemoveCssClass("ag-row-odd",!o),Zr(n.element,r)})}};xd.DOM_DATA_KEY_ROW_CTRL="renderedRow";var di=xd,ke=class extends T{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedListener(this.element,e,t)}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",zr("touchstart")?"touchstart":"mousedown"].forEach(i=>{const s=this.processMouseEvent.bind(this,i);this.addManagedListener(this.element,i,s)})}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||nt(t))return;const i=this.getRowForEvent(t),s=this.mouseEventService.getRenderedCellForEvent(t);"contextmenu"===e?this.handleContextMenuMouseEvent(t,void 0,i,s):(s&&s.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!At())return;const e=new we(this.element);this.addManagedListener(e,we.EVENT_LONG_TAP,i=>{const s=this.getRowForEvent(i.touchEvent),o=this.mouseEventService.getRenderedCellForEvent(i.touchEvent);this.handleContextMenuMouseEvent(void 0,i.touchEvent,s,o)}),this.addDestroyFunc(()=>e.destroy())}getRowForEvent(e){let t=e.target;for(;t;){const i=this.gridOptionsService.getDomData(t,di.DOM_DATA_KEY_ROW_CTRL);if(i)return i;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,i,s){const o=i?i.getRowNode():null,r=s?s.getColumn():null;let n=null;r&&(s.dispatchCellContextMenuEvent((e||t)??null),n=this.valueService.getValue(r,o));const l=this.ctrlsService.getGridBodyCtrl(),a=s?s.getGui():l.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:o,column:r,value:n,anchorToElement:a})}getControlsForEventTarget(e){return{cellCtrl:Fo(this.gridOptionsService,e,ai.DOM_DATA_KEY_CELL_CTRL),rowCtrl:Fo(this.gridOptionsService,e,di.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:s}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):s&&s.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,e,t))}processCellKeyboardEvent(e,t,i){const s=e.getRowNode(),o=e.getColumn(),r=e.isEditing();if(!zo(this.gridOptionsService,i,s,o,r)&&"keydown"===t&&(!r&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),Uo(i)&&e.processCharacter(i)),"keydown"===t){const l=e.createEvent(i,p.EVENT_CELL_KEY_DOWN);this.eventService.dispatchEvent(l)}}processFullWidthRowKeyboardEvent(e,t,i){const s=e.getRowNode(),o=this.focusService.getFocusedCell();if(!zo(this.gridOptionsService,i,s,o&&o.column,!1)&&"keydown"===t)switch(i.key){case w.PAGE_HOME:case w.PAGE_END:case w.PAGE_UP:case w.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case w.UP:case w.DOWN:e.onKeyboardNavigate(i);break;case w.TAB:e.onTabKeyDown(i)}if("keydown"===t){const l=e.createRowEvent(p.EVENT_CELL_KEY_DOWN,i);this.eventService.dispatchEvent(l)}}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey||t||!this.mouseEventService.isEventFromThisGrid(e))return;const i=za(e);return i===w.A?this.onCtrlAndA(e):i===w.C?this.onCtrlAndC(e):i===w.D?this.onCtrlAndD(e):i===w.V?this.onCtrlAndV(e):i===w.X?this.onCtrlAndX(e):i===w.Y?this.onCtrlAndY():i===w.Z?this.onCtrlAndZ(e):void 0}onCtrlAndA(e){const{pinnedRowModel:t,paginationProxy:i,rangeService:s}=this;if(s&&i.isRowsToRender()){const[o,r]=[t.isEmpty("top"),t.isEmpty("bottom")],n=o?null:"top";let l,a;r?(l=null,a=this.paginationProxy.getRowCount()-1):(l="bottom",a=t.getPinnedBottomRowData().length-1);const c=this.columnModel.getAllDisplayedColumns();if(Be(c))return;s.setCellRange({rowStartIndex:0,rowStartPinned:n,rowEndIndex:a,rowEndPinned:l,columnStart:c[0],columnEnd:K(c)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gridOptionsService.get("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t?.isEditing()||i?.isEditing()||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gridOptionsService.get("enableCellTextSelection")||this.gridOptionsService.get("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t?.isEditing()||i?.isEditing()||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t?.isEditing()||i?.isEditing()||this.clipboardService&&!this.gridOptionsService.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gridOptionsService.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){this.gridOptionsService.get("undoRedoCellEditing")&&(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService.redo("ui")}
1};u([f("mouseEventService")],ke.prototype,"mouseEventService",2),u([f("valueService")],ke.prototype,"valueService",2),u([f("menuService")],ke.prototype,"menuService",2),u([f("ctrlsService")],ke.prototype,"ctrlsService",2),u([f("navigationService")],ke.prototype,"navigationService",2),u([f("focusService")],ke.prototype,"focusService",2),u([f("undoRedoService")],ke.prototype,"undoRedoService",2),u([f("columnModel")],ke.prototype,"columnModel",2),u([f("paginationProxy")],ke.prototype,"paginationProxy",2),u([f("pinnedRowModel")],ke.prototype,"pinnedRowModel",2),u([z("rangeService")],ke.prototype,"rangeService",2),u([z("clipboardService")],ke.prototype,"clipboardService",2),u([b],ke.prototype,"postConstruct",1);var zi=class extends T{constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl(),this.listenForResize()}),this.addManagedListener(this.eventService,p.EVENT_SCROLLBAR_WIDTH_CHANGED,this.onScrollbarWidthChanged.bind(this)),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnModel.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const t=Jt(this.gridBodyCtrl.getBodyViewportElement());if(t<=50)return;let i=this.getPinnedColumnsOverflowingViewport(t-50);const s=this.gridOptionsService.getCallback("processUnpinnedColumns");i.length&&(s&&(i=s({columns:i,viewportWidth:t})),this.columnModel.setColumnsPinned(i,null,"viewportSizeFeature"))}getPinnedColumnsOverflowingViewport(e){const s=this.pinnedWidthService.getPinnedRightWidth()+this.pinnedWidthService.getPinnedLeftWidth();if(s<e)return[];const o=[...this.columnModel.getDisplayedLeftColumns()],r=[...this.columnModel.getDisplayedRightColumns()];let n=0,l=0;const c=[];let h=s-0-e;for(;(l<o.length||n<r.length)&&h>0;){if(n<r.length){const g=r[n++];h-=g.getActualWidth(),c.push(g)}if(l<o.length&&h>0){const g=o[l++];h-=g.getActualWidth(),c.push(g)}}return c}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const t=ys(this.gridBodyCtrl.getBodyViewportElement());this.bodyHeight!==t&&(this.bodyHeight=t,this.eventService.dispatchEvent({type:p.EVENT_BODY_HEIGHT_CHANGED}))}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnModel.setViewportPosition(e,t)}};u([f("ctrlsService")],zi.prototype,"ctrlsService",2),u([f("pinnedWidthService")],zi.prototype,"pinnedWidthService",2),u([f("columnModel")],zi.prototype,"columnModel",2),u([f("scrollVisibleService")],zi.prototype,"scrollVisibleService",2),u([b],zi.prototype,"postConstruct",1);var zn=class extends T{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,p.EVENT_LEFT_PINNED_WIDTH_CHANGED,this.onPinnedLeftWidthChanged.bind(this))}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth();U(this.element,e>0),Xe(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}};u([f("pinnedWidthService")],zn.prototype,"pinnedWidthService",2),u([b],zn.prototype,"postConstruct",1);var Kn=class extends T{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,p.EVENT_RIGHT_PINNED_WIDTH_CHANGED,this.onPinnedRightWidthChanged.bind(this))}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth();U(this.element,e>0),Xe(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}};u([f("pinnedWidthService")],Kn.prototype,"pinnedWidthService",2),u([b],Kn.prototype,"postConstruct",1);var sr=class extends T{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedListener(this.eventService,p.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onHeightChanged.bind(this))}onHeightChanged(){const e=this.maxDivHeightScaler.getUiContainerHeight(),t=null!=e?`${e}px`:"";this.eContainer.style.height=t,this.eViewport&&(this.eViewport.style.height=t)}};u([f("rowContainerHeightService")],sr.prototype,"maxDivHeightScaler",2),u([b],sr.prototype,"postConstruct",1);var or=class extends T{constructor(e){super(),this.eContainer=e}postConstruct(){G(this.rangeService)||(this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListener("enableRangeSelection",t=>
1{t.currentValue?this.enableFeature():this.disableFeature()}),this.addDestroyFunc(()=>this.disableFeature()),this.gridOptionsService.get("enableRangeSelection")&&this.enableFeature())}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}};u([z("rangeService")],or.prototype,"rangeService",2),u([f("dragService")],or.prototype,"dragService",2),u([b],or.prototype,"postConstruct",1);var Ki=class extends T{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedListener(this.eventService,p.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,p.EVENT_LEFT_PINNED_WIDTH_CHANGED,e),this.addSpacer&&(this.addManagedListener(this.eventService,p.EVENT_RIGHT_PINNED_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,p.EVENT_SCROLL_VISIBILITY_CHANGED,e),this.addManagedListener(this.eventService,p.EVENT_SCROLLBAR_WIDTH_CHANGED,e)),this.setWidth()}setWidth(){const{columnModel:e}=this,t=this.gridOptionsService.isDomLayout("print"),i=e.getBodyContainerWidth(),s=e.getDisplayedColumnsLeftWidth(),o=e.getDisplayedColumnsRightWidth();let r;t?r=i+s+o:(r=i,this.addSpacer&&0===(this.gridOptionsService.get("enableRtl")?s:o)&&this.scrollVisibleService.isVerticalScrollShowing()&&(r+=this.gridOptionsService.getScrollbarWidth())),this.callback(r)}};u([f("columnModel")],Ki.prototype,"columnModel",2),u([f("scrollVisibleService")],Ki.prototype,"scrollVisibleService",2),u([b],Ki.prototype,"postConstruct",1);var Zp=kt([["center","ag-center-cols-container"],["left","ag-pinned-left-cols-container"],["right","ag-pinned-right-cols-container"],["fullWidth","ag-full-width-container"],["topCenter","ag-floating-top-container"],["topLeft","ag-pinned-left-floating-top"],["topRight","ag-pinned-right-floating-top"],["topFullWidth","ag-floating-top-full-width-container"],["stickyTopCenter","ag-sticky-top-container"],["stickyTopLeft","ag-pinned-left-sticky-top"],["stickyTopRight","ag-pinned-right-sticky-top"],["stickyTopFullWidth","ag-sticky-top-full-width-container"],["bottomCenter","ag-floating-bottom-container"],["bottomLeft","ag-pinned-left-floating-bottom"],["bottomRight","ag-pinned-right-floating-bottom"],["bottomFullWidth","ag-floating-bottom-full-width-container"]]),Jp=kt([["center","ag-center-cols-viewport"],["topCenter","ag-floating-top-viewport"],["stickyTopCenter","ag-sticky-top-viewport"],["bottomCenter","ag-floating-bottom-viewport"]]),ui=class Au extends T{constructor(t){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=t,this.isFullWithContainer="topFullWidth"===this.name||"stickyTopFullWidth"===this.name||"bottomFullWidth"===this.name||"fullWidth"===this.name}static getRowContainerCssClasses(t){return{container:Zp.get(t),viewport:Jp.get(t)}}static getPinned(t){switch(t){case"bottomLeft":case"topLeft":case"stickyTopLeft":case"left":return"left";case"bottomRight":case"topRight":case"stickyTopRight":case"right":return"right";default:return null}}postConstruct(){this.enableRtl=this.gridOptionsService.get("enableRtl"),this.forContainers(["center"],()=>this.viewportSizeFeature=this.createManagedBean(new zi(this)))}registerWithCtrlsService(){switch(this.name){case"center":this.ctrlsService.registerCenterRowContainerCtrl(this);break;case"left":this.ctrlsService.registerLeftRowContainerCtrl(this);break;case"right":this.ctrlsService.registerRightRowContainerCtrl(this);break;case"topCenter":this.ctrlsService.registerTopCenterRowContainerCtrl(this);break;case"topLeft":this.ctrlsService.registerTopLeftRowContainerCon(this);break;case"topRight":this.ctrlsService.registerTopRightRowContainerCtrl(this);break;case"stickyTopCenter":this.ctrlsService.registerStickyTopCenterRowContainerCtrl(this);break;case"stickyTopLeft":this.ctrlsService.registerStickyTopLeftRowContainerCon(this);break;case"stickyTopRight":this.ctrlsService.registerStickyTopRightRowContainerCtrl(this);break;case"bottomCenter":this.ctrlsService.registerBottomCenterRowContainerCtrl(this);break;case"bottomLeft":this.ctrlsService.registerBottomLeftRowContainerCtrl(this);break;case"bottomRight":this.ctrlsService.registerBottomRightRowContainerCtrl(this)}}forContainers(t,i){t.indexOf(this.name)>=0&&i()}getContainerElement(){return this.eContainer}
1getViewportSizeFeature(){return this.viewportSizeFeature}setComp(t,i,s){this.comp=t,this.eContainer=i,this.eViewport=s,this.createManagedBean(new ke(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows();this.forContainers(["left","bottomLeft","topLeft","stickyTopLeft"],()=>{this.pinnedWidthFeature=this.createManagedBean(new zn(this.eContainer)),this.addManagedListener(this.eventService,p.EVENT_LEFT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(["right","bottomRight","topRight","stickyTopRight"],()=>{this.pinnedWidthFeature=this.createManagedBean(new Kn(this.eContainer)),this.addManagedListener(this.eventService,p.EVENT_RIGHT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(["center","left","right","fullWidth"],()=>this.createManagedBean(new sr(this.eContainer,"center"===this.name?s:void 0))),this.forContainers(["topCenter","topLeft","topRight","bottomCenter","bottomLeft","bottomRight","center","left","right","stickyTopCenter","stickyTopLeft","stickyTopRight"],()=>this.createManagedBean(new or(this.eContainer))),this.forContainers(["center","topCenter","stickyTopCenter","bottomCenter"],()=>this.createManagedBean(new Ki(C=>this.comp.setContainerWidth(`${C}px`)))),this.addListeners(),this.registerWithCtrlsService()}addListeners(){this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>this.onDisplayedColumnsChanged()),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>this.onDisplayedColumnsWidthChanged()),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_ROWS_CHANGED,t=>this.onDisplayedRowsChanged(t.afterScroll)),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if(["stickyTopCenter","stickyTopLeft","stickyTopRight","stickyTopFullWidth"].indexOf(this.name)>=0)return void this.comp.setDomOrder(!0);const s=()=>{const o=this.gridOptionsService.get("ensureDomOrder"),r=this.gridOptionsService.isDomLayout("print");this.comp.setDomOrder(o||r)};this.addManagedPropertyListener("domLayout",s),s()}stopHScrollOnPinnedRows(){this.forContainers(["topCenter","stickyTopCenter","bottomCenter"],()=>{this.addManagedListener(this.eViewport,"scroll",()=>this.eViewport.scrollLeft=0)})}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const t=i=>{this.dragService.isDragging()&&i.cancelable&&i.preventDefault()};this.eContainer.addEventListener("touchmove",t,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",t))}onHorizontalViewportChanged(t=!1){const i=this.getCenterWidth(),s=this.getCenterViewportScrollLeft();this.columnModel.setViewportPosition(i,s,t)}getCenterWidth(){return Jt(this.eViewport)}getCenterViewportScrollLeft(){return Ts(this.eViewport,this.enableRtl)}registerViewportResizeListener(t){const i=this.resizeObserverService.observeResize(this.eViewport,t);this.addDestroyFunc(()=>i())}isViewportInTheDOMTree(){return En(this.eViewport)}getViewportScrollLeft(){return Ts(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gridOptionsService.get("alwaysShowHorizontalScroll")||_a(this.eViewport)}getViewportElement(){return this.eViewport}setContainerTranslateX(t){this.eContainer.style.transform=`translateX(${t}px)`}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(t){bs(this.eViewport,t,this.enableRtl)}isContainerVisible(){return!Au.getPinned(this.name)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const t=this.isContainerVisible();this.visible!=t&&(this.visible=t,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(t=!1){if(!this.visible)return void this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});const i=this.gridOptionsService.isDomLayout("print"),o=this.gridOptionsService.get("embedFullWidthRows")||i,r=this.getRowCtrls().filter(n=>{const l=n.isFullWidth();return this.isFullWithContainer?!o&&l:o||!l});this.comp.setRowCtrls({rowCtrls:r,useFlushSync:t})}getRowCtrls(){switch(this.name){case"topCenter":case"topLeft":case"topRight":case"topFullWidth":return this.rowRenderer.getTopRowCtrls();case"stickyTopCenter":case"stickyTopLeft":case"stickyTopRight":case"stickyTopFullWidth":return this.rowRenderer.getStickyTopRowCtrls();case"bottomCenter":case"bottomLeft":case"bottomRight":case"bottomFullWidth":return this.rowRenderer.getBottomRowCtrls();default:return this.rowRenderer.getCentreRowCtrls()}}};u([f("dragService")],ui.prototype,"dragService",2),u([f("ctrlsService")],ui.prototype,"ctrlsService",2),u([f("columnModel")],ui.prototype,"columnModel",2),u([f("resizeObserverService")],ui.prototype,"resizeObserverService",2),u([f("rowRenderer")],ui.prototype,"rowRenderer",2),u([b],ui.prototype,"postConstruct",1);var Gd=ui,Ct=class extends k{constructor(){super('<div class="ag-root ag-unselectable" role="treegrid">\n <ag-header-root ref="gridHeader"></ag-header-root>\n <div class="ag-floating-top" ref="eTop" role="presentation">\n <ag-row-container ref="topLeftContainer" name="topLeft"></ag-row-container>\n <ag-row-container ref="topCenterContainer" name="topCenter"></ag-row-container>\n <ag-row-container ref="topRightContainer" name="top
1Right"></ag-row-container>\n <ag-row-container ref="topFullWidthContainer" name="topFullWidth"></ag-row-container>\n </div>\n <div class="ag-body" ref="eBody" role="presentation">\n <div class="ag-body-viewport" ref="eBodyViewport" role="presentation">\n <ag-row-container ref="leftContainer" name="left"></ag-row-container>\n <ag-row-container ref="centerContainer" name="center"></ag-row-container>\n <ag-row-container ref="rightContainer" name="right"></ag-row-container>\n <ag-row-container ref="fullWidthContainer" name="fullWidth"></ag-row-container>\n </div>\n <ag-fake-vertical-scroll></ag-fake-vertical-scroll>\n </div>\n <div class="ag-sticky-top" ref="eStickyTop" role="presentation">\n <ag-row-container ref="stickyTopLeftContainer" name="stickyTopLeft"></ag-row-container>\n <ag-row-container ref="stickyTopCenterContainer" name="stickyTopCenter"></ag-row-container>\n <ag-row-container ref="stickyTopRightContainer" name="stickyTopRight"></ag-row-container>\n <ag-row-container ref="stickyTopFullWidthContainer" name="stickyTopFullWidth"></ag-row-container>\n </div>\n <div class="ag-floating-bottom" ref="eBottom" role="presentation">\n <ag-row-container ref="bottomLeftContainer" name="bottomLeft"></ag-row-container>\n <ag-row-container ref="bottomCenterContainer" name="bottomCenter"></ag-row-container>\n <ag-row-container ref="bottomRightContainer" name="bottomRight"></ag-row-container>\n <ag-row-container ref="bottomFullWidthContainer" name="bottomFullWidth"></ag-row-container>\n </div>\n <ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>\n <ag-overlay-wrapper></ag-overlay-wrapper>\n </div>')}init(){const e=(i,s)=>{const o=`${i}px`;s.style.minHeight=o,s.style.height=o},t={setRowAnimationCssOnBodyViewport:(i,s)=>this.setRowAnimationCssOnBodyViewport(i,s),setColumnCount:i=>Ca(this.getGui(),i),setRowCount:i=>ma(this.getGui(),i),setTopHeight:i=>e(i,this.eTop),setBottomHeight:i=>e(i,this.eBottom),setTopDisplay:i=>this.eTop.style.display=i,setBottomDisplay:i=>this.eBottom.style.display=i,setStickyTopHeight:i=>this.eStickyTop.style.height=i,setStickyTopTop:i=>this.eStickyTop.style.top=i,setStickyTopWidth:i=>this.eStickyTop.style.width=i,setColumnMovingCss:(i,s)=>this.addOrRemoveCssClass(i,s),updateLayoutClasses:(i,s)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach(r=>{r.toggle("ag-layout-auto-height",s.autoHeight),r.toggle("ag-layout-normal",s.normal),r.toggle("ag-layout-print",s.print)}),this.addOrRemoveCssClass("ag-layout-auto-height",s.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",s.normal),this.addOrRemoveCssClass("ag-layout-print",s.print)},setAlwaysVerticalScrollClass:(i,s)=>this.eBodyViewport.classList.toggle(Id,s),registerBodyViewportResizeListener:i=>{const s=this.resizeObserverService.observeResize(this.eBodyViewport,i);this.addDestroyFunc(()=>s())},setPinnedTopBottomOverflowY:i=>this.eTop.style.overflowY=this.eBottom.style.overflowY=i,setCellSelectableCss:(i,s)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach(o=>o.classList.toggle(i,s))},setBodyViewportWidth:i=>this.eBodyViewport.style.width=i};
1this.ctrl=this.createManagedBean(new Oe),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop),(this.rangeService&&this.gridOptionsService.get("enableRangeSelection")||"multiple"===this.gridOptionsService.get("rowSelection"))&&fa(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle("ag-row-animation",t),i.toggle("ag-row-no-animation",!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}};u([f("resizeObserverService")],Ct.prototype,"resizeObserverService",2),u([z("rangeService")],Ct.prototype,"rangeService",2),u([A("eBodyViewport")],Ct.prototype,"eBodyViewport",2),u([A("eStickyTop")],Ct.prototype,"eStickyTop",2),u([A("eTop")],Ct.prototype,"eTop",2),u([A("eBottom")],Ct.prototype,"eBottom",2),u([A("gridHeader")],Ct.prototype,"headerRootComp",2),u([A("eBody")],Ct.prototype,"eBody",2),u([b],Ct.prototype,"init",1);var $i=class extends T{postConstruct(){this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this))}onDisplayedColumnsChanged(){this.update()}onDisplayedColumnsWidthChanged(){this.update()}update(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn(()=>{this.columnAnimationService.executeLaterVMTurn(()=>this.updateImpl())}):this.updateImpl()}updateImpl(){const e=this.ctrlsService.getCenterRowContainerCtrl();if(!e||this.columnAnimationService.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t)}setScrollsVisible(e){this.horizontalScrollShowing===e.horizontalScrollShowing&&this.verticalScrollShowing===e.verticalScrollShowing||(this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing,this.eventService.dispatchEvent({type:p.EVENT_SCROLL_VISIBILITY_CHANGED}))}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}};u([f("ctrlsService")],$i.prototype,"ctrlsService",2),u([f("columnAnimationService")],$i.prototype,"columnAnimationService",2),u([b],$i.prototype,"postConstruct",1),$i=u([O("scrollVisibleService")],$i);var It=class extends T{constructor(){super(...arguments),this.gridInstanceId=It.gridInstanceSequence.next()}stampTopLevelGridCompWithGridInstance(e){e[It.GRID_DOM_KEY]=this.gridInstanceId}getRenderedCellForEvent(e){return Fo(this.gridOptionsService,e.target,ai.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(e){return this.isElementInThisGrid(e.target)}isElementInThisGrid(e){let t=e;for(;t;){const i=t[It.GRID_DOM_KEY];if(R(i))return i===this.gridInstanceId;t=t.parentElement}return!1}getCellPositionForEvent(e){const t=this.getRenderedCellForEvent(e);return t?t.getCellPosition():null}getNormalisedPosition(e){const t=this.gridOptionsService.isDomLayout("normal");let s,o;if(null!=e.clientX||null!=e.clientY?(s=e.clientX,o=e.clientY):(s=e.x,o=e.y),t){const r=this.ctrlsService.getGridBodyCtrl(),n=r.getScrollFeature().getVScrollPosition();s+=r.getScrollFeature().getHScrollPosition().left,o+=n.top}return{x:s,y:o}}};It.gridInstanceSequence=new Bi,It.GRID_DOM_KEY="__ag_grid_instance",u([f("ctrlsService")],It.prototype,"ctrlsService",2),It=u([O("mouseEventService")],It);var ye=class extends T{constructor(){super(),this.onPageDown=Gr(this.onPageDown,100),this.onPageUp=Gr(this.onPageUp,100)}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const i=e.key,s=e.altKey,o=e.ctrlKey||e.metaKey,r=!!this.rangeService&&e.shiftKey,n=this.mouseEventService.getCellPositionForEvent(e);let l=!1;switch(i){case w.PAGE_HOME:case w.PAGE_END:!o&&!s&&(this.onHomeOrEndKey(i),l=!0);break;case w.LEFT:case w.RIGHT:case w.UP:case w.DOWN:if(!n)return!1;o&&!s&&!r&&(this.onCtrlUpDownLeftRight(i,n),l=!0);break;case w.PAGE_DOWN:case w.PAGE_UP:!o&&!s&&(l=this.handlePageUpDown(i,n,t))}return l&&e.preventDefault(),l}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),!!t&&(e===w.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0)}navigateTo(e){const{scrollIndex:t,scrollType:i,scrollColumn:s,focusIndex:o,focusColumn:r}=e;
1R(s)&&!s.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(s),R(t)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(t,i),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(o),this.focusService.setFocusedCell({rowIndex:o,column:r,rowPinned:null,forceBrowserFocus:!0}),this.rangeService&&this.rangeService.setRangeToCell({rowIndex:o,rowPinned:null,column:r})}onPageDown(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.getViewportHeight(),o=this.paginationProxy.getPixelOffset(),n=this.paginationProxy.getRowIndexAtPixel(i.top+s+o);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,n):this.navigateToNextPage(e,n)}onPageUp(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.paginationProxy.getPixelOffset(),r=this.paginationProxy.getRowIndexAtPixel(i.top+s);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,r,!0):this.navigateToNextPage(e,r,!0)}navigateToNextPage(e,t,i=!1){const s=this.getViewportHeight(),o=this.paginationProxy.getPageFirstRow(),r=this.paginationProxy.getPageLastRow(),n=this.paginationProxy.getPixelOffset(),l=this.paginationProxy.getRow(e.rowIndex),a=i?l?.rowHeight-s-n:s-n;let g,h=this.paginationProxy.getRowIndexAtPixel(l?.rowTop+a+n);h===e.rowIndex&&(t=h=e.rowIndex+(i?-1:1)),i?(g="bottom",h<o&&(h=o),t<o&&(t=o)):(g="top",h>r&&(h=r),t>r&&(t=r)),this.isRowTallerThanView(h)&&(t=h,g="top"),this.navigateTo({scrollIndex:t,scrollType:g,scrollColumn:null,focusIndex:h,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,i=!1){this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{const s=this.getNextFocusIndexForAutoHeight(e,i);this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:s,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){var i;const s=t?-1:1,o=this.getViewportHeight(),r=this.paginationProxy.getPageLastRow();let n=0,l=e.rowIndex;for(;l>=0&&l<=r;){const a=this.paginationProxy.getRow(l);if(a){const c=null!=(i=a.rowHeight)?i:0;if(n+c>o)break;n+=c}l+=s}return Math.max(0,Math.min(l,r))}getViewportHeight(){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.gridOptionsService.getScrollbarWidth();let s=t.bottom-t.top;return this.ctrlsService.getCenterRowContainerCtrl().isHorizontalScrollShowing()&&(s-=i),s}isRowTallerThanView(e){const t=this.paginationProxy.getRow(e);if(!t)return!1;const i=t.rowHeight;return"number"==typeof i&&i>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const i=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:s,column:o}=i;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:o,focusIndex:s,focusColumn:o})}onHomeOrEndKey(e){const t=e===w.PAGE_HOME,i=this.columnModel.getAllDisplayedColumns(),s=t?i[0]:K(i),o=t?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow();this.navigateTo({scrollIndex:o,scrollType:null,scrollColumn:s,focusIndex:o,focusColumn:s})}onTabKeyDown(e,t){const i=t.shiftKey;if(this.tabToNextCellCommon(e,i,t))t.preventDefault();else if(i){const{rowIndex:o,rowPinned:r}=e.getRowPosition();(r?0===o:o===this.paginationProxy.getPageFirstRow())&&(0===this.gridOptionsService.get("headerHeight")||this.gridOptionsService.get("suppressHeaderFocus")?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof ai&&e.focusCell(!0),this.focusService.focusNextGridCoreContainer(i)&&t.preventDefault()}tabToNextCell(e,t){const i=this.focusService.getFocusedCell();if(!i)return!1;let s=this.getCellByPosition(i);return!!(s||(s=this.rowRenderer.getRowByPosition(i),s&&s.isFullWidth()))&&this.tabToNextCellCommon(s,e,t)}tabToNextCellCommon(e,t,i){let o,s=e.isEditing();if(!s&&e instanceof ai){const n=e.getRowCtrl();n&&(s=n.isEditing())}return o=s?"fullRow"===this.gridOptionsService.get("editType")?this.moveToNextEditingRow(e,t,i):this.moveToNextEditingCell(e,t,i):this.moveToNext
1CellNotEditing(e,t),o||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,i=null){const s=e.getCellPosition();e.getGui().focus(),e.stopEditing();const o=this.findNextCellToFocusOn(s,t,!0);return null!=o&&(o.startEditing(null,!0,i),o.focusCell(!1),!0)}moveToNextEditingRow(e,t,i=null){const s=e.getCellPosition(),o=this.findNextCellToFocusOn(s,t,!0);if(null==o)return!1;const r=o.getCellPosition(),n=this.isCellEditable(s),l=this.isCellEditable(r),a=r&&s.rowIndex===r.rowIndex&&s.rowPinned===r.rowPinned;return n&&e.setFocusOutOnEditor(),a||(e.getRowCtrl().stopEditing(),o.getRowCtrl().startRowEditing(void 0,void 0,i)),l?(o.setFocusInOnEditor(),o.focusCell()):o.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const i=this.columnModel.getAllDisplayedColumns();let s;s=e instanceof di?ie(L({},e.getRowPosition()),{column:t?i[0]:K(i)}):e.getCellPosition();const o=this.findNextCellToFocusOn(s,t,!1);if(o instanceof ai)o.focusCell(!0);else if(o)return this.tryToFocusFullWidthRow(o.getRowPosition(),t);return R(o)}findNextCellToFocusOn(e,t,i){let s=e;for(;;){e!==s&&(e=s),t||(s=this.getLastCellOfColSpan(s)),s=this.cellNavigationService.getNextTabbedCell(s,t);const o=this.gridOptionsService.getCallback("tabToNextCell");if(R(o)){const a=o({backwards:t,editing:i,previousCellPosition:e,nextCellPosition:s||null});R(a)?(a.floating&&(x("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),a.rowPinned=a.floating),s={rowIndex:a.rowIndex,column:a.column,rowPinned:a.rowPinned}):s=null}if(!s)return null;if(s.rowIndex<0){const l=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l+s.rowIndex,column:s.column},fromCell:!0}),null}const r="fullRow"===this.gridOptionsService.get("editType");if(i&&!r&&!this.isCellEditable(s))continue;this.ensureCellVisible(s);const n=this.getCellByPosition(s);if(!n){const l=this.rowRenderer.getRowByPosition(s);if(!l||!l.isFullWidth()||i)continue;return l}if(!n.isSuppressNavigable())return this.rangeService&&this.rangeService.setRangeToCell(s),n}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return!!t&&e.column.isCellEditable(t)}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return"top"===e.rowPinned?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):"bottom"===e.rowPinned?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.paginationProxy.getRow(e.rowIndex)}navigateToNextCell(e,t,i,s){let o=i,r=!1;for(;o&&(o===i||!this.isValidNavigateCell(o));)this.gridOptionsService.get("enableRtl")?t===w.LEFT&&(o=this.getLastCellOfColSpan(o)):t===w.RIGHT&&(o=this.getLastCellOfColSpan(o)),o=this.cellNavigationService.getNextCellToFocus(t,o),r=G(o);if(r&&e&&e.key===w.UP&&(o={rowIndex:-1,rowPinned:null,column:i.column}),s){const l=this.gridOptionsService.getCallback("navigateToNextCell");if(R(l)){const c=l({key:t,previousCellPosition:i,nextCellPosition:o||null,event:e});R(c)?(c.floating&&(x("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),c.rowPinned=c.floating),o={rowPinned:c.rowPinned,rowIndex:c.rowIndex,column:c.column}):o=null}}if(!o)return;if(o.rowIndex<0){const l=this.headerNavigationService.getHeaderRowCount();return void this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l+o.rowIndex,column:i.column},event:e||void 0,fromCell:!0})}const n=this.getNormalisedPosition(o);n?this.focusPosition(n):this.tryToFocusFullWidthRow(o)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t=!1){const i=this.columnModel.getAllDisplayedColumns(),s=this.rowRenderer.getRowByPosition(e);if(!s||!s.isFullWidth())return!1;const o=this.focusService.getFocusedCell(),r={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?K(i):i[0])};this.focusPosition(r);const n=null!=o&&this.rowPositionUtils.before(r,o);return this.eventService.dispatchEvent({type:p.EVENT_FULL_WIDTH_ROW_FOCUSED,rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:r.column,isFullWidthCell:!0,floating:r.rowPinned,fromBelow:n}),!0}focusPosition(e){this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),this.rangeService&&this.rangeService.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;
1const i=t.getColSpanningList();return 1===i.length?e:{rowIndex:e.rowIndex,column:K(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=this.gridOptionsService.isGroupRowsSticky(),i=this.rowModel.getRow(e.rowIndex);!(t&&i?.sticky)&&G(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}};u([f("mouseEventService")],ye.prototype,"mouseEventService",2),u([f("paginationProxy")],ye.prototype,"paginationProxy",2),u([f("focusService")],ye.prototype,"focusService",2),u([z("rangeService")],ye.prototype,"rangeService",2),u([f("columnModel")],ye.prototype,"columnModel",2),u([f("rowModel")],ye.prototype,"rowModel",2),u([f("ctrlsService")],ye.prototype,"ctrlsService",2),u([f("rowRenderer")],ye.prototype,"rowRenderer",2),u([f("headerNavigationService")],ye.prototype,"headerNavigationService",2),u([f("rowPositionUtils")],ye.prototype,"rowPositionUtils",2),u([f("cellNavigationService")],ye.prototype,"cellNavigationService",2),u([f("pinnedRowModel")],ye.prototype,"pinnedRowModel",2),u([b],ye.prototype,"postConstruct",1),ye=u([O("navigationService")],ye);var $n=class Fu extends si{constructor(t){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=t}postConstruct(){this.gridOptionsService.setDomData(this.getGui(),Fu.DOM_KEY_POPUP_EDITOR_WRAPPER,!0),this.addKeyDownListener()}addKeyDownListener(){const t=this.getGui(),i=this.params;this.addManagedListener(t,"keydown",o=>{zo(this.gridOptionsService,o,i.node,i.column,!0)||i.onKeyDown(o)})}};$n.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper",u([b],$n.prototype,"postConstruct",1);var tg=$n,ig=class extends k{constructor(e,t,i,s,o){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=s,this.cellCtrl=t;const r=document.createElement("div");r.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(r);const n=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const l=(h,g)=>{null!=g&&""!=g?n.setAttribute(h,g):n.removeAttribute(h)};re(n,t.getCellAriaRole()),l("col-id",t.getColumnIdSanitised());const a=t.getTabIndex();void 0!==a&&l("tabindex",a.toString()),t.setComp({addOrRemoveCssClass:(h,g)=>this.addOrRemoveCssClass(h,g),setUserStyles:h=>Dn(n,h),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:h=>this.includeSelection=h,setIncludeRowDrag:h=>this.includeRowDrag=h,setIncludeDndSource:h=>this.includeDndSource=h,setRenderDetails:(h,g,m)=>this.setRenderDetails(h,g,m),setEditDetails:(h,g,m)=>this.setEditDetails(h,g,m),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()},this.getGui(),this.eCellWrapper,i,o)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=null==this.firstRender;const o=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!i&&!o&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t))}setEditDetails(e,t,i){e?this.createCellEditorInstance(e,t,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=t||this.forceWrapper,s=i&&null==this.eCellWrapper;if(s){const c=document.createElement("div");c.setAttribute("role","presentation"),c.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=c,this.getGui().appendChild(this.eCellWrapper)}const o=!i&&null!=this.eCellWrapper;o&&(at(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const r=!e&&i,n=r&&null==this.eCellValue;if(n){const c=document.createElement("span");c.setAttribute("role","presentation"),c.setAttribute("class","ag-cell-value"),this.eCellValue=c,this.eCellWrapper.appendChild(this.eCellValue)}const l=!r&&null!=this.eCellValue;l&&(at(this.eCellValue),this.eCellValue=void 0);const a=s||o||n||l;
1return a&&this.removeControls(),e||t&&this.addControls(),a}addControls(){this.includeRowDrag&&null==this.rowDraggingComp&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&null==this.dndSourceComp&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&null==this.checkboxSelectionComp&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,i){const s=this.editorVersion,o=e.newAgStackInstance();if(!o)return;const{params:r}=e;o.then(l=>this.afterCellEditorCreated(s,l,r,t,i)),G(this.cellEditor)&&r.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();ce(t);const i=null!=e?pe(e,!0):null;null!=i&&(t.textContent=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),at(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),at(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(null==this.cellRenderer||null==this.cellRenderer.refresh||this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return!0===t||void 0===t}createCellRendererInstance(e){const i=!this.beans.gridOptionsService.get("suppressAnimationFrame"),s=this.rendererVersion,{componentClass:o}=e,r=()=>{if(this.rendererVersion!==s||!this.isAlive())return;const l=e.newAgStackInstance(),a=this.afterCellRendererCreated.bind(this,s,o);l&&l.then(a)};i&&this.firstRender?this.beans.animationFrameService.createTask(r,this.rowNode.rowIndex,"createTasksP2"):r()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,i){if(this.isAlive()&&e===this.rendererVersion){if(this.cellRenderer=i,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),null!=this.cellRendererGui){const o=this.getParentOfValue();ce(o),o.appendChild(this.cellRendererGui)}}else this.beans.context.destroyBean(i)}afterCellEditorCreated(e,t,i,s,o){if(e!==this.editorVersion)return void this.beans.context.destroyBean(t);if(t.isCancelBeforeStart&&t.isCancelBeforeStart())return this.beans.context.destroyBean(t),void this.cellCtrl.stopEditing(!0);if(!t.getGui)return console.warn(`AG Grid: cellEditor for column ${this.column.getId()} is missing getGui() method`),void this.beans.context.destroyBean(t);this.cellEditor=t,this.cellEditorGui=t.getGui();const l=s||void 0!==t.isPopup&&t.isPopup();l?this.addPopupCellEditor(i,o):this.addInCellEditor(),this.refreshEditStyles(!0,l),t.afterGuiAttached&&t.afterGuiAttached()}refreshEditStyles(e,t){var i;this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),null==(i=this.rowCtrl)||i.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui(),t=this.beans.gridOptionsService.getDocument();e.contains(t.activeElement)&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){"fullRow"===this.beans.gridOptionsService.get("editType")&&console.warn("AG Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(new tg(e));const s=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&s.appendChild(this.cellEditorGui);const o=this.beans.popupService,r=this.beans.gridOptionsService.get("stopEditingWhenCellsLoseFocus"),n=t??(i.getPopupPosition?i.getPopupPosition():"over"),l=this.beans.gridOptionsService.get("enableRtl"),a={ePopup:s,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:n,alignSide:l?"right":"left",keepWithinBounds:!0},c=o.positionPopupByComponent.bind(o,a),h=this.beans.localeService.getLocaleTextFunc(),g=o.addPopup({modal:r,eChild:s,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:c,ariaLabel:h("ariaLabelCellEditor","Cell Editor")});g&&(this.hideEditorPopup=g.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}
1destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui(),t=this.beans.gridOptionsService.getDocument();e.contains(t.activeElement)&&hn()&&e.focus({preventScroll:!0}),ce(this.getParentOfValue())}},sg=class extends k{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const s=document.createElement("div");s.setAttribute("comp-id",`${this.getCompId()}`),s.setAttribute("style",this.getInitialStyle(i)),this.setTemplateFromElement(s);const o=this.getGui(),r=o.style;this.domOrder=this.rowCtrl.getDomOrder(),re(o,"row");const n=this.rowCtrl.getTabIndex();null!=n&&o.setAttribute("tabindex",n.toString()),e.setComp({setDomOrder:a=>this.domOrder=a,setCellCtrls:a=>this.setCellCtrls(a),showFullWidth:a=>this.showFullWidth(a),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(a,c)=>this.addOrRemoveCssClass(a,c),setUserStyles:a=>Dn(o,a),setTop:a=>r.top=a,setTransform:a=>r.transform=a,setRowIndex:a=>o.setAttribute("row-index",a),setRowId:a=>o.setAttribute("row-id",a),setRowBusinessKey:a=>o.setAttribute("row-business-key",a),refreshFullWidth:a=>this.refreshFullWidth(a)},this.getGui(),i),this.addDestroyFunc(()=>{e.unsetComp(i)})}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const i=e.newAgStackInstance();i&&i.then(s=>{if(this.isAlive()){const o=s.getGui();this.getGui().appendChild(o),this.rowCtrl.setupDetailRowAutoHeight(o),this.setFullWidthRowComp(s)}else this.beans.context.destroyBean(s)})}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach(s=>{const o=s.getInstanceId();null==this.cellComps[o]?this.newCellComp(s):t[o]=null});const i=Nt(t).filter(s=>null!=s);this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach(i=>{const s=this.cellComps[i.getInstanceId()];s&&t.push(s.getGui())}),Rn(this.getGui(),t)}newCellComp(e){const t=new ig(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.getInstanceId()]=t,this.getGui().appendChild(t.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=Nt(this.cellComps).filter(t=>null!=t);this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&console.error("AG Grid - should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)})}getFullWidthCellRenderer(){return this.fullWidthCellRenderer}destroyCells(e){e.forEach(t=>{if(!t)return;const i=t.getCtrl().getInstanceId();this.cellComps[i]===t&&(t.detach(),t.destroy(),this.cellComps[i]=null)})}refreshFullWidth(e){const{fullWidthCellRenderer:t}=this;if(!t||!t.refresh)return!1;const i=e();return t.refresh(i)}},qi=class extends k{constructor(){super(function og(){const e=k.elementGettingCreated.getAttribute("name"),t=Gd.getRowContainerCssClasses(e);let i;return i="center"===e||"topCenter"===e||"stickyTopCenter"===e||"bottomCenter"===e?`<div class="${t.viewport}" ref="eViewport" role="presentation">\n <div class="${t.container}" ref="eContainer"></div>\n </div>`:`<div class="${t.container}" ref="eContainer"></div>`,i}()),this.rowComps={},this.name=k.elementGettingCreated.getAttribute("name"),this.type=function Xp(e){switch(e){case"center":case"topCenter":case"stickyTopCenter":case"bottomCenter":return"center";case"left":case"topLeft":case"stickyTopLeft":case"bottomLeft":return"left";case"right":case"topRight":case"stickyTopRight":case"bottomRight":return"right";case"fullWidth":case"topFullWidth":case"stickyTopFullWidth":case"bottomFullWidth":return"fullWidth";default:throw Error("Invalid Row Container Type")}}(this.name)}postConstruct(){const e={setViewportHeight:i=>this.eViewport.style.height=i,setRowCtrls:({rowCtrls:i})=>this.setRowCtrls(i),setDomOrder:i=>{this.domOrder=i},setContainerWidth:i=>this.eContainer.style.width=i};this.createManagedBean(new Gd(this.name)).setComp(e,this.eContainer,this.eViewport)}preDestroy(){this.setRowCtrls([])}setRowCtrls(e){const t=L({},this.rowComps);this.rowComps={},this.lastPlacedElement=null,e.forEach(s=>{const o=s.getInstanceId(),r=t[o];if(r)this.rowComps[o]=r,delete t[o],this.ensureDomOrder(r.getGui());else{if(!s.getRowNode().displayed)return;const n=new sg(s,this.beans,this.type);this.rowComps[o]=n,this.appendRow(n.getGui())}}),Nt(t).forEach(s=>{this.eContainer.removeChild(s.getGui()),s.destroy()}),re(this.eContainer,"rowgroup")}appendRow(e){this.domOrder?La(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(yn(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}};u([f("beans")],qi.prototype,"beans",2),u([A("eViewport")],qi.prototype,"eViewport",2),u([A("eContainer")],qi.prototype,"eContainer",2),u([b],qi.prototype,"postConstruct",1),u([Ae],qi.prototype,"preDestroy",1);var qn=class{constructor(e){this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}onDragEnter(e){if(this.clearColumnsList(),this.gridOptionsService.get("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach(i=>
1{i.isPrimary()&&(i.isAnyFunctionActive()||(i.isAllowValue()?this.columnsToAggregate.push(i):i.isAllowRowGroup()?this.columnsToGroup.push(i):i.isAllowPivot()&&this.columnsToPivot.push(i)))})}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?V.ICON_PINNED:V.ICON_MOVE:null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.columnModel.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.columnModel.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.columnModel.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}};u([f("columnModel")],qn.prototype,"columnModel",2),u([f("gridOptionsService")],qn.prototype,"gridOptionsService",2);var ci=class{static attemptMoveColumns(e){const{isFromHeader:t,hDirection:i,xPosition:s,fromEnter:o,fakeEvent:r,pinned:n,gridOptionsService:l,columnModel:a}=e,c=0===i,h=1===i;let{allMovingColumns:g}=e;if(t){let F=[];g.forEach(M=>{var I;let _=null,j=M.getParent();for(;null!=j&&1===j.getDisplayedLeafColumns().length;)_=j,j=j.getParent();null!=_?(null!=(I=_.getColGroupDef())&&I.marryChildren?_.getProvidedColumnGroup().getLeafColumns():_.getLeafColumns()).forEach(He=>{F.includes(He)||F.push(He)}):F.includes(M)||F.push(M)}),g=F}const m=g.slice();a.sortColumnsLikeGridColumns(m);const C=this.calculateValidMoves({movingCols:m,draggingRight:h,xPosition:s,pinned:n,gridOptionsService:l,columnModel:a}),v=this.calculateOldIndex(m,a);if(0===C.length)return;const E=C[0];let S=null!==v&&!o;if(t&&(S=null!==v),S&&!r&&(c&&E>=v||h&&E<=v))return;const D=a.getAllDisplayedColumns();let y=[],P=null;for(let F=0;F<C.length;F++){const M=C[F],I=a.getProposedColumnOrder(m,M);if(!a.doesOrderPassRules(I))continue;const _=I.filter(de=>D.includes(de));if(null===P)P=_;else if(!pt(_,P))break;const j=this.groupFragCount(I);y.push({move:M,fragCount:j})}return 0!==y.length?(y.sort((F,M)=>F.fragCount-M.fragCount),this.moveColumns(g,y[0].move,"uiColumnMoved",!1,a)):void 0}static moveColumns(e,t,i,s,o){return o.moveColumns(e,t,i,s),s?null:{columns:e,toIndex:t}}static calculateOldIndex(e,t){const i=t.getAllGridColumns(),s=ql(e.map(a=>i.indexOf(a))),o=s[0];return K(s)-o!=s.length-1?null:o}static groupFragCount(e){function t(s){let o=[],r=s.getOriginalParent();for(;null!=r;)o.push(r),r=r.getOriginalParent();return o}let i=0;for(let s=0;s<e.length-1;
1s++){let o=t(e[s]),r=t(e[s+1]);[o,r]=o.length>r.length?[o,r]:[r,o],o.forEach(n=>{-1===r.indexOf(n)&&i++})}return i}static calculateValidMoves(e){const{movingCols:t,draggingRight:i,xPosition:s,pinned:o,gridOptionsService:r,columnModel:n}=e;if(r.get("suppressMovableColumns")||t.some(y=>y.getColDef().suppressMovable))return[];const a=n.getDisplayedColumns(o),c=n.getAllGridColumns(),h=a.filter(y=>Ue(t,y)),g=a.filter(y=>!Ue(t,y)),m=c.filter(y=>!Ue(t,y));let E,C=0,v=s;if(i){let y=0;h.forEach(P=>y+=P.getActualWidth()),v-=y}if(v>0){for(let y=0;y<g.length&&(v-=g[y].getActualWidth(),!(v<0));y++)C++;i&&C++}C>0?E=m.indexOf(g[C-1])+1:(E=m.indexOf(g[0]),-1===E&&(E=0));const S=[E],D=(y,P)=>y-P;if(i){let y=E+1;const P=c.length-1;for(;y<=P;)S.push(y),y++;S.sort(D)}else{let y=E;const P=c.length-1;let F=c[y];for(;y<=P&&a.indexOf(F)<0;)y++,S.push(y),F=c[y];y=E-1;const M=0;for(;y>=M;)S.push(y),y--;S.sort(D).reverse()}return S}static normaliseX(e,t,i,s,o){const r=o.getHeaderRowContainerCtrl(t).getViewport();return i&&(e-=r.getBoundingClientRect().left),s.get("enableRtl")&&(e=r.clientWidth-e),null==t&&(e+=o.getCenterRowContainerCtrl().getCenterViewportScrollLeft()),e}},Yi=class{constructor(e,t){this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.eContainer=t,this.centerContainer=!R(e)}init(){this.ctrlsService.whenReady(()=>{this.gridBodyCon=this.ctrlsService.getGridBodyCtrl()})}getIconName(){return this.pinned?V.ICON_PINNED:V.ICON_MOVE}onDragEnter(e){const t=e.dragItem.columns;if(0===e.dragSource.type)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const s=e.dragItem.visibleState,o=(t||[]).filter(r=>s[r.getId()]);this.setColumnsVisible(o,!0,"uiColumnDragged")}this.setColumnsPinned(t,this.pinned,"uiColumnDragged"),this.onDragging(e,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,i){if(e){const s=e.filter(o=>!o.getColDef().lockVisible);this.columnModel.setColumnsVisible(s,t,i)}}setColumnsPinned(e,t,i){if(e){const s=e.filter(o=>!o.getColDef().lockPinned);this.columnModel.setColumnsPinned(s,t,i)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}checkCenterForScrolling(e){if(this.centerContainer){const t=this.ctrlsService.getCenterRowContainerCtrl().getCenterViewportScrollLeft(),i=t+this.ctrlsService.getCenterRowContainerCtrl().getCenterWidth();this.gridOptionsService.get("enableRtl")?(this.needToMoveRight=e<t+50,this.needToMoveLeft=e>i-50):(this.needToMoveLeft=e<t+50,this.needToMoveRight=e>i-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(e=this.lastDraggingEvent,t=!1,i=!1,s=!1){var o;if(s){if(this.lastMovedInfo){const{columns:h,toIndex:g}=this.lastMovedInfo;ci.moveColumns(h,g,"uiColumnMoved",!0,this.columnModel)}return}if(this.lastDraggingEvent=e,G(e.hDirection))return;const r=ci.normaliseX(e.x,this.pinned,!1,this.gridOptionsService,this.ctrlsService);t||this.checkCenterForScrolling(r);const n=this.normaliseDirection(e.hDirection),l=e.dragSource.type,a=(null==(o=e.dragSource.getDragItem().columns)?void 0:o.filter(h=>!h.getColDef().lockPinned||h.getPinned()==this.pinned))||[],c=ci.attemptMoveColumns({allMovingColumns:a,isFromHeader:1===l,hDirection:n,xPosition:r,pinned:this.pinned,fromEnter:t,fakeEvent:i,gridOptionsService:this.gridOptionsService,columnModel:this.columnModel});c&&(this.lastMovedInfo=c)}normaliseDirection(e){if(!this.gridOptionsService.get("enableRtl"))return e;switch(e){case 0:return 1;case 1:return 0;default:console.error(`AG Grid: Unknown direction ${e}`)}}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.dragAndDropService.setGhostIcon(this.needToMoveLeft?V.ICON_LEFT:V.ICON_RIGHT,!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon(V.ICON_MOVE))}moveInterval(){let e;this.intervalCount++,e=10+5*this.intervalCount,e>100&&(e=100);let t=null;
1const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),0!==t)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const o=this.lastDraggingEvent.dragItem.columns.filter(r=>!r.getColDef().lockPinned);o.length>0&&(this.dragAndDropService.setGhostIcon(V.ICON_PINNED),this.failedMoveAttempts>7)&&(this.setColumnsPinned(o,this.needToMoveLeft?"left":"right","uiColumnDragged"),this.dragAndDropService.nudge())}}};u([f("columnModel")],Yi.prototype,"columnModel",2),u([f("dragAndDropService")],Yi.prototype,"dragAndDropService",2),u([f("gridOptionsService")],Yi.prototype,"gridOptionsService",2),u([f("ctrlsService")],Yi.prototype,"ctrlsService",2),u([b],Yi.prototype,"init",1);var ji=class extends T{constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady(e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.leftRowContainerCtrl.getContainerElement()],[e.bottomLeftRowContainerCtrl.getContainerElement()],[e.topLeftRowContainerCtrl.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.rightRowContainerCtrl.getContainerElement()],[e.bottomRightRowContainerCtrl.getContainerElement()],[e.topRightRowContainerCtrl.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.centerRowContainerCtrl.getViewportElement()],[e.bottomCenterRowContainerCtrl.getViewportElement()],[e.topCenterRowContainerCtrl.getViewportElement()]]}})}isInterestedIn(e){return 1===e||0===e&&this.gridOptionsService.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}init(){this.moveColumnFeature=this.createManagedBean(new Yi(this.pinned,this.eContainer)),this.bodyDropPivotTarget=this.createManagedBean(new qn(this.pinned)),this.dragAndDropService.addDropTarget(this)}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&0===e.dragSource.type}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}};u([f("dragAndDropService")],ji.prototype,"dragAndDropService",2),u([f("columnModel")],ji.prototype,"columnModel",2),u([f("ctrlsService")],ji.prototype,"ctrlsService",2),u([b],ji.prototype,"postConstruct",1),u([b],ji.prototype,"init",1);var Qi=class Ou extends Un{constructor(t){super(Ou.TEMPLATE,t),this.headerCompVersion=0,this.column=t.getColumnGroupChild(),this.pinned=t.getPinned()}postConstruct(){const t=this.getGui();var r,n;r="col-id",null!=(n=this.column.getColId())&&""!=n?t.setAttribute(r,n):t.removeAttribute(r);const s={setWidth:r=>t.style.width=r,addOrRemoveCssClass:(r,n)=>this.addOrRemoveCssClass(r,n),setAriaSort:r=>r?wa(t,r):Sa(t),setUserCompDetails:r=>this.setUserCompDetails(r),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(s,this.getGui(),this.eResize,this.eHeaderCompWrapper);const o=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",o)}destroyHeaderComp(){this.headerComp&&(this.eHeaderCompWrapper.removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(t){this.headerCompVersion++;const i=this.headerCompVersion;t.newAgStackInstance().then(s=>this.afterCompCreated(i,s))}afterCompCreated(t,i){t==this.headerCompVersion&&this.isAlive()?(this.destroyHeaderComp(),this.headerComp=i,this.headerCompGui=i.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())):this.destroyBean(i)}};Qi.TEMPLATE='<div class="ag-header-cell" role="columnheader">\n <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n <div ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>\n </div>',u([A("eResize")],Qi.prototype,"eResize",2),u([A("eHeaderCompWrapper")],Qi.prototype,"eHeaderCompWrapper",2),u([b],Qi.prototype,"postConstruct",1),u([Ae],Qi.prototype,"destroyHeaderComp",1);var rg=Qi,rr=class Mu extends Un{constructor(t){super(Mu.TEMPLATE,t)}postConstruct(){const t=this.getGui();
1t.setAttribute("col-id",this.ctrl.getColId()),this.ctrl.setComp({addOrRemoveCssClass:(o,r)=>this.addOrRemoveCssClass(o,r),setResizableDisplayed:o=>U(this.eResize,o),setWidth:o=>t.style.width=o,setAriaExpanded:o=>((o,r)=>null!=r?t.setAttribute(o,r):t.removeAttribute(o))("aria-expanded",o),setUserCompDetails:o=>this.setUserCompDetails(o),getUserCompInstance:()=>this.headerGroupComp},t,this.eResize)}setUserCompDetails(t){t.newAgStackInstance().then(i=>this.afterHeaderCompCreated(i))}afterHeaderCompCreated(t){const i=()=>this.destroyBean(t);if(!this.isAlive())return void i();const s=this.getGui(),o=t.getGui();s.appendChild(o),this.addDestroyFunc(i),this.headerGroupComp=t,this.ctrl.setDragSource(s)}};rr.TEMPLATE='<div class="ag-header-group-cell" role="columnheader">\n <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n </div>',u([A("eResize")],rr.prototype,"eResize",2),u([b],rr.prototype,"postConstruct",1);var ng=rr,Yn=class extends k{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}init(){Zr(this.getGui(),this.ctrl.getAriaRowIndex()),this.ctrl.setComp({setHeight:t=>this.getGui().style.height=t,setTop:t=>this.getGui().style.top=t,setHeaderCtrls:(t,i)=>this.setHeaderCtrls(t,i),setWidth:t=>this.getGui().style.width=t})}destroyHeaderCtrls(){this.setHeaderCtrls([],!1)}setHeaderCtrls(e,t){if(!this.isAlive())return;const i=this.headerComps;if(this.headerComps={},e.forEach(s=>{const o=s.getInstanceId();let r=i[o];delete i[o],null==r&&(r=this.createHeaderComp(s),this.getGui().appendChild(r.getGui())),this.headerComps[o]=r}),Se(i,(s,o)=>{this.getGui().removeChild(o.getGui()),this.destroyBean(o)}),t){const s=Nt(this.headerComps);s.sort((r,n)=>r.getCtrl().getColumnGroupChild().getLeft()-n.getCtrl().getColumnGroupChild().getLeft());const o=s.map(r=>r.getGui());Rn(this.getGui(),o)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case"group":t=new ng(e);break;case"filter":t=new mp(e);break;default:t=new rg(e)}return this.createBean(t),t.setParentComponent(this),t}};u([b],Yn.prototype,"init",1),u([Ae],Yn.prototype,"destroyHeaderCtrls",1);var ag=0,Lt=class Iu extends T{constructor(t,i,s){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=t,this.parentRowCtrl=s,this.beans=i,this.instanceId=t.getUniqueId()+"-"+ag++}postConstruct(){this.addManagedPropertyListeners(["suppressHeaderFocus"],()=>this.refreshTabIndex())}shouldStopEventPropagation(t){const{headerRowIndex:i,column:s}=this.focusService.getFocusedHeader();return Ua(this.gridOptionsService,t,i,s)}getWrapperHasFocus(){return this.gridOptionsService.getDocument().activeElement===this.eGui}setGui(t){this.eGui=t,this.addDomData(),this.addManagedListener(this.beans.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}onDisplayedColumnsChanged(){!this.comp||!this.column||(this.refreshFirstAndLastStyles(),this.refreshAriaColIndex())}refreshFirstAndLastStyles(){const{comp:t,column:i,beans:s}=this;ir.refreshFirstAndLastStyles(t,i,s.columnModel)}refreshAriaColIndex(){const{beans:t,column:i}=this,s=t.columnModel.getAriaColumnIndex(i);Jr(this.eGui,s)}addResizeAndMoveKeyboardListeners(){this.resizeFeature&&(this.addManagedListener(this.eGui,"keydown",this.onGuiKeyDown.bind(this)),this.addManagedListener(this.eGui,"keyup",this.onGuiKeyUp.bind(this)))}refreshTabIndex(){this.gridOptionsService.get("suppressHeaderFocus")?this.eGui.removeAttribute("tabindex"):this.eGui.setAttribute("tabindex","-1")}onGuiKeyDown(t){var i;const o=this.gridOptionsService.getDocument().activeElement,r=t.key===w.LEFT||t.key===w.RIGHT;if(this.isResizing&&(t.preventDefault(),t.stopImmediatePropagation()),o!==this.eGui||!t.shiftKey&&!t.altKey||((this.isResizing||r)&&(t.preventDefault(),t.stopImmediatePropagation()),!r))return;const n=t.key===w.LEFT!==this.gridOptionsService.get("enableRtl"),l=vd[n?"Left":"Right"];if(t.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const a=this.getViewportAdjustedResizeDiff(t);this.resizeHeader(a,t.shiftKey),null==(i=this.resizeFeature)||i.toggleColumnResizing(!0)}else this.moveHeader(l)}getViewportAdjustedResizeDiff(t){let i=this.getResizeDiff(t);if(this.column.getPinned()){const o=this.pinnedWidthService.getPinnedLeftWidth(),r=this.pinnedWidthService.getPinnedRightWidth(),n=Jt(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(o+r+i>n){if(!(n>o+r))return 0;i=n-o-r}}return i}getResizeDiff(t){let i=t.key===w.LEFT!==this.gridOptionsService.get("enableRtl");const s=this.column.getPinned(),o=this.gridOptionsService.get("enableRtl");return s&&o!==("right"===s)&&(i=!i),(i?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=setTimeout(()=>{var t;null==(t=this.resizeFeature)||t.toggleColumnResizing(!1)},150))}handleKeyDown(t){const i=this.getWrapperHasFocus();switch(t.key){case w.PAGE_DOWN:case w.PAGE_UP:case w.PAGE_HOME:case w.PAGE_END:i&&t.preventDefault()}}addDomData(){const t=Iu.DOM_DATA_KEY_HEADER_CTRL;this.gridOptionsService.setDomData(this.eGui,t,this),this.addDestroyFunc(()=>this.gridOptionsService.setDomData(this.eGui,t,null))}getGui(){return this.eGui}focus(t){return!!this.eGui&&(this.lastFocusEvent=t||null,this.eGui.focus(),!0)}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getInstanceId(){return this.instanceId}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(t,i,s){const o=t??i;this.gridOptionsService.get("preventDefaultOnContextMenu")&&o.preventDefault();const r=s instanceof Z?s:void 0;this.menuService.isHeaderContextMenuEnabled(r)&&this.menuService.showHeaderContextMenu(r,t,i),this.dispatchColumnMouseEvent(p.EVENT_COLUMN_HEADER_CONTEXT_MENU,s)}dispatchColumnMouseEvent(t,i){this.eventService.dispatchEvent({type:t,column:i})}destroy(){super.destroy(),this.removeDragSource(),this.comp=null,this.column=null,this.resizeFeature=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null,this.eGui=null}};Lt.DOM_DATA_KEY_HEADER_CTRL="headerCtrl",u([f("pinnedWidthService")],Lt.prototype,"pinnedWidthService",2),u([f("focusService")],Lt.prototype,"focusService",2),u([f("userComponentFactory")],Lt.prototype,"userComponentFactory",2),u([f("ctrlsService")],Lt.prototype,"ctrlsService",2),u([f("dragAndDropService")],Lt.prototype,"dragAndDropService",2),u([f("menuService")],Lt.prototype,"menuService",2),u([b],Lt.prototype,"postConstruct",1);var nr=Lt,lr=class extends T{constructor(e,t,i,s){super(),this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=s,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gridOptionsService.get("enableRtl")&&this.colsSpanning?K(this.colsSpanning):this.columnOrGroup}postConstruct(){this.addManagedListener(this.columnOrGroup,Z.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this)),this.setLeftFirstTime(),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onLeftChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onLeftChanged.bind(this))}setLeftFirstTime(){const e=this.beans.gridOptionsService.get("suppressColumnMoveAnimation"),t=R(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),s=this.modifyLeftForPrintLayout(e,i),o=this.modifyLeftForPrintLayout(e,t);this.setLeft(s),this.actualLeft=o,this.beans.columnAnimationService.executeNextVMTurn(()=>
1{this.actualLeft===o&&this.setLeft(o)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!this.beans.gridOptionsService.isDomLayout("print")||"left"===e.getPinned())return t;const s=this.beans.columnModel.getDisplayedColumnsLeftWidth();return"right"===e.getPinned()?s+this.beans.columnModel.getBodyContainerWidth()+t:s+t}setLeft(e){let t;if(R(e)&&(this.eCell.style.left=`${e}px`),this.columnOrGroup instanceof Z)t=this.columnOrGroup;else{const s=this.columnOrGroup.getLeafColumns();if(!s.length)return;s.length>1&&va(this.ariaEl,s.length),t=s[0]}}};u([b],lr.prototype,"postConstruct",1);var Vs=class extends T{constructor(e,t){super(),this.columns=e,this.element=t}postConstruct(){this.gridOptionsService.get("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListener(this.element,"mouseout",this.onMouseOut.bind(this)),this.addManagedListener(this.element,"mouseover",this.onMouseOver.bind(this))}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}};u([f("columnHoverService")],Vs.prototype,"columnHoverService",2),u([b],Vs.prototype,"postConstruct",1);var dg=class extends nr{constructor(e,t,i){super(e,t,i),this.iconCreated=!1,this.column=e}setComp(e,t,i,s){this.comp=e,this.eButtonShowMainFilter=i,this.eFloatingFilterBody=s,this.setGui(t),this.setupActive(),this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedListener(this.eButtonShowMainFilter,"click",this.showParentFilter.bind(this)),this.setupFilterChangedListener(),this.addManagedListener(this.column,Z.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this))}resizeHeader(){}moveHeader(){}setupActive(){const e=this.column.getColDef();this.active=!!e.filter&&!!e.floatingFilter}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=oe("filter",this.gridOptionsService,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(){this.createManagedBean(new Ht(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.localeService.getLocaleTextFunc();lt(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(this.gridOptionsService.getDocument().activeElement===this.eGui)return;const o=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(o)return this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),void o.focus();const r=this.findNextColumnWithFloatingFilter(e.shiftKey);r&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:r},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.columnModel;let i=this.column;do{if(i=e?t.getDisplayedColBefore(i):t.getDisplayedColAfter(i),!i)break}while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case w.UP:case w.DOWN:t||e.preventDefault();case w.LEFT:case w.RIGHT:if(t)return;e.stopPropagation();case w.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case w.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const i=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),s=!!e.relatedTarget&&Zt(e.relatedTarget,"ag-floating-filter");if(i&&s&&e.target===this.eGui){const r=this.lastFocusEvent;r&&r&&r.key===w.TAB&&this.focusService.focusInto(this.eGui,r.shiftKey)}const o=this.getRowIndex();this.beans.focusService.setFocusedHeader(o,this.column)}setupHover(){this.createManagedBean(new Vs([this.column],this.eGui));const e=()=>
1{if(!this.gridOptionsService.get("columnHoverHighlight"))return;const t=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",t)};this.addManagedListener(this.eventService,p.EVENT_COLUMN_HOVER_CHANGED,e),e()}setupLeft(){const e=new lr(this.column,this.eGui,this.beans);this.createManagedBean(e)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){if(!this.active)return;const e=this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){this.menuService.showFilterMenu({column:this.column,buttonElement:this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(){if(!this.active)return;const{filterManager:e}=this.beans,t=i=>{const s=this.comp.getFloatingFilterComp();s&&s.then(o=>{if(o){const r=e.getCurrentFloatingFilterParentModel(this.column);o.onParentModelChanged(r,i)}})};this.destroySyncListener=this.addManagedListener(this.column,Z.EVENT_FILTER_CHANGED,t),e.isFilterActive(this.column)&&t(null)}setupWidth(){const e=()=>{const t=`${this.column.getActualWidth()}px`;this.comp.setWidth(t)};this.addManagedListener(this.column,Z.EVENT_WIDTH_CHANGED,e),e()}setupFilterChangedListener(){this.active&&(this.destroyFilterChangedListener=this.addManagedListener(this.column,Z.EVENT_FILTER_CHANGED,this.updateFilterButton.bind(this)),this.updateFilterButton())}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){const e=this.beans.filterManager.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(){var e,t;const i=this.active;this.setupActive();const s=!i&&this.active;i&&!this.active&&(null==(e=this.destroySyncListener)||e.call(this),null==(t=this.destroyFilterChangedListener)||t.call(this));const o=this.active?this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,r=this.comp.getFloatingFilterComp();r&&o?r.then(n=>{var l;!n||this.beans.filterManager.areFilterCompsDifferent(null!=(l=this.userCompDetails)?l:null,o)?this.updateCompDetails(o,s):this.updateFloatingFilterParams(o)}):this.updateCompDetails(o,s)}updateCompDetails(e,t){this.isAlive()&&(this.setCompDetails(e),this.setupFilterButton(),this.setupUi(),t&&(this.setupSyncWithFilter(),this.setupFilterChangedListener()))}updateFloatingFilterParams(e){var t;if(!e)return;const i=e.params;null==(t=this.comp.getFloatingFilterComp())||t.then(s=>{let o=!1;s?.refresh&&"function"==typeof s.refresh&&null!==s.refresh(i)&&(o=!0),!o&&s?.onParamsUpdated&&"function"==typeof s.onParamsUpdated&&null!==s.onParamsUpdated(i)&&x("Custom floating filter method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")})}destroy(){super.destroy(),this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.destroySyncListener=null,this.destroyFilterChangedListener=null}},Xi=class extends T{constructor(e,t,i,s,o){super(),this.pinned=e,this.column=t,this.eResize=i,this.comp=s,this.ctrl=o}postConstruct(){const e=[];let t,i;const s=()=>
1{if(U(this.eResize,t),!t)return;const n=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(n),i){const l=this.gridOptionsService.get("skipHeaderOnAutoSize"),a=()=>{this.columnModel.autoSizeColumn(this.column,"uiColumnResized",l)};this.eResize.addEventListener("dblclick",a);const c=new we(this.eResize);c.addEventListener(we.EVENT_DOUBLE_TAP,a),e.push(()=>{this.eResize.removeEventListener("dblclick",a),c.removeEventListener(we.EVENT_DOUBLE_TAP,a),c.destroy()})}},o=()=>{e.forEach(n=>n()),e.length=0},r=()=>{const n=this.column.isResizable(),l=!this.gridOptionsService.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(n!==t||l!==i)&&(t=n,i=l,o(),s())};r(),this.addDestroyFunc(o),this.ctrl.addRefreshFunction(r)}onResizing(e,t){const{column:i,lastResizeAmount:s,resizeStartWidth:o}=this,r=this.normaliseResizeAmount(t),l=[{key:i,newWidth:o+r}];this.column.getPinned()&&this.pinnedWidthService.getPinnedLeftWidth()+this.pinnedWidthService.getPinnedRightWidth()+(r-s)>Jt(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50||(this.lastResizeAmount=r,this.columnModel.setColumnWidths(l,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1))}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const i="left"!==this.pinned,s="right"===this.pinned;return this.gridOptionsService.get("enableRtl")?i&&(t*=-1):s&&(t*=-1),t}};u([f("horizontalResizeService")],Xi.prototype,"horizontalResizeService",2),u([f("pinnedWidthService")],Xi.prototype,"pinnedWidthService",2),u([f("ctrlsService")],Xi.prototype,"ctrlsService",2),u([f("columnModel")],Xi.prototype,"columnModel",2),u([b],Xi.prototype,"postConstruct",1);var jn=class extends T{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e}onSpaceKeyDown(e){const t=this.cbSelectAll,i=this.gridOptionsService.getDocument();t.isDisplayed()&&!t.getGui().contains(i.activeElement)&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new Qo),this.cbSelectAll.addCssClass("ag-header-select-all"),re(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_SELECTION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_PAGINATION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_MODEL_UPDATED,this.onModelChanged.bind(this)),this.addManagedListener(this.cbSelectAll,p.EVENT_FIELD_VALUE_CHANGED,this.onCbSelectAll.bind(this)),Es(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(e);const t=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!t),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),i=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),s=e("ariaRowSelectAll","Press Space to toggle all rows selection");
1this.headerCellCtrl.setAriaDescriptionProperty("selectAll",this.cbSelectAllVisible?`${s} (${i})`:null),this.cbSelectAll.setInputAriaLabel(`${s} (${i})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(e){return"multiple"===this.gridOptionsService.get("rowSelection")||(console.warn(`AG Grid: ${e} is only available if using 'multiple' rowSelection.`),!1)}checkRightRowModelType(e){const t=this.rowModel.getType();return"clientSide"===t||"serverSide"===t||(console.warn(`AG Grid: ${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox||!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.isFilteredOnly(),i=this.isCurrentPageOnly();let s="uiSelectAll";i?s="uiSelectAllCurrentPage":t&&(s="uiSelectAllFiltered");const o={source:s,justFiltered:t,justCurrentPage:i};e?this.selectionService.selectAllRowNodes(o):this.selectionService.deselectAllRowNodes(o)}isCheckboxSelection(){let e=this.column.getColDef().headerCheckboxSelection;return"function"==typeof e&&(e=e(this.gridOptionsService.addGridCommonParams({column:this.column,colDef:this.column.getColDef()}))),!!e&&this.checkRightRowModelType("headerCheckboxSelection")&&this.checkSelectionType("headerCheckboxSelection")}isFilteredOnly(){return!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){return!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}};u([f("rowModel")],jn.prototype,"rowModel",2),u([f("selectionService")],jn.prototype,"selectionService",2);var ug=class extends nr{constructor(e,t,i){super(e,t,i),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,s){this.comp=e,this.setGui(t),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight(s),this.addColumnHoverListener(),this.setupFilterClass(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.resizeFeature=this.createManagedBean(new Xi(this.getPinned(),this.column,i,e,this)),this.createManagedBean(new Vs([this.column],t)),this.createManagedBean(new lr(this.column,t,this.beans)),this.createManagedBean(new Ht(t,{shouldStopEventPropagation:o=>this.shouldStopEventPropagation(o),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(),this.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader"],this.refresh.bind(this)),this.addManagedListener(this.column,Z.EVENT_COL_DEF_CHANGED,this.refresh.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VALUE_CHANGED,this.onColumnValueChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onColumnRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_CHANGED,this.onColumnPivotChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}resizeHeader(e,t){var i,s;if(!this.column.isResizable())return;const o=this.column.getActualWidth(),r=null!=(i=this.column.getMinWidth())?i:0,n=null!=(s=this.column.getMaxWidth())?s:Number.MAX_SAFE_INTEGER,l=Math.min(Math.max(o+e,r),n);this.beans.columnModel.setColumnWidths([{key:this.column,newWidth:l}],t,!0,"uiColumnResized")}moveHeader(e){const{eGui:t,column:i,gridOptionsService:s,ctrlsService:o}=this,r=this.getPinned(),n=t.getBoundingClientRect().left,l=i.getActualWidth(),a=s.get("enableRtl"),h=ci.normaliseX(0===e!==a?n-20:n+l+20,r,!0,s,o);ci.attemptMoveColumns({allMovingColumns:[i],isFromHeader:!0,hDirection:e,xPosition:h,pinned:r,fromEnter:!1,fakeEvent:!1,gridOptionsService:s,columnModel:this.beans.columnModel}),o.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(i,"auto")}
1setupUserComp(){const e=this.lookupUserCompDetails();this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(t,e)}createParams(){return this.gridOptionsService.addGridCommonParams({column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&this.menuService.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!this.openFilterEnabled||this.menuService.isLegacyMenuEnabled(),showColumnMenu:t=>{this.menuService.showColumnMenu({column:this.column,buttonElement:t,positionBy:"button"})},showColumnMenuAfterMouseClick:t=>{this.menuService.showColumnMenu({column:this.column,mouseEvent:t,positionBy:"mouse"})},showFilter:t=>{this.menuService.showFilterMenu({column:this.column,buttonElement:t,containerType:"columnFilter",positionBy:"button"})},progressSort:t=>{this.beans.sortController.progressSort(this.column,!!t,"uiColumnSorted")},setSort:(t,i)=>{this.beans.sortController.setSortForColumn(this.column,t,!!i,"uiColumnSorted")},eGridHeader:this.getGui(),setTooltip:(t,i)=>{this.setupTooltip(t,i)}})}setupSelectAll(){this.selectAllFeature=this.createManagedBean(new jn(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===w.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===w.ENTER&&this.onEnterKeyDown(e),e.key===w.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){e.ctrlKey||e.metaKey?this.showMenuOnKeyPress(e,!0):this.sortable&&this.beans.sortController.progressSort(this.column,e.shiftKey,"uiColumnSorted")}showMenuOnKeyPress(e,t){const i=this.comp.getUserCompInstance();!i||!(i instanceof Nn)||i.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const t=this.getRowIndex();this.focusService.setFocusedHeader(t,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i="whenTruncated"===this.gridOptionsService.get("tooltipShowMode"),s=this.eGui,o=this.column.getColDef();!t&&i&&!o.headerComponent&&(t=()=>{const l=s.querySelector(".ag-header-cell-text");return!l||l.scrollWidth>l.clientWidth});const n=this.createManagedBean(new Ft({getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>s,getLocation:()=>"header",getTooltipValue:()=>e??this.column.getColDef().headerTooltip,shouldDisplayTooltip:t}));this.refreshFunctions.push(()=>n.refreshToolTip())}setupClassesFromColDef(){const e=()=>{const t=this.column.getColDef(),i=ir.getHeaderClassesFromColDef(t,this.gridOptionsService,this.column,null),s=this.userHeaderClasses;this.userHeaderClasses=new Set(i),i.forEach(o=>{s.has(o)?s.delete(o):this.comp.addOrRemoveCssClass(o,!0)}),s.forEach(o=>this.comp.addOrRemoveCssClass(o,!1))};this.refreshFunctions.push(e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const{column:t,beans:i,displayName:s,dragAndDropService:o,gridOptionsService:r}=this,{columnModel:n}=i;let l=!this.gridOptionsService.get("suppressDragLeaveHidesColumns");const a=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>l?V.ICON_HIDE:V.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(t),dragItemName:s,onDragStarted:()=>{l=!r.get("suppressDragLeaveHidesColumns"),t.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>t.setMoving(!1,"uiColumnMoved"),onGridEnter:c=>{var h;if(l){const g=(null==(h=c?.columns)?void 0:h.filter(m=>!m.getColDef().lockVisible))||[];n.setColumnsVisible(g,!0,"uiColumnMoved")}},onGridExit:c=>{var h;if(l){const g=(null==(h=c?.columns)?void 0:h.filter(m=>!m.getColDef().lockVisible))||[];n.setColumnsVisible(g,!1,"uiColumnMoved")}}};o.addDragSource(a,!0)}createDragItem(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}addRefreshFunction(e){this.refreshFunctions.push(e)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach(e
1=>e())}refreshHeaderComp(){const e=this.lookupUserCompDetails();null!=this.comp.getUserCompInstance()&&this.userCompDetails.componentClass==e.componentClass&&this.attemptHeaderCompRefresh(e.params)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!(!t||!t.refresh)&&t.refresh(e)}calculateDisplayName(){return this.beans.columnModel.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!(this.gridOptionsService.get("suppressMovableColumns")||e.suppressMovable||e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const e=()=>{const t=this.column.getActualWidth();this.comp.setWidth(`${t}px`)};this.addManagedListener(this.column,Z.EVENT_WIDTH_CHANGED,e),e()}setupMovingCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListener(this.column,Z.EVENT_MOVING_CHANGED,e),e()}setupMenuClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListener(this.column,Z.EVENT_MENU_VISIBLE_CHANGED,e),e()}setupSortableClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};e(),this.addRefreshFunction(e),this.addManagedListener(this.eventService,Z.EVENT_SORT_CHANGED,this.refreshAriaSort.bind(this))}setupFilterClass(){const e=()=>{const t=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",t),this.refreshAria()};this.addManagedListener(this.column,Z.EVENT_FILTER_ACTIVE_CHANGED,e),e()}setupWrapTextClass(){const e=()=>{const t=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",t)};e(),this.addRefreshFunction(e)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,beans:s}=this;if(!t.isSpanHeaderHeight())return e.style.removeProperty("top"),e.style.removeProperty("height"),i.addOrRemoveCssClass("ag-header-span-height",!1),void i.addOrRemoveCssClass("ag-header-span-total",!1);const{numberOfParents:o,isSpanningTotal:r}=this.column.getColumnGroupPaddingInfo();i.addOrRemoveCssClass("ag-header-span-height",o>0);const{columnModel:n}=s,l=n.getColumnHeaderRowHeight();if(0===o)return i.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),void e.style.setProperty("height",`${l}px`);i.addOrRemoveCssClass("ag-header-span-total",r);const h=o*(n.isPivotMode()?n.getPivotGroupHeaderHeight():n.getGroupHeaderHeight());e.style.setProperty("top",-h+"px"),e.style.setProperty("height",`${l+h}px`)}setupAutoHeight(e){const{columnModel:t,resizeObserverService:i}=this.beans,s=c=>{if(!this.isAlive())return;const{paddingTop:h,paddingBottom:g,borderBottomWidth:m,borderTopWidth:C}=Vt(this.getGui()),S=e.offsetHeight+(h+g+m+C);if(c<5){const D=this.beans.gridOptionsService.getDocument();if(!D||!D.contains(e)||0==S)return void window.setTimeout(()=>s(c+1),0)}t.setColumnHeaderHeight(this.column,S)};let r,o=!1;const n=()=>{const c=this.column.isAutoHeaderHeight();c&&!o&&l(),!c&&o&&a()},l=()=>{o=!0,s(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),r=i.observeResize(e,()=>s(0))},a=()=>{o=!1,r&&r(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),r=void 0};n(),this.addDestroyFunc(()=>a()),this.addManagedListener(this.column,Z.EVENT_WIDTH_CHANGED,()=>o&&s(0)),this.addManagedListener(this.eventService,Z.EVENT_SORT_CHANGED,()=>{o&&window.setTimeout(()=>s(0))}),this.addRefreshFunction(n)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(aa(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}
1refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",e("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const e=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",e("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(e,t){null!=t?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}announceAriaDescription(){const e=this.beans.gridOptionsService.getDocument();if(!this.eGui.contains(e.activeElement))return;const t=Array.from(this.ariaDescriptionProperties.keys()).sort((i,s)=>"filter"===i?-1:s.charCodeAt(0)-i.charCodeAt(0)).map(i=>this.ariaDescriptionProperties.get(i)).join(". ");this.beans.ariaAnnouncementService.announceValue(t)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(){const e=()=>{if(!this.gridOptionsService.get("columnHoverHighlight"))return;const t=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",t)};this.addManagedListener(this.eventService,p.EVENT_COLUMN_HOVER_CHANGED,e),e()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(){const e=s=>this.handleMouseOverChange("mouseenter"===s.type);this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e),this.addManagedListener(this.getGui(),"click",()=>this.dispatchColumnMouseEvent(p.EVENT_COLUMN_HEADER_CLICKED,this.column)),this.addManagedListener(this.getGui(),"contextmenu",s=>this.handleContextMenuMouseEvent(s,void 0,this.column))}handleMouseOverChange(e){this.setActiveHeader(e),this.eventService.dispatchEvent({type:e?p.EVENT_COLUMN_HEADER_MOUSE_OVER:p.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column})}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return t instanceof Nn?t.getAnchorElementForMenu(e):this.getGui()}destroy(){super.destroy(),this.refreshFunctions=null,this.selectAllFeature=null,this.dragSourceElement=null,this.userCompDetails=null,this.userHeaderClasses=null,this.ariaDescriptionProperties=null}},Hs=class extends T{constructor(e,t,i,s){super(),this.eResize=t,this.comp=e,this.pinned=i,this.columnGroup=s}postConstruct(){if(!this.columnGroup.isResizable())return void this.comp.setResizableDisplayed(!1);const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gridOptionsService.get("suppressAutoSize")){const t=this.gridOptionsService.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",()=>{const i=[];this.columnGroup.getDisplayedLeafColumns().forEach(o=>{o.getColDef().suppressAutoSize||i.push(o.getColId())}),i.length>0&&this.columnModel.autoSizeColumns({columns:i,skipHeader:t,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")})}}onResizeStart(e){const t=this.getInitialValues(e);this.storeLocalValues(t),this.toggleColumnResizing(!0)}onResizing(e,t,i="uiColumnResized"){const s=this.normaliseDragChange(t);this.resizeColumnsFromLocalValues(this.resizeStartWidth+s,i,e)}getInitialValues(e){const t=this.getColumnsToResize(),i=this.getInitialSizeOfColumns(t),o={columnsToResize:t,resizeStartWidth:i,resizeRatios:this.getSizeRatiosOfColumns(t,i)};let r=null;if(e&&(r=this.columnModel.getDisplayedGroupAfter(this.columnGroup)),r){const n=r.getDisplayedLeafColumns(),l=o.groupAfterColumns=n.filter(c=>c.isResizable()),a=o.groupAfterStartWidth=this.getInitialSizeOfColumns(l);o.groupAfterRatios=this.getSizeRatiosOfColumns(l,a)}else o.groupAfterColumns=void 0,o.groupAfterStartWidth=void 0,o.groupAfterRatios=void 0;return o}storeLocalValues(e){const{columnsToResize:t,resizeStartWidth:i,resizeRatios:s,groupAfterColumns:o,groupAfterStartWidth:r,groupAfterRatios:n}=e;this.resizeCols=t,this.resizeStartWidth=i,this.resizeRatios=s,this.resizeTakeFromCols=o,this.resizeTakeFromStartWidth=r,this.resizeTakeFromRatios=n}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),i=this.getInitialValues();t>i.resizeStartWidth&&this.resizeColumns(i,t,e,!0)}resizeColumnsFromLocalValues(e,t,i=!0){var s,o,r;if(!this.resizeCols||!this.resizeRatios)return;const n={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:null!=(s=this.resizeTakeFromCols)?s:void 0,groupAfterStartWidth:null!=(o=this.resizeTakeFromStartWidth)?o:void 0,groupAfterRatios:null!=(r=this.resizeTakeFromRatios)?r:void 0};this.resizeColumns(n,e,t,i)}resizeColumns(e,t,i,s=!0){const{columnsToResize:o,resizeStartWidth:r,resizeRatios:n,groupAfterColumns:l,groupAfterStartWidth:a,groupAfterRatios:c}=e,h=[];h.push({columns:o,ratios:n,width:t}),l&&h.push({columns:l,ratios:c,width:a-(t-r)}),this.columnModel.resizeColumnSets({resizeSets:h,finished:s,source:i}),s&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(t=>t.isResizable())}getInitialSizeOfColumns(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}getSizeRatiosOfColumns(e,t){return e.map(i=>i.getActualWidth()/t)}normaliseDragChange(e){let t=e;return this.gridOptionsService.get("enableRtl")?"left"!==this.pinned&&(t*=-1):"right"===this.pinned&&(t*=-1),t}destroy(){super.destroy(),this.clearLocalValues()}};u([f("horizontalResizeService")],Hs.prototype,"horizontalResizeService",2),u([f("autoWidthCalculator")],Hs.prototype,"autoWidthCalculator",2),u([f("columnModel")],Hs.prototype,"columnModel",2),u([b],Hs.prototype,"postConstruct",1);var Nd=class extends T{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListener(this.columnGroup,he.EVENT_DISPLAYED_CHILDREN_CHANGED,this.onDisplayedChildrenChanged.bind(this)),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);
1this.columnGroup.getLeafColumns().forEach(t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)})})}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach(e=>e()),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",0===e)}};u([b],Nd.prototype,"postConstruct",1);var cg=class extends nr{constructor(e,t,i){super(e,t,i),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const s=this.getGui();this.setDragSource(s)}},this.column=e}setComp(e,t,i){this.comp=e,this.setGui(t),this.displayName=this.beans.columnModel.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.addDestroyFunc(()=>{this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature))}),this.setupUserComp(),this.addHeaderMouseListeners();const s=this.getParentRowCtrl().getPinned(),o=this.column.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new Vs(o,t)),this.createManagedBean(new lr(this.column,t,this.beans)),this.createManagedBean(new Nd(e,this.column)),this.resizeFeature=this.createManagedBean(new Hs(e,i,s,this.column)),this.createManagedBean(new Ht(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addManagedPropertyListener(p.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners()}resizeHeader(e,t){if(!this.resizeFeature)return;const i=this.resizeFeature.getInitialValues(t);this.resizeFeature.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}moveHeader(e){const{beans:t,eGui:i,column:s,gridOptionsService:o,ctrlsService:r}=this,n=o.get("enableRtl"),l=0===e,a=this.getPinned(),c=i.getBoundingClientRect(),h=c.left,m=ci.normaliseX(l!==n?h-20:h+c.width+20,a,!0,o,r),C=s.getGroupId(),v=this.focusService.getFocusedHeader();ci.attemptMoveColumns({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,hDirection:e,xPosition:m,pinned:a,fromEnter:!1,fakeEvent:!1,gridOptionsService:o,columnModel:t.columnModel});const E=s.getDisplayedLeafColumns(),S=l?E[0]:K(E);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(S,"auto"),!this.isAlive()&&v&&this.restoreFocus(C,s,v)}restoreFocus(e,t,i){const s=t.getLeafColumns();if(!s.length)return;const o=s[0].getParent();if(!o)return;const r=this.findGroupWidthId(o,e);r&&this.focusService.focusHeaderPosition({headerPosition:ie(L({},i),{column:r})})}findGroupWidthId(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}return null}resizeLeafColumnsToFit(e){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(){const e=this.gridOptionsService.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:i=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),i,"gridInitializing")},setTooltip:(i,s)=>{this.setupTooltip(i,s)}}),t=this.userComponentFactory.getHeaderGroupCompDetails(e);this.comp.setUserCompDetails(t)}addHeaderMouseListeners(){const e=s=>this.handleMouseOverChange("mouseenter"===s.type);this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e),this.addManagedListener(this.getGui(),"click",()=>this.dispatchColumnMouseEvent(p.EVENT_COLUMN_HEADER_CLICKED,this.column.getProvidedColumnGroup())),this.addManagedListener(this.getGui(),"contextmenu",s=>this.handleContextMenuMouseEvent(s,void 0,this.column.getProvidedColumnGroup()))}handleMouseOverChange(e){const i={type:e?p.EVENT_COLUMN_HEADER_MOUSE_OVER:p.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column.getProvidedColumnGroup()};this.eventService.dispatchEvent(i)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i=this.column.getColGroupDef(),s="whenTruncated"===this.gridOptionsService.get("tooltipShowMode"),o=this.eGui;!t&&s&&!i?.headerGroupComponent&&(t=()=>{const n=o.querySelector(".ag-header-group-text");return!n||n.scrollWidth>n.clientWidth}
1);const r={getColumn:()=>this.column,getGui:()=>o,getLocation:()=>"headerGroup",getTooltipValue:()=>e??(i&&i.headerTooltip),shouldDisplayTooltip:t};i&&(r.getColDef=()=>i),this.createBean(new Ft(r))}setupExpandable(){const e=this.column.getProvidedColumnGroup();this.refreshExpanded(),this.addManagedListener(e,le.EVENT_EXPANDABLE_CHANGED,this.refreshExpanded.bind(this)),this.addManagedListener(e,le.EVENT_EXPANDED_CHANGED,this.refreshExpanded.bind(this))}refreshExpanded(){const e=this.column;this.expandable=e.isExpandable();const t=e.isExpanded();this.comp.setAriaExpanded(this.expandable?t?"true":"false":void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const e=this.column.getColGroupDef(),t=ir.getHeaderClassesFromColDef(e,this.gridOptionsService,null,this.column);this.column.isPadding()?(t.push("ag-header-group-cell-no-group"),this.column.getLeafColumns().every(s=>s.isSpanHeaderHeight())&&t.push("ag-header-span-height")):t.push("ag-header-group-cell-with-group"),t.forEach(i=>this.comp.addOrRemoveCssClass(i,!0))}setupMovingCss(){const t=this.column.getProvidedColumnGroup().getLeafColumns(),i=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());t.forEach(s=>{this.addManagedListener(s,Z.EVENT_MOVING_CHANGED,i)}),i()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const t=this.getRowIndex();this.beans.focusService.setFocusedHeader(t,this.column)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(this.expandable&&t&&e.key===w.ENTER){const i=this.column,s=!i.isExpanded();this.beans.columnModel.setColumnGroupOpened(i.getProvidedColumnGroup(),s,"uiColumnExpanded")}}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving()||(this.removeDragSource(),!e))return;const{beans:t,column:i,displayName:s,gridOptionsService:o,dragAndDropService:r}=this,{columnModel:n}=t,l=i.getProvidedColumnGroup().getLeafColumns();let a=!o.get("suppressDragLeaveHidesColumns");const c=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>a?V.ICON_HIDE:V.ICON_NOT_ALLOWED,dragItemName:s,getDragItem:()=>this.getDragItemForGroup(i),onDragStarted:()=>{a=!o.get("suppressDragLeaveHidesColumns"),l.forEach(h=>h.setMoving(!0,"uiColumnDragged"))},onDragStopped:()=>l.forEach(h=>h.setMoving(!1,"uiColumnDragged")),onGridEnter:h=>{var g;if(a){const m=(null==(g=h?.columns)?void 0:g.filter(C=>!C.getColDef().lockVisible))||[];n.setColumnsVisible(m,!0,"uiColumnMoved")}},onGridExit:h=>{var g;if(a){const m=(null==(g=h?.columns)?void 0:g.filter(C=>!C.getColDef().lockVisible))||[];n.setColumnsVisible(m,!1,"uiColumnMoved")}}};r.addDragSource(c,!0)}getDragItemForGroup(e){const t=e.getProvidedColumnGroup().getLeafColumns(),i={};t.forEach(o=>i[o.getId()]=o.isVisible());const s=[];return this.beans.columnModel.getAllDisplayedColumns().forEach(o=>{t.indexOf(o)>=0&&(s.push(o),Le(t,o))}),t.forEach(o=>s.push(o)),{columns:s,visibleState:i}}isSuppressMoving(){let e=!1;return this.column.getLeafColumns().forEach(i=>{(i.getColDef().suppressMovable||i.getColDef().lockPosition)&&(e=!0)}),e||this.gridOptionsService.get("suppressMovableColumns")}},hg=0,Bs=class extends T{constructor(e,t,i){super(),this.instanceId=hg++,this.rowIndex=e,this.pinned=t,this.type=i,this.headerRowClass="ag-header-row "+("group"==i?"ag-header-row-column-group":"filter"==i?"ag-header-row-column-filter":"ag-header-row-column")}postConstruct(){this.isPrintLayout=this.gridOptionsService.isDomLayout("print"),this.isEnsureDomOrder=this.gridOptionsService.get("ensureDomOrder")}getInstanceId(){return this.instanceId}setComp(e,t=!0){this.comp=e,t&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners()}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(){this.addManagedListener(this.eventService,p.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this)),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_VIRTUAL_COLUMNS_CHANGED,e=>this.onVirtualColumnsChanged(e.afterScroll)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_GRID_STYLES_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("ensureDomOrder",e=>this.isEnsureDomOrder=e.currentValue),this.addManagedPropertyListener("headerHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("groupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotGroupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("floatingFiltersHeight",this.onRowHeightChanged.bind(this))}getHeaderCellCtrl(e){if(this.headerCellCtrls)return jt(this.headerCellCtrls).find(t=>t.getColumnGroupChild()===e)}onDisplayedColumnsChanged(){this.isPrintLayout=this.gridOptionsService.isDomLayout("print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{columnModel:e}=this.beans;return this.isPrintLayout?null!=this.pinned?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){var{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){const{columnModel:e,filterManager:t}=this.beans;let i=e.getHeaderRowCount();const s=[];let o=0;t.hasFloatingFilters()&&(i++,o=1);const r=e.getColumnGroupHeaderRowHeight(),n=e.getColumnHeaderRowHeight(),a=i-(1+o);for(let g=0;g<a;g++)s.push(r);s.push(n);for(let g=0;g<o;g++)s.push(e.getFloatingFiltersHeight());let c=0;for(let g=0;g<this.rowIndex;g++)c+=s[g];return{topOffset:c,rowHeight:s[this.rowIndex]}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls();this.comp.setHeaderCtrls(t,this.isEnsureDomOrder||this.isPrintLayout,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls=new Map;const t=this.getColumnsInViewport();for(const o of t)this.recycleAndCreateHeaderCtrls(o,e);const i=o=>{const{focusService:r,columnModel:n}=this.beans;return!!r.isHeaderWrapperFocused(o)&&n.isDisplayed(o.getColumnGroupChild())};if(e)for(const[o,r]of e)i(r)?this.headerCellCtrls.set(o,r):this.destroyBean(r);return Array.from(this.headerCellCtrls.values())}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls||e.isEmptyGroup())return;const i=e.getUniqueId();let s;if(t&&(s=t.get(i),t.delete(i)),s&&s.getColumnGroupChild()!=e&&(this.destroyBean(s),s=void 0),null==s)switch(this.type){case"filter":s=this.createBean(new dg(e,this.beans,this));break;case"group":s=this.createBean(new cg(e,this.beans,this));break;default:s=this.createBean(new ug(e,this.beans,this))}this.headerCellCtrls.set(i,s)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(null!=this.pinned)return[];let e=[];const t=this.getActualDepth(),{columnModel:i}=this.beans;return["left",null,"right"].forEach(s=>{const o=i.getVirtualHeaderGroupRow(s,t);e=e.concat(o)}),e}getActualDepth(){return"filter"==this.type?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnModel.getVirtualHeaderGroupRow(this.pinned,this.getActualDepth())}focusHeader(e,t){if(!this.headerCellCtrls)return!1;const s=Array.from(this.headerCellCtrls.values()).find(o=>o.getColumnGroupChild()==e);return!!s&&s.focus(t)}
1destroy(){this.headerCellCtrls&&this.headerCellCtrls.forEach(e=>{this.destroyBean(e)}),this.headerCellCtrls=void 0,super.destroy()}};u([f("beans")],Bs.prototype,"beans",2),u([b],Bs.prototype,"postConstruct",1);var hi=class extends T{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport),this.addManagedListener(this.eventService,p.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.ctrlsService.registerHeaderContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}setupDragAndDrop(e){const t=new ji(this.pinned,e);this.createManagedBean(t)}refresh(e=!1){const t=new Bi,i=this.focusService.getFocusHeaderToUseAfterRefresh();(()=>{const l=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let a=0;a<l;a++){const c=this.createBean(new Bs(t.next(),this.pinned,"group"));this.groupsRowCtrls.push(c)}})(),(()=>{const l=t.next(),a=!(this.hidden||null!=this.columnsRowCtrl&&e&&this.columnsRowCtrl.getRowIndex()===l);(a||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),a&&(this.columnsRowCtrl=this.createBean(new Bs(l,this.pinned,"column")))})(),(()=>{this.includeFloatingFilter=this.filterManager.hasFloatingFilters()&&!this.hidden;const l=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter)return void l();const a=t.next();if(this.filtersRowCtrl){const c=this.filtersRowCtrl.getRowIndex()!==a;(!e||c)&&l()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new Bs(a,this.pinned,"filter")))})();const n=this.getAllCtrls();this.comp.setCtrls(n),this.restoreFocusOnHeader(i)}restoreFocusOnHeader(e){null==e||e.column.getPinned()!=this.pinned||this.focusService.focusHeaderPosition({headerPosition:e})}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const e=this.filterManager.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){null==this.pinned&&this.createManagedBean(new Ki(e=>this.comp.setCenterWidth(`${e}px`),!0))}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}setupPinnedWidth(){if(null==this.pinned)return;
1const e="left"===this.pinned,t="right"===this.pinned;this.hidden=!0;const i=()=>{const s=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(null==s)return;const o=0==s,r=this.hidden!==o,n=this.gridOptionsService.get("enableRtl"),l=this.gridOptionsService.getScrollbarWidth(),c=this.scrollVisibleService.isVerticalScrollShowing()&&(n&&e||!n&&t)?s+l:s;this.comp.setPinnedContainerWidth(`${c}px`),this.comp.setDisplayed(!o),r&&(this.hidden=o,this.refresh())};this.addManagedListener(this.eventService,p.EVENT_LEFT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,p.EVENT_RIGHT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,p.EVENT_SCROLL_VISIBILITY_CHANGED,i),this.addManagedListener(this.eventService,p.EVENT_SCROLLBAR_WIDTH_CHANGED,i)}getHeaderCtrlForColumn(e){if(e instanceof Z)return this.columnsRowCtrl?this.columnsRowCtrl.getHeaderCellCtrl(e):void 0;if(0!==this.groupsRowCtrls.length)for(let t=0;t<this.groupsRowCtrls.length;t++){const i=this.groupsRowCtrls[t].getHeaderCellCtrl(e);if(i)return i}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const i=this.getAllCtrls()[e];return i?i.getType():void 0}focusHeader(e,t,i){const o=this.getAllCtrls()[e];return!!o&&o.focusHeader(t,i)}getViewport(){return this.eViewport}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}};u([f("ctrlsService")],hi.prototype,"ctrlsService",2),u([f("scrollVisibleService")],hi.prototype,"scrollVisibleService",2),u([f("pinnedWidthService")],hi.prototype,"pinnedWidthService",2),u([f("columnModel")],hi.prototype,"columnModel",2),u([f("focusService")],hi.prototype,"focusService",2),u([f("filterManager")],hi.prototype,"filterManager",2);var pi=class br extends k{constructor(t){super(),this.headerRowComps={},this.rowCompsList=[],this.pinned=t}init(){this.selectAndSetTemplate();const t={setDisplayed:s=>this.setDisplayed(s),setCtrls:s=>this.setCtrls(s),setCenterWidth:s=>this.eCenterContainer.style.width=s,setViewportScrollLeft:s=>this.getGui().scrollLeft=s,setPinnedContainerWidth:s=>{const o=this.getGui();o.style.width=s,o.style.maxWidth=s,o.style.minWidth=s}};this.createManagedBean(new hi(this.pinned)).setComp(t,this.getGui())}selectAndSetTemplate(){this.setTemplate("left"==this.pinned?br.PINNED_LEFT_TEMPLATE:"right"==this.pinned?br.PINNED_RIGHT_TEMPLATE:br.CENTER_TEMPLATE),this.eRowContainer=this.eCenterContainer?this.eCenterContainer:this.getGui()}destroyRowComps(){this.setCtrls([])}destroyRowComp(t){this.destroyBean(t),this.eRowContainer.removeChild(t.getGui())}setCtrls(t){const i=this.headerRowComps;let s;this.headerRowComps={},this.rowCompsList=[];const o=r=>{const n=r.getGui();n.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(n),s&&yn(this.eRowContainer,n,s),s=n};t.forEach(r=>{const n=r.getInstanceId(),l=i[n];delete i[n];const a=l||this.createBean(new Yn(r));this.headerRowComps[n]=a,this.rowCompsList.push(a),o(a)}),Nt(i).forEach(r=>this.destroyRowComp(r))}};pi.PINNED_LEFT_TEMPLATE='<div class="ag-pinned-left-header" role="rowgroup"></div>',pi.PINNED_RIGHT_TEMPLATE='<div class="ag-pinned-right-header" role="rowgroup"></div>',pi.CENTER_TEMPLATE='<div class="ag-header-viewport" role="presentation">\n <div class="ag-header-container" ref="eCenterContainer" role="rowgroup"></div>\n </div>',u([A("eCenterContainer")],pi.prototype,"eCenterContainer",2),u([b],pi.prototype,"init",1),u([Ae],pi.prototype,"destroyRowComps",1);var Qn=pi,gi=class extends T{constructor(){super(...arguments),this.currentHeaderRowWithoutSpan=-1}postConstruct(){this.ctrlsService.whenReady(t=>{this.gridBodyCon=t.gridBodyCtrl});const e=this.gridOptionsService.getDocument();this.addManagedListener(e,"mousedown",()=>this.setCurrentHeaderRowWithoutSpan(-1))}getHeaderRowCount(){const e=this.ctrlsService.getHeaderRowContainerCtrl();return e?e.getRowCount():0}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:s,column:o}=t,r=this.getHeaderRowCount(),n=0===e;let{headerRowIndex:l,column:a,headerRowIndexWithoutSpan:c}=n?this.headerPositionUtils.getColumnVisibleParent(o,s):this.headerPositionUtils.getColumnVisibleChild(o,s),h=!1;return l<0&&(l=0,a=o,h=!0),l>=r?(l=-1,this.setCurrentHeaderRowWithoutSpan(-1)):void 0!==c&&(this.currentHeaderRowWithoutSpan=c),!(!h&&!a)&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l,column:a},allowUserOverride:!0,event:i})}setCurrentHeaderRowWithoutSpan(e){this.currentHeaderRowWithoutSpan=e}navigateHorizontally(e,t=!1,i){const s=this.focusService.getFocusedHeader(),o=2===e,r=this.gridOptionsService.get("enableRtl");let n,l;return-1!==this.currentHeaderRowWithoutSpan?s.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=s.headerRowIndex,o!==r?(l="Before",n=this.headerPositionUtils.findHeader(s,l)):(l="After",n=this.headerPositionUtils.findHeader(s,l)),n||!t?this.focusService.focusHeaderPosition({headerPosition:n,direction:l,fromTab:t,allowUserOverride:!0,event:i}):this.focusNextHeaderRow(s,l,i)}focusNextHeaderRow(e,t,i){const s=e.headerRowIndex;let r,o=null;if("Before"===t?s>0&&(r=s-1,this.currentHeaderRowWithoutSpan-=1,o=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"end")):(r=s+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),o=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"start")),!o)return!1;const{column:n,headerRowIndex:l}=this.headerPositionUtils.getHeaderIndexToFocus(o.column,o?.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:n,headerRowIndex:l},direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if(e instanceof he){const s=e.getDisplayedLeafColumns();i="Before"===t?K(s):s[0]}else i=e;
1this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}};u([f("focusService")],gi.prototype,"focusService",2),u([f("headerPositionUtils")],gi.prototype,"headerPositionUtils",2),u([f("ctrlsService")],gi.prototype,"ctrlsService",2),u([b],gi.prototype,"postConstruct",1),gi=u([O("headerNavigationService")],gi);var fi=class extends T{setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new Ht(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onPivotModeChanged(),this.setupHeaderHeight();const s=this.onHeaderContextMenu.bind(this);this.addManagedListener(this.eGui,"contextmenu",s),this.mockContextMenuForIPad(s),this.ctrlsService.registerGridHeaderCtrl(this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("pivotHeaderHeight",e),this.addManagedPropertyListener("groupHeaderHeight",e),this.addManagedPropertyListener("pivotGroupHeaderHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,p.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,e),this.addManagedListener(this.eventService,p.EVENT_GRID_STYLES_CHANGED,e),this.addManagedListener(this.eventService,p.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,e)}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:e}=this;let s,t=0,i=e.getHeaderRowCount();this.filterManager.hasFloatingFilters()&&(i++,t=1);const r=this.columnModel.getColumnGroupHeaderRowHeight(),n=this.columnModel.getColumnHeaderRowHeight(),a=i-(1+t);s=t*e.getFloatingFiltersHeight(),s+=a*r,s+=n,this.headerHeight!==s&&(this.headerHeight=s,this.comp.setHeightAndMinHeight(`${s+1}px`),this.eventService.dispatchEvent({type:p.EVENT_HEADER_HEIGHT_CHANGED}))}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const t=this.columnModel.getAllDisplayedColumns().some(i=>i.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",t)}onTabKeyDown(e){const t=this.gridOptionsService.get("enableRtl");(this.headerNavigationService.navigateHorizontally(e.shiftKey!==t?2:3,!0,e)||this.focusService.focusNextGridCoreContainer(e.shiftKey))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case w.LEFT:t=2;case w.RIGHT:R(t)||(t=3),this.headerNavigationService.navigateHorizontally(t,!1,e);break;case w.UP:t=0;case w.DOWN:R(t)||(t=1),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break;default:return}}onFocusOut(e){const t=this.gridOptionsService.getDocument(),{relatedTarget:i}=e;!i&&this.eGui.contains(t.activeElement)||this.eGui.contains(i)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(e,t,i){if(!e&&!i||!this.menuService.isHeaderContextMenuEnabled())return;const{target:s}=e??t;(s===this.eGui||s===this.ctrlsService.getHeaderRowContainerCtrl().getViewport())&&this.menuService.showHeaderContextMenu(void 0,e,i)}mockContextMenuForIPad(e){if(!At())return;const t=new we(this.eGui);this.addManagedListener(t,we.EVENT_LONG_TAP,s=>{e(void 0,s.touchStart,s.touchEvent)}),this.addDestroyFunc(()=>t.destroy())}};u([f("headerNavigationService")],fi.prototype,"headerNavigationService",2),u([f("focusService")],fi.prototype,"focusService",2),u([f("columnModel")],fi.prototype,"columnModel",2),u([f("ctrlsService")],fi.prototype,"ctrlsService",2),u([f("filterManager")],fi.prototype,"filterManager",2),u([f("menuService")],fi.prototype,"menuService",2);var Xn=class Lu extends k{constructor(){super(Lu.TEMPLATE)}postConstruct(){const t={addOrRemoveCssClass:(o,r)=>this.addOrRemoveCssClass(o,r),setHeightAndMinHeight:o=>{this.getGui().style.height=o,this.getGui().style.minHeight=o}};this.createManagedBean(new fi).setComp(t,this.getGui(),this.getFocusableElement());const s=o=>{this.createManagedBean(o),this.appendChild(o)};s(new Qn("left")),s(new Qn(null)),s(new Qn("right"))}};Xn.TEMPLATE='<div class="ag-header" role="presentation"/>',u([b],Xn.prototype,"postConstruct",1);var gg=Xn,Ws=class extends T{addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};return this.dragService.addDragSource(t),()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&!0===t.shiftKey;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.getGridCtrl();
1e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e,t){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.getGridCtrl();e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}};u([f("dragService")],Ws.prototype,"dragService",2),u([f("ctrlsService")],Ws.prototype,"ctrlsService",2),Ws=u([O("horizontalResizeService")],Ws);var Wt=class extends T{hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t,i){this.showPopup(e,s=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:i,mouseEvent:t,ePopup:s})},i,t.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(e,t,i){let s=-1,o="left";const r=this.menuService.isLegacyMenuEnabled();!r&&this.gridOptionsService.get("enableRtl")&&(s=1,o="right");let n=r?void 0:4*s,l=r?void 0:4;this.showPopup(e,a=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:a,nudgeX:n,nudgeY:l,alignSide:o,keepWithinBounds:!0,position:"under",column:e})},i,t,r)}showPopup(e,t,i,s,o){const r=e?this.filterManager.getOrCreateFilterWrapper(e,"COLUMN_MENU"):void 0;if(!r||!e)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const n=document.createElement("div");let l;re(n,"presentation"),n.classList.add("ag-menu"),o||n.classList.add("ag-filter-menu"),this.tabListener=this.addManagedListener(n,"keydown",v=>this.trapFocusWithin(v,n)),r.guiPromise.then(v=>n.appendChild(v));const c=this.menuService.isColumnMenuAnchoringEnabled()?s??this.ctrlsService.getGridBodyCtrl().getGui():void 0,g=this.localeService.getLocaleTextFunc(),m=o&&"columnFilter"!==i?g("ariaLabelColumnMenu","Column Menu"):g("ariaLabelColumnFilter","Column Filter"),C=this.popupService.addPopup({modal:!0,eChild:n,closeOnEsc:!0,closedCallback:v=>{e.setMenuVisible(!1,"contextMenu");const E=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),E&&s&&ze(s)){const S=this.focusService.findTabbableParent(s);S&&S.focus()}(()=>{var v;null==(v=r.filterPromise)||v.then(E=>{var S;return null==(S=E?.afterGuiDetached)?void 0:S.call(E)})})(),this.dispatchVisibleChangedEvent(!1,i,e)},positionCallback:()=>t(n),anchorToElement:c,ariaLabel:m});C&&(this.hidePopup=l=C.hideFunc),r.filterPromise.then(v=>{t(n),v.afterGuiAttached&&v.afterGuiAttached({container:i,hidePopup:l})}),e.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,i,e)}trapFocusWithin(e,t){e.key!==w.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,i){this.eventService.dispatchEvent({type:p.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:e,switchingTab:!1,key:t,column:i??null})}isMenuEnabled(e){var t;return e.isFilterAllowed()&&(null!=(t=e.getColDef().menuTabs)?t:["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}};u([f("filterManager")],Wt.prototype,"filterManager",2),u([f("popupService")],Wt.prototype,"popupService",2),u([f("focusService")],Wt.prototype,"focusService",2),u([f("ctrlsService")],Wt.prototype,"ctrlsService",2),u([f("menuService")],Wt.prototype,"menuService",2),Wt=u([O("filterMenuFactory")],Wt);var Zn=class extends T{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1;const{comp:t,eTopGuard:i,eBottomGuard:s,focusTrapActive:o,forceFocusOutWhenTabGuardsAreEmpty:r,focusInnerElement:n,onFocusIn:l,onFocusOut:a,shouldStopEventPropagation:c,onTabKeyDown:h,handleKeyDown:g,eFocusableElement:m}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=s,this.providedFocusInnerElement=n,this.eFocusableElement=m,this.focusTrapActive=!!o,this.forceFocusOutWhenTabGuardsAreEmpty=!!r,this.providedFocusIn=l,this.providedFocusOut=a,this.providedShouldStopEventPropagation=c,this.providedOnTabKeyDown=h,this.providedHandleKeyDown=g}postConstruct(){this.createManagedBean(new Ht(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEac
1h(e=>this.addManagedListener(e,"focus",this.onFocus.bind(this)))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return!!this.providedShouldStopEventPropagation&&this.providedShouldStopEventPropagation()}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gridOptionsService.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.skipTabGuardFocus)return void(this.skipTabGuardFocus=!1);if(this.forceFocusOutWhenTabGuardsAreEmpty&&0===this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length)return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}findNextElementOutsideAndFocus(e){const t=this.gridOptionsService.getDocument(),i=this.focusService.findFocusableElements(t.body,null,!0),s=i.indexOf(e?this.eTopGuard:this.eBottomGuard);if(-1===s)return;let o,r;e?(o=0,r=s):(o=s+1,r=i.length);const n=i.slice(o,r),l=this.gridOptionsService.get("tabIndex");n.sort((a,c)=>{const h=parseInt(a.getAttribute("tabindex")||"0"),g=parseInt(c.getAttribute("tabindex")||"0");return g===l?1:h===l?-1:0===h?1:0===g?-1:h-g}),n[e?n.length-1:0].focus()}onFocusIn(e){this.focusTrapActive||(this.providedFocusIn&&this.providedFocusIn(e),this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown)return void this.providedOnTabKeyDown(e);if(this.focusTrapActive||e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e){return e===this.eTopGuard||e===this.eBottomGuard}};u([f("focusService")],Zn.prototype,"focusService",2),u([b],Zn.prototype,"postConstruct",1);var Us=class extends k{initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.getFocusableElement();const t=[this.eTopGuard,this.eBottomGuard],i={setTabIndex:s=>{t.forEach(o=>null!=s?o.setAttribute("tabindex",s):o.removeAttribute("tabindex"))}};this.addTabGuards(this.eTopGuard,this.eBottomGuard),this.tabGuardCtrl=this.createManagedBean(new Zn({comp:i,focusTrapActive:!!e.focusTrapActive,eTopGuard:this.eTopGuard,eBottomGuard:this.eBottomGuard,eFocusableElement:this.eFocusableElement,onFocusIn:e.onFocusIn,onFocusOut:e.onFocusOut,focusInnerElement:e.focusInnerElement,handleKeyDown:e.handleKeyDown,onTabKeyDown:e.onTabKeyDown,shouldStopEventPropagation:e.shouldStopEventPropagation,forceFocusOutWhenTabGuardsAreEmpty:e.forceFocusOutWhenTabGuardsAreEmpty}))}createTabGuard(e){const t=document.createElement("div");return t.classList.add("ag-tab-guard","top"===e?"ag-tab-guard-top":"ag-tab-guard-bottom"),re(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];ce(this.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t){As(e)||(e=e.getGui());const{eBottomGuard:i}=this;i?i.insertAdjacentElement("beforebegin",e):super.appendChild(e,t)}},ar=class _u extends Us{constructor(t){super(_u.getTemplate(t.cssClass)),this.items=[],this.tabbedItemScrollMap=new Map,this.params=t}postConstruct(){this.setupHeader(),this.params.items&&this.params.items.forEac
1h(t=>this.addItem(t)),this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),focusInnerElement:this.focusInnerElement.bind(this),focusTrapActive:!0}),this.addDestroyFunc(()=>{var t,i,s;return null==(s=null==(i=null==(t=this.activeItem)?void 0:t.tabbedItem)?void 0:i.afterDetachedCallback)?void 0:s.call(i)})}static getTemplate(t){return`<div class="ag-tabs ${t}">\n <div ref="eHeader"></div>\n <div ref="eBody" role="presentation" class="ag-tabs-body ${t?`${t}-body`:""}"></div>\n </div>`}setupHeader(){const{enableCloseButton:t,cssClass:i}=this.params,s=(o,r)=>{o.classList.add(`ag-tabs-${r}`),i&&o.classList.add(`${i}-${r}`)};t?(this.setupCloseButton(s),this.eTabHeader=this.gridOptionsService.getDocument().createElement("div"),s(this.eHeader,"header-wrapper"),re(this.eHeader,"presentation"),this.eHeader.appendChild(this.eTabHeader)):this.eTabHeader=this.eHeader,re(this.eTabHeader,"tablist"),s(this.eTabHeader,"header")}setupCloseButton(t){const i=this.gridOptionsService.getDocument(),s=i.createElement("button");t(s,"close-button");const o=oe("close",this.gridOptionsService,void 0,!0);lt(s,this.params.closeButtonAriaLabel),s.appendChild(o),this.addManagedListener(s,"click",()=>{var n,l;return null==(l=(n=this.params).onCloseClicked)?void 0:l.call(n)});const r=i.createElement("div");t(r,"close-button-wrapper"),re(r,"presentation"),r.appendChild(s),this.eHeader.appendChild(r),this.eCloseButton=s}handleKeyDown(t){const i=this.gridOptionsService.getDocument();switch(t.key){case w.RIGHT:case w.LEFT:if(!this.eTabHeader.contains(i.activeElement))return;const s=t.key===w.RIGHT,o=this.gridOptionsService.get("enableRtl"),r=this.items.indexOf(this.activeItem),n=s!==o?Math.min(r+1,this.items.length-1):Math.max(r-1,0);if(r===n)return;t.preventDefault();const l=this.items[n];this.showItemWrapper(l),l.eHeaderButton.focus();break;case w.UP:case w.DOWN:t.stopPropagation()}}onTabKeyDown(t){var i,s,o,r;if(t.defaultPrevented)return;const{focusService:n,eHeader:l,eBody:a,activeItem:c,params:h}=this,{suppressTrapFocus:g,enableCloseButton:m}=h,v=this.gridOptionsService.getDocument().activeElement,E=t.target,S=t.shiftKey;if(l.contains(v))return t.preventDefault(),void(!m||!S||null!=(i=this.eCloseButton)&&i.contains(v)?g&&S?null==(o=this.focusService.findFocusableElementBeforeTabGuard(this.gridOptionsService.getDocument().body,E))||o.focus():this.focusBody(t.shiftKey):null==(s=this.eCloseButton)||s.focus());let D=null;if(n.isTargetUnderManagedComponent(a,E)&&(S&&(D=this.focusService.findFocusableElementBeforeTabGuard(a,E)),!D&&!g&&(D=c.eHeaderButton)),!D&&a.contains(v)&&(D=n.findNextFocusableElement(a,!1,S),!D))return t.preventDefault(),void(g&&!S?this.forceFocusOutOfContainer(S):m&&!S?null==(r=this.eCloseButton)||r.focus():this.focusHeader());D&&(t.preventDefault(),D.focus())}focusInnerElement(t){t?this.focusHeader():this.focusBody(!0)}focusHeader(t){this.activeItem.eHeaderButton.focus({preventScroll:t})}focusBody(t){this.focusService.focusInto(this.eBody,t)}setAfterAttachedParams(t){this.afterAttachedParams=t}showFirstItem(){this.items.length>0&&this.showItemWrapper(this.items[0])}addItem(t){const i=document.createElement("span");re(i,"tab"),i.setAttribute("tabindex","-1"),i.appendChild(t.title),i.classList.add("ag-tab"),this.eTabHeader.appendChild(i),lt(i,t.titleLabel);const s={tabbedItem:t,eHeaderButton:i};this.items.push(s),i.addEventListener("click",this.showItemWrapper.bind(this,s))}showItem(t){const i=this.items.find(s=>s.tabbedItem===t);i&&this.showItemWrapper(i)}showItemWrapper(t){var i,s,o,r,n,l;const{tabbedItem:a,eHeaderButton:c}=t;null==(s=(i=this.params).onItemClicked)||s.call(i,{item:a}),this.activeItem!==t?(this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),ce(this.eBody),a.bodyPromise.then(h=>{this.eBody.appendChild(h);const g=!this.focusService.isKeyboardMode();if(this.params.suppressFocusBodyOnOpen||this.focusService.focusInto(this.eBody,!1,g),a.afterAttachedCallback&&a.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const m=a.getScrollableContainer&&a.getScrollableContainer()||h;this.lastScrollListener=this.addManagedListener(m,"scroll",()=>{this.tabbedItemScrollMap.set(a.name,m.scrollTop)});const C=this.tabbedItemScrollMap.get(a.name);void 0!==C&&setTimeout(()=>{m.scrollTop=C},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),null==(l=(n=this.activeItem.tabbedItem).afterDetachedCallback)||l.call(n)),c.classList.add("ag-tab-selected"),this.activeItem=t):null==(r=(o=this.params).onActiveItem
1Clicked)||r.call(o)}};u([f("focusService")],ar.prototype,"focusService",2),u([A("eHeader")],ar.prototype,"eHeader",2),u([A("eBody")],ar.prototype,"eBody",2),u([b],ar.prototype,"postConstruct",1);var Jn=class extends T{constructor(){super(...arguments),this.polyfillFunctions=[]}observeResize(e,t){const i=this.gridOptionsService.getWindow(),o=()=>{var l,a;let c=null!=(l=e?.clientWidth)?l:0,h=null!=(a=e?.clientHeight)?a:0,g=!0;const m=()=>{var C,v;if(g){const E=null!=(C=e?.clientWidth)?C:0,S=null!=(v=e?.clientHeight)?v:0;(E!==c||S!==h)&&(c=E,h=S,t()),this.doNextPolyfillTurn(m)}};return m(),()=>g=!1},r=this.gridOptionsService.get("suppressBrowserResizeObserver");return i.ResizeObserver&&!r?(()=>{const l=new i.ResizeObserver(t);return l.observe(e),()=>l.disconnect()})():this.getFrameworkOverrides().wrapIncoming(()=>o(),"resize-observer")}doNextPolyfillTurn(e){this.polyfillFunctions.push(e),this.schedulePolyfill()}schedulePolyfill(){this.polyfillScheduled||(this.polyfillScheduled=!0,window.setTimeout(()=>{const t=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],t.forEach(i=>i())},50))}};Jn=u([O("resizeObserverService")],Jn);var Zi=class extends T{constructor(){super(...arguments),this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}setScrollTop(e){const t=this.gridOptionsService.get("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&0===e){const i=this.paginationProxy.getCurrentPage();i!==this.lastPage&&(this.lastPage=i,this.scrollGoingDown=!0)}this.lastScrollTop=e}init(){this.useAnimationFrame=!this.gridOptionsService.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){!1===this.useAnimationFrame&&console.warn(`AG Grid: AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const s={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],s),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort((i,s)=>i.index!==s.index?t*(s.index-i.index):s.createOrder-i.createOrder),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,i=t.list,s=this.createTasksP2,o=s.list,r=this.destroyTasks,n=(new Date).getTime();let l=(new Date).getTime()-n;const a=e<=0,c=this.ctrlsService.getGridBodyCtrl();for(;a||l<e;){if(!c.getScrollFeature().scrollGridIfNeeded()){let g;if(i.length)this.sortTaskList(t),g=i.pop().task;else if(o.length)this.sortTaskList(s),g=o.pop().task;else{if(!r.length){this.cancelledTasks.clear();break}g=r.pop()}this.cancelledTasks.has(g)||g()}l=(new Date).getTime()-n}i.length||o.length||r.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=this.gridOptionsService.getWindow();t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{this.isOn()?t||(t=!0,this.addDestroyTask(()=>{t=!1,e()})):window.setTimeout(e,0)}}};u([f("ctrlsService")],Zi.prototype,"ctrlsService",2),u([f("paginationProxy")],Zi.prototype,"paginationProxy",2),u([b],Zi.prototype,"init",1),Zi=u([O("animationFrameService")],Zi);var zs=class extends T{postConstruct(){this.isClientSideRowModel="clientSide"===this.rowModel.getType()}expandRows(e){if(!this.isClientSideRowModel)return;const t=new Set(e);this.rowModel.forEachNode(i=>{i.id&&t.has(i.id)&&(i.expanded=!0)}),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const e=[];return this.rowModel.forEachNode(({expanded:t,id:i}
1)=>{t&&i&&e.push(i)}),e}expandAll(e){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(e)}setRowNodeExpanded(e,t,i){e&&(i&&e.parent&&-1!==e.parent.level&&this.setRowNodeExpanded(e.parent,t,i),e.setExpanded(t))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}};u([f("rowModel")],zs.prototype,"rowModel",2),u([b],zs.prototype,"postConstruct",1),zs=u([O("expansionService")],zs);var ct=class extends T{postConstruct(){var e;this.activeMenuFactory=null!=(e=this.enterpriseMenuFactory)?e:this.filterMenuFactory}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const t=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(t,e,e.containerType,!0)}showHeaderContextMenu(e,t,i){this.activeMenuFactory.showMenuAfterContextMenuEvent(e,t,i)}showContextMenu(e){var t,i,s;const{column:o,anchorToElement:r,rowNode:n,value:l}=e;null==(s=this.contextMenuFactory)||s.onContextMenu(null!=(t=e.mouseEvent)?t:null,null!=(i=e.touchEvent)?i:null,n??null,o??null,l,r)}showColumnChooser(e){var t;null==(t=this.columnChooserFactory)||t.showColumnChooser(e)}hidePopupMenu(){var e;null==(e=this.contextMenuFactory)||e.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){var e;null==(e=this.columnChooserFactory)||e.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(e){const{suppressMenu:t,suppressHeaderMenuButton:i}=e.getColDef();return!(i??t)&&this.activeMenuFactory.isMenuEnabled(e)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&this.filterManager.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!e?.getColDef().suppressHeaderContextMenu&&"new"===this.getColumnMenuType()}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(At()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return this.filterManager.isFilterAllowed(e)&&!this.isLegacyMenuEnabled()&&!this.isFilterMenuInHeaderEnabled(e)&&!this.isFloatingFilterButtonDisplayed(e)}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return"new"===this.getColumnMenuType()}isLegacyMenuEnabled(){return"legacy"===this.getColumnMenuType()}isFloatingFilterButtonEnabled(e){var t;const i=e.getColDef(),s=null==(t=i.floatingFilterComponentParams)?void 0:t.suppressFilterButton;return null!=s&&x("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),null==i.suppressFloatingFilterButton?!s:!i.suppressFloatingFilterButton}getColumnMenuType(){var e;return null!=(e=this.gridOptionsService.get("columnMenu"))?e:"legacy"}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gridOptionsService.get("suppressMenuHide");return!this.isLegacyMenuEnabled()&&!this.gridOptionsService.exists("suppressMenuHide")||e}showColumnMenuCommon(e,t,i,s){const{column:o,positionBy:r}=t;if("button"===r){const{buttonElement:n}=t;e.showMenuAfterButtonClick(o,n,i,s)}else if("mouse"===r){const{mouseEvent:n}=t;e.showMenuAfterMouseEvent(o,n,i,s)}else o&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(o,"auto"),this.animationFrameService.requestAnimationFrame(()=>{const n=this.ctrlsService.getHeaderRowContainerCtrl(o.getPinned()).getHeaderCtrlForColumn(o);e.showMenuAfterButtonClick(o,n.getAnchorElementForMenu(s),i,!0)}))}};u([z("enterpriseMenuFactory")],ct.prototype,"enterpriseMenuFactory",2),u([f("filterMenuFactory")],ct.prototype,"filterMenuFactory",2),u([z("contextMenuFactory")],ct.prototype,"contextMenuFactory",2),u([f("ctrlsService")],ct.prototype,"ctrlsService",2),u([f("animationFrameService")],ct.prototype,"animationFrameService",2),u([z("columnChooserFactory")],ct.prototype,"columnChooserFactory",2),u([f("filterManager")],ct.prototype,"filterManager",2),u([b],ct.prototype,"postConstruct",1),ct=u([O("menuService")],ct);var mi=class extends T{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowContainerCtrl=e.centerRowContainerCtrl})}getPreferredWidthForColumn(e,t){const i=this.getHeaderCellForColumn(e);if(!i)return-1;const s=this.rowRenderer.getAllCellsForColumn(e);return t||s.push(i),this.addElementsToContainerAndGetWidth(s)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const i=this.centerRowContainerCtrl.getContainerElement();e.forEach(r=>this.cloneItemIntoDummy(r,t)),i.appendChild(t);const s=t.offsetWidth;return i.removeChild(t),s+this.getAutoSizePadding()}getAutoSizePadding(){return this.gridOptionsService.get("autoSizePadding")}getHeaderCellForColumn(e){let t=null;
1return this.ctrlsService.getHeaderRowContainerCtrls().forEach(i=>{const s=i.getHtmlElementForColumnHeader(e);null!=s&&(t=s)}),t}cloneItemIntoDummy(e,t){const i=e.cloneNode(!0);i.style.width="",i.style.position="static",i.style.left="";const s=document.createElement("div"),o=s.classList;["ag-header-cell","ag-header-group-cell"].some(l=>i.classList.contains(l))?(o.add("ag-header","ag-header-row"),s.style.position="static"):o.add("ag-row");let n=e.parentElement;for(;n;){if(["ag-header-row","ag-row"].some(a=>n.classList.contains(a))){for(let a=0;a<n.classList.length;a++){const c=n.classList[a];"ag-row-position-absolute"!=c&&o.add(c)}break}n=n.parentElement}s.appendChild(i),t.appendChild(s)}};u([f("rowRenderer")],mi.prototype,"rowRenderer",2),u([f("ctrlsService")],mi.prototype,"ctrlsService",2),u([f("rowCssClassCalculator")],mi.prototype,"rowCssClassCalculator",2),u([b],mi.prototype,"postConstruct",1),mi=u([O("autoWidthCalculator")],mi);var Ks=class extends T{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyRowCtrls=[],this.containerHeight=0}postConstruct(){this.isClientSide="clientSide"===this.rowModel.getType(),this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl})}getStickyRowCtrls(){return this.stickyRowCtrls}checkStickyRows(){let e=0;if(!this.gridOptionsService.isGroupRowsSticky())return this.refreshNodesAndContainerHeight([],e);const t=[],i=this.rowRenderer.getFirstVisibleVerticalPixel(),s=r=>{var n,l,a;let c;if(t.push(r),this.isClientSide){let g=r;for(;g.isExpandable()&&g.expanded;)if(g.master)g=g.detailNode;else if(g.childrenAfterSort){if(0===g.childrenAfterSort.length)break;g=K(g.childrenAfterSort)}c=g.rowTop+g.rowHeight}else if(r.master)c=r.detailNode.rowTop+r.detailNode.rowHeight;else{const g=null==(n=r.childStore)?void 0:n.getStoreBounds();c=(null!=(l=g?.heightPx)?l:0)+(null!=(a=g?.topPx)?a:0)}const h=i+e+r.rowHeight;r.stickyRowTop=c<h?e+(c-h):e,e=0,t.forEach(g=>{const m=g.stickyRowTop+g.rowHeight;e<m&&(e=m)})};let o=0;for(;;){const r=i+e,n=this.rowModel.getRowIndexAtPixel(r),l=this.rowModel.getRow(n);if(null==l||l.level<0||100==o++)break;const a=[];let c=l.parent;for(;c.level>=0;)a.push(c),c=c.parent;const h=a.reverse().find(g=>t.indexOf(g)<0&&g.displayed);if(h)s(h);else{if(!(l.isExpandable()&&l.expanded&&l.rowTop<r))break;s(l)}}return this.refreshNodesAndContainerHeight(t,e)}refreshStickyNode(e){const t=[];for(let i=0;i<this.stickyRowCtrls.length;i++){const s=this.stickyRowCtrls[i].getRowNode();s!==e&&t.push(s)}this.refreshNodesAndContainerHeight(t,this.containerHeight)&&this.checkStickyRows()}refreshNodesAndContainerHeight(e,t){let i=!1;const s=this.stickyRowCtrls.filter(l=>-1===e.indexOf(l.getRowNode())),o=e.filter(l=>-1===this.stickyRowCtrls.findIndex(a=>a.getRowNode()===l));(s.length||o.length)&&(i=!0);const r={};s.forEach(l=>{r[l.getRowNode().id]=l,this.stickyRowCtrls=this.stickyRowCtrls.filter(a=>a!==l)});for(const l of Object.values(r))l.getRowNode().sticky=!1;this.destroyRowCtrls(r,!1);const n=o.map(l=>(l.sticky=!0,this.createRowCon(l,!1,!1)));return this.stickyRowCtrls.push(...n),this.stickyRowCtrls.forEach(l=>l.setRowTop(l.getRowNode().stickyRowTop)),this.stickyRowCtrls.sort((l,a)=>a.getRowNode().rowIndex-l.getRowNode().rowIndex),this.containerHeight!==t&&(this.containerHeight=t,this.gridBodyCtrl.setStickyTopHeight(t),i=!0),i}};u([f("rowModel")],Ks.prototype,"rowModel",2),u([f("rowRenderer")],Ks.prototype,"rowRenderer",2),u([f("ctrlsService")],Ks.prototype,"ctrlsService",2),u([b],Ks.prototype,"postConstruct",1);var $e=class extends T{constructor(){super(...arguments),this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{this.getAllCellCtrls().forEach(r=>r.onRangeSelectionChanged())},t=()=>{this.getAllCellCtrls().forEach(r=>r.updateRangeBordersIfRangeCount())},i=()=>{this.eventService.addEventListener(p.EVENT_RANGE_SELECTION_CHANGED,e),this.eventService.addEventListener(p.EVENT_COLUMN_MOVED,t),this.eventService.addEventListener(p.EVENT_COLUMN_PINNED,t),this.eventService.addEventListener(p.EVENT_COLUMN_VISIBLE,t)},s=()=>{this.eventService.removeEventListener(p.EVENT_RANGE_SELECTION_CHANGED,e),this.eventService.removeEventListener(p.EVENT_COLUMN_MOVED,t),this.eventService.removeEventListener(p.EVENT_COLUMN_PINNED,t),this.eventService.removeEventListener(p.EVENT_COLUMN_VISIBLE,t)};this.addDestroyFunc(()=>s()),this.addManagedPropertyListener("enableRangeSelection",r=>{r.currentValue?i():s()}),this.gridOptionsService.get("enableRangeSelection")&&i()}}postConstruct(){this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl(),this.initialise()})}initialise(){if(this.addManagedListener(this.eventService,p.EVENT_PAGINATION_CHANGED,this.onPageLoaded.bind(this)),this.addManagedListener(this.eventService,p.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_BODY_SCROLL,this.onBodyScroll.bind(this)),this.addManagedListener(this.eventService,p.EVENT_BODY_HEIGHT_CHANGED,this.redraw.bind(this)),this.addManagedPropertyListeners(["domL
1ayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListeners(["suppressCellFocus","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],()=>this.redrawRows()),this.gridOptionsService.isGroupRowsSticky()){const e=this.rowModel.getType();("clientSide"===e||"serverSide"===e)&&(this.stickyRowFeature=this.createManagedBean(new Ks(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this))))}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=this.gridOptionsService.isDomLayout("print"),this.embedFullWidthRows=this.printLayout||this.gridOptionsService.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gridOptionsService.get("keepDetailRows")){const e=this.getKeepDetailRowsCount();this.cachedRowCtrls=new vg(e??3)}}getKeepDetailRowsCount(){return this.gridOptionsService.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyRowCtrls():[]}updateAllRowCtrls(){const e=Nt(this.rowCtrlsByRowIndex),t=Nt(this.zombieRowCtrls),i=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];this.allRowCtrls=t.length>0||i.length>0?[...e,...t,...i]:e}onCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onCellFocused(e)),this.getFullWidthRowCtrls().forEach(t=>t.onFullWidthRowFocused(e))}registerCellEventListeners(){this.addManagedListener(this.eventService,p.EVENT_CELL_FOCUSED,e=>{this.onCellFocusChanged(e)}),this.addManagedListener(this.eventService,p.EVENT_CELL_FOCUS_CLEARED,()=>{this.onCellFocusChanged()}),this.addManagedListener(this.eventService,p.EVENT_FLASH_CELLS,e=>{this.getAllCellCtrls().forEach(t=>t.onFlashCells(e))}),this.addManagedListener(this.eventService,p.EVENT_COLUMN_HOVER_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onColumnHover())}),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onDisplayedColumnsChanged())}),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>{this.printLayout&&this.getAllCellCtrls().forEach(e=>e.onLeftChanged())}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedListener(this.eventService,p.EVENT_GRID_COLUMNS_CHANGED,this.refreshListenersToColumnsForCellComps.bind(this)),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach(e=>e()),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners(),this.columnModel.getAllGridColumns().forEach(t=>{const i=a=>{this.getAllCellCtrls().forEach(c=>{c.getColumn()===t&&a(c)})},s=()=>{i(a=>a.onLeftChanged())},o=()=>{i(a=>a.onWidthChanged())},r=()=>{i(a=>a.onFirstRightPinnedChanged())},n=()=>{i(a=>a.onLastLeftPinnedChanged())},l=()=>{i(a=>a.onColDefChanged())};t.addEventListener("leftChanged",s),t.addEventListener("widthChanged",o),t.addEventListener("firstRightPinnedChanged",r),t.addEventListener("lastLeftPinnedChanged",n),t.addEventListener("colDefChanged",l),this.destroyFuncsForColumnListeners.push(()=>{t.removeEventListener("leftChanged",s),t.removeEventListener("widthChanged",o),t.removeEventListener("firstRightPinnedChanged",r),t.removeEventListener("lastLeftPinnedChanged",n),t.removeEventListener("colDefChanged",l)})})}onDomLayoutChanged(){const e=this.gridOptionsService.isDomLayout("print"),t=e||this.gridOptionsService.get("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){this.redrawAfterModelUpdate({recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0})}getAllCellsForColumn(e){const t=[];
1return this.getAllRowCtrls().forEach(i=>{const s=i.getCellElement(e);s&&t.push(s)}),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,this.pinnedRowModel.getPinnedTopRowData()),this.refreshFloatingRows(this.bottomRowCtrls,this.pinnedRowModel.getPinnedBottomRowData())}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){e.forEach(i=>{i.destroyFirstPass(),i.destroySecondPass()}),e.length=0,t&&t.forEach(i=>{const s=new di(i,this.beans,!1,!1,this.printLayout);e.push(s)})}onPinnedRowDataChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(e,t=!1){var i;if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else{if(null!=(i=this.cachedRowCtrls)&&i.has(e))return void this.cachedRowCtrls.removeRow(e);{const s=o=>{const r=o[e.rowIndex];r&&r.getRowNode()===e&&(r.destroyFirstPass(),r.destroySecondPass(),o[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":s(this.topRowCtrls);break;case"bottom":s(this.bottomRowCtrls);break;default:s(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(null!=e)return e?.forEach(i=>this.redrawRow(i,!0)),void this.dispatchDisplayedRowsChanged(!1);this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=e?.suppressKeepFocus?null:this.focusService.getFocusCellToUseAfterRefresh();if(null==t)return null;const s=this.gridOptionsService.getDocument().activeElement,o=this.gridOptionsService.getDomData(s,ai.DOM_DATA_KEY_CELL_CTRL),r=this.gridOptionsService.getDomData(s,di.DOM_DATA_KEY_ROW_CTRL);return o||r?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);
1const i=!e.domLayoutChanged&&!!e.recycleRows,s=e.animate&&this.gridOptionsService.isAnimateRows(),o=i?this.getRowsToRecycle():null;i||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature&&this.stickyRowFeature.checkStickyRows(),this.recycleRows(o,s),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),null!=t&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,i=this.gridOptionsService.get("suppressScrollOnNewData");t&&!i&&this.gridBodyCtrl.getScrollFeature().scrollToTop()}updateContainerHeights(){if(this.printLayout)return void this.rowContainerHeightService.setModelHeight(null);let e=this.paginationProxy.getCurrentPageHeight();0===e&&(e=1),this.rowContainerHeightService.setModelHeight(e)}getLockOnRefresh(){if(this.refreshInProgress)throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }
1, 0). To see what part of your code that caused the refresh check this stacktrace.");this.refreshInProgress=!0}releaseLockOnRefresh(){this.refreshInProgress=!1}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&(this.focusService.setRestoreFocusedCell(e),this.onCellFocusChanged(this.beans.gridOptionsService.addGridCommonParams({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"mock"})))}stopEditing(e=!1){this.getAllRowCtrls().forEach(t=>{t.stopEditing(e)})}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let s=0;s<i;s++){const o=t[s].getAllCellCtrls(),r=o.length;for(let n=0;n<r;n++)e.push(o[n])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyRowCtrls()||[],t=[...this.topRowCtrls,...this.bottomRowCtrls,...e];for(const i of Object.keys(this.rowCtrlsByRowIndex))t.push(this.rowCtrlsByRowIndex[i]);return t}addRenderedRowListener(e,t,i){const s=this.rowCtrlsByRowIndex[t];s&&s.addEventListener(e,i)}flashCells(e={}){this.getCellCtrls(e.rowNodes,e.columns).forEach(t=>t.flashCell(e))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};this.getCellCtrls(e.rowNodes,e.columns).forEach(i=>i.refreshOrDestroyCell(t)),e.rowNodes&&(this.getRowCtrls(e.rowNodes).forEach(i=>{i.isFullWidth()&&(i.refreshFullWidth()||this.redrawRow(i.getRowNode(),!0))}),this.dispatchDisplayedRowsChanged(!1))}getCellRendererInstances(e){var t;const i=this.getCellCtrls(e.rowNodes,e.columns).map(r=>r.getCellRenderer()).filter(r=>null!=r);if(null!=(t=e.columns)&&t.length)return i;const s=[],o=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach(r=>{if(o&&!this.isRowInMap(r.getRowNode(),o)||!r.isFullWidth())return;const n=r.getFullWidthCellRenderers();for(let l=0;l<n.length;l++){const a=n[l];null!=a&&s.push(a)}}),[...s,...i]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach(i=>{const s=i.getCellEditor();s&&t.push(s)}),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach(t=>{if(t.isEditing()){const i=t.getCellPosition();e.push(i)}}),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach(i=>{const s=i.id;"top"===i.rowPinned?t.top[s]=i:"bottom"===i.rowPinned?t.bottom[s]=i:t.normal[s]=i}),t}isRowInMap(e,t){const i=e.id,s=e.rowPinned;return"bottom"===s?null!=t.bottom[i]:"top"===s?null!=t.top[i]:null!=t.normal[i]}getRowCtrls(e){const t=this.mapRowNodes(e),i=this.getAllRowCtrls();return e&&t?i.filter(s=>{const o=s.getRowNode();return this.isRowInMap(o,t)}):i}getCellCtrls(e,t){let i;R(t)&&(i={},t.forEach(o=>{const r=this.columnModel.getGridColumn(o);R(r)&&(i[r.getId()]=!0)}));const s=[];return this.getRowCtrls(e).forEach(o=>{o.getAllCellCtrls().forEach(r=>{const n=r.getColumn().getId();i&&!i[n]||s.push(r)})}),s}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}getRowsToRecycle(){const e=[];Se(this.rowCtrlsByRowIndex,(i,s)=>{null==s.getRowNode().id&&e.push(i)}),this.removeRowCtrls(e);const t={};return Se(this.rowCtrlsByRowIndex,(i,s)=>{const o=s.getRowNode();t[o.id]=s}),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){e.forEach(i=>{const s=this.rowCtrlsByRowIndex[i];s&&(s.destroyFirstPass(t),s.destroySecondPass()),delete this.rowCtrlsByRowIndex[i]})}onBodyScroll(e){"vertical"===e.direction&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let i;this.stickyRowFeature&&hn()&&(i=this.getCellToRestoreFocusToAfterRefresh()||void 0);const s=this.firstRenderedRow,o=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let r=!1;if(this.stickyRowFeature&&(r=this.stickyRowFeature.checkStickyRows()),(!t||r||this.firstRenderedRow!==s||this.lastRenderedRow!==o)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t&&!r),null!=i)){const l=this.getCellToRestoreFocusToAfterRefresh();null!=i&&null==l&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const i={};e.forEach(r=>i[r]=!0);const o=Object.keys(this.rowCtrlsByRowIndex).filter(r=>!i[r]);this.removeRowCtrls(o,t)}
1calculateIndexesToDraw(e){let t=Fa(this.firstRenderedRow,this.lastRenderedRow);const i=(o,r)=>{const n=r.getRowNode().rowIndex;null!=n&&(n<this.firstRenderedRow||n>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(r)&&t.push(n)};Se(this.rowCtrlsByRowIndex,i),Se(e,i),t.sort((o,r)=>o-r);const s=[];for(let o=0;o<t.length;o++){const r=t[o],n=this.paginationProxy.getRow(r);n&&!n.sticky&&s.push(r)}return s}recycleRows(e,t=!1,i=!1){const s=this.calculateIndexesToDraw(e);(this.printLayout||i)&&(t=!1),this.removeRowCompsNotToDraw(s,!t);const o=[];s.forEach(r=>{const n=this.createOrUpdateRowCtrl(r,e,t,i);R(n)&&o.push(n)}),e&&(!i||this.gridOptionsService.get("suppressAnimationFrame")||this.printLayout?this.destroyRowCtrls(e,t):this.beans.animationFrameService.addDestroyTask(()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()})),this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){this.eventService.dispatchEvent({type:p.EVENT_DISPLAYED_ROWS_CHANGED,afterScroll:e})}onDisplayedColumnsChanged(){const e=this.columnModel.isPinningLeft(),t=this.columnModel.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach(t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())}),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter(i=>{if(!i.isFullWidth())return!1;const s=i.getRowNode();return!(null!=t&&!this.isRowInMap(s,t))})}createOrUpdateRowCtrl(e,t,i,s){let o,r=this.rowCtrlsByRowIndex[e];if(r||(o=this.paginationProxy.getRow(e),R(o)&&R(t)&&t[o.id]&&o.alreadyRendered&&(r=t[o.id],t[o.id]=null)),!r){if(o||(o=this.paginationProxy.getRow(e)),!R(o))return;r=this.createRowCon(o,i,s)}return o&&(o.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=r,r}destroyRowCtrls(e,t){const i=[];Se(e,(s,o)=>{if(o){if(this.cachedRowCtrls&&o.isCacheable())return void this.cachedRowCtrls.addRow(o);o.destroyFirstPass(!t),t?(this.zombieRowCtrls[o.getInstanceId()]=o,i.push(()=>{o.destroySecondPass(),delete this.zombieRowCtrls[o.getInstanceId()]})):o.destroySecondPass()}}),t&&(i.push(()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),kl(i))}getRowBuffer(){return this.gridOptionsService.get("rowBuffer")}getRowBufferInPixels(){return this.getRowBuffer()*this.gridOptionsService.getRowHeightAsNumber()}workOutFirstAndLastRowsToRender(){let e,t;if(this.rowContainerHeightService.updateOffset(),this.paginationProxy.isRowsToRender())if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.paginationProxy.getPageFirstRow(),t=this.paginationProxy.getPageLastRow();else{const l=this.getRowBufferInPixels(),a=this.ctrlsService.getGridBodyCtrl(),c=this.gridOptionsService.get("suppressRowVirtualisation");let g,m,h=!1;do{const D=this.paginationProxy.getPixelOffset(),{pageFirstPixel:y,pageLastPixel:P}=this.paginationProxy.getCurrentPagePixelRange(),F=this.rowContainerHeightService.getDivStretchOffset(),M=a.getScrollFeature().getVScrollPosition(),I=M.top,_=M.bottom;c?(g=y+F,m=P+F):(g=Math.max(I+D-l,y)+F,m=Math.min(_+D+l,P)+F),this.firstVisibleVPixel=Math.max(I+D,y)+F,h=this.ensureAllRowsInRangeHaveHeightsCalculated(g,m)}while(h);let C=this.paginationProxy.getRowIndexAtPixel(g),v=this.paginationProxy.getRowIndexAtPixel(m);const E=this.paginationProxy.getPageFirstRow(),S=this.paginationProxy.getPageLastRow();C<E&&(C=E),v>S&&(v=S),e=C,t=v}else e=0,t=-1;const i=this.gridOptionsService.isDomLayout("normal"),s=this.gridOptionsService.get("suppressMaxRenderedRowRestriction"),o=Math.max(this.getRowBuffer(),500);i&&!s&&t-e>o&&(t=e+o),e===this.firstRenderedRow&&t===this.lastRenderedRow||(this.firstRenderedRow=e,this.lastRenderedRow=t,this.eventService.dispatchEvent({type:p.EVENT_VIEWPORT_CHANGED,firstRow:e,lastRow:t}))}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const e={type:p.EVENT_FIRST_DATA_RENDERED,firstRow:this.firstRen
1deredRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame(()=>{this.beans.eventService.dispatchEvent(e)})}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const i=this.paginationProxy.ensureRowHeightsValid(e,t,-1,-1);return i&&this.updateContainerHeights(),i}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const s=e.getRowNode(),o=this.focusService.isRowNodeFocused(s),r=e.isEditing();return!!(o||r||s.detail)&&!!this.paginationProxy.isRowPresent(s)}createRowCon(e,t,i){const s=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(s)return s;const o=this.gridOptionsService.get("suppressAnimationFrame");return new di(e,this.beans,t,i&&!o&&!this.printLayout,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.keys(e).map(t=>e[t].getRowNode())}getRowByPosition(e){let t;const{rowIndex:i}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[i];break;case"bottom":t=this.bottomRowCtrls[i];break;default:t=this.rowCtrlsByRowIndex[i],t||(t=this.getStickyTopRowCtrls().find(s=>s.getRowNode().rowIndex===i)||null)}return t}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}isRangeInRenderedViewport(e,t){return null!=e&&null!=t&&!(t<this.firstRenderedRow||e>this.lastRenderedRow)}};u([f("animationFrameService")],$e.prototype,"animationFrameService",2),u([f("paginationProxy")],$e.prototype,"paginationProxy",2),u([f("columnModel")],$e.prototype,"columnModel",2),u([f("pinnedRowModel")],$e.prototype,"pinnedRowModel",2),u([f("rowModel")],$e.prototype,"rowModel",2),u([f("focusService")],$e.prototype,"focusService",2),u([f("beans")],$e.prototype,"beans",2),u([f("rowContainerHeightService")],$e.prototype,"rowContainerHeightService",2),u([f("ctrlsService")],$e.prototype,"ctrlsService",2),u([b],$e.prototype,"postConstruct",1),$e=u([O("rowRenderer")],$e);var vg=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const t=this.entriesList[0];t.destroyFirstPass(),t.destroySecondPass(),this.removeFromCache(t)}}getRow(e){if(null==e||null==e.id)return null;const t=this.entriesMap[e.id];return t?(this.removeFromCache(t),t.setCached(!1),t.getRowNode()!=e?null:t):null}has(e){return null!=this.entriesMap[e.id]}removeRow(e){const t=e.id,i=this.entriesMap[t];delete this.entriesMap[t],Le(this.entriesList,i)}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],Le(this.entriesList,e)}getEntries(){return this.entriesList}},dr=class extends T{formatValue(e,t,i,s,o=!0){let n,r=null;const l=e.getColDef();if(s?n=s:o&&(n=l.valueFormatter),n){const a=this.gridOptionsService.addGridCommonParams({value:i,node:t,data:t?t.data:null,colDef:l,column:e});r="function"==typeof n?n(a):this.expressionService.evaluate(n,a)}else if(l.refData)return l.refData[i]||"";return null==r&&Array.isArray(i)&&(r=i.join(", ")),r}};u([f("expressionService")],dr.prototype,"expressionService",2),dr=u([O("valueFormatterService")],dr);var $s=class extends T{init(){this.setPinnedTopRowData(),this.setPinnedBottomRowData(),this.addManagedPropertyListener("pinnedTopRowData",()=>this.setPinnedTopRowData()),this.addManagedPropertyListener("pinnedBottomRowData",()=>this.setPinnedBottomRowData())}isEmpty(e){return Be("top"===e?this.pinnedTopRows:this.pinnedBottomRows)}isRowsToRender(e){return!this.isEmpty(e)}getRowAtPixel(e,t){const i="top"===t?this.pinnedTopRows:this.pinnedBottomRows;if(Be(i))return 0;for(let s=0;s<i.length;s++){const o=i[s];if(o.rowTop+o.rowHeight-1>=e)return s}return i.length-1}setPinnedTopRowData(){const e=this.gridOptionsService.get("pinnedTopRowData");this.pinnedTopRows=this.createNodesFromData(e,!0),this.eventService.dispatchEvent({type:p.EVENT_PINNED_ROW_DATA_CHANGED})}setPinnedBottomRowData(){const e=this.gridOptionsService.get("pinnedBottomRowData");this.pinnedBottomRows=this.createNodesFromData(e,!1),this.eventService.dispatchEvent({type:p.EVENT_PINNED_ROW_DATA_CHANGED})}createNodesFromData(e,t){const i=[];if(e){let s=0;e.forEach((o,r)=>
1{const n=new B(this.beans);n.data=o,n.id=(t?B.ID_PREFIX_TOP_PINNED:B.ID_PREFIX_BOTTOM_PINNED)+r,n.rowPinned=t?"top":"bottom",n.setRowTop(s),n.setRowHeight(this.gridOptionsService.getRowHeightForNode(n).height),n.setRowIndex(r),s+=n.rowHeight,i.push(n)})}return i}getPinnedTopRowData(){return this.pinnedTopRows}getPinnedBottomRowData(){return this.pinnedBottomRows}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedTopRowCount(){return this.pinnedTopRows?this.pinnedTopRows.length:0}getPinnedBottomRowCount(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0}getPinnedTopRow(e){return this.pinnedTopRows[e]}getPinnedBottomRow(e){return this.pinnedBottomRows[e]}forEachPinnedTopRow(e){Be(this.pinnedTopRows)||this.pinnedTopRows.forEach(e)}forEachPinnedBottomRow(e){Be(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(e)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(e){if(!e||0===e.length)return 0;const t=K(e);return t.rowTop+t.rowHeight}};u([f("beans")],$s.prototype,"beans",2),u([b],$s.prototype,"init",1),$s=u([O("pinnedRowModel")],$s);var ur=class{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let i=0;i<e.children.length;i++)this.depthFirstSearchChangedPath(e.children[i],t);t(e.rowNode)}depthFirstSearchEverything(e,t,i){if(e.childrenAfterGroup)for(let s=0;s<e.childrenAfterGroup.length;s++){const o=e.childrenAfterGroup[s];o.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[s],t,i):i&&t(o)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,i=!1){this.active&&!i?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,i=0;for(;!this.mapToItems[t.id];)this.mapToItems[t.id]={rowNode:t,children:null},i++,t=t.parent;return i}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let i=e;for(;i;)this.nodeIdsToColumns[i.id]||(this.nodeIdsToColumns[i.id]={}),t.forEach(s=>this.nodeIdsToColumns[i.id][s.getId()]=!0),i=i.parent}linkPathItems(e,t){let i=e;for(let s=0;s<t;s++){const o=this.mapToItems[i.id],r=this.mapToItems[i.parent.id];r.children||(r.children=[]),r.children.push(o),i=i.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const i=this.createPathItems(e);this.linkPathItems(e,i),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const i=this.nodeIdsToColumns[e.id];return t.filter(o=>i[o.getId()])}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const i=this.nodeIdsToColumns[e.id];return t.filter(o=>!i[o.getId()])}},Ji=class Mi extends T{constructor(t){super(),this.state=Mi.STATE_WAITING_TO_LOAD,this.version=0,this.id=t}getId(){return this.id}load(){this.state=Mi.STATE_LOADING,this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state=Mi.STATE_WAITING_TO_LOAD}getState(){return this.state}pageLoadFailed(t){this.isRequestMostRecentAndLive(t)&&(this.state=Mi.STATE_FAILED,this.processServerFail()),this.dispatchLoadCompleted(!1)}success(t,i){this.successCommon(t,i)}pageLoaded(t,i,s){this.successCommon(t,{rowData:i,rowCount:s})}isRequestMostRecentAndLive(t){const i=t===this.version,s=this.isAlive();return i&&s}successCommon(t,i){this.dispatchLoadCompleted(),this.isRequestMostRecentAndLive(t)&&(this.state=Mi.STATE_LOADED,this.processServerResult(i))}dispatchLoadCompleted(t=!0){this.dispatchEvent({type:Mi.EVENT_LOAD_COMPLETE,success:t,block:this})}};Ji.EVENT_LOAD_COMPLETE="loadComplete",Ji.STATE_WAITING_TO_LOAD="needsLoading",Ji.STATE_LOADING="loading",Ji.STATE_LOADED="loaded",Ji.STATE_FAILED="failed";var el=Ji,vt=class extends T{constructor(){super(...arguments),this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gridOptionsService.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=H.debounce(this.performCheckBlocksToLoad.bind(this),e))}setBeans(e){this.logger=e.create("RowNodeBlockLoader")}getMaxConcurrentDatasourceRequests(){const e=this.gridOptionsService.get("maxConcurrentDatasourceRequests");return null==e?2:e<=0?void 0:e}addBlock(e){this.blocks.push(e),e.addEventListener(el.EVENT_LOAD_COMPLETE,this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){H.removeFromArray(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchEvent({type:vt.BLOCK_LOADED_EVENT}),0==this.activeBlockLoadsCount&&this.dispatchEvent({type:vt.BLOCK_LOADER_FINISHED_EVENT})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),null!=this.maxConcurrentRequests&&this.activeBlockLoadsCount>=this.maxConcurrentRequests)return void this.logger.log("checkBlockToLoad: max loads exceeded");const e=this.getAvailableLoadingCount(),t=this.blocks.filter(i=>i.getState()===el.STATE_WAITING_TO_LOAD).slice(0,e);this.registerLoads(t.length),t.forEach(i=>
1i.load()),this.printCacheStatus()}getBlockState(){if(this.gridOptionsService.isRowModelType("serverSide"))return this.rowModel.getBlockStates();const e={};return this.blocks.forEach(t=>{const{id:i,state:s}=t.getBlockStateJson();e[i]=s}),e}printCacheStatus(){this.logger.isLogging()&&this.logger.log(`printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return void 0!==this.maxConcurrentRequests?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}};vt.BLOCK_LOADED_EVENT="blockLoaded",vt.BLOCK_LOADER_FINISHED_EVENT="blockLoaderFinished",u([f("rowModel")],vt.prototype,"rowModel",2),u([b],vt.prototype,"postConstruct",1),u([it(0,qe("loggerFactory"))],vt.prototype,"setBeans",1),vt=u([O("rowNodeBlockLoader")],vt);var qs=class extends T{constructor(){super(...arguments),this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.pixelOffset=0,this.masterRowCount=0}postConstruct(){this.active=this.gridOptionsService.get("pagination"),this.pageSizeFromGridOptions=this.gridOptionsService.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedListener(this.eventService,p.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this)),this.onModelUpdated()}ensureRowHeightsValid(e,t,i,s){const o=this.rowModel.ensureRowHeightsValid(e,t,this.getPageFirstRow(),this.getPageLastRow());return o&&this.calculatePages(),o}isPaginateChildRows(){return!(!this.gridOptionsService.get("groupRemoveSingleChildren")&&!this.gridOptionsService.get("groupRemoveLowestSingleChildren"))||this.gridOptionsService.get("paginateChildRows")}onModelUpdated(e){this.calculatePages(),this.eventService.dispatchEvent({type:p.EVENT_PAGINATION_CHANGED,animate:!!e&&e.animate,newData:!!e&&e.newData,newPage:!!e&&e.newPage,newPageSize:!!e&&e.newPageSize,keepRenderedRows:!!e&&e.keepRenderedRows})}onPaginationGridOptionChanged(){this.active=this.gridOptionsService.get("pagination"),this.calculatePages(),this.eventService.dispatchEvent({type:p.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!1,keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gridOptionsService.get("paginationPageSize"),"gridOptions")}goToPage(e){this.active&&this.currentPage!==e&&"number"==typeof this.currentPage&&(this.currentPage=e,this.onModelUpdated({type:p.EVENT_MODEL_UPDATED,animate:!1,keepRenderedRows:!1,newData:!1,newPage:!0,newPageSize:!1}))}getPixelOffset(){return this.pixelOffset}getRow(e){return this.rowModel.getRow(e)}getRowNode(e){return this.rowModel.getRowNode(e)}getRowIndexAtPixel(e){return this.rowModel.getRowIndexAtPixel(e)}getCurrentPageHeight(){return G(this.topRowBounds)||G(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){return{pageFirstPixel:this.topRowBounds?this.topRowBounds.rowTop:0,pageLastPixel:this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0}}isRowPresent(e){return!!this.rowModel.isRowPresent(e)&&e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex}isEmpty(){return this.rowModel.isEmpty()}isRowsToRender(){return this.rowModel.isRowsToRender()}forEachNode(e){return this.rowModel.forEachNode(e)}forEachNodeOnPage(e){const t=this.getPageFirstRow(),i=this.getPageLastRow();for(let s=t;s<=i;s++){const o=this.getRow(s);o&&e(o)}}getType(){return this.rowModel.getType()}getRowBounds(e){const t=this.rowModel.getRowBounds(e);return t.rowIndex=e,t}getPageFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getPageLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getRowCount(){return this.rowModel.getRowCount()}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){return!this.active||this.getPageForIndex(e.rowIndex)===this.currentPage}isLastPageFound(){return this.rowModel.isLastRowIndexKnown()}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return R(this.pageSizeAutoCalculated)?this.pageSizeAutoCalculated:R(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:R(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:R(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}unsetAutoCalculatedPageSize(){if(void 0===this.pageSizeAutoCalculated)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&this.onModelUpdated({type:p.EVENT_MODEL_UPDATED,animate:!1,keepRenderedRows:!1,newData:!1,newPage:!1,newPageSize:!0})}setPageSize(e,t){const i=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,0!==this.currentPage&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,0!==this.currentPage&&this.goToFirstPage()}i!==this.pageSize&&this.onModelUpdated({type:p.EVENT_MODEL_UPDATED,animate:!1,keepRenderedRows:!1,newData:!1,newPage:!1,newPageSize:!0})}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.topRowBounds=this.rowModel.getRowBounds(this.topDisplayedRowIndex),this.topRowBounds&&(this.topRowBounds.rowIndex=this.topDisplayedRowIndex),this.bottomRowBounds=this.rowModel.getRowBounds(this.bottomDis
1playedRowIndex),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=this.bottomDisplayedRowIndex),this.setPixelOffset(R(this.topRowBounds)?this.topRowBounds.rowTop:0)}setPixelOffset(e){this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:p.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();let i=this.pageSize*(this.currentPage+1)-1;if(i>e&&(i=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(this.pageSize*this.currentPage),i===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const s=this.rowModel.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=s-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),0===this.masterRowCount)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.setPageSize(this.masterRowCount,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}};u([f("rowModel")],qs.prototype,"rowModel",2),u([b],qs.prototype,"postConstruct",1),qs=u([O("paginationProxy")],qs);var cr=class extends T{processAllCellClasses(e,t,i,s){this.processClassRules(void 0,e.cellClassRules,t,i,s),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,s,o){if(null==t&&null==e)return;const r={},n={},l=(a,c)=>{a.split(" ").forEach(h=>{""!=h.trim()&&c(h)})};if(t){const a=Object.keys(t);for(let c=0;c<a.length;c++){const h=a[c],g=t[h];let m;"string"==typeof g?m=this.expressionService.evaluate(g,i):"function"==typeof g&&(m=g(i)),l(h,C=>{m?r[C]=!0:n[C]=!0})}}e&&o&&Object.keys(e).forEach(a=>l(a,c=>{r[c]||(n[c]=!0)})),o&&Object.keys(n).forEach(o),Object.keys(r).forEach(s)}getStaticCellClasses(e,t){const{cellClass:i}=e;if(!i)return[];let s;return s="function"==typeof i?i(t):i,"string"==typeof s&&(s=[s]),s||[]}processStaticCellClasses(e,t,i){this.getStaticCellClasses(e,t).forEach(o=>{i(o)})}};u([f("expressionService")],cr.prototype,"expressionService",2),cr=u([O("stylingService")],cr);var kd=class extends Qo{constructor(e){super(e,"ag-toggle-button")}setValue(e,t){return super.setValue(e,t),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}},Sg=class extends dt{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value=e,i}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},Eg=class extends ii{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this));const e=ft();this.addManagedListener(this.eInput,"mousedown",()=>{this.isDisabled()||e||this.eInput.focus()}),this.eInput.step="any"}onWheel(e){document.activeElement===this.eInput&&e.preventDefault()}setMin(e){var t;const i=e instanceof Date?null!=(t=Qe(e??null,!1))?t:void 0:e;return this.min===i||(this.min=i,mt(this.eInput,"min",i)),this}setMax(e){var t;const i=e instanceof Date?null!=(t=Qe(e??null,!1))?t:void 0:e;return this.max===i||(this.max=i,mt(this.eInput,"max",i)),this}setStep(e){return this.step===e||(this.step=e,mt(this.eInput,"step",e)),this}getDate(){var e;if(this.eInput.validity.valid)return null!=(e=_e(this.getValue()))?e:void 0}setDate(e,t){this.setValue(Qe(e??null,!1),t)}},yg=class extends dt{constructor(e){super(e,"ag-range-field","range")}
1postConstruct(){super.postConstruct();const{min:e,max:t,step:i}=this.config;null!=e&&this.setMinValue(e),null!=t&&this.setMaxValue(t),this.setStep(i||1)}addInputListeners(){this.addManagedListener(this.eInput,"input",e=>{this.setValue(e.target.value)})}setMinValue(e){return this.min=e,this.eInput.setAttribute("min",e.toString()),this}setMaxValue(e){return this.max=e,this.eInput.setAttribute("max",e.toString()),this}setStep(e){return this.eInput.setAttribute("step",e.toString()),this}setValue(e,t){null!=this.min&&(e=Math.max(parseFloat(e),this.min).toString()),null!=this.max&&(e=Math.min(parseFloat(e),this.max).toString());const i=super.setValue(e,t);return this.eInput.value=e,i}},tl=class extends k{constructor(e,t){super('<div class="ag-rich-select-row" role="presentation"></div>'),this.params=e,this.wrapperEl=t}postConstruct(){this.addManagedListener(this.getGui(),"click",this.onClick.bind(this))}setState(e){let t="";this.params.valueFormatter&&(t=this.params.valueFormatter(e)),this.populateWithRenderer(e,t)||this.populateWithoutRenderer(e,t),this.value=e}highlightString(e){const{parsedValue:t}=this;if(this.params.cellRenderer||!R(t))return;let i=R(e);if(i){const s=t?.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(s>=0){const o=s+e.length,r=pe(t.slice(0,s),!0),n=pe(t.slice(s,o),!0),l=pe(t.slice(o));this.renderValueWithoutRenderer(`${r}<span class="ag-rich-select-row-text-highlight">${n}</span>${l}`)}else i=!1}i||this.renderValueWithoutRenderer(t)}updateHighlighted(e){var t;const i=this.getGui(),s=`ag-rich-select-row-${this.getCompId()}`;null==(t=i.parentElement)||t.setAttribute("id",s),e&&(Xr(this.getParentComponent().getAriaElement(),s),this.wrapperEl.setAttribute("data-active-option",s)),Ni(i.parentElement,e),this.addOrRemoveCssClass("ag-rich-select-row-selected",e)}populateWithoutRenderer(e,t){const i=this.gridOptionsService.getDocument(),s=this.getGui(),o=i.createElement("span");o.style.overflow="hidden",o.style.textOverflow="ellipsis";const r=pe(R(t)?t:e,!0);this.parsedValue=R(r)?r:null,s.appendChild(o),this.renderValueWithoutRenderer(r),this.setTooltip({newTooltipText:this.parsedValue,shouldDisplayTooltip:()=>o.scrollWidth>o.clientWidth})}renderValueWithoutRenderer(e){const t=this.getGui().querySelector("span");t&&(t.innerHTML=R(e)?e:" ")}populateWithRenderer(e,t){let i,s;return this.params.cellRenderer&&(s=this.userComponentFactory.getCellRendererDetails(this.params,{value:e,valueFormatted:t,setTooltip:(o,r)=>{this.setTooltip({newTooltipText:o,shouldDisplayTooltip:r})}})),s&&(i=s.newAgStackInstance()),i&&bn(i,this.getGui()),!!i&&(i.then(o=>{this.addDestroyFunc(()=>{this.getContext().destroyBean(o)})}),!0)}onClick(){const e=this.getParentComponent(),t={type:p.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:!1,value:this.value};e?.dispatchEvent(t)}};u([f("userComponentFactory")],tl.prototype,"userComponentFactory",2),u([b],tl.prototype,"postConstruct",1);var Ys=class xu extends Us{constructor(t){super(xu.getTemplate(t?.cssIdentifier||"default")),this.renderedRows=new Map,this.rowHeight=20,this.isHeightFromTheme=!0;const{cssIdentifier:i="default",ariaRole:s="listbox",listName:o}=t||{};this.cssIdentifier=i,this.ariaRole=s,this.listName=o}postConstruct(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),this.initialiseTabGuard({onFocusIn:t=>this.onFocusIn(t),onFocusOut:t=>this.onFocusOut(t),focusInnerElement:t=>this.focusInnerElement(t),onTabKeyDown:t=>this.onTabKeyDown(t),handleKeyDown:t=>this.handleKeyDown(t)}),this.setAriaProperties(),this.addManagedListener(this.eventService,p.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanged.bind(this))}onGridStylesChanged(){this.rowHeight=this.getItemHeight(),this.refresh()}setAriaProperties(){const i=this.localeService.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),s=this.eContainer;re(s,this.ariaRole),lt(s,i)}addResizeObserver(){const i=this.resizeObserverService.observeResize(this.getGui(),()=>this.animationFrameService.requestAnimationFrame(()=>this.drawVirtualRows()));this.addDestroyFunc(i)}focusInnerElement(t){this.focusRow(t?this.model.getRowCount()-1:0)}onFocusIn(t){const i=t.target;i.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=da(i)-1)}onFocusOut(t){this.getFocusableElement().contains(t.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(t){switch(t.key){case w.UP:case w.DOWN:this.navigate(t.key===w.UP)&&t.preventDefault()}}onTabKeyDown(t){this.navigate(t.shiftKey)?t.preventDefault():(rt(t),this.forceFocusOutOfContainer(t.shiftKey))}navigate(t){if(null==this.lastFocusedRowIndex)return!1;const i=this.lastFocusedRowIndex+(t?-1:1);return!(i<0||i>=this.model.getRowCount()||(this.focusRow(i),0))}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(t){this.ensureIndexVisible(t),window.setTimeout(()=>{if(!this.isAlive())return;const i=this.renderedRows.get(t);i&&i.eDiv.focus()},10)}getComponentAt(t){const i=this.renderedRows.get(t);return i&&i.rowComponent}forEachRenderedRow(t){this.renderedRows.forEach((i,s)=>t(i.rowComponent,s))}static getTemplate(t){return`<div class="ag-virtual-list-viewport ag-${t}-virtual-list-viewport" role="presentation">\n <div class="ag-virtual-list-container ag-${t}-virtual-list-container" ref="eContainer"></div>\n </div>`}getItemHeight(){return this.isHeightFromTheme?this.environment.getListItemHeight():this.rowHeight}ensureIndexVisible(t,i=!0){const s=this.model.getRowCount();if("number"!=typeof t||t<0||t>
1=s)return console.warn("AG Grid: invalid row index for ensureIndexVisible: "+t),!1;const o=t*this.rowHeight,r=o+this.rowHeight,n=this.getGui(),l=n.scrollTop,a=n.offsetHeight,h=i?0:this.rowHeight,m=l+a<r-h;return l>o+h?(n.scrollTop=o,!0):!!m&&(n.scrollTop=r-a,!0)}setComponentCreator(t){this.componentCreator=t}setComponentUpdater(t){this.componentUpdater=t}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(t){this.isHeightFromTheme=!1,this.rowHeight=t,this.refresh()}refresh(t){if(null==this.model||!this.isAlive())return;const i=this.model.getRowCount();this.eContainer.style.height=i*this.rowHeight+"px",Nr(()=>this.eContainer.clientHeight>=i*this.rowHeight,()=>{this.isAlive()&&(this.canSoftRefresh(t)?this.drawVirtualRows(!0):(this.clearVirtualRows(),this.drawVirtualRows()))})}canSoftRefresh(t){return!!(t&&this.renderedRows.size&&"function"==typeof this.model.areRowsEqual&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((t,i)=>this.removeRow(i))}drawVirtualRows(t){if(!this.isAlive()||!this.model)return;const i=this.getGui(),s=i.scrollTop,o=s+i.offsetHeight,r=Math.floor(s/this.rowHeight),n=Math.floor(o/this.rowHeight);this.ensureRowsRendered(r,n,t)}ensureRowsRendered(t,i,s){this.renderedRows.forEach((o,r)=>{(r<t||r>i)&&r!==this.lastFocusedRowIndex&&this.removeRow(r)}),s&&this.refreshRows();for(let o=t;o<=i;o++)this.renderedRows.has(o)||o<this.model.getRowCount()&&this.insertRow(o)}insertRow(t){const i=this.model.getRow(t),s=document.createElement("div");s.classList.add("ag-virtual-list-item",`ag-${this.cssIdentifier}-virtual-list-item`),re(s,"tree"===this.ariaRole?"treeitem":"option"),xo(s,this.model.getRowCount()),Go(s,t+1),s.setAttribute("tabindex","-1"),s.style.height=`${this.rowHeight}px`,s.style.top=this.rowHeight*t+"px";const o=this.componentCreator(i,s);o.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=t),s.appendChild(o.getGui()),this.renderedRows.has(t-1)?this.renderedRows.get(t-1).eDiv.insertAdjacentElement("afterend",s):this.renderedRows.has(t+1)?this.renderedRows.get(t+1).eDiv.insertAdjacentElement("beforebegin",s):this.eContainer.appendChild(s),this.renderedRows.set(t,{rowComponent:o,eDiv:s,value:i})}removeRow(t){const i=this.renderedRows.get(t);this.eContainer.removeChild(i.eDiv),this.destroyBean(i.rowComponent),this.renderedRows.delete(t)}refreshRows(){const t=this.model.getRowCount();this.renderedRows.forEach((i,s)=>{var o,r;if(s>=t)this.removeRow(s);else{const n=this.model.getRow(s);null!=(r=(o=this.model).areRowsEqual)&&r.call(o,i.value,n)?this.componentUpdater(n,i.rowComponent):this.removeRow(s)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(t){this.model=t}getAriaElement(){return this.eContainer}destroy(){this.isAlive()&&(this.clearVirtualRows(),super.destroy())}};u([f("resizeObserverService")],Ys.prototype,"resizeObserverService",2),u([f("animationFrameService")],Ys.prototype,"animationFrameService",2),u([A("eContainer")],Ys.prototype,"eContainer",2),u([b],Ys.prototype,"postConstruct",1);var Vd=Ys,il=class extends ti{constructor(e){var t,i;super(ie(L({pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"ag-list",className:"ag-rich-select",pickerIcon:"smallDown",ariaRole:"combobox",template:null!=(t=e?.template)?t:'\n <div class="ag-picker-field" role="presentation">\n <div ref="eLabel"></div>\n <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed">\n <div ref="eDisplayField" class="ag-picker-field-display"></div>\n <ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>\n <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n </div>\n </div>',modalPicker:!1},e),{maxPickerHeight:null!=(i=e?.maxPickerHeight)?i:"calc(var(--ag-row-height) * 6.5)"})),this.searchString="",this.highlightedItem=-1,this.lastRowHovered=-1,this.searchStringCreator=null;const{cellRowHeight:s,value:o,valueList:r,searchStringCreator:n}=e||{};null!=s&&(this.cellRowHeight=s),void 0!==o&&(this.value=o),null!=r&&(this.values=r),n&&(this.searchStringCreator=n)}
1postConstruct(){super.postConstruct(),this.createLoadingElement(),this.createListComponent();const{allowTyping:e,placeholder:t}=this.config;e?(this.eInput.setAutoComplete(!1).setInputPlaceholder(t),this.eDisplayField.classList.add("ag-hidden")):this.eInput.setDisplayed(!1),this.eWrapper.tabIndex=this.gridOptionsService.get("tabIndex");const{searchDebounceDelay:i=300}=this.config;this.clearSearchString=Pe(this.clearSearchString,i),this.renderSelectedValue(),e&&(this.eInput.onValueChange(s=>this.searchTextFromString(s)),this.addManagedListener(this.eWrapper,"focus",this.onWrapperFocus.bind(this))),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}createLoadingElement(){const e=this.gridOptionsService.getDocument(),t=this.localeService.getLocaleTextFunc(),i=e.createElement("div");i.classList.add("ag-loading-text"),i.innerText=t("loadingOoo","Loading..."),this.eLoading=i}createListComponent(){this.listComponent=this.createBean(new Vd({cssIdentifier:"rich-select"})),this.listComponent.setComponentCreator(this.createRowComponent.bind(this)),this.listComponent.setComponentUpdater((l,a)=>{}),this.listComponent.setParentComponent(this),this.addManagedListener(this.listComponent,p.EVENT_FIELD_PICKER_VALUE_SELECTED,l=>{this.onListValueSelected(l.value,l.fromEnterKey)});const{cellRowHeight:t}=this;t&&this.listComponent.setRowHeight(t);const i=this.listComponent.getGui(),s=this.listComponent.getAriaElement();this.addManagedListener(i,"mousemove",this.onPickerMouseMove.bind(this)),this.addManagedListener(i,"mousedown",l=>l.preventDefault()),i.classList.add("ag-rich-select-list");const o=`ag-rich-select-list-${this.listComponent.getCompId()}`;s.setAttribute("id",o),lt(s,this.localeService.getLocaleTextFunc()(this.config.pickerAriaLabelKey,this.config.pickerAriaLabelValue)),en(this.eWrapper,s)}renderSelectedValue(){const{value:e,eDisplayField:t,config:i}=this,{allowTyping:s,initialInputValue:o}=this.config,r=this.config.valueFormatter?this.config.valueFormatter(e):e;if(s)return void this.eInput.setValue(o??r);let n,l;if(i.cellRenderer&&(n=this.userComponentFactory.getCellRendererDetails(this.config,{value:e,valueFormatted:r})),n&&(l=n.newAgStackInstance()),l)ce(t),bn(l,t),l.then(a=>{this.addDestroyFunc(()=>this.getContext().destroyBean(a))});else{if(R(this.value))t.innerText=r,t.classList.remove("ag-display-as-placeholder");else{const{placeholder:a}=i;R(a)?(t.innerHTML=`${pe(a)}`,t.classList.add("ag-display-as-placeholder")):ce(t)}this.setTooltip({newTooltipText:r??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth})}}getCurrentValueIndex(){const{currentList:e,value:t}=this;if(null==t||!e)return-1;for(let i=0;i<e.length;i++)if(e[i]===t)return i;return-1}highlightFilterMatch(){var e;null==(e=this.listComponent)||e.forEachRenderedRow((t,i)=>{t.highlightString(this.searchString)})}highlightSelectedValue(e){var t;null==e&&(e=this.getCurrentValueIndex()),this.highlightedItem=e,null==(t=this.listComponent)||t.forEachRenderedRow((i,s)=>{i.updateHighlighted(-1!==e&&this.highlightedItem===s)})}setRowHeight(e){e!==this.cellRowHeight&&(this.cellRowHeight=e),this.listComponent&&this.listComponent.setRowHeight(e)}createPickerComponent(){const{values:e}=this;return e&&this.setValueList({valueList:e}),this.listComponent}setSearchStringCreator(e){this.searchStringCreator=e}setValueList(e){const{valueList:t,refresh:i}=e;this.listComponent&&this.currentList!==t&&(this.currentList=t,this.listComponent.setModel({getRowCount:()=>t.length,getRow:s=>t[s],areRowsEqual:(s,o)=>s===o}),i&&(this.values?this.listComponent.refresh(!0):(this.values=t,this.isPickerDisplayed&&this.showCurrentValueInPicker())))}showPicker(){super.showPicker(),this.showCurrentValueInPicker(),this.displayOrHidePicker()}showCurrentValueInPicker(){var e,t;if(!this.listComponent)return;if(!this.currentList)return void(this.isPickerDisplayed&&this.eLoading&&this.listComponent.appendChild(this.eLoading));null!=(e=this.eLoading)&&e.offsetParent&&(null==(t=this.eLoading.parentElement)||t.removeChild(this.eLoading));const i=this.getCurrentValueIndex();-1!==i?(this.listComponent.refresh(),this.listComponent.ensureIndexVisible(i),this.listComponent.refresh(!0),this.highlightSelectedValue(i)):this.listComponent.refresh()}beforeHidePicker(){this.highlightedItem=-1,super.beforeHidePicker()}onWrapperFocus(){if(!this.eInput)return;const e=this.eInput.getFocusableElement();e.focus(),e.select()}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}buildSearchStringFromKeyboardEvent(e){let{key:t}=e;if(t===w.BACKSPACE)this.searchString=this.searchString.slice(0,-1),t="";else if(!Uo(e))return;e.preventDefault(),this.searchTextFromCharacter(t)}searchTextFromCharacter(e){this.searchString+=e,this.runSearch(),this.clearSearchString()}searchTextFromString(e){null==e&&(e=""),this.searchString=e,this.runSearch()}buildSearchStrings(e){const{valueFormatter:t=(s=>s)}=this.config;let i;return"number"==typeof e[0]||"string"==typeof e[0]?i=e.map(s=>t(s)):"object"==typeof e[0]&&this.searchStringCreator&&(i=this.searchStringCreator(e)),i}getSuggestionsAndFilteredValues(e,t){let i=[],s=[];if(!e.length)return{suggestions:i,filteredValues:s};const{searchType:o="fuzzy",filterList:r}=this.config;if("fuzzy"===o){const n=Fs(this.searchString,t,!0);i=n.values;const l=n.indices;if(r&&l.length)for(let a=0;a<l.length;a++)s.push(this.values[l[a]])}else i=t.filter((n,l)=>{const a=n.toLocaleLowerCase(),c=this.searchString.toLocaleLowerCase(),h="match"===o?a.startsWith(c):-1!==a.indexOf(c);return r&&h&&s.push(this.values[l]),h});return{suggestions:i,filteredValues:s}}filterListModel(e){const{filterList:t}=this.config;t&&(this.setValueList({valueList:e,refresh:!0}),this.alignPickerToComponent())}runSearch(){var e,t;const{values:i}=this,s=this.buildSearchStrings(i);if(!s)return void this.highlightSelectedValue(-1);const{suggestions:o,filteredValues:r}=this.getSuggestionsAndFilteredValues(this.searchString,s),{filterList:n,highlightMatch:l,searchType:a="fuzzy"}=this.config,c=r.length,h=!(!n||""===this.searchString);if(this.filterListModel(h?r:i),o.length){const g=h?0:s.indexOf(o[0]);this.selectListItem(g)}else if(this.highlightSelectedValue(-1),!h||c)null==(e=this.listComponent)||e.ensureIndexVisible(0);else if(h){this.getAriaElement().removeAttribute("data-active-option");const g=null==(t=this.listComponent)?void 0:t.getAriaElement();g&&Xr(g,null)}l&&"fuzzy"!==a&&this.highlightFilterMatch(),this.displayOrHidePicker()}displayOrHidePicker(){var e;const t=null==(e=this.listComponent)?void 0:e.getGui(),i=!!this.currentList&&0===this.currentList.length;t?.classList.toggle("ag-hidden",i)}clearSearchString(){this.searchString=""}selectListItem(e,t){!this.isPickerDisplayed||!this.currentList||!this.listComponent||e<0||e>=this.currentList.length||(this.listComponent.ensureIndexVisible(e,!t)&&!t&&this.listComponent.refresh(!0),this.highlightSelectedValue(e))}setValue(e,t,i){const s=this.currentList?this.currentList.indexOf(e):-1;return-1===s?this:(this.value=e,i||this.selectListItem(s),this.renderSelectedValue(),super.setValue(e,t))}createRowComponent(e){const t=new tl(this.config,this.eWrapper);t.setParentComponent(this.listComponent),this.getContext().createBean(t),t.setState(e);const{highlightMatch:i,searchType:s="fuzzy"}=this.config;return i&&"fuzzy"!==s&&t.highlightString(this.searchString),t}getRowForMouseEvent(e){const{listComponent:t}=this;if(!t)return-1;const s=(t?.getGui()).getBoundingClientRect(),o=t.getScrollTop();return Math.floor((e.clientY-s.top+o)/t.getRowHeight())}onPickerMouseMove(e){if(!this.listComponent)return;const t=this.getRowForMouseEvent(e);-1!==t&&t!=this.lastRowHovered&&(this.lastRowHovered=t,this.selectListItem(t,!0))}onNavigationKeyDown(e,t){e.preventDefault();const i=t===w.DOWN;if(!this.isPickerDisplayed&&i)return void this.showPicker();const s=this.highlightedItem;this.selectListItem(-1===s?0:s+(i?1:-1))}
1onEnterKeyDown(e){this.isPickerDisplayed&&(e.preventDefault(),this.currentList&&this.onListValueSelected(this.currentList[this.highlightedItem],!0))}onTabKeyDown(){!this.isPickerDisplayed||!this.currentList||this.setValue(this.currentList[this.highlightedItem],!1,!0)}onListValueSelected(e,t){this.setValue(e,!1,!0),this.dispatchPickerEvent(e,t),this.hidePicker()}dispatchPickerEvent(e,t){this.dispatchEvent({type:p.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:t,value:e})}getFocusableElement(){const{allowTyping:e}=this.config;return e?this.eInput.getFocusableElement():super.getFocusableElement()}onKeyDown(e){const t=e.key,{allowTyping:i}=this.config;switch(t){case w.LEFT:case w.RIGHT:case w.PAGE_HOME:case w.PAGE_END:i||e.preventDefault();break;case w.PAGE_UP:case w.PAGE_DOWN:e.preventDefault();break;case w.DOWN:case w.UP:this.onNavigationKeyDown(e,t);break;case w.ESCAPE:this.isPickerDisplayed&&(ze(this.listComponent.getGui())&&(e.preventDefault(),rt(e)),this.hidePicker());break;case w.ENTER:this.onEnterKeyDown(e);break;case w.TAB:this.onTabKeyDown();break;default:i||this.buildSearchStringFromKeyboardEvent(e)}}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),this.eLoading=void 0,super.destroy()}};u([f("userComponentFactory")],il.prototype,"userComponentFactory",2),u([A("eInput")],il.prototype,"eInput",2);var es=class Gu extends On{constructor(t){super(t,Gu.TEMPLATE),this.labelAlignment="top"}init(){this.eSlider.addCssClass("ag-slider-field");const{minValue:t,maxValue:i,textFieldWidth:s,step:o,value:r,onValueChange:n}=this.config;null!=t&&this.setMinValue(t),null!=i&&this.setMaxValue(i),null!=s&&this.setTextFieldWidth(s),null!=o&&this.setStep(o),null!=r&&this.setValue(r),null!=n&&this.onValueChange(n)}onValueChange(t){const i=p.EVENT_FIELD_VALUE_CHANGED;return this.addManagedListener(this.eText,i,()=>{const s=parseFloat(this.eText.getValue());this.eSlider.setValue(s.toString(),!0),t(s||0)}),this.addManagedListener(this.eSlider,i,()=>{const s=this.eSlider.getValue();this.eText.setValue(s,!0),t(parseFloat(s))}),this}setSliderWidth(t){return this.eSlider.setWidth(t),this}setTextFieldWidth(t){return this.eText.setWidth(t),this}setMinValue(t){return this.eSlider.setMinValue(t),this.eText.setMin(t),this}setMaxValue(t){return this.eSlider.setMaxValue(t),this.eText.setMax(t),this}getValue(){return this.eText.getValue()}setValue(t,i){return this.getValue()===t||(this.eText.setValue(t,!0),this.eSlider.setValue(t,!0),i||this.dispatchEvent({type:p.EVENT_FIELD_VALUE_CHANGED})),this}setStep(t){return this.eSlider.setStep(t),this.eText.setStep(t),this}};es.TEMPLATE='<div class="ag-slider">\n <label ref="eLabel"></label>\n <div class="ag-wrapper ag-slider-wrapper">\n <ag-input-range ref="eSlider"></ag-input-range>\n <ag-input-number-field ref="eText"></ag-input-number-field>\n </div>\n </div>',u([A("eLabel")],es.prototype,"eLabel",2),u([A("eSlider")],es.prototype,"eSlider",2),u([A("eText")],es.prototype,"eText",2),u([b],es.prototype,"init",1);var Dg=es,Ut=class ms extends k{constructor(t={}){super(ms.getTemplate(t)),this.params=t,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1;const{enabled:i,items:s,suppressEnabledCheckbox:o,expanded:r,suppressToggleExpandOnEnableChange:n,useToggle:l}=t;this.cssIdentifier=t.cssIdentifier||"default",this.enabled=i??!0,this.items=s||[],this.useToggle=l??!1,this.alignItems=t.alignItems||"center",this.expanded=r??!0,null!=o&&(this.suppressEnabledCheckbox=o),null!=n&&(this.suppressToggleExpandOnEnableChange=n)}static getTemplate(t){const i=t.cssIdentifier||"default";return`\n <div class="ag-group ag-${i}-group" role="presentation">\n <div ref="eToolbar" class="ag-group-toolbar ag-${i}-group-toolbar">\n <ag-checkbox ref="cbGroupEnabled"></ag-checkbox>\n </div>\n <div ref="eContainer" class="ag-group-container ag-group-container-${t.direction||"vertical"} ag-${i}-group-container"></div>\n </div>\n `}postConstruct(){if(this.setupTitleBar(),this.items.length){const o=this.items;this.items=[],this.addItems(o)}const t=this.localeService.getLocaleTextFunc();this.cbGroupEnabled.setLabel(t("enabled","Enabled")),this.enabled&&this.setEnabled(this.enabled,void 0,!0),this.setAlignItems(this.alignItems);const{onEnableChange:i,suppressOpenCloseIcons:s}=this.params;this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(s??!1),this.refreshChildDisplay(),U(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(o=>{this.setEnabled(o,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(o)}),null!=i&&this.onEnableChange(i)}refreshChildDisplay(){var t;U(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),null==(t=this.eTitleBar)||t.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(t){return this.alignItems!==t&&this.removeCssClass(`ag-group-item-alignment-${this.alignItems}`),this.alignItems=t,this.addCssClass(`ag-group-item-alignment-${this.alignItems}`),this}toggleGroupExpand(t){var i;let s=!1;if(null!=(i=this.eTitleBar)&&i.isSuppressCollapse()&&!this.useToggle)t=!0,s=!0;else if(this.expanded===(t=t??!this.expanded))return this;return this.expanded=t,this.refreshChildDisplay(),U(this.eContainer,t),s||this.dispatchEvent({type:t?ms.EVENT_EXPANDED:ms.EVENT_COLLAPSED}),this}addItems(t){t.forEach(i=>
1this.addItem(i))}prependItem(t){this.insertItem(t,!0)}addItem(t){this.insertItem(t,!1)}insertItem(t,i){const s=this.eContainer,o=t instanceof k?t.getGui():t;o.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),i?(s.insertAdjacentElement("afterbegin",o),this.items.unshift(o)):(s.appendChild(o),this.items.push(o))}hideItem(t,i){U(this.items[i],!t)}getItemIndex(t){const i=t instanceof k?t.getGui():t;return this.items.indexOf(i)}setTitle(t){var i;return null==(i=this.eTitleBar)||i.setTitle(t),this}addCssClassToTitleBar(t){var i;null==(i=this.eTitleBar)||i.addCssClass(t)}dispatchEnableChangeEvent(t){this.dispatchEvent({type:ms.EVENT_ENABLE_CHANGE,enabled:t})}setEnabled(t,i,s){var o;return this.enabled=t,this.refreshDisabledStyles(),s||this.toggleGroupExpand(t),i||(this.cbGroupEnabled.setValue(t),null==(o=this.eToggle)||o.setValue(t)),this}isEnabled(){return this.enabled}onEnableChange(t){return this.addManagedListener(this,ms.EVENT_ENABLE_CHANGE,i=>t(i.enabled)),this}hideEnabledCheckbox(t){return this.suppressEnabledCheckbox=t,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(t){var i;return null==(i=this.eTitleBar)||i.hideOpenCloseIcons(t),this}refreshDisabledStyles(){var t;const i=!this.enabled;this.eContainer.classList.toggle("ag-disabled",i),null==(t=this.eTitleBar)||t.refreshDisabledStyles(this.suppressEnabledCheckbox&&i),this.eContainer.classList.toggle("ag-disabled-group-container",i)}setupTitleBar(){const t=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",t.getGui())}createDefaultTitleBar(){const t=this.createManagedBean(new Hd(this.params));return this.eTitleBar=t,t.refreshOnExpand(this.expanded),this.addManagedListener(t,Hd.EVENT_EXPAND_CHANGED,i=>this.toggleGroupExpand(i.expanded)),t}createToggleTitleBar(){var t;const i=this.createManagedBean(new kd({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:s=>{this.setEnabled(s,!0),this.dispatchEnableChangeEvent(s)}}));return i.addCssClass("ag-group-title-bar"),i.addCssClass(`ag-${null!=(t=this.params.cssIdentifier)?t:"default"}-group-title-bar ag-unselectable`),this.eToggle=i,this.toggleGroupExpand(this.enabled),i}};Ut.EVENT_EXPANDED="expanded",Ut.EVENT_COLLAPSED="collapsed",Ut.EVENT_ENABLE_CHANGE="enableChange",u([A("eToolbar")],Ut.prototype,"eToolbar",2),u([A("cbGroupEnabled")],Ut.prototype,"cbGroupEnabled",2),u([A("eContainer")],Ut.prototype,"eContainer",2),u([b],Ut.prototype,"postConstruct",1);var Tg=Ut,ts=class yl extends k{constructor(t={}){super(yl.getTemplate(t)),this.suppressOpenCloseIcons=!1;const{title:i,suppressOpenCloseIcons:s}=t;this.title=i,null!=s&&(this.suppressOpenCloseIcons=s)}static getTemplate(t){var i;const s=null!=(i=t.cssIdentifier)?i:"default";return`\n <div class="ag-group-title-bar ag-${s}-group-title-bar ag-unselectable" role="button">\n <span class="ag-group-title-bar-icon ag-${s}-group-title-bar-icon" ref="eGroupOpenedIcon" role="presentation"></span>\n <span class="ag-group-title-bar-icon ag-${s}-group-title-bar-icon" ref="eGroupClosedIcon" role="presentation"></span>\n <span ref="eTitle" class="ag-group-title ag-${s}-group-title"></span>\n </div>\n `}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){this.eGroupClosedIcon.appendChild(Ze("columnSelectClosed",this.gridOptionsService,null)),this.eGroupOpenedIcon.appendChild(Ze("columnSelectOpen",this.gridOptionsService,null)),this.addManagedListener(this.getGui(),"click",()=>this.dispatchExpandChanged()),this.addManagedListener(this.getGui(),"keydown",t=>{switch(t.key){case w.ENTER:case w.SPACE:t.preventDefault(),this.dispatchExpandChanged();break;case w.RIGHT:case w.LEFT:t.preventDefault(),this.dispatchExpandChanged(t.key===w.RIGHT)}})}refreshOnExpand(t){this.refreshAriaStatus(t),this.refreshOpenCloseIcons(t)}refreshAriaStatus(t){this.suppressOpenCloseIcons||Pt(this.getGui(),t)}refreshOpenCloseIcons(t){const i=!this.suppressOpenCloseIcons;U(this.eGroupOpenedIcon,i&&t),U(this.eGroupClosedIcon,i&&!t)}isSuppressCollapse(){return this.suppressOpenCloseIcons}
1dispatchExpandChanged(t){this.dispatchEvent({type:yl.EVENT_EXPAND_CHANGED,expanded:t})}setTitle(t){return this.eTitle.innerText=t||"",U(this.getGui(),null!=t),this}hideOpenCloseIcons(t){return this.suppressOpenCloseIcons=t,t&&this.dispatchExpandChanged(!0),this}refreshDisabledStyles(t){const i=this.getGui();t?(i.classList.add("ag-disabled-group-title-bar"),i.removeAttribute("tabindex")):(i.classList.remove("ag-disabled-group-title-bar"),"string"==typeof this.title?i.setAttribute("tabindex","0"):i.removeAttribute("tabindex"))}};ts.EVENT_EXPAND_CHANGED="expandedChanged",u([A("eGroupOpenedIcon")],ts.prototype,"eGroupOpenedIcon",2),u([A("eGroupClosedIcon")],ts.prototype,"eGroupClosedIcon",2),u([A("eTitle")],ts.prototype,"eTitle",2),u([b],ts.prototype,"postConstruct",1);var Hd=ts,sl=class extends Us{constructor(e=0,t){super('<div class="ag-menu-list" role="tree"></div>'),this.level=e,this.menuItems=[],this.params=t??{column:null,node:null,value:null}}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.handleFocusIn(e),onFocusOut:e=>this.handleFocusOut(e)})}onTabKeyDown(e){const t=this.getParentComponent(),i=t&&t.getGui();i&&i.classList.contains("ag-focus-managed")||e.preventDefault(),e.shiftKey&&this.closeIfIsChild(e)}handleKeyDown(e){switch(e.key){case w.UP:case w.RIGHT:case w.DOWN:case w.LEFT:e.preventDefault(),this.handleNavKey(e.key);break;case w.ESCAPE:this.closeIfIsChild()&&rt(e)}}handleFocusIn(e){var t,i;const s=e.relatedTarget;!this.tabGuardCtrl.isTabGuard(s)&&(this.getGui().contains(s)||null!=(i=null==(t=this.activeMenuItem)?void 0:t.getSubMenuGui())&&i.contains(s))||(this.activeMenuItem?this.activeMenuItem.activate():this.activateFirstItem())}handleFocusOut(e){var t;const i=e.relatedTarget;!this.activeMenuItem||this.getGui().contains(i)||null!=(t=this.activeMenuItem.getSubMenuGui())&&t.contains(i)||this.activeMenuItem.isSubMenuOpening()||this.activeMenuItem.deactivate()}clearActiveItem(){this.activeMenuItem&&(this.activeMenuItem.deactivate(),this.activeMenuItem=null)}addMenuItems(e){null!=e&&Ge.all(e.map(t=>"separator"===t?Ge.resolve({eGui:this.createSeparator()}):"string"==typeof t?(console.warn(`AG Grid: unrecognised menu item ${t}`),Ge.resolve({eGui:null})):this.addItem(t))).then(t=>{t.forEach(i=>{i?.eGui&&(this.appendChild(i.eGui),i.comp&&this.menuItems.push(i.comp))})})}addItem(e){const t=this.createManagedBean(new hr);return t.init({menuItemDef:e,isAnotherSubMenuOpen:()=>this.menuItems.some(i=>i.isSubMenuOpen()),level:this.level,contextParams:this.params}).then(()=>(t.setParentComponent(this),this.addManagedListener(t,hr.EVENT_CLOSE_MENU,i=>{this.dispatchEvent(i)}),this.addManagedListener(t,hr.EVENT_MENU_ITEM_ACTIVATED,i=>{this.activeMenuItem&&this.activeMenuItem!==i.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=i.menuItem}),{comp:t,eGui:t.getGui()}))}activateFirstItem(){const e=this.menuItems.filter(t=>!t.isDisabled())[0];e&&e.activate()}createSeparator(){return xe('\n <div class="ag-menu-separator" aria-hidden="true">\n <div class="ag-menu-separator-part"></div>\n <div class="ag-menu-separator-part"></div>\n <div class="ag-menu-separator-part"></div>\n <div class="ag-menu-separator-part"></div>\n </div>')}handleNavKey(e){switch(e){case w.UP:case w.DOWN:const i=this.findNextItem(e===w.UP);return void(i&&i!==this.activeMenuItem&&i.activate())}e===(this.gridOptionsService.get("enableRtl")?w.RIGHT:w.LEFT)?this.closeIfIsChild():this.openChild()}closeIfIsChild(e){const t=this.getParentComponent();return!!(t&&t instanceof hr)&&(e&&e.preventDefault(),t.closeSubMenu(),t.getGui().focus(),!0)}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(e){const t=this.menuItems.filter(o=>!o.isDisabled());if(!t.length)return;if(!this.activeMenuItem)return e?K(t):t[0];e&&t.reverse();let i,s=!1;for(let o=0;o<t.length;o++){const r=t[o];if(s){i=r;break}r===this.activeMenuItem&&(s=!0)}return s&&!i?t[0]:i||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}};u([f("focusService")],sl.prototype,"focusService",2),u([b],sl.prototype,"postConstruct",1);var Bd=class extends Us{constructor(e){super(),this.wrappedComponent=e,this.setTemplateFromElement(e.getGui())}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}handleKeyDown(e){e.key===w.ESCAPE&&this.closePanel()}onTabKeyDown(e){e.defaultPrevented||(this.closePanel(),e.preventDefault())}closePanel(){const e=this.parentComponent;e.closeSubMenu(),setTimeout(()=>
1e.getGui().focus(),0)}};u([b],Bd.prototype,"postConstruct",1);var Ci=class Cs extends T{constructor(){super(...arguments),this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}init(t){var i,s;const{menuItemDef:o,isAnotherSubMenuOpen:r,level:n,childComponent:l,contextParams:a}=t;return this.params=t.menuItemDef,this.level=n,this.isAnotherSubMenuOpen=r,this.childComponent=l,this.contextParams=a,this.cssClassPrefix=null!=(s=null==(i=this.params.menuItemParams)?void 0:i.cssClassPrefix)?s:"ag-menu-option",this.userComponentFactory.getMenuItemCompDetails(this.params,ie(L({},o),{level:n,isAnotherSubMenuOpen:r,openSubMenu:h=>this.openSubMenu(h),closeSubMenu:()=>this.closeSubMenu(),closeMenu:h=>this.closeMenu(h),updateTooltip:(h,g)=>this.refreshTooltip(h,g),onItemActivated:()=>this.onItemActivated()})).newAgStackInstance().then(h=>{var g;this.menuItemComp=h;const m=null==(g=h.configureDefaults)?void 0:g.call(h);m&&this.configureDefaults(!0===m?void 0:m)})}addListeners(t,i){i?.suppressClick||this.addManagedListener(t,"click",s=>this.onItemSelected(s)),i?.suppressKeyboardSelect||this.addManagedListener(t,"keydown",s=>{(s.key===w.ENTER||s.key===w.SPACE)&&(s.preventDefault(),this.onItemSelected(s))}),i?.suppressMouseDown||this.addManagedListener(t,"mousedown",s=>{s.stopPropagation(),s.preventDefault()}),i?.suppressMouseOver||(this.addManagedListener(t,"mouseenter",()=>this.onMouseEnter()),this.addManagedListener(t,"mouseleave",()=>this.onMouseLeave()))}isDisabled(){return!!this.params.disabled}openSubMenu(t=!1){var i,s;if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;const o=xe('<div class="ag-menu" role="presentation"></div>');this.eSubMenuGui=o;let r,n=()=>{this.subMenuIsOpening=!1};if(this.childComponent){const h=this.createBean(new Bd(this.childComponent));h.setParentComponent(this);const g=h.getGui(),m="mouseenter",C=()=>this.cancelDeactivate();g.addEventListener(m,C),r=()=>g.removeEventListener(m,C),o.appendChild(g),this.childComponent.afterGuiAttached&&(n=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){const h=this.createBean(new sl(this.level+1,this.contextParams));h.setParentComponent(this),h.addMenuItems(this.params.subMenu),o.appendChild(h.getGui()),this.addManagedListener(h,Cs.EVENT_CLOSE_MENU,g=>this.dispatchEvent(g)),h.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),r=()=>this.destroyBean(h),t&&(n=()=>{h.activateFirstItem(),this.subMenuIsOpening=!1})}const l=this.popupService.positionPopupForMenu.bind(this.popupService,{eventSource:this.eGui,ePopup:o}),a=this.localeService.getLocaleTextFunc(),c=this.popupService.addPopup({modal:!0,eChild:o,positionCallback:l,anchorToElement:this.eGui,ariaLabel:a("ariaLabelSubMenu","SubMenu"),afterGuiAttached:n});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{var h,g;c&&c.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),r(),null==(g=(h=this.menuItemComp).setExpanded)||g.call(h,!1),this.eSubMenuGui=void 0},null==(s=(i=this.menuItemComp).setExpanded)||s.call(i,!0)}setAriaExpanded(t){this.suppressAria||Pt(this.eGui,t)}closeSubMenu(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1))}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(t){var i,s;this.cancelActivate(),!this.params.disabled&&(this.isActive=!0,this.suppressRootStyles||this.eGui.classList.add(`${this.cssClassPrefix}-active`),null==(s=(i=this.menuItemComp).setActive)||s.call(i,!0),this.suppressFocus||this.eGui.focus({preventScroll:!0}),t&&this.params.subMenu&&window.setTimeout(()=>{this.isAlive()&&this.isActive&&this.openSubMenu()},300),this.onItemActivated())}deactivate(){var t,i;this.cancelDeactivate(),this.suppressRootStyles||this.eGui.classList.remove(`${this.cssClassPrefix}-active`),null==(i=(t=this.menuItemComp).setActive)||i.call(t,!1),this.isActive=!1,this.subMenuIsOpen&&this.hideSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(t){this.parentComponent=t}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(t){var i,s;null==(s=(i=this.menuItemComp).select)||s.call(i),this.params.action?this.getFrameworkOverrides().wrapOutgoing(()=>this.params.action(this.gridOptionsService.addGridCommonParams(L({},this.contextParams)))):this.openSubMenu(t&&"keydown"===t.type),!(this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect)&&this.closeMenu(t)}closeMenu(t){this.dispatchEvent({type:Cs.EVENT_CLOSE_MENU,event:t})}onItemActivated(){this.dispatchEvent({type:Cs.EVENT_MENU_ITEM_ACTIVATED,menuItem:this})}cancelActivate(){this.activateTimeoutId&&(window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0)}cancelDeactivate(){this.deactivateTimeoutId&&(window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0)}onMouseEnter(){this.cancelDeactivate(),this.isAnotherSubMenuOpen()?this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),Cs.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),Cs.ACTIVATION_DELAY):this.deactivate()}configureDefaults(t){var i,s,o;if(this.tooltip=this.params.tooltip,!this.menuItemComp)return void setTimeout(()=>this.configureDefaults(t));let r=this.menuItemComp.getGui();const n=null==(s=(i=this.menuItemComp).getRootElement)?void 0:s.call(i);n&&(t?.suppressRootStyles||r.classList.add("ag-menu-option-custom"),r=n),this.eGui=r,this.suppressRootStyles=!!t?.suppressRootStyles,this.suppressRootStyles||(r.classList.add(this.cssClassPrefix),null==(o=this.params.cssClasse
1s)||o.forEach(l=>r.classList.add(l)),this.params.disabled&&r.classList.add(`${this.cssClassPrefix}-disabled`)),t?.suppressTooltip||this.refreshTooltip(),this.suppressAria=!!t?.suppressAria,this.suppressAria||(re(r,"treeitem"),pa(r,this.level+1),this.params.disabled&&Qr(r,!0)),t?.suppressTabIndex||r.setAttribute("tabindex","-1"),this.params.disabled||this.addListeners(r,t),this.suppressFocus=!!t?.suppressFocus}refreshTooltip(t,i){this.tooltip=t,this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),t&&this.menuItemComp&&(this.tooltipFeature=this.createBean(new Ft({getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:i})))}destroy(){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}};Ci.EVENT_CLOSE_MENU="closeMenu",Ci.EVENT_MENU_ITEM_ACTIVATED="menuItemActivated",Ci.ACTIVATION_DELAY=80,u([f("popupService")],Ci.prototype,"popupService",2),u([f("userComponentFactory")],Ci.prototype,"userComponentFactory",2),u([f("beans")],Ci.prototype,"beans",2);var hr=Ci,vi=class Rl extends k{constructor(t){super(Rl.getTemplate(t)),this.config=t,this.closable=!0}static getTemplate(t){const i=t.cssIdentifier||"default";return`<div class="ag-panel ag-${i}-panel" tabindex="-1">\n <div ref="eTitleBar" class="ag-panel-title-bar ag-${i}-panel-title-bar ag-unselectable">\n <span ref="eTitle" class="ag-panel-title-bar-title ag-${i}-panel-title-bar-title"></span>\n <div ref="eTitleBarButtons" class="ag-panel-title-bar-buttons ag-${i}-panel-title-bar-buttons"></div>\n </div>\n <div ref="eContentWrapper" class="ag-panel-content-wrapper ag-${i}-panel-content-wrapper"></div>\n </div>`}postConstruct(){const{component:t,closable:i,hideTitleBar:s,title:o,minWidth:r=250,width:n,minHeight:l=250,height:a,centered:c,popup:h,x:g,y:m}=this.config;this.positionableFeature=new Wi(this.getGui(),{minWidth:r,width:n,minHeight:l,height:a,centered:c,x:g,y:m,popup:h,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}),this.createManagedBean(this.positionableFeature);const C=this.getGui();t&&this.setBodyComponent(t),s?U(this.eTitleBar,!1):(o&&this.setTitle(o),this.setClosable(i??this.closable)),this.addManagedListener(this.eTitleBar,"mousedown",v=>{const E=this.gridOptionsService.getDocument();if(C.contains(v.relatedTarget)||C.contains(E.activeElement)||this.eTitleBarButtons.contains(v.target))return void v.preventDefault();const S=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");S&&S.focus()}),(!h||!this.positionableFeature.isPositioned())&&(this.renderComponent&&this.renderComponent(),this.positionableFeature.initialisePosition(),this.eContentWrapper.style.height="0")}renderComponent(){const t=this.getGui();t.focus(),this.close=()=>{t.parentElement.removeChild(t),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(t){this.positionableFeature.setHeight(t)}getWidth(){return this.positionableFeature.getWidth()}setWidth(t){this.positionableFeature.setWidth(t)}setClosable(t){if(t!==this.closable&&(this.closable=t),t){const i=this.closeButtonComp=new k(Rl.CLOSE_BTN_TEMPLATE);this.getContext().createBean(i);const s=i.getGui(),o=oe("close",this.gridOptionsService);o.classList.add("ag-panel-title-bar-button-icon"),s.appendChild(o),this.addTitleBarButton(i),i.addManagedListener(s,"click",this.onBtClose.bind(this))}else if(this.closeButtonComp){const i=this.closeButtonComp.getGui();i.parentElement.removeChild(i),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}}setBodyComponent(t){t.setParentComponent(this),this.eContentWrapper.appendChild(t.getGui())}addTitleBarButton(t,i){const s=this.eTitleBarButtons,o=s.children,r=o.length;null==i&&(i=r),i=Math.max(0,Math.min(i,r)),t.addCssClass("ag-panel-title-bar-button");const n=t.getGui();0===i?s.insertAdjacentElement("afterbegin",n):i===r?s.insertAdjacentElement("beforeend",n):o[i-1].insertAdjacentElement("afterend",n),t.setParentComponent(this)}getBodyHeight(){return ys(this.eContentWrapper)}getBodyWidth(){return Jt(this.eContentWrapper)}setTitle(t){this.eTitle.innerText=t}onBtClose(){this.close()}destroy(){this.closeButtonComp&&(this.closeButtonComp=this.destroyBean(this.closeButtonComp));const t=this.getGui();t&&ze(t)&&this.close(),super.destroy()}};vi.CLOSE_BTN_TEMPLATE='<div class="ag-button"></div>',u([A("eContentWrapper")],vi.prototype,"eContentWrapper",2),u([A("eTitleBar")],vi.prototype,"eTitleBar",2),u([A("eTitleBarButtons")],vi.prototype,"eTitleBarButtons",2),u([A("eTitle")],vi.prototype,"eTitle",2),u([b],vi.prototype,"postConstruct",1);var bg=vi;u([f("popupService")],class extends bg{constructor(e){super(ie(L({},e),{popup:!0})),this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}postConstruct(){const e=this.getGui(),{movable:t,resizable:i,maximizable:s}=this.config;this.addCssClass("ag-dialog"),super.postConstruct(),this.addManagedListener(e,"focusin",o=>{this.popupService.bringPopupToFront(e)}),t&&this.setMovable(t),s&&this.setMaximizable(s),i&&this.setResizable(i)}renderComponent(){const e=this.getGui(),{alwaysOnTop:t,modal:i,title:s,afterGuiAttached:o}=this.config,r=this.localeService.getLocaleTextFunc(),n=this.popupService.addPopup({modal:i,eChild:e,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:t,ariaLabel:s||r("ariaLabelDialog","Dialog"),afterGuiAttached:o});n&&(this.close=n.hideFunc)}onClosed(e){var t,i;this.destroy(),null==(i=(t=this.config).closedCallback)||i.call(t,e)}toggleMaximize(){const e=this.positionableFeature.getPosition();if(this.isMaximized){const{x:t,y:i,width:s,height:o}=this.lastPosition;this.setWidth(s),this.setHeight(o),this.positionableFeature.offsetElement(t,i)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=e.x,this.lastPosition.y=e.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){U(this.maximizeIcon,!this.isMaximized),U(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){this.maximizeListeners.length&&(this.maximizeListeners.forEac
1h(e=>e()),this.maximizeListeners.length=0),this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(e){this.positionableFeature.setResizable(e)}setMovable(e){this.positionableFeature.setMovable(e,this.eTitleBar)}setMaximizable(e){if(!e)return this.clearMaximizebleListeners(),void(this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0));const t=this.eTitleBar;if(!t||e===this.isMaximizable)return;const i=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),i.addManagedListener(i.getGui(),"click",this.toggleMaximize.bind(this)),this.addTitleBarButton(i,0),this.maximizeListeners.push(this.addManagedListener(t,"dblclick",this.toggleMaximize.bind(this))),this.resizeListenerDestroy=this.addManagedListener(this,"resize",()=>{this.isMaximized=!1,this.refreshMaximizeIcon()})}buildMaximizeAndMinimizeElements(){const e=this.maximizeButtonComp=this.createBean(new k('<div class="ag-dialog-button"></span>')),t=e.getGui();return this.maximizeIcon=oe("maximize",this.gridOptionsService),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=oe("minimize",this.gridOptionsService),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),e}}.prototype,"popupService",2);var Ag=0,_t=class extends T{constructor(){super(...arguments),this.popupList=[]}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl}),this.addManagedListener(this.eventService,p.EVENT_GRID_STYLES_CHANGED,this.handleThemeChange.bind(this))}getPopupParent(){return this.gridOptionsService.get("popupParent")||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:i}=e,s=this.getPopupIndex(i);-1!==s&&(this.popupList[s].alignedToElement=t);const o=t.getBoundingClientRect(),r=this.getParentRect(),n=this.keepXYWithinBounds(i,o.top-r.top,0),l=i.clientWidth>0?i.clientWidth:200;i.style.minWidth=`${l}px`;const c=r.right-r.left-l;let h;function g(){return o.right-r.left-2}function m(){return o.left-r.left-l}this.gridOptionsService.get("enableRtl")?(h=m(),h<0&&(h=g(),this.setAlignedStyles(i,"left")),h>c&&(h=0,this.setAlignedStyles(i,"right"))):(h=g(),h>c&&(h=m(),this.setAlignedStyles(i,"right")),h<0&&(h=0,this.setAlignedStyles(i,"left"))),i.style.left=`${h}px`,i.style.top=`${n}px`}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:i,nudgeY:s,skipObserver:o}=e;this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:!0,skipObserver:o,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,eventSource:r,alignSide:n="left",position:l="over",column:a,rowNode:c,type:h}=e,g=r.getBoundingClientRect(),m=this.getParentRect(),C=this.getPopupIndex(t);-1!==C&&(this.popupList[C].alignedToElement=r),this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,updatePosition:()=>{let S,E=g.left-m.left;return"right"===n&&(E-=t.offsetWidth-g.width),"over"===l?(S=g.top-m.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),S="under"===this.shouldRenderUnderOrAbove(t,g,m,e.nudgeY||0)?g.top-m.top+g.height:g.top-t.offsetHeight-2*(s||0)-m.top),{x:E,y:S}},postProcessCallback:()=>this.callPostProcessPopup(h,t,r,null,a,c)})}shouldRenderUnderOrAbove(e,t,i,s){const o=i.bottom-t.bottom,r=t.top-i.top,n=e.offsetHeight+s;return o>n?"under":r>n||r>o?"above":"under"}setAlignedStyles(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const s=this.popupList[i],{alignedToElement:o}=s;!o||(["right","left","over","above","under"].forEach(n=>{o.classList.remove(`ag-has-popup-positioned-${n}`),e.classList.remove(`ag-popup-positioned-${n}`)}),!t)||(o.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`))}callPostProcessPopup(e,t,i,s,o,r){const n=this.gridOptionsService.getCallback("postProcessPopup");n&&n({column:o,rowNode:r,ePopup:t,type:e,eventSource:i,mouseEvent:s})}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:s,nudgeY:o,skipObserver:r,updatePosition:n}=e,l={width:0,height:0},a=(c=!1)=>{let{x:h,y:g}=n();c&&t.clientWidth===l.width&&t.clientHeight===l.height||(l.width=t.clientWidth,l.height=t.clientHeight,s&&(h+=s),o&&(g+=o),i&&(h=this.keepXYWithinBounds(t,h,1),g=this.keepXYWithinBounds(t,g,0)),t.style.left=`${h}px`,t.style.top=`${g}px`,e.postProcessCallback&&e.postProcessCallback())};if(a(),!r){const c=this.resizeObserverService.observeResize(t,()=>a(!0));setTimeout(()=>c(),_t.WAIT_FOR_POPUP_CONTENT_RESIZE)}}getActivePopups(){return this.popupList.map(e=>e.element)}getPopupList(){return this.popupList}getParentRect(){const e=this.gridOptionsService.getDocument();let t=this.getPopupParent();return t===e.body?t=e.documentElement:"static"===getComputedStyle(t).position&&(t=t.offsetParent),Sn(t)}keepXYWithinBounds(e,t,i){const s=0===i,o=s?"clientHeight":"clientWidth",r=s?"top":"left",n=s?"offsetHeight":"offsetWidth",l=s?"scrollTop":"scrollLeft",a=this.gridOptionsService.getDocument(),c=a.documentElement,h=this.getPopupParent(),g=h.getBoundingClientRect(),m=a.documentElement.getBoundingClientRect(),C=h===a.body,v=e[n];let S=C?(s?wn:Rs)(c)+c[l]:h[o];C&&(S-=Math.abs(m[r]-g[r]));const D=S-v;return Math.min(Math.max(t,0),Math.abs(D))}addPopup(e){const t=this.gridOptionsService.getDocument(),{eChild:i,ariaLabel:s,alwaysOnTop:o,positionCallback:r,anchorToElement:n}=e;if(!t)return console.warn("AG Grid: could not find the document, document is empty"),{hideFunc:()=>{}};const l=this.getPopupIndex(i);if(-1!==l)return{hideFunc:this.popupList[l].hideFunc};this.initialisePopupPosition(i);const a=this.createPopupWrapper(i,s,!!o),c=this.addEventListenersToPopup(ie(L({},e),{wrapperEl:a}));return r&&r(),this.addPopupToPopupList(i,a,c,n),{hideFunc:c}}initialisePopupPosition(e){const i=this.getPopupParent().getBoundingClientRect();R(e.style.top)||(e.style.top=-1*i.top+"px"),R(e.style.left)||(e.style.left=-1*i.left+"px")}createPopupWrapper(e,t,i){const s=this.getPopupParent(),o=document.createElement("div"),{allThemes:r}=this.environment.getTheme();return r.length&&o.classList.add(...r),o.classList.add("ag-popup"),e.classList.add(this.gridOptionsService.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||re(e,"dialog"),lt(e,t),o.appendChild(e),s.appendChild(o),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),o}handleThemeChange(){const{allThemes:e}=this.environment.getTheme();for(const t of this.popupList){for(const i of Array.from(t.wrapper.classList))i.startsWith("ag-theme-")&&t.wrapper.classList.remove(i);e.length&&t.wrapper.classList.add(...e)}}addEventListenersToPopup(e){const t=this.gridOptionsService.getDocument(),i=this.getPopupParent(),{wrapperEl:s,eChild:o,closedCallback:n,afterGuiAttached:l,closeOnEsc:a,modal:c}=e;let h=!1;const g=E=>
1{s.contains(t.activeElement)&&E.key===w.ESCAPE&&!nt(E)&&v({keyboardEvent:E})},m=E=>v({mouseEvent:E}),C=E=>v({touchEvent:E}),v=(E={})=>{const{mouseEvent:S,touchEvent:D,keyboardEvent:y}=E;this.isEventFromCurrentPopup({mouseEvent:S,touchEvent:D},o)||h||(h=!0,i.removeChild(s),t.removeEventListener("keydown",g),t.removeEventListener("mousedown",m),t.removeEventListener("touchstart",C),t.removeEventListener("contextmenu",m),this.eventService.removeEventListener(p.EVENT_DRAG_STARTED,m),n&&n(S||D||y),this.removePopupFromPopupList(o))};return l&&l({hidePopup:v}),window.setTimeout(()=>{a&&t.addEventListener("keydown",g),c&&(t.addEventListener("mousedown",m),this.eventService.addEventListener(p.EVENT_DRAG_STARTED,m),t.addEventListener("touchstart",C),t.addEventListener("contextmenu",m))},0),v}addPopupToPopupList(e,t,i,s){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:Ag++,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s)}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const s=this.popupList[i];if(s.stopAnchoringPromise&&s.stopAnchoringPromise.then(r=>r&&r()),s.stopAnchoringPromise=void 0,s.isAnchored=!1,!t)return;const o=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:s.hideFunc});return s.stopAnchoringPromise=o,s.isAnchored=!0,o}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter(t=>t.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:s,ePopup:o}=e,r=s.getBoundingClientRect(),n=i.top-r.top,l=i.left-r.left;let a=n,c=l;const h=o.style.top,g=parseInt(h.substring(0,h.length-1),10),m=o.style.left,C=parseInt(m.substring(0,m.length-1),10);return new Ge(v=>{this.getFrameworkOverrides().setInterval(()=>{const E=t.getBoundingClientRect(),S=s.getBoundingClientRect();if(0==S.top&&0==S.left&&0==S.height&&0==S.width)return void e.hidePopup();const y=E.top-S.top;if(y!=a){const F=this.keepXYWithinBounds(o,g+n-y,0);o.style.top=`${F}px`}a=y;const P=E.left-S.left;if(P!=c){const F=this.keepXYWithinBounds(o,C+l-P,1);o.style.left=`${F}px`}c=P},200).then(E=>{v(()=>{null!=E&&window.clearInterval(E)})})})}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:s}=e,o=i||s;if(!o)return!1;const r=this.getPopupIndex(t);if(-1===r)return!1;for(let n=r;n<this.popupList.length;n++)if(Oo(this.popupList[n].element,o))return!0;return this.isElementWithinCustomPopup(o.target)}isElementWithinCustomPopup(e){const t=this.gridOptionsService.getDocument();for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||null===e.parentElement)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),s=i.length,o=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),r=o.length,n=this.getWrapper(e);if(!n||s<=1||!t.contains(e))return;const l=i.indexOf(n),a=n.querySelectorAll("div"),c=[];for(a.forEach(h=>{0!==h.scrollTop&&c.push([h,h.scrollTop])}),r?n.classList.contains("ag-always-on-top")?l!==s-1&&K(o).insertAdjacentElement("afterend",n):l!==s-r-1&&o[0].insertAdjacentElement("beforebegin",n):l!==s-1&&K(i).insertAdjacentElement("afterend",n);c.length;){const h=c.pop();h[0].scrollTop=h[1]}}};_t.WAIT_FOR_POPUP_CONTENT_RESIZE=200,u([f("focusService")],_t.prototype,"focusService",2),u([f("ctrlsService")],_t.prototype,"ctrlsService",2),u([f("resizeObserverService")],_t.prototype,"resizeObserverService",2),u([b],_t.prototype,"postConstruct",1),_t=u([O("popupService")],_t);var Fg=class extends k{constructor(){super('\n <div class="ag-autocomplete-row" role="presentation">\n <div class="ag-autocomplete-row-label"></div>\n </div>'),this.hasHighlighting=!1}setState(e,t){this.value=e,this.render(),this.updateSelected(t)}updateSelected(e){this.addOrRemoveCssClass("ag-autocomplete-row-selected",e)}setSearchString(e){var t;let i=!1;if(R(e)){const s=null==(t=this.value)?void 0:t.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(s>=0){i=!0,this.hasHighlighting=!0;const o=s+e.length,r=pe(this.value.slice(0,s)),n=pe(this.value.slice(s,o)),l=pe(this.value.slice(o));this.getGui().lastElementChild.innerHTML=`${r}<b>${n}</b>${l}`}}!i&&this.hasHighlighting&&(this.hasHighlighting=!1,this.render())}render(){var e;this.getGui().lastElementChild.innerHTML=null!=(e=pe(this.value))?e:" "}},pr=class Nu extends si{constructor(t){super(Nu.TEMPLATE),this.params=t,this.searchString=""}destroy(){super.destroy()}init(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new Vd({cssIdentifier:"autocomplete"})),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.autocompleteEntries.length,getRow:i=>this.autocompleteEntries[i]});const t=this.virtualList.getGui();this.addManagedListener(t,"click",()=>this.params.onConfirmed()),this.addManagedListener(t,"mousemove",this.onMouseMove.bind(this)),this.addManagedListener(t,"mousedown",i=>i.preventDefault()),this.setSelectedValue(0)}onNavigationKeyDown(t,i){t.preventDefault();const s=this.autocompleteEntries.indexOf(this.selectedValue);this.checkSetSelectedValue(i===w.UP?s-1:s+1)}setSearch(t){this.searchString=t,R(t)?this.runSearch():(this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList.refresh(),this.checkSetSelectedValue(0)),this.updateSearchInList()}runContainsSearch(t,i){let s,o=!1;const r=t.toLocaleLowerCase(),n=i.filter(l=>{const c=l.toLocaleLowerCase().indexOf(r),h=0===c,g=c>=0;return g&&(!s||!o&&h||o===h&&l.length<s.length)&&(s=l,o=h),g});return!s&&n.length&&(s=n[0]),{topMatch:s,allMatches:n}}runSearch(){var t,i;const{autocompleteEntries:s}=this.params,o=s.map(c=>{var h;return null!=(h=c.displayValue)?h:c.key});let r,n;if(this.params.useFuzzySearch)r=Fs(this.searchString,o,!0).values,n=r.length?r[0]:void 0;else{const c=this.runContainsSearch(this.searchString,o);r=c.allMatches,n=c.topMatch}let l=s.filter(({key:c,displayValue:h})=>r.includes(h??c));if(!l.length&&this.selectedValue&&null!=(i=null==(t=this.params)?void 0:t.forceLastSelection)&&i.call(t,this.selectedValue,this.searchString)&&(l=[this.selectedValue]),this.autocompleteEntries=l,this.virtualList.refresh(),!n)return;const a=r.indexOf(n);this.checkSetSelectedValue(a)}updateSearchInList(){this.virtualList.forEachRenderedRow(t=>t.setSearchString(this.searchString))}checkSetSelectedValue(t){t>=0&&t<this.autocompleteEntries.length&&this.setSelectedValue(t)}setSelectedValue(t){const i=this.autocompleteEntries[t];this.selectedValue!==i&&(this.selectedValue=i,this.virtualList.ensureIndexVisible(t),this.virtualList.forEachRenderedRow((s,o)=>{s.updateSelected(t===o)}))}createRowComponent(t){var i;const s=new Fg;return this.getContext().createBean(s),s.setState(null!=(i=t.displayValue)?i:t.key,t===this.selectedValue),s}onMouseMove(t){const i=this.virtualList.getGui().getBoundingClientRect(),s=this.virtualList.getScrollTop(),r=Math.floor((t.clientY-i.top+s)/this.virtualList.getRowHeight());this.checkSetSelectedValue(r)}afterGuiAttached(){this.virtualList.refresh()}getSelectedValue(){var t;return this.autocompleteEntries.length&&null!=(t=this.selectedValue)?t:null}};pr.TEMPLATE='<div class="ag-autocomplete-list-popup">\n <div ref="eList" class="ag-autocomplete-list"></div>\n <div>',u([A("eList")],pr.prototype,"eList",2),u([b],pr.prototype,"init",1);var Og=pr,zt=class Co extends k{constructor(){super('\n <div class="ag-autocomplete" role="presentation">\n <ag-input-text-field ref="eAutocompleteInput"></ag-input-text-field>\n </div>'),this.isListOpen=!1,this.lastPosition=0,this.valid=!0}postConstruct(){this.eAutocompleteInput.onValueChange(t=>this.onValueChanged(t)),this.eAutocompleteInput.getInputElement().setAttribute("autocomplete","off"),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.addGuiEventListener("click",this.updatePositionAndList.bind(this)),this.addDestroyFunc(()=>{this.destroyBean(this.autocompleteList)}),this.addGuiEventListener("focusout",()=>this.onFocusOut())}onValueChanged(t){const i=ht(t);
1this.updateValue(i),this.updateAutocompleteList(i)}updateValue(t){this.updateLastPosition(),this.dispatchEvent({type:Co.EVENT_VALUE_CHANGED,value:t}),this.validate(t)}updateAutocompleteList(t){var i,s,o,r;const n=null!=(s=null==(i=this.listGenerator)?void 0:i.call(this,t,this.lastPosition))?s:{enabled:!1};if((!n.type||n.type!==(null==(o=this.autocompleteListParams)?void 0:o.type))&&this.isListOpen&&this.closeList(),this.autocompleteListParams=n,null!=(r=this.autocompleteListParams)&&r.enabled){this.isListOpen||this.openList();const{searchString:l}=this.autocompleteListParams;this.autocompleteList.setSearch(l??"")}else this.isListOpen&&this.closeList()}onKeyDown(t){const i=t.key;switch(this.updateLastPosition(),i){case w.ENTER:this.onEnterKeyDown(t);break;case w.TAB:this.onTabKeyDown(t);break;case w.DOWN:case w.UP:this.onUpDownKeyDown(t,i);break;case w.LEFT:case w.RIGHT:case w.PAGE_HOME:case w.PAGE_END:setTimeout(()=>{this.updatePositionAndList()});break;case w.ESCAPE:this.onEscapeKeyDown(t);break;case w.SPACE:t.ctrlKey&&!this.isListOpen&&(t.preventDefault(),this.forceOpenList())}}confirmSelection(){var t;const i=null==(t=this.autocompleteList)?void 0:t.getSelectedValue();i&&(this.closeList(),this.dispatchEvent({type:Co.EVENT_OPTION_SELECTED,value:this.getValue(),position:this.lastPosition,updateEntry:i,autocompleteType:this.autocompleteListParams.type}))}onTabKeyDown(t){this.isListOpen&&(t.preventDefault(),t.stopPropagation(),this.confirmSelection())}onEnterKeyDown(t){t.preventDefault(),this.isListOpen?this.confirmSelection():this.onCompleted()}onUpDownKeyDown(t,i){var s;t.preventDefault(),this.isListOpen?null==(s=this.autocompleteList)||s.onNavigationKeyDown(t,i):this.forceOpenList()}onEscapeKeyDown(t){this.isListOpen&&(t.preventDefault(),t.stopPropagation(),this.closeList(),this.setCaret(this.lastPosition,!0))}onFocusOut(){this.isListOpen&&this.closeList()}updatePositionAndList(){var t;this.updateLastPosition(),this.updateAutocompleteList(null!=(t=this.eAutocompleteInput.getValue())?t:null)}setCaret(t,i){const s=this.gridOptionsService.getDocument();i&&s.activeElement===s.body&&this.eAutocompleteInput.getFocusableElement().focus();const o=this.eAutocompleteInput.getInputElement();o.setSelectionRange(t,t),t===o.value.length&&(o.scrollLeft=o.scrollWidth)}forceOpenList(){this.onValueChanged(this.eAutocompleteInput.getValue())}updateLastPosition(){var t;this.lastPosition=null!=(t=this.eAutocompleteInput.getInputElement().selectionStart)?t:0}validate(t){var i;this.validator&&(this.validationMessage=this.validator(t),this.eAutocompleteInput.getInputElement().setCustomValidity(null!=(i=this.validationMessage)?i:""),this.valid=!this.validationMessage,this.dispatchEvent({type:Co.EVENT_VALID_CHANGED,isValid:this.valid,validationMessage:this.validationMessage}))}openList(){this.isListOpen=!0,this.autocompleteList=this.createBean(new Og({autocompleteEntries:this.autocompleteListParams.entries,onConfirmed:()=>this.confirmSelection(),forceLastSelection:this.forceLastSelection}));const t=this.autocompleteList.getGui(),i={ePopup:t,type:"autocomplete",eventSource:this.getGui(),position:"under",alignSide:this.gridOptionsService.get("enableRtl")?"right":"left",keepWithinBounds:!0},s=this.popupService.addPopup({eChild:t,anchorToElement:this.getGui(),positionCallback:()=>this.popupService.positionPopupByComponent(i),ariaLabel:this.listAriaLabel});this.hidePopup=s.hideFunc,this.autocompleteList.afterGuiAttached()}closeList(){this.isListOpen=!1,this.hidePopup(),this.destroyBean(this.autocompleteList),this.autocompleteList=null}onCompleted(){this.isListOpen&&this.closeList(),this.dispatchEvent({type:Co.EVENT_VALUE_CONFIRMED,value:this.getValue(),isValid:this.isValid()})}getValue(){return ht(this.eAutocompleteInput.getValue())}setInputPlaceholder(t){return this.eAutocompleteInput.setInputPlaceholder(t),this}setInputAriaLabel(t){return this.eAutocompleteInput.setInputAriaLabel(t),this}setListAriaLabel(t){return this.listAriaLabel=t,this}setListGenerator(t){return this.listGenerator=t,this}setValidator(t){return this.validator=t,this}isValid(){return this.valid}setValue(t){const{value:i,position:s,silent:o,updateListOnlyIfOpen:r,restoreFocus:n}=t;this.eAutocompleteInput.setValue(i,!0),this.setCaret(s??this.lastPosition,n),o||this.updateV
1alue(i),(!r||this.isListOpen)&&this.updateAutocompleteList(i)}setForceLastSelection(t){return this.forceLastSelection=t,this}setInputDisabled(t){return this.eAutocompleteInput.setDisabled(t),this}};zt.EVENT_VALUE_CHANGED="eventValueChanged",zt.EVENT_VALUE_CONFIRMED="eventValueConfirmed",zt.EVENT_OPTION_SELECTED="eventOptionSelected",zt.EVENT_VALID_CHANGED="eventValidChanged",u([f("popupService")],zt.prototype,"popupService",2),u([A("eAutocompleteInput")],zt.prototype,"eAutocompleteInput",2),u([b],zt.prototype,"postConstruct",1);var Mg=zt,Kt=class Pr extends k{constructor(t,i,s,o){super(),this.dragSourceDropTarget=t,this.ghost=i,this.horizontal=s,this.template=o}init(){var t;this.setTemplate(null!=(t=this.template)?t:Pr.TEMPLATE);const i=this.getGui();this.addElementClasses(i),this.addElementClasses(this.eDragHandle,"drag-handle"),this.addElementClasses(this.eText,"text"),this.addElementClasses(this.eButton,"button"),this.eDragHandle.appendChild(oe("columnDrag",this.gridOptionsService)),this.eButton.appendChild(oe("cancel",this.gridOptionsService)),this.setupComponents(),!this.ghost&&this.isDraggable()&&this.addDragSource(),this.setupAria(),this.setupTooltip(),this.activateTabIndex(),this.refreshDraggable()}isDraggable(){return!0}refreshDraggable(){this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!this.isDraggable())}setupAria(){const t=this.localeService.getLocaleTextFunc(),i=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(i,t),lt(this.getGui(),i.join(". "))}addAdditionalAriaInstructions(t,i){if(this.isRemovable()){const s=i("ariaDropZoneColumnComponentDescription","Press DELETE to remove");t.push(s)}}setupTooltip(){const t=()=>{const i=this.getTooltip();this.setTooltip({newTooltipText:i})};t(),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,t)}getDragSourceId(){}getDefaultIconName(){return V.ICON_NOT_ALLOWED}addDragSource(){const{dragAndDropService:t,eDragHandle:i}=this,s=this.createGetDragItem(),o=this.getDefaultIconName(),r={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:i,getDefaultIconName:()=>o,getDragItem:s,dragItemName:this.getDisplayName()};t.addDragSource(r,!0),this.addDestroyFunc(()=>t.removeDragSource(r))}setupComponents(){this.setTextValue(),this.setupRemove(),this.ghost&&this.addCssClass("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){U(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();const t={type:Pr.EVENT_COLUMN_REMOVE};this.addGuiEventListener("keydown",s=>this.onKeyDown(s)),this.addManagedListener(this.eButton,"click",s=>{this.dispatchEvent(t),s.stopPropagation()});const i=new we(this.eButton);this.addManagedListener(i,we.EVENT_TAP,()=>{this.dispatchEvent(t)}),this.addDestroyFunc(i.destroy.bind(i))}onKeyDown(t){t.key===w.DELETE&&this.isRemovable()&&(t.preventDefault(),this.dispatchEvent({type:Pr.EVENT_COLUMN_REMOVE}))}getDisplayValue(){return this.getDisplayName()}setTextValue(){const i=pe(this.getDisplayValue());this.eText.innerHTML=i}addElementClasses(t,i){t.classList.add("ag-column-drop-cell"+(i=i?`-${i}`:""),`ag-column-drop-${this.horizontal?"horizontal":"vertical"}-cell${i}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}};Kt.EVENT_COLUMN_REMOVE="columnRemove",Kt.TEMPLATE='<span role="option">\n <span ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>\n <span ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>\n <span ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>\n </span>',u([f("dragAndDropService")],Kt.prototype,"dragAndDropService",2),u([A("eText")],Kt.prototype,"eText",2),u([A("eDragHandle")],Kt.prototype,"eDragHandle",2),u([A("eButton")],Kt.prototype,"eButton",2),u([b],Kt.prototype,"init",1);var Ig=Kt,js=class Dt extends k{constructor(t){super('<div class="ag-unselectable" role="presentation"></div>'),this.horizontal=t,this.state=Dt.STATE_NOT_DRAGGING,this.guiDestroyFunctions=[],this.childPillComponents=[],this.resizeEnabled=!1,this.addElementClasses(this.getGui()),this.ePillDropList=document.createElement("div"),this.addElementClasses(this.ePillDropList,"list"),re(this.ePillDropList,"listbox")}isHorizontal(){return this.horizontal}
1toggleResizable(t){this.positionableFeature.setResizable(!!t&&{bottom:!0}),this.resizeEnabled=t}isSourceEventFromTarget(t){const{dropZoneTarget:i,dragSource:s}=t;return i.contains(s.eElement)}destroy(){this.destroyGui(),super.destroy()}destroyGui(){this.guiDestroyFunctions.forEach(t=>t()),this.guiDestroyFunctions.length=0,this.childPillComponents.length=0,ce(this.getGui()),ce(this.ePillDropList)}init(t){this.params=t??{},this.createManagedBean(new Ht(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.setupDropTarget(),this.positionableFeature=new Wi(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature),this.refreshGui(),lt(this.ePillDropList,this.getAriaLabel())}handleKeyDown(t){let s=t.key===w.DOWN,o=t.key===w.UP;if(this.horizontal){const n=this.gridOptionsService.get("enableRtl");s=!n&&t.key===w.RIGHT||n&&t.key===w.LEFT,o=!n&&t.key===w.LEFT||n&&t.key===w.RIGHT}if(!s&&!o)return;const r=this.focusService.findNextFocusableElement(this.getFocusableElement(),!1,o);r&&(t.preventDefault(),r.focus())}addElementClasses(t,i){t.classList.add("ag-column-drop"+(i=i?`-${i}`:""),`ag-column-drop-${this.horizontal?"horizontal":"vertical"}${i}`)}setupDropTarget(){this.dropTarget={getContainer:this.getGui.bind(this),getIconName:this.getIconName.bind(this),onDragging:this.onDragging.bind(this),onDragEnter:this.onDragEnter.bind(this),onDragLeave:this.onDragLeave.bind(this),onDragStop:this.onDragStop.bind(this),isInterestedIn:this.isInterestedIn.bind(this)},this.dragAndDropService.addDropTarget(this.dropTarget)}minimumAllowedNewInsertIndex(){return 0}checkInsertIndex(t){const i=this.getNewInsertIndex(t);if(i<0)return!1;const s=this.minimumAllowedNewInsertIndex(),o=Math.max(s,i),r=o!==this.insertIndex;return r&&(this.insertIndex=o),r}getNewInsertIndex(t){const i=t.event,s=this.horizontal?i.clientX:i.clientY,o=this.childPillComponents.map(n=>n.getGui().getBoundingClientRect()),r=o.findIndex(n=>this.horizontal?n.right>s&&n.left<s:n.top<s&&n.bottom>s);if(-1===r){const n=this.gridOptionsService.get("enableRtl");return o.every(c=>s>(this.horizontal?c.right:c.bottom))?n&&this.horizontal?0:this.childPillComponents.length:o.every(c=>s<(this.horizontal?c.left:c.top))?n&&this.horizontal?this.childPillComponents.length:0:this.insertIndex}return this.insertIndex<=r?r+1:r}checkDragStartedBySelf(t){this.state===Dt.STATE_NOT_DRAGGING&&(this.state=Dt.STATE_REARRANGE_ITEMS,this.potentialDndItems=this.getItems(t.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(t),this.refreshGui())}onDragging(t){this.checkDragStartedBySelf(t),this.checkInsertIndex(t)&&this.refreshGui()}handleDragEnterEnd(t){}onDragEnter(t){const i=this.getItems(t.dragSource.getDragItem());this.state=Dt.STATE_NEW_ITEMS_IN;const s=i.filter(r=>this.isItemDroppable(r,t)),o=s.every(r=>-1!==this.childPillComponents.map(n=>n.getItem()).indexOf(r));if(0!==s.length){if(this.potentialDndItems=s,o)return void(this.state=Dt.STATE_NOT_DRAGGING);this.handleDragEnterEnd(t),this.checkInsertIndex(t),this.refreshGui()}}
1isPotentialDndItems(){return $l(this.potentialDndItems)}handleDragLeaveEnd(t){}onDragLeave(t){if(this.state===Dt.STATE_REARRANGE_ITEMS){const i=this.getItems(t.dragSource.getDragItem());this.removeItems(i)}this.isPotentialDndItems()&&(this.handleDragLeaveEnd(t),this.potentialDndItems=[],this.refreshGui()),this.state=Dt.STATE_NOT_DRAGGING}refreshOnDragStop(){return!0}onDragStop(){if(this.isPotentialDndItems()){let t=!1;this.state===Dt.STATE_NEW_ITEMS_IN?(this.addItems(this.potentialDndItems),t=!0):t=this.rearrangeItems(this.potentialDndItems),this.potentialDndItems=[],(this.refreshOnDragStop()||!t)&&this.refreshGui()}this.state=Dt.STATE_NOT_DRAGGING}removeItems(t){const i=this.getExistingItems().filter(s=>!Ue(t,s));this.updateItems(i)}addItems(t){if(!t)return;const i=this.getExistingItems().slice(),s=t.filter(o=>i.indexOf(o)<0);Hr(i,s,this.insertIndex),this.updateItems(i)}addItem(t){this.insertIndex=this.getExistingItems().length,this.addItems([t]),this.refreshGui()}rearrangeItems(t){const i=this.getNonGhostItems().slice();return Hr(i,t,this.insertIndex),!pt(i,this.getExistingItems())&&(this.updateItems(i),!0)}refreshGui(){const t=this.ePillDropList.scrollTop,i=this.resizeEnabled,s=this.getFocusedItem();let o=this.focusService.findNextFocusableElement();o||(o=this.focusService.findNextFocusableElement(void 0,!1,!0)),this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),this.isHorizontal()||(this.ePillDropList.scrollTop=t),i&&this.toggleResizable(i),this.focusService.isKeyboardMode()&&this.restoreFocus(s,o)}getFocusedItem(){const t=this.getGui(),i=this.gridOptionsService.getDocument().activeElement;return t.contains(i)?Array.from(t.querySelectorAll(".ag-column-drop-cell")).indexOf(i):-1}restoreFocus(t,i){const s=this.getGui(),o=Array.from(s.querySelectorAll(".ag-column-drop-cell"));if(-1===t)return;0===o.length&&i.focus();const n=o[Math.min(o.length-1,t)];n&&n.focus()}focusList(t){this.restoreFocus(t?this.childPillComponents.length-1:0,this.getFocusableElement())}getNonGhostItems(){const t=this.getExistingItems();return this.isPotentialDndItems()?t.filter(i=>!Ue(this.potentialDndItems,i)):t}addItemsToGui(){const i=this.getNonGhostItems().map(s=>this.createItemComponent(s,!1));if(this.isPotentialDndItems()){const s=this.potentialDndItems.map(o=>this.createItemComponent(o,!0));this.insertIndex>
1=i.length?i.push(...s):i.splice(this.insertIndex,0,...s)}this.appendChild(this.ePillDropList),i.forEach((s,o)=>{o>0&&this.addArrow(this.ePillDropList),this.ePillDropList.appendChild(s.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){this.childPillComponents.forEach((t,i)=>{const s=t.getGui();Go(s,i+1),xo(s,this.childPillComponents.length)})}createItemComponent(t,i){const s=this.createPillComponent(t,this.dropTarget,i,this.horizontal);return s.addEventListener(Ig.EVENT_COLUMN_REMOVE,this.removeItems.bind(this,[t])),this.context.createBean(s),this.guiDestroyFunctions.push(()=>this.destroyBean(s)),i||this.childPillComponents.push(s),s}addIconAndTitleToGui(){const{title:t,icon:i}=this.params;if(!t||!i)return;const s=document.createElement("div");if(Es(s,!0),this.addElementClasses(s,"title-bar"),this.addElementClasses(i,"icon"),this.addOrRemoveCssClass("ag-column-drop-empty",this.isExistingItemsEmpty()),s.appendChild(i),!this.horizontal){const o=document.createElement("span");this.addElementClasses(o,"title"),o.innerHTML=t,s.appendChild(o)}this.appendChild(s)}isExistingItemsEmpty(){return 0===this.getExistingItems().length}addEmptyMessageToGui(){const{emptyMessage:t}=this.params;if(!t||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;const i=document.createElement("span");i.innerHTML=t,this.addElementClasses(i,"empty-message"),this.ePillDropList.appendChild(i)}addArrow(t){if(this.horizontal){const s=oe(this.gridOptionsService.get("enableRtl")?"smallLeft":"smallRight",this.gridOptionsService);this.addElementClasses(s,"cell-separator"),t.appendChild(s)}}};js.STATE_NOT_DRAGGING="notDragging",js.STATE_NEW_ITEMS_IN="newItemsIn",js.STATE_REARRANGE_ITEMS="rearrangeItems",u([f("focusService")],js.prototype,"focusService",2),u([f("dragAndDropService")],js.prototype,"dragAndDropService",2);var Lg=["touchstart","touchend","touchmove","touchcancel"],Wd=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=t=>t(),this.wrapOutgoing=t=>t()}setInterval(e,t){return new Ge(i=>{i(window.setInterval(e,t))})}addEventListener(e,t,i,s){const o=Ue(Lg,t);e.addEventListener(t,i,{capture:!!s,passive:o})}get shouldWrapOutgoing(){return!1}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`https://www.ag-grid.com/${"solid"===this.frameworkName?"react":this.frameworkName}-data-grid${e?`/${e}`:""}`}},$t=class extends T{getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===w.UP,o=e===w.LEFT;let r,n;if(i||e===w.DOWN)n=i?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow(),r=t.column;else{const l=this.columnModel.getAllDisplayedColumns(),a=this.gridOptionsService.get("enableRtl");n=t.rowIndex,r=o!==a?l[0]:K(l)}return{rowIndex:n,rowPinned:null,column:r}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,s=!1;for(;!s;){switch(e){case w.UP:i=this.getCellAbove(i);break;case w.DOWN:i=this.getCellBelow(i);break;case w.RIGHT:i=this.gridOptionsService.get("enableRtl")?this.getCellToLeft(i):this.getCellToRight(i);break;case w.LEFT:i=this.gridOptionsService.get("enableRtl")?this.getCellToRight(i):this.getCellToLeft(i);break;default:i=null,console.warn("AG Grid: unknown key for navigation "+e)}s=!i||this.isCellGoodToFocusOn(i)}return i}isCellGoodToFocusOn(e){const t=e.column;let i;switch(e.rowPinned){case"top":i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex)}return!!i&&!t.isSuppressNavigable(i)}getCellToLeft(e){if(!e)return null;const t=this.columnModel.getDisplayedColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.columnModel.getDisplayedColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.paginationProxy.getPageFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}const s=this.rowModel.getRow(e.rowIndex);return this.getNextStickyPosition(s)||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!this.gridOptionsService.isGroupRowsSticky()||!e||!e.sticky)return;const i=[...this.rowRenderer.getStickyTopRowCtrls()].sort((n,l)=>n.getRowNode().rowIndex-l.getRowNode().rowIndex),s=t?-1:1,o=i.findIndex(n=>
1n.getRowNode().rowIndex===e.rowIndex),r=i[o+s];return r?{rowIndex:r.getRowNode().rowIndex,rowPinned:null}:void 0}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,i=e.rowIndex;return"top"===t?this.pinnedRowModel.getPinnedTopRowData().length-1<=i:"bottom"===t?this.pinnedRowModel.getPinnedBottomRowData().length-1<=i:this.paginationProxy.getPageLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned;if(i?0===t:t===this.paginationProxy.getPageFirstRow())return"top"===i?null:i&&this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const o=this.rowModel.getRow(e.rowIndex);return this.getNextStickyPosition(o,!0)||{rowIndex:t-1,rowPinned:i}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.paginationProxy.getPageLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowData().length-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,s=e.rowPinned,o=this.columnModel.getDisplayedColAfter(e.column);if(!o){o=t[0];const r=this.getRowBelow(e);if(G(r)||!r.rowPinned&&!this.paginationProxy.isRowInPage(r))return null;i=r?r.rowIndex:null,s=r?r.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}getNextTabbedCellBackwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,s=e.rowPinned,o=this.columnModel.getDisplayedColBefore(e.column);if(!o){o=K(t);const r=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(G(r)||!r.rowPinned&&!this.paginationProxy.isRowInPage(r))return null;i=r?r.rowIndex:null,s=r?r.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}};u([f("columnModel")],$t.prototype,"columnModel",2),u([f("rowModel")],$t.prototype,"rowModel",2),u([f("rowRenderer")],$t.prototype,"rowRenderer",2),u([f("pinnedRowModel")],$t.prototype,"pinnedRowModel",2),u([f("paginationProxy")],$t.prototype,"paginationProxy",2),$t=u([O("cellNavigationService")],$t);var wi=class extends T{constructor(){super(...arguments),this.consuming=!1}setBeans(e){this.logger=e.create("AlignedGridsService")}getAlignedGridApis(){var e;let t=null!=(e=this.gridOptionsService.get("alignedGrids"))?e:[];const i="function"==typeof t;"function"==typeof t&&(t=t());const s=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return t.map(r=>{var n;if(!r)return st("alignedGrids contains an undefined option."),i||st('You may want to configure via a callback to avoid setup race conditions:\n "alignedGrids: () => [linkedGrid]"'),void st(s());if(r instanceof W)return r;const l=r;return"current"in l?null==(n=l.current)?void 0:n.api:(l.api||st(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${s()}`),l.api)}).filter(r=>!!r&&!r.isDestroyed())}init(){this.addManagedListener(this.eventService,p.EVENT_COLUMN_MOVED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VISIBLE,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PINNED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_GROUP_OPENED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_RESIZED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,p.EVENT_BODY_SCROLL,this.fireScrollEvent.bind(this))}fireEvent(e){this.consuming||this.getAlignedGridApis().forEach(t=>{const i=t.__getAlignedGridService();e(i)})}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent(t=>{t.onColumnEvent(e)})}fireScrollEvent(e){"horizontal"===e.direction&&this.fireEvent(t=>{t.onScrollEvent(e)})}onScrollEvent(e){this.onEvent(()=>
1{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}getMasterColumns(e){const t=[];return e.columns?e.columns.forEach(i=>{t.push(i)}):e.column&&t.push(e.column),t}getColumnIds(e){const t=[];return e.columns?e.columns.forEach(i=>{t.push(i.getColId())}):e.column&&t.push(e.column.getColId()),t}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case p.EVENT_COLUMN_MOVED:case p.EVENT_COLUMN_VISIBLE:case p.EVENT_COLUMN_PINNED:case p.EVENT_COLUMN_RESIZED:this.processColumnEvent(e);break;case p.EVENT_COLUMN_GROUP_OPENED:this.processGroupOpenedEvent(e);break;case p.EVENT_COLUMN_PIVOT_CHANGED:console.warn("AG Grid: pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.")}})}processGroupOpenedEvent(e){e.columnGroups.forEach(t=>{let i=null;if(t){const s=t.getGroupId();i=this.columnModel.getProvidedColumnGroup(s)}t&&!i||(this.logger.log("onColumnEvent-> processing "+e+" expanded = "+t.isExpanded()),this.columnModel.setColumnGroupOpened(i,t.isExpanded(),"alignedGridChanged"))})}processColumnEvent(e){var t;const i=e.column;let s=null;if(i&&(s=this.columnModel.getPrimaryColumn(i.getColId())),i&&!s)return;const o=this.getMasterColumns(e);switch(e.type){case p.EVENT_COLUMN_MOVED:{const c=e,g=e.api.getColumnState().map(m=>({colId:m.colId}));this.columnModel.applyColumnState({state:g,applyOrder:!0},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} toIndex = ${c.toIndex}`)}break;case p.EVENT_COLUMN_VISIBLE:{const c=e,g=e.api.getColumnState().map(m=>({colId:m.colId,hide:m.hide}));this.columnModel.applyColumnState({state:g},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} visible = ${c.visible}`)}break;case p.EVENT_COLUMN_PINNED:{const c=e,g=e.api.getColumnState().map(m=>({colId:m.colId,pinned:m.pinned}));this.columnModel.applyColumnState({state:g},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} pinned = ${c.pinned}`)}break;case p.EVENT_COLUMN_RESIZED:const l=e,a={};o.forEach(c=>{this.logger.log(`onColumnEvent-> processing ${e.type} actualWidth = ${c.getActualWidth()}`),a[c.getId()]={key:c.getColId(),newWidth:c.getActualWidth()}}),null==(t=l.flexColumns)||t.forEach(c=>{a[c.getId()]&&delete a[c.getId()]}),this.columnModel.setColumnWidths(Object.values(a),!1,l.finished,"alignedGridChanged")}const n=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach(l=>{l.setGridOption("alwaysShowVerticalScroll",n)})}};u([f("columnModel")],wi.prototype,"columnModel",2),u([f("ctrlsService")],wi.prototype,"ctrlsService",2),u([it(0,qe("loggerFactory"))],wi.prototype,"setBeans",1),u([b],wi.prototype,"init",1),wi=u([O("alignedGridsService")],wi);var Si=class extends T{constructor(){super(...arguments),this.selectedNodes=new Map,this.lastRowNode=null}init(){this.rowSelection=this.gridOptionsService.get("rowSelection"),this.groupSelectsChildren=this.gridOptionsService.get("groupSelectsChildren"),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],()=>{this.groupSelectsChildren=this.gridOptionsService.get("groupSelectsChildren"),this.rowSelection=this.gridOptionsService.get("rowSelection"),this.deselectAllRowNodes({source:"api"})}),this.addManagedListener(this.eventService,p.EVENT_ROW_SELECTED,this.onRowSelected.bind(this))}destroy(){super.destroy(),this.resetNodes(),this.lastRowNode=null}isMultiselect(){return"multiple"===this.rowSelection}setNodesSelected(e){var t;const{newValue:i,clearSelection:s,suppressFinishActions:o,rangeSelect:r,nodes:n,event:l,source:a="api"}=e;if(0===n.length)return 0;if(n.length>1&&!this.isMultiselect())return console.warn("AG Grid: cannot multi select while rowSelection='single'"),0;const c=this.groupSelectsChildren&&!0===e.groupSelectsFiltered,h=n.map(m=>m.footer?m.sibling:m);if(r){if(n.length>1)return console.warn("AG Grid: cannot range select while selecting multiple rows"),0;let m=null;if("checkboxSelected"===a&&!1===i&&this.lastRowNode&&(this.lastRowNode.id?m=this.lastRowNode:this.lastRowNode=null),null==m&&(m=this.getLastSelectedNode()),m){const C=h[0];if(C!==m&&this.isMultiselect())return this.selectRange(C,m,i,a)}}this.lastRowNode=i?null:h[0];let g=0;for(let m=0;m<h.length;m++){const C=h[m];c&&C.group||C.selectThisNode(i,l,a)&&g++,this.groupSelectsChildren&&null!=(t=C.childrenAfterGroup)&&t.length&&(g+=this.selectChildren(C,i,c,a))}return!o&&(i&&(s||!this.isMultiselect())&&(g+=this.clearOtherNodes(h[0],a)),g>0)&&(this.updateGroupsFromChildrenSelections(a),this.eventService.dispatchEvent({type:p.EVENT_SELECTION_CHANGED,source:a})),g}selectRange(e,t,i=!0,s){const o=this.rowModel.getNodesInRangeForSelection(e,t);let r=0;return o.forEach(l=>{l.group&&this.groupSelectsChildren||l.selectThisNode(i,void 0,s)&&r++}),this.updateGroupsFromChildrenSelections(s),this.eventService.dispatchEvent({type:p.EVENT_SELECTION_CHANGED,source:s}),r}selectChildren(e,t,i,s){const o=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return G(o)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:s,nodes:o})}getLastSelectedNode(){const e=Array.from(this.selectedNodes.keys());return 0==e.length?null:this.selectedNodes.get(K(e))||null}getSelectedNodes(){const e=[];
1return this.selectedNodes.forEach(t=>{t&&e.push(t)}),e}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>{t&&t.data&&e.push(t.data)}),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((i,s)=>{i&&e(i)&&t.set(s,i)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren||"clientSide"!==this.rowModel.getType())return!1;const s=this.rowModel.getRootNode();t||(t=new ur(!0,s)).setInactive();let o=!1;return t.forEachChangedNodeDepthFirst(r=>{if(r!==s){const n=r.calculateSelectedFromChildren();o=r.selectThisNode(null!==n&&n,void 0,e)||o}}),o}clearOtherNodes(e,t){const i=new Map;let s=0;return this.selectedNodes.forEach(o=>{if(o&&o.id!==e.id){const r=this.selectedNodes.get(o.id);s+=r.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&o.parent&&i.set(o.parent.id,o.parent)}}),i.forEach(o=>{const r=o.calculateSelectedFromChildren();o.selectThisNode(null!==r&&r,void 0,t)}),s}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,t){R(t)&&e.id!==t.id&&t&&this.selectedNodes.get(t.id)==e&&this.selectedNodes.set(t.id,t)}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.setSelectedInitialValue(!0),this.selectedNodes.set(e.id,e)):e.setSelectedInitialValue(!1)}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.eventService.dispatchEvent({type:p.EVENT_SELECTION_CHANGED,source:e})}resetNodes(){var e;null==(e=this.selectedNodes)||e.clear()}getBestCostNodeSelection(){if("clientSide"!==this.rowModel.getType())return;const t=this.rowModel.getTopLevelNodes();if(null===t)return;const i=[];return function s(o){for(let r=0,n=o.length;r<n;r++){const l=o[r];l.isSelected()?i.push(l):l.group&&l.children&&s(l.children)}}(t),i}isEmpty(){let e=0;return this.selectedNodes.forEach(t=>{t&&e++}),0===e}deselectAllRowNodes(e){const t=l=>l.selectThisNode(!1,void 0,s),i="clientSide"===this.rowModel.getType(),{source:s,justFiltered:o,justCurrentPage:r}=e;if(r||o){if(!i)return void console.error("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'");this.getNodesToSelect(o,r).forEach(t)}else this.selectedNodes.forEach(l=>{l&&t(l)}),this.reset(s);i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(s),this.eventService.dispatchEvent({type:p.EVENT_SELECTION_CHANGED,source:s})}getSelectedCounts(e,t){let i=0,s=0;return this.getNodesToSelect(e,t).forEach(r=>{this.groupSelectsChildren&&r.group||(r.isSelected()?i++:r.selectable&&s++)}),{selectedCount:i,notSelectedCount:s}}getSelectAllState(e,t){const{selectedCount:i,notSelectedCount:s}=this.getSelectedCounts(e,t);return(0!==i||0!==s)&&(i>0&&s>0?null:i>0)}hasNodesToSelect(e=!1,t=!1){return this.getNodesToSelect(e,t).filter(i=>i.selectable).length>0}getNodesToSelect(e=!1,t=!1){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const i=[];if(t)return this.paginationProxy.forEachNodeOnPage(o=>{if(o.group)if(o.expanded)this.groupSelectsChildren||i.push(o);else{const r=n=>{var l;i.push(n),null!=(l=n.childrenAfterFilter)&&l.length&&n.childrenAfterFilter.forEach(r)};r(o)}else i.push(o)}),i;const s=this.rowModel;return e?(s.forEachNodeAfterFilter(o=>{i.push(o)}),i):(s.forEachNode(o=>{i.push(o)}),i)}selectAllRowNodes(e){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const{source:t,justFiltered:i,justCurrentPage:s}=e;this.getNodesToSelect(i,s).forEach(n=>n.selectThisNode(!0,void 0,t)),"clientSide"===this.rowModel.getType()&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t),this.eventService.dispatchEvent({type:p.EVENT_SELECTION_CHANGED,source:t})}getSelectionState(){const e=[];
1return this.selectedNodes.forEach(t=>{t?.id&&e.push(t.id)}),e.length?e:null}setSelectionState(e,t){if(!Array.isArray(e))return;const i=new Set(e),s=[];this.rowModel.forEachNode(o=>{i.has(o.id)&&s.push(o)}),this.setNodesSelected({newValue:!0,nodes:s,source:t})}};u([f("rowModel")],Si.prototype,"rowModel",2),u([f("paginationProxy")],Si.prototype,"paginationProxy",2),u([b],Si.prototype,"init",1),Si=u([O("selectionService")],Si);var Ei=class{constructor(e){this.viaApi=(t,...i)=>(x(`Since v31, 'columnApi.${t}' is deprecated and moved to 'api.${t}'.`),this.api[t](...i)),this.api=e}sizeColumnsToFit(e){this.viaApi("sizeColumnsToFit",e)}setColumnGroupOpened(e,t){this.viaApi("setColumnGroupOpened",e,t)}getColumnGroup(e,t){return this.viaApi("getColumnGroup",e,t)}getProvidedColumnGroup(e){return this.viaApi("getProvidedColumnGroup",e)}getDisplayNameForColumn(e,t){return this.viaApi("getDisplayNameForColumn",e,t)}getDisplayNameForColumnGroup(e,t){return this.viaApi("getDisplayNameForColumnGroup",e,t)}getColumn(e){return this.viaApi("getColumn",e)}getColumns(){return this.viaApi("getColumns")}applyColumnState(e){return this.viaApi("applyColumnState",e)}getColumnState(){return this.viaApi("getColumnState")}resetColumnState(){this.viaApi("resetColumnState")}getColumnGroupState(){return this.viaApi("getColumnGroupState")}setColumnGroupState(e){this.viaApi("setColumnGroupState",e)}resetColumnGroupState(){this.viaApi("resetColumnGroupState")}isPinning(){return this.viaApi("isPinning")}isPinningLeft(){return this.viaApi("isPinningLeft")}isPinningRight(){return this.viaApi("isPinningRight")}getDisplayedColAfter(e){return this.viaApi("getDisplayedColAfter",e)}getDisplayedColBefore(e){return this.viaApi("getDisplayedColBefore",e)}setColumnVisible(e,t){this.viaApi("setColumnVisible",e,t)}setColumnsVisible(e,t){this.viaApi("setColumnsVisible",e,t)}setColumnPinned(e,t){this.viaApi("setColumnPinned",e,t)}setColumnsPinned(e,t){this.viaApi("setColumnsPinned",e,t)}getAllGridColumns(){return this.viaApi("getAllGridColumns")}getDisplayedLeftColumns(){return this.viaApi("getDisplayedLeftColumns")}getDisplayedCenterColumns(){return this.viaApi("getDisplayedCenterColumns")}getDisplayedRightColumns(){return this.viaApi("getDisplayedRightColumns")}getAllDisplayedColumns(){return this.viaApi("getAllDisplayedColumns")}getAllDisplayedVirtualColumns(){return this.viaApi("getAllDisplayedVirtualColumns")}moveColumn(e,t){this.viaApi("moveColumn",e,t)}moveColumnByIndex(e,t){this.viaApi("moveColumnByIndex",e,t)}moveColumns(e,t){this.viaApi("moveColumns",e,t)}moveRowGroupColumn(e,t){this.viaApi("moveRowGroupColumn",e,t)}setColumnAggFunc(e,t){this.viaApi("setColumnAggFunc",e,t)}setColumnWidth(e,t,i=!0,s){this.viaApi("setColumnWidth",e,t,i,s)}setColumnWidths(e,t=!0,i){this.viaApi("setColumnWidths",e,t,i)}setPivotMode(e){this.viaApi("setPivotMode",e)}isPivotMode(){return this.viaApi("isPivotMode")}getPivotResultColumn(e,t){return this.viaApi("getPivotResultColumn",e,t)}setValueColumns(e){this.viaApi("setValueColumns",e)}getValueColumns(){return this.viaApi("getValueColumns")}removeValueColumn(e){this.viaApi("removeValueColumn",e)}removeValueColumns(e){this.viaApi("removeValueColumns",e)}addValueColumn(e){this.viaApi("addValueColumn",e)}addValueColumns(e){this.viaApi("addValueColumns",e)}setRowGroupColumns(e){this.viaApi("setRowGroupColumns",e)}removeRowGroupColumn(e){this.viaApi("removeRowGroupColumn",e)}removeRowGroupColumns(e){this.viaApi("removeRowGroupColumns",e)}addRowGroupColumn(e){this.viaApi("addRowGroupColumn",e)}addRowGroupColumns(e){this.viaApi("addRowGroupColumns",e)}getRowGroupColumns(){return this.viaApi("getRowGroupColumns")}setPivotColumns(e){this.viaApi("setPivotColumns",e)}removePivotColumn(e){this.viaApi("removePivotColumn",e)}removePivotColumns(e){this.viaApi("removePivotColumns",e)}addPivotColumn(e){this.viaApi("addPivotColumn",e)}addPivotColumns(e){this.viaApi("addPivotColumns",e)}getPivotColumns(){return this.viaApi("getPivotColumns")}getLeftDisplayedColumnGroups(){return this.viaApi("getLeftDisplayedColumnGroups")}getCenterDisplayedColumnGroups(){return this.viaApi("getCenterDisplayedColumnGroups")}getRightDisplayedColumnGroups(){return this.viaApi("getRightDisplayedColumnGroups")}getAllDisplayedColumnGroups(){return this.viaApi("getAllDisplayedColumnGroups")}autoSizeColumn(e,t){return this.viaApi("autoSizeColumn",e,t)}autoSizeColumns(e,t){this.viaApi("autoSizeColumns",e,t)}autoSizeAllColumns(e){this.viaApi("autoSizeAllColumns",e)}setPivotResultColumns(e){this.viaApi("setPivotResultColumns",e)}getPivotResultColumns(){return this.viaApi("getPivotResultColumns")}};u([f("gridApi")],Ei.prototype,"api",2),Ei=u([O("columnApi")],Ei);var qt=class extends T{constructor(){super(...arguments),this.initialised=!1,this.isSsrm=!1}init(){this.isSsrm=this.gridOptionsService.isRowModelType("serverSide"),this.cellExpressions=this.gridOptionsService.get("enableCellExpressions"),this.isTreeData=this.gridOptionsService.get("treeData"),this.initialised=!0;const e=i=>this.callColumnCellValueChangedHandler(i),t=this.gridOptionsService.useAsyncEvents();this.eventService.addEventListener(p.EVENT_CELL_VALUE_CHANGED,e,t),this.addDestroyFunc(()=>this.eventService.removeEventListener(p.EVENT_CELL_VALUE_CHANGED,e,t)),this.addManagedPropertyListener("treeData",i=>this.isTreeData=i.currentValue)}getValue(e,t,i=!1,s=!1){if(this.initialised||this.init(),!t)return;const o=e.getColDef(),r=o.field,n=e.getColId(),l=t.data;let a;const c=t.groupData&&void 0!==t.groupData[n],h=!s&&t.aggData&&void 0!==t.aggData[n],g=this.isSsrm&&s&&!!e.getColDef().aggFunc,m=this.isSsrm&&t.footer&&t.field&&(!0===e.getColDef().showRowGroup||e.getColDef().showRowGroup===t.field);if(i&&o.filterValueGetter?a=this.executeFilterValueGetter(o.filterValueGetter,l,e,t):this.isTreeData&&h?a=t.aggData[n]:this.isTreeData&&o.valueGetter?a=this.execute
1ValueGetter(o.valueGetter,l,e,t):this.isTreeData&&r&&l?a=Li(l,r,e.isFieldContainsDots()):c?a=t.groupData[n]:h?a=t.aggData[n]:o.valueGetter?a=this.executeValueGetter(o.valueGetter,l,e,t):m?a=Li(l,t.field,e.isFieldContainsDots()):r&&l&&!g&&(a=Li(l,r,e.isFieldContainsDots())),this.cellExpressions&&"string"==typeof a&&0===a.indexOf("=")){const C=a.substring(1);a=this.executeValueGetter(C,l,e,t)}if(null==a){const C=this.getOpenedGroup(t,e);if(null!=C)return C}return a}getOpenedGroup(e,t){if(!this.gridOptionsService.get("showOpenedGroup")||!t.getColDef().showRowGroup)return;const s=t.getColDef().showRowGroup;let o=e.parent;for(;null!=o;){if(o.rowGroupColumn&&(!0===s||s===o.rowGroupColumn.getColId()))return o.key;o=o.parent}}setValue(e,t,i,s){const o=this.columnModel.getPrimaryColumn(t);if(!e||!o)return!1;G(e.data)&&(e.data={});const{field:r,valueSetter:n}=o.getColDef();if(G(r)&&G(n))return console.warn("AG Grid: you need either field or valueSetter set on colDef for editing to work"),!1;if(!this.dataTypeService.checkType(o,i))return console.warn("AG Grid: Data type of the new value does not match the cell data type of the column"),!1;const l=this.gridOptionsService.addGridCommonParams({node:e,data:e.data,oldValue:this.getValue(o,e),newValue:i,colDef:o.getColDef(),column:o});let a;return l.newValue=i,a=R(n)?"function"==typeof n?n(l):this.expressionService.evaluate(n,l):this.setValueUsingField(e.data,r,i,o.isFieldContainsDots()),void 0===a&&(a=!0),!!a&&(e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),l.newValue=this.getValue(o,e),this.eventService.dispatchEvent({type:p.EVENT_CELL_VALUE_CHANGED,event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:l.column,api:l.api,columnApi:l.columnApi,colDef:l.colDef,context:l.context,data:e.data,node:e,oldValue:l.oldValue,newValue:l.newValue,value:l.newValue,source:s}),!0)}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;"function"==typeof t&&this.getFrameworkOverrides().wrapOutgoing(()=>{t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,columnApi:e.columnApi,context:e.context})})}setValueUsingField(e,t,i,s){if(!t)return!1;let o=!1;if(s){const r=t.split(".");let n=e;for(;r.length>0&&n;){const l=r.shift();0===r.length?(o=n[l]===i,o||(n[l]=i)):n=n[l]}}else o=e[t]===i,o||(e[t]=i);return!o}executeFilterValueGetter(e,t,i,s){const o=this.gridOptionsService.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});return"function"==typeof e?e(o):this.expressionService.evaluate(e,o)}executeValueGetter(e,t,i,s){const o=i.getColId(),r=this.valueCache.getValue(s,o);if(void 0!==r)return r;const n=this.gridOptionsService.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});let l;return l="function"==typeof e?e(n):this.expressionService.evaluate(e,n),this.valueCache.setValue(s,o,l),l}getValueCallback(e,t){const i=this.columnModel.getPrimaryColumn(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),s=e.getColDef().keyCreator;let o=i;return s&&(o=s(this.gridOptionsService.addGridCommonParams({value:i,colDef:e.getColDef(),column:e,node:t,data:t.data}))),"string"==typeof o||null==o||(o=String(o),"[object Object]"===o&&x("a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key")),o}};u([f("expressionService")],qt.prototype,"expressionService",2),u([f("columnModel")],qt.prototype,"columnModel",2),u([f("valueCache")],qt.prototype,"valueCache",2),u([f("dataTypeService")],qt.prototype,"dataTypeService",2),u([b],qt.prototype,"init",1),qt=u([O("valueService")],qt);var gr=class extends T{constructor(){super(...arguments),this.expressionToFunctionCache={}}setBeans(e){this.logger=e.create("ExpressionService")}evaluate(e,t){if("string"==typeof e)return this.evaluateExpression(e,t);console.error("AG Grid: value should be either a string or a function",e)}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.columnApi,t.getValue,t.column,t.columnGroup)}catch(i){return console.log("Processing of the expression failed"),console.log("Expression = "+e),console.log("Param
1s =",t),console.log("Exception = "+i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}};u([it(0,qe("loggerFactory"))],gr.prototype,"setBeans",1),gr=u([O("expressionService")],gr);var ol=class extends T{constructor(){super(...arguments),this.templateCache={},this.waitingCallbacks={}}getTemplate(e,t){const i=this.templateCache[e];if(i)return i;let s=this.waitingCallbacks[e];const o=this;if(!s){s=[],this.waitingCallbacks[e]=s;const r=new XMLHttpRequest;r.onload=function(){o.handleHttpResult(this,e)},r.open("GET",e),r.send()}return t&&s.push(t),null}handleHttpResult(e,t){if(200!==e.status||null===e.response)return void console.warn(`AG Grid: Unable to get template error ${e.status} - ${t}`);this.templateCache[t]=e.response||e.responseText;const i=this.waitingCallbacks[t];for(let s=0;s<i.length;s++)(0,i[s])()}};ol=u([O("templateService")],ol);var fr=class extends T{setBeans(e){this.logging=e.get("debug")}create(e){return new rl(e,this.isLogging.bind(this))}isLogging(){return this.logging}};u([it(0,qe("gridOptionsService"))],fr.prototype,"setBeans",1),fr=u([O("loggerFactory")],fr);var rl=class{constructor(e,t){this.name=e,this.isLoggingFunc=t}isLogging(){return this.isLoggingFunc()}log(e){this.isLoggingFunc()&&console.log("AG Grid."+this.name+": "+e)}},yi=class extends T{setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.context.getGridId()),this.dragAndDropService.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:o=>1===o||0===o,getIconName:()=>V.ICON_NOT_ALLOWED}),this.mouseEventService.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new tr(this.view)),this.addRtlSupport();const s=this.resizeObserverService.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>s()),this.ctrlsService.registerGridCtrl(this)}isDetailGrid(){var e;const t=this.focusService.findTabbableParent(this.getGui());return(null==(e=t?.getAttribute("row-id"))?void 0:e.startsWith("detail"))||!1}showDropZones(){return Y.__isRegistered("@ag-grid-enterprise/row-grouping",this.context.getGridId())}showSideBar(){return Y.__isRegistered("@ag-grid-enterprise/side-bar",this.context.getGridId())}showStatusBar(){return Y.__isRegistered("@ag-grid-enterprise/status-bar",this.context.getGridId())}showWatermark(){return Y.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId())}onGridSizeChanged(){this.eventService.dispatchEvent({type:p.EVENT_GRID_SIZE_CHANGED,clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight})}addRtlSupport(){const e=this.gridOptionsService.get("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(e)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.gridOptionsService.getDocument(),i=this.view.getFocusableContainers(),o=i.findIndex(r=>r.contains(t.activeElement))+(e?-1:1);return!(o<=0||o>=i.length)&&this.focusService.focusInto(i[o])}focusInnerElement(e){const t=this.view.getFocusableContainers(),i=this.columnModel.getAllDisplayedColumns();if(e){if(t.length>1)return this.focusService.focusInto(K(t),!0);const s=K(i);if(this.focusService.focusGridView(s,!0))return!0}if(0===this.gridOptionsService.get("headerHeight")||this.gridOptionsService.get("suppressHeaderFocus")){if(this.focusService.focusGridView(i[0]))return!0;for(let s=1;s<t.length;s++)if(this.focusService.focusInto(t[s]))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}};u([f("focusService")],yi.prototype,"focusService",2),u([f("resizeObserverService")],yi.prototype,"resizeObserverService",2),u([f("columnModel")],yi.prototype,"columnModel",2),u([f("ctrlsService")],yi.prototype,"ctrlsService",2),u([f("mou
1seEventService")],yi.prototype,"mouseEventService",2),u([f("dragAndDropService")],yi.prototype,"dragAndDropService",2);var Ri=class extends Us{constructor(e){super(),this.eGridDiv=e}postConstruct(){this.logger=this.loggerFactory.create("GridComp");const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:i=>this.addCssClass(i),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:i=>{this.getGui().style.userSelect=i??"",this.getGui().style.webkitUserSelect=i??""},setCursor:i=>{this.getGui().style.cursor=i??""}};this.ctrl=this.createManagedBean(new yi);const t=this.createTemplate();this.setTemplate(t),this.ctrl.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:i=>this.ctrl.focusInnerElement(i),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{this.eGridDiv.removeChild(e),this.logger.log("Grid removed from DOM")})}updateLayoutClasses(e,t){const i=this.eRootWrapperBody.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)}createTemplate(){return`<div class="ag-root-wrapper" role="presentation">\n ${this.ctrl.showDropZones()?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":""}\n <div class="ag-root-wrapper-body" ref="rootWrapperBody" role="presentation">\n <ag-grid-body ref="gridBody"></ag-grid-body>\n ${this.ctrl.showSideBar()?'<ag-side-bar ref="sideBar"></ag-side-bar>':""}\n </div>\n ${this.ctrl.showStatusBar()?'<ag-status-bar ref="statusBar"></ag-status-bar>':""}\n <ag-pagination></ag-pagination>\n ${this.ctrl.showWatermark()?"<ag-watermark></ag-watermark>":""}\n </div>`}getFocusableElement(){return this.eRootWrapperBody}getFocusableContainers(){const e=[this.gridBodyComp.getGui()];return this.sideBarComp&&e.push(this.sideBarComp.getGui()),e.filter(t=>ze(t))}};u([f("loggerFactory")],Ri.prototype,"loggerFactory",2),u([A("gridBody")],Ri.prototype,"gridBodyComp",2),u([A("sideBar")],Ri.prototype,"sideBarComp",2),u([A("rootWrapperBody")],Ri.prototype,"eRootWrapperBody",2),u([b],Ri.prototype,"postConstruct",1);var Di=class extends T{progressSort(e,t,i){const s=this.getNextSortDirection(e);this.setSortForColumn(e,s,t,i)}setSortForColumn(e,t,i,s){"asc"!==t&&"desc"!==t&&(t=null);let r=[e];if(this.gridOptionsService.isColumnsSortingCoupledToGroup()&&e.getColDef().showRowGroup){const a=this.columnModel.getSourceColumnsForGroupColumn(e),c=a?.filter(h=>h.isSortable());c&&(r=[e,...c])}r.forEach(a=>a.setSort(t,s));const l=[];if(!i&&!this.gridOptionsService.get("alwaysMultiSort")||this.gridOptionsService.get("suppressMultiSort")){const a=this.clearSortBarTheseColumns(r,s);l.push(...a)}this.updateSortIndex(e),l.push(...r),this.dispatchSortChangedEvents(s,l)}updateSortIndex(e){const t=this.gridOptionsService.isColumnsSortingCoupledToGroup(),i=this.columnModel.getGroupDisplayColumnForGroup(e.getId()),s=t&&i||e,o=this.getColumnsWithSortingOrdered();this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(l=>l.setSortIndex(null));const r=o.filter(l=>!(t&&l.getColDef().showRowGroup||l===s));(s.getSort()?[...r,s]:r).forEach((l,a)=>{l.setSortIndex(a)})}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){const t=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(i=>!!i.getSort());return t&&t.length>0}dispatchSortChangedEvents(e,t){const i={type:p.EVENT_SORT_CHANGED,source:e};t&&(i.columns=t),this.eventService.dispatchEvent(i)}clearSortBarTheseColumns(e,t){const i=[];return this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEac
1h(s=>{e.includes(s)||(s.getSort()&&i.push(s),s.setSort(void 0,t))}),i}getNextSortDirection(e){let t;if(t=e.getColDef().sortingOrder?e.getColDef().sortingOrder:this.gridOptionsService.get("sortingOrder")?this.gridOptionsService.get("sortingOrder"):Di.DEFAULT_SORTING_ORDER,!Array.isArray(t)||t.length<=0)return console.warn(`AG Grid: sortingOrder must be an array with at least one element, currently it's ${t}`),null;const i=t.indexOf(e.getSort());let r;return r=i<0||i==t.length-1?t[0]:t[i+1],Di.DEFAULT_SORTING_ORDER.indexOf(r)<0?(console.warn("AG Grid: invalid sort type "+r),null):r}getIndexedSortMap(){let e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(r=>!!r.getSort());if(this.columnModel.isPivotMode()){const r=this.gridOptionsService.isColumnsSortingCoupledToGroup();e=e.filter(n=>{const l=!!n.getAggFunc(),a=!n.isPrimary(),c=r?this.columnModel.getGroupDisplayColumnForGroup(n.getId()):n.getColDef().showRowGroup;return l||a||c})}const t=this.columnModel.getRowGroupColumns().filter(r=>!!r.getSort()),i={};e.forEach((r,n)=>i[r.getId()]=n),e.sort((r,n)=>{const l=r.getSortIndex(),a=n.getSortIndex();return null!=l&&null!=a?l-a:null==l&&null==a?i[r.getId()]>i[n.getId()]?1:-1:null==a?-1:1});const s=this.gridOptionsService.isColumnsSortingCoupledToGroup()&&!!t.length;s&&(e=[...new Set(e.map(r=>{var n;return null!=(n=this.columnModel.getGroupDisplayColumnForGroup(r.getId()))?n:r}))]);const o=new Map;return e.forEach((r,n)=>o.set(r,n)),s&&t.forEach(r=>{const n=this.columnModel.getGroupDisplayColumnForGroup(r.getId());o.set(r,o.get(n))}),o}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([e,t],[i,s])=>t-s).map(([e])=>e)}getSortModel(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),colId:e.getId()}))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),column:e}))}canColumnDisplayMixedSort(e){const t=this.gridOptionsService.isColumnsSortingCoupledToGroup(),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.columnModel.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!t?.length)return e.getSort();const s=null!=e.getColDef().field||e.getColDef().valueGetter?[e,...t]:t,o=s[0].getSort();return s.every(n=>n.getSort()==o)?o:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}};Di.DEFAULT_SORTING_ORDER=["asc","desc",null],u([f("columnModel")],Di.prototype,"columnModel",2),Di=u([O("sortController")],Di);var J=class extends T{static addKeyboardModeEvents(e){this.instanceCount>0||(e.addEventListener("keydown",J.toggleKeyboardMode),e.addEventListener("mousedown",J.toggleKeyboardMode))}static removeKeyboardModeEvents(e){this.instanceCount>0||(e.addEventListener("keydown",J.toggleKeyboardMode),e.addEventListener("mousedown",J.toggleKeyboardMode))}static toggleKeyboardMode(e){const i="keydown"===e.type;i&&(e.ctrlKey||e.metaKey||e.altKey)||J.keyboardModeActive!==i&&(J.keyboardModeActive=i)}static unregisterGridCompController(e){J.removeKeyboardModeEvents(e)}init(){const e=this.clearFocusedCell.bind(this);this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverythingChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_GROUP_OPENED,e),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady(t=>{this.gridCtrl=t.gridCtrl})}registerKeyboardFocusEvents(){const e=this.gridOptionsService.getDocument();J.addKeyboardModeEvents(e),J.instanceCount++,this.addDestroyFunc(()=>{J.instanceCount--,J.unregisterGridCompController(e)})}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const e=this.focusedCellPosition.column,t=this.columnModel.getGridColumn(e.getId());e!==t&&this.clearFocusedCell()}isKeyboardMode(){return J.keyboardModeActive}getFocusCellToUseAfterRefresh(){const e=this.gridOptionsService.getDocument();return this.gridOptionsService.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(e.activeElement,di.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){const e=this.gridOptionsService.getDocument();return this.gridOptionsService.get("suppressFocusAfterRefresh")||!this.focused
1HeaderPosition||this.isDomDataMissingInHierarchy(e.activeElement,nr.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(e,t){let i=e;for(;i;){if(this.gridOptionsService.getDomData(i,t))return!1;i=i.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(e){return!!this.isCellRestoreFocused(e)&&(setTimeout(()=>{this.restoredFocusedCellPosition=null},0),!0)}isCellRestoreFocused(e){return null!=this.restoredFocusedCellPosition&&this.cellPositionUtils.equals(e,this.restoredFocusedCellPosition)}setRestoreFocusedCell(e){"react"===this.getFrameworkOverrides().renderingEngine&&(this.restoredFocusedCellPosition=e)}getFocusEventParams(){const{rowIndex:e,rowPinned:t,column:i}=this.focusedCellPosition,s={rowIndex:e,rowPinned:t,column:i,isFullWidthCell:!1},o=this.rowRenderer.getRowByPosition({rowIndex:e,rowPinned:t});return o&&(s.isFullWidthCell=o.isFullWidth()),s}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,null==this.focusedCellPosition)return;const e=L({type:p.EVENT_CELL_FOCUS_CLEARED},this.getFocusEventParams());this.focusedCellPosition=null,this.eventService.dispatchEvent(e)}setFocusedCell(e){const{column:t,rowIndex:i,rowPinned:s,forceBrowserFocus:o=!1,preventScrollOnBrowserFocus:r=!1}=e,n=this.columnModel.getGridColumn(t);if(!n)return void(this.focusedCellPosition=null);this.focusedCellPosition=n?{rowIndex:i,rowPinned:ht(s),column:n}:null;const l=ie(L({type:p.EVENT_CELL_FOCUSED},this.getFocusEventParams()),{forceBrowserFocus:o,preventScrollOnBrowserFocus:r,floating:null});this.eventService.dispatchEvent(l)}isCellFocused(e){return null!=this.focusedCellPosition&&this.cellPositionUtils.equals(e,this.focusedCellPosition)}isRowNodeFocused(e){return this.isRowFocused(e.rowIndex,e.rowPinned)}isHeaderWrapperFocused(e){if(null==this.focusedHeaderPosition)return!1;const t=e.getColumnGroupChild(),i=e.getRowIndex(),s=e.getPinned(),{column:o,headerRowIndex:r}=this.focusedHeaderPosition;return t===o&&i===r&&s==o.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(e,t){this.focusedHeaderPosition={headerRowIndex:e,column:t}}focusHeaderPosition(e){if(this.gridOptionsService.get("suppressHeaderFocus"))return!1;const{direction:t,fromTab:i,allowUserOverride:s,event:o,fromCell:r,rowWithoutSpanValue:n}=e;let{headerPosition:l}=e;if(r&&this.filterManager.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(l);if(s){const h=this.getFocusedHeader(),g=this.headerNavigationService.getHeaderRowCount();if(i){const m=this.gridOptionsService.getCallback("tabToNextHeader");m&&(l=m({backwards:"Before"===t,previousHeaderPosition:h,nextHeaderPosition:l,headerRowCount:g}))}else{const m=this.gridOptionsService.getCallback("navigateToNextHeader");m&&o&&(l=m({key:o.key,previousHeaderPosition:h,nextHeaderPosition:l,headerRowCount:g,event:o}))}}if(!l)return!1;if(-1===l.headerRowIndex)return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(l):this.focusGridView(l.column);this.headerNavigationService.scrollToColumn(l.column,t);const c=this.ctrlsService.getHeaderRowContainerCtrl(l.column.getPinned()).focusHeader(l.headerRowIndex,l.column,o);return c&&(null!=n||r)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(n??-1),c}focusFirstHeader(){let e=this.columnModel.getAllDisplayedColumns()[0];if(!e)return!1;e.getParent()&&(e=this.columnModel.getColumnGroupAtLevel(e,0));const t=this.headerPositionUtils.getHeaderIndexToFocus(e,0);return this.focusHeaderPosition({headerPosition:t,rowWithoutSpanValue:0})}focusLastHeader(e){const t=this.headerNavigationService.getHeaderRowCount()-1,i=K(this.columnModel.getAllDisplayedColumns());return this.focusHeaderPosition({headerPosition:{headerRowIndex:t,column:i},rowWithoutSpanValue:-1,event:e})}focusPreviousFromFirstCell(e){return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(e,t){return null!=this.focusedCellPosition&&this.focusedCellPosition.rowIndex===e&&this.focusedCellPosition.rowPinned===ht(t)}findFocusableElements(e,t,i=!1){let o=Cn;t&&(o+=", "+t),i&&(o+=', [tabindex="-1"]');const r=Array.prototype.slice.apply(e.querySelectorAll(Ma)).filter(a=>
1ze(a)),n=Array.prototype.slice.apply(e.querySelectorAll(o));return n.length?(c=n,r.filter(h=>-1===c.indexOf(h))):r;var c}focusInto(e,t=!1,i=!1){const s=this.findFocusableElements(e,null,i),o=t?K(s):s[0];return!!o&&(o.focus({preventScroll:!0}),!0)}findFocusableElementBeforeTabGuard(e,t){if(!t)return null;const i=this.findFocusableElements(e),s=i.indexOf(t);if(-1===s)return null;let o=-1;for(let r=s-1;r>=0;r--)if(i[r].classList.contains("ag-tab-guard-top")){o=r;break}return o<=0?null:i[o-1]}findNextFocusableElement(e=this.eGridDiv,t,i){const s=this.findFocusableElements(e,t?':not([tabindex="-1"])':null),r=this.gridOptionsService.getDocument().activeElement;let n;n=t?s.findIndex(a=>a.contains(r)):s.indexOf(r);const l=n+(i?-1:1);return l<0||l>=s.length?null:s[l]}isTargetUnderManagedComponent(e,t){if(!t)return!1;const i=e.querySelectorAll(`.${Ht.FOCUS_MANAGED_CLASS}`);if(!i.length)return!1;for(let s=0;s<i.length;s++)if(i[s].contains(t))return!0;return!1}findTabbableParent(e,t=5){let i=0;for(;e&&null===Ho(e)&&++i<=t;)e=e.parentElement;return null===Ho(e)?null:e}focusGridView(e,t){if(this.gridOptionsService.get("suppressCellFocus"))return t?this.gridOptionsService.get("suppressHeaderFocus")?this.focusNextGridCoreContainer(!0,!0):this.focusLastHeader():this.focusNextGridCoreContainer(!1);const i=t?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!i)return!1;const{rowIndex:s,rowPinned:o}=i,r=this.getFocusedHeader();return!e&&r&&(e=r.column),!(null==s||!e)&&(this.navigationService.ensureCellVisible({rowIndex:s,column:e,rowPinned:o}),this.setFocusedCell({rowIndex:s,column:e,rowPinned:ht(o),forceBrowserFocus:!0}),this.rangeService&&this.rangeService.setRangeToCell({rowIndex:s,rowPinned:o,column:e}),!0)}focusNextGridCoreContainer(e,t=!1){return!(t||!this.gridCtrl.focusNextInnerContainer(e))||((t||!e&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(e),!1)}focusAdvancedFilter(e){return this.advancedFilterFocusColumn=e?.column,this.advancedFilterService.getCtrl().focusHeaderComp()}focusNextFromAdvancedFilter(e,t){var i,s;const o=null!=(s=t?void 0:this.advancedFilterFocusColumn)?s:null==(i=this.columnModel.getAllDisplayedColumns())?void 0:i[0];return e?this.focusHeaderPosition({headerPosition:{column:o,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(o)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}};J.keyboardModeActive=!1,J.instanceCount=0,u([f("eGridDiv")],J.prototype,"eGridDiv",2),u([f("columnModel")],J.prototype,"columnModel",2),u([f("headerNavigationService")],J.prototype,"headerNavigationService",2),u([f("headerPositionUtils")],J.prototype,"headerPositionUtils",2),u([f("rowRenderer")],J.prototype,"rowRenderer",2),u([f("rowPositionUtils")],J.prototype,"rowPositionUtils",2),u([f("cellPositionUtils")],J.prototype,"cellPositionUtils",2),u([z("rangeService")],J.prototype,"rangeService",2),u([f("navigationService")],J.prototype,"navigationService",2),u([f("ctrlsService")],J.prototype,"ctrlsService",2),u([f("filterManager")],J.prototype,"filterManager",2),u([z("advancedFilterService")],J.prototype,"advancedFilterService",2),u([b],J.prototype,"init",1),J=u([O("focusService")],J);var nl=class extends T{setMouseOver(e){this.selectedColumns=e,this.eventService.dispatchEvent({type:p.EVENT_COLUMN_HOVER_CHANGED})}clearMouseOver(){this.selectedColumns=null,this.eventService.dispatchEvent({type:p.EVENT_COLUMN_HOVER_CHANGED})}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}};nl=u([O("columnHoverService")],nl);var Qs=class extends T{constructor(){super(...arguments),this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.ctrlsService.whenReady(e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){this.active||this.gridOptionsService.get("suppressColumnMoveAnimation")||this.gridOptionsService.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&this.flush(()=>{this.active=!1})}executeNextVMTurn(e){this.active?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)})}flush(e){if(0===this.executeNextFuncs.length&&0===this.executeLaterFuncs.length)return void e();const t=i=>{for(;i.length;){const s=i.pop();s&&s()}};this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>t(this.executeNextFuncs),0),window.setTimeout(()=>{t(this.executeLaterFuncs),e()},200)})}};u([f("ctrlsService")],Qs.prototype,"ctrlsService",2),u([b],Qs.prototype,"postConstruct",1),Qs=u([O("columnAnimationService")],Qs);var is=class extends T{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowContainerCon=e.centerRowContainerCtrl,this.addManagedListener(this.eventService,p.EVENT_BODY_HEIGHT_CHANGED,this.checkPageSize.bind(this)),this.addManagedListener(this.eventService,p.EVENT_SCROLL_VISIBILITY_CHANGED,this.checkPageSize.bind(this)),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gridOptionsService.get("paginationAutoPageSize")||null==this.centerRowContainerCon}onPaginationAutoSizeChanged(){this.notActive()?this.paginationProxy.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;
1const e=this.centerRowContainerCon.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const i=this.gridOptionsService.getRowHeightAsNumber(),s=Math.floor(e/i);this.paginationProxy.setPageSize(s,"autoCalculated")};this.isBodyRendered?Pe(()=>t(),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};u([f("ctrlsService")],is.prototype,"ctrlsService",2),u([f("paginationProxy")],is.prototype,"paginationProxy",2),u([b],is.prototype,"postConstruct",1),is=u([O("paginationAutoPageSizeService")],is);var mr=class extends T{constructor(){super(...arguments),this.cacheVersion=0}init(){this.active=this.gridOptionsService.get("valueCache"),this.neverExpires=this.gridOptionsService.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,i){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=i)}getValue(e,t){if(this.active&&e.__cacheVersion===this.cacheVersion)return e.__cacheData[t]}};u([b],mr.prototype,"init",1),mr=u([O("valueCache")],mr);var ss=class extends T{init(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel),this.addManagedListener(this.eventService,p.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged.bind(this))}onCellValueChanged(e){"paste"!==e.source&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gridOptionsService.get("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const s=this.gridOptionsService.get("aggregateOnlyChangedColumns"),o=new ur(s,this.clientSideRowModel.getRootNode());o.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(o),o.forEachChangedNodeDepthFirst(r=>{i.push(r)})}this.rowRenderer.refreshCells({rowNodes:i})}};u([f("rowModel")],ss.prototype,"rowModel",2),u([f("rowRenderer")],ss.prototype,"rowRenderer",2),u([b],ss.prototype,"init",1),ss=u([O("changeDetectionService")],ss);var Cr=class extends T{adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){return class t{refresh(s){return!1}getGui(){return this.eGui}init(s){const o=e(s),r=typeof o;this.eGui="string"!==r&&"number"!==r&&"boolean"!==r?null!=o?o:xe("<span></span>"):xe("<span>"+o+"</span>")}}}doesImplementIComponent(e){return!!e&&e.prototype&&"getGui"in e.prototype}};u([f("componentMetadataProvider")],Cr.prototype,"componentMetadataProvider",2),Cr=u([O("agComponentUtils")],Cr);var Xs=class extends T{postConstruct(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","onParamsUpdated","refresh"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[]},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached","onParamsUpdated","refresh"]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["refresh"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","getState"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]},menuItem:{mandatoryMethodList:[],optionalMethodList:["setActive","select","setExpanded","configureDefaults"]}}}retrieve(e){return this.componentMetaData[e]}};u([f("agComponentUtils")],Xs.prototype,"agComponentUtils",2),u([b],Xs.prototype,"postConstruct",1),Xs=u([O("componentMetadataProvider")],Xs);var kg={"ag-theme-custom":{headerHeight:25,headerCellMinWidth:24,listItemHeight:20,rowHeight:25,chartMenuPanelWidth:220},"ag-theme-material":{headerHeight:56,headerCellMinWidth:48,listItemHeight:32,rowHeight:48,chartMenuPanelWidth:240},"ag-theme-balham":{headerHeight:32,headerCellMinWidth:24,listItemHeight:24,rowHeight:28,chartMenuPanelWidth:220}
1,"ag-theme-alpine":{headerHeight:48,headerCellMinWidth:36,listItemHeight:24,rowHeight:42,chartMenuPanelWidth:240},"ag-theme-quartz":{headerHeight:48,headerCellMinWidth:36,listItemHeight:24,rowHeight:42,chartMenuPanelWidth:260}},Kd={headerHeight:["ag-header-row"],headerCellMinWidth:["ag-header-cell"],listItemHeight:["ag-virtual-list-item"],rowHeight:["ag-row"],chartMenuPanelWidth:["ag-chart-docked-container"]},Zs=class extends T{constructor(){super(...arguments),this.calculatedSizes={}}postConstruct(){var e;const t=null!=(e=this.getTheme().el)?e:this.eGridDiv;this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.mutationObserver=new MutationObserver(()=>{this.calculatedSizes={},this.fireGridStylesChangedEvent()}),this.mutationObserver.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]})}fireGridStylesChangedEvent(){this.eventService.dispatchEvent({type:p.EVENT_GRID_STYLES_CHANGED})}getSassVariable(e){const{themeFamily:t,el:i}=this.getTheme();if(t&&0===t.indexOf("ag-theme"))return this.calculatedSizes||(this.calculatedSizes={}),this.calculatedSizes[t]||(this.calculatedSizes[t]={}),this.calculatedSizes[t][e]??(this.calculatedSizes[t][e]=this.calculateValueForSassProperty(e,t,i),this.calculatedSizes[t][e])}calculateValueForSassProperty(e,t,i){const s="ag-theme-"+(t.match("material")?"material":t.match("balham")?"balham":t.match("alpine")?"alpine":"custom"),o=kg[s][e],r=this.gridOptionsService.getDocument();if(i||(i=this.eGridDiv),!Kd[e])return o;const n=Kd[e],l=r.createElement("div"),a=Array.from(i.classList);l.classList.add(t,...a),l.style.position="absolute";const c=n.reduce((g,m)=>{const C=r.createElement("div");return C.style.position="static",C.classList.add(m),g.appendChild(C),C},l);let h=0;if(r.body){r.body.appendChild(l);const g=-1!==e.toLowerCase().indexOf("height")?"height":"width";h=parseInt(window.getComputedStyle(c)[g],10),r.body.removeChild(l)}return h||o}isThemeDark(){const{theme:e}=this.getTheme();return!!e&&e.indexOf("dark")>=0}chartMenuPanelWidth(){return this.getSassVariable("chartMenuPanelWidth")}getTheme(){const e=/\bag-(material|(?:theme-([\w\-]*)))\b/g;let t=this.eGridDiv,i=null,s=[];for(;t;){if(i=e.exec(t.className),i){const r=t.className.match(e);r&&(s=r);break}t=t.parentElement||void 0}if(!i)return{allThemes:s};const o=i[0];return{theme:o,el:t,themeFamily:o.replace(/-dark$/,""),allThemes:s}}getFromTheme(e,t){var i;return null!=(i=this.getSassVariable(t))?i:e}getDefaultRowHeight(){return this.getFromTheme(25,"rowHeight")}getListItemHeight(){return this.getFromTheme(20,"listItemHeight")}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gridOptionsService.get("rowHeight");if(null==t||isNaN(t)||!isFinite(t))return null!==e&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const i=`${t}px`;return e!=i?(this.eGridDiv.style.setProperty("--ag-line-height",i),t):""!=e?parseFloat(e):-1}getMinColWidth(){const e=this.getFromTheme(null,"headerCellMinWidth");return R(e)?Math.max(e,10):10}destroy(){this.calculatedSizes=null,this.mutationObserver&&this.mutationObserver.disconnect(),super.destroy()}};u([f("eGridDiv")],Zs.prototype,"eGridDiv",2),u([b],Zs.prototype,"postConstruct",1),Zs=u([O("environment")],Zs);var os=class extends T{constructor(){super(...arguments),this.scrollY=0,this.uiBodyHeight=0}agWire(e){this.logger=e.create("RowContainerHeightService")}postConstruct(){this.addManagedListener(this.eventService,p.EVENT_BODY_HEIGHT_CHANGED,this.updateOffset.bind(this)),this.maxDivHeight=ya(),this.logger.log("maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,i=this.getUiBodyHeight();(t!==this.scrollY||i!==this.uiBodyHeight)&&(this.scrollY=t,this.uiBodyHeight=i,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;this.logger.log(`Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:p.EVENT_ROW_CONTAINER_HEIGHT_CHANGED}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t="number"==typeof e?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:p.EVENT_HEIGHT_SCALE_CHANGED}))}setModelHeight(e){this.modelHeight=e,this.stretching=null!=e&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature
1().getVScrollPosition();return t.bottom-t.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=this.modelHeight-this.getUiBodyHeight();return this.maxScrollY*(e/t)}};u([f("ctrlsService")],os.prototype,"ctrlsService",2),u([it(0,qe("loggerFactory"))],os.prototype,"agWire",1),u([b],os.prototype,"postConstruct",1),os=u([O("rowContainerHeightService")],os);var rs=class extends T{init(){this.addManagedPropertyListener("isRowSelectable",()=>this.updateSelectable())}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(e=!1){const t=!!this.gridOptionsService.get("rowSelection"),i=this.gridOptionsService.get("isRowSelectable");if(!t||!i)return;const s=this.gridOptionsService.get("groupSelectsChildren"),o="clientSide"===this.rowModel.getType()&&s,r=[],n=l=>{if(e&&!l.group)return;if(o&&l.group){const c=l.childrenAfterGroup.some(h=>!0===h.selectable);return void l.setRowSelectable(c,!0)}const a=!i||i(l);l.setRowSelectable(a,!0),!a&&l.isSelected()&&r.push(l)};o?new ur(!1,this.rowModel.getRootNode()).forEachChangedNodeDepthFirst(n,!0,!0):this.rowModel.forEachNode(n),r.length&&this.selectionService.setNodesSelected({nodes:r,newValue:!1,source:"selectableChanged"}),o&&this.selectionService instanceof Si&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}};u([f("rowModel")],rs.prototype,"rowModel",2),u([f("selectionService")],rs.prototype,"selectionService",2),u([b],rs.prototype,"init",1),rs=u([O("selectableService")],rs);var Ve=class extends k{constructor(){super(),this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1}postConstruct(){const e=this.gridOptionsService.get("enableRtl");this.setTemplate(this.getTemplate());const{btFirst:t,btPrevious:i,btNext:s,btLast:o}=this;this.activateTabIndex([t,i,s,o]),t.insertAdjacentElement("afterbegin",oe(e?"last":"first",this.gridOptionsService)),i.insertAdjacentElement("afterbegin",oe(e?"next":"previous",this.gridOptionsService)),s.insertAdjacentElement("afterbegin",oe(e?"previous":"next",this.gridOptionsService)),o.insertAdjacentElement("afterbegin",oe(e?"first":"last",this.gridOptionsService)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.onPaginationChanged()}onPaginationChanged(){const t=this.gridOptionsService.get("pagination")&&!this.gridOptionsService.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateRowLabels(),this.setCurrentPageLabel(),this.setTotalLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){this.areListenersSetup||(this.addManagedListener(this.eventService,p.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach(e=>{const{el:t,fn:i}=e;this.addManagedListener(t,"click",i),this.addManagedListener(t,"keydown",s=>{(s.key===w.ENTER||s.key===w.SPACE)&&(s.preventDefault(),i())})}),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToFirstPage()}setCurrentPageLabel(){const e=this.paginationProxy.getTotalPages()>0,t=this.paginationProxy.getCurrentPage();this.lbCurrent.textContent=this.formatNumber(e?t+1:0)}formatNumber(e){const t=this.gridOptionsService.getCallback("paginationNumberFormatter");if(t)return t({value:e});const i=this.localeService.getLocaleTextFunc();return gn(e,i("thousandSeparator",","),i("decimalSeparator","."))}getTemplate(){const e=this.localeService.getLocaleTextFunc(),t=e("page","Page"),i=e("to","to"),s=e("of","of"),o=e("firstPage","First Page"),r=e("previousPage","Previous Page"),n=e("nextPage","Next Page"),l=e("lastPage","Last Page"),a=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${a}">\n <ag-page-size-selector ref="pageSizeComp"></ag-page-size-selector>
1\n <span class="ag-paging-row-summary-panel" role="status">\n <span id="ag-${a}-first-row" ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n <span id="ag-${a}-to">${i}</span>\n <span id="ag-${a}-last-row" ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n <span id="ag-${a}-of">${s}</span>\n <span id="ag-${a}-row-count" ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>\n </span>\n <span class="ag-paging-page-summary-panel" role="presentation">\n <div ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>\n <div ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>\n <span class="ag-paging-description" role="status">\n <span id="ag-${a}-start-page">${t}</span>\n <span id="ag-${a}-start-page-number" ref="lbCurrent" class="ag-paging-number"></span>\n <span id="ag-${a}-of-page">${s}</span>\n <span id="ag-${a}-of-page-number" ref="lbTotal" class="ag-paging-number"></span>\n </span>\n <div ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${n}"></div>\n <div ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${l}"></div>\n </span>\n </div>`}onBtNext(){this.nextButtonDisabled||this.paginationProxy.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationProxy.goToLastPage()}enableOrDisableButtons(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.isLastPageFound(),i=this.paginationProxy.getTotalPages();this.previousAndFirstButtonsDisabled=0===e,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay();this.nextButtonDisabled=e===i-1||s,this.lastButtonDisabled=!t||s||e===i-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Qr(e,t),e.classList.toggle("ag-disabled",t)}updateRowLabels(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.getPageSize(),i=this.paginationProxy.isLastPageFound(),s=this.paginationProxy.isLastPageFound()?this.paginationProxy.getMasterRowCount():null;let o,r;if(this.isZeroPagesToDisplay()?o=r=0:(o=t*e+1,r=o+t-1,i&&r>s&&(r=s)),this.lbFirstRowOnPage.textContent=this.formatNumber(o),this.rowNodeBlockLoader.isLoading()){const n=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=n("pageLastRowUnknown","?")}else this.lbLastRowOnPage.textContent=this.formatNumber(r)}isZeroPagesToDisplay(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages();return e&&0===t}setTotalLabels(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages(),i=e?this.paginationProxy.getMasterRowCount():null;if(1===i){const s=this.paginationProxy.getRow(0);if(s&&s.group&&!s.groupData&&!s.aggData)return void this.setTotalLabelsToZero()}if(e)this.lbTotal.textContent=this.formatNumber(t),this.lbRecordCount.textContent=this.formatNumber(i);else{const s=this.localeService.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=s,this.lbRecordCount.innerHTML=s}}setTotalLabelsToZero(){this.lbFirstRowOnPage.textContent=this.formatNumber(0),this.lbCurrent.textContent=this.formatNumber(0),this.lbLastRowOnPage.textContent=this.formatNumber(0),this.lbTotal.textContent=this.formatNumber(0),this.lbRecordCount.textContent=this.formatNumber(0)}};u([f("paginationProxy")],Ve.prototype,"paginationProxy",2),u([f("rowNodeBlockLoader")],Ve.prototype,"rowNodeBlockLoader",2),u([A("btFirst")],Ve.prototype,"btFirst",2),u([A("btPrevious")],Ve.prototype,"btPrevious",2),u([A("btNext")],Ve.prototype,"btNext",2),u([A("btLast")],Ve.prototype,"btLast",2),u([A("lbRecordCount")],Ve.prototype,"lbRecordCount",2),u([A("lbFirstRowOnPage")],Ve.prototype,"lbFirstRowOnPage",2),u([A("lbLastRowOnPage")],Ve.prototype,"lbLastRowOnPage",2),u([A("lbCurrent")],Ve.prototype,"lbCurrent",2),u([A("lbTotal")],Ve.prototype,"lbTotal",2),u([A("pageSizeComp")],Ve.prototype,"pageSizeComp",2),u([b],Ve.prototype,"postConstruct",1);var Js=class ku extends k{constructor(){super(ku.TEMPLATE),this.inProgress=!1,this.destroyRequested=!1}updateLayoutClasses(t,i){const s=this.eOverlayWrapper.classList;s.toggle("ag-layout-auto-height",i.autoHeight),s.toggle("ag-layout-normal",i.normal),s.toggle("ag-layout-print",i.print)}postConstruct(){this.createManagedBean(new tr(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.overlayService.registerOverlayWrapperComp(this)}setWrapperTypeClass(t){const i=this.eOverlayWrapper.classList;this.activeOverlayWrapperCssClass&&i.toggle(this.activeOverlayWrapperCssClass,!1),this.activeOverlayWrapperCssClass=t,i.toggle(t,!0)}showOverlay(t,i,s){this.inProgress||(this.setWrapperTypeClass(i),this.destroyActiveOverlay(),this.inProgress=!0,t&&t.then(o=>{this.inProgress=!1,this.eOverlayWrapper.appendChild(o.getGui()),this.activeOverlay=o,this.updateListenerDestroyFunc=s,this.destroyRequested&&(this.destroyRequested=!1,this.destroyActiveOverlay())}),this.setDisplayed(!0,{skipAriaHidden:!0}))}destroyActiveOverlay(){var t;this.inProgress?this.destroyRequested=!0:this.activeOverlay&&(this.activeOverlay=this.getContext().destroyBean(this.activeOverlay),null==(t=this.updateListenerDestroyFunc)||t.call(this),ce(this.eOverlayWrapper))}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.destroyActiveOverlay(),super.destroy()}};Js.TEMPLATE='\n <div class="ag-overlay" role="presentation">\n <div class="ag-overlay-panel" role="presentation">\n <div class="ag-overlay-wrapper" ref="eOverlayWrapper" role="presentation"></div>\n </div>\n </div>',u([f("overlayService")],Js.prototype,"overlayService",2),u([A("eOverlayWrapper")],Js.prototype,"eOverlayWrapper",2),u([b],Js.prototype,"postConstruct",1);var Vg=Js,ns=class extends T{getFirstRow(){let t,e=0;return this.pinnedRowModel.getPinnedTopRowCount()?t="top":this.rowModel.getRowCount()?(t=null,e=this.paginationProxy.getPageFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(t="bottom"),void 0===t?null:{rowIndex:e,rowPinned:t}}getLastRow(){let e,t=null;const i=this.pinnedRowModel.getPinnedBottomRowCount(),s=this.pinnedRowModel.getPinnedTopRowCount();return i?(t="bottom",e=i-1):this.rowModel.getRowCount()?(t=null,e=this.paginationProxy.getPageLastRow()):s&&(t="top",e=s-1),void 0===e?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t||!(e&&!t||!e&&t)&&e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}before(e,t){switch(e.rowPinned){case"top":if("top"!==t.rowPinned)return!0;break;case"bottom":if("bottom"!==t.rowPinned)return!1;break;default:if(R(t.rowPinned))return"top"!==t.rowPinned}return e.rowIndex<t.rowIndex}rowMax(e){let t;return e.forEach(i=>
1{(void 0===t||this.before(t,i))&&(t=i)}),t}rowMin(e){let t;return e.forEach(i=>{(void 0===t||this.before(i,t))&&(t=i)}),t}};u([f("rowModel")],ns.prototype,"rowModel",2),u([f("pinnedRowModel")],ns.prototype,"pinnedRowModel",2),u([f("paginationProxy")],ns.prototype,"paginationProxy",2),ns=u([O("rowPositionUtils")],ns);var cl=class extends T{createId(e){const{rowIndex:t,rowPinned:i,column:s}=e;return this.createIdFromValues({rowIndex:t,column:s,rowPinned:i})}createIdFromValues(e){const{rowIndex:t,rowPinned:i,column:s}=e;return`${t}.${i??"null"}.${s.getId()}`}equals(e,t){return e.column===t.column&&e.rowPinned===t.rowPinned&&e.rowIndex===t.rowIndex}};cl=u([O("cellPositionUtils")],cl);var eo=class{constructor(e){this.cellValueChanges=e}},hl=class extends eo{constructor(e,t,i,s){super(e),this.initialRange=t,this.finalRange=i,this.ranges=s}},$d=class Vu{constructor(t){this.actionStack=[],this.maxStackSize=t||Vu.DEFAULT_STACK_SIZE,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(t){t.cellValueChanges&&t.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(t))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}};$d.DEFAULT_STACK_SIZE=10;var qd=$d,et=class extends T{constructor(){super(...arguments),this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=null!==this.activeCellEdit&&this.cellPositionUtils.equals(this.activeCellEdit,t),s=null!==this.activeRowEdit&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(i||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:n,column:l,oldValue:a,value:c}=e,h={rowPinned:r,rowIndex:n,columnId:l.getColId(),newValue:c,oldValue:a};this.cellValueChanges.push(h)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}init(){if(!this.gridOptionsService.get("undoRedoCellEditing"))return;const e=this.gridOptionsService.get("undoRedoCellEditingLimit");e<=0||(this.undoStack=new qd(e),this.redoStack=new qd(e),this.addRowEditingListeners(),this.addCellEditingListeners(),this.addPasteListeners(),this.addFillListeners(),this.addCellKeyListeners(),this.addManagedListener(this.eventService,p.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged),this.addManagedListener(this.eventService,p.EVENT_MODEL_UPDATED,t=>{t.keepUndoRedoStack||this.clearStacks()}),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,this.clearStacks),this.addManagedListener(this.eventService,p.EVENT_COLUMN_GROUP_OPENED,this.clearStacks),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,p.EVENT_COLUMN_MOVED,this.clearStacks),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PINNED,this.clearStacks),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VISIBLE,this.clearStacks),this.addManagedListener(this.eventService,p.EVENT_ROW_DRAG_END,this.clearStacks),this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl()}))}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(e){this.eventService.dispatchEvent({type:p.EVENT_UNDO_STARTED,source:e});const i=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo");this.eventService.dispatchEvent({type:p.EVENT_UNDO_ENDED,source:e,operationPerformed:i})}redo(e){this.eventService.dispatchEvent({type:p.EVENT_REDO_STARTED,source:e});const i=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo");this.eventService.dispatchEvent({type:p.EVENT_REDO_ENDED,source:e,operationPerformed:i})}undoRedo(e,t,i,s,o){if(!e)return!1;const r=e.pop();return!(!r||!r.cellValueChanges||(this.processAction(r,n=>n[s],o),r instanceof hl?this.processRange(r.ranges||[r[i]]):this.processCell(r.cellValueChanges),t.push(r),
10))}processAction(e,t,i){e.cellValueChanges.forEach(s=>{const{rowIndex:o,rowPinned:r,columnId:n}=s,a=this.getRowNode({rowIndex:o,rowPinned:r});a.displayed&&a.setDataValue(n,t(s),i)})}processRange(e){let t;this.rangeService.removeAllCellRanges(!0),e.forEach((i,s)=>{if(!i)return;const o=i.startRow,r=i.endRow;s===e.length-1&&(t={rowPinned:o.rowPinned,rowIndex:o.rowIndex,columnId:i.startColumn.getColId()},this.setLastFocusedCell(t)),this.rangeService.addCellRange({rowStartIndex:o.rowIndex,rowStartPinned:o.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:i.startColumn,columns:i.columns})})}processCell(e){const t=e[0],{rowIndex:i,rowPinned:s}=t,r=this.getRowNode({rowIndex:i,rowPinned:s});this.setLastFocusedCell({rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId},!!this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:s,rowPinned:o}=e,r=this.gridBodyCtrl.getScrollFeature(),n=this.columnModel.getGridColumn(s);if(!n)return;r.ensureIndexVisible(i),r.ensureColumnVisible(n);const l={rowIndex:i,column:n,rowPinned:o};this.focusService.setFocusedCell(ie(L({},l),{forceBrowserFocus:!0})),t&&this.rangeService.setRangeToCell(l)}addRowEditingListeners(){this.addManagedListener(this.eventService,p.EVENT_ROW_EDITING_STARTED,e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,p.EVENT_ROW_EDITING_STOPPED,()=>{const e=new eo(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null})}addCellEditingListeners(){this.addManagedListener(this.eventService,p.EVENT_CELL_EDITING_STARTED,e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,p.EVENT_CELL_EDITING_STOPPED,e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const i=new eo(this.cellValueChanges);this.pushActionsToUndoStack(i)}})}addPasteListeners(){this.addManagedListener(this.eventService,p.EVENT_PASTE_START,()=>{this.isPasting=!0}),this.addManagedListener(this.eventService,p.EVENT_PASTE_END,()=>{const e=new eo(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1})}addFillListeners(){this.addManagedListener(this.eventService,p.EVENT_FILL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,p.EVENT_FILL_END,e=>{const t=new hl(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1})}addCellKeyListeners(){this.addManagedListener(this.eventService,p.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,p.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,()=>{let e;e=this.rangeService&&this.gridOptionsService.get("enableRangeSelection")?new hl(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):new eo(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}};u([f("focusService")],et.prototype,"focusService",2),u([f("ctrlsService")],et.prototype,"ctrlsService",2),u([f("rowModel")],et.prototype,"rowModel",2),u([f("pinnedRowModel")],et.prototype,"pinnedRowModel",2),u([f("cellPositionUtils")],et.prototype,"cellPositionUtils",2),u([f("rowPositionUtils")],et.prototype,"rowPositionUtils",2),u([f("columnModel")],et.prototype,"columnModel",2),u([z("rangeService")],et.prototype,"rangeService",2),u([b],et.prototype,"init",1),et=u([O("undoRedoService")],et);var to=class extends T{findHeader(e,t){let i,s,o;if(e.column instanceof he?(s=`getDisplayedGroup${t}`,i=this.columnModel[s](e.column)):(o=`getDisplayedCol${t}`,i=this.columnModel[o](e.column)),!i)return;let{headerRowIndex:r}=e;if("filter"!==this.getHeaderRowType(r)){const a=[i];for(;i.getParent();)i=i.getParent(),a.push(i);i=a[a.length-1-r]}const{column:n,headerRowIndex:l}=this.getHeaderIndexToFocus(i,r);return{column:n,headerRowIndex:l}}getHeaderIndexToFocus(e,t){let i;if(e instanceof he&&this.isAnyChildSpanningHeaderHeight(e)&&e.isPadding()){const s=e;i=s.getLeafColumns()[0];let o=i;for(;o!==s;)t++,o=o.getParent()}return{column:i||e,headerRowIndex:t}}isAnyChildSpanningHeaderHeight(e){return!!e&&e.getLeafColumns().some(t=>t.isSpanHeaderHeight())}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),o="column"===i;let r="filter"===i?e:e.getParent(),n=t-1,l=n;if(o&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;r&&r.isPadding();)r=r.getParent(),n--;l=n,n<0&&(r=e,n=t,l=void 0)}return{column:r,headerRowIndex:n,headerRowIndexWithoutSpan:l}}getColumnVisibleChild(e,t,i="After"){let o=e,r=t+1,n=r;if("group"===this.getHeaderRowType(t)){const l=e.getDisplayedLeafColumns(),a="After"===i?l[0]:K(l),c=[];let h=a;for(;h.getParent()!==e;)h=h.getParent(),c.push(h);if(o=a,a.isSpanHeaderHeight())for(let g=c.length-1;g>=0;g--){const m=c[g];if(!m.isPadding()){o=m;break}r++}else o=K(c),o||(o=a)}return{column:o,headerRowIndex:r,headerRowIndexWithoutSpan:n}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.columnModel.getAllDisplayedColumns(),s=i["start"===t?0:i.length-1];if(!s)return;const r=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()).getRowType(e);return"group"==r?{headerRowIndex:e,column:this.columnModel.getColumnGroupAtLevel(s,e)}:{headerRowIndex:null==r?-1:e,column:s}}};u([f("columnModel")],to.prototype,"columnModel",2),u([f("ctrlsService")],to.prototype,"ctrlsService",2),to=u([O("headerPositionUtils")],to);var pl=class{buildColumnDefs(e,t,i){const s=[],o={};return e.forEach(r=>{let l=!0,a=this.createDefFromColumn(r,t,i),c=r.getOriginalParent(),h=null;for(;c;){let g=null;if(c.isPadding()){c=c.getOriginalParent();continue}const m=o[c.getGroupId()];if(m){m.children.push(a),l=!1;break}if(g=this.createDefFromGroup(c),g&&(g.children=[a],o[g.groupId]=g,a=g,c=c.getOriginalParent()),null!=c&&h===c){l=!1;break}h=c}l&&s.push(a)}),s}createDefFromGroup(e){const t=Ro(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const s=Ro(e.getColDef());return s.colId=e.getColId(),s.width=e.getActualWidth(),s.rowGroup=e.isRowGroupActive(),s.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,s.pivot=e.isPivotActive(),s.pivotIndex=e.isPivotActive()?i.indexOf(e):null,s.aggFunc=e.isValueActive()?e.getAggFunc():null,s.hide=!e.isVisible()||void 0,s.pinned=e.isPinned()?e.getPinned():null,s.sort=e.getSort()?e.getSort():null,
1s.sortIndex=null!=e.getSortIndex()?e.getSortIndex():null,s}};pl=u([O("columnDefFactory")],pl);var io=class{getInitialRowClasses(e){const t=[];return R(e.extraCssClass)&&t.push(e.extraCssClass),t.push("ag-row"),t.push(e.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&t.push("ag-opacity-zero"),t.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&t.push("ag-row-pinned"),e.rowNode.isSelected()&&t.push("ag-row-selected"),e.rowNode.footer&&t.push("ag-row-footer"),t.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&t.push("ag-row-loading"),e.fullWidthRow&&t.push("ag-full-width-row"),e.expandable&&(t.push("ag-row-group"),t.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&t.push("ag-row-dragging"),Wr(t,this.processClassesFromGridOptions(e.rowNode)),Wr(t,this.preProcessRowClassRules(e.rowNode)),t.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&t.push("ag-row-first"),e.lastRowOnPage&&t.push("ag-row-last"),e.fullWidthRow&&("left"===e.pinned&&t.push("ag-cell-last-left-pinned"),"right"===e.pinned&&t.push("ag-cell-first-right-pinned")),t}processClassesFromGridOptions(e){const t=[],i=r=>{"string"==typeof r?t.push(r):Array.isArray(r)&&r.forEach(n=>t.push(n))},s=this.gridOptionsService.get("rowClass");if(s){if("function"==typeof s)return console.warn("AG Grid: rowClass should not be a function, please use getRowClass instead"),[];i(s)}const o=this.gridOptionsService.getCallback("getRowClass");return o&&i(o({data:e.data,node:e,rowIndex:e.rowIndex})),t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,i=>{t.push(i)},i=>{}),t}processRowClassRules(e,t,i){const s=this.gridOptionsService.addGridCommonParams({data:e.data,node:e,rowIndex:e.rowIndex});this.stylingService.processClassRules(void 0,this.gridOptionsService.get("rowClassRules"),s,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}};u([f("stylingService")],io.prototype,"stylingService",2),u([f("gridOptionsService")],io.prototype,"gridOptionsService",2),io=u([O("rowCssClassCalculator")],io);var ls=class extends T{init(){this.isAccentedSort=this.gridOptionsService.get("accentedSort"),this.primaryColumnsSortGroups=this.gridOptionsService.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",e=>this.isAccentedSort=e.currentValue),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.primaryColumnsSortGroups=this.gridOptionsService.isColumnsSortingCoupledToGroup())}doFullSort(e,t){const s=e.map((o,r)=>({currentPos:r,rowNode:o}));return s.sort(this.compareRowNodes.bind(this,t)),s.map(o=>o.rowNode)}compareRowNodes(e,t,i){const s=t.rowNode,o=i.rowNode;for(let r=0,n=e.length;r<n;r++){const l=e[r],a="desc"===l.sort,c=this.getValue(s,l.column),h=this.getValue(o,l.column);let g;const m=this.getComparator(l,s);if(g=m?m(c,h,s,o,a):H.defaultComparator(c,h,this.isAccentedSort),!isNaN(g)&&0!==g)return"asc"===l.sort?g:-1*g}return t.currentPos-i.currentPos}getComparator(e,t){const i=e.column,s=i.getColDef().comparator;if(null!=s)return s;if(!i.getColDef().showRowGroup)return;const o=!t.group&&i.getColDef().field;if(!o)return;const r=this.columnModel.getPrimaryColumn(o);return r?r.getColDef().comparator:void 0}getValue(e,t){var i,s;if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(this.gridOptionsService.isGroupUseEntireRow(this.columnModel.isPivotActive())){const l=null==(i=e.allLeafChildren)?void 0:i[0];return l?this.valueService.getValue(t,l,!1,!1):void 0}const n=this.columnModel.getGroupDisplayColumnForGroup(t.getId());return n?null==(s=e.groupData)?void 0:s[n.getId()]:void 0}return e.group&&t.getColDef().showRowGroup?void 0:this.valueService.getValue(t,e,!1,!1)}};u([f("valueService")],ls.prototype,"valueService",2),u([f("columnModel")],ls.prototype,"columnModel",2),u([b],ls.prototype,"init",1),ls=u([O("rowNodeSorter")],ls);var so=class extends T{constructor(){super(...arguments),this.ready=!1,this.readyCallbacks=[]}checkReady(){if(this.ready=null!=this.gridCtrl&&null!=this.gridBodyCtrl&&null!=this.centerRowContainerCtrl&&null!=this.leftRowContainerCtrl&&null!=this.rightRowContainerCtrl&&null!=this.bottomCenterRowContainerCtrl&&null!=this.bottomLeftRowContainerCtrl&&null!=this.bottomRightRowContainerCtrl&&null!=this.topCenterRowContainerCtrl&&null!=this.topLeftRowContainerCtrl&&null!=this.topRightRowContainerCtrl&&null!=this.stickyTopCenterRowContainerCtrl&&null!=this.stickyTopLeftRowContainerCtrl&&null!=this.stickyTopRightRowContainerCtrl&&null!=this.centerHeaderRowContainerCtrl&&null!=this.leftHeaderRowContainerCtrl&&null!=this.rightHeaderRowContainerCtrl&&null!=this.fakeHScrollComp&&null!=this.fakeVScrollComp&&null!=this.gridHeaderCtrl,this.ready){const e=this.createReadyParams();this.readyCallbacks.forEach(t=>t(e)),this.readyCallbacks.length=0}}whenReady(e){this.ready?e(this.createReadyParams()):this.readyCallbacks.push(e)}createReadyParams(){return{centerRowContainerCtrl:this.centerRowContainerCtrl,leftRowContainerCtrl:this.leftRowContainerCtrl,rightRowContainerCtrl:this.rightRowContainerCtrl,bottomCenterRowContainerCtrl:this.bottomCenterRowContainerCtrl,bottomLeftRowContainerCtrl:this.bottomLeftRowContainerCtrl,bottomRightRowContainerCtrl:this.bottomRightRowContainerCtrl,topCenterRowContainerCtrl:this.topCenterRowContainerCtrl,topLeftRowContainerCtrl:this.topLeftRowContainerCtrl,topRightRowContainerCtrl:this.topRightRowContainerCtrl,stickyTopCenterRowContainerCtrl:this.stickyTopCenterRowContainerCtrl,stickyTopLeftRowContainerCtrl:this.stickyTopLeftRowContainerCtrl,stickyTopRightRowContainerCtrl:this.stickyTopRightRowContainerCtrl,centerHeaderRowContainerCtrl:this.centerHeaderRowContainerCtrl,leftHeaderRowContainerCtrl:this.leftHeaderRowContainerCtrl,rightHeaderRowContainerCtrl:this.rightHeaderRowContainerCtrl,fakeHScrollComp:this.fakeHScrollComp,fakeVScrollComp:this.fakeVScrollComp,gridBodyCtrl:this.gridBodyCtrl,gridCtrl:this.gridCtrl,gridHeaderCtrl:this.gridHeaderCtrl}}registerFakeHScrollComp(e){this.fakeHScrollComp=e,this.checkReady()}registerFakeVScrollComp(e){this.fakeVScrollComp=e,this.checkReady()}registerGridHeaderCtrl(e){this.gridHeaderCtrl=e,this.checkReady()}registerCenterRowContainerCtrl(e){this.centerRowContainerCtrl=e,this.checkReady()}registerLeftRowContainerCtrl(e){this.leftRowContainerCtrl=e,this.checkReady()}registerRightRowContainerCtrl(e){this.rightRowContainerCtrl=e,this.checkReady()}registerTopCenterRowContainerCtrl(e){this.topCenterRowContainerCtrl=e,this.checkReady()}registerTopLeftRowContainerCon(e){this.topLeftRowContainerCtrl=e,this.checkReady()}registerTopRightRowContainerCtrl(e){this.topRightRowContainerCtrl=e,this.checkReady()}registerStickyTopCenterRowContainerCtrl(e){this.stickyTopCenterRowContainerCtrl=e,this.checkReady()}registerStickyTopLeftRowContainerCon(e){this.stickyTopLeftRowContainerCtrl=e,this.checkReady()}registerStickyTopRightRowContainerCtrl(e){this.stickyTopRightRowContainerCtrl=e,this.checkReady()}registerBottomCenterRowContainerCtrl(e){this.bottomCenterRowContainerCtrl=e,this.checkReady()}registerBottomLeftRowContainerCtrl(e){this.bottomLeftRowContainerCtrl=e,this.checkReady()}registerBottomRightRowContainerCtrl(e){this.bottomRightRowContainerCtrl=e,this.checkReady()}registerHeaderContainer(e,t){switch(t){case"left":this.leftHeaderRowContainerCtrl=e;break;case"right":this.rightHeaderRowContainerCtrl=e;break;default:this.centerHeaderRowContainerCtrl=e}this.checkReady()}registerGridBodyCtrl(e){this.gridBodyCtrl=e,this.checkReady()}registerGridCtrl(e){this.gridCtrl=e,this.checkReady()}getFakeHScrollComp(){return this.fakeHScrollComp}getFakeVScrollComp(){return this.fakeVScrollComp}getGridHeaderCtrl(){return this.gridHeaderCtrl}getGridCtrl(){return this.gridCtrl}getCenterRowContainerCtrl(){return this.centerRowContainerCtrl}getTopCenterRowContainerCtrl(){return this.topCenterRowContainerCtrl}getBottomCenterRowContainerCtrl(){return this.bottomCenterRowContainerCtrl}getStickyTopCenterRowContainerCtrl(){return this.stickyTopCenterRowContainerCtrl}getGridBodyCtrl(){return this.gridBodyCtrl}getHeaderRowContainerCtrls(){return[this.leftHeaderRowContainerCtrl,this.rightHeaderRowContainerCtrl,this.centerHeaderRowContainerCtrl]}getHeaderRowContainerCtrl(e){switch(e){case"left":return this.leftHeaderRowContainerCtrl;case"right":return this.rightHeaderRowContainerCtrl;default:return this.centerHeaderRowContainerCtrl}}};so.NAME="ctrlsService",so=u([O(so.NAME)],so);var gl=class extends T{constructor(){super(...arguments),this.registry={}}register(e){this.registry[e.controllerName]=e.controllerClass}getInstance(e){const t=this.registry[e];if(null!=t)return new t}};gl=u([O("ctrlsFactory")],gl);var Ti=class extends k{constructor(e,t){super(e),this.direction=t,this.hideTimeout=null}postConstruct(){this.addManagedListener(this.eventService,p.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",cn()||At())}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.invisibleScrollbar=pn(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles())
1)}addActiveListenerToggles(){const i=this.getGui();["mouseenter","mousedown","touchstart"].forEach(s=>this.addManagedListener(i,s,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0))),["mouseleave","touchend"].forEach(s=>this.addManagedListener(i,s,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1)))}onScrollVisibilityChanged(){void 0===this.invisibleScrollbar&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame(()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedListener(this.eventService,p.EVENT_BODY_SCROLL,e=>{e.direction===this.direction&&(null!==this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))}),this.addManagedListener(this.eventService,p.EVENT_BODY_SCROLL_END,()=>{this.hideTimeout=window.setTimeout(()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null},400)})}attemptSettingScrollPosition(e){const t=this.getViewport();Nr(()=>ze(t),()=>this.setScrollPosition(e),100)}getViewport(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(e){this.addManagedListener(this.getViewport(),"scroll",e)}};u([A("eViewport")],Ti.prototype,"eViewport",2),u([A("eContainer")],Ti.prototype,"eContainer",2),u([f("scrollVisibleService")],Ti.prototype,"scrollVisibleService",2),u([f("ctrlsService")],Ti.prototype,"ctrlsService",2),u([f("animationFrameService")],Ti.prototype,"animationFrameService",2);var bi=class Hu extends Ti{constructor(){super(Hu.TEMPLATE,"horizontal")}postConstruct(){super.postConstruct();const t=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,t),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,t),this.addManagedListener(this.eventService,p.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedPropertyListener("domLayout",t),this.ctrlsService.registerFakeHScrollComp(this),this.createManagedBean(new Ki(i=>this.eContainer.style.width=`${i}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.enableRtl=this.gridOptionsService.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}onPinnedRowDataChanged(){this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;const t=this.pinnedRowModel.getPinnedBottomTotalHeight();this.getGui().style.bottom=`${t}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const t=this.scrollVisibleService.isVerticalScrollShowing();let i=this.columnModel.getDisplayedColumnsRightWidth();const s=!this.enableRtl&&t,o=this.gridOptionsService.getScrollbarWidth();s&&(i+=o),Xe(this.eRightSpacer,i),this.eRightSpacer.classList.toggle("ag-scroller-corner",i<=o);let r=this.columnModel.getDisplayedColumnsLeftWidth();this.enableRtl&&t&&(r+=o),Xe(this.eLeftSpacer,r),this.eLeftSpacer.classList.toggle("ag-scroller-corner",r<=o)}setScrollVisible(){const t=this.scrollVisibleService.isHorizontalScrollShowing(),i=this.invisibleScrollbar,s=this.gridOptionsService.get("suppressHorizontalScroll"),o=t&&this.gridOptionsService.getScrollbarWidth()||0,n=s?0:0===o&&i?16:o;this.addOrRemoveCssClass("ag-scrollbar-invisible",i),ei(this.getGui(),n),ei(this.eViewport,n),ei(this.eContainer,n),this.setDisplayed(t,{skipAriaHidden:!0})}getScrollPosition(){return Ts(this.getViewport(),this.enableRtl)}setScrollPosition(t){ze(this.getViewport())||this.attemptSettingScrollPosition(t),bs(this.getViewport(),t,this.enableRtl)}};bi.TEMPLATE='<div class="ag-body-horizontal-scroll" aria-hidden="true">\n <div class="ag-horizontal-left-spacer" ref="eLeftSpacer"></div>\n <div class="ag-body-horizontal-scroll-viewport" ref="eViewport">\n <div class="ag-body-horizontal-scroll-container" ref="eContainer"></div>\n </div>\n <div class="ag-horizontal-right-spacer" ref="eRightSpacer"></div>\n </div>',u([A("eLeftSpacer")],bi.prototype,"eLeftSpacer",2),u([A("eRightSpacer")],bi.prototype,"eRightSpacer",2),u([f("columnModel")],bi.prototype,"columnModel",2),u([f("pinnedRowModel")],bi.prototype,"pinnedRowModel",2),u([b],bi.prototype,"postConstruct",1);var Hg=bi,oo=class extends T{postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=this.gridOptionsService.isDomLayout("print"),t=e?0:this.columnModel.getDisplayedColumnsLeftWidth(),i=e?0:this.columnModel.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:p.EVENT_LEFT_PINNED_WIDTH_CHANGED})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:p.EVENT_RIGHT_PINNED_WIDTH_CHANGED}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}};u([f("columnModel")],oo.prototype,"columnModel",2),u([b],oo.prototype,"postConstruct",1),oo=u([O("pinnedWidthService")],oo);var as=class extends T{constructor(){super(...arguments),this.events=[]}postConstruct(){"clientSide"==this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel)}
1dispatchExpanded(e){null!=this.clientSideRowModel?(this.events.push(e),null==this.dispatchExpandedDebounced&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach(i=>this.eventService.dispatchEvent(i)),this.events=[]})),this.dispatchExpandedDebounced()):this.eventService.dispatchEvent(e)}};u([f("animationFrameService")],as.prototype,"animationFrameService",2),u([f("rowModel")],as.prototype,"rowModel",2),u([b],as.prototype,"postConstruct",1),as=u([O("rowNodeEventThrottle")],as);var Yt=(e,t)=>{var i;return"clientSide"===(null!=(i=t.rowModelType)?i:"clientSide")?{module:"@ag-grid-enterprise/row-grouping"}:null},Wg={enableRowGroup:Yt,rowGroup:Yt,rowGroupIndex:Yt,enablePivot:Yt,enableValue:Yt,pivot:Yt,pivotIndex:Yt,aggFunc:Yt,cellEditor:e=>"agRichSelect"===e.cellEditor||"agRichSelectCellEditor"===e.cellEditor?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:e=>{var t;const i=["columnsMenuTab","generalMenuTab"];return null!=(t=e.menuTabs)&&t.some(s=>i.includes(s))?{module:"@ag-grid-enterprise/menu"}:null},columnsMenuParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},columnChooserParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>ds},ds={objectName:"colDef",allProperties:pp.ALL_PROPERTIES,docsUrl:"column-properties/",deprecations:{columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."},suppressCellFlash:{version:"31.2",message:"Use `enableCellChangeFlash={false}` in the ColDef"},dndSource:{version:"31.2",message:"This feature has been replaced by `Row Dragging to an External DropZone`."},dndSourceOnRowDrag:{version:"31.2",message:"This feature has been replaced by `Row Dragging to an External DropZone`."}},validations:Wg},zg={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!1,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:"\t",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!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,suppressChartToolPanelsButton:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!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,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!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,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!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,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,suppressGroupMaintainValueType:!1,functionsPassive:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,pivotMaxGeneratedColumns:-1},Kg={sideBar:{module:"@ag-grid-enterprise/side-bar"},statusBar:{module:"@ag-grid-enterprise/status-bar"},enableCharts:{module:"@ag-grid-enterprise/charts"},getMainMenuItems:{module:"@ag-grid-enterprise/menu"},getContextMenuItems:{module:"@ag-grid-enterprise/menu"},allowContextMenuWithControlKey:{module:"@ag-grid-enterprise/menu"},enableAdvancedFilter:{module:"@ag-grid-enterprise/advanced-filter"},treeData:{supportedRowModels:["clientSide","serverSide"],module:"@ag-grid-enterprise/row-grouping",dependencies:e=>{var t;const i=null!=(t=e.rowModelType)?t:"clientSide";switch(i){case"clientSide":return e.getDataPath?null:`treeData requires 'getDataPath' in the ${i} row model.`;case"serverSide":return e.isServerSideGroup&&e.getServerSideGroupKey?null:`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${i} row model.`}return null}},masterDetail:{module:"@ag-grid-enterprise/master-detail"},enableRangeSelection:{module:"@ag-grid-enterprise/range-selection"},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],dependencies:e=>{var t;switch(null!=(t=e.rowModelType)?t:"clientSide"){case"clientSide":return null;case"serverSide":return e.suppressServerSideInfiniteScroll?"groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll":null}return null}},groupIncludeTotalFooter:{supportedRowModels:["clientSide"]}
1,groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveLowestSingleChildren:[void 0,!1]}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveSingleChildren:[void 0,!1]}},groupSelectsChildren:{dependencies:{rowSelection:["multiple"]}},suppressParentsInRowNodes:{dependencies:{groupSelectsChildren:[void 0,!1]}},viewportDatasource:{supportedRowModels:["viewport"],module:"@ag-grid-enterprise/viewport-row-model"},serverSideDatasource:{supportedRowModels:["serverSide"],module:"@ag-grid-enterprise/server-side-row-model"},cacheBlockSize:{supportedRowModels:["serverSide","infinite"]},datasource:{supportedRowModels:["infinite"],module:"@ag-grid-community/infinite-row-model"},rowData:{supportedRowModels:["clientSide"],module:"@ag-grid-community/client-side-row-model"},columnDefs:()=>ds,defaultColDef:()=>ds,defaultColGroupDef:()=>ds,autoGroupColumnDef:()=>ds},$g={objectName:"gridOptions",allProperties:[...gt.ALL_PROPERTIES,...Lo.EVENT_CALLBACKS],propertyExceptions:["api","columnApi"],docsUrl:"grid-options/",deprecations:{enableChartToolPanelsButton:{version:"29"},functionsPassive:{version:"29.2"},onColumnRowGroupChangeRequest:{version:"29.2"},onColumnPivotChangeRequest:{version:"29.2"},onColumnValueChangeRequest:{version:"29.2"},onColumnAggFuncChangeRequest:{version:"29.2"},serverSideFilterAllLevels:{version:"30",message:"All server-side group levels are now filtered by default. This can be toggled using `serverSideOnlyRefreshFilteredGroups`."},suppressAggAtRootLevel:{version:"30",message:"The root level aggregation is now suppressed by default. This can be toggled using `alwaysAggregateAtRootLevel`."},excludeHiddenColumnsFromQuickFilter:{version:"30",message:"Hidden columns are now excluded from the Quick Filter by default. This can be toggled using `includeHiddenColumnsInQuickFilter`."},enterMovesDown:{version:"30",renamed:"enterNavigatesVertically"},enterMovesDownAfterEdit:{version:"30",renamed:"enterNavigatesVerticallyAfterEdit"},suppressParentsInRowNodes:{version:"30.2",message:"Using suppressParentsInRowNodes is no longer recommended. To serialize nodes it is now recommended to instead remove the parent node reference before serialization."},advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"},enableCellChangeFlash:{version:"31.2",message:"Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."}}
1,validations:Kg},$=class{constructor(){this.destroyed=!1,this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new ot,this.globalEventHandlerFactory=e=>(t,i)=>{if(this.destroyed)return;const s=Io.has(t);if(s&&!e||!s&&e)return;const o=Lo.getCallbackForEvent(t),r=this.gridOptions[o];"function"==typeof r&&this.frameworkOverrides.wrapOutgoing(()=>{r(i)})}}get context(){return this.gridOptions.context}init(){this.columnApi=new Ei(this.api);const e=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),e),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.getScrollbarWidth()}destroy(){this.destroyed=!0,this.columnApi=void 0}get(e){var t;return null!=(t=this.gridOptions[e])?t:zg[e]}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return R(this.gridOptions[e])}mergeGridCommonParams(e){return e&&(i=>{const s=i;return s.api=this.api,s.columnApi=this.columnApi,s.context=this.context,e(s)})}static toBoolean(e){return"boolean"==typeof e?e:"string"==typeof e&&("TRUE"===e.toUpperCase()||""==e)}static toNumber(e){if("number"==typeof e)return e;if("string"==typeof e){const t=parseInt(e);return isNaN(t)?void 0:t}}static toConstrainedNum(e,t){return i=>{const s=$.toNumber(i);if(!(null==s||s<e||s>t))return s}}static getCoercedValue(e,t){const i=$.PROPERTY_COERCIONS.get(e);return i?i(t):t}static getCoercedGridOptions(e){const t={};return Object.entries(e).forEach(([i,s])=>{const o=$.getCoercedValue(i,s);t[i]=o}),t}updateGridOptions({options:e,source:t="api"}){const i={id:$.changeSetId++,properties:[]},s=[];Object.entries(e).forEach(([o,r])=>{"api"===t&&rh[o]&&x(`${o} is an initial property and cannot be updated.`);const n=$.getCoercedValue(o,r),a=this.gridOptions[o];("object"==typeof n&&"api"===t||a!==n)&&(this.gridOptions[o]=n,s.push({type:o,currentValue:n,previousValue:a,changeSet:i,source:t}))}),this.validationService.processGridOptions(this.gridOptions),i.properties=s.map(o=>o.type),s.forEach(o=>{this.gridOptions.debug&&console.log(`AG Grid: Updated property ${o.type} from `,o.previousValue," to ",o.currentValue),this.propertyEventService.dispatchEvent(o)})}addEventListener(e,t){this.propertyEventService.addEventListener(e,t)}removeEventListener(e,t){this.propertyEventService.removeEventListener(e,t)}getScrollbarWidth(){if(null==this.scrollbarWidth){const t="number"==typeof this.gridOptions.scrollbarWidth&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:Ta();null!=t&&(this.scrollbarWidth=t,this.eventService.dispatchEvent({type:p.EVENT_SCROLLBAR_WIDTH_CHANGED}))}return this.scrollbarWidth}isRowModelType(e){return this.gridOptions.rowModelType===e||"clientSide"===e&&G(this.gridOptions.rowModelType)}isDomLayout(e){var t;return(null!=(t=this.gridOptions.domLayout)?t:"normal")===e}isRowSelection(){return"single"===this.gridOptions.rowSelection||"multiple"===this.gridOptions.rowSelection}useAsyncEvents(){return!this.get("suppressAsyncEvents")}isGetRowHeightFunction(){return"function"==typeof this.gridOptions.getRowHeight}getRowHeightForNode(e,t=!1,i){if(null==i&&(i=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(t)return{height:i,estimated:!0};const o={node:e,data:e.data},r=this.getCallback("getRowHeight")(o);if(this.isNumeric(r))return 0===r&&x("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,r),estimated:!1}}return e.detail&&this.get("masterDetail")?this.getMasterDetailRowHeight():{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:i,estimated:!1}}getMasterDetailRowHeight(){return this.get("detailRowAutoHeight")?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1}}getRowHeightAsNumber(){if(!this.gridOptions.rowHeight||G(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const e=this.environment.refreshRowHeightVariable();return-1!==e?e:(console.warn("AG Grid row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(e){return!isNaN(e)&&"number"==typeof e&&isFinite(e)}getDomDataKey(){return this.domDataKey}getDomData(e,t){const i=e[this.getDomDataKey()];return i?i[t]:void 0}setDomData(e,t,i){const s=this.getDomDataKey();let o=e[s];G(o)&&(o={},e[s]=o),o[t]=i}getDocument(){let e=null;return this.gridOptions.getDocument&&R(this.gridOptions.getDocument)?e=this.gridOptions.getDocument():this.eGridDiv&&(e=this.eGridDiv.ownerDocument),e&&R(e)?e:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getAsyncTransactionWaitMillis(){return R(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return!this.get("ensureDomOrder")&&this.get("animateRows")}isGroupRowsSticky(){return!(this.get("suppressGroupRowsSticky")||this.get("paginateChildRows")||this.get("groupHideOpenParents")||this.isDomLayout("print"))}isColumnsSortingCoupledToGroup(){const e=this.gridOptions.autoGroupColumnDef;return!e?.comparator&&!this.get("treeData")}getGroupAggFiltering(){const e=this.gridOptions.groupAggFiltering;return"function"==typeof e?this.getCallback("groupAggFiltering"):!0===e?()=>!0:void 0}isGroupIncludeFooterTrueOrCallback(){const e=this.gridOptions.groupIncludeFooter;return!0===e||"function"==typeof e}getGroupIncludeFooter(){const e=this.gridOptions.groupIncludeFooter;return"function"==typeof e?this.getCallback("groupIncludeFooter"):!0===e?()=>!0:()=>!1}isGroupMultiAutoColumn(){return this.gridOptions.groupDisplayType?"multipleColumns"===this.gridOptions.groupDisplayType:this.get("groupHideOpenParents")}isGroupUseEntireRow(e){return!e&&"groupRows"===this.gridOptions.groupDisplayType}getGridCommonParams(){return{api:this.api,columnApi:this.columnApi,context:this.context}}addGridCommonParams(e){const t=e;return t.api=this.api,t.columnApi=this.columnApi,t.context=this.context,t}};$.PROPERTY_COERCIONS=new Map([...gt.BOOLEAN_PROPERTIES.map(e=>[e,$.toBoolean]),...gt.NUMBER_PROPERTIES.map(e=>[e,$.toNumber]),["groupAggFiltering",e=>"function"==typeof e?e:$.toBoolean(e)],["pageSize",$.toConstrainedNum(1,Number.MAX_VALUE)],["autoSizePadding",$.toConstrainedNum(0,Number.MAX_VALUE)],["keepDetailRowsCount",$.toConstrainedNum(1,Number.MAX_VALUE)],["rowBuffer",$.toConstrainedNum(0,Number.MAX_VALUE)],["infiniteInitialRowCount",$.toConstrainedNum(1,Number.MAX_VALUE)],["cacheOverflowSize",$.toConstrainedNum(1,Number.MAX_VALUE)],["cacheBlockSize",$.toConstrainedNum(1,Number.MAX_VALUE)],["serverSideInitialRowCount",$.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelPageSize",$.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelBufferSize",$.toConstrainedNum(0,Number.MAX_VALUE)]]),$.changeSetId=0,u([f("gridOptions")],$.prototype,"gridOptions",2),u([f("eventService")],$.prototype,"eventService",2),u([f("environment")],$.prototype,"environment",2),u([f("frameworkOverrides")],$.prototype,"frameworkOverrides",2),u([f("eGridDiv")],$.prototype,"eGridDiv",2),u([f("validationService")],$.prototype,"validationService",2),u([f("gridApi")],$.prototype,"api",2),u([b],$.prototype,"init",1),u([Ae],$.prototype,"destroy",1),$=u([O("gridOptionsService")],$);var fl=class extends T{getLocaleTextFunc(){const e=this.gridOptionsService.getCallback("getLocaleText");if(e)return(i,s,o)=>e({key:i,defaultValue:s,variableValues:o});const t=this.gridOptionsService.get("localeText");return(i,s,o)=>{let r=t&&t[i];if(r&&o&&o.length){let n=0;for(;!(n>=o.length||-1===r.indexOf("${variable}"));)r=r.replace("${variable}",o[n++])}return r??s}}};fl=u([O("localeService")],fl);var ml=class Bu extends Ti{constructor(){super(Bu.TEMPLATE,"vertical")}
1postConstruct(){super.postConstruct(),this.createManagedBean(new sr(this.eContainer)),this.ctrlsService.registerFakeVScrollComp(this),this.addManagedListener(this.eventService,p.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onRowContainerHeightChanged.bind(this))}setScrollVisible(){const t=this.scrollVisibleService.isVerticalScrollShowing(),i=this.invisibleScrollbar,s=t&&this.gridOptionsService.getScrollbarWidth()||0,o=0===s&&i?16:s;this.addOrRemoveCssClass("ag-scrollbar-invisible",i),Xe(this.getGui(),o),Xe(this.eViewport,o),Xe(this.eContainer,o),this.setDisplayed(t,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:t}=this,s=t.getGridBodyCtrl().getBodyViewportElement(),o=this.getScrollPosition(),r=s.scrollTop;o!=r&&this.setScrollPosition(r,!0)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(t,i){!i&&!ze(this.getViewport())&&this.attemptSettingScrollPosition(t),this.getViewport().scrollTop=t}};ml.TEMPLATE='<div class="ag-body-vertical-scroll" aria-hidden="true">\n <div class="ag-body-vertical-scroll-viewport" ref="eViewport">\n <div class="ag-body-vertical-scroll-container" ref="eContainer"></div>\n </div>\n </div>',u([b],ml.prototype,"postConstruct",1);var qg=ml,Yd={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},jd=["january","february","march","april","may","june","july","august","september","october","november","december"],xt=class extends T{constructor(){super(...arguments),this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}init(){this.groupHideOpenParents=this.gridOptionsService.get("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",()=>{this.groupHideOpenParents=this.gridOptionsService.get("groupHideOpenParents")}),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",e=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(Gi(e.source))})}processDataTypeDefinitions(){var e;const t=this.getDefaultDataTypes();this.dataTypeDefinitions={},Object.entries(t).forEach(([s,o])=>{this.dataTypeDefinitions[s]=ie(L({},o),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)})});const i=null!=(e=this.gridOptionsService.get("dataTypeDefinitions"))?e:{};this.dataTypeMatchers={},Object.entries(i).forEach(([s,o])=>{const r=this.processDataTypeDefinition(o,i,[s],t);r&&(this.dataTypeDefinitions[s]=r,o.dataTypeMatcher&&(this.dataTypeMatchers[s]=o.dataTypeMatcher))}),this.checkObjectValueHandlers(t),["dateString","text","number","boolean","date"].forEach(s=>{const o=this.dataTypeMatchers[s];o&&delete this.dataTypeMatchers[s],this.dataTypeMatchers[s]=o??t[s].dataTypeMatcher})}mergeDataTypeDefinitions(e,t){const i=L(L({},e),t);return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...this.convertColumnTypes(e.columnTypes),...this.convertColumnTypes(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,s){let o;const r=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let n=s[r];const l=t[r];if(n&&l&&(n=l),!this.validateDataTypeDefinition(e,n,r))return;o=this.mergeDataTypeDefinitions(n,e)}else{if(i.includes(r))return void x('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');const n=t[r];if(!this.validateDataTypeDefinition(e,n,r))return;const l=this.processDataTypeDefinition(n,t,[...i,r],s);if(!l)return;o=this.mergeDataTypeDefinitions(l,e)}return ie(L({},o),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)})}validateDataTypeDefinition(e,t,i){return t?t.baseDataType===e.baseDataType||(x('The "baseDataType" property of a data type definition must match that of its parent.'),!1):(x(`The data type definition ${i} does not exist.`),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{var i,s;if(null!=(i=t.node)&&i.group){const o=t.column.getAggFunc();if(o){if("first"===o||"last"===o)return e.valueFormatter(t);if("number"===e.baseDataType&&"count"!==o){if("number"==typeof t.value)return e.valueFormatter(t);if("object"==typeof t.value){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter(ie(L({},t),{value:t.value.toNumber()}));if("value"in t.value)return e.valueFormatter(ie(L({},t),{value:t.value.value}))}}}if(!this.gridOptionsService.get("suppressGroupMaintainValueType"))return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive()){if("string"!=typeof t.value||null!=(s=e.dataTypeMatcher)&&s.call(e,t.value))return e.valueFormatter(t);if(!this.gridOptionsService.get("suppressGroupMaintainValueType"))return}return e.valueFormatter(t)}}updateColDefAndGetDataTypeDefinitionColumnType(e,t,i){let{cellDataType:s}=t;const{field:o}=t;if(void 0===s&&(s=e.cellDataType),(null==s||!0===s)&&(s=!!this.canInferCellDataType(e,t)&&this.inferCellDataType(o,i)),!s)return void(e.cellDataType=!1);const r=this.dataTypeDefinitions[s];if(r)return e.cellDataType=s,r.groupSafeValueFormatter&&(e.valueFormatter=r.groupSafeValueFormatter),r.valueParser&&(e.valueParser=r.valueParser),r.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,r,i),r.columnTypes;x(`Missing data type definition - "${s}"`)}updateColDefAndGetColumnType(e,t,i){var s,o;const r=this.updateColDefAndGetDataTypeDefinitionColumnType(e,t,i),n=null!=(o=null!=(s=t.type)?s:r)?o:e.type;return e.type=n,n?this.convertColumnTypes(n):void 0}
1addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=s=>{t.add(s.key)};e.addEventListener(Z.EVENT_STATE_UPDATED,i),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.removeEventListener(Z.EVENT_STATE_UPDATED,i))}canInferCellDataType(e,t){var i;if("clientSide"!==this.rowModel.getType())return!1;const s={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,s))return!1;const o=null===t.type?e.type:t.type;if(o){const r=null!=(i=this.gridOptionsService.get("columnTypes"))?i:{};if(this.convertColumnTypes(o).some(l=>{const a=r[l.trim()];return a&&this.doColDefPropsPreventInference(a,s)}))return!1}return!this.doColDefPropsPreventInference(e,s)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([i,s])=>this.doesColDefPropPreventInference(e,t,i,s))}doesColDefPropPreventInference(e,t,i,s){if(!t[i])return!1;const o=e[i];return null===o?(t[i]=!1,!1):void 0===s?!!o:o===s}inferCellDataType(e,t){var i;if(!e)return;let s;const o=this.getInitialData();if(o){const n=e.indexOf(".")>=0&&!this.gridOptionsService.get("suppressFieldDotNotation");s=Li(o,e,n)}else this.initWaitForRowData(t);if(null==s)return;const[r]=null!=(i=Object.entries(this.dataTypeMatchers).find(([n,l])=>l(s)))?i:["object"];return r}getInitialData(){const e=this.gridOptionsService.get("rowData");if(e?.length)return e[0];if(this.initialData)return this.initialData;{const t=this.rowModel.getRootNode().allLeafChildren;if(t?.length)return t[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const i=this.addManagedListener(this.eventService,p.EVENT_ROW_DATA_UPDATE_STARTED,s=>{const{firstRowData:o}=s;o&&(i?.(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(o,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations(),this.eventService.dispatchEvent({type:p.EVENT_DATA_TYPES_INFERRED}))})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.columnStateUpdateListenerDestroyFuncs.forEach(r=>r()),this.columnStateUpdateListenerDestroyFuncs=[];const s={},o={};Object.entries(this.columnStateUpdatesPendingInference).forEach(([r,n])=>{const l=this.columnModel.getGridColumn(r);if(!l)return;const a=l.getColDef();if(!this.columnModel.resetColumnDefIntoColumn(l,"cellDataTypeInferred"))return;const c=l.getColDef();if(t&&c.type&&c.type!==a.type){const h=this.getUpdatedColumnState(l,n);h.rowGroup&&null==h.rowGroupIndex&&(s[r]=h),h.pivot&&null==h.pivotIndex&&(o[r]=h),i.push(h)}}),t&&i.push(...this.columnModel.generateColumnStateForRowGroupAndPivotIndexes(s,o)),i.length&&this.columnModel.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnModel.getColumnStateFromColDef(e);return t.forEach(s=>{delete i[s],"rowGroup"===s?delete i.rowGroupIndex:"pivot"===s&&delete i.pivotIndex}),i}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,i=e.object;this.hasObjectValueParser=t.valueParser!==i.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==i.valueFormatter}convertColumnTypes(e){let t=[];return e instanceof Array?e.some(s=>"string"!=typeof s)?console.warn("if colDef.type is supplied an array it should be of type 'string[]'"):t=e:"string"==typeof e?t=e.split(","):console.warn("colDef.type should be of type 'string' | 'string[]'"),t}getDateStringTypeDefinition(e){var t;return e&&null!=(t=this.getDataTypeDefinition(e))?t:this.dataTypeDefinitions.dateString}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){var t;return null==(t=this.getDataTypeDefinition(e))?void 0:t.baseDataType}checkType(e,t){var i;if(null==t)return!0;const s=null==(i=this.getDataTypeDefinition(e))?void 0:i.dataTypeMatcher;return!s||s(t)}validateColDef(e){"object"===e.cellDataType&&(e.valueFormatter===this.dataTypeDefinitions.object.groupSafeValueFormatter&&!this.hasObjectValueFormatter&&x('Cell data type is "object" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set "colDef.valueFormatter"'),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&x('Cell data type is "object" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set "colDef.valueParser"'))}setColDefPropertiesForBaseDataType(e,t,i){const s=(l,a,c)=>{let h=l.getColDef().valueFormatter;return h===t.groupSafeValueFormatter&&(h=t.valueFormatter),this.valueFormatterService.formatValue(l,a,c,h)},o=Y.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()),r=this.localeService.getLocaleTextFunc(),n=l=>{const{filterParams:a}=e;e.filterParams="object"==typeof a?L(L({},a),l):l};switch(t.baseDataType){case"number":e.cellEditor="agNumberCellEditor",o&&n({comparator:(l,a)=>{const c=null==l?0:parseInt(l),h=null==a?0:parseInt(a);return c===h?0:c>h?1:-1}});break;case"boolean":e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=l=>!!l.colDef.editable&&l.event.key===w.SPACE,n(o?{valueFormatter:l=>R(l.value)?r(String(l.value),l.value?"True":"False"):r("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(l,a)=>a,numberOfInputs:0}
1,{displayKey:"false",displayName:"False",predicate:(l,a)=>!1===a,numberOfInputs:0}]});break;case"date":e.cellEditor="agDateCellEditor",e.keyCreator=l=>s(l.column,l.node,l.value),o&&n({valueFormatter:l=>{const a=s(l.column,l.node,l.value);return R(a)?a:r("blanks","(Blanks)")},treeList:!0,treeListFormatter:(l,a)=>{if(1===a&&null!=l){const c=jd[Number(l)-1];return r(c,Yd[c])}return l??r("blanks","(Blanks)")}});break;case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=a=>s(a.column,a.node,a.value);const l=t.dateParser;n(o?{valueFormatter:a=>{const c=s(a.column,a.node,a.value);return R(c)?c:r("blanks","(Blanks)")},treeList:!0,treeListPathGetter:a=>{const c=l(a??void 0);return c?[String(c.getFullYear()),String(c.getMonth()+1),String(c.getDate())]:null},treeListFormatter:(a,c)=>{if(1===c&&null!=a){const h=jd[Number(a)-1];return r(h,Yd[h])}return a??r("blanks","(Blanks)")}}:{comparator:(a,c)=>{const h=l(c);return null==c||h<a?-1:h>a?1:0}});break}case"object":e.cellEditorParams={useFormatter:!0},e.comparator=(l,a)=>{const c=this.columnModel.getPrimaryColumn(i),h=c?.getColDef();if(!c||!h)return 0;const g=null==l?"":s(c,null,l),m=null==a?"":s(c,null,a);return g===m?0:g>m?1:-1},e.keyCreator=l=>s(l.column,l.node,l.value),o?n({valueFormatter:l=>{const a=s(l.column,l.node,l.value);return R(a)?a:r("blanks","(Blanks)")}}):e.filterValueGetter=l=>s(l.column,l.node,this.valueService.getValue(l.column,l.node))}}getDefaultDataTypes(){const e=i=>!!i.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:i=>{var s,o;return""===(null==(o=null==(s=i.newValue)?void 0:s.trim)?void 0:o.call(s))?null:Number(i.newValue)},valueFormatter:i=>null==i.value?"":"number"!=typeof i.value||isNaN(i.value)?t("invalidNumber","Invalid Number"):String(i.value),dataTypeMatcher:i=>"number"==typeof i},text:{baseDataType:"text",valueParser:i=>""===i.newValue?null:vs(i.newValue),dataTypeMatcher:i=>"string"==typeof i},boolean:{baseDataType:"boolean",valueParser:i=>{var s,o;return null==i.newValue?i.newValue:""===(null==(o=null==(s=i.newValue)?void 0:s.trim)?void 0:o.call(s))?null:"true"===String(i.newValue).toLowerCase()},valueFormatter:i=>null==i.value?"":String(i.value),dataTypeMatcher:i=>"boolean"==typeof i},date:{baseDataType:"date",valueParser:i=>_e(null==i.newValue?null:String(i.newValue)),valueFormatter:i=>{var s;return null==i.value?"":i.value instanceof Date&&!isNaN(i.value.getTime())?null!=(s=Qe(i.value,!1))?s:"":t("invalidDate","Invalid Date")},dataTypeMatcher:i=>i instanceof Date},dateString:{baseDataType:"dateString",dateParser:i=>{var s;return null!=(s=_e(i))?s:void 0},dateFormatter:i=>{var s;return null!=(s=Qe(i??null,!1))?s:void 0},valueParser:i=>e(String(i.newValue))?i.newValue:null,valueFormatter:i=>e(String(i.value))?i.value:"",dataTypeMatcher:i=>"string"==typeof i&&e(i)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:i=>{var s;return null!=(s=vs(i.value))?s:""}}}}};u([f("rowModel")],xt.prototype,"rowModel",2),u([f("columnModel")],xt.prototype,"columnModel",2),u([f("columnUtils")],xt.prototype,"columnUtils",2),u([f("valueService")],xt.prototype,"valueService",2),u([f("valueFormatterService")],xt.prototype,"valueFormatterService",2),u([b],xt.prototype,"init",1),xt=u([O("dataTypeService")],xt);var vr=class extends T{parseValue(e,t,i,s){const o=e.getColDef(),r=this.gridOptionsService.addGridCommonParams({node:t,data:t?.data,oldValue:s,newValue:i,colDef:o,column:e}),n=o.valueParser;return R(n)?"function"==typeof n?n(r):this.expressionService.evaluate(n,r):i}};u([f("expressionService")],vr.prototype,"expressionService",2),vr=u([O("valueParserService")],vr);var Pi=class extends T{constructor(){super(...arguments),this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",e=>this.setColumnDefs(e))}start(){this.ctrlsService.whenReady(()=>{const e=this.gridOptionsService.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()})}setColumnsAndData(e){this.columnModel.setColumnDefs(e??[],"gridInitializing"),this.rowModel.start()}gridReady(){this.dispatchGridReadyEvent();const e=Y.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId());new rl("AG Grid",()=>this.gridOptionsService.get("debug")).log(`initialised successfully, enterprise = ${e}`)}
1dispatchGridReadyEvent(){this.eventService.dispatchEvent({type:p.EVENT_GRID_READY})}setColumnDefs(e){const t=this.gridOptionsService.get("columnDefs");if(t){if(this.waitingForColumns)return this.waitingForColumns=!1,void this.setColumnsAndData(t);this.columnModel.setColumnDefs(t,Gi(e.source))}}};u([f("ctrlsService")],Pi.prototype,"ctrlsService",2),u([f("columnModel")],Pi.prototype,"columnModel",2),u([f("rowModel")],Pi.prototype,"rowModel",2),u([b],Pi.prototype,"postConstruct",1),Pi=u([O("syncService")],Pi);var Ai=class extends T{constructor(){super(...arguments),this.manuallyDisplayed=!1}postConstruct(){this.addManagedListener(this.eventService,p.EVENT_ROW_DATA_UPDATED,()=>this.onRowDataUpdated()),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}registerOverlayWrapperComp(e){this.overlayWrapperComp=e,(!this.gridOptionsService.get("columnDefs")||this.gridOptionsService.isRowModelType("clientSide")&&!this.gridOptionsService.get("rowData"))&&this.showLoadingOverlay()}showLoadingOverlay(){if(this.gridOptionsService.get("suppressLoadingOverlay"))return;const t=this.userComponentFactory.getLoadingOverlayCompDetails({});this.showOverlay(t,"ag-overlay-loading-wrapper","loadingOverlayComponentParams")}showNoRowsOverlay(){if(this.gridOptionsService.get("suppressNoRowsOverlay"))return;const t=this.userComponentFactory.getNoRowsOverlayCompDetails({});this.showOverlay(t,"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams")}showOverlay(e,t,i){const s=e.newAgStackInstance(),o=this.addManagedPropertyListener(i,({currentValue:r})=>{s.then(n=>{n.refresh&&n.refresh(this.gridOptionsService.addGridCommonParams(L({},r??{})))})});this.manuallyDisplayed=this.columnModel.isReady()&&!this.paginationProxy.isEmpty(),this.overlayWrapperComp.showOverlay(s,t,o)}hideOverlay(){this.manuallyDisplayed=!1,this.overlayWrapperComp.hideOverlay()}showOrHideOverlay(){const e=this.paginationProxy.isEmpty(),t=this.gridOptionsService.get("suppressNoRowsOverlay");e&&!t?this.showNoRowsOverlay():this.hideOverlay()}onRowDataUpdated(){this.showOrHideOverlay()}onNewColumnsLoaded(){this.columnModel.isReady()&&!this.paginationProxy.isEmpty()&&!this.manuallyDisplayed&&this.hideOverlay()}};u([f("userComponentFactory")],Ai.prototype,"userComponentFactory",2),u([f("paginationProxy")],Ai.prototype,"paginationProxy",2),u([f("columnModel")],Ai.prototype,"columnModel",2),u([b],Ai.prototype,"postConstruct",1),Ai=u([O("overlayService")],Ai);var Me=class extends T{constructor(){super(...arguments),this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Pe(()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Pe(()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),0),this.onRowSelectedDebounced=Pe(()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){var e;this.isClientSideRowModel="clientSide"===this.rowModel.getType(),this.cachedState=null!=(e=this.gridOptionsService.get("initialState"))?e:{},this.ctrlsService.whenReady(()=>this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnGridReady()));const t=this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,({source:o})=>{"gridInitializing"===o&&(t?.(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnColumnsInitialised()))}),i=this.addManagedListener(this.eventService,p.EVENT_ROW_COUNT_READY,()=>{i?.(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnRowCountReady())}),s=this.addManagedListener(this.eventService,p.EVENT_FIRST_DATA_RENDERED,()=>{s?.(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnFirstDataRendered())})}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState()),this.addManagedListener(this.eventService,p.EVENT_TOOL_PANEL_VISIBLE_CHANGED,()=>this.updateCachedState("sideBar",this.getSideBarState())),this.addManagedListener(this.eventService,p.EVENT_SIDE_BAR_UPDATED,(
1)=>this.updateCachedState("sideBar",this.getSideBarState()))}setupStateOnColumnsInitialised(){var e;const t=null!=(e=this.gridOptionsService.get("initialState"))?e:{};this.setColumnState(t),this.setColumnGroupState(t),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VALUE_CHANGED,()=>this.updateColumnState(["aggregation"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_MOVED,()=>this.updateColumnState(["columnOrder"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PINNED,()=>this.updateColumnState(["columnPinning"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_RESIZED,()=>this.updateColumnState(["columnSizing"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VISIBLE,()=>this.updateColumnState(["columnVisibility"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateColumnState(["rowGroup"])),this.addManagedListener(this.eventService,p.EVENT_SORT_CHANGED,()=>this.updateColumnState(["sort"])),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_GROUP_OPENED,()=>this.updateCachedState("columnGroup",this.getColumnGroupState()))}setupStateOnRowCountReady(){var e;const{filter:t,rowGroupExpansion:i,rowSelection:s,pagination:o}=null!=(e=this.gridOptionsService.get("initialState"))?e:{},r=this.gridOptionsService.get("advancedFilterModel");(t||r)&&this.setFilterState(t,r),i&&this.setRowGroupExpansionState(i),s&&this.setRowSelectionState(s),o&&this.setPaginationState(o),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState()),this.addManagedListener(this.eventService,p.EVENT_FILTER_CHANGED,(
1)=>this.updateCachedState("filter",this.getFilterState())),this.addManagedListener(this.eventService,p.EVENT_ROW_GROUP_OPENED,()=>this.onRowGroupOpenedDebounced()),this.addManagedListener(this.eventService,p.EVENT_EXPAND_COLLAPSE_ALL,()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState())),this.addManagedListener(this.eventService,p.EVENT_SELECTION_CHANGED,()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()}),this.addManagedListener(this.eventService,p.EVENT_PAGINATION_CHANGED,n=>{(n.newPage||n.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())})}setupStateOnFirstDataRendered(){var e;const{scroll:t,rangeSelection:i,focusedCell:s,columnOrder:o}=null!=(e=this.gridOptionsService.get("initialState"))?e:{};s&&this.setFocusedCellState(s),i&&this.setRangeSelectionState(i),t&&this.setScrollState(t),this.setColumnPivotState(!!o?.orderedColIds),this.updateCachedState("sideBar",this.getSideBarState()),this.updateCachedState("focusedCell",this.getFocusedCellState()),this.updateCachedState("rangeSelection",this.getRangeSelectionState()),this.updateCachedState("scroll",this.getScrollState()),this.addManagedListener(this.eventService,p.EVENT_CELL_FOCUSED,()=>this.updateCachedState("focusedCell",this.getFocusedCellState())),this.addManagedListener(this.eventService,p.EVENT_RANGE_SELECTION_CHANGED,r=>{r.finished&&this.updateCachedState("rangeSelection",this.getRangeSelectionState())}),this.addManagedListener(this.eventService,p.EVENT_BODY_SCROLL_END,()=>this.updateCachedState("scroll",this.getScrollState()))}getColumnState(){const e=this.columnModel.isPivotMode(),t=[],i=[],s=[],o=[],r=[],n=[],l=[],a=[],c=[],h=this.columnModel.getColumnState();for(let g=0;g<h.length;g++){const{colId:m,sort:C,sortIndex:v,rowGroup:E,rowGroupIndex:S,aggFunc:D,pivot:y,pivotIndex:P,pinned:F,hide:M,width:I,flex:_}=h[g];c.push(m),C&&(t[v??0]={colId:m,sort:C}),E&&(i[S??0]=m),"string"==typeof D&&s.push({colId:m,aggFunc:D}),y&&(o[P??0]=m),F&&("right"===F?n:r).push(m),M&&l.push(m),(_||I)&&a.push({colId:m,flex:_??void 0,width:I})}return{sort:t.length?{sortModel:t}:void 0,rowGroup:i.length?{groupColIds:i}:void 0,aggregation:s.length?{aggregationModel:s}:void 0,pivot:o.length||e?{pivotMode:e,pivotColIds:o}:void 0,columnPinning:r.length||n.length?{leftColIds:r,rightColIds:n}:void 0,columnVisibility:l.length?{hiddenColIds:l}:void 0,columnSizing:a.length?{columnSizingModel:a}:void 0,columnOrder:c.length?{orderedColIds:c}:void 0}}setColumnState(e){const{sort:t,rowGroup:i,aggregation:s,pivot:o,columnPinning:r,columnVisibility:n,columnSizing:l,columnOrder:a}=e,c={},h=v=>{let E=c[v];return E||(E={colId:v},c[v]=E,E)};t&&t.sortModel.forEach(({colId:v,sort:E},S)=>{const D=h(v);D.sort=E,D.sortIndex=S}),i&&i.groupColIds.forEach((v,E)=>{const S=h(v);S.rowGroup=!0,S.rowGroupIndex=E}),s&&s.aggregationModel.forEach(({colId:v,aggFunc:E})=>{h(v).aggFunc=E}),o&&(o.pivotColIds.forEach((v,E)=>{const S=h(v);S.pivot=!0,S.pivotIndex=E}),this.gridOptionsService.updateGridOptions({options:{pivotMode:o.pivotMode},source:"gridInitializing"})),r&&(r.leftColIds.forEach(v=>{h(v).pinned="left"}),r.rightColIds.forEach(v=>{h(v).pinned="right"})),n&&n.hiddenColIds.forEach(v=>{h(v).hide=!0}),l&&l.columnSizingModel.forEach(({colId:v,flex:E,width:S})=>{const D=h(v);D.flex=E??null,D.width=S});const g=a?.orderedColIds,m=!!g?.length,C=m?g.map(v=>h(v)):Object.values(c);C.length&&(this.columnStates=C,this.columnModel.applyColumnState({state:C,applyOrder:m,defaultState:{sort:null,sortIndex:null,rowGroup:null,rowGroupIndex:null,aggFunc:null,pivot:null,pivotIndex:null,pinned:null,hide:null,flex:null}},"gridInitializing"))}setColumnPivotState(e){const t=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;if(this.columnGroupStates=void 0,this.columnModel.isSecondaryColumnsPresent()){if(t){let s=[];for(const o of t)this.columnModel.getSecondaryColumn(o.colId)&&s.push(o);this.columnModel.applyColumnState({state:s,applyOrder:e},"gridInitializing")}i&&this.columnModel.setColumnGroupState(i,"gridInitializing")}}getColumnGroupState(){const e=this.columnModel.getColumnGroupState(),t=[];return e.forEach(({groupId:i,open:s})=>
1{s&&t.push(i)}),t.length?{openColumnGroupIds:t}:void 0}setColumnGroupState(e){var t;if(!e.hasOwnProperty("columnGroup"))return;const i=new Set(null==(t=e.columnGroup)?void 0:t.openColumnGroupIds),o=this.columnModel.getColumnGroupState().map(({groupId:r})=>{const n=i.has(r);return n&&i.delete(r),{groupId:r,open:n}});i.forEach(r=>{o.push({groupId:r,open:!0})}),o.length&&(this.columnGroupStates=o),this.columnModel.setColumnGroupState(o,"gridInitializing")}getFilterState(){var e;let t=this.filterManager.getFilterModel();t&&0===Object.keys(t).length&&(t=void 0);const i=null!=(e=this.filterManager.getAdvancedFilterModel())?e:void 0;return t||i?{filterModel:t,advancedFilterModel:i}:void 0}setFilterState(e,t){const{filterModel:i,advancedFilterModel:s}=e??{advancedFilterModel:t};i&&this.filterManager.setFilterModel(i,"columnFilter"),s&&this.filterManager.setAdvancedFilterModel(s)}getRangeSelectionState(){var e;const t=null==(e=this.rangeService)?void 0:e.getCellRanges().map(i=>{const{id:s,type:o,startRow:r,endRow:n,columns:l,startColumn:a}=i;return{id:s,type:o,startRow:r,endRow:n,colIds:l.map(c=>c.getColId()),startColId:a.getColId()}});return t?.length?{cellRanges:t}:void 0}setRangeSelectionState(e){var t;if(!this.gridOptionsService.get("enableRangeSelection"))return;const i=e.cellRanges.map(s=>ie(L({},s),{columns:s.colIds.map(o=>this.columnModel.getGridColumn(o)),startColumn:this.columnModel.getGridColumn(s.startColId)}));null==(t=this.rangeService)||t.setCellRanges(i)}getScrollState(){var e,t,i;if(!this.isClientSideRowModel)return;const s=null==(e=this.ctrlsService.getGridBodyCtrl())?void 0:e.getScrollFeature(),{left:o}=null!=(t=s?.getHScrollPosition())?t:{left:0},{top:r}=null!=(i=s?.getVScrollPosition())?i:{top:0};return r||o?{top:r,left:o}:void 0}setScrollState(e){var t;if(!this.isClientSideRowModel)return;const{top:i,left:s}=e;null==(t=this.ctrlsService.getGridBodyCtrl())||t.getScrollFeature().setScrollPosition(i,s)}getSideBarState(){var e,t;return null==(t=null==(e=this.sideBarService)?void 0:e.getSideBarComp())?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.focusService.getFocusedCell();if(e){const{column:t,rowIndex:i,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:i,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{colId:t,rowIndex:i,rowPinned:s}=e;this.focusService.setFocusedCell({column:this.columnModel.getGridColumn(t),rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const e=this.paginationProxy.getCurrentPage(),t=this.gridOptionsService.get("paginationAutoPageSize")?void 0:this.paginationProxy.getPageSize();if(e||t)return{page:e,pageSize:t}}setPaginationState(e){e.pageSize&&!this.gridOptionsService.get("paginationAutoPageSize")&&this.paginationProxy.setPageSize(e.pageSize,"initialState"),"number"==typeof e.page&&this.paginationProxy.setPage(e.page)}getRowSelectionState(){var e;const t=this.selectionService.getSelectionState();return t&&(Array.isArray(t)||!1!==t.selectAll&&!1!==t.selectAllChildren||null!=(e=t?.toggledNodes)&&e.length)?t:void 0}setRowSelectionState(e){this.selectionService.setSelectionState(e,"gridInitializing")}getRowGroupExpansionState(){const e=this.expansionService.getExpandedRows();return e.length?{expandedRowGroupIds:e}:void 0}setRowGroupExpansionState(e){this.expansionService.expandRows(e.expandedRowGroupIds)}updateColumnState(e){const t=this.getColumnState();let i=!1;Object.entries(t).forEach(([s,o])=>{Mr(o,this.cachedState[s])||(i=!0)}),this.cachedState=L(L({},this.cachedState),t),i&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const i=this.cachedState[e];this.setCachedStateValue(e,t),Mr(t,i)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState=ie(L({},this.cachedState),{[e]:t})}refreshStaleState(){this.staleStateKeys.forEach(e=>{"rowSelection"===e&&this.setCachedStateValue(e,this.getRowSelectionState())}),this.staleStateKeys.clear()}dispatchStateUpdateEvent(e){this.suppressEvents||(e.forEach(t=>this.queuedUpdateSources.add(t)),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const e=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear(),this.eventService.dispatchEvent({type:p.EVENT_STATE_UPDATED,sources:e,state:this.cachedState})}suppressEventsAndDispatchInitEvent(e){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),e(),setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))})}};u([f("filterManager")],Me.prototype,"filterManager",2),u([z("rangeService")],Me.prototype,"rangeService",2),u([f("ctrlsService")],Me.prototype,"ctrlsService",2),u([z("sideBarService")],Me.prototype,"sideBarService",2),u([f("focusService")],Me.prototype,"focusService",2),u([f("columnModel")],Me.prototype,"columnModel",2),u([f("paginationProxy")],Me.prototype,"paginationProxy",2),u([f("rowModel")],Me.prototype,"rowModel",2),u([f("selectionService")],Me.prototype,"selectionService",2),u([f("expansionService")],Me.prototype,"expansionService",2),u([f("columnAnimationService")],Me.prototype,"columnAnimationService",2),u([b],Me.prototype,"postConstruct",1),Me=u([O("stateService")],Me);var ro=class extends T{init(){this.processGridOptions(this.gridOptions)}processGridOptions(e){this.processOptions(e,$g)}processColumnDefs(e){this.processOptions(e,ds)}processOptions(e,t){const{validations:i,deprecations:s,allProperties:o,propertyExceptions:r,objectName:n,docsUrl:l}=t;o&&!0!==this.gridOptions.suppressPropertyNamesCheck&&this.checkProperties(e,[...r??[],...Object.keys(s)],o,n,l);const a=new Set;Object.keys(e).forEach(h=>{var g;const m=s[h];if(m)if("renamed"in m){const{renamed:P,version:F}=m;a.add(`As of v${F}, ${String(h)} is deprecated. Please use ${String(P)} instead.`),e[P]=e[h]}
1else{const{message:P,version:F}=m;a.add(`As of v${F}, ${String(h)} is deprecated. ${P??""}`)}const C=e[h];if(null==C||!1===C)return;const v=i[h];let E;if(!v)return;if("function"==typeof v){const P=v(e,this.gridOptions);if(!P)return;if("objectName"in P){const F=e[h];return Array.isArray(F)?void F.forEach(M=>{this.processOptions(M,P)}):void this.processOptions(e[h],P)}E=P}else E=v;const{module:S,dependencies:D,supportedRowModels:y}=E;if(y){const P=null!=(g=this.gridOptions.rowModelType)?g:"clientSide";if(!y.includes(P))return void a.add(`${String(h)} is not supported with the '${P}' row model.`)}if(S){const P=Array.isArray(S)?S:[S];let F=!0;if(P.forEach(M=>{Y.__assertRegistered(M,String(h),this.context.getGridId())||(F=!1,a.add(`${String(h)} is only available when ${M} is loaded.`))}),!F)return}if(D){const P=this.checkForWarning(h,D,e);if(P)return void a.add(P)}}),a.size>0&&a.forEach(h=>{x(h)})}checkForWarning(e,t,i){if("function"==typeof t)return t(i,this.gridOptions);const o=Object.entries(t).find(([l,a])=>!a.includes(i[l]));if(!o)return null;const[r,n]=o;return n.length>1?`'${String(e)}' requires '${r}' to be one of [${n.join(", ")}].`:`'${String(e)}' requires '${r}' to be ${n[0]}.`}checkProperties(e,t,i,s,o){const n=Va(Object.getOwnPropertyNames(e),["__ob__","__v_skip","__metadata__",...t,...i],i);if(Se(n,(l,a)=>{x(`invalid ${s} property '${l}' did you mean any of these: ${a.slice(0,8).join(", ")}`)}),Object.keys(n).length>0&&o){const l=this.getFrameworkOverrides().getDocLink(o);x(`to see all the valid ${s} properties please check: ${l}`)}}};u([f("gridOptions")],ro.prototype,"gridOptions",2),u([b],ro.prototype,"init",1),ro=u([O("validationService")],ro);var wr=class extends T{constructor(){super(...arguments),this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new kr(this.getFrameworkOverrides())}addEventListener(e,t){const i=this.frameworkEventWrappingService.wrap(t),s=this.gridOptionsService.useAsyncEvents()&&!Io.has(e),o=s?this.asyncEventListeners:this.syncEventListeners;o.has(e)||o.set(e,new Set),o.get(e).add(i),this.eventService.addEventListener(e,i,s)}removeEventListener(e,t){var i;const s=this.frameworkEventWrappingService.unwrap(t),o=this.asyncEventListeners.get(e),r=!!o?.delete(s);r||null==(i=this.syncEventListeners.get(e))||i.delete(s),this.eventService.removeEventListener(e,s,r)}addGlobalListener(e){const t=this.frameworkEventWrappingService.wrapGlobal(e);if(this.gridOptionsService.useAsyncEvents()){const s=(r,n)=>{Io.has(r)&&t(r,n)},o=(r,n)=>{Io.has(r)||t(r,n)};this.globalEventListenerPairs.set(e,{syncListener:s,asyncListener:o}),this.eventService.addGlobalListener(s,!1),this.eventService.addGlobalListener(o,!0)}else this.syncGlobalEventListeners.add(t),this.eventService.addGlobalListener(t,!1)}removeGlobalListener(e){const t=this.frameworkEventWrappingService.unwrapGlobal(e);if(this.globalEventListenerPairs.has(t)){const{syncListener:s,asyncListener:o}=this.globalEventListenerPairs.get(t);this.eventService.removeGlobalListener(s,!1),this.eventService.removeGlobalListener(o,!0),this.globalEventListenerPairs.delete(e)}else this.syncGlobalEventListeners.delete(t),this.eventService.removeGlobalListener(t,!1)}destroyEventListeners(e,t){e.forEach((i,s)=>{i.forEach(o=>this.eventService.removeEventListener(s,o,t)),i.clear()}),e.clear()}destroyGlobalListeners(e,t){e.forEach(i=>this.eventService.removeGlobalListener(i,t)),e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach(({syncListener:e,asyncListener:t})=>{this.eventService.removeGlobalListener(e,!1),this.eventService.removeGlobalListener(t,!0)}),this.globalEventListenerPairs.clear()}};u([b],wr.prototype,"postConstruct",1),wr=u([O("apiEventService")],wr);var no=class extends k{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>
1{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.paginationProxy.getPageSize()||(this.paginationProxy.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}init(){this.addManagedPropertyListener("paginationPageSizeSelector",()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedListener(this.eventService,p.EVENT_PAGINATION_CHANGED,e=>this.handlePaginationChanged(e))}handlePaginationChanged(e){if(!this.selectPageSizeComp||!e?.newPageSize)return;const t=this.paginationProxy.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp&&this.appendChild(this.selectPageSizeComp))}reset(){ce(this.getGui()),this.selectPageSizeComp&&(this.destroyBean(this.selectPageSizeComp),this.selectPageSizeComp=void 0)}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gridOptionsService.get("pagination")&&!this.gridOptionsService.get("suppressPaginationPanel")&&!this.gridOptionsService.get("paginationAutoPageSize")&&!1!==this.gridOptionsService.get("paginationPageSizeSelector")}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.paginationProxy.getPageSize(),i=!t||!e.includes(t);i&&(e.unshift(""),x("The paginationPageSize grid option is set to a value that is not in the list of page size options.\n Please make sure that the paginationPageSize grid option is set to one of the values in the \n paginationPageSizeSelector array, or set the paginationPageSizeSelector to false to hide the page size selector.")),this.selectPageSizeComp&&(this.destroyBean(this.selectPageSizeComp),this.selectPageSizeComp=void 0);const s=this.localeService.getLocaleTextFunc(),o=s("pageSizeSelectorLabel","Page Size:"),r=e.map(l=>({value:String(l),text:String(l)})),n=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new jo).addOptions(r).setValue(String(i?"":t)).setAriaLabel(n).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.hasEmptyOption=i}getPageSizeSelectorValues(){const t=this.gridOptionsService.get("paginationPageSizeSelector");return Array.isArray(t)&&this.validateValues(t)?[...t].sort((i,s)=>i-s):[20,50,100]}validateValues(e){if(!e.length)return x("The paginationPageSizeSelector grid option is an empty array. This is most likely a mistake.\n If you want to hide the page size selector, please set the paginationPageSizeSelector to false."),!1;for(let t=0;t<e.length;t++){const i=e[t],o=i>0;if("number"!=typeof i)return x("The paginationPageSizeSelector grid option contains a non-numeric value.\n Please make sure that all values in the paginationPageSizeSelector array are numbers."),!1;if(!o)return x("The paginationPageSizeSelector grid option contains a negative number or zero.\n Please make sure that all values in the paginationPageSizeSelector array are positive."),!1}return!0}destroy(){this.toggleSelectDisplay(!1),super.destroy()}};u([f("localeService")],no.prototype,"localeService",2),u([f("gridOptionsService")],no.prototype,"gridOptionsService",2),u([f("paginationProxy")],no.prototype,"paginationProxy",2),u([b],no.prototype,"init",1);var lo=class extends T{constructor(){super(),this.descriptionContainer=null,this.announceValue=Pe(this.announceValue.bind(this),200)}postConstruct(){const e=this.gridOptionsService.getDocument(),t=this.descriptionContainer=e.createElement("div");t.classList.add("ag-aria-description-container"),jr(t,"polite"),ha(t,"additions text"),ca(t,!0),this.eGridDiv.appendChild(t)}announceValue(e){this.descriptionContainer&&(this.descriptionContainer.textContent="",setTimeout(()=>{this.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=e)},50))}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(ce(e),e.parentElement&&e.parentElement.removeChild(e)),this.descriptionContainer=null,this.eGridDiv=null}};u([f("eGridDiv")],lo.prototype,"eGridDiv",2),u([b],lo.prototype,"postConstruct",1),lo=u([O("ariaAnnouncementService")],lo);var jg=1,Qd=class{create(e,t,i,s,o){var r;const n=!!t.debug,l=null!=(r=t.gridId)?r:String(jg++),a=this.getRegisteredModules(o,l),c=this.createBeansList(t.rowModelType,a,l),h=this.createProvidedBeans(e,t,o);if(!c)return void st("Failed to create grid.");
1const g={providedBeanInstances:h,beanClasses:c,debug:n,gridId:l},m=new rl("Context",()=>g.debug),C=new zc(g,m),v=C.getBean("beans");return this.registerModuleUserComponents(v,a),this.registerStackComponents(v,a),this.registerControllers(v,a),i(C),v.syncService.start(),s&&s(C),v.gridApi}registerControllers(e,t){t.forEach(i=>{i.controllers&&i.controllers.forEach(s=>e.ctrlsFactory.register(s))})}registerStackComponents(e,t){const i=this.createAgStackComponentsList(t);e.agStackComponentsRegistry.setupComponents(i)}getRegisteredModules(e,t){const i=e?e.modules:null,s=Y.__getRegisteredModules(t),o=[],r={},n=(l,a,c)=>{var g;r[(g=a).moduleName]||(r[g.moduleName]=!0,o.push(g),Y.__register(g,l,c)),a.dependantModules&&a.dependantModules.forEach(g=>n(l,g,c))};return i&&i.forEach(l=>n(!0,l,t)),s&&s.forEach(l=>n(!Y.__isPackageBased(),l,void 0)),o}registerModuleUserComponents(e,t){this.extractModuleEntity(t,s=>s.userComponents?s.userComponents:[]).forEach(s=>{e.userComponentRegistry.registerDefaultComponent(s.componentName,s.componentClass)})}createProvidedBeans(e,t,i){let s=i?i.frameworkOverrides:null;G(s)&&(s=new Wd);const o={gridOptions:t,eGridDiv:e,globalEventListener:i?i.globalEventListener:null,globalSyncEventListener:i?i.globalSyncEventListener:null,frameworkOverrides:s};return i&&i.providedBeanInstances&&Object.assign(o,i.providedBeanInstances),o}createAgStackComponentsList(e){let t=[{componentName:"AgCheckbox",componentClass:Qo},{componentName:"AgRadioButton",componentClass:sd},{componentName:"AgToggleButton",componentClass:kd},{componentName:"AgInputTextField",componentClass:ii},{componentName:"AgInputTextArea",componentClass:Sg},{componentName:"AgInputNumberField",componentClass:Ln},{componentName:"AgInputDateField",componentClass:Eg},{componentName:"AgInputRange",componentClass:yg},{componentName:"AgRichSelect",componentClass:il},{componentName:"AgSelect",componentClass:jo},{componentName:"AgSlider",componentClass:Dg},{componentName:"AgGridBody",componentClass:Ct},{componentName:"AgHeaderRoot",componentClass:gg},{componentName:"AgSortIndicator",componentClass:Gn},{componentName:"AgPagination",componentClass:Ve},{componentName:"AgPageSizeSelector",componentClass:no},{componentName:"AgOverlayWrapper",componentClass:Vg},{componentName:"AgGroupComponent",componentClass:Tg},{componentName:"AgRowContainer",componentClass:qi},{componentName:"AgFakeHorizontalScroll",componentClass:Hg},{componentName:"AgFakeVerticalScroll",componentClass:qg},{componentName:"AgAutocomplete",componentClass:Mg}];const i=this.extractModuleEntity(e,s=>s.agStackComponents?s.agStackComponents:[]);return t=t.concat(i),t}createBeansList(e="clientSide",t,i){const s=t.filter(a=>!a.rowModel||a.rowModel===e),o={clientSide:"@ag-grid-community/client-side-row-model",infinite:"@ag-grid-community/infinite-row-model",serverSide:"@ag-grid-enterprise/server-side-row-model",viewport:"@ag-grid-enterprise/viewport-row-model"};if(!o[e])return void st("Could not find row model for rowModelType = "+e);if(!Y.__assertRegistered(o[e],`rowModelType = '${e}'`,i))return;const r=[N,ns,cl,to,is,W,Gs,Cr,Xs,Jn,Bt,os,Ws,fl,ro,$s,Ns,$r,ot,$,_t,Si,Je,fe,gi,qs,$e,gr,_i,ol,wi,ye,mr,qt,fr,Kr,mi,Wt,V,Ei,J,It,Zs,$t,dr,cr,$i,Di,nl,Qs,rs,Ss,ss,Zi,et,qr,pl,io,vt,ls,so,oo,as,gl,xt,vr,Ne,Pi,Ai,Me,zs,wr,lo,ct],n=this.extractModuleEntity(s,a=>a.beans?a.beans:[]);r.push(...n);const l=[];return r.forEach(a=>{l.indexOf(a)<0&&l.push(a)}),l}extractModuleEntity(e,t){return[].concat(...e.map(t))}},Qg=class{wrap(e,t,i=[],s){const o=this.createWrapper(e,s);return t.forEach(r=>{this.createMethod(o,r,!0)}
1),i.forEach(r=>{this.createMethod(o,r,!1)}),o}unwrap(e){return e}createMethod(e,t,i){e.addMethod(t,this.createMethodProxy(e,t,i))}createMethodProxy(e,t,i){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(i&&console.warn("AG Grid: Framework component is missing the method "+t+"()"),null)}}},us=typeof global>"u"?{}:global;us.HTMLElement=typeof HTMLElement>"u"?{}:HTMLElement,us.HTMLButtonElement=typeof HTMLButtonElement>"u"?{}:HTMLButtonElement,us.HTMLSelectElement=typeof HTMLSelectElement>"u"?{}:HTMLSelectElement,us.HTMLInputElement=typeof HTMLInputElement>"u"?{}:HTMLInputElement,us.Node=typeof Node>"u"?{}:Node,us.MouseEvent=typeof MouseEvent>"u"?{}:MouseEvent;var Cl=class vo{constructor(t,i,s,o,r,n){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=t,this.gridOptionsService=i,this.eventService=s,this.columnModel=o,this.beans=n,this.selectionService=r,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=vo.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return H.cloneObject(this.allNodesMap)}getRowNode(t){return this.allNodesMap[t]}setRowData(t){if("string"==typeof t)return void console.warn("AG Grid: rowData must be an array, however you passed in a string. If you are loading JSON, make sure you convert the JSON string to JavaScript objects first");this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(t);const i=this.rootNode,s=this.rootNode.sibling;i.childrenAfterFilter=null,i.childrenAfterGroup=null,i.childrenAfterAggFilter=null,i.childrenAfterSort=null,i.childrenMapped=null,i.updateHasChildren(),this.nextId=0,this.allNodesMap={},t?i.allLeafChildren=t.map(o=>this.createNode(o,this.rootNode,vo.TOP_LEVEL)):(i.allLeafChildren=[],i.childrenAfterGroup=[]),s&&(s.childrenAfterFilter=i.childrenAfterFilter,s.childrenAfterGroup=i.childrenAfterGroup,s.childrenAfterAggFilter=i.childrenAfterAggFilter,s.childrenAfterSort=i.childrenAfterSort,s.childrenMapped=i.childrenMapped,s.allLeafChildren=i.allLeafChildren)}updateRowData(t,i){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(t.add);const s={remove:[],update:[],add:[]},o=[];return this.executeRemove(t,s,o),this.executeUpdate(t,s,o),this.executeAdd(t,s),this.updateSelection(o,"rowDataChanged"),i&&H.sortRowNodesByOrder(this.rootNode.allLeafChildren,i),s}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(t){this.eventService.dispatchEvent({type:p.EVENT_ROW_DATA_UPDATE_STARTED,firstRowData:t?.length?t[0]:null})}updateSelection(t,i){const s=t.length>0;s&&this.selectionService.setNodesSelected({newValue:!1,nodes:t,suppressFinishActions:!0,source:i}),this.selectionService.updateGroupsFromChildrenSelections(i),s&&this.eventService.dispatchEvent({type:p.EVENT_SELECTION_CHANGED,source:i})}executeAdd(t,i){var s;const{add:o,addIndex:r}=t;if(H.missingOrEmpty(o))return;const n=o.map(l=>this.createNode(l,this.rootNode,vo.TOP_LEVEL));if("number"==typeof r&&r>=0){const{allLeafChildren:l}=this.rootNode,a=l.length;let c=r;if(this.gridOptionsService.get("treeData")&&r>0&&a>0)for(let C=0;C<a;C++)if((null==(s=l[C])?void 0:s.rowIndex)==r-1){c=C+1;break}const g=l.slice(0,c),m=l.slice(c,l.length);this.rootNode.allLeafChildren=[...g,...n,...m]}else this.rootNode.allLeafChildren=[...this.rootNode.allLeafChildren,...n];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),i.add=n}executeRemove(t,i,s){const{remove:o}=t;if(H.missingOrEmpty(o))return;const r={};o.forEach(n=>{const l=this.lookupRowNode(n);l&&(l.isSelected()&&s.push(l),l.clearRowTopAndRowIndex(),r[l.id]=!0,delete this.allNodesMap[l.id],i.remove.push(l))}),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter(n=>!r[n.id]),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(t,i,s){const{update:o}=t;H.missingOrEmpty(o)||o.forEach(r=>{const n=this.lookupRowNode(r);n&&(n.updateData(r),!n.selectable&&n.isSelected()&&s.push(n),this.setMasterForRow(n,r,vo.TOP_LEVEL,!1),i.update.push(n))})}lookupRowNode(t){const i=this.gridOptionsService.getCallback("getRowId");let s;if(i){const o=i({data:t,level:0});if(s=this.allNodesMap[o],!s)return console.error(`AG Grid: could not find row id=${o}, data item was not found for this id`),null}else if(s=this.rootNode.allLeafChildren.find(o=>o.data===t),!s)return console.error("AG Grid: could not find data item as object was not found",t),console.error("Consider using getRowId to help the Grid find matching row data"),null;return s||null}createNode(t,i,s){const o=new B(this.beans);o.group=!1,this.setMasterForRow(o,t,s,!0);const r=this.gridOptionsService.get("suppressParentsInRowNodes");return i&&!r&&(o.parent=i),o.level=s,o.setDataAndId(t,this.nextId.toString()),this.allNodesMap[o.id]&&console.warn(`AG Grid: duplicate node id '${o.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[o.id]=o,this.nextId++,o}setMasterForRow(t,i,s,o){if(this.gridOptionsService.get("treeData"))t.setMaster(!1),o&&(t.expanded=!1);else{if(this.gridOptionsService.get("masterDetail")){const l=this.gridOptionsService.get("isRowMaster");t.setMaster(!l||l(i))}else t.setMaster(!1);if(o){const l=this.columnModel.getRowGroupColumns();t.expanded=!!t.master&&this.isExpanded(s+(l?l.length:0))}}}isExpanded(t){const i=this.gridOptionsService.get("groupDefaultExpanded");return-1===i||t<i}};Cl.TOP_LEVEL=0,Cl.ROOT_NODE_ID="ROOT_NODE_ID";var Zg=Cl,Re=class extends T{constructor(){super(...arguments),this.onRowHeightChanged_debounced=H.debounce(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}init(){const e=this.refreshModel.bind(this,{step:"group"}),t=!this.gridOptionsService.get("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,i),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:"pivot"})),this.addManagedListener(this.eventService,p.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,p.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanges.bind(this)),this.addManagedListener(this.eventService,p.EVENT_GRID_READY,()=>this.onGridReady()),this.addPropertyListeners(),this.rootNode=new B(this.beans),this.nodeManager=new Zg(this.rootNode,this.gridOptionsService,this.eventService,this.columnModel,this.selectionService,this.beans)}addPropertyListeners(){const e=new Set(["treeData","masterDetail"]),t=new Set(["suppressParentsInRowNodes","groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),i=new Set(["excludeChildrenWhenTreeDataFiltering"]),s=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),o=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly"]),r=new Set(["postSortRows","groupDisplayType","accentedSort"]),n=new Set([]),l=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter"]),a=[...e,...t,...i,...s,...s,...o,...r,...n,...l];this.addManagedPropertyListeners(a,c=>{var h;const g=null==(h=c.changeSet)?void 0:h.properties;if(!g)return;const m=C=>g.some(v=>C.has(v));m(e)?this.setRowData(this.rootNode.allLeafChildren.map(C=>C.data)):m(t)?this.refreshModel({step:"group"}):m(i)?this.refreshModel({step:"filter"}):m(s)?this.refreshModel({step:"pivot"}):m(o)?this.refreshModel({step:"aggregate"}):m(r)?this.refreshModel({step:"sort"}):m(n)?this.refreshModel({step:"filter_aggregates"}):m(l)&&this.refreshModel({step:"map"})}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const e=this.gridOptionsService.get("rowData");e&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(e))}ensureRowHeightsValid(e,t,i,s){let o,r=!1;do{o=!1;const n=this.getRowIndexAtPixel(e),l=this.getRowIndexAtPixel(t),a=Math.max(n,i),c=Math.min(l,s);for(let h=a;h<=c;h++){const g=this.getRow(h);if(g.rowHeightEstimated){const m=this.gridOptionsService.getRowHeightForNode(g);g.setRowHeight(m.height),o=!0,r=!0}}o&&this.setRowTopAndRowIndex()}while(o);return r}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const i=new Set,s=this.gridOptionsService.isDomLayout("normal");for(let o=0;o<this.rowsToDisplay.length;o++){const r=this.rowsToDisplay[o];if(null!=r.id&&i.add(r.id),null==r.rowHeight){const n=this.gridOptionsService.getRowHeightForNode(r,s,e);r.setRowHeight(n.height,n.estimated)}r.setRowTop(t),r.setRowIndex(o),t+=r.rowHeight}return i}clearRowTopAndRowIndex(e,t){const i=e.isActive(),s=r=>{r&&null!=r.id&&!t.has(r.id)&&r.clearRowTopAndRowIndex()},o=r=>{s(r),s(r.detailNode),s(r.sibling),r.hasChildren()&&r.childrenAfterGroup&&(i&&-1!=r.level&&!r.expanded||r.childrenAfterGroup.forEach(o))};o(this.rootNode)}ensureRowsAtPixel(e,t,i=0){const s=this.getRowIndexAtPixel(t),o=this.getRow(s),r=!this.gridOptionsService.get("suppressAnimationFrame");return o!==e[0]&&(e.forEach(n=>{H.removeFromArray(this.rootNode.allLeafChildren,n)}),e.forEach((n,l)=>{H.insertIntoArray(this.rootNode.allLeafChildren,n,Math.max(s+i,0)+l)}),this.refreshModel({step:"group",keepRenderedRows:!0,keepEditingRows:!0,animate:r}),!0)}highlightRowAtPixel(e,t){const i=null!=t?this.getRowIndexAtPixel(t):null,s=null!=i?this.getRow(i):null;if(!s||!e||s===e||null==t)return void(this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null));const o=this.getHighlightPosition(t,s);this.lastHighlightedRow&&this.lastHighlightedRow!==s&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),s.setHighlighted(o),this.lastHighlightedRow=s}getHighlightPosition(e,t){if(!t){const o=this.getRowIndexAtPixel(e);
1if(!(t=this.getRow(o||0)))return 1}const{rowTop:i,rowHeight:s}=t;return e-i<s/2?0:1}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const t=this.rootNode.childrenAfterAggFilter;return t?t.length:0}getTopLevelRowDisplayedIndex(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let i=this.rootNode.childrenAfterSort[e];if(this.gridOptionsService.get("groupHideOpenParents"))for(;i.expanded&&i.childrenAfterSort&&i.childrenAfterSort.length>0;)i=i.childrenAfterSort[0];return i.rowIndex}getRowBounds(e){if(H.missing(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=this.gridOptionsService.isAnimateRows();this.refreshModel({step:"map",keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=this.gridOptionsService.isAnimateRows(),s=0===e.columns.length||e.columns.some(o=>o.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:s,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=this.gridOptionsService.isAnimateRows();this.refreshModel({step:"sort",keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:"pivot"}):this.refreshModel({step:"aggregate"})}createChangePath(e){const t=H.missingOrEmpty(e),i=new ur(!1,this.rootNode);return(t||this.gridOptionsService.get("treeData"))&&i.setInactive(),i}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gridOptionsService.get("suppressModelUpdateAfterUpdateTransaction")||null==e.rowNodeTransactions)return!1;const t=e.rowNodeTransactions.filter(s=>null!=s.add&&s.add.length>0||null!=s.remove&&s.remove.length>0);return null==t||0==t.length}buildRefreshModelParams(e){let t="group";const i={everything:"group",group:"group",filter:"filter",map:"map",aggregate:"aggregate",sort:"sort",pivot:"pivot"};if(H.exists(e)&&(t=i[e]),!H.missing(t))return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:!this.gridOptionsService.get("suppressAnimationFrame")};console.error(`AG Grid: invalid step ${e}, available steps are ${Object.keys(i).join(", ")}`)}refreshModel(e){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.shouldRowModelIgnoreRefresh())return;let t="object"==typeof e&&"step"in e?e:this.buildRefreshModelParams(e);if(!t||this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const i=this.createChangePath(t.rowNodeTransactions);switch(this.isRefreshingModel=!0,t.step){case"group":this.doRowGrouping(t.rowNodeTransactions,t.rowNodeOrder,i,!!t.afterColumnsChanged);case"filter":this.doFilter(i);case"pivot":this.doPivot(i);case"aggregate":this.doAggregate(i);case"filter_aggregates":this.doFilterAggregates(i);case"sort":this.doSort(t.rowNodeTransactions,i);case"map":this.doRowsToDisplay()}const s=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(i,s),this.isRefreshingModel=!1,this.eventService.dispatchEvent({type:p.EVENT_MODEL_UPDATED,animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack})}isEmpty(){const e=H.missing(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return H.missing(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return H.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let i=!t,s=!1;const o=[],r=this.gridOptionsService.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort(n=>{if(!s)if(i&&(n===t||n===e)&&(s=!0,n.group&&r))o.push(...n.allLeafChildren);else{if(!i){if(n!==t&&n!==e)return;i=!0}n.group&&r||o.push(n)}}),o}setDatasource(e){console.error("AG Grid: should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||0===this.rowsToDisplay.length)return-1;let t=0,i=this.rowsToDisplay.length-1;if(e<=0)return 0;if(H.last(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let o=-1,r=-1;for(;;){const n=Math.floor((t+i)/2),l=this.rowsToDisplay[n];if(this.isRowInPixel(l,e)||(l.rowTop<e?t=n+1:l.rowTop>e&&(i=n-1),o===t&&r===i))return n;o=t,r=i}}isRowInPixel(e,t){return e.rowTop<=t&&e.rowTop+e.rowHeight>t}forEachLeafNode(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEac
1h((t,i)=>e(t,i))}forEachNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:e,recursionType:0,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:1,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:2,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:3,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){var t;const{nodes:i,callback:s,recursionType:o,includeFooterNodes:r}=e;let{index:n}=e;for(let c=0;c<i.length;c++){const h=i[c];if(s(h,n++),h.hasChildren()&&!h.footer){let g=null;switch(o){case 0:g=h.childrenAfterGroup;break;case 1:g=h.childrenAfterAggFilter;break;case 2:g=h.childrenAfterSort;break;case 3:g=h.leafGroup?null:h.childrenAfterSort}g&&(n=this.recursivelyWalkNodesAndCallback({nodes:[...g],callback:s,recursionType:o,index:n,includeFooterNodes:r}))}}const l=null==(t=i[0])?void 0:t.parent;if(!r||!l)return n;if(l===this.rootNode){if(!this.gridOptionsService.get("groupIncludeTotalFooter"))return n}else if(!this.gridOptionsService.getGroupIncludeFooter()({node:l}))return n;return l.createFooter(),s(l.sibling,n++),n}doAggregate(e){this.aggregationStage&&this.aggregationStage.execute({rowNode:this.rootNode,changedPath:e})}doFilterAggregates(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(e){const t=this.gridOptionsService.get("treeData"),i=this.columnModel.isPivotActive(),s=n=>{n&&n.forEach(l=>{const a=()=>{l.expanded=e,s(l.childrenAfterGroup)};t?H.exists(l.childrenAfterGroup)&&a():i?!l.leafGroup&&a():l.group&&a()})};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:"map"}),this.eventService.dispatchEvent({type:p.EVENT_EXPAND_COLLAPSE_ALL,source:e?"expandAll":"collapseAll"})}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,i,s){this.groupStage?(this.groupStage.execute(e?{rowNode:this.rootNode,rowNodeTransactions:e,rowNodeOrder:t,changedPath:i}:{rowNode:this.rootNode,changedPath:i,afterColumnsChanged:s}),this.gridOptionsService.get("groupSelectsChildren")&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",i)&&this.eventService.dispatchEvent({type:p.EVENT_SELECTION_CHANGED,source:"rowGroupChanged"})):(this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren()),this.nodeManager.isRowCountReady()&&(this.rowCountReady=!0,this.eventService.dispatchEventOnce({type:p.EVENT_ROW_COUNT_READY}))}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){this.pivotStage&&this.pivotStage.execute({rowNode:this.rootNode,changedPath:e})}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(e){if("string"==typeof e&&0==e.indexOf(B.ID_PREFIX_ROW_GROUP)){let i;return this.forEachNode(s=>{s.id===e&&(i=s)}),i}return this.nodeManager.getRowNode(e)}setRowData(e){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(e),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){this.eventService.dispatchEvent({type:p.EVENT_ROW_DATA_UPDATED}),this.refreshModel({step:"group",newData:!0})}batchUpdateRowData(e,t){if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];const i=this.gridOptionsService.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.executeBatchUpdateRowData()},i)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const e=[],t=[];let i=!1;this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEac
1h(s=>{const o=this.nodeManager.updateRowData(s.rowDataTransaction,void 0);t.push(o),s.callback&&e.push(s.callback.bind(null,o)),"number"==typeof s.rowDataTransaction.addIndex&&(i=!0)}),this.commonUpdateRowData(t,void 0,i),e.length>0&&window.setTimeout(()=>{e.forEach(s=>s())},0),t.length>0&&this.eventService.dispatchEvent({type:p.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:t}),this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e,t){this.valueCache.onDataChanged();const i=this.nodeManager.updateRowData(e,t);return this.commonUpdateRowData([i],t,"number"==typeof e.addIndex),i}createRowNodeOrder(){if(this.gridOptionsService.get("suppressMaintainUnsortedOrder"))return;const t={};if(this.rootNode&&this.rootNode.allLeafChildren)for(let i=0;i<this.rootNode.allLeafChildren.length;i++)t[this.rootNode.allLeafChildren[i].id]=i;return t}commonUpdateRowData(e,t,i){if(!this.hasStarted)return;const s=!this.gridOptionsService.get("suppressAnimationFrame");i&&(t=this.createRowNodeOrder()),this.eventService.dispatchEvent({type:p.EVENT_ROW_DATA_UPDATED}),this.refreshModel({step:"group",rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const i=t.detailNode;i&&i.setRowHeight(i.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0}),e}onGridStylesChanges(){this.columnModel.isAutoRowHeightActive()||this.resetRowHeights()}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}};u([f("columnModel")],Re.prototype,"columnModel",2),u([f("selectionService")],Re.prototype,"selectionService",2),u([f("filterManager")],Re.prototype,"filterManager",2),u([f("valueCache")],Re.prototype,"valueCache",2),u([f("beans")],Re.prototype,"beans",2),u([f("filterStage")],Re.prototype,"filterStage",2),u([f("sortStage")],Re.prototype,"sortStage",2),u([f("flattenStage")],Re.prototype,"flattenStage",2),u([z("groupStage")],Re.prototype,"groupStage",2),u([z("aggregationStage")],Re.prototype,"aggregationStage",2),u([z("pivotStage")],Re.prototype,"pivotStage",2),u([z("filterAggregatesStage")],Re.prototype,"filterAggregatesStage",2),u([b],Re.prototype,"init",1),Re=u([O("rowModel")],Re);var Sr=class extends T{execute(e){const{changedPath:t}=e;this.filterService.filter(t)}};u([f("filterService")],Sr.prototype,"filterService",2),Sr=u([O("filterStage")],Sr);var ao=class extends T{execute(e){const t=this.sortController.getSortOptions(),i=H.exists(t)&&t.length>0,s=i&&H.exists(e.rowNodeTransactions)&&this.gridOptionsService.get("deltaSort"),o=t.some(r=>this.gridOptionsService.isColumnsSortingCoupledToGroup()?r.column.isPrimary()&&r.column.isRowGroupActive():!!r.column.getColDef().showRowGroup);this.sortService.sort(t,i,s,e.rowNodeTransactions,e.changedPath,o)}};u([f("sortService")],ao.prototype,"sortService",2),u([f("sortController")],ao.prototype,"sortController",2),ao=u([O("sortStage")],ao);var uo=class extends T{execute(e){const t=e.rowNode,i=[],s=this.columnModel.isPivotMode(),o=s&&t.leafGroup,r=o?[t]:t.childrenAfterSort,n=this.getFlattenDetails();return this.recursivelyAddToRowsToDisplay(n,r,i,s,0),!o&&i.length>0&&n.groupIncludeTotalFooter&&(t.createFooter(),this.addRowNodeToRowsToDisplay(n,t.sibling,i,0)),i}getFlattenDetails(){const e=this.gridOptionsService.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gridOptionsService.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:this.gridOptionsService.isGroupMultiAutoColumn(),hideOpenParents:this.gridOptionsService.get("groupHideOpenParents"),groupIncludeTotalFooter:this.gridOptionsService.get("groupIncludeTotalFooter"),getGroupIncludeFooter:this.gridOptionsService.getGroupIncludeFooter()}}recursivelyAddToRowsToDisplay(e,t,i,s,o){if(!H.missingOrEmpty(t))for(let r=0;r<t.length;r++){const n=t[r],l=n.hasChildren(),c=e.groupRemoveSingleChildren&&l&&1===n.childrenAfterGroup.length,h=e.groupRemoveLowestSingleChildren&&l&&n.leafGroup&&1===n.childrenAfterGroup.length;if(!(s&&!l)&&!(e.hideOpenParents&&n.expanded&&!n.master&&(!s||!n.leafGroup))&&!c&&!h&&this.addRowNodeToRowsToDisplay(e,n,i,o),!s||!n.leafGroup)if(l){const v=c||h;
1if(n.expanded||v){const E=v?o:o+1;this.recursivelyAddToRowsToDisplay(e,n.childrenAfterSort,i,s,E),e.getGroupIncludeFooter({node:n})?(n.createFooter(),this.addRowNodeToRowsToDisplay(e,n.sibling,i,E)):n.destroyFooter()}}else if(n.master&&n.expanded){const v=this.createDetailNode(n);this.addRowNodeToRowsToDisplay(e,v,i,o)}}}addRowNodeToRowsToDisplay(e,t,i,s){i.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:s)}createDetailNode(e){if(H.exists(e.detailNode))return e.detailNode;const t=new B(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,H.exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}};u([f("columnModel")],uo.prototype,"columnModel",2),u([f("beans")],uo.prototype,"beans",2),uo=u([O("flattenStage")],uo);var co=class extends T{sort(e,t,i,s,o,r){const n=this.gridOptionsService.get("groupMaintainOrder"),l=this.columnModel.getAllGridColumns().some(m=>m.isRowGroupActive());let a={};i&&s&&(a=this.calculateDirtyNodes(s));const c=this.columnModel.isPivotMode(),h=this.gridOptionsService.getCallback("postSortRows");o&&o.forEachChangedNodeDepthFirst(m=>{var C;this.pullDownGroupDataForHideOpenParents(m.childrenAfterAggFilter,!0);const v=c&&m.leafGroup;if(n&&l&&!m.leafGroup&&!r){const S=null==(C=this.columnModel.getRowGroupColumns())?void 0:C[m.level+1],D=null===S?.getSort(),y=m.childrenAfterAggFilter.slice(0);if(m.childrenAfterSort&&!D){const P={};m.childrenAfterSort.forEach((F,M)=>{P[F.id]=M}),y.sort((F,M)=>{var I,_;return(null!=(I=P[F.id])?I:0)-(null!=(_=P[M.id])?_:0)})}m.childrenAfterSort=y}else m.childrenAfterSort=!t||v?m.childrenAfterAggFilter.slice(0):i?this.doDeltaSort(m,a,o,e):this.rowNodeSorter.doFullSort(m.childrenAfterAggFilter,e);m.sibling&&(m.sibling.childrenAfterSort=m.childrenAfterSort),this.updateChildIndexes(m),h&&h({nodes:m.childrenAfterSort})}),this.updateGroupDataForHideOpenParents(o)}calculateDirtyNodes(e){const t={},i=s=>{s&&s.forEach(o=>t[o.id]=!0)};return e&&e.forEach(s=>{i(s.add),i(s.update),i(s.remove)}),t}doDeltaSort(e,t,i,s){const o=e.childrenAfterAggFilter,r=e.childrenAfterSort;if(!r)return this.rowNodeSorter.doFullSort(o,s);const n={},l=[];o.forEach(g=>{t[g.id]||!i.canSkip(g)?l.push(g):n[g.id]=!0});const a=r.filter(g=>n[g.id]),c=(g,m)=>({currentPos:m,rowNode:g}),h=l.map(c).sort((g,m)=>this.rowNodeSorter.compareRowNodes(s,g,m));return this.mergeSortedArrays(s,h,a.map(c)).map(({rowNode:g})=>g)}mergeSortedArrays(e,t,i){const s=[];let o=0,r=0;for(;o<t.length&&r<i.length;)this.rowNodeSorter.compareRowNodes(e,t[o],i[r])<0?s.push(t[o++]):s.push(i[r++]);for(;o<t.length;)s.push(t[o++]);for(;r<i.length;)s.push(i[r++]);return s}updateChildIndexes(e){if(H.missing(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let i=0;i<t.length;i++){const s=t[i],r=i===e.childrenAfterSort.length-1;s.setFirstChild(0===i),s.setLastChild(r),s.setChildIndex(i)}}updateGroupDataForHideOpenParents(e){if(!this.gridOptionsService.get("groupHideOpenParents"))return;if(this.gridOptionsService.get("treeData"))return H.warnOnce("The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them."),!1;const t=i=>{this.pullDownGroupDataForHideOpenParents(i.childrenAfterSort,!1),i.childrenAfterSort.forEach(s=>{s.hasChildren()&&t(s)})};e&&e.executeFromRootNode(i=>t(i))}pullDownGroupDataForHideOpenParents(e,t){!this.gridOptionsService.get("groupHideOpenParents")||H.missing(e)||e.forEach(i=>{this.columnModel.getGroupDisplayColumns().forEach(o=>{const r=o.getColDef().showRowGroup;if("string"!=typeof r)return void console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");const l=this.columnModel.getPrimaryColumn(r);if(l!==i.rowGroupColumn)if(t)i.setGroupValue(o.getId(),void 0);else{const c=i.getFirstChildOfFirstChild(l);c&&i.setGroupValue(o.getId(),c.key)}})})}};u([f("columnModel")],co.prototype,"columnModel",2),u([f("rowNodeSorter")],co.prototype,"rowNodeSorter",2),co=u([O("sortService")],co);var Er=class extends T{filter(e){const t=this.filterManager.isChildFilterPresent();this.filterNodes(t,e)}filterNodes(e,t){const i=(s,o)=>{s.childrenAfterFilter=s.hasChildren()&&e&&!o?s.childrenAfterGroup.filter(r=>{const n=r.childrenAfterFilter&&r.childrenAfterFilter.length>0,l=r.data&&this.filterManager.doesRowPassFilter({rowNode:r});return n||l}):s.childrenAfterGroup,s.sibling&&(s.sibling.childrenAfterFilter=s.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const s=(r,n)=>{if(r.childrenAfterGroup)for(let l=0;l<r.childrenAfterGroup.length;l++){const a=r.childrenAfterGroup[l],c=n||this.filterManager.doesRowPassFilter({rowNode:a});a.childrenAfterGroup?s(r.childrenAfterGroup[l],c):i(a,c)}i(r,n)};t.executeFromRootNode(r=>s(r,!1))}else t.forEachChangedNodeDepthFirst(o=>i(o,!1),!0)}doingTreeDataFiltering(){return this.gridOptionsService.get("treeData")&&!this.gridOptionsService.get("excludeChildrenWhenTreeDataFiltering")}};u([f("filterManager")],Er.prototype,"filterManager",2),Er=u([O("filterService")],Er);var Fi=class extends T{postConstruct(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",()=>this.onRowDataUpdated()))}isActive(){const e=this.gridOptionsService.exists("getRowId");return!this.gridOptionsService.get("resetRowDataOnUpdate")&&e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const[i,s]=t;this.clientSideRowModel.updateRowData(i,s)}createTransactionForRowData(e){if(H.missing(this.clientSideRowModel))return void console.error("AG Grid: ImmutableService only works with ClientSideRowModel");const t=this.gridOptionsService.getCallback("getRowId");if(null==t)return void console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");const i={remove:[],update:[],add:[]},s=this.clientSideRowModel.getCopyOfNodesMap(),r=this.gridOptionsService.get("suppressMaintainUnsortedOrder")?void 0:{};return H.exists(e)&&e.forEach((n,l)=>{const a=t({data:n,level:0}),c=s[a];r&&(r[a]=l),c?(c.data!==n&&i.update.push(n),s[a]=void 0):i.add.push(n)}
1),H.iterateObject(s,(n,l)=>{l&&i.remove.push(l.data)}),[i,r]}onRowDataUpdated(){const e=this.gridOptionsService.get("rowData");e&&(this.isActive()?this.setRowData(e):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(e)))}};u([f("rowModel")],Fi.prototype,"rowModel",2),u([f("rowRenderer")],Fi.prototype,"rowRenderer",2),u([f("selectionService")],Fi.prototype,"selectionService",2),u([b],Fi.prototype,"postConstruct",1);var ef={version:"31.2.0",moduleName:"@ag-grid-community/client-side-row-model",rowModel:"clientSide",beans:[Re,Sr,ao,uo,co,Er,Fi=u([O("immutableService")],Fi)]},tf=Object.defineProperty,sf=Object.getOwnPropertyDescriptor,Ie=(e,t,i,s)=>{for(var n,o=s>1?void 0:s?sf(t,i):t,r=e.length-1;r>=0;r--)(n=e[r])&&(o=(s?n(t,i,o):n(o))||o);return s&&o&&tf(t,i,o),o},ho=class extends el{constructor(e,t,i){super(e),this.parentCache=t,this.params=i,this.startRow=e*i.blockSize,this.endRow=this.startRow+i.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,i){H.exists(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();H.missing(this.params.datasource.getRows)?console.warn("AG Grid: datasource is missing getRows method"):window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gridOptionsService.getGridCommonParams().context}}forEachNode(e,t,i){this.rowNodes.forEach((s,o)=>{this.startRow+o<i&&e(s,t.next())})}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){return t||(this.lastAccessed=this.params.lastAccessedSequence.next()),this.rowNodes[e-this.startRow]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,i=new B(this.beans);i.setRowHeight(this.params.rowHeight),i.uiLevel=0,i.setRowIndex(t),i.setRowTop(this.params.rowHeight*t),this.rowNodes.push(i)}}processServerResult(e){this.rowNodes.forEach((i,s)=>{const o=e.rowData?e.rowData[s]:void 0;!i.id&&i.alreadyRendered&&o&&(this.rowNodes[s]=new B(this.beans),this.rowNodes[s].setRowIndex(i.rowIndex),this.rowNodes[s].setRowTop(i.rowTop),this.rowNodes[s].setRowHeight(i.rowHeight),i.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[s],o,this.startRow+s)}),this.parentCache.pageLoaded(this,null!=e.rowCount&&e.rowCount>=0?e.rowCount:void 0)}destroyRowNodes(){this.rowNodes.forEach(e=>{e.clearRowTopAndRowIndex()})}};Ie([f("beans")],ho.prototype,"beans",2),Ie([b],ho.prototype,"postConstruct",1),Ie([Ae],ho.prototype,"destroyRowNodes",1);var t,cs=class Wu extends T{constructor(t){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=t.initialRowCount,this.params=t}setBeans(t){this.logger=t.create("InfiniteCache")}getRow(t,i=!1){const s=Math.floor(t/this.params.blockSize);let o=this.blocks[s];if(!o){if(i)return;o=this.createBlock(s)}return o.getRow(t)}createBlock(t){const i=this.createBean(new ho(t,this,this.params));return this.blocks[i.getId()]=i,this.blockCount++,this.purgeBlocksIfNeeded(i),this.params.rowNodeBlockLoader.addBlock(i),i}refreshCache(){0!=this.blockCount?(this.getBlocksInOrder().forEach(i=>i.setStateWaitingToLoad()),this.params.rowNodeBlockLoader.checkBlockToLoad()):this.purgeCache()}destroyAllBlocks(){this.getBlocksInOrder().forEach(t=>this.destroyBlock(t))}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(t,i){this.isAlive()&&(this.logger.log(`onPageLoaded: page = ${t.getId()}, lastRow = ${i}`),this.checkRowCount(t,i),this.onCacheUpdated())}purgeBlocksIfNeeded(t){const i=this.getBlocksInOrder().filter(l=>l!=t);i.sort((l,a)=>a.getLastAccessed()-l.getLastAccessed());const o=this.params.maxBlocksInCache>0,r=o?this.params.maxBlocksInCache-1:null,n=Wu.MAX_EMPTY_BLOCKS_TO_KEEP-1;
1i.forEach((l,a)=>{if(l.getState()===ho.STATE_WAITING_TO_LOAD&&a>=n||o&&a>=r){if(this.isBlockCurrentlyDisplayed(l)||this.isBlockFocused(l))return;this.removeBlockFromCache(l)}})}isBlockFocused(t){const i=this.focusService.getFocusCellToUseAfterRefresh();if(!i||null!=i.rowPinned)return!1;const s=t.getStartRow(),o=t.getEndRow();return i.rowIndex>=s&&i.rowIndex<o}isBlockCurrentlyDisplayed(t){const i=t.getStartRow(),s=t.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(i,s)}removeBlockFromCache(t){t&&this.destroyBlock(t)}checkRowCount(t,i){if("number"==typeof i&&i>=0)this.rowCount=i,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const o=(t.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<o&&(this.rowCount=o)}}setRowCount(t,i){this.rowCount=t,H.exists(i)&&(this.lastRowIndexKnown=i),this.lastRowIndexKnown||this.rowCount%this.params.blockSize==0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(t){const i=new Bi;this.getBlocksInOrder().forEach(s=>s.forEachNode(t,i,this.rowCount))}getBlocksInOrder(){return H.getAllValuesInObject(this.blocks).sort((s,o)=>s.getId()-o.getId())}destroyBlock(t){delete this.blocks[t.getId()],this.destroyBean(t),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(t)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventService.dispatchEvent({type:p.EVENT_STORE_UPDATED}))}destroyAllBlocksPastVirtualRowCount(){const t=[];this.getBlocksInOrder().forEach(i=>{i.getId()*this.params.blockSize>=this.rowCount&&t.push(i)}),t.length>0&&t.forEach(i=>this.destroyBlock(i))}purgeCache(){this.getBlocksInOrder().forEach(t=>this.removeBlockFromCache(t)),this.lastRowIndexKnown=!1,0===this.rowCount&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(t,i){const s=[];let o=-1,r=!1;const n=new Bi;H.missing(t)&&(r=!0);let l=!1;return this.getBlocksInOrder().forEach(c=>{if(!l){if(r&&o+1!==c.getId())return void(l=!0);o=c.getId(),c.forEachNode(h=>{const g=h===t||h===i;(r||g)&&s.push(h),g&&(r=!r)},n,this.rowCount)}}),l||r?[]:s}};cs.MAX_EMPTY_BLOCKS_TO_KEEP=2,Ie([f("rowRenderer")],cs.prototype,"rowRenderer",2),Ie([f("focusService")],cs.prototype,"focusService",2),Ie([(0,t=qe("loggerFactory"),(i,s)=>t(i,s,0))],cs.prototype,"setBeans",1),Ie([Ae],cs.prototype,"destroyAllBlocks",1);var rf=cs,wt=class extends T{getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(e,t,i,s){return!1}init(){this.gridOptionsService.isRowModelType("infinite")&&(this.rowHeight=this.gridOptionsService.getRowHeightAsNumber(),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache()),this.verifyProps())}verifyProps(){this.gridOptionsService.exists("initialGroupOrderComparator")&&H.warnOnce("initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side")}start(){this.setDatasource(this.gridOptionsService.get("datasource"))}destroyDatasource(){this.datasource&&(this.getContext().destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedListener(this.eventService,p.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,p.EVENT_STORE_UPDATED,this.onCacheUpdated.bind(this)),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gridOptionsService.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=this.gridOptionsService.getRowHeightAsNumber(),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let e;e=!this.cacheParams||this.isSortModelDifferent(),e&&this.reset()}isSortModelDifferent(){return!H.jsonEquals(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){this.datasource&&(null!=this.gridOptionsService.getCallback("getRowId")||this.selectionService.reset("rowDataChanged"),this.resetCache())}createModelUpdatedEvent(){return{type:p.EVENT_MODEL_UPDATED,newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1}}resetCache(){this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:this.filterManager.getFilterModel(),sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.gridOptionsService.get("infiniteInitialRowCount"),maxBlocksInCache:this.gridOptionsService.get("maxBlocksInCache"),rowHeight:this.gridOptionsService.getRowHeightAsNumber(),overflowSize:this.gridOptionsService.get("
1cacheOverflowSize"),blockSize:this.gridOptionsService.get("cacheBlockSize"),lastAccessedSequence:new Bi},this.infiniteCache=this.createBean(new rf(this.cacheParams)),this.eventService.dispatchEventOnce({type:p.EVENT_ROW_COUNT_READY});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}updateRowHeights(){this.forEachNode(t=>{t.setRowHeight(this.rowHeight),t.setRowTop(this.rowHeight*t.rowIndex)});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(0!==this.rowHeight){const t=Math.floor(e/this.rowHeight),i=this.getRowCount()-1;return t>i?i:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return!!this.infiniteCache&&this.infiniteCache.isLastRowIndexKnown()}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};Ie([f("filterManager")],wt.prototype,"filterManager",2),Ie([f("sortController")],wt.prototype,"sortController",2),Ie([f("selectionService")],wt.prototype,"selectionService",2),Ie([f("rowRenderer")],wt.prototype,"rowRenderer",2),Ie([f("rowNodeBlockLoader")],wt.prototype,"rowNodeBlockLoader",2),Ie([b],wt.prototype,"init",1),Ie([Ae],wt.prototype,"destroyDatasource",1);var lf={version:"31.2.0",moduleName:"@ag-grid-community/infinite-row-model",rowModel:"infinite",beans:[wt=Ie([O("rowModel")],wt)]},Xd=Object.defineProperty,af=Object.defineProperties,df=Object.getOwnPropertyDescriptor,uf=Object.getOwnPropertyDescriptors,Zd=Object.getOwnPropertySymbols,cf=Object.prototype.hasOwnProperty,hf=Object.prototype.propertyIsEnumerable,Jd=(e,t,i)=>t in e?Xd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,eu=(e,t)=>{for(var i in t||(t={}))cf.call(t,i)&&Jd(e,i,t[i]);if(Zd)for(var i of Zd(t))hf.call(t,i)&&Jd(e,i,t[i]);return e},tu=(e,t)=>af(e,uf(t)),De=(e,t,i,s)=>{for(var n,o=s>1?void 0:s?df(t,i):t,r=e.length-1;r>=0;r--)(n=e[r])&&(o=(s?n(t,i,o):n(o))||o);return s&&o&&Xd(t,i,o),o},po=(e,t,i)=>new Promise((s,o)=>{var r=a=>{try{l(i.next(a))}catch(c){o(c)}},n=a=>{try{l(i.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(r,n);l((i=i.apply(e,t)).next())}),pf=class{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return(null==e||!e.length)&&(e=this.getDefaultFileName()),-1===e.indexOf(".")?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},gf=class{constructor(e){this.groupColumns=[];const{columnModel:t,valueService:i,gridOptionsService:s,valueFormatterService:o,valueParserService:r,processCellCallback:n,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:c}=e;this.columnModel=t,this.valueService=i,this.gridOptionsService=s,this.valueFormatterService=o,this.valueParserService=r,this.processCellCallback=n,this.processHeaderCallback=l,this.processGroupHeaderCallback=a,this.processRowGroupCallback=c}prepare(e){this.groupColumns=e.filter(t=>!!t.getColDef().showRowGroup)}extractHeaderValue(e){return this.getHeaderName(this.processHeaderCallback,e)??""}extractRowCellValue(e,t,i,s,o){const n=this.gridOptionsService.get("groupHideOpenParents")&&!o.footer||!this.shouldRenderGroupSummaryCell(o,e,t)?this.valueService.getValue(e,o):this.createValueForGroupNode(e,o);return this.processCell({accumulatedRowIndex:i,rowNode:o,column:e,value:n,processCellCallback:this.processCellCallback,type:s})}shouldRenderGroupSummaryCell(e,t,i){var s;if(!e||!e.group)return!1;if(-1!==this.groupColumns.indexOf(t)){if(null!=(null==(s=e.groupData)?void 0:s[t.getId()])||this.gridOptionsService.isRowModelType("serverSide")&&e.group)return!0;
1if(e.footer&&-1===e.level){const l=t.getColDef();return null==l||!0===l.showRowGroup||l.showRowGroup===this.columnModel.getRowGroupColumns()[0].getId()}}const n=this.gridOptionsService.isGroupUseEntireRow(this.columnModel.isPivotMode());return 0===i&&n}getHeaderName(e,t){return e?e(this.gridOptionsService.addGridCommonParams({column:t})):this.columnModel.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gridOptionsService.addGridCommonParams({column:e,node:t}));const i=this.gridOptionsService.get("treeData"),s=this.gridOptionsService.get("suppressGroupMaintainValueType"),o=a=>{var c,h;if(i||s)return a.key;const g=null==(c=a.groupData)?void 0:c[e.getId()];return g&&a.rowGroupColumn&&!1!==a.rowGroupColumn.getColDef().useValueFormatterForExport&&null!=(h=this.valueFormatterService.formatValue(a.rowGroupColumn,a,g))?h:g},r=t.footer,n=[o(t)];if(!this.gridOptionsService.isGroupMultiAutoColumn())for(;t.parent;)n.push(o(t=t.parent));const l=n.reverse().join(" -> ");return r?`Total ${l}`:l}processCell(e){var t;const{accumulatedRowIndex:i,rowNode:s,column:o,value:r,processCellCallback:n,type:l}=e;return n?{value:null!=(t=n(this.gridOptionsService.addGridCommonParams({accumulatedRowIndex:i,column:o,node:s,value:r,type:l,parseValue:a=>this.valueParserService.parseValue(o,s,a,this.valueService.getValue(o,s)),formatValue:a=>{var c;return null!=(c=this.valueFormatterService.formatValue(o,s,a))?c:a}})))?t:""}:!1!==o.getColDef().useValueFormatterForExport?{value:r??"",valueFormatted:this.valueFormatterService.formatValue(o,s,r)}:{value:r??""}}},ff=class{static download(e,t){const i=document.defaultView||window;if(!i)return void console.warn("AG Grid: There is no `window` associated with the current `document`");const s=document.createElement("a"),o=i.URL.createObjectURL(t);s.setAttribute("href",o),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:i})),document.body.removeChild(s),i.setTimeout(()=>{i.URL.revokeObjectURL(o)},0)}},mf=class extends gf{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:i}=e;this.suppressQuotes=t,this.columnSeparator=i}addCustomContent(e){e&&("string"==typeof e?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,"\r\n"),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((i,s)=>{0!==s&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(i.data.value||""),i.mergeAcross&&this.appendEmptyCells(i.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,i,s){0!=i&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,i){var s;0!=t&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",i);this.result+=this.putInQuotes(null!=(s=o.valueFormatted)?s:o.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(null==e)return'""';let t;return"string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():(console.warn("AG Grid: unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1}},St=class extends pf{postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gridOptionsService:this.gridOptionsService})}getMergedParams(e){const t=this.gridOptionsService.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration.");const t=this.getMergedParams(e),i=this.getData(t),s=new Blob(["\ufeff",i],{type:"text/plain"}),o="function"==typeof t.fileName?t.fileName(this.gridOptionsService.getGridCommonParams()):t.fileName;ff.download(this.getFileName(o),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const i=t?Object.assign({},e):this.getMergedParams(e);return this.getData(i)}getDefaultFileExtension(){return"csv"}
1createSerializingSession(e){const{columnModel:t,valueService:i,gridOptionsService:s,valueFormatterService:o,valueParserService:r}=this,{processCellCallback:n,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:c,suppressQuotes:h,columnSeparator:g}=e;return new mf({columnModel:t,valueService:i,gridOptionsService:s,valueFormatterService:o,valueParserService:r,processCellCallback:n||void 0,processHeaderCallback:l||void 0,processGroupHeaderCallback:a||void 0,processRowGroupCallback:c||void 0,suppressQuotes:h||!1,columnSeparator:g||","})}isExportSuppressed(){return this.gridOptionsService.get("suppressCsvExport")}};De([f("columnModel")],St.prototype,"columnModel",2),De([f("valueService")],St.prototype,"valueService",2),De([f("gridSerializer")],St.prototype,"gridSerializer",2),De([f("gridOptionsService")],St.prototype,"gridOptionsService",2),De([f("valueFormatterService")],St.prototype,"valueFormatterService",2),De([f("valueParserService")],St.prototype,"valueParserService",2),De([b],St.prototype,"postConstruct",1),St=De([O("csvCreator")],St);var Et=class extends T{serialize(e,t={}){const{allColumns:i,columnKeys:s,skipRowGroups:o}=t,r=this.getColumnsToExport(i,o,s);return H.compose(this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t))(e).parse()}processRow(e,t,i,s){const o=t.shouldRowBeSkipped||(()=>!1),r=this.gridOptionsService.get("groupRemoveSingleChildren"),n=this.gridOptionsService.get("groupRemoveLowestSingleChildren"),a=null!=t.rowPositions||!!t.onlySelected,c=this.gridOptionsService.get("groupHideOpenParents")&&!a,h=this.columnModel.isPivotMode()?s.leafGroup:!s.group,g=!!s.footer;if(!h&&!g&&(t.skipRowGroups||1===s.allChildrenCount&&(r||n&&s.leafGroup)||c)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&"top"===s.rowPinned||t.skipPinnedBottom&&"bottom"===s.rowPinned||-1===s.level&&!h&&!g||o(this.gridOptionsService.addGridCommonParams({node:s})))return;const D=e.onNewBodyRow(s);if(i.forEach((y,P)=>{D.onColumn(y,P,s)}),t.getCustomContentBelowRow){const y=t.getCustomContentBelowRow(this.gridOptionsService.addGridCommonParams({node:s}));y&&e.addCustomContent(y)}}appendContent(e){return t=>{const i=e.appendContent;return i&&t.addCustomContent(i),t}}prependContent(e){return t=>{const i=e.prependContent;return i&&t.addCustomContent(i),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return i=>{if(!e.skipColumnGroupHeaders){const s=new ta,o=this.displayedGroupCreator.createDisplayedGroups(t,s,null);this.recursivelyAddHeaderGroups(o,i,e.processGroupHeaderCallback)}return i}}exportHeaders(e,t){return i=>{if(!e.skipColumnHeaders){const s=i.onNewHeaderRow();t.forEach((o,r)=>{s.onColumn(o,r,void 0)})}return i}}processPinnedTopRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(o=>"top"===o.rowPinned).sort((o,r)=>o.rowIndex-r.rowIndex).map(o=>this.pinnedRowModel.getPinnedTopRow(o.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedTopRow(s),i}}processRows(e,t){return i=>{const s=this.rowModel,o=s.getType(),r="clientSide"===o,n="serverSide"===o,l=!r&&e.onlySelected,a=this.processRow.bind(this,i,e,t),{exportedRows:c="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(h=>null==h.rowPinned).sort((h,g)=>h.rowIndex-g.rowIndex).map(h=>s.getRow(h.rowIndex)).forEach(a);
1else if(this.columnModel.isPivotMode())r?s.forEachPivotNode(a,!0):n?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||l){const h=this.selectionService.getSelectedNodes();this.replicateSortedOrder(h),h.forEach(a)}else"all"===c?s.forEachNode(a):r||n?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return i}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),i=(s,o)=>{var r,n,l,a;return null!=s.rowIndex&&null!=o.rowIndex?s.rowIndex-o.rowIndex:s.level===o.level?(null==(r=s.parent)?void 0:r.id)===(null==(n=o.parent)?void 0:n.id)?this.rowNodeSorter.compareRowNodes(t,{rowNode:s,currentPos:null!=(l=s.rowIndex)?l:-1},{rowNode:o,currentPos:null!=(a=o.rowIndex)?a:-1}):i(s.parent,o.parent):s.level>o.level?i(s.parent,o):i(s,o.parent)};e.sort(i)}processPinnedBottomRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(o=>"bottom"===o.rowPinned).sort((o,r)=>o.rowIndex-r.rowIndex).map(o=>this.pinnedRowModel.getPinnedBottomRow(o.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedBottomRow(s),i}}getColumnsToExport(e=!1,t=!1,i){const s=this.columnModel.isPivotMode();if(i&&i.length)return this.columnModel.getGridColumns(i);const o=this.gridOptionsService.get("treeData");let r=[];return r=e&&!s?this.columnModel.getAllGridColumns():this.columnModel.getAllDisplayedColumns(),t&&!o&&(r=r.filter(n=>n.getColId()!==xi)),r}recursivelyAddHeaderGroups(e,t,i){const s=[];e.forEach(o=>
1{o.getChildren&&o.getChildren().forEach(n=>s.push(n))}),e.length>0&&e[0]instanceof he&&this.doAddHeaderHeader(t,e,i),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,i)}doAddHeaderHeader(e,t,i){const s=e.onNewHeaderGroupingRow();let o=0;t.forEach(r=>{const n=r;let l;l=i?i(this.gridOptionsService.addGridCommonParams({columnGroup:n})):this.columnModel.getDisplayNameForColumnGroup(n,"header");const a=n.getLeafColumns().reduce((c,h,g,m)=>{let C=H.last(c);return"open"===h.getColumnGroupShow()?(!C||null!=C[1])&&(C=[g],c.push(C)):C&&null==C[1]&&(C[1]=g-1),g===m.length-1&&C&&null==C[1]&&(C[1]=g),c},[]);s.onColumn(n,l||"",o++,n.getLeafColumns().length-1,a)})}};De([f("displayedGroupCreator")],Et.prototype,"displayedGroupCreator",2),De([f("columnModel")],Et.prototype,"columnModel",2),De([f("rowModel")],Et.prototype,"rowModel",2),De([f("pinnedRowModel")],Et.prototype,"pinnedRowModel",2),De([f("selectionService")],Et.prototype,"selectionService",2),De([f("rowNodeSorter")],Et.prototype,"rowNodeSorter",2),De([f("sortController")],Et.prototype,"sortController",2);var wf={version:"31.2.0",moduleName:"@ag-grid-community/csv-export",beans:[St,Et=De([O("gridSerializer")],Et)]};function Te(e,t){let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(255&e),e>>>=8;return i}var ou=e=>e.length?(e=>{if(!e.length)return 0;let t=-1,i=0,s=0,o=0;for(let r=0;r<e.length;r++)i=e[r],s=255&(t^i),o=yf[s],t=t>>>8^o;return-1^t})("string"==typeof e?(new TextEncoder).encode(e):e):0,yf=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),{utf8_encode:Tf}=H,bf=(e,t)=>po(void 0,null,function*(){const{content:i}=e,{size:s,content:o}=i?nu(i):{size:0,content:Uint8Array.from([])};let r,n,l=!1;if("file"===e.type&&o&&s>0){const h=yield(e=>po(void 0,null,function*(){const t=new Blob([e]),{size:i,content:s}=yield(e=>po(void 0,null,function*(){let t=0;const i=[],s=new WritableStream({write:n=>{i.push(n),t+=n.length}}),o=new ReadableStream({start:n=>{const l=new FileReader;l.onload=a=>{var c;null!=(c=a.target)&&c.result&&n.enqueue(a.target.result),n.close()},l.readAsArrayBuffer(e)}}),r=new window.CompressionStream("deflate-raw");return yield o.pipeThrough(r).pipeTo(s),{size:t,content:new Blob(i)}}))(t);return{size:i,content:new Uint8Array(yield s.arrayBuffer())}}))(o);r=h.content,n=h.size,l=!0}const c=ru(e,l,t,s,o,n);return tu(eu({},c),{content:r||o,isCompressed:l})}),Pf=(e,t)=>{const{content:i}=e,{content:s}=i?nu(i):{content:Uint8Array.from([])},o=ru(e,!1,t,s.length,s,void 0);return tu(eu({},o),{content:s,isCompressed:!1})},ru=(e,t,i,s,o,r)=>{const{content:n,path:l,created:a}=e,c=(e=>{let t=e.getHours();return t<<=6,t|=e.getMinutes(),t<<=5,t|=e.getSeconds()/2,t})(a),h=(e=>{let t=e.getFullYear()-1980;return t<<=4,t|=e.getMonth()+1,t<<=5,t|=e.getDate(),t})(a),g=ou(o),m=void 0!==r?r:s,C=Tf(l),v=C!==l;let E="";if(v){const P=Te(1,1)+Te(ou(C),4)+C;
1E="up"+Te(P.length,2)+P}const S="\x14\0"+(v?"\0\b":"\0\0")+Te(t?8:0,2)+Te(c,2)+Te(h,2)+Te(m?g:0,4)+Te(r??s,4)+Te(s,4)+Te(C.length,2)+Te(E.length,2),D="PK\x03\x04"+S+C+E,y="PK\x01\x02\x14\0"+S+"\0\0\0\0\0\0"+(n?"\0\0\0\0":"\x10\0\0\0")+Te(i,4)+C+E;return{localFileHeader:Uint8Array.from(D,P=>P.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(y,P=>P.charCodeAt(0))}},nu=e=>{let t;return t="string"==typeof e?(e=>{const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t})(atob(e.split(";base64,")[1])):e,{size:t.length,content:t}},lu=class{static addFolders(e){e.forEach(this.addFolder.bind(this))}static addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}static addFile(e,t,i=!1){this.files.push({path:e,created:new Date,content:i?t:(new TextEncoder).encode(t),isBase64:i,type:"file"})}static getZipFile(e="application/zip"){return po(this,null,function*(){const t=yield this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})})}static getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}static clearStream(){this.folders=[],this.files=[]}static packageFiles(e){let t=new Uint8Array(0),i=new Uint8Array(0),s=0,o=0;for(const l of e){const{localFileHeader:a,centralDirectoryHeader:c,content:h}=l,g=new Uint8Array(t.length+a.length);g.set(t),g.set(a,t.length),t=g;const m=new Uint8Array(t.length+h.length);m.set(t),m.set(h,t.length),t=m;const C=new Uint8Array(i.length+c.length);C.set(i),C.set(c,i.length),i=C,s+=a.length+h.length,o+=c.length}const r=((e,t,i)=>{const s="PK\x05\x06\0\0\0\0"+Te(e,2)+Te(e,2)+Te(t,4)+Te(i,4)+"\0\0";return Uint8Array.from(s,o=>o.charCodeAt(0))})(e.length,o,s),n=new Uint8Array(t.length+i.length+r.length);return n.set(t),n.set(i,t.length),n.set(r,t.length+i.length),n}static buildCompressedFileStream(){return po(this,null,function*(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const o=yield bf(s,i),{localFileHeader:r,content:n}=o;t.push(o),i+=r.length+n.length}return this.packageFiles(t)})}static buildFileStream(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const o=Pf(s,i),{localFileHeader:r,content:n}=o;t.push(o),i+=r.length+n.length}return this.packageFiles(t)}};lu.folders=[],lu.files=[],Y.__registerModules([ef,lf,wf],!1,void 0);let au=(()=>{class e extends Wd{constructor(i){super("angular"),this._ngZone=i,this.isRunningWithinTestZone=!1,this.wrapIncoming=(s,o)=>this.runOutside(s,o),this.wrapOutgoing=s=>this.runInsideAngular(s),this.isRunningWithinTestZone=window?.AG_GRID_UNDER_TEST??!!window?.Zone?.AsyncTestZoneSpec,this.runOutside=this._ngZone?this.isRunningWithinTestZone?(s,o)=>"resize-observer"===o?this._ngZone.runOutsideAngular(s):s():s=>this._ngZone.runOutsideAngular(s):s=>s()}get shouldWrapOutgoing(){return this._ngZone&&d.WW2.isInAngularZone()}isFrameworkComponent(i){if(!i)return!1;const s=i.prototype;return s&&"agInit"in s}runInsideAngular(i){return this._ngZone?this._ngZone.run(i):i()}runOutsideAngular(i,s){return this.runOutside(i,s)}}return e.\u0275fac=function(i){return new(i||e)(d.CoB(d.WW2))},e.\u0275prov=d.wxM({token:e,factory:e.\u0275fac}),e})(),du=(()=>{class e extends Qg{setViewContainerRef(i,s){this.viewContainerRef=i,this.angularFrameworkOverrides=s}createWrapper(i,s){let o=this.angularFrameworkOverrides,r=this,l=new class n extends Of{init(c){o.runInsideAngular(()=>{super.init(c),this._componentRef.changeDetectorRef.detectChanges()})}createComponent(){return o.runInsideAngular(()=>r.createComponent(i))}hasMethod(c){return null!=l.getFrameworkComponentInstance()[c]}callMethod(c,h){const g=this.getFrameworkComponentInstance();return o.runInsideAngular(()=>l.getFrameworkComponentInstance()[c].apply(g,h))}addMethod(c,h){l[c]=h}};return l}createComponent(i){return this.viewContainerRef.createComponent(i)}}return e.\u0275fac=(()=>{let t;return function(s){return(t||(t=d.otF(e)))(s||e)}})(),e.\u0275prov=d.wxM({token:e,factory:e.\u0275fac}),e})();class Of{init(t){this._params=t,this._componentRef=this.createComponent(),this._agAwareComponent=this._componentRef.instance,this._frameworkComponentInstance=this._componentRef.instance,this._eGui=this._componentRef.location.nativeElement,this._agAwareComponent.agInit(this._params)}getGui(){return this._eGui}getRootElement(){return this._eGui.firstChild}destroy(){this._frameworkComponentInstance&&"function"==typeof this._frameworkComponentInstance.destroy&&this._frameworkComponentInstance.destroy(),this._componentRef&&this._componentRef.destroy()}getFrameworkComponentInstance(){return this._frameworkComponentInstance}}let vl=(()=>
1{class e{constructor(i,s,o,r){this.viewContainerRef=s,this.angularFrameworkOverrides=o,this.frameworkComponentWrapper=r,this._initialised=!1,this._destroyed=!1,this._fullyReady=Ge.resolve(!0),this.statusBar=void 0,this.sideBar=void 0,this.suppressContextMenu=void 0,this.preventDefaultOnContextMenu=void 0,this.allowContextMenuWithControlKey=void 0,this.columnMenu=void 0,this.suppressMenuHide=void 0,this.enableBrowserTooltips=void 0,this.tooltipTrigger=void 0,this.tooltipShowDelay=void 0,this.tooltipHideDelay=void 0,this.tooltipMouseTrack=void 0,this.tooltipShowMode=void 0,this.tooltipInteraction=void 0,this.popupParent=void 0,this.copyHeadersToClipboard=void 0,this.copyGroupHeadersToClipboard=void 0,this.clipboardDelimiter=void 0,this.suppressCopyRowsToClipboard=void 0,this.suppressCopySingleCellRanges=void 0,this.suppressLastEmptyLineOnPaste=void 0,this.suppressClipboardPaste=void 0,this.suppressClipboardApi=void 0,this.suppressCutToClipboard=void 0,this.columnDefs=void 0,this.defaultColDef=void 0,this.defaultColGroupDef=void 0,this.columnTypes=void 0,this.dataTypeDefinitions=void 0,this.maintainColumnOrder=void 0,this.suppressFieldDotNotation=void 0,this.headerHeight=void 0,this.groupHeaderHeight=void 0,this.floatingFiltersHeight=void 0,this.pivotHeaderHeight=void 0,this.pivotGroupHeaderHeight=void 0,this.allowDragFromColumnsToolPanel=void 0,this.suppressMovableColumns=void 0,this.suppressColumnMoveAnimation=void 0,this.suppressDragLeaveHidesColumns=void 0,this.suppressRowGroupHidesColumns=void 0,this.colResizeDefault=void 0,this.suppressAutoSize=void 0,this.autoSizePadding=void 0,this.skipHeaderOnAutoSize=void 0,this.autoSizeStrategy=void 0,this.components=void 0,this.editType=void 0,this.singleClickEdit=void 0,this.suppressClickEdit=void 0,this.readOnlyEdit=void 0,this.stopEditingWhenCellsLoseFocus=void 0,this.enterMovesDown=void 0,this.enterMovesDownAfterEdit=void 0,this.enterNavigatesVertically=void 0,this.enterNavigatesVerticallyAfterEdit=void 0,this.enableCellEditingOnBackspace=void 0,this.undoRedoCellEditing=void 0,this.undoRedoCellEditingLimit=void 0,this.defaultCsvExportParams=void 0,this.suppressCsvExport=void 0,this.defaultExcelExportParams=void 0,this.suppressExcelExport=void 0,this.excelStyles=void 0,this.quickFilterText=void 0,this.cacheQuickFilter=void 0,this.excludeHiddenColumnsFromQuickFilter=void 0,this.includeHiddenColumnsInQuickFilter=void 0,this.quickFilterParser=void 0,this.quickFilterMatcher=void 0,this.excludeChildrenWhenTreeDataFiltering=void 0,this.enableAdvancedFilter=void 0,this.advancedFilterModel=void 0,this.includeHiddenColumnsInAdvancedFilter=void 0,this.advancedFilterParent=void 0,this.advancedFilterBuilderParams=void 0,this.enableCharts=void 0,this.chartThemes=void 0,this.customChartThemes=void 0,this.chartThemeOverrides=void 0,this.enableChartToolPanelsButton=void 0,this.suppressChartToolPanelsButton=void 0,this.chartToolPanelsDef=void 0,this.chartMenuItems=void 0,this.loadingCellRenderer=void 0,this.loadingCellRendererParams=void 0,this.loadingCellRendererSelector=void 0,this.localeText=void 0,this.masterDetail=void 0,this.keepDetailRows=void 0,this.keepDetailRowsCount=void 0,this.detailCellRenderer=void 0,this.detailCellRendererParams=void 0,this.detailRowHeight=void 0,this.detailRowAutoHeight=void 0,this.context=void 0,this.alignedGrids=void 0,this.tabIndex=void 0,this.rowBuffer=void 0,this.valueCache=void 0,this.valueCacheNeverExpires=void 0,this.enableCellExpressions=void 0,this.suppressParentsInRowNodes=void 0,this.suppressTouch=void 0,this.suppressFocusAfterRefresh=void 0,this.suppressAsyncEvents=void 0,this.suppressBrowserResizeObserver=void 0,this.suppressPropertyNamesCheck=void 0,this.suppressChangeDetection=void 0,this.debug=void 0,this.overlayLoadingTemplate=void 0,this.loadingOverlayComponent=void 0,this.loadingOverlayComponentParams=void 0,this.suppressLoadingOverlay=void 0,this.overlayNoRowsTemplate=void 0,this.noRowsOverlayComponent=void 0,this.noRowsOverlayComponentParams=void 0,this.suppressNoRowsOverlay=void 0,this.pagination=void 0,this.paginationPageSize=void 0,this.paginationPageSizeSelector=void 0,this.paginationAutoPageSize=void 0,this.paginateChildRows=void 0,this.suppressPaginationPanel=void 0,this.pivotMode=void 0,this.pivotPanelShow=void 0,this.pivotMaxGeneratedColumns=void 0,this.pivotDefaultExpanded=void 0,this.pivotColumnGroupTotals=void 0,this.pivotRowTotals=void 0,this.pivotSuppressAutoColumn=void 0,this.suppressExpandablePivotGroups=void 0,this.functionsReadOnly=void 0,this.aggFuncs=void 0,this.suppressAggFuncInHeader=void 0,this.alwaysAggregateAtRootLevel=void 0,this.suppressAggAtRootLevel=void 0,this.aggregateOnlyChangedColumns=void 0,this.suppressAggFilteredOnly=void 0,this.removePivotHeaderRowWhenSingleValueColumn=void 0,this.animateRows=void 0,this.enableCellChangeFlash=void 0,this.cellFlashDuration=void 0,this.cellFlashDelay=void 0,this.cellFadeDuration=void 0,this.cellFadeDelay=void 0,this.allowShowChangeAfterFilter=void 0,this.domLayout=void 0,this.ensureDomOrder=void 0,this.enableRtl=void 0,this.suppressColumnVirtualisation=void 0,this.suppressMaxRenderedRowRestriction=void 0,this.suppressRowVirtualisation=void 0,this.rowDragManaged=void 0,this.suppressRowDrag=void 0,this.suppressMoveWhenRowDragging=void 0,this.rowDragEntireRow=void 0,this.rowDragMultiRow=void 0,this.rowDragText=void 0,this.fullWidthCellRenderer=void 0,this.fullWidthCellRendererParams=void 0,this.embedFullWidthRows=void 0,this.suppressGroupMaintainValueType=void 0,this.groupDisplayType=void 0,this.groupDefaultExpanded=void 0,this.autoGroupColumnDef=void 0,this.groupMaintainOrder=void 0,this.groupSelectsChildren=void 0,this.groupLockGroupColumns=void 0,this.groupAggFiltering=void 0,this.groupIncludeFooter=void 0,this.groupIncludeTotalFooter=void 0,this.groupSuppressBlankHeader=void 0,this.groupSelectsFiltered=void 0,this.showOpenedGroup=void 0,this.groupRemoveSingleChildren=void 0,this.groupRemoveLowestSingleChildren=void 0,this.groupHideOpenParents=void 0,this.groupAllowUnbalanced=void 0,this.rowGroupPanelShow=void 0,this.groupRowRenderer=void 0,this.groupRowRendererParams=void 0,this.suppressMakeColumnVisibleAfterUnGroup=void 0,this.treeData=void 0,this.rowGroupPanelSuppressSort=void 0,this.suppressGroupRowsSticky=void 0,this.pinnedTopRowData=void 0,this.pinnedBottomRowData=void 0,this.rowModelType=void 0,this.rowData=void 0,this.asyncTransactionWaitMillis=void 0,this.suppressModelUpdateAfterUpdateTransaction=void 0,this.datasource=void 0,this.cacheOverflowSize=void 0,this.infiniteInitialRowCount=void 0,this.serverSideInitialRowCount=void 0,this.suppressServerSideInfiniteScroll=void 0,this.cacheBlockSize=void 0,this.maxBlocksInCache=void 0,this.maxConcurrentDatasourceRequests=void 0,this.blockLoadDebounceMillis=void 0,this.purgeClosedRowNodes=void 0,this.serverSideDatasource=void 0,this.serverSideSortAllLevels=void 0,this.serverSideEnableClientSideSort=void 0,this.serverSideOnlyRefreshFilteredGroups=void 0,this.serverSideFilterAllLevels=void 0,this.serverSideSortOnServer=void 0,this.serverSideFilterOnServer=void 0,this.serverSidePivotResultFieldSeparator=void 0,this.viewportDatasource=void 0,this.viewportRowModelPageSize=void 0,this.viewportRowModelBufferSize=void 0,this.alwaysShowHorizontalScroll=void 0,this.alwaysShowVerticalScroll=void 0,this.debounceVerticalScrollbar=void 0,this.suppressHorizontalScroll=void 0,this.suppressScrollOnNewData=void 0,this.suppressScrollWhenPopupsAreOpen=void 0,this.suppressAnimationFrame=void 0,this.suppressMiddleClickScrolls=void 0,this.suppressPreventDefaultOnMouseWheel=void 0,this.scrollbarWidth=void 0,this.rowSelection=void 0,this.rowMultiSelectWithClick=void 0,this.suppressRowDeselection=void 0,this.suppressRowClickSelection=void 0,this.suppressCellFocus=void 0,this.suppressHeaderFocus=void 0,this.suppressMultiRangeSelection=void 0,this.enableCellTextSelection=void 0,this.enableRangeSelection=void 0,this.enableRangeHandle=void 0,this.enableFillHandle=void 0,this.fillHandleDirection=void 0,this.suppressClearOnFillReduction=void 0,this.sortingOrder=void 0,this.accentedSort=void 0,this.unSortIcon=void 0,this.suppressMultiSort=void 0,this.alwaysMultiSort=void 0,this.multiSortKey=void 0,this.suppressMaintainUnsortedOrder=void 0,this.icons=void 0,this.rowHeight=void 0,this.rowStyle=void 0,this.rowClass=void 0,this.rowClassRules=void 0,this.suppressRowHoverHighlight=void 0,this.suppressRowTransform=void 0,this.columnHoverHighlight=void 0,this.gridId=void 0,this.deltaSort=void 0,this.treeDataDisplayType=void 0,this.functionsPassive=void 0,this.enableGroupEdit=void 0,this.initialState=void 0,this.getContextMenuItems=void 0,this.getMainMenuItems=void 0,this.postProcessPopup=void 0,this.processUnpinnedColumns=void 0,this.processCellForClipboard=void 0,this.processHeaderForClipboard=void 0,this.processGroupHeaderForClipboard=void 0,this.processCellFromClipboard=void 0,this.sendToClipboard=void 0,this.processDataFromClipboard=void 0,this.isExternalFilterPresent=void 0,this.doesExternalFilterPass=void 0,this.getChartToolbarItems=void 0,this.createChartContainer=void 0,this.navigateToNextHeader=void 0,this.tabToNextHeader=void 0,this.navigateToNextCell=void 0,this.tabToNextCell=void 0,this.getLocaleText=void 0,this.getDocument=void 0,this.paginationNumberFormatter=void 0,this.getGroupRowAgg
1=void 0,this.isGroupOpenByDefault=void 0,this.initialGroupOrderComparator=void 0,this.processPivotResultColDef=void 0,this.processPivotResultColGroupDef=void 0,this.getDataPath=void 0,this.getChildCount=void 0,this.getServerSideGroupLevelParams=void 0,this.isServerSideGroupOpenByDefault=void 0,this.isApplyServerSideTransaction=void 0,this.isServerSideGroup=void 0,this.getServerSideGroupKey=void 0,this.getBusinessKeyForNode=void 0,this.getRowId=void 0,this.resetRowDataOnUpdate=void 0,this.processRowPostCreate=void 0,this.isRowSelectable=void 0,this.isRowMaster=void 0,this.fillOperation=void 0,this.postSortRows=void 0,this.getRowStyle=void 0,this.getRowClass=void 0,this.getRowHeight=void 0,this.isFullWidthRow=void 0,this.toolPanelVisibleChanged=new d._w7,this.toolPanelSizeChanged=new d._w7,this.columnMenuVisibleChanged=new d._w7,this.cutStart=new d._w7,this.cutEnd=new d._w7,this.pasteStart=new d._w7,this.pasteEnd=new d._w7,this.columnVisible=new d._w7,this.columnPinned=new d._w7,this.columnResized=new d._w7,this.columnMoved=new d._w7,this.columnValueChanged=new d._w7,this.columnPivotModeChanged=new d._w7,this.columnPivotChanged=new d._w7,this.columnGroupOpened=new d._w7,this.newColumnsLoaded=new d._w7,this.gridColumnsChanged=new d._w7,this.displayedColumnsChanged=new d._w7,this.virtualColumnsChanged=new d._w7,this.columnEverythingChanged=new d._w7,this.columnHeaderMouseOver=new d._w7,this.columnHeaderMouseLeave=new d._w7,this.columnHeaderClicked=new d._w7,this.columnHeaderContextMenu=new d._w7,this.componentStateChanged=new d._w7,this.cellValueChanged=new d._w7,this.cellEditRequest=new d._w7,this.rowValueChanged=new d._w7,this.cellEditingStarted=new d._w7,this.cellEditingStopped=new d._w7,this.rowEditingStarted=new d._w7,this.rowEditingStopped=new d._w7,this.undoStarted=new d._w7,this.undoEnded=new d._w7,this.redoStarted=new d._w7,this.redoEnded=new d._w7,this.rangeDeleteStart=new d._w7,this.rangeDeleteEnd=new d._w7,this.filterOpened=new d._w7,this.filterChanged=new d._w7,this.filterModified=new d._w7,this.advancedFilterBuilderVisibleChanged=new d._w7,this.chartCreated=new d._w7,this.chartRangeSelectionChanged=new d._w7,this.chartOptionsChanged=new d._w7,this.chartDestroyed=new d._w7,this.cellKeyDown=new d._w7,this.gridReady=new d._w7,this.gridPreDestroyed=new d._w7,this.firstDataRendered=new d._w7,this.gridSizeChanged=new d._w7,this.modelUpdated=new d._w7,this.virtualRowRemoved=new d._w7,this.viewportChanged=new d._w7,this.bodyScroll=new d._w7,this.bodyScrollEnd=new d._w7,this.dragStarted=new d._w7,this.dragStopped=new d._w7,this.stateUpdated=new d._w7,this.paginationChanged=new d._w7,this.rowDragEnter=new d._w7,this.rowDragMove=new d._w7,this.rowDragLeave=new d._w7,this.rowDragEnd=new d._w7,this.columnRowGroupChanged=new d._w7,this.rowGroupOpened=new d._w7,this.expandOrCollapseAll=new d._w7,this.pivotMaxColumnsExceeded=new d._w7,this.pinnedRowDataChanged=new d._w7,this.rowDataUpdated=new d._w7,this.asyncTransactionsFlushed=new d._w7,this.storeRefreshed=new d._w7,this.cellClicked=new d._w7,this.cellDoubleClicked=new d._w7,this.cellFocused=new d._w7,this.cellMouseOver=new d._w7,this.cellMouseOut=new d._w7,this.cellMouseDown=new d._w7,this.rowClicked=new d._w7,this.rowDoubleClicked=new d._w7,this.rowSelected=new d._w7,this.selectionChanged=new d._w7,this.cellContextMenu=new d._w7,this.rangeSelectionChanged=new d._w7,this.tooltipShow=new d._w7,this.tooltipHide=new d._w7,this.sortChanged=new d._w7,this.columnRowGroupChangeRequest=new d._w7,this.columnPivotChangeRequest=new d._w7,this.columnValueChangeRequest=new d._w7,this.columnAggFuncChangeRequest=new d._w7,this._nativeElement=i.nativeElement}ngAfterViewInit(){this.angularFrameworkOverrides.runOutsideAngular(()=>{this.frameworkComponentWrapper.setViewContainerRef(this.viewContainerRef,this.angularFrameworkOverrides);const i=Lo.combineAttributesAndGridOptions(this.gridOptions,this);this.gridParams={globalEventListener:this.globalEventListener.bind(this),frameworkOverrides:this.angularFrameworkOverrides,providedBeanInstances:{frameworkComponentWrapper:this.frameworkComponentWrapper},modules:this.modules||[]};const s=function Yg(e,t,i){if(!t)return st("No gridOptions provided to createGrid"),{};const s=$.getCoercedGridOptions(t),o=(new Qd).create(e,s,r=>{const n=new Ri(e);r.createBean(n)},void 0,i);if(!Object.isFrozen(t)&&!i?.frameworkOverrides){const r="https://ag-grid.com/javascript-data-grid/grid-interface/#grid-api";
1Object.defineProperty(t,"api",{get:()=>{st(`gridOptions.api is no longer supported. See ${r}.`)},configurable:!0}),Object.defineProperty(t,"columnApi",{get:()=>{st(`gridOptions.columnApi is no longer supported and all methods moved to the grid api. See ${r}.`)},configurable:!0})}return o}(this._nativeElement,i,this.gridParams);s&&(this.api=s,this.columnApi=new Ei(s));const o=this.gridPreDestroyed;(o.observed??o.observers.length>0)&&console.warn('AG Grid: gridPreDestroyed event listener registered via (gridPreDestroyed)="method($event)" will be ignored! Please assign via gridOptions.gridPreDestroyed and pass to the grid as [gridOptions]="gridOptions"'),this._initialised=!0,this._fullyReady.resolveNow(null,r=>r)})}ngOnChanges(i){this._initialised&&this.angularFrameworkOverrides.runOutsideAngular(()=>{const s={};Object.entries(i).forEach(([o,r])=>{s[o]=r.currentValue}),Lo.processOnChange(s,this.api)})}ngOnDestroy(){this._initialised&&(this._destroyed=!0,this.api?.destroy())}isEmitterUsed(i){const o=this[i],r=o?.observed??o?.observers?.length>0,n=`on${i.charAt(0).toUpperCase()}${i.substring(1)}`;return r||!!this.gridOptions&&!!this.gridOptions[n]}globalEventListener(i,s){if(this._destroyed)return;const o=this[i];if(o&&this.isEmitterUsed(i)){const r=()=>this.angularFrameworkOverrides.runInsideAngular(()=>o.emit(s));"gridReady"===i?this._fullyReady.then(()=>r()):r()}}}return e.\u0275fac=function(i){return new(i||e)(d.GI1(d.GMv),d.GI1(d.y8U),d.GI1(au),d.GI1(du))},e.\u0275cmp=d.In1({type:e,selectors:[["ag-grid-angular"]],inputs:{gridOptions:"gridOptions",modules:"modules",statusBar:"statusBar",sideBar:"sideBar",suppressContextMenu:"suppressContextMenu",preventDefaultOnContextMenu:"preventDefaultOnContextMenu",allowContextMenuWithControlKey:"allowContextMenuWithControlKey",columnMenu:"columnMenu",suppressMenuHide:"suppressMenuHide",enableBrowserTooltips:"enableBrowserTooltips",tooltipTrigger:"tooltipTrigger",tooltipShowDelay:"tooltipShowDelay",tooltipHideDelay:"tooltipHideDelay",tooltipMouseTrack:"tooltipMouseTrack",tooltipShowMode:"tooltipShowMode",tooltipInteraction:"tooltipInteraction",popupParent:"popupParent",copyHeadersToClipboard:"copyHeadersToClipboard",copyGroupHeadersToClipboard:"copyGroupHeadersToClipboard",clipboardDelimiter:"clipboardDelimiter",suppressCopyRowsToClipboard:"suppressCopyRowsToClipboard",suppressCopySingleCellRanges:"suppressCopySingleCellRanges",suppressLastEmptyLineOnPaste:"suppressLastEmptyLineOnPaste",suppressClipboardPaste:"suppressClipboardPaste",suppressClipboardApi:"suppressClipboardApi",suppressCutToClipboard:"suppressCutToClipboard",columnDefs:"columnDefs",defaultColDef:"defaultColDef",defaultColGroupDef:"defaultColGroupDef",columnTypes:"columnTypes",dataTypeDefinitions:"dataTypeDefinitions",maintainColumnOrder:"maintainColumnOrder",suppressFieldDotNotation:"suppressFieldDotNotation",headerHeight:"headerHeight",groupHeaderHeight:"groupHeaderHeight",floatingFiltersHeight:"floatingFiltersHeight",pivotHeaderHeight:"pivotHeaderHeight",pivotGroupHeaderHeight:"pivotGroupHeaderHeight",allowDragFromColumnsToolPanel:"allowDragFromColumnsToolPanel",suppressMovableColumns:"suppressMovableColumns",suppressColumnMoveAnimation:"suppressColumnMoveAnimation",suppressDragLeaveHidesColumns:"suppressDragLeaveHidesColumns",suppressRowGroupHidesColumns:"suppressRowGroupHidesColumns",colResizeDefault:"colResizeDefault",suppressAutoSize:"suppressAutoSize",autoSizePadding:"autoSizePadding",skipHeaderOnAutoSize:"skipHeaderOnAutoSize",autoSizeStrategy:"autoSizeStrategy",components:"components",editType:"editType",singleClickEdit:"singleClickEdit",suppressClickEdit:"suppressClickEdit",readOnlyEdit:"readOnlyEdit",stopEditingWhenCellsLoseFocus:"stopEditingWhenCellsLoseFocus",enterMovesDown:"enterMovesDown",enterMovesDownAfterEdit:"enterMovesDownAfterEdit",enterNavigatesVertically:"enterNavigatesVertically",enterNavigatesVerticallyAfterEdit:"enterNavigatesVerticallyAfterEdit",enableCellEditingOnBackspace:"enableCellEditingOnBackspace",undoRedoCellEditing:"undoRedoCellEditing",undoRedoCellEditingLimit:"undoRedoCellEditingLimit",defaultCsvExportParams:"defaultCsvExportParams",suppressCsvExport:"suppressCsvExport",defaultExcelExportParams:"defaultExcelExportParams",suppressExcelExport:"suppressExcelExport",excelStyles:"excelStyles",quickFilterText:"quickFilterText",cacheQuickFilter:"cacheQuickFilter",excludeHiddenColumnsFromQuickFilter:"excludeHiddenColumnsFromQuickFilter",includeHiddenColumnsInQuickFilter:"includeHiddenColumnsInQuickFilter",quickFilterParser:"quickFilterParser",quickFilterMatcher:"quickFilterMatcher",excludeChildrenWhenTreeDataFiltering:"excludeChildrenWhenTreeDataFiltering",enableAdvancedFilter:"enableAdvancedFilter",advancedFilterModel:"advancedFilterModel",includeHiddenColumnsInAdvancedFilter:"includeHiddenColumnsInAdvancedFilter",advancedFilterParent:"advancedFilterParent",advancedFilterBuilderParams:"advancedFilterBuilderParams",enableCharts:"enableCharts",chartThemes:"chartThemes",customChartThemes:"customChartThemes",chartThemeOverrides:"chartThemeOverrides",enableChartToolPanelsButton:"enableChartToolPanelsButton",suppressChartToolPanelsButton:"suppressChartToolPanelsButton",chartToolPanelsDef:"chartToolPanelsDef",chartMenuItems:"chartMenuItems",loadingCellRenderer:"loadingCellRenderer",loadingCellRendererParams:"loadingCellRendererParams",loadingCellRendererSelector:"loadingCellRendererSelector",localeText:"localeText",masterDetail:"masterDetail",keepDetailRows:"keepDetailRows",keepDetailRowsCount:"keepDetailRowsCount",detailCellRenderer:"detailCellRenderer",detailCellRendererParams:"detailCellRendererParams",detailRowHeight:"detailRowHeight",detailRowAutoHeight:"detailRowAutoHeight",context:"context",alignedGrids:"al
1ignedGrids",tabIndex:"tabIndex",rowBuffer:"rowBuffer",valueCache:"valueCache",valueCacheNeverExpires:"valueCacheNeverExpires",enableCellExpressions:"enableCellExpressions",suppressParentsInRowNodes:"suppressParentsInRowNodes",suppressTouch:"suppressTouch",suppressFocusAfterRefresh:"suppressFocusAfterRefresh",suppressAsyncEvents:"suppressAsyncEvents",suppressBrowserResizeObserver:"suppressBrowserResizeObserver",suppressPropertyNamesCheck:"suppressPropertyNamesCheck",suppressChangeDetection:"suppressChangeDetection",debug:"debug",overlayLoadingTemplate:"overlayLoadingTemplate",loadingOverlayComponent:"loadingOverlayComponent",loadingOverlayComponentParams:"loadingOverlayComponentParams",suppressLoadingOverlay:"suppressLoadingOverlay",overlayNoRowsTemplate:"overlayNoRowsTemplate",noRowsOverlayComponent:"noRowsOverlayComponent",noRowsOverlayComponentParams:"noRowsOverlayComponentParams",suppressNoRowsOverlay:"suppressNoRowsOverlay",pagination:"pagination",paginationPageSize:"paginationPageSize",paginationPageSizeSelector:"paginationPageSizeSelector",paginationAutoPageSize:"paginationAutoPageSize",paginateChildRows:"paginateChildRows",suppressPaginationPanel:"suppressPaginationPanel",pivotMode:"pivotMode",pivotPanelShow:"pivotPanelShow",pivotMaxGeneratedColumns:"pivotMaxGeneratedColumns",pivotDefaultExpanded:"pivotDefaultExpanded",pivotColumnGroupTotals:"pivotColumnGroupTotals",pivotRowTotals:"pivotRowTotals",pivotSuppressAutoColumn:"pivotSuppressAutoColumn",suppressExpandablePivotGroups:"suppressExpandablePivotGroups",functionsReadOnly:"functionsReadOnly",aggFuncs:"aggFuncs",suppressAggFuncInHeader:"suppressAggFuncInHeader",alwaysAggregateAtRootLevel:"alwaysAggregateAtRootLevel",suppressAggAtRootLevel:"suppressAggAtRootLevel",aggregateOnlyChangedColumns:"aggregateOnlyChangedColumns",suppressAggFilteredOnly:"suppressAggFilteredOnly",removePivotHeaderRowWhenSingleValueColumn:"removePivotHeaderRowWhenSingleValueColumn",animateRows:"animateRows",enableCellChangeFlash:"enableCellChangeFlash",cellFlashDuration:"cellFlashDuration",cellFlashDelay:"cellFlashDelay",cellFadeDuration:"cellFadeDuration",cellFadeDelay:"cellFadeDelay",allowShowChangeAfterFilter:"allowShowChangeAfterFilter",domLayout:"domLayout",ensureDomOrder:"ensureDomOrder",enableRtl:"enableRtl",suppressColumnVirtualisation:"suppressColumnVirtualisation",suppressMaxRenderedRowRestriction:"suppressMaxRenderedRowRestriction",suppressRowVirtualisation:"suppressRowVirtualisation",rowDragManaged:"rowDragManaged",suppressRowDrag:"suppressRowDrag",suppressMoveWhenRowDragging:"suppressMoveWhenRowDragging",rowDragEntireRow:"rowDragEntireRow",rowDragMultiRow:"rowDragMultiRow",rowDragText:"rowDragText",fullWidthCellRenderer:"fullWidthCellRenderer",fullWidthCellRendererParams:"fullWidthCellRendererParams",embedFullWidthRows:"embedFullWidthRows",suppressGroupMaintainValueType:"suppressGroupMaintainValueType",groupDisplayType:"groupDisplayType",groupDefaultExpanded:"groupDefaultExpanded",autoGroupColumnDef:"autoGroupColumnDef",groupMaintainOrder:"groupMaintainOrder",groupSelectsChildren:"groupSelectsChildren",groupLockGroupColumns:"groupLockGroupColumns",groupAggFiltering:"groupAggFiltering",groupIncludeFooter:"groupIncludeFooter",groupIncludeTotalFooter:"groupIncludeTotalFooter",groupSuppressBlankHeader:"groupSuppressBlankHeader",groupSelectsFiltered:"groupSelectsFiltered",showOpenedGroup:"showOpenedGroup",groupRemoveSingleChildren:"groupRemoveSingleChildren",groupRemoveLowestSingleChildren:"groupRemoveLowestSingleChildren",groupHideOpenParents:"groupHideOpenParents",groupAllowUnbalanced:"groupAllowUnbalanced",rowGroupPanelShow:"rowGroupPanelShow",groupRowRenderer:"groupRowRenderer",groupRowRendererParams:"groupRowRendererParams",suppressMakeColumnVisibleAfterUnGroup:"suppressMakeColumnVisibleAfterUnGroup",treeData:"treeData",rowGroupPanelSuppressSort:"rowGroupPanelSuppressSort",suppressGroupRowsSticky:"suppressGroupRowsSticky",pinnedTopRowData:"pinnedTopRowData",pinnedBottomRowData:"pinnedBottomRowData",rowModelType:"rowModelType",rowData:"rowData",asyncTransactionWaitMillis:"asyncTransactionWaitMillis",suppressModelUpdateAfterUpdateTransaction:"suppressModelUpdateAfterUpdateTransaction",datasource:"datasource",cac
1heOverflowSize:"cacheOverflowSize",infiniteInitialRowCount:"infiniteInitialRowCount",serverSideInitialRowCount:"serverSideInitialRowCount",suppressServerSideInfiniteScroll:"suppressServerSideInfiniteScroll",cacheBlockSize:"cacheBlockSize",maxBlocksInCache:"maxBlocksInCache",maxConcurrentDatasourceRequests:"maxConcurrentDatasourceRequests",blockLoadDebounceMillis:"blockLoadDebounceMillis",purgeClosedRowNodes:"purgeClosedRowNodes",serverSideDatasource:"serverSideDatasource",serverSideSortAllLevels:"serverSideSortAllLevels",serverSideEnableClientSideSort:"serverSideEnableClientSideSort",serverSideOnlyRefreshFilteredGroups:"serverSideOnlyRefreshFilteredGroups",serverSideFilterAllLevels:"serverSideFilterAllLevels",serverSideSortOnServer:"serverSideSortOnServer",serverSideFilterOnServer:"serverSideFilterOnServer",serverSidePivotResultFieldSeparator:"serverSidePivotResultFieldSeparator",viewportDatasource:"viewportDatasource",viewportRowModelPageSize:"viewportRowModelPageSize",viewportRowModelBufferSize:"viewportRowModelBufferSize",alwaysShowHorizontalScroll:"alwaysShowHorizontalScroll",alwaysShowVerticalScroll:"alwaysShowVerticalScroll",debounceVerticalScrollbar:"debounceVerticalScrollbar",suppressHorizontalScroll:"suppressHorizontalScroll",suppressScrollOnNewData:"suppressScrollOnNewData",suppressScrollWhenPopupsAreOpen:"suppressScrollWhenPopupsAreOpen",suppressAnimationFrame:"suppressAnimationFrame",suppressMiddleClickScrolls:"suppressMiddleClickScrolls",suppressPreventDefaultOnMouseWheel:"suppressPreventDefaultOnMouseWheel",scrollbarWidth:"scrollbarWidth",rowSelection:"rowSelection",rowMultiSelectWithClick:"rowMultiSelectWithClick",suppressRowDeselection:"suppressRowDeselection",suppressRowClickSelection:"suppressRowClickSelection",suppressCellFocus:"suppressCellFocus",suppressHeaderFocus:"suppressHeaderFocus",suppressMultiRangeSelection:"suppressMultiRangeSelection",enableCellTextSelection:"enableCellTextSelection",enableRangeSelection:"enableRangeSelection",enableRangeHandle:"enableRangeHandle",enableFillHandle:"enableFillHandle",fillHandleDirection:"fillHandleDirection",suppressClearOnFillReduction:"suppressClearOnFillReduction",sortingOrder:"sortingOrder",accentedSort:"accentedSort",unSortIcon:"unSortIcon",suppressMultiSort:"suppressMultiSort",alwaysMultiSort:"alwaysMultiSort",multiSortKey:"multiSortKey",suppressMaintainUnsortedOrder:"suppressMaintainUnsortedOrder",icons:"icons",rowHeight:"rowHeight",rowStyle:"rowStyle",rowClass:"rowClass",rowClassRules:"rowClassRules",suppressRowHoverHighlight:"suppressRowHoverHighlight",suppressRowTransform:"suppressRowTransform",columnHoverHighlight:"columnHoverHighlight",gridId:"gridId",deltaSort:"deltaSort",treeDataDisplayType:"treeDataDisplayType",functionsPassive:"functionsPassive",enableGroupEdit:"enableGroupEdit",initialState:"initialState",getContextMenuItems:"getContextMenuItems",getMainMenuItems:"getMainMenuItems",postProcessPopup:"postProcessPopup",processUnpinnedColumns:"processUnpinnedColumns",processCellForClipboard:"processCellForClipboard",processHeaderForClipboard:"processHeaderForClipboard",processGroupHeaderForClipboard:"processGroupHeaderForClipboard",processCellFromClipboard:"processCellFromClipboard",sendToClipboard:"sendToClipboard",processDataFromClipboard:"processDataFromClipboard",isExternalFilterPresent:"isExternalFilterPresent",doesExternalFilterPass:"doesExternalFilterPass",getChartToolbarItems:"getChartToolbarItems",createChartContainer:"createChartContainer",navigateToNextHeader:"navigateToNextHeader",tabToNextHeader:"tabToNextHeader",navigateToNextCell:"navigateToNextCell",tabToNextCell:"tabToNextCell",getLocaleText:"getLocaleText",getDocument:"getDocument",paginationNumberFormatter:"paginationNumberFormatter",getGroupRowAgg:"getGroupRowAgg",isGroupOpenByDefault:"isGroupOpenByDefault",initialGroupOrderComparator:"initialGroupOrderComparator",processPivotResultColDef:"processPivotResultColDef",processPivotResultColGroupDef:"processPivotResultColGroupDef",getDataPath:"getDataPath",getChildCount:"getChildCount",getServerSideGroupLevelParams:"getServerSideGroupLevelParams",isServerSideGroupOpenByDefault:"isServerSideGroupOpenByDefault",isApplyServerSideTransaction:"isApplyServerSideTransaction",isServerSideGroup:"isServerSideGroup",getServerSideGroupKey:"getServerSideGroupKey",getBusinessKeyForNode:"getBusinessKeyForNode",getRowId:"getRowId",resetRowDataOnUpdate:"resetRowDataOnUpdate",processRowPostCreate:"processRowPostCreate",isRowSelectable:"isRowSelectable",isRowMaster:"isRowMaster",fillOperation:"fillOperation",postSortRows:"postSortRows",getRowStyle:"getRowStyle",getRowClass:"getRowClass",getRowHeight:"getRowHeight",isFullWidthRow:"isFullWidthRow"},outputs:{toolPanelVisibleChanged:"toolPanelVisibleChanged",toolPanelSizeChanged:"toolPanelSizeChanged",columnMenuVisibleChanged:"columnMenuVisibleChanged",cutStart:"cutStart",cutEnd:"cutEnd",pasteStart:"pasteStart",pasteEnd:"pasteEnd",columnVisible:"columnVisible",columnPinned:"columnPinned",columnResized:"columnResized",columnMoved:"columnMoved",columnValueChanged:"columnValueChanged",columnPivotModeChanged:"columnPivotModeChanged",columnPivotChanged:"columnPivotChanged",columnGroupOpened:"columnGroupOpened",newColumnsLoaded:"newColumnsLoaded",gridColumnsChanged:"gridColumnsChanged",displayedColumnsChanged:"displayedColumnsChanged",virtualColumnsChanged:"virtualColumnsChanged",columnEverythingChanged:"columnEverythingChanged",columnHeaderMouseOver:"columnHeaderMouseOver",columnHeaderMouseLeave:"columnHeaderMouseLeave",columnHeaderClicked:"columnHeaderClicked",columnHeaderContextMenu:"columnHeaderContextMenu",componentStateChanged:"componentStateChanged",cellValueChanged:"cellV
1alueChanged",cellEditRequest:"cellEditRequest",rowValueChanged:"rowValueChanged",cellEditingStarted:"cellEditingStarted",cellEditingStopped:"cellEditingStopped",rowEditingStarted:"rowEditingStarted",rowEditingStopped:"rowEditingStopped",undoStarted:"undoStarted",undoEnded:"undoEnded",redoStarted:"redoStarted",redoEnded:"redoEnded",rangeDeleteStart:"rangeDeleteStart",rangeDeleteEnd:"rangeDeleteEnd",filterOpened:"filterOpened",filterChanged:"filterChanged",filterModified:"filterModified",advancedFilterBuilderVisibleChanged:"advancedFilterBuilderVisibleChanged",chartCreated:"chartCreated",chartRangeSelectionChanged:"chartRangeSelectionChanged",chartOptionsChanged:"chartOptionsChanged",chartDestroyed:"chartDestroyed",cellKeyDown:"cellKeyDown",gridReady:"gridReady",gridPreDestroyed:"gridPreDestroyed",firstDataRendered:"firstDataRendered",gridSizeChanged:"gridSizeChanged",modelUpdated:"modelUpdated",virtualRowRemoved:"virtualRowRemoved",viewportChanged:"viewportChanged",bodyScroll:"bodyScroll",bodyScrollEnd:"bodyScrollEnd",dragStarted:"dragStarted",dragStopped:"dragStopped",stateUpdated:"stateUpdated",paginationChanged:"paginationChanged",rowDragEnter:"rowDragEnter",rowDragMove:"rowDragMove",rowDragLeave:"rowDragLeave",rowDragEnd:"rowDragEnd",columnRowGroupChanged:"columnRowGroupChanged",rowGroupOpened:"rowGroupOpened",expandOrCollapseAll:"expandOrCollapseAll",pivotMaxColumnsExceeded:"pivotMaxColumnsExceeded",pinnedRowDataChanged:"pinnedRowDataChanged",rowDataUpdated:"rowDataUpdated",asyncTransactionsFlushed:"asyncTransactionsFlushed",storeRefreshed:"storeRefreshed",cellClicked:"cellClicked",cellDoubleClicked:"cellDoubleClicked",cellFocused:"cellFocused",cellMouseOver:"cellMouseOver",cellMouseOut:"cellMouseOut",cellMouseDown:"cellMouseDown",rowClicked:"rowClicked",rowDoubleClicked:"rowDoubleClicked",rowSelected:"rowSelected",selectionChanged:"selectionChanged",cellContextMenu:"cellContextMenu",rangeSelectionChanged:"rangeSelectionChanged",tooltipShow:"tooltipShow",tooltipHide:"tooltipHide",sortChanged:"sortChanged",columnRowGroupChangeRequest:"columnRowGroupChangeRequest",columnPivotChangeRequest:"columnPivotChangeRequest",columnValueChangeRequest:"columnValueChangeRequest",columnAggFuncChangeRequest:"columnAggFuncChangeRequest"},standalone:!0,features:[d.M5G([au,du]),d.SYr,d.UHJ],decls:0,vars:0,template:function(i,s){},encapsulation:2}),e})(),Mf=(()=>{class e{}return e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=d.a4G({type:e}),e.\u0275inj=d.s3X({imports:[vl]}),e})(),If=(()=>{class e{changeDetectorRef;ngZone;timer;constructor(i,s){this.changeDetectorRef=i,this.ngZone=s}transform(i){this.removeTimer();const s=new Date(i),r=Math.round(Math.abs(((new Date).getTime()-s.getTime())/1e3)),n=Number.isNaN(r)?1e3:1e3*this.getSecondsUntilUpdate(r);this.timer=this.ngZone.runOutsideAngular(()=>typeof window<"u"?window.setTimeout(()=>{this.ngZone.run(()=>this.changeDetectorRef.markForCheck())},n):null);const l=Math.round(Math.abs(r/60)),a=Math.round(Math.abs(l/60)),c=Math.round(Math.abs(a/24)),h=Math.round(Math.abs(c/30.416)),g=Math.round(Math.abs(c/365));return Number.isNaN(r)?"":r<=45?"a few seconds ago":r<=90?"a minute ago":l<=45?l+"m ago":l<=90?"an hour ago":a<=22?a+"h ago":a<=36?"a day ago":c<=25?c+" days ago":c<=45?"a month ago":c<=345?h+"m ago":c<=545?"a year ago":g+"y ago"}ngOnDestroy(){this.removeTimer()}removeTimer(){this.timer&&(window.clearTimeout(this.timer),this.timer=null)}getSecondsUntilUpdate(i){return i<60?2:i<3600?30:i<86400?300:3600}static \u0275fac=function(s){return new(s||e)(d.GI1(d.kD9,16),d.GI1(d.WW2,16))};static \u0275pipe=d.UTH({name:"timeAgo",type:e,pure:!1})}return e})();function Lf(e,t){1&e&&d.wR5(0,"ion-icon",30)}const _f=e=>({"background-image":e});function xf(e,t){if(1&e&&d.wR5(0,"div",31),2&e){const i=d.GaO(2);d.E7m("ngStyle",d.S45(1,_f,"url("+(null==i.request.userInfo?null:i.request.userInfo.profilePhoto)+")"))}}function Gf(e,t){if(1&e&&(d.I0R(0,"p"),d.OEk(1),d.C$Y()),2&e){const i=d.GaO(2);d.yG2(),d.oRS(" Assigned to ",i.IsFriendlyPro.vendorId===i.userProvider.loggedInUser.id?" me":" team member "+i.IsFriendlyPro.vendorName," ")}}function Nf(e,t){1&e&&(d.I0R(0,"p"),d.OEk(1,"Pros Responded"),d.C$Y())}function kf(e,t){if(1&e&&(d.I0R(0,"p"),d.OEk(1),d.C$Y()),2&e){const i=d.GaO(2);d.yG2(),d.oRS(" Assigned to team member ",i.IsFriendlyPro.vendorName," ")}}function Vf(e,t){1&e&&(d.I0R(0,"p"),d.OEk(1," Pros Responded "),d.C$Y())}const Hf=e=>({left:e});function Bf(e,t){if(1&e){const i=d.KQA();d.I0R(0,"div",3),d.qCj("click",function(){d.usT(i);const o=d.GaO();return d.CGJ(o.showWorkRequestModule(o.request))}),d.I0R(1,"span",4),d.OEk(2),d.wVc(3,"currency"),d.C$Y(),d.I0R(4,"ion-row")(5,"ion-col")(6,"div",5)(7,"div"),d.yuY(8,Lf,1,0,"ion-icon",6)(9,xf,1,3,"div",7),d.C$Y(),d.I0R(10,"div",8),d.OEk(11),d.I0R(12,"div",9)(13,"section",10),d.wR5(14,"ion-icon",11),d.OEk(15),d.C$Y(),d.I0R(16,"section"),d.OEk(17,"View Map"),d.C$Y()()()()()(),d.I0R(18,"ion-row",12)(19,"ion-col")(20,"div",13)(21,"div",14),d.wR5(22,"ion-icon",15),d.C$Y(),d.I0R(23,"div",16),d.OEk(24),d.wVc(25,"slice"),d.C$Y()()(),d.I0R(26,"ion-col",17),d.OEk(27),d.wVc(28,"timeAgo"),d.C$Y()(),d.I0R(29,"ion-row",18)(30,"ion-col",19)(31,"div",13),d.wR5(32,"img",20),d.I0R(33,"div",14),d.wR5(34,"ion-icon",21),d.C$Y(),d.I0R(35,"div",16),d.OEk(36),d.wVc(37,"slice"),d.C$Y()()(),d.I0R(38,"ion-col",22)(39,"div",23),d.wR5(40,"div",24),d.C$Y(),d.I0R(41,"div",25),d.OEk(42),d.C$Y()()(),d.I0R(43,"div",26)(44,"div",27)(45,"div"),d.yuY(46,Gf,2,1,"p",28)(47,Nf,2,0,"p",28),d.C$Y(),d.I0R(48,"div"),d.yuY(49,kf,2,1,"p",28)(50,Vf,2,0,"p",28),d.C$Y()()(),d.I0R(51,"h6",29),d.OEk(52),d.C$Y()()}if(2&e){const i=d.GaO();d.yG2(2),d.oRS(" ",d.kDX(3,17,i.getVendorChargeAmount(null==i.request?null:i.request.packageType,null==i.request?null:i.request.requestType,null==i.request?null:i.request.payment.globalTotal))," "),d.yG2(6),d.E7m("ngIf",!(null!=i.request.userInfo&&i.request.userInfo.profilePhoto)),d.yG2(),d.E7m("ngIf",null==i.request.userInfo?null:i.request.userInfo.profilePhoto),d.yG2(2),d.CAO(" ",null==i.request.userInfo?null:i.request.userInfo.firstName," ",null==i.request.userInfo?null:i.request.userInfo.lastName," "),d.yG2(4),d.CAO(" ",null==i.request||null==i.request.userInfo||null==i.request.userInfo.address?null:i.request.userInfo.address.city," ",null!=i.request&&null!=i.request.userInfo&&null!=i.request.userInfo.address&&i.request.userInfo.address.city?", "+(null==i.request||null==i.request.userInfo||null==i.request.userInfo.address?null:i.request.userInfo.address.state):null==i.request||null==i.request.userInfo||null==i.request.userInfo.address?null:i.request.userInfo.address.city," "),d.yG2(9),d.oRS(" ",d.I7O(25,19,null==i.request||null==i.request.userInfo?null:i.request.userInfo.phoneNumber,0,3),"-***-**** "),d.yG2(3),d.oRS(" ",d.kDX(28,23,null==i.request?null:i.request.postedDate)," "),d.yG2(9),d.oRS(" ",d.I7O(37,25,null==i.request||null==i.request.userInfo?null:i.request.userInfo.email,0,3),"**@***.com "),d.yG2(4),d.E7m("ngStyle",d.S45(29,Hf,20*i.request.responded.length)),d.yG2(2),d.oRS(" ",i.request.responded.length," responded "),d.yG2(4),d.E7m("ngIf",i.IsFriendlyPro),d.yG2(),d.E7m("ngIf",!i.IsFriendlyPro),d.yG2(2),d.E7m("ngIf",i.IsFriendlyPro&&i.request.hiredByTeamMate),d.yG2(),d.E7m("ngIf",i.IsFriendlyPro&&!i.request.hiredByTeamMate),d.yG2(2),d.oRS(" ",i.format.getFullPackage(i.request)," ")}}function Wf(e,t){if(1&e){const i=d.KQA();d.I0R(0,"ag-grid-angular",32),d.qCj("gridReady",function(o){d.usT(i);const r=d.GaO();return d.CGJ(r.onGridReady(o))})("rowClicked",function(o){d.usT(i);const r=d.GaO();return d.CGJ(r.onRowClicked(o))})("rowSelected",function(o){d.usT(i);const r=d.GaO();return d.CGJ(r.onRowSelected(o))})("selectionChanged",function(o){d.usT(i);const r=d.GaO();return d.CGJ(r.onSelectionChanged(o))}),d.C$Y()}if(2&e){const i=d.GaO();d.E7m("columnDefs",i.columnDefs)("rowData",i.rData)("defaultColDef",i.defaultColDef)("suppressMenuHide",!0)("pagination",!0)("cacheQuickFilter",!0)}}function Uf(e,t){if(1&e&&d.wR5(0,"ag-grid-angular",33),2&e){const i=d.GaO();d.E7m("columnDefs",i.columnDefs)("rowData",i.rData)("defaultColDef",i.defaultColDef)("suppressMenuHide",!0)("pagination",!0)("cacheQuickFilter",!0)}}let zf=(()=>{class e{router;userProvider;format;datePipe;firebaseApi;request;slug;rowData=[];gridApi;agGrid;defaultColDef={sortable:!0,resizable:!0,editable:!1,flex:1};columnDefs=[{headerName:"Id",field:"id",hide:!0},{headerName:"Name",field:"name",filter:!0,cellClass:"grid-blue",checkboxSelection:!0}
1,{headerName:"Email",filter:!0,field:"email",cellClass:"grid-blue",minWidth:180},{headerName:"Phone",filter:!0,field:"phone"},{headerName:"Request Status",field:"status",filter:!0,cellRenderer:i=>'<button type="button" class="grid-btn">'+("notHired"===this.slug?"Not hired":i.data.status)+"</button>",minWidth:180},{headerName:"States",filter:!0,field:"states"},{headerName:"Request Type",filter:!0,field:"requestType"},{headerName:"Posted on",filter:!0,field:"posted"}];rowSelection="single";oldSlug="";rData=[];constructor(i,s,o,r,n){this.router=i,this.userProvider=s,this.format=o,this.datePipe=r,this.firebaseApi=n}ngOnChanges(i){console.log("1 data >>>>>>-=>",this.rowData),this.getRowData(),console.log("2 data >>>>>>-=>",this.slug,this.rData)}getRowData(){this.rData=[],this.rowData&&this.rowData.length>0&&this.rowData.forEach(i=>{const s=i.userInfo?.firstName+" "+i.userInfo?.lastName,o=i?.userInfo?.email,r=this.respondedVendors(i.responded),n=i?.userInfo?.phoneNumber,l=this.getStates(i),a=this.getRequestType(i),c=this.datePipe.transform(i?.postedDate,"y-MM-dd h:mm a"),h=i.currentStatus?i.currentStatus:i.progress?i.progress:"...";this.rData.push({id:i?.id,name:s,email:o,phone:n,posted:c,status:h,respondedBy:r,states:l.toString(),requestType:a})})}getStates(i){let s=[];if(i.requestType.indexOf("Tax Return")>=0){const o=this.format.getStatesList(i);return o&&o.length>0&&(s=o.map(r=>r.name)),s.toString()}return" / "}getRequestType(i){return this.format.getFullPackage(i)||""}respondedVendors(i){let s="...";if(i&&i.length>0){const o=i.map(r=>r.vendorName);s=o.length>0?o.toString():"..."}return s}onFirstDataRendered(i){setTimeout(()=>{i.api.getDisplayedRowAtIndex(1).setExpanded(!0)},0)}onGridReady(i){}onFilterTextBoxChanged(){const i=document.getElementById("filter-text-box").value;console.log(">>>",i),this.gridApi.setQuickFilter(i)}onPrintQuickFilterTexts(){this.gridApi.forEachNode((i,s)=>{console.log("Row "+s+" quick filter text is "+i.quickFilterAggregateText)})}get IsFriendlyPro(){return this.request.responded.find(i=>this.userProvider.loggedInUser.teamArray.includes(i.vendorId))}showWorkRequestModule(i){var s=this;return(0,q.c)(function*(){i.read||(i.read=!0,yield s.firebaseApi.updateOne("workRequests",i.id,{read:!0})),s.router.navigate(["work-requests",s.slug],{queryParams:{id:i.id}}),s.userProvider.notify({target:"map",value:!0})})()}getVendorChargeAmount(i,s,o){let r=0;return r="Tax Return"===s?1===i?.length&&i?.includes("business")?50:i?.length>1&&i?.includes("business")?70:30:30,r+.15*o}onRowClicked(i){if("Not hired"===i.data?.status)return;const s=i.data?.id?i.data?.id:"";this.format.selectedWrId=s,console.log("grid click evt ->",s,i),s&&this.router.navigate(["work-request","overview"],{queryParams:{id:s}})}onRowSelected(i){this.format.selectedWr={selected:i.node.selected,wrId:i.data?.id?i.data?.id:""},console.log("onRowSelected evt ->",this.format.selectedWr)}onSelectionChanged(i){}static \u0275fac=function(s){return new(s||e)(d.GI1(Ii.E5),d.GI1(So.e),d.GI1(Fr.M),d.GI1(be.y),d.GI1(wo.H))};static \u0275cmp=d.In1({type:e,selectors:[["app-work-request-item"]],viewQuery:function(s,o){if(1&s&&d.CC$(vl,5),2&s){let r;d.wto(r=d.Gqi())&&(o.agGrid=r.first)}},inputs:{request:"request",slug:"slug",rowData:"rowData"},features:[d.SYr],decls:3,vars:3,consts:[["class","border-bot wr-item relative margin-top-1-5","style","\n\t\tpadding: 0 !important;\n\t\tborder-bottom: 1px solid #e5e5e5;\n\t\tmin-height: 220px;\n\t",3,"click",4,"ngIf"],["style","width: 100%; height: 75%","class","ag-theme-alpine",3,"columnDefs","rowData","defaultColDef","suppressMenuHide","pagination","cacheQuickFilter","gridReady","rowClicked","rowSelected","selectionChanged",4,"ngIf"],["style","width: 100%; height: 75%","class","ag-theme-alpine",3,"columnDefs","rowData","defaultColDef","suppressMenuHide","pagination","cacheQuickFilter",4,"ngIf"],[1,"border-bot","wr-item","relative","margin-top-1-5",2,"padding","0 !important","border-bottom","1px solid #e5e5e5","min-height","220px",3,"click"],[1,"flo-rs","f2-0"],[1,"margin-left","flex","f-align-center"],["class","profile-img","name","person-circle-outline",4,"ngIf"],["class","profile-img",3,"ngStyle",4,"ngIf"],[1,"bold-600","f1-2","w-100"],[1,"bold-100","grey","flex","f-align-center","f-just-btw","f0-9","margin-top-05"],[1,"grey","flex","f-align-center"],["name","location","color","medium",1,"f1-2"],[1,"max-800",2,"margin-top","1.2rem !important"],[1,"info-item"],[1,"first-icon"],["name","call"],[1,"info"],[1,"ion-text-right","f0-9","bold-600"],[1,"max-800"],["size","4"],["src","../../../assets/icon-verified.png",1,"verified"],["name","mail"],[1,"flex-rowend"],[1,"range-bar"],[1,"knob-box",3,"ngStyle"],[1,"f0-8"],[1,"margin-top-05"],["id","prosResponded"],[4,"ngIf"],[2,"margin-top","5px !important"],["name","person-circle-outline",1,"profile-img"],[1,"profile-img",3,"ngStyle"],[1,"ag-theme-alpine",2,"width","100%","height","75%",3,"columnDefs","rowData","defaultColDef","suppressMenuHide","pagination","cacheQuickFilter","gridReady","rowClicked","rowSelected","selectionChanged"],[1,"ag-theme-alpine",2,"width","100%","height","75%",3,"columnDefs","rowData","defaultColDef","suppressMenuHide","pagination","cacheQuickFilter"]],template:function(s,o){1&s&&d.yuY(0,Bf,53,31,"div",0)(1,Wf,1,6,"ag-grid-angular",1)(2,Uf,1,6,"ag-grid-angular",2),2&s&&(d.E7m("ngIf","leads"==o.slug),d.yG2(),d.E7m("ngIf","leads"!=o.slug&&"notHired"!=o.slug),d.yG2(),d.E7m("ngIf","notHired"==o.slug))},dependencies:[be.u_,be.Qt,ee.Kk,ee.Ko,ee.qo,vl,be.qq,be.cf,If],styles:["h1[_ngcontent-%COMP%]{margin:2px auto;font-size:1.4rem}
1h2[_ngcontent-%COMP%], h4[_ngcontent-%COMP%], h5[_ngcontent-%COMP%], span[_ngcontent-%COMP%], p[_ngcontent-%COMP%]{margin:2px auto;padding:0}p[_ngcontent-%COMP%]{margin:0;color:#555}a[_ngcontent-%COMP%], p[_ngcontent-%COMP%], span[_ngcontent-%COMP%]{font-size:.8rem}.rush[_ngcontent-%COMP%]{font-size:.8rem;color:gray}.profile-img[_ngcontent-%COMP%]{width:80px;height:80px}#prosResponded[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:gray;font-size:1.1rem}#prosResponded[_ngcontent-%COMP%] .pros-status[_ngcontent-%COMP%]{background-color:#f0f2f8;padding:4px;border-radius:20px;display:inline-flex;margin-top:5px}#prosResponded[_ngcontent-%COMP%] .pros-status[_ngcontent-%COMP%] .pros-status-circle[_ngcontent-%COMP%]{width:15px;height:15px;border-radius:100%;margin:0 5px}#prosResponded[_ngcontent-%COMP%] .pros-status[_ngcontent-%COMP%] .pros-status-circle.blue[_ngcontent-%COMP%]{background-color:#b4e8f0;border:1px solid #2ad1dd}#prosResponded[_ngcontent-%COMP%] .pros-status[_ngcontent-%COMP%] .pros-status-circle.green[_ngcontent-%COMP%]{background-color:#dae6c1;border:1px solid #a6cb43}#prosResponded[_ngcontent-%COMP%] .pros-status[_ngcontent-%COMP%] .pros-status-circle.yellow[_ngcontent-%COMP%]{background-color:#f5e6ad;border:1px solid #ffca00}#prosResponded[_ngcontent-%COMP%] .pros-status[_ngcontent-%COMP%] .pros-status-circle.orange[_ngcontent-%COMP%]{background-color:#f3e2c7;border:1px solid #ffa000}#prosResponded[_ngcontent-%COMP%] .pros-status[_ngcontent-%COMP%] .pros-status-circle.red[_ngcontent-%COMP%]{background-color:#f3cfd2;border:1px solid #ff403a}#prosResponded[_ngcontent-%COMP%] .pros-status[_ngcontent-%COMP%] .pros-status-circle.empty[_ngcontent-%COMP%]{background-color:#f0f2f8;border:1px solid #cdced2}#btn-contact[_ngcontent-%COMP%]{padding:10px 25px;width:200px;color:#fff;background:#6c63ff;border-radius:16px}.request[_ngcontent-%COMP%]{padding:10px 0;margin:25px 0;border-radius:25px;box-shadow:10px 10px 30px #0004;cursor:pointer}#wr-summary[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0}ion-row[_ngcontent-%COMP%]{margin:0;padding:0;border:1px solid rgba(255,0,0,0)}ion-col[_ngcontent-%COMP%]{margin:0;padding:0;border:1px solid rgba(0,0,119,0)}.info-item[_ngcontent-%COMP%]{display:flex;align-items:center}.info-item[_ngcontent-%COMP%] .first-icon[_ngcontent-%COMP%]{margin-right:5px}.info-item[_ngcontent-%COMP%] .first-icon[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{color:gray}.info-item[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{font-size:.8rem;color:gray}.info-item[_ngcontent-%COMP%] .second-icon[_ngcontent-%COMP%]{margin-left:10px}.info-item[_ngcontent-%COMP%] .first-icon[_ngcontent-%COMP%], .info-item[_ngcontent-%COMP%] .second-icon[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center}.verified[_ngcontent-%COMP%]{height:13px;padding-right:5px}.table[_ngcontent-%COMP%] ion-row[_ngcontent-%COMP%]{display:flex;align-items:center;height:4rem;border-bottom:1px solid rgb(226,226,226);margin-top:.5rem;font-size:1rem}.wr-item[_ngcontent-%COMP%]{cursor:pointer;padding:.5rem}.wr-item[_ngcontent-%COMP%]:hover{background-color:#f8f8f8}.read[_ngcontent-%COMP%]{font-size:1.2rem;position:absolute;top:0}.info-item[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background-color:#efefef;padding:5px 10px;color:#000;border-radius:5px}.flo-rs[_ngcontent-%COMP%]{background-color:red;color:#fff;padding:1px 5px;position:absolute;right:0%;top:-20px;font-size:1.1rem;z-index:9999;border-radius:4px;z-index:2500}"]})}return e})();function Kf(e,t){1&e&&(d.I0R(0,"span",18),d.wR5(1,"ion-icon",19),d.C$Y())}function $f(e,t){1&e&&(d.I0R(0,"span",18),d.wR5(1,"ion-icon",19),d.C$Y())}function qf(e,t){1&e&&(d.I0R(0,"span",18),d.wR5(1,"ion-icon",19),d.C$Y())}const hs=e=>({selected:e});function Yf(e,t){if(1&e){const i=d.KQA();d.I0R(0,"div",8),d.qCj("click",function(){d.usT(i);const o=d.GaO();return d.CGJ(o.filterLeads("all"))}),d.OEk(1," View All "),d.C$Y()}if(2&e){const i=d.GaO();d.E7m("ngClass",d.S45(1,hs,"all"===i.slug))}}
1function jf(e,t){1&e&&(d.I0R(0,"span",18),d.wR5(1,"ion-icon",19),d.C$Y())}function Qf(e,t){if(1&e){const i=d.KQA();d.I0R(0,"div",8),d.qCj("click",function(){d.usT(i);const o=d.GaO();return d.CGJ(o.filterLeads("notHired"))}),d.yuY(1,jf,2,0,"span",9),d.OEk(2," Not Hired "),d.C$Y()}if(2&e){const i=d.GaO();d.E7m("ngClass",d.S45(2,hs,"notHired"===i.slug)),d.yG2(),d.E7m("ngIf",null==i.leadWatcher.workRequests||null==i.leadWatcher.workRequests.notHired?null:i.leadWatcher.workRequests.notHired.notification)}}function Xf(e,t){if(1&e&&d.wR5(0,"app-work-request-item",24),2&e){const i=t.$implicit,s=d.GaO(2);d.E7m("request",i)("slug",s.slug)}}function Zf(e,t){if(1&e&&d.wR5(0,"app-contact-work-request",25),2&e){const i=d.GaO(2);d.E7m("componentProps",i.componentProps)}}function Jf(e,t){if(1&e&&(d.I0R(0,"ion-row")(1,"ion-col",20)(2,"div",21),d.yuY(3,Xf,1,2,"app-work-request-item",22),d.wR5(4,"br")(5,"br")(6,"br")(7,"br"),d.C$Y()(),d.I0R(8,"ion-col"),d.yuY(9,Zf,1,1,"app-contact-work-request",23),d.C$Y()()),2&e){const i=d.GaO();d.yG2(3),d.E7m("ngForOf",i.showWorkRequests),d.yG2(6),d.E7m("ngIf",i.componentProps&&(null==i.componentProps?null:i.componentProps.selected))}}function em(e,t){if(1&e&&(d.I0R(0,"ion-row")(1,"ion-col")(2,"div",26),d.wR5(3,"app-work-request-item",27)(4,"br")(5,"br")(6,"br")(7,"br"),d.C$Y()()()),2&e){const i=d.GaO();d.yG2(3),d.E7m("rowData",i.leadWatcher.workRequests[i.slug].data)("slug",i.slug)}}const tm=e=>({menuActiveStyle:e});let uu=(()=>{class e{firebaseApi;userProvider;util;route;router;leadWatcher;menuService;format;datePipe;slug="";teamViewToggle=!1;componentProps={};wrStatus="";rowData=[];oldworkRequests=[];constructor(i,s,o,r,n,l,a,c,h){this.firebaseApi=i,this.userProvider=s,this.util=o,this.route=r,this.router=n,this.leadWatcher=l,this.menuService=a,this.format=c,this.datePipe=h}showMore=!1;toggleShowMore(){this.showMore=!this.showMore}get showWorkRequests(){let i=[];switch(this.slug){case"notHired":i=this.leadWatcher.workRequests.notHired.data.filter(s=>!!this.teamViewToggle||s.potentialVendors.includes(this.userProvider.loggedInUser.id));break;case"hired":i=this.leadWatcher.workRequests.hired.data.filter(s=>!!this.teamViewToggle||s.potentialVendors.includes(this.userProvider.loggedInUser.id)&&s.tasks.find(o=>o.vendorId===this.userProvider.loggedInUser.id));break;case"pending":i=this.leadWatcher.workRequests.pending.data.filter(s=>!!this.teamViewToggle||s.tasks.find(o=>o.vendorId===this.userProvider.loggedInUser.id));break;case"leads":i=this.leadWatcher.workRequests.leads.data.filter(s=>!!this.teamViewToggle||s.potentialVendors.includes(this.userProvider.loggedInUser.id));break;case"complete":i=this.leadWatcher.workRequests.complete.data.filter(s=>!!this.teamViewToggle||s.potentialVendors.includes(this.userProvider.loggedInUser.id));break;case"all":{const s=Uu.concat(this.leadWatcher.workRequests.pending.data,this.leadWatcher.workRequests.hired.data,this.leadWatcher.workRequests.complete.data);i=s&&s.length>0?s.filter(o=>o.potentialVendors.includes(this.userProvider.loggedInUser.id)):[];break}default:i=this.leadWatcher.workRequests.all.data.filter(s=>!!this.teamViewToggle||s.potentialVendors.includes(this.userProvider.loggedInUser.id))}return i}ngOnInit(){var i=this;return(0,q.c)(function*(){i.route.params.subscribe(s=>{i.slug=s.id||"leads",i.leadWatcher.workRequests.selectedSlug=i.slug}),i.route.queryParams.subscribe(function(){var s=(0,q.c)(function*(o){if(o.id){const r=i.leadWatcher.workRequests.all.data.find(n=>n.id===o.id);r?i.componentProps={selected:r,slug:i.slug}:setTimeout((0,q.c)(function*(){const n=i.leadWatcher.workRequests.all.data.find(l=>l.id===o.id);n&&(i.componentProps={selected:n,slug:i.slug})}),3e3)}else i.route.snapshot.params.id!==i.slug&&i.router.navigate(["work-requests",i.slug])});return function(o){return s.apply(this,arguments)}}())})()}ionViewWillEnter(){this.leadWatcher.workRequests.changed=!1}filterLeads(i){switch(this.init(),i){case"notHired":this.leadWatcher.workRequests.notHired.notification=!1,this.leadWatcher.workRequests.changed=!1,this.leadWatcher.workRequests.selectedSlug=i;break;
1case"hired":this.leadWatcher.workRequests.hired.notification=!1,this.leadWatcher.workRequests.changed=!1,this.leadWatcher.workRequests.selectedSlug=i;break;case"pending":this.leadWatcher.workRequests.pending.notification=!1,this.leadWatcher.workRequests.changed=!1,this.leadWatcher.workRequests.selectedSlug=i;break;case"leads":this.leadWatcher.workRequests.leads.notification=!1,this.leadWatcher.workRequests.changed=!1,this.leadWatcher.workRequests.selectedSlug=i;break;case"complete":this.leadWatcher.workRequests.complete.notification=!1,this.leadWatcher.workRequests.changed=!1,this.leadWatcher.workRequests.selectedSlug=i;break;default:this.leadWatcher.workRequests.all.notification=!1,this.leadWatcher.workRequests.changed=!1,this.leadWatcher.workRequests.selectedSlug=i}this.slug=i,this.router.navigate(["work-requests",i])}goTo(i){i&&(this.leadWatcher.workRequests.changed=!1),this.menuService.toggleMenu(!0,!1)}init(){this.componentProps={}}static \u0275fac=function(s){return new(s||e)(d.GI1(wo.H),d.GI1(So.e),d.GI1(Ar.e),d.GI1(Ii.gV),d.GI1(Ii.E5),d.GI1(Tl.c),d.GI1(zu.C),d.GI1(Fr.M),d.GI1(be.y))};static \u0275cmp=d.In1({type:e,selectors:[["app-work-requests"]],decls:42,vars:27,consts:[[1,"main-div"],[1,"main-section"],["fixed","",3,"ngClass"],[1,"ion-justify-content-start",2,"margin","0 0 0 0.35rem"],["size","2",1,"flex-center-end"],[3,"ngModel","ngModelChange"],[2,"padding","0 0.6rem 0 0.6rem"],["id","wr-nav"],[1,"wr-nav-item",3,"ngClass","click"],["class","notif",4,"ngIf"],["class","wr-nav-item",3,"ngClass","click",4,"ngIf"],[1,"wr-nav-item","toggle-button",3,"click"],["alt","Toggle",3,"src"],[1,"margin-top-05"],[1,"flex-rowstart"],[1,"f1-2","bold-600","adding-5",2,"padding","0 0.4rem"],[1,"f0-9","blue","padding-5",2,"padding-left","0.5rem"],[4,"ngIf"],[1,"notif"],["name","notifications-outline"],["size","4"],[1,"div-box","scroll",2,"margin-top","0.7rem"],[3,"request","slug",4,"ngFor","ngForOf"],[3,"componentProps",4,"ngIf"],[3,"request","slug"],[3,"componentProps"],[1,"div-box","scroll"],[3,"rowData","slug"]],template:function(s,o){1&s&&(d.wR5(0,"app-header"),d.I0R(1,"ion-content")(2,"div",0)(3,"div"),d.wR5(4,"app-menu-module"),d.C$Y(),d.I0R(5,"div",1)(6,"ion-grid",2)(7,"ion-row")(8,"ion-col")(9,"ion-row",3),d.wR5(10,"ion-col"),d.I0R(11,"ion-col",4)(12,"span"),d.OEk(13,"Team View "),d.C$Y(),d.I0R(14,"ion-toggle",5),d.iHE("ngModelChange",function(n){return d.kNx(o.teamViewToggle,n)||(o.teamViewToggle=n),n}),d.C$Y()()(),d.I0R(15,"ion-row")(16,"ion-col",6)(17,"div",7)(18,"div",8),d.qCj("click",function(){return o.filterLeads("leads")}),d.yuY(19,Kf,2,0,"span",9),d.OEk(20," Lead "),d.C$Y(),d.I0R(21,"div",8),d.qCj("click",function(){return o.filterLeads("pending")}),d.yuY(22,$f,2,0,"span",9),d.OEk(23," Responded "),d.C$Y(),d.I0R(24,"div",8),d.qCj("click",function(){return o.filterLeads("hired")}),d.yuY(25,qf,2,0,"span",9),d.OEk(26," Hired "),d.C$Y(),d.I0R(27,"div",8),d.qCj("click",function(){return o.filterLeads("complete")}),d.OEk(28," Completed "),d.C$Y(),d.yuY(29,Yf,2,3,"div",10)(30,Qf,3,4,"div",10),d.I0R(31,"div",11),d.qCj("click",function(){return o.toggleShowMore()}),d.wR5(32,"img",12),d.C$Y()()()(),d.I0R(33,"ion-row",13)(34,"ion-col",14)(35,"div",15),d.OEk(36),d.C$Y(),d.I0R(37,"div",16),d.OEk(38," Auto Updated, "),d.C$Y()()(),d.yuY(39,Jf,10,2,"ion-row",17)(40,em,8,2,"ion-row",17),d.C$Y()()()()(),d.wR5(41,"app-pop-chats"),d.C$Y()),2&s&&(d.yG2(6),d.E7m("ngClass",d.S45(17,tm,o.menuService.mainMenuActive)),d.yG2(8),d.OKB("ngModel",o.teamViewToggle),d.yG2(4),d.E7m("ngClass",d.S45(19,hs,"leads"===o.slug)),d.yG2(),d.E7m("ngIf",null==o.leadWatcher.workRequests||null==o.leadWatcher.workRequests.lead?null:o.leadWatcher.workRequests.lead.notification),d.yG2(2),d.E7m("ngClass",d.S45(21,hs,"pending"===o.slug)),d.yG2(),d.E7m("ngIf",null==o.leadWatcher.workRequests||null==o.leadWatcher.workRequests.pending?null:o.leadWatcher.workRequests.pending.notification),d.yG2(2),d.E7m("ngClass",d.S45(23,hs,"hired"===o.slug)),d.yG2(),d.E7m("ngIf",null==o.leadWatcher.workRequests||null==o.leadWatcher.workRequests.hired?null:o.leadWatcher.workRequests.hired.notification),d.yG2(2),d.E7m("ngClass",d.S45(25,hs,"complete"===o.slug)),d.yG2(2),d.E7m("ngIf",o.showMore),d.yG2(),d.E7m("ngIf",o.showMore),d.yG2(2),d.m4B("transform",o.showMore?"rotate(180deg)":"rotate(0deg)"),d.E7m("src","assets/images/double-right.png",d.K6U),d.yG2(4),d.oRS(" Showing all ",o.showWorkRequests?o.showWorkRequests.length:""," leads "),d.yG2(3),d.E7m("ngIf","leads"==o.slug),d.yG2(),d.E7m("ngIf","leads"!=o.slug))},dependencies:[be.QF,be.ay,be.u_,Tt.ue,Tt._G,ee.Kk,ee._i,ee.YP,ee.Ko,ee.qo,ee.E$,ee.UJ,Ku.a,$u.k,Lc,_c.o,zf],styles:['#header[_ngcontent-%COMP%]{margin:2px 0}.menuActiveStyle[_ngcontent-%COMP%]{max-width:calc(100vw - 600px)}ion-grid[_ngcontent-%COMP%]{transition:"max-width" .5s;width:100%;margin:0}.flex-center-end[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center}
1.notif[_ngcontent-%COMP%]{background-color:var(--ion-color-primary);width:30px;height:30px;border-radius:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;right:-40px;top:50%;transform:translateY(-50%)}#wr-nav[_ngcontent-%COMP%]{border:1px solid #d1d1d1;background-color:#fff;box-shadow:#0000 0 0 2px;width:100%;display:flex;align-items:center;justify-content:space-between;border-radius:4px;padding-left:5rem}#wr-nav[_ngcontent-%COMP%] .wr-nav-item[_ngcontent-%COMP%]{padding-top:5px;position:relative;color:#000;font-size:1.2rem;text-align:center;border-bottom:2px solid transparent}#wr-nav[_ngcontent-%COMP%] .wr-nav-item[_ngcontent-%COMP%]:hover{cursor:pointer}#wr-nav[_ngcontent-%COMP%] .wr-nav-item.greyed[_ngcontent-%COMP%]{opacity:.3}#wr-nav[_ngcontent-%COMP%] .wr-nav-item.selected[_ngcontent-%COMP%]{border-bottom:3px solid #6863ef}.font-heebo[_ngcontent-%COMP%]{font-family:Heebo,sans-serif}.font-roboto[_ngcontent-%COMP%], h1[_ngcontent-%COMP%], h2[_ngcontent-%COMP%]{font-family:roboto,sans-serif}h3[_ngcontent-%COMP%], h4[_ngcontent-%COMP%], h5[_ngcontent-%COMP%], h6[_ngcontent-%COMP%], p[_ngcontent-%COMP%]{font-family:Heebo,sans-serif}.nav[_ngcontent-%COMP%]{margin:10px 0;width:100%}ul[_ngcontent-%COMP%]{list-style-type:none;margin:0;padding:5px 0;overflow:hidden;background-color:#3b3a3a}.nav-link[_ngcontent-%COMP%]{color:#fff;font-size:20px;padding-left:80px;padding-right:80px}.nav-item[_ngcontent-%COMP%] [_ngcontent-%COMP%]:hover{color:#fff}.dropdown[_ngcontent-%COMP%]{padding-top:5px;padding-bottom:5px}.v_flex[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:flex-end}#dropdownMenuButton1[_ngcontent-%COMP%]{background:#fff;border:black 2px solid;opacity:50%;color:#000}.headshot[_ngcontent-%COMP%]{display:inline-block;width:75px}.circle-container[_ngcontent-%COMP%]{display:inline-block;position:relative;margin:0 5px;height:75px;width:75px;border-radius:50%}.circle-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{display:inline-block;position:relative;top:45%;transform:translateY(-50%);width:40px!important}.circle-i[_ngcontent-%COMP%]{position:absolute;z-index:10;height:25px;width:25px;right:5px;top:0;color:#fff;border-radius:50%;background:red}#requests[_ngcontent-%COMP%]{margin:auto;width:100%}#requests[_ngcontent-%COMP%] a[_ngcontent-%COMP%], #requests[_ngcontent-%COMP%] p[_ngcontent-%COMP%], #requests[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.8rem}#requests[_ngcontent-%COMP%] .request[_ngcontent-%COMP%]{padding:10px 0;margin:25px 0;border-radius:25px;box-shadow:10px 10px 30px #0004}#requests[_ngcontent-%COMP%] .contact[_ngcontent-%COMP%]{padding:50px 25px}#btn-contact[_ngcontent-%COMP%]{padding:10px 25px;font-weight:500;font-family:roboto,sans-serif!important;width:200px;color:#fff;background:#6c63ff;border-radius:16px}.bg-purple[_ngcontent-%COMP%]{background:#8180e099}.bg-blue-light[_ngcontent-%COMP%]{background:#c1f8ff}.bg-blue[_ngcontent-%COMP%]{background:#0af}.bg-green[_ngcontent-%COMP%]{background:#6aaf5299}.bg-orange[_ngcontent-%COMP%]{background:#ffc30099}.bg-red[_ngcontent-%COMP%]{background:red}.font-red[_ngcontent-%COMP%]{color:red}.font-green[_ngcontent-%COMP%]{color:#6aaf52}.font-blue[_ngcontent-%COMP%]{color:#8180e0}.font-orange[_ngcontent-%COMP%]{color:#f5ac2d}.font-purple[_ngcontent-%COMP%]{color:#8e8de3}.font-black[_ngcontent-%COMP%]{color:#000}.font-500[_ngcontent-%COMP%]{font-weight:500}.font-600[_ngcontent-%COMP%]{font-weight:600}.font-700[_ngcontent-%COMP%]{font-weight:700}h1[_ngcontent-%COMP%]{margin:2px auto;font-size:1.4rem}h2[_ngcontent-%COMP%], h4[_ngcontent-%COMP%], h5[_ngcontent-%COMP%], span[_ngcontent-%COMP%], p[_ngcontent-%COMP%]{margin:2px auto;padding:0}p[_ngcontent-%COMP%]{margin:0;color:#555}@media (max-width: 972px){#requests[_ngcontent-%COMP%]{padding:100px 25px;margin:auto;width:100%}.wr-nav-item[_ngcontent-%COMP%]{font-size:.8rem}}@media (max-width: 768px){ion-grid[_ngcontent-%COMP%]{padding-left:0}}']})}return e})();const im=[{path:"",component:uu},{path:":id",component:uu}];let sm=(()=>{class e{static \u0275fac=function(s){return new(s||e)};static \u0275mod=d.a4G({type:e});static \u0275inj=d.s3X({imports:[Ii.qQ.forChild(im),Ii.qQ]})}return e})();var om=X(87560),rm=X(48396),nm=X(56584),lm=X(25200),am=X(75448),dm=X(60338);let um=(()=>{class e{static \u0275fac=function(s){return new(s||e)};static \u0275mod=d.a4G({type:e});static \u0275inj=d.s3X({imports:[be.MD,Tt.y,ee.wZ,sm,om.l,rm.S,nm.Y,dm.W,lm.y,Mf,am.K]})}return e})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.