const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdfmake-ew3m0mVj.js","assets/react-CQ4vcI6N.js","assets/xlsx.core.min-DQ8amVV5.js","assets/analytics-DnZ7ZfB8.js","assets/utils-D8wDTXTL.js"])))=>i.map(i=>d[i]);
import{j as C,P as Kf,M as Xf,N as qf}from"./vendors-Vb7QRKDU.js";import{a as S,r as Qf,l as ie,b as Zf,c as bc,L as Sc}from"./react-CQ4vcI6N.js";import{a2 as Ut,a3 as st,a4 as Po,a5 as Jt,X as zt,a6 as Dt,a7 as $y,a8 as Jf,a9 as em,aa as Ky,ab as ma,ac as Bd,ad as Xy,ae as _c,af as kg,ag as zu,ah as tm,ai as Yu,aj as Lu,ak as tn,al as qy,am as Qy,an as dn,ao as im,ap as Zy,aq as Jy,ar as ew,as as Ec,at as tw,au as iw,av as sw,aw as Gg,V as rw,ax as ow,ay as nw,az as aw,aA as lw,aB as uw,aC as hw,aD as xc,aE as dw,U as cw,aF as sm,aG as pw,aH as gw}from"./index-794R-Uxy.js";import{i as qi,E as fw,Z as rm,Q as mw,_ as vw,$ as Cw,C as yw,c as Vg}from"./utils-D8wDTXTL.js";import{a as to,f as ww,i as Rc,L as bw,o as Sw,g as _w,I as Hg}from"./dateTime-BLQiLCis.js";import{D as Lh}from"./ui-BmfexqQL.js";import"./analytics-DnZ7ZfB8.js";import"./media-d-bFm1XA.js";import"./icons-BJcj7X5U.js";function wt({loading:i,dataPresent:e,children:t,inline:s}){return e?C.jsx("div",{className:Ut("transition-opacity",i&&"opacity-60 duration-300",s&&"inline"),children:t}):s?C.jsx("span",{className:"opacity-60",children:"—"}):C.jsx("div",{className:"h-[400px] flex flex-row items-center justify-center",children:C.jsx(Ew,{})})}const Ew=st.div`
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #eceef1;
box-shadow:
16px 0 #eceef1,
-16px 0 #eceef1;
position: relative;
animation: loadingPulse 0.5s ease-out infinite alternate;
`;function xw({percentAccepted:i,percentOpened:e,loading:t}){const s=qi(i)||qi(e)?0:i+e;return C.jsxs(Rw,{children:[C.jsxs("svg",{viewBox:"0 0 36 36",className:"donut-chart",children:[C.jsx("path",{className:"bg",d:`M18 2.0845
a 15.9155 15.9155 0 0 1 0 31.831
a 15.9155 15.9155 0 0 1 0 -31.831`}),s?C.jsx("path",{className:"line-yellow",strokeDasharray:`${s||0}, 100`,d:`M18 2.0845
a 15.9155 15.9155 0 0 1 0 31.831
a 15.9155 15.9155 0 0 1 0 -31.831`}):null,i?C.jsx("path",{className:"line-green",strokeDasharray:`${i||0}, 100`,d:`M18 2.0845
a 15.9155 15.9155 0 0 1 0 31.831
a 15.9155 15.9155 0 0 1 0 -31.831`}):null]}),C.jsx("div",{className:"absolute top-0 left-0 right-0 bottom-0 flex flex-row items-center justify-center",children:C.jsxs("div",{className:"font-medium text-[48px] text-[#10b983] text-center",children:[C.jsx("div",{className:"text-[48px] leading-snug",children:C.jsxs(wt,{loading:t,dataPresent:!qi(i),inline:!0,children:[i,"%"]})}),C.jsx("div",{className:"text-xl leading-snug",children:"accepted"})]})})]})}const Rw=st.div.attrs({className:"flex flex-row justify-center relative"})`
.donut-chart {
max-width: 85%;
max-height: 300px;
display: block;
}
.bg {
fill: none;
stroke: #f5f5f5;
stroke-width: 2.5;
}
.line-green,
.line-yellow {
fill: none;
stroke-width: 2.5;
stroke-linecap: round;
}
.line-green {
stroke: #34d399;
//animation: progress 2s ease-out forwards;
}
.line-yellow {
stroke: #fcd34d;
//animation: progress 2.3s ease-out forwards;
}
// Not used for now, because there are too many animations and it causes lag,
// but might in the future
@keyframes progress {
0% {
stroke-dasharray: 0 100;
}
50% {
stroke-dasharray: 0 100;
}
}
`,_s=st.div.attrs(Po("border border-gray-150 rounded-xl"))`
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.03);
`,je=S.createContext({filterClasses:null,selectedFilters:{},selectedFilterOptionsForClass:()=>[],openFilterDrawer:()=>{},setFilterDrawerPage:()=>{},toggleFilterOption:()=>{},removeAllSelectionsForFilterClass:()=>{},removeAllFilters:()=>{},selectedDateRange:{start:new Date,end:new Date,rangeType:"custom"},setSelectedDateRange:()=>{},setSelectedDateRangeFromDates:()=>{},setDateRangePreset:()=>{},setDateRangeDrawerOpen:()=>{},getGraphqlVariables:()=>({dateStart:"",dateEnd:""}),ready:!1,useRequestChartData:()=>{},planPrivilege:"none",showUpsell:()=>{}});function It(i){const e=S.useRef();return S.useEffect(()=>{qi(i)||(e.current=i)},[i]),qi(i)?e.current:i}function Dw(){const{getGraphqlVariables:i,useRequestChartData:e}=S.useContext(je),[t,{data:s,loading:r}]=Jt(Pw);e(()=>{t({variables:{params:i()}})});const o=s?.reportChart?.acceptanceRate,n=It(o);return C.jsx(_s,{className:"flex-1",children:C.jsxs("div",{className:"p-8 flex flex-col justify-between h-full",children:[C.jsx("div",{className:"text-gray-700 font-medium text-xl text-center",children:"Acceptance rate"}),C.jsxs(C.Fragment,{children:[C.jsx(xw,{percentAccepted:n?.percentAccepted,percentOpened:n?.percentOpened,loading:r}),C.jsxs("div",{className:"font-medium text-xl text-center",children:[C.jsxs("div",{className:"text-[#cc9a00]",children:[C.jsx(wt,{loading:r,dataPresent:!qi(n?.percentOpened),inline:!0,children:n?.percentOpened}),"% opened, haven’t accepted"]}),C.jsxs("div",{className:"text-gray-400",children:[C.jsx(wt,{loading:r,dataPresent:!qi(n?.percentNotOpened),inline:!0,children:n?.percentNotOpened}),"% haven’t opened"]})]})]})]})})}const Pw=zt`
query ReportCharts_AcceptanceRate($params: ReportParamsInput!) {
reportChart(params: $params) {
acceptanceRate {
percentAccepted
percentOpened
percentNotOpened
}
}
}
`,om=S.createContext({onExpandGift:()=>{}}),Tw=i=>S.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("path",{d:"M10 2H14V6",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M6 14H2V10",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M14.0007 2L9.33398 6.66667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M2 13.9997L6.66667 9.33301",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}));function Aw(i){const e=S.useContext(om);return C.jsxs(Fw,{children:[C.jsx("span",{className:"font-medium",children:i.value}),C.jsxs("button",{className:"grid-expand-button",onClick:()=>e.onExpandGift(i.data),children:[C.jsx(Tw,{}),C.jsx("span",{children:"Expand"})]})]})}const Fw=Dt.div`
relative
[&_button.grid-expand-button]:absolute [&_button.grid-expand-button]:top-1 [&_button.grid-expand-button]:right-0 [&_button.grid-expand-button]:bottom-1 [&_button.grid-expand-button]:bg-white [&_button.grid-expand-button]:shadow-min [&_button.grid-expand-button]:px-2 [&_button.grid-expand-button]:flex [&_button.grid-expand-button]:flex-row [&_button.grid-expand-button]:items-center [&_button.grid-expand-button]:justify-center [&_button.grid-expand-button]:gap-2 [&_button.grid-expand-button]:rounded-lg [&_button.grid-expand-button]:font-medium [&_button.grid-expand-button]:text-gray-700 [&_button.grid-expand-button]:opacity-0
[&_button.grid-expand-button]:hover:bg-gray-050
[&_button.grid-expand-button]:active:bg-gray-100 [&_button.grid-expand-button]:active:scale-95 [&_button.grid-expand-button]:active:transition-transform
`;function Mw(i){return C.jsx("div",{className:"flex flex-row items-center",children:C.jsx(Lw,{status:i.value,children:$y(i.value)})})}function Lw({status:i,children:e}){return C.jsx("div",{className:Ut("bg-gray-100 rounded-full text-gray-600 font-medium px-4 text-center h-[28px] flex flex-row items-center justify-center w-full",(i==="CREATED"||i==="NOTIFIED")&&"bg-gray-100",i==="OPENED"&&"bg-gray-200 text-gray-700",(i==="ACCEPTED"||i==="PENDING_PAYMENT"||i==="PAID"||i==="ORDERED")&&"bg-green-100 text-green-600",i==="SHIPPED"&&"bg-blue-100 text-blue-600",i==="DELIVERED"&&"bg-primary-new-050 text-primary-new-600"),children:e})}const La={"Recipient Full Name":{type:"string",width:260,pinned:"left",cellRenderer:Aw},"Recipient First Name":{type:"string",initialHide:!0},"Recipient Last Name":{type:"string",initialHide:!0},"Recipient Email":{type:"string",width:300},"Gift Status":{type:"string",cellRenderer:Mw,width:160},"Date Created":{type:"date",sort:"desc"},ID:{type:"string"},"Workspace Name":{type:"string"},"Sender Full Name":{type:"string"},"Sender First Name":{type:"string",initialHide:!0},"Sender Last Name":{type:"string",initialHide:!0},"Sender Email":{type:"string",width:300},"Sender Title":{type:"string",initialHide:!0},"From Name":{type:"string",width:240},Message:{type:"string",autoHeight:!0,wrapText:!0,width:400},Products:{type:"string",autoHeight:!0,wrapText:!0,width:400},"Original Pre-Swap Products":{type:"string",autoHeight:!0,wrapText:!0,width:400},"Is Swapped":{type:"string"},"Thank You Note":{type:"string",autoHeight:!0,wrapText:!0,width:400},"Individual Gift URL":{type:"string",width:400},"Card Image URL":{type:"string",initialHide:!0},"Gift Batch ID":{type:"string"},"Gift Batch Name":{type:"string"},"Gift Batch Recipient Count":{type:"number",initialHide:!0},"Date Opened":{type:"date"},"Date Accepted":{type:"date"},"Date Paid":{type:"date",initialHide:!0},"Date Shipped":{type:"date"},"Date Delivered":{type:"date"},"Date Canceled":{type:"date",initialHide:!0},"Timestamp Created":{type:"timestamp",initialHide:!0},"Timestamp Opened":{type:"timestamp",initialHide:!0},"Timestamp Accepted":{type:"timestamp",initialHide:!0},"Timestamp Paid":{type:"timestamp",initialHide:!0},"Timestamp Shipped":{type:"timestamp",initialHide:!0},"Timestamp Delivered":{type:"timestamp",initialHide:!0},"Timestamp Canceled":{type:"timestamp",initialHide:!0},"Amount Product":{type:"currency"},"Amount Shipping":{type:"currency"},"Amount Processing Fee":{type:"currency"},"Amount Credit Applied":{type:"currency"},"Amount Pre-Tax Total":{type:"currency"},"Amount Estimated Total With Estimated Tax":{type:"currency",initialHide:!0},"Amount Tax":{type:"currency"},"Amount Total":{type:"currency"},"Amount Global Relay Cost":{type:"currency",initialHide:!0},"Original Pre-Swap Amount Product":{type:"currency",initialHide:!0},"Original Pre-Swap Amount Shipping":{type:"currency",initialHide:!0},"Original Pre-Swap Amount Credit Applied":{type:"currency",initialHide:!0},"Original Pre-Swap Amount Pre-Tax Total":{type:"currency",initialHide:!0},"Recipient View Count":{type:"number",width:220},"Meeting Scheduled":{type:"string"},"Payment Method":{type:"string",initialHide:!0},"Autogift Type":{type:"string"},"Autogift Tenure Year":{type:"number",initialHide:!0},"Autogift Tenure Rule Configuration":{type:"string",initialHide:!0},"Recipient Job Title":{type:"string",initialHide:!0},"Recipient Team":{type:"string",initialHide:!0},"Receipt ID":{type:"string",initialHide:!0},"Refund Receipt ID":{type:"string",initialHide:!0}},$u={"Recipient Information":["Recipient Full Name","Recipient First Name","Recipient Last Name","Recipient Email"],"Gift Information":["Gift Status","Date Created","ID","Workspace Name","Individual Gift URL"],Sender:["Sender Full Name","Sender First Name","Sender Last Name","Sender Email","Sender Title","From Name"],"Gift Content":["Message","Products","Original Pre-Swap Products","Is Swapped","Thank You Note","Card Image URL"],"Gift Batch":["Gift Batch ID","Gift Batch Name","Gift Batch Recipient Count"],Dates:["Date Created","Date Opened","Date Accepted","Date Paid","Date Shipped","Date Delivered","Date Canceled"],Timestamps:["Timestamp Created","Timestamp Opened","Timestamp Accepted","Timestamp Paid","Timestamp Shipped","Timestamp Delivered","Timestamp Canceled"],Amounts:["Amount Product","Amount Shipping","Amount Processing Fee","Amount Credit Applied","Amount Pre-Tax Total","Amount Estimated Total With Estimated Tax","Amount Tax","Amount Total","Amount Global Relay Cost"],"Original Pre-Swap Amounts":["Original Pre-Swap Amount Product","Original Pre-Swap Amount Shipping","Original Pre-Swap Amount Credit Applied","Original Pre-Swap Amount Pre-Tax Total"],Autogift:["Autogift Type","Autogift Tenure Year","Autogift Tenure Rule Configuration"],"Other Information":["Recipient View Count","Meeting Scheduled","Payment Method","Recipient Job Title","Recipient Team","Receipt ID","Refund Receipt ID"]},Iw=Object.fromEntries(Object.keys(La).map(i=>[i,!La[i].initialHide])),Ow={string:"agTextColumnFilter",number:"agNumberColumnFilter",currency:"agNumberColumnFilter",date:"agDateColumnFilter",timestamp:void 0},Nw={string:void 0,number:"numericColumn",currency:"currencyColumn",date:"dateColumn",timestamp:"timestampColumn"},kw=Object.keys(La).map(i=>{const e=La[i];return{field:i,filter:Ow[e.type],type:Nw[e.type],initialHide:e.initialHide,width:e.width,sort:e.sort,floatingFilter:e.type!=="timestamp",headerClass:e.type==="currency"?"ag-right-aligned-header":void 0,cellClass:e.type==="currency"?"ag-right-aligned-cell":void 0,pinned:e.pinned,cellRenderer:e.cellRenderer}}),Gw={sortable:!0,resizable:!0},Vw={dateColumn:{filter:"agDateColumnFilter",valueFormatter:i=>i.value?ww(to(i.value),"MM/dd/yyyy"):i.value,filterParams:{browserDatePicker:!0,inRangeInclusive:!0,suppressAndOrCondition:!0,comparator:(i,e)=>{if(!i||!e)return 0;const t=i instanceof Date?i:to(i),s=e instanceof Date?e:to(e);return s<t?-1:s>t?1:0}}},currencyColumn:{valueFormatter:({value:i})=>i==null?"":fw(i)?"$"+i.toFixed(2):i,filterParams:{suppressAndOrCondition:!0}}},Hw=i=>S.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("path",{d:"M15 18L9 12L15 6",stroke:"#B7BCC5",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));function Sl({name:i,preHeader:e,onClose:t,onBack:s}){return C.jsx("div",{children:C.jsxs("div",{className:"flex flex-row items-start justify-between",children:[s&&C.jsx("div",{className:"-ml-3 -mt-1 mr-2",children:C.jsx("button",{className:"rounded-full p-2 hover:bg-gray-150 focus:outline-none focus-visible:bg-gray-100 active:bg-gray-200 transition-colors",onClick:s,children:C.jsx(Hw,{})})}),C.jsxs("div",{className:"font-medium text-2xl mr-auto",children:[e&&C.jsx("div",{className:"text-base text-gray-400",children:e}),i]}),C.jsx("div",{className:"-mt-1 -mr-1",children:C.jsx(Jf,{onClick:t})})]})})}const Bw=i=>S.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("path",{d:"M12.2074 4.79279C12.3949 4.98031 12.5002 5.23462 12.5002 5.49979C12.5002 5.76495 12.3949 6.01926 12.2074 6.20679L7.20741 11.2068C7.01988 11.3943 6.76557 11.4996 6.50041 11.4996C6.23524 11.4996 5.98094 11.3943 5.79341 11.2068L3.79341 9.20679C3.61125 9.01818 3.51045 8.76558 3.51273 8.50339C3.51501 8.24119 3.62018 7.99038 3.80559 7.80497C3.991 7.61956 4.24181 7.51439 4.50401 7.51211C4.7662 7.50983 5.0188 7.61063 5.20741 7.79279L6.50041 9.08579L10.7934 4.79279C10.9809 4.60532 11.2352 4.5 11.5004 4.5C11.7656 4.5 12.0199 4.60532 12.2074 4.79279Z",fill:"white"}));function Ww({open:i,onClose:e,columnVisibility:t,onChangeColumnVisibility:s}){return C.jsx(Lh,{anchor:"right",open:i,onClose:e,children:C.jsx("div",{className:"w-[424px] max-w-full h-full",children:C.jsxs("div",{className:"px-8 pt-8 pr-6",children:[C.jsx(Sl,{name:"Columns",onClose:e}),C.jsx("div",{className:"-mx-3 pt-6 pb-48",children:Object.keys($u).map(r=>{const o=$u[r];return C.jsxs("div",{className:"pb-4",children:[C.jsx("div",{className:"px-4 py-1 bg-gray-150 font-medium text-gray-600 rounded mb-[2px]",children:r}),C.jsx("div",{children:o.map(n=>C.jsxs(Uw,{className:"group",$active:t[n],onClick:()=>s(n,!t[n]),children:[C.jsx(jw,{$active:t[n],children:C.jsx(Bw,{})}),C.jsx("div",{className:"mr-auto",children:n.replaceAll("Estimated","Est.")})]},n))})]},r)})})]})})})}const jw=st.div`
${i=>i.$active?"shadow-none bg-primary-new-600 group-active:bg-primary-new-700":"shadow-inner-border-px-med bg-white group-active:bg-gray-050"}
h-4 w-4 rounded mr-3 flex flex-row items-center justify-center transition-all duration-100
`,Uw=st.button.attrs(i=>({className:Ut("flex flex-row items-center w-full px-4 py-3 relative rounded transition-all -mt-px text-gray-600","hover:bg-gray-075","active:bg-gray-100","after:absolute after:bottom-0 after:left-3 after:right-3 after:border-b after:border-gray-200 after:content-[''] after:z-[-10]",i.$active&&"text-primary-new-700")}))``;var up=Object.defineProperty,zw=Object.defineProperties,Yw=Object.getOwnPropertyDescriptor,$w=Object.getOwnPropertyDescriptors,Ku=Object.getOwnPropertySymbols,nm=Object.prototype.hasOwnProperty,am=Object.prototype.propertyIsEnumerable,Bg=(i,e,t)=>e in i?up(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,de=(i,e)=>{for(var t in e||(e={}))nm.call(e,t)&&Bg(i,t,e[t]);if(Ku)for(var t of Ku(e))am.call(e,t)&&Bg(i,t,e[t]);return i},lt=(i,e)=>zw(i,$w(e)),Kw=(i,e)=>{var t={};for(var s in i)nm.call(i,s)&&e.indexOf(s)<0&&(t[s]=i[s]);if(i!=null&&Ku)for(var s of Ku(i))e.indexOf(s)<0&&am.call(i,s)&&(t[s]=i[s]);return t},qt=(i,e)=>{for(var t in e)up(i,t,{get:e[t],enumerable:!0})},g=(i,e,t,s)=>{for(var r=s>1?void 0:s?Yw(e,t):e,o=i.length-1,n;o>=0;o--)(n=i[o])&&(r=(s?n(e,t,r):n(r))||r);return s&&r&&up(e,t,r),r},gs=(i,e)=>(t,s)=>e(t,s,i),lm={};qt(lm,{attrToBoolean:()=>Xu,attrToNumber:()=>vr,attrToString:()=>Xw,defaultComparator:()=>qw,exists:()=>K,jsonEquals:()=>Dc,makeNull:()=>Fs,missing:()=>be,missingOrEmpty:()=>zi,toStringOrNull:()=>Ia,values:()=>io});function Fs(i){return i==null||i===""?null:i}function K(i,e=!1){return i!=null&&(i!==""||e)}function be(i){return!K(i)}function zi(i){return i==null||i.length===0}function Ia(i){return i!=null&&typeof i.toString=="function"?i.toString():null}function vr(i){if(i===void 0)return;if(i===null||i==="")return null;if(typeof i=="number")return isNaN(i)?void 0:i;const e=parseInt(i,10);return isNaN(e)?void 0:e}function Xu(i){if(i!==void 0)return i===null||i===""?!1:typeof i=="boolean"?i:/true/i.test(i)}function Xw(i){if(!(i==null||i===""))return i}function Dc(i,e){const t=i?JSON.stringify(i):null,s=e?JSON.stringify(e):null;return t===s}function qw(i,e,t=!1){const s=i==null,r=e==null;if(i&&i.toNumber&&(i=i.toNumber()),e&&e.toNumber&&(e=e.toNumber()),s&&r)return 0;if(s)return-1;if(r)return 1;function o(n,a){return n>a?1:n<a?-1:0}if(typeof i!="string"||!t)return o(i,e);try{return i.localeCompare(e)}catch{return o(i,e)}}function io(i){if(i instanceof Set||i instanceof Map){const e=[];return i.forEach(t=>e.push(t)),e}return Object.values(i)}var Qw=class{constructor(){this.existingKeys={}}addExistingKeys(i){for(let e=0;e<i.length;e++)this.existingKeys[i[e]]=!0}getUniqueKey(i,e){i=Ia(i);let t=0;for(;;){let s;if(i?(s=i,t!==0&&(s+="_"+t)):e?(s=e,t!==0&&(s+="_"+t)):s=t,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);t++}}},um={};qt(um,{SKIP_JS_BUILTINS:()=>Ih,cloneObject:()=>hp,deepCloneDefinition:()=>qu,getAllValuesInObject:()=>Cr,getValueUsingField:()=>an,isNonNullObject:()=>Qu,iterateObject:()=>si,mergeDeep:()=>Ei,removeAllReferences:()=>hm});var Ih=new Set(["__proto__","constructor","prototype"]);function si(i,e){if(i!=null){if(Array.isArray(i)){for(let t=0;t<i.length;t++)e(t.toString(),i[t]);return}for(const[t,s]of Object.entries(i))e(t,s)}}function hp(i){const e={},t=Object.keys(i);for(let s=0;s<t.length;s++){if(Ih.has(t[s]))continue;const r=t[s],o=i[r];e[r]=o}return e}function qu(i,e){if(!i)return;const t=i,s={};return Object.keys(t).forEach(r=>{if(e&&e.indexOf(r)>=0||Ih.has(r))return;const o=t[r];Qu(o)&&o.constructor===Object?s[r]=qu(o):s[r]=o}),s}function Cr(i){if(!i)return[];const e=Object;if(typeof e.values=="function")return e.values(i);const t=[];for(const s in i)i.hasOwnProperty(s)&&i.propertyIsEnumerable(s)&&t.push(i[s]);return t}function Ei(i,e,t=!0,s=!1){K(e)&&si(e,(r,o)=>{if(Ih.has(r))return;let n=i[r];n!==o&&(s&&n==null&&o!=null&&typeof o=="object"&&o.constructor===Object&&(n={},i[r]=n),Qu(o)&&Qu(n)&&!Array.isArray(n)?Ei(n,o,t,s):(t||o!==void 0)&&(i[r]=o))})}function an(i,e,t){if(!e||!i)return;if(!t)return i[e];const s=e.split(".");let r=i;for(let o=0;o<s.length;o++){if(r==null)return;r=r[s[o]]}return r}function hm(i,e=[],t){Object.keys(i).forEach(n=>{typeof i[n]=="object"&&!e.includes(n)&&(i[n]=void 0)});const s=Object.getPrototypeOf(i),r={},o=n=>`AG Grid: Grid API function ${n}() cannot be called as the grid has been destroyed.
It is recommended to remove local references to the grid api. Alternatively, check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.
To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${t}`;Object.getOwnPropertyNames(s).forEach(n=>{if(typeof s[n]=="function"&&!e.includes(n)){const l=()=>{console.warn(o(n))};r[n]={value:l,writable:!0}}}),Object.defineProperties(i,r)}function Qu(i){return typeof i=="object"&&i!==null}var dm={};qt(dm,{compose:()=>Zw,debounce:()=>ci,doOnce:()=>cn,errorOnce:()=>Zr,executeAfter:()=>pm,executeInAWhile:()=>cm,executeNextVMTurn:()=>Pc,getFunctionName:()=>Oh,isFunction:()=>Nh,noop:()=>Jw,throttle:()=>Tc,waitUntil:()=>dp,warnOnce:()=>fe});var Wg={};function cn(i,e){Wg[e]||(i(),Wg[e]=!0)}function fe(i){cn(()=>console.warn("AG Grid: "+i),i)}function Zr(i){cn(()=>console.error("AG Grid: "+i),i)}function Oh(i){if(i.name)return i.name;const e=/function\s+([^\(]+)/.exec(i.toString());return e&&e.length===2?e[1].trim():null}function Nh(i){return!!(i&&i.constructor&&i.call&&i.apply)}function cm(i){pm(i,400)}var Wd=[],jd=!1;function Pc(i){Wd.push(i),!jd&&(jd=!0,window.setTimeout(()=>{const e=Wd.slice();Wd.length=0,jd=!1,e.forEach(t=>t())},0))}function pm(i,e=0){i.length>0&&window.setTimeout(()=>i.forEach(t=>t()),e)}function ci(i,e){let t;return function(...s){const r=this;window.clearTimeout(t),t=window.setTimeout(function(){i.apply(r,s)},e)}}function Tc(i,e){let t=0;return function(...s){const r=this,o=new Date().getTime();o-t<e||(t=o,i.apply(r,s))}}function dp(i,e,t=100,s){const r=new Date().getTime();let o=null,n=!1;const a=()=>{const l=new Date().getTime()-r>t;(i()||l)&&(e(),n=!0,o!=null&&(window.clearInterval(o),o=null),l&&s&&console.warn(s))};a(),n||(o=window.setInterval(a,10))}function Zw(...i){return e=>i.reduce((t,s)=>s(t),e)}var Jw=()=>{},gm=(i=>(i.CommunityCoreModule="@ag-grid-community/core",i.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",i.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",i.CsvExportModule="@ag-grid-community/csv-export",i.EnterpriseCoreModule="@ag-grid-enterprise/core",i.RowGroupingModule="@ag-grid-enterprise/row-grouping",i.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",i.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",i.MenuModule="@ag-grid-enterprise/menu",i.SetFilterModule="@ag-grid-enterprise/set-filter",i.MultiFilterModule="@ag-grid-enterprise/multi-filter",i.StatusBarModule="@ag-grid-enterprise/status-bar",i.SideBarModule="@ag-grid-enterprise/side-bar",i.RangeSelectionModule="@ag-grid-enterprise/range-selection",i.MasterDetailModule="@ag-grid-enterprise/master-detail",i.RichSelectModule="@ag-grid-enterprise/rich-select",i.GridChartsModule="@ag-grid-enterprise/charts",i.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",i.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",i.ExcelExportModule="@ag-grid-enterprise/excel-export",i.ClipboardModule="@ag-grid-enterprise/clipboard",i.SparklinesModule="@ag-grid-enterprise/sparklines",i.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",i.AngularModule="@ag-grid-community/angular",i.ReactModule="@ag-grid-community/react",i.VueModule="@ag-grid-community/vue",i))(gm||{}),kh=class Xe{static register(e){Xe.__register(e,!0,void 0)}static registerModules(e){Xe.__registerModules(e,!0,void 0)}static __register(e,t,s){Xe.runVersionChecks(e),s!==void 0?(Xe.areGridScopedModules=!0,Xe.gridModulesMap[s]===void 0&&(Xe.gridModulesMap[s]={}),Xe.gridModulesMap[s][e.moduleName]=e):Xe.globalModulesMap[e.moduleName]=e,Xe.setModuleBased(t)}static __unRegisterGridModules(e){delete Xe.gridModulesMap[e]}static __registerModules(e,t,s){Xe.setModuleBased(t),e&&e.forEach(r=>Xe.__register(r,t,s))}static isValidModuleVersion(e){const[t,s]=e.version.split(".")||[],[r,o]=Xe.currentModuleVersion.split(".")||[];return t===r&&s===o}static runVersionChecks(e){if(Xe.currentModuleVersion||(Xe.currentModuleVersion=e.version),e.version?Xe.isValidModuleVersion(e)||console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${e.moduleName}' is version ${e.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. '${e.moduleName}' is incompatible. Please update all modules to the same version.`),e.validate){const t=e.validate();t.isValid||console.error(`AG Grid: ${t.message}`)}}static setModuleBased(e){Xe.moduleBased===void 0?Xe.moduleBased=e:Xe.moduleBased!==e&&cn(()=>{console.warn("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),console.warn("Please see https://www.ag-grid.com/javascript-grid/modules/ for more information.")},"ModulePackageCheck")}static __setIsBundled(){Xe.isBundled=!0}static __assertRegistered(e,t,s){var r;if(this.__isRegistered(e,s))return!0;const o=t+e;let n;if(Xe.isBundled)n=`AG Grid: unable to use ${t} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:
<script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script>
For more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(Xe.moduleBased||Xe.moduleBased===void 0){let a=(r=Object.entries(gm).find(([l,u])=>u===e))==null?void 0:r[0];n=`AG Grid: unable to use ${t} as the ${a} is not registered${Xe.areGridScopedModules?` for gridId: ${s}`:""}. Check if you have registered the module:
import { ModuleRegistry } from '@ag-grid-community/core';
import { ${a} } from '${e}';
ModuleRegistry.registerModules([ ${a} ]);
For more info see: https://www.ag-grid.com/javascript-grid/modules/`}else n=`AG Grid: unable to use ${t} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:
import 'ag-grid-enterprise';`;return cn(()=>{console.warn(n)},o),!1}static __isRegistered(e,t){var s;return!!Xe.globalModulesMap[e]||!!((s=Xe.gridModulesMap[t])!=null&&s[e])}static __getRegisteredModules(e){return[...io(Xe.globalModulesMap),...io(Xe.gridModulesMap[e]||{})]}static __getGridRegisteredModules(e){var t;return io((t=Xe.gridModulesMap[e])!=null?t:{})||[]}static __isPackageBased(){return!Xe.moduleBased}};kh.globalModulesMap={};kh.gridModulesMap={};kh.areGridScopedModules=!1;var ze=kh,eb=class{constructor(i,e){if(this.beanWrappers={},this.destroyed=!1,!i||!i.beanClasses)return;this.contextParams=i,this.logger=e,this.logger.log(">> creating ag-Application Context"),this.createBeans();const t=this.getBeanInstances();this.wireBeans(t),this.logger.log(">> ag-Application Context ready - component is alive")}getBeanInstances(){return io(this.beanWrappers).map(i=>i.beanInstance)}createBean(i,e){if(!i)throw Error("Can't wire to bean since it is null");return this.wireBeans([i],e),i}wireBeans(i,e){this.autoWireBeans(i),this.methodWireBeans(i),this.callLifeCycleMethods(i,"preConstructMethods"),K(e)&&i.forEach(e),this.callLifeCycleMethods(i,"postConstructMethods")}createBeans(){this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)),si(this.beanWrappers,(e,t)=>{let s;t.bean.__agBeanMetaData&&t.bean.__agBeanMetaData.autowireMethods&&t.bean.__agBeanMetaData.autowireMethods.agConstructor&&(s=t.bean.__agBeanMetaData.autowireMethods.agConstructor);const r=this.getBeansForParameters(s,t.bean.name),o=new(t.bean.bind.apply(t.bean,[null,...r]));t.beanInstance=o});const i=Object.keys(this.beanWrappers).join(", ");this.logger.log(`created beans: ${i}`)}createBeanWrapper(i){const e=i.__agBeanMetaData;if(!e){let s;i.prototype.constructor?s=Oh(i.prototype.constructor):s=""+i,console.error(`Context item ${s} is not a bean`);return}const t={bean:i,beanInstance:null,beanName:e.beanName};this.beanWrappers[e.beanName]=t}autoWireBeans(i){i.forEach(e=>{this.forEachMetaDataInHierarchy(e,(t,s)=>{const r=t.agClassAttributes;r&&r.forEach(o=>{const n=this.lookupBeanInstance(s,o.beanName,o.optional);e[o.attributeName]=n})})})}methodWireBeans(i){i.forEach(e=>{this.forEachMetaDataInHierarchy(e,(t,s)=>{si(t.autowireMethods,(r,o)=>{if(r==="agConstructor")return;const n=this.getBeansForParameters(o,s);e[r].apply(e,n)})})})}forEachMetaDataInHierarchy(i,e){let t=Object.getPrototypeOf(i);for(;t!=null;){const s=t.constructor;if(s.hasOwnProperty("__agBeanMetaData")){const r=s.__agBeanMetaData,o=this.getBeanName(s);e(r,o)}t=Object.getPrototypeOf(t)}}getBeanName(i){if(i.__agBeanMetaData&&i.__agBeanMetaData.beanName)return i.__agBeanMetaData.beanName;const e=i.toString();return e.substring(9,e.indexOf("("))}getBeansForParameters(i,e){const t=[];return i&&si(i,(s,r)=>{const o=this.lookupBeanInstance(e,r);t[Number(s)]=o}),t}lookupBeanInstance(i,e,t=!1){if(this.destroyed)return this.logger.log(`AG Grid: bean reference ${e} is used after the grid is destroyed!`),null;if(e==="context")return this;if(this.contextParams.providedBeanInstances&&this.contextParams.providedBeanInstances.hasOwnProperty(e))return this.contextParams.providedBeanInstances[e];const s=this.beanWrappers[e];return s?s.beanInstance:(t||console.error(`AG Grid: unable to find bean reference ${e} while initialising ${i}`),null)}callLifeCycleMethods(i,e){i.forEach(t=>this.callLifeCycleMethodsOnBean(t,e))}callLifeCycleMethodsOnBean(i,e,t){const s={};this.forEachMetaDataInHierarchy(i,o=>{const n=o[e];n&&n.forEach(a=>{a!=t&&(s[a]=!0)})}),Object.keys(s).forEach(o=>i[o]())}getBean(i){return this.lookupBeanInstance("getBean",i,!0)}destroy(){if(this.destroyed)return;this.destroyed=!0,this.logger.log(">> Shutting down ag-Application Context");const i=this.getBeanInstances();this.destroyBeans(i),this.contextParams.providedBeanInstances=null,ze.__unRegisterGridModules(this.contextParams.gridId),this.logger.log(">> ag-Application Context shut down - component is dead")}destroyBean(i){i&&this.destroyBeans([i])}destroyBeans(i){return i?(i.forEach(e=>{this.callLifeCycleMethodsOnBean(e,"preDestroyMethods","destroy");const t=e;typeof t.destroy=="function"&&t.destroy()}),[]):[]}isDestroyed(){return this.destroyed}getGridId(){return this.contextParams.gridId}};function fm(i,e,t){const s=uo(i.constructor);s.preConstructMethods||(s.preConstructMethods=[]),s.preConstructMethods.push(e)}function J(i,e,t){const s=uo(i.constructor);s.postConstructMethods||(s.postConstructMethods=[]),s.postConstructMethods.push(e)}function vi(i,e,t){const s=uo(i.constructor);s.preDestroyMethods||(s.preDestroyMethods=[]),s.preDestroyMethods.push(e)}function le(i){return e=>{const t=uo(e);t.beanName=i}}function R(i){return(e,t,s)=>{mm(e,i,!1,e,t)}}function Ke(i){return(e,t,s)=>{mm(e,i,!0,e,t)}}function mm(i,e,t,s,r,o){if(e===null){console.error("AG Grid: Autowired name should not be null");return}const n=uo(i.constructor);n.agClassAttributes||(n.agClassAttributes=[]),n.agClassAttributes.push({attributeName:r,beanName:e,optional:t})}function Ki(i){return(e,t,s)=>{const r=typeof e=="function"?e:e.constructor;let o;if(typeof s=="number"){let n;t?(o=uo(r),n=t):(o=uo(r),n="agConstructor"),o.autowireMethods||(o.autowireMethods={}),o.autowireMethods[n]||(o.autowireMethods[n]={}),o.autowireMethods[n][s]=i}}}function uo(i){return i.hasOwnProperty("__agBeanMetaData")||(i.__agBeanMetaData={}),i.__agBeanMetaData}var ys=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={}}setBeans(i,e,t=null,s=null){if(this.frameworkOverrides=e,this.gos=i,t){const r=i.useAsyncEvents();this.addGlobalListener(t,r)}s&&this.addGlobalListener(s,!1)}setFrameworkOverrides(i){this.frameworkOverrides=i}getListeners(i,e,t){const s=e?this.allAsyncListeners:this.allSyncListeners;let r=s.get(i);return!r&&t&&(r=new Set,s.set(i,r)),r}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(i,e,t=!1){this.getListeners(i,t,!0).add(e)}removeEventListener(i,e,t=!1){const s=this.getListeners(i,t,!1);s&&(s.delete(e),s.size===0&&(t?this.allAsyncListeners:this.allSyncListeners).delete(i))}addGlobalListener(i,e=!1){(e?this.globalAsyncListeners:this.globalSyncListeners).add(i)}removeGlobalListener(i,e=!1){(e?this.globalAsyncListeners:this.globalSyncListeners).delete(i)}dispatchEvent(i){let e=i;this.gos&&this.gos.addGridCommonParams(e),this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(i){this.firedEvents[i.type]||this.dispatchEvent(i)}dispatchToListeners(i,e){var t;const s=i.type;if(e&&"event"in i){const l=i.event;l instanceof Event&&(i.eventPath=l.composedPath())}const r=(l,u)=>l.forEach(h=>{if(!u.has(h))return;const d=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>h(i)):()=>h(i);e?this.dispatchAsync(d):d()}),o=(t=this.getListeners(s,e,!1))!=null?t:new Set,n=new Set(o);n.size>0&&r(n,o),new Set(e?this.globalAsyncListeners:this.globalSyncListeners).forEach(l=>{const u=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>l(s,i)):()=>l(s,i);e?this.dispatchAsync(u):u()})}dispatchAsync(i){this.asyncFunctionsQueue.push(i),this.scheduled||(this.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)}),this.scheduled=!0)}flushAsyncQueue(){this.scheduled=!1;const i=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],i.forEach(e=>e())}};g([gs(0,Ki("gridOptionsService")),gs(1,Ki("frameworkOverrides")),gs(2,Ki("globalEventListener")),gs(3,Ki("globalSyncEventListener"))],ys.prototype,"setBeans",1);ys=g([le("eventService")],ys);var cp=class{constructor(i){this.frameworkOverrides=i,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(i){let e=i;return this.frameworkOverrides.shouldWrapOutgoing&&(e=t=>{this.frameworkOverrides.wrapOutgoing(()=>i(t))},this.wrappedListeners.set(i,e)),e}wrapGlobal(i){let e=i;return this.frameworkOverrides.shouldWrapOutgoing&&(e=(t,s)=>{this.frameworkOverrides.wrapOutgoing(()=>i(t,s))},this.wrappedGlobalListeners.set(i,e)),e}unwrap(i){var e;return(e=this.wrappedListeners.get(i))!=null?e:i}unwrapGlobal(i){var e;return(e=this.wrappedGlobalListeners.get(i))!=null?e:i}},tb={resizable:!0,sortable:!0},ib=0;function vm(){return ib++}var Ot=class Cm{constructor(e,t,s,r){this.instanceId=vm(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.eventService=new ys,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=s,this.primary=r,this.setState(e)}getInstanceId(){return this.instanceId}setState(e){e.sort!==void 0?(e.sort==="asc"||e.sort==="desc")&&(this.sort=e.sort):(e.initialSort==="asc"||e.initialSort==="desc")&&(this.sort=e.initialSort);const t=e.sortIndex,s=e.initialSortIndex;t!==void 0?t!==null&&(this.sortIndex=t):s!==null&&(this.sortIndex=s);const r=e.hide,o=e.initialHide;r!==void 0?this.visible=!r:this.visible=!o,e.pinned!==void 0?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const n=e.flex,a=e.initialFlex;n!==void 0?this.flex=n:a!==void 0&&(this.flex=a)}setColDef(e,t,s){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.eventService.dispatchEvent(this.createColumnEvent("colDefChanged",s))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}initialise(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const e=this.gos.get("suppressFieldDotNotation");this.fieldContainsDots=K(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=K(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){var e,t;const s=this.colDef;this.minWidth=(e=s.minWidth)!=null?e:this.environment.getMinColWidth(),this.maxWidth=(t=s.maxWidth)!=null?t:Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=K(this.colDef.tooltipField)||K(this.colDef.tooltipValueGetter)||K(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){var t,s;const r=(t=e.minWidth)!=null?t:this.environment.getMinColWidth(),o=(s=e.maxWidth)!=null?s:Number.MAX_SAFE_INTEGER;let n;const a=vr(e.width),l=vr(e.initialWidth);return a!=null?n=a:l!=null?n=l:n=200,Math.max(Math.min(n,o),r)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(be(this.colDef)||be(this.colDef.showRowGroup))return!1;const t=this.colDef.showRowGroup===!0,s=this.colDef.showRowGroup===e;return t||s}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}addEventListener(e,t){var s,r;this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new cp(this.frameworkOverrides));const o=(r=(s=this.frameworkEventListenerService)==null?void 0:s.wrap(t))!=null?r:t;this.eventService.addEventListener(e,o)}removeEventListener(e,t){var s,r;const o=(r=(s=this.frameworkEventListenerService)==null?void 0:s.unwrap(t))!=null?r:t;this.eventService.removeEventListener(e,o)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if(typeof this.colDef.suppressNavigable=="boolean")return this.colDef.suppressNavigable;if(typeof this.colDef.suppressNavigable=="function"){const t=this.createColumnFunctionCallbackParams(e),s=this.colDef.suppressNavigable;return s(t)}return!1}isCellEditable(e){return e.group&&!this.gos.get("enableGroupEdit")?!1:this.isColumnFunc(e,this.colDef.editable)}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){var t;return(t=this.colDef[e])!=null?t:tb[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const s=this.createColumnFunctionCallbackParams(e);return t(s)}return!1}setMoving(e,t){this.moving=e,this.eventService.dispatchEvent(this.createColumnEvent("movingChanged",t))}createColumnEvent(e,t){return this.gos.addGridCommonParams({type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,t){this.sort!==e&&(this.sort=e,this.eventService.dispatchEvent(this.createColumnEvent("sortChanged",t))),this.dispatchStateUpdatedEvent("sort")}setMenuVisible(e,t){this.menuVisible!==e&&(this.menuVisible=e,this.eventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",t)))}isMenuVisible(){return this.menuVisible}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return be(this.sort)}isSorting(){return K(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.eventService.dispatchEvent(this.createColumnEvent("leftChanged",t)))}isFilterActive(){return this.filterActive}setFilterActive(e,t,s){this.filterActive!==e&&(this.filterActive=e,this.eventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const r=this.createColumnEvent("filterChanged",t);s&&Ei(r,s),this.eventService.dispatchEvent(r)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){e===!0||e==="left"?this.pinned="left":e==="right"?this.pinned="right":this.pinned=null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.eventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",t)))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.eventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",t)))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const s=e===!0;this.visible!==s&&(this.visible=s,this.eventService.dispatchEvent(this.createColumnEvent("visibleChanged",t))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const e=this.getColDef();return!e.suppressSpanHeaderHeight&&!e.autoHeaderHeight}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let s=!0;for(;e;){if(!e.isPadding()){s=!1;break}e=e.getParent()}return{numberOfParents:t,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(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(be(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),s=this.colDef.colSpan(t);return Math.max(s,1)}getRowSpan(e){if(be(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),s=this.colDef.rowSpan(t);return Math.max(s,1)}setActualWidth(e,t,s=!1){this.minWidth!=null&&(e=Math.max(e,this.minWidth)),this.maxWidth!=null&&(e=Math.min(e,this.maxWidth)),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),s||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.eventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return this.maxWidth!=null?e>this.maxWidth:!1}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(e){this.flex!==e&&(this.flex=e),this.dispatchStateUpdatedEvent("flex")}setMinimum(e){K(this.minWidth)&&this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,t){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",t))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,t){this.pivotActive!==e&&(this.pivotActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",t))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,t){this.aggregationActive!==e&&(this.aggregationActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnValueChanged",t)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}getMenuTabs(e){fe("As of v31.1, 'getMenuTabs' is deprecated. Use 'getColDef().menuTabs ?? defaultValues' instead.");let t=this.getColDef().menuTabs;return t==null&&(t=e),t}dispatchStateUpdatedEvent(e){this.eventService.dispatchEvent({type:Cm.EVENT_STATE_UPDATED,key:e})}};Ot.EVENT_MOVING_CHANGED="movingChanged";Ot.EVENT_LEFT_CHANGED="leftChanged";Ot.EVENT_WIDTH_CHANGED="widthChanged";Ot.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged";Ot.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged";Ot.EVENT_VISIBLE_CHANGED="visibleChanged";Ot.EVENT_FILTER_CHANGED="filterChanged";Ot.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged";Ot.EVENT_SORT_CHANGED="sortChanged";Ot.EVENT_COL_DEF_CHANGED="colDefChanged";Ot.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged";Ot.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged";Ot.EVENT_PIVOT_CHANGED="columnPivotChanged";Ot.EVENT_VALUE_CHANGED="columnValueChanged";Ot.EVENT_STATE_UPDATED="columnStateUpdated";g([R("gridOptionsService")],Ot.prototype,"gos",2);g([R("environment")],Ot.prototype,"environment",2);g([R("columnHoverService")],Ot.prototype,"columnHoverService",2);g([R("frameworkOverrides")],Ot.prototype,"frameworkOverrides",2);g([J],Ot.prototype,"initialise",1);var Qe=Ot,Gh=class ya{constructor(e,t,s,r){this.localEventService=new ys,this.expandable=!1,this.instanceId=vm(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=s,this.level=r}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0)}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e;const t={type:ya.EVENT_EXPANDED_CHANGED};this.localEventService.dispatchEvent(t)}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(e){this.children&&this.children.forEach(t=>{t instanceof Qe?e.push(t):t instanceof ya&&t.addLeafColumns(e)})}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach(t=>t.addEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach(t=>t.removeEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,s=!1;const r=this.findChildrenRemovingPadding();for(let n=0,a=r.length;n<a;n++){const l=r[n];if(!l.isVisible())continue;const u=l.getColumnGroupShow();u==="open"?(e=!0,s=!0):u==="closed"?(t=!0,s=!0):(e=!0,t=!0)}const o=e&&t&&s;if(this.expandable!==o){this.expandable=o;const n={type:ya.EVENT_EXPANDABLE_CHANGED};this.localEventService.dispatchEvent(n)}}findChildrenRemovingPadding(){const e=[],t=s=>{s.forEach(r=>{r instanceof ya&&r.isPadding()?t(r.children):e.push(r)})};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}};Gh.EVENT_EXPANDED_CHANGED="expandedChanged";Gh.EVENT_EXPANDABLE_CHANGED="expandableChanged";g([vi],Gh.prototype,"destroy",1);var At=Gh,sb={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},ym={};qt(ym,{addSafePassiveEventListener:()=>Tm,createEventPath:()=>Dm,getCtrlForEventTarget:()=>Zu,getEventPath:()=>Pm,isElementInEventPath:()=>Ju,isEventSupported:()=>gp,isStopPropagationForAgGrid:()=>vs,stopPropagationForAgGrid:()=>ws});var wm={};qt(wm,{areEqual:()=>Ts,existsAndNotEmpty:()=>bm,flatten:()=>xm,forEachReverse:()=>ab,includes:()=>ki,insertArrayIntoArray:()=>Ac,insertIntoArray:()=>Oa,last:()=>We,moveInArray:()=>Fc,pushAll:()=>Mc,removeAllFromArray:()=>Em,removeAllFromUnorderedArray:()=>_m,removeFromArray:()=>_i,removeFromUnorderedArray:()=>pp,removeRepeatsFromArray:()=>ob,shallowCompare:()=>rb,sortNumerically:()=>Sm,toStrings:()=>nb});function bm(i){return i!=null&&i.length>0}function We(i){if(!(!i||!i.length))return i[i.length-1]}function Ts(i,e,t){return i==null&&e==null?!0:i!=null&&e!=null&&i.length===e.length&&i.every((s,r)=>t?t(s,e[r]):e[r]===s)}function rb(i,e){return Ts(i,e)}function Sm(i){return i.sort((e,t)=>e-t)}function ob(i,e){if(i)for(let t=i.length-2;t>=0;t--){const s=i[t]===e,r=i[t+1]===e;s&&r&&i.splice(t+1,1)}}function pp(i,e){const t=i.indexOf(e);t>=0&&(i[t]=i[i.length-1],i.pop())}function _i(i,e){const t=i.indexOf(e);t>=0&&i.splice(t,1)}function _m(i,e){for(let t=0;t<e.length;t++)pp(i,e[t])}function Em(i,e){for(let t=0;t<e.length;t++)_i(i,e[t])}function Oa(i,e,t){i.splice(t,0,e)}function Ac(i,e,t){if(!(i==null||e==null))for(let s=e.length-1;s>=0;s--){const r=e[s];Oa(i,r,t)}}function Fc(i,e,t){Em(i,e),e.slice().reverse().forEach(s=>Oa(i,s,t))}function ki(i,e){return i.indexOf(e)>-1}function xm(i){return[].concat.apply([],i)}function Mc(i,e){e==null||i==null||e.forEach(t=>i.push(t))}function nb(i){return i.map(Ia)}function ab(i,e){if(i!=null)for(let t=i.length-1;t>=0;t--)e(i[t],t)}var Rm="__ag_Grid_Stop_Propagation",lb=["touchstart","touchend","touchmove","touchcancel","scroll"],Ud={};function ws(i){i[Rm]=!0}function vs(i){return i[Rm]===!0}var gp=(()=>{const i={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if(typeof Ud[t]=="boolean")return Ud[t];const s=document.createElement(i[t]||"div");return t="on"+t,Ud[t]=t in s}})();function Zu(i,e,t){let s=e;for(;s;){const r=i.getDomData(s,t);if(r)return r;s=s.parentElement}return null}function Ju(i,e){return!e||!i?!1:Pm(e).indexOf(i)>=0}function Dm(i){const e=[];let t=i.target;for(;t;)e.push(t),t=t.parentElement;return e}function Pm(i){const e=i;return e.path?e.path:e.composedPath?e.composedPath():Dm(e)}function Tm(i,e,t,s){const o=ki(lb,t)?{passive:!0}:void 0;i&&i.addEventListener&&i.addEventListener(e,t,s,o)}var Zs=class Am{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(){for(let e=0;e<this.destroyFunctions.length;e++)this.destroyFunctions[e]();this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchEvent({type:Am.EVENT_DESTROYED})}addEventListener(e,t){this.localEventService||(this.localEventService=new ys),this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService&&this.localEventService.removeEventListener(e,t)}dispatchEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedListener(e,t,s){if(this.destroyed)return;e instanceof HTMLElement?Tm(this.getFrameworkOverrides(),e,t,s):e.addEventListener(t,s);const r=()=>(e.removeEventListener(t,s),null);return this.destroyFunctions.push(r),()=>(r(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==r),null)}setupGridOptionListener(e,t){this.gos.addEventListener(e,t);const s=()=>(this.gos.removeEventListener(e,t),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(r=>r!==s),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const s=e.join("-")+this.propertyListenerId++,r=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[s])return;this.lastChangeSetIdLookup[s]=o.changeSet.id}const n={type:"gridPropertyChanged",changeSet:o.changeSet,source:o.source};t(n)};e.forEach(o=>this.setupGridOptionListener(o,r))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const s=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),s}createBean(e,t,s){return(t||this.getContext()).createBean(e,s)}destroyBean(e,t){return(t||this.getContext()).destroyBean(e)}destroyBeans(e,t){if(e)for(let s=0;s<e.length;s++)this.destroyBean(e[s],t);return[]}};Zs.EVENT_DESTROYED="destroyed";g([R("frameworkOverrides")],Zs.prototype,"frameworkOverrides",2);g([R("context")],Zs.prototype,"context",2);g([R("eventService")],Zs.prototype,"eventService",2);g([R("gridOptionsService")],Zs.prototype,"gos",2);g([R("localeService")],Zs.prototype,"localeService",2);g([R("environment")],Zs.prototype,"environment",2);g([vi],Zs.prototype,"destroy",1);var Z=Zs,Na=class extends Z{setBeans(i){this.logger=i.create("ColumnFactory")}createColumnTree(i,e,t,s){const r=new Qw,{existingCols:o,existingGroups:n,existingColKeys:a}=this.extractExistingTreeData(t);r.addExistingKeys(a);const l=this.recursivelyCreateColumns(i,0,e,o,r,n,s),u=this.findMaxDept(l,0);this.logger.log("Number of levels for grouped columns is "+u);const h=this.balanceColumnTree(l,0,u,r);return Us(null,h,(c,p)=>{c instanceof At&&c.setupExpandable(),c.setOriginalParent(p)}),{columnTree:h,treeDept:u}}extractExistingTreeData(i){const e=[],t=[],s=[];return i&&Us(null,i,r=>{if(r instanceof At){const o=r;t.push(o)}else{const o=r;s.push(o.getId()),e.push(o)}}),{existingCols:e,existingGroups:t,existingColKeys:s}}createForAutoGroups(i,e){return i.map(t=>this.createAutoGroupTreeItem(e,t))}createAutoGroupTreeItem(i,e){const t=this.findDepth(i);let s=e;for(let r=t-1;r>=0;r--){const o=new At(null,`FAKE_PATH_${e.getId()}}_${r}`,!0,r);this.createBean(o),o.setChildren([s]),s.setOriginalParent(o),s=o}return t===0&&e.setOriginalParent(null),s}findDepth(i){let e=0,t=i;for(;t&&t[0]&&t[0]instanceof At;)e++,t=t[0].getChildren();return e}balanceColumnTree(i,e,t,s){const r=[];for(let o=0;o<i.length;o++){const n=i[o];if(n instanceof At){const a=n,l=this.balanceColumnTree(a.getChildren(),e+1,t,s);a.setChildren(l),r.push(a)}else{let a,l;for(let u=t-1;u>=e;u--){const h=s.getUniqueKey(null,null),d=this.createMergedColGroupDef(null),c=new At(d,h,!0,e);this.createBean(c),l&&l.setChildren([c]),l=c,a||(a=l)}if(a&&l)if(r.push(a),i.some(h=>h instanceof At)){l.setChildren([n]);continue}else{l.setChildren(i);break}r.push(n)}}return r}findMaxDept(i,e){let t=e;for(let s=0;s<i.length;s++){const r=i[s];if(r instanceof At){const o=r,n=this.findMaxDept(o.getChildren(),e+1);t<n&&(t=n)}}return t}recursivelyCreateColumns(i,e,t,s,r,o,n){if(!i)return[];const a=new Array(i.length);for(let l=0;l<a.length;l++){const u=i[l];this.isColumnGroup(u)?a[l]=this.createColumnGroup(t,u,e,s,r,o,n):a[l]=this.createColumn(t,u,s,r,n)}return a}createColumnGroup(i,e,t,s,r,o,n){const a=this.createMergedColGroupDef(e),l=r.getUniqueKey(a.groupId||null,null),u=new At(a,l,!1,t);this.createBean(u);const h=this.findExistingGroup(e,o);h&&o.splice(h.idx,1);let d=h?.group;d&&u.setExpanded(d.isExpanded());const c=this.recursivelyCreateColumns(a.children,t+1,i,s,r,o,n);return u.setChildren(c),u}createMergedColGroupDef(i){const e={};return Object.assign(e,this.gos.get("defaultColGroupDef")),Object.assign(e,i),e}createColumn(i,e,t,s,r){const o=this.findExistingColumn(e,t);o&&t?.splice(o.idx,1);let n=o?.column;if(n){const a=this.addColumnDefaultAndTypes(e,n.getColId());n.setColDef(a,e,r),this.applyColumnState(n,a,r)}else{const a=s.getUniqueKey(e.colId,e.field),l=this.addColumnDefaultAndTypes(e,a);n=new Qe(l,e,a,i),this.context.createBean(n)}return this.dataTypeService.addColumnListeners(n),n}applyColumnState(i,e,t){const s=vr(e.flex);if(s!==void 0&&i.setFlex(s),i.getFlex()<=0){const a=vr(e.width);if(a!=null)i.setActualWidth(a,t);else{const l=i.getActualWidth();i.setActualWidth(l,t)}}e.sort!==void 0&&(e.sort=="asc"||e.sort=="desc"?i.setSort(e.sort,t):i.setSort(void 0,t));const o=vr(e.sortIndex);o!==void 0&&i.setSortIndex(o);const n=Xu(e.hide);n!==void 0&&i.setVisible(!n,t),e.pinned!==void 0&&i.setPinned(e.pinned)}findExistingColumn(i,e){if(e)for(let t=0;t<e.length;t++){const s=e[t].getUserProvidedColDef();if(!s)continue;if(i.colId!=null){if(e[t].getId()===i.colId)return{idx:t,column:e[t]};continue}if(i.field!=null){if(s.field===i.field)return{idx:t,column:e[t]};continue}if(s===i)return{idx:t,column:e[t]}}}findExistingGroup(i,e){if(i.groupId!=null)for(let s=0;s<e.length;s++){const r=e[s];if(r.getColGroupDef()&&r.getId()===i.groupId)return{idx:s,group:r}}}addColumnDefaultAndTypes(i,e){const t={},s=this.gos.get("defaultColDef");Ei(t,s,!1,!0);const r=this.dataTypeService.updateColDefAndGetColumnType(t,i,e);r&&this.assignColumnTypes(r,t),Ei(t,i,!1,!0);const o=this.gos.get("autoGroupColumnDef"),n=this.gos.isColumnsSortingCoupledToGroup();return i.rowGroup&&o&&n&&Ei(t,{sort:o.sort,initialSort:o.initialSort},!1,!0),this.dataTypeService.validateColDef(t),t}assignColumnTypes(i,e){if(!i.length)return;const t=Object.assign({},sb),s=this.gos.get("columnTypes")||{};si(s,(r,o)=>{r in t?console.warn(`AG Grid: the column type '${r}' is a default column type and cannot be overridden.`):(o.type&&fe("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."),t[r]=o)}),i.forEach(r=>{const o=t[r.trim()];o?Ei(e,o,!1,!0):console.warn("AG Grid: colDef.type '"+r+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(i){return i.children!==void 0}};g([R("dataTypeService")],Na.prototype,"dataTypeService",2);g([gs(0,Ki("loggerFactory"))],Na.prototype,"setBeans",1);Na=g([le("columnFactory")],Na);function Us(i,e,t){if(e)for(let s=0;s<e.length;s++){const r=e[s];r instanceof At&&Us(r,r.getChildren(),t),t(r,i)}}var Vh=class Ds{constructor(e,t,s,r){this.displayedChildren=[],this.localEventService=new ys,this.groupId=t,this.partId=s,this.providedColumnGroup=e,this.pinned=r}static createUniqueId(e,t){return e+"_"+t}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return Ds.createUniqueId(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!e||e.length===0?!1:e.every(t=>t.isMoving())}checkLeft(){if(this.displayedChildren.forEach(e=>{e instanceof Ds&&e.checkLeft()}),this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const t=We(this.displayedChildren).getLeft();this.setLeft(t)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.localEventService.dispatchEvent(this.createAgEvent(Ds.EVENT_LEFT_CHANGED)))}getPinned(){return this.pinned}createAgEvent(e){return{type:e}}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}getGroupId(){return this.groupId}getPartId(){return this.partId}isChildInThisGroupDeepSearch(e){let t=!1;return this.children.forEach(s=>{e===s&&(t=!0),s instanceof Ds&&s.isChildInThisGroupDeepSearch(e)&&(t=!0)}),t}getActualWidth(){let e=0;return this.displayedChildren&&this.displayedChildren.forEach(t=>{e+=t.getActualWidth()}),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach(t=>{t.isResizable()&&(e=!0)}),e}getMinWidth(){let e=0;return this.displayedChildren.forEach(t=>{e+=t.getMinWidth()||0}),e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}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(e){this.providedColumnGroup.setExpanded(e)}addDisplayedLeafColumns(e){this.displayedChildren.forEach(t=>{t instanceof Qe?e.push(t):t instanceof Ds&&t.addDisplayedLeafColumns(e)})}addLeafColumns(e){this.children.forEach(t=>{t instanceof Qe?e.push(t):t instanceof Ds&&t.addLeafColumns(e)})}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return!this.isPadding()||!e||!e.isPadding()?0:1+e.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e!=null&&e.isPadding();)e=e.getParent();if(!(e?e.providedColumnGroup.isExpandable():!1)){this.displayedChildren=this.children,this.localEventService.dispatchEvent(this.createAgEvent(Ds.EVENT_DISPLAYED_CHILDREN_CHANGED));return}this.children.forEach(s=>{if(s instanceof Ds&&(!s.displayedChildren||!s.displayedChildren.length))return;switch(s.getColumnGroupShow()){case"open":e.providedColumnGroup.isExpanded()&&this.displayedChildren.push(s);break;case"closed":e.providedColumnGroup.isExpanded()||this.displayedChildren.push(s);break;default:this.displayedChildren.push(s);break}}),this.localEventService.dispatchEvent(this.createAgEvent(Ds.EVENT_DISPLAYED_CHILDREN_CHANGED))}};Vh.EVENT_LEFT_CHANGED="leftChanged";Vh.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged";g([R("gridOptionsService")],Vh.prototype,"gos",2);var jt=Vh,b=class{};b.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged";b.EVENT_NEW_COLUMNS_LOADED="newColumnsLoaded";b.EVENT_COLUMN_PIVOT_MODE_CHANGED="columnPivotModeChanged";b.EVENT_PIVOT_MAX_COLUMNS_EXCEEDED="pivotMaxColumnsExceeded";b.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged";b.EVENT_EXPAND_COLLAPSE_ALL="expandOrCollapseAll";b.EVENT_COLUMN_PIVOT_CHANGED="columnPivotChanged";b.EVENT_GRID_COLUMNS_CHANGED="gridColumnsChanged";b.EVENT_COLUMN_VALUE_CHANGED="columnValueChanged";b.EVENT_COLUMN_MOVED="columnMoved";b.EVENT_COLUMN_VISIBLE="columnVisible";b.EVENT_COLUMN_PINNED="columnPinned";b.EVENT_COLUMN_GROUP_OPENED="columnGroupOpened";b.EVENT_COLUMN_RESIZED="columnResized";b.EVENT_DISPLAYED_COLUMNS_CHANGED="displayedColumnsChanged";b.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED="suppressMovableColumns";b.EVENT_SUPPRESS_MENU_HIDE_CHANGED="suppressMenuHide";b.EVENT_SUPPRESS_FIELD_DOT_NOTATION="suppressFieldDotNotation";b.EVENT_VIRTUAL_COLUMNS_CHANGED="virtualColumnsChanged";b.EVENT_COLUMN_HEADER_MOUSE_OVER="columnHeaderMouseOver";b.EVENT_COLUMN_HEADER_MOUSE_LEAVE="columnHeaderMouseLeave";b.EVENT_COLUMN_HEADER_CLICKED="columnHeaderClicked";b.EVENT_COLUMN_HEADER_CONTEXT_MENU="columnHeaderContextMenu";b.EVENT_ASYNC_TRANSACTIONS_FLUSHED="asyncTransactionsFlushed";b.EVENT_ROW_GROUP_OPENED="rowGroupOpened";b.EVENT_ROW_DATA_UPDATED="rowDataUpdated";b.EVENT_PINNED_ROW_DATA_CHANGED="pinnedRowDataChanged";b.EVENT_RANGE_SELECTION_CHANGED="rangeSelectionChanged";b.EVENT_CHART_CREATED="chartCreated";b.EVENT_CHART_RANGE_SELECTION_CHANGED="chartRangeSelectionChanged";b.EVENT_CHART_OPTIONS_CHANGED="chartOptionsChanged";b.EVENT_CHART_DESTROYED="chartDestroyed";b.EVENT_TOOL_PANEL_VISIBLE_CHANGED="toolPanelVisibleChanged";b.EVENT_TOOL_PANEL_SIZE_CHANGED="toolPanelSizeChanged";b.EVENT_COLUMN_PANEL_ITEM_DRAG_START="columnPanelItemDragStart";b.EVENT_COLUMN_PANEL_ITEM_DRAG_END="columnPanelItemDragEnd";b.EVENT_MODEL_UPDATED="modelUpdated";b.EVENT_CUT_START="cutStart";b.EVENT_CUT_END="cutEnd";b.EVENT_PASTE_START="pasteStart";b.EVENT_PASTE_END="pasteEnd";b.EVENT_FILL_START="fillStart";b.EVENT_FILL_END="fillEnd";b.EVENT_RANGE_DELETE_START="rangeDeleteStart";b.EVENT_RANGE_DELETE_END="rangeDeleteEnd";b.EVENT_UNDO_STARTED="undoStarted";b.EVENT_UNDO_ENDED="undoEnded";b.EVENT_REDO_STARTED="redoStarted";b.EVENT_REDO_ENDED="redoEnded";b.EVENT_KEY_SHORTCUT_CHANGED_CELL_START="keyShortcutChangedCellStart";b.EVENT_KEY_SHORTCUT_CHANGED_CELL_END="keyShortcutChangedCellEnd";b.EVENT_CELL_CLICKED="cellClicked";b.EVENT_CELL_DOUBLE_CLICKED="cellDoubleClicked";b.EVENT_CELL_MOUSE_DOWN="cellMouseDown";b.EVENT_CELL_CONTEXT_MENU="cellContextMenu";b.EVENT_CELL_VALUE_CHANGED="cellValueChanged";b.EVENT_CELL_EDIT_REQUEST="cellEditRequest";b.EVENT_ROW_VALUE_CHANGED="rowValueChanged";b.EVENT_CELL_FOCUSED="cellFocused";b.EVENT_CELL_FOCUS_CLEARED="cellFocusCleared";b.EVENT_FULL_WIDTH_ROW_FOCUSED="fullWidthRowFocused";b.EVENT_ROW_SELECTED="rowSelected";b.EVENT_SELECTION_CHANGED="selectionChanged";b.EVENT_TOOLTIP_SHOW="tooltipShow";b.EVENT_TOOLTIP_HIDE="tooltipHide";b.EVENT_CELL_KEY_DOWN="cellKeyDown";b.EVENT_CELL_MOUSE_OVER="cellMouseOver";b.EVENT_CELL_MOUSE_OUT="cellMouseOut";b.EVENT_FILTER_CHANGED="filterChanged";b.EVENT_FILTER_MODIFIED="filterModified";b.EVENT_FILTER_OPENED="filterOpened";b.EVENT_ADVANCED_FILTER_BUILDER_VISIBLE_CHANGED="advancedFilterBuilderVisibleChanged";b.EVENT_SORT_CHANGED="sortChanged";b.EVENT_VIRTUAL_ROW_REMOVED="virtualRowRemoved";b.EVENT_ROW_CLICKED="rowClicked";b.EVENT_ROW_DOUBLE_CLICKED="rowDoubleClicked";b.EVENT_GRID_READY="gridReady";b.EVENT_GRID_PRE_DESTROYED="gridPreDestroyed";b.EVENT_GRID_SIZE_CHANGED="gridSizeChanged";b.EVENT_VIEWPORT_CHANGED="viewportChanged";b.EVENT_SCROLLBAR_WIDTH_CHANGED="scrollbarWidthChanged";b.EVENT_FIRST_DATA_RENDERED="firstDataRendered";b.EVENT_DRAG_STARTED="dragStarted";b.EVENT_DRAG_STOPPED="dragStopped";b.EVENT_CHECKBOX_CHANGED="checkboxChanged";b.EVENT_ROW_EDITING_STARTED="rowEditingStarted";b.EVENT_ROW_EDITING_STOPPED="rowEditingStopped";b.EVENT_CELL_EDITING_STARTED="cellEditingStarted";b.EVENT_CELL_EDITING_STOPPED="cellEditingStopped";b.EVENT_BODY_SCROLL="bodyScroll";b.EVENT_BODY_SCROLL_END="bodyScrollEnd";b.EVENT_HEIGHT_SCALE_CHANGED="heightScaleChanged";b.EVENT_PAGINATION_CHANGED="paginationChanged";b.EVENT_COMPONENT_STATE_CHANGED="componentStateChanged";b.EVENT_STORE_REFRESHED="storeRefreshed";b.EVENT_STATE_UPDATED="stateUpdated";b.EVENT_COLUMN_MENU_VISIBLE_CHANGED="columnMenuVisibleChanged";b.EVENT_CONTEXT_MENU_VISIBLE_CHANGED="contextMenuVisibleChanged";b.EVENT_BODY_HEIGHT_CHANGED="bodyHeightChanged";b.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED="columnContainerWidthChanged";b.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED="displayedColumnsWidthChanged";b.EVENT_SCROLL_VISIBILITY_CHANGED="scrollVisibilityChanged";b.EVENT_COLUMN_HOVER_CHANGED="columnHoverChanged";b.EVENT_FLASH_CELLS="flashCells";b.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED="paginationPixelOffsetChanged";b.EVENT_DISPLAYED_ROWS_CHANGED="displayedRowsChanged";b.EVENT_LEFT_PINNED_WIDTH_CHANGED="leftPinnedWidthChanged";b.EVENT_RIGHT_PINNED_WIDTH_CHANGED="rightPinnedWidthChanged";b.EVENT_ROW_CONTAINER_HEIGHT_CHANGED="rowContainerHeightChanged";b.EVENT_HEADER_HEIGHT_CHANGED="headerHeightChanged";b.EVENT_COLUMN_HEADER_HEIGHT_CHANGED="columnHeaderHeightChanged";b.EVENT_ROW_DRAG_ENTER="rowDragEnter";b.EVENT_ROW_DRAG_MOVE="rowDragMove";b.EVENT_ROW_DRAG_LEAVE="rowDragLeave";b.EVENT_ROW_DRAG_END="rowDragEnd";b.EVENT_GRID_STYLES_CHANGED="gridStylesChanged";b.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST="columnRowGroupChangeRequest";b.EVENT_COLUMN_PIVOT_CHANGE_REQUEST="columnPivotChangeRequest";b.EVENT_COLUMN_VALUE_CHANGE_REQUEST="columnValueChangeRequest";b.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST="columnAggFuncChangeRequest";b.EVENT_STORE_UPDATED="storeUpdated";b.EVENT_FILTER_DESTROYED="filterDestroyed";b.EVENT_ROW_DATA_UPDATE_STARTED="rowDataUpdateStarted";b.EVENT_ROW_COUNT_READY="rowCountReady";b.EVENT_ADVANCED_FILTER_ENABLED_CHANGED="advancedFilterEnabledChanged";b.EVENT_DATA_TYPES_INFERRED="dataTypesInferred";b.EVENT_FIELD_VALUE_CHANGED="fieldValueChanged";b.EVENT_FIELD_PICKER_VALUE_SELECTED="fieldPickerValueSelected";b.EVENT_SIDE_BAR_UPDATED="sideBarUpdated";var Iu=new Set([b.EVENT_GRID_PRE_DESTROYED,b.EVENT_FILL_START]),Fm=class{constructor(){this.existingIds={}}getInstanceIdForKey(i){const e=this.existingIds[i];let t;return typeof e!="number"?t=0:t=e+1,this.existingIds[i]=t,t}},pn="ag-Grid-AutoColumn",ka=class extends Z{createAutoGroupColumns(i){const e=[],t=this.gos.get("treeData");let s=this.gos.isGroupMultiAutoColumn();return t&&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?i.forEach((r,o)=>{e.push(this.createOneAutoGroupColumn(r,o))}):e.push(this.createOneAutoGroupColumn()),e}updateAutoGroupColumns(i,e){i.forEach((t,s)=>this.updateOneAutoGroupColumn(t,s,e))}createOneAutoGroupColumn(i,e){let t;i?t=`${pn}-${i.getId()}`:t=pn;const s=this.createAutoGroupColDef(t,i,e);s.colId=t;const r=new Qe(s,null,t,!0);return this.context.createBean(r),r}updateOneAutoGroupColumn(i,e,t){const s=i.getColDef(),r=typeof s.showRowGroup=="string"?s.showRowGroup:void 0,o=r!=null?this.columnModel.getPrimaryColumn(r):void 0,n=this.createAutoGroupColDef(i.getId(),o??void 0,e);i.setColDef(n,null,t),this.columnFactory.applyColumnState(i,n,t)}createAutoGroupColDef(i,e,t){let s=this.createBaseColDef(e);const r=this.gos.get("autoGroupColumnDef");Ei(s,r),s=this.columnFactory.addColumnDefaultAndTypes(s,i),this.gos.get("treeData")||be(s.field)&&be(s.valueGetter)&&be(s.filterValueGetter)&&s.filter!=="agGroupColumnFilter"&&(s.filter=!1),t&&t>0&&(s.headerCheckboxSelection=!1);const o=this.gos.isColumnsSortingCoupledToGroup(),n=s.valueGetter||s.field!=null;return o&&!n&&(s.sortIndex=void 0,s.initialSort=void 0),s}createBaseColDef(i){const e=this.gos.get("autoGroupColumnDef"),s={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(e&&(e.cellRenderer||e.cellRendererSelector)||(s.cellRenderer="agGroupCellRenderer"),i){const o=i.getColDef();Object.assign(s,{headerName:this.columnModel.getDisplayNameForColumn(i,"header"),headerValueGetter:o.headerValueGetter}),o.cellRenderer&&Object.assign(s,{cellRendererParams:{innerRenderer:o.cellRenderer,innerRendererParams:o.cellRendererParams}}),s.showRowGroup=i.getColId()}else s.showRowGroup=!0;return s}};g([R("columnModel")],ka.prototype,"columnModel",2);g([R("columnFactory")],ka.prototype,"columnFactory",2);ka=g([le("autoGroupColService")],ka);var Mm={};qt(Mm,{camelCaseToHumanText:()=>Lm,camelCaseToHyphenated:()=>Im,capitalise:()=>cb,escapeString:()=>Ft,utf8_encode:()=>db});var ub=/[&<>"']/g,hb={"&":"&","<":"<",">":">",'"':""","'":"'"};function db(i){const e=String.fromCharCode;function t(d){const c=[];if(!d)return[];const p=d.length;let y=0,f,w;for(;y<p;)f=d.charCodeAt(y++),f>=55296&&f<=56319&&y<p?(w=d.charCodeAt(y++),(w&64512)==56320?c.push(((f&1023)<<10)+(w&1023)+65536):(c.push(f),y--)):c.push(f);return c}function s(d){if(d>=55296&&d<=57343)throw Error("Lone surrogate U+"+d.toString(16).toUpperCase()+" is not a scalar value")}function r(d,c){return e(d>>c&63|128)}function o(d){if(d>=0&&d<=31&&d!==10)return`_x${d.toString(16).toUpperCase().padStart(4,"0")}_`;if((d&4294967168)==0)return e(d);let c="";return(d&4294965248)==0?c=e(d>>6&31|192):(d&4294901760)==0?(s(d),c=e(d>>12&15|224),c+=r(d,6)):(d&4292870144)==0&&(c=e(d>>18&7|240),c+=r(d,12),c+=r(d,6)),c+=e(d&63|128),c}const n=t(i),a=n.length;let l=-1,u,h="";for(;++l<a;)u=n[l],h+=o(u);return h}function cb(i){return i[0].toUpperCase()+i.substring(1).toLowerCase()}function Ft(i,e){if(i==null)return null;const t=i.toString().toString();return e?t:t.replace(ub,s=>hb[s])}function Lm(i){if(!i||i==null)return null;const e=/([a-z])([A-Z])/g,t=/([A-Z]+)([A-Z])([a-z])/g;return i.replace(e,"$1 $2").replace(t,"$1 $2$3").replace(/\./g," ").split(" ").map(r=>r.substring(0,1).toUpperCase()+(r.length>1?r.substring(1,r.length):"")).join(" ")}function Im(i){return i.replace(/[A-Z]/g,e=>`-${e.toLocaleLowerCase()}`)}var Om={};qt(Om,{convertToMap:()=>fr,keys:()=>gb,mapById:()=>pb});function fr(i){const e=new Map;return i.forEach(t=>e.set(t[0],t[1])),e}function pb(i,e){const t=new Map;return i.forEach(s=>t.set(e(s),s)),t}function gb(i){const e=[];return i.forEach((t,s)=>e.push(s)),e}var Xt=class extends Z{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.gos.get("suppressColumnVirtualisation");const i=this.gos.get("pivotMode");this.isPivotSettingAllowed(i)&&(this.pivotMode=i),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],e=>this.buildAutoGroupColumns(sn(e.source))),this.addManagedPropertyListener("autoGroupColumnDef",e=>this.onAutoGroupColumnDefChanged(sn(e.source))),this.addManagedPropertyListeners(["defaultColDef","columnTypes","suppressFieldDotNotation"],e=>this.onSharedColDefChanged(sn(e.source))),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),sn(e.source))),this.addManagedListener(this.eventService,b.EVENT_FIRST_DATA_RENDERED,()=>this.onFirstDataRendered())}buildAutoGroupColumns(i){this.columnDefs&&(this.autoGroupsNeedBuilding=!0,this.forceRecreateAutoGroups=!0,this.updateGridColumns(),this.updateDisplayedColumns(i))}onAutoGroupColumnDefChanged(i){this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,i)}onSharedColDefChanged(i){this.gridColumns&&(this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,i),this.createColumnsFromColumnDefs(!0,i))}setColumnDefs(i,e){const t=!!this.columnDefs;this.columnDefs=i,this.createColumnsFromColumnDefs(t,e)}recreateColumnDefs(i){this.onSharedColDefChanged(i)}destroyOldColumns(i,e){const t={};if(!i)return;Us(null,i,r=>{t[r.getInstanceId()]=r}),e&&Us(null,e,r=>{t[r.getInstanceId()]=null});const s=Object.values(t).filter(r=>r!=null);this.destroyBeans(s)}destroyColumns(){this.destroyOldColumns(this.primaryColumnTree),this.destroyOldColumns(this.secondaryBalancedTree),this.destroyOldColumns(this.groupAutoColsBalancedTree)}createColumnsFromColumnDefs(i,e){const t=i?this.compareColumnStatesAndDispatchEvents(e):void 0;this.valueCache.expire(),this.autoGroupsNeedBuilding=!0;const s=this.primaryColumns,r=this.primaryColumnTree,o=this.columnFactory.createColumnTree(this.columnDefs,!0,r,e);this.destroyOldColumns(this.primaryColumnTree,o.columnTree),this.primaryColumnTree=o.columnTree,this.primaryHeaderRowCount=o.treeDept+1,this.primaryColumns=this.getColumnsFromTree(this.primaryColumnTree),this.primaryColumnsMap={},this.primaryColumns.forEach(l=>this.primaryColumnsMap[l.getId()]=l),this.extractRowGroupColumns(e,s),this.extractPivotColumns(e,s),this.extractValueColumns(e,s),this.ready=!0;const n=this.gridColsArePrimary===void 0;(this.gridColsArePrimary||n||this.autoGroupsNeedBuilding)&&(this.updateGridColumns(),i&&this.gridColsArePrimary&&!this.gos.get("maintainColumnOrder")&&this.orderGridColumnsLikePrimary(),this.updateDisplayedColumns(e),this.checkViewportColumns()),this.dispatchEverythingChanged(e),this.changeEventsDispatching=!0,t&&t(),this.changeEventsDispatching=!1,this.dispatchNewColumnsLoaded(e)}shouldRowModelIgnoreRefresh(){return this.changeEventsDispatching}dispatchNewColumnsLoaded(i){const e={type:b.EVENT_NEW_COLUMNS_LOADED,source:i};this.eventService.dispatchEvent(e),i==="gridInitializing"&&this.onColumnsReady()}dispatchEverythingChanged(i){const e={type:b.EVENT_COLUMN_EVERYTHING_CHANGED,source:i};this.eventService.dispatchEvent(e)}orderGridColumnsLikePrimary(){const i=this.primaryColumns;if(!i)return;const e=i.filter(s=>this.gridColumns.indexOf(s)>=0),t=this.gridColumns.filter(s=>e.indexOf(s)<0);this.gridColumns=[...t,...e],this.gridColumns=this.placeLockedColumns(this.gridColumns)}getAllDisplayedAutoHeightCols(){return this.displayedAutoHeightCols}setViewport(){this.gos.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)}checkViewportColumns(i=!1){if(this.displayedColumnsCenter==null||!this.extractViewport())return;const t={type:b.EVENT_VIRTUAL_COLUMNS_CHANGED,afterScroll:i};this.eventService.dispatchEvent(t)}setViewportPosition(i,e,t=!1){(i!==this.scrollWidth||e!==this.scrollPosition||this.bodyWidthDirty)&&(this.scrollWidth=i,this.scrollPosition=e,this.bodyWidthDirty=!0,this.setViewport(),this.ready&&this.checkViewportColumns(t))}isPivotMode(){return this.pivotMode}isPivotSettingAllowed(i){return i&&this.gos.get("treeData")?(fe("Pivot mode not available with treeData."),!1):!0}setPivotMode(i,e){if(i===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode)||(this.pivotMode=i,!this.gridColumns))return;this.autoGroupsNeedBuilding=!0,this.updateGridColumns(),this.updateDisplayedColumns(e);const t={type:b.EVENT_COLUMN_PIVOT_MODE_CHANGED};this.eventService.dispatchEvent(t)}getSecondaryPivotColumn(i,e){if(be(this.secondaryColumns))return null;const t=this.getPrimaryColumn(e);let s=null;return this.secondaryColumns.forEach(r=>{const o=r.getColDef().pivotKeys,n=r.getColDef().pivotValueColumn;Ts(o,i)&&n===t&&(s=r)}),s}setBeans(i){this.logger=i.create("columnModel")}setFirstRightAndLastLeftPinned(i){let e,t;this.gos.get("enableRtl")?(e=this.displayedColumnsLeft?this.displayedColumnsLeft[0]:null,t=this.displayedColumnsRight?We(this.displayedColumnsRight):null):(e=this.displayedColumnsLeft?We(this.displayedColumnsLeft):null,t=this.displayedColumnsRight?this.displayedColumnsRight[0]:null),this.gridColumns.forEach(s=>{s.setLastLeftPinned(s===e,i),s.setFirstRightPinned(s===t,i)})}autoSizeColumns(i){if(this.shouldQueueResizeOperations){this.resizeOperationQueue.push(()=>this.autoSizeColumns(i));return}const{columns:e,skipHeader:t,skipHeaderGroups:s,stopAtGroup:r,source:o="api"}=i;this.animationFrameService.flushAllFrames();const n=[];let a=-1;const l=t??this.gos.get("skipHeaderOnAutoSize"),u=s??l;for(;a!==0;)a=0,this.actionOnGridColumns(e,h=>{if(n.indexOf(h)>=0)return!1;const d=this.autoWidthCalculator.getPreferredWidthForColumn(h,l);if(d>0){const c=this.normaliseColumnWidth(h,d);h.setActualWidth(c,o),n.push(h),a++}return!0},o);u||this.autoSizeColumnGroupsByColumns(e,o,r),this.dispatchColumnResizedEvent(n,!0,"autosizeColumns")}dispatchColumnResizedEvent(i,e,t,s=null){if(i&&i.length){const r={type:b.EVENT_COLUMN_RESIZED,columns:i,column:i.length===1?i[0]:null,flexColumns:s,finished:e,source:t};this.eventService.dispatchEvent(r)}}dispatchColumnChangedEvent(i,e,t){const s={type:i,columns:e,column:e&&e.length==1?e[0]:null,source:t};this.eventService.dispatchEvent(s)}dispatchColumnMovedEvent(i){const{movedColumns:e,source:t,toIndex:s,finished:r}=i,o={type:b.EVENT_COLUMN_MOVED,columns:e,column:e&&e.length===1?e[0]:null,toIndex:s,finished:r,source:t};this.eventService.dispatchEvent(o)}dispatchColumnPinnedEvent(i,e){if(!i.length)return;const t=i.length===1?i[0]:null,s=this.getCommonValue(i,o=>o.getPinned()),r={type:b.EVENT_COLUMN_PINNED,pinned:s??null,columns:i,column:t,source:e};this.eventService.dispatchEvent(r)}dispatchColumnVisibleEvent(i,e){if(!i.length)return;const t=i.length===1?i[0]:null,s=this.getCommonValue(i,o=>o.isVisible()),r={type:b.EVENT_COLUMN_VISIBLE,visible:s,columns:i,column:t,source:e};this.eventService.dispatchEvent(r)}autoSizeColumn(i,e,t){i&&this.autoSizeColumns({columns:[i],skipHeader:t,skipHeaderGroups:!0,source:e})}autoSizeColumnGroupsByColumns(i,e,t){const s=new Set;this.getGridColumns(i).forEach(a=>{let l=a.getParent();for(;l&&l!=t;)l.isPadding()||s.add(l),l=l.getParent()});let o;const n=[];for(const a of s){for(const l of this.ctrlsService.getHeaderRowContainerCtrls())if(o=l.getHeaderCtrlForColumn(a),o)break;o&&o.resizeLeafColumnsToFit(e)}return n}autoSizeAllColumns(i,e){if(this.shouldQueueResizeOperations){this.resizeOperationQueue.push(()=>this.autoSizeAllColumns(i,e));return}const t=this.getAllDisplayedColumns();this.autoSizeColumns({columns:t,skipHeader:e,source:i})}getColumnsFromTree(i){const e=[],t=s=>{for(let r=0;r<s.length;r++){const o=s[r];o instanceof Qe?e.push(o):o instanceof At&&t(o.getChildren())}};return t(i),e}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(i){return this.getAllDisplayedColumns().indexOf(i)>=0}getAllDisplayedColumns(){return this.displayedColumns}getViewportColumns(){return this.viewportColumns}getDisplayedLeftColumnsForRow(i){return this.colSpanActive?this.getDisplayedColumnsForRow(i,this.displayedColumnsLeft):this.displayedColumnsLeft}getDisplayedRightColumnsForRow(i){return this.colSpanActive?this.getDisplayedColumnsForRow(i,this.displayedColumnsRight):this.displayedColumnsRight}isColSpanActive(){return this.colSpanActive}getDisplayedColumnsForRow(i,e,t,s){const r=[];let o=null;for(let n=0;n<e.length;n++){const a=e[n],l=e.length-n,u=Math.min(a.getColSpan(i),l),h=[a];if(u>1){const c=u-1;for(let p=1;p<=c;p++)h.push(e[n+p]);n+=c}let d;t?(d=!1,h.forEach(c=>{t(c)&&(d=!0)})):d=!0,d&&(r.length===0&&o&&(s&&s(a))&&r.push(o),r.push(a)),o=a}return r}getViewportCenterColumnsForRow(i){if(!this.colSpanActive)return this.viewportColumnsCenter;const e=s=>{const r=s.getLeft();return K(r)&&r>this.viewportLeft},t=this.isColumnVirtualisationSuppressed()?null:this.isColumnInRowViewport.bind(this);return this.getDisplayedColumnsForRow(i,this.displayedColumnsCenter,t,e)}isColumnAtEdge(i,e){const t=this.getAllDisplayedColumns();if(!t.length)return!1;const s=e==="first";let r;if(i instanceof jt){const o=i.getDisplayedLeafColumns();if(!o.length)return!1;r=s?o[0]:We(o)}else r=i;return(s?t[0]:We(t))===r}getAriaColumnIndex(i){let e;return i instanceof jt?e=i.getLeafColumns()[0]:e=i,this.ariaOrderColumns.indexOf(e)+1}isColumnInHeaderViewport(i){return i.isAutoHeaderHeight()?!0:this.isColumnInRowViewport(i)}isColumnInRowViewport(i){if(i.isAutoHeight())return!0;const e=i.getLeft()||0,t=e+i.getActualWidth(),s=this.viewportLeft-200,r=this.viewportRight+200,o=e<s&&t<s,n=e>r&&t>r;return!o&&!n}getDisplayedColumnsLeftWidth(){return this.getWidthOfColsInList(this.displayedColumnsLeft)}getDisplayedColumnsRightWidth(){return this.getWidthOfColsInList(this.displayedColumnsRight)}updatePrimaryColumnList(i,e,t,s,r,o){if(!i||zi(i))return;let n=!1;if(i.forEach(l=>{if(!l)return;const u=this.getPrimaryColumn(l);if(u){if(t){if(e.indexOf(u)>=0)return;e.push(u)}else{if(e.indexOf(u)<0)return;_i(e,u)}s(u),n=!0}}),!n)return;this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(o);const a={type:r,columns:e,column:e.length===1?e[0]:null,source:o};this.eventService.dispatchEvent(a)}setRowGroupColumns(i,e){this.autoGroupsNeedBuilding=!0,this.setPrimaryColumnList(i,this.rowGroupColumns,b.EVENT_COLUMN_ROW_GROUP_CHANGED,!0,this.setRowGroupActive.bind(this),e)}setRowGroupActive(i,e,t){i!==e.isRowGroupActive()&&(e.setRowGroupActive(i,t),i&&!this.gos.get("suppressRowGroupHidesColumns")&&this.setColumnsVisible([e],!1,t),!i&&!this.gos.get("suppressMakeColumnVisibleAfterUnGroup")&&this.setColumnsVisible([e],!0,t))}addRowGroupColumns(i,e){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(i,this.rowGroupColumns,!0,this.setRowGroupActive.bind(this,!0),b.EVENT_COLUMN_ROW_GROUP_CHANGED,e)}removeRowGroupColumns(i,e){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(i,this.rowGroupColumns,!1,this.setRowGroupActive.bind(this,!1),b.EVENT_COLUMN_ROW_GROUP_CHANGED,e)}addPivotColumns(i,e){this.updatePrimaryColumnList(i,this.pivotColumns,!0,t=>t.setPivotActive(!0,e),b.EVENT_COLUMN_PIVOT_CHANGED,e)}setPivotColumns(i,e){this.setPrimaryColumnList(i,this.pivotColumns,b.EVENT_COLUMN_PIVOT_CHANGED,!0,(t,s)=>{s.setPivotActive(t,e)},e)}removePivotColumns(i,e){this.updatePrimaryColumnList(i,this.pivotColumns,!1,t=>t.setPivotActive(!1,e),b.EVENT_COLUMN_PIVOT_CHANGED,e)}setPrimaryColumnList(i,e,t,s,r,o){if(!this.gridColumns)return;const n=new Map;e.forEach((a,l)=>n.set(a,l)),e.length=0,K(i)&&i.forEach(a=>{const l=this.getPrimaryColumn(a);l&&e.push(l)}),e.forEach((a,l)=>{const u=n.get(a);if(u===void 0){n.set(a,0);return}s&&u!==l||n.delete(a)}),(this.primaryColumns||[]).forEach(a=>{const l=e.indexOf(a)>=0;r(l,a)}),this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(o),this.dispatchColumnChangedEvent(t,[...n.keys()],o)}setValueColumns(i,e){this.setPrimaryColumnList(i,this.valueColumns,b.EVENT_COLUMN_VALUE_CHANGED,!1,this.setValueActive.bind(this),e)}setValueActive(i,e,t){if(i!==e.isValueActive()&&(e.setValueActive(i,t),i&&!e.getAggFunc()&&this.aggFuncService)){const s=this.aggFuncService.getDefaultAggFunc(e);e.setAggFunc(s)}}addValueColumns(i,e){this.updatePrimaryColumnList(i,this.valueColumns,!0,this.setValueActive.bind(this,!0),b.EVENT_COLUMN_VALUE_CHANGED,e)}removeValueColumns(i,e){this.updatePrimaryColumnList(i,this.valueColumns,!1,this.setValueActive.bind(this,!1),b.EVENT_COLUMN_VALUE_CHANGED,e)}normaliseColumnWidth(i,e){const t=i.getMinWidth();K(t)&&e<t&&(e=t);const s=i.getMaxWidth();return K(s)&&i.isGreaterThanMax(e)&&(e=s),e}getPrimaryOrGridColumn(i){return this.getPrimaryColumn(i)||this.getGridColumn(i)}setColumnWidths(i,e,t,s){const r=[];i.forEach(o=>{const n=this.getPrimaryOrGridColumn(o.key);if(!n)return;if(r.push({width:o.newWidth,ratios:[1],columns:[n]}),this.gos.get("colResizeDefault")==="shift"&&(e=!e),e){const l=this.getDisplayedColAfter(n);if(!l)return;const u=n.getActualWidth()-o.newWidth,h=l.getActualWidth()+u;r.push({width:h,ratios:[1],columns:[l]})}}),r.length!==0&&this.resizeColumnSets({resizeSets:r,finished:t,source:s})}checkMinAndMaxWidthsForSet(i){const{columns:e,width:t}=i;let s=0,r=0,o=!0;e.forEach(l=>{const u=l.getMinWidth();s+=u||0;const h=l.getMaxWidth();K(h)&&h>0?r+=h:o=!1});const n=t>=s,a=!o||t<=r;return n&&a}resizeColumnSets(i){const{resizeSets:e,finished:t,source:s}=i;if(!(!e||e.every(h=>this.checkMinAndMaxWidthsForSet(h)))){if(t){const h=e&&e.length>0?e[0].columns:null;this.dispatchColumnResizedEvent(h,t,s)}return}const o=[],n=[];e.forEach(h=>{const{width:d,columns:c,ratios:p}=h,y={},f={};c.forEach(P=>n.push(P));let w=!0,_=0;for(;w;){if(_++,_>1e3){console.error("AG Grid: infinite loop in resizeColumnSets");break}w=!1;const P=[];let T=0,D=d;c.forEach((O,N)=>{if(f[O.getId()])D-=y[O.getId()];else{P.push(O);const Y=p[N];T+=Y}});const M=1/T;P.forEach((O,N)=>{const z=N===P.length-1;let Y;z?Y=D:(Y=Math.round(p[N]*d*M),D-=Y);const W=O.getMinWidth(),$=O.getMaxWidth();K(W)&&Y<W?(Y=W,f[O.getId()]=!0,w=!0):K($)&&$>0&&Y>$&&(Y=$,f[O.getId()]=!0,w=!0),y[O.getId()]=Y})}c.forEach(P=>{const T=y[P.getId()];P.getActualWidth()!==T&&(P.setActualWidth(T,s),o.push(P))})});const a=o.length>0;let l=[];a&&(l=this.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0}),this.setLeftValues(s),this.updateBodyWidths(),this.checkViewportColumns());const u=n.concat(l);(a||t)&&this.dispatchColumnResizedEvent(u,t,s,l)}setColumnAggFunc(i,e,t){if(!i)return;const s=this.getPrimaryColumn(i);s&&(s.setAggFunc(e),this.dispatchColumnChangedEvent(b.EVENT_COLUMN_VALUE_CHANGED,[s],t))}moveRowGroupColumn(i,e,t){if(this.isRowGroupEmpty())return;const s=this.rowGroupColumns[i],r=this.rowGroupColumns.slice(i,e);this.rowGroupColumns.splice(i,1),this.rowGroupColumns.splice(e,0,s);const o={type:b.EVENT_COLUMN_ROW_GROUP_CHANGED,columns:r,column:r.length===1?r[0]:null,source:t};this.eventService.dispatchEvent(o)}moveColumns(i,e,t,s=!0){if(!this.gridColumns)return;if(this.columnAnimationService.start(),e>this.gridColumns.length-i.length){console.warn("AG Grid: tried to insert columns in invalid location, toIndex = "+e),console.warn("AG Grid: remember that you should not count the moving columns when calculating the new index");return}const r=this.getGridColumns(i);this.doesMovePassRules(r,e)&&(Fc(this.gridColumns,r,e),this.updateDisplayedColumns(t),this.dispatchColumnMovedEvent({movedColumns:r,source:t,toIndex:e,finished:s}),this.columnAnimationService.finish())}doesMovePassRules(i,e){const t=this.getProposedColumnOrder(i,e);return this.doesOrderPassRules(t)}doesOrderPassRules(i){return!(!this.doesMovePassMarryChildren(i)||!this.doesMovePassLockedPositions(i))}getProposedColumnOrder(i,e){const t=this.gridColumns.slice();return Fc(t,i,e),t}sortColumnsLikeGridColumns(i){!i||i.length<=1||i.filter(t=>this.gridColumns.indexOf(t)<0).length>0||i.sort((t,s)=>{const r=this.gridColumns.indexOf(t),o=this.gridColumns.indexOf(s);return r-o})}doesMovePassLockedPositions(i){let e=0,t=!0;const s=r=>r?r===!0||r==="left"?0:2:1;return i.forEach(r=>{const o=s(r.getColDef().lockPosition);o<e&&(t=!1),e=o}),t}doesMovePassMarryChildren(i){let e=!0;return Us(null,this.gridBalancedTree,t=>{if(!(t instanceof At))return;const s=t,r=s.getColGroupDef();if(!(r&&r.marryChildren))return;const n=[];s.getLeafColumns().forEach(d=>{const c=i.indexOf(d);n.push(c)});const a=Math.max.apply(Math,n),l=Math.min.apply(Math,n),u=a-l,h=s.getLeafColumns().length-1;u>h&&(e=!1)}),e}moveColumnByIndex(i,e,t){if(!this.gridColumns)return;const s=this.gridColumns[i];this.moveColumns([s],e,t)}getColumnDefs(){if(!this.primaryColumns)return;const i=this.primaryColumns.slice();return this.gridColsArePrimary?i.sort((e,t)=>this.gridColumns.indexOf(e)-this.gridColumns.indexOf(t)):this.lastPrimaryOrder&&i.sort((e,t)=>this.lastPrimaryOrder.indexOf(e)-this.lastPrimaryOrder.indexOf(t)),this.columnDefFactory.buildColumnDefs(i,this.rowGroupColumns,this.pivotColumns)}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(i){switch(i){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}updateBodyWidths(){const i=this.getWidthOfColsInList(this.displayedColumnsCenter),e=this.getWidthOfColsInList(this.displayedColumnsLeft),t=this.getWidthOfColsInList(this.displayedColumnsRight);if(this.bodyWidthDirty=this.bodyWidth!==i,this.bodyWidth!==i||this.leftWidth!==e||this.rightWidth!==t){this.bodyWidth=i,this.leftWidth=e,this.rightWidth=t;const r={type:b.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED};this.eventService.dispatchEvent(r);const o={type:b.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED};this.eventService.dispatchEvent(o)}}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}getAllPrimaryColumns(){return this.primaryColumns?this.primaryColumns:null}getSecondaryColumns(){return this.secondaryColumns?this.secondaryColumns:null}getAllColumnsForQuickFilter(){return this.columnsForQuickFilter}getAllGridColumns(){var i;return(i=this.gridColumns)!=null?i:[]}isRowGroupEmpty(){return zi(this.rowGroupColumns)}setColumnsVisible(i,e=!1,t){this.applyColumnState({state:i.map(s=>({colId:typeof s=="string"?s:s.getColId(),hide:!e}))},t)}setColumnsPinned(i,e,t){if(!this.gridColumns)return;if(this.gos.isDomLayout("print")){console.warn("AG Grid: Changing the column pinning status is not allowed with domLayout='print'");return}this.columnAnimationService.start();let s;e===!0||e==="left"?s="left":e==="right"?s="right":s=null,this.actionOnGridColumns(i,r=>r.getPinned()!==s?(r.setPinned(s),!0):!1,t,()=>({type:b.EVENT_COLUMN_PINNED,pinned:s,column:null,columns:null,source:t})),this.columnAnimationService.finish()}actionOnGridColumns(i,e,t,s){if(zi(i))return;const r=[];if(i.forEach(o=>{if(!o)return;const n=this.getGridColumn(o);if(!n)return;e(n)!==!1&&r.push(n)}),!!r.length&&(this.updateDisplayedColumns(t),K(s)&&s)){const o=s();o.columns=r,o.column=r.length===1?r[0]:null,this.eventService.dispatchEvent(o)}}getDisplayedColBefore(i){const e=this.getAllDisplayedColumns(),t=e.indexOf(i);return t>0?e[t-1]:null}getDisplayedColAfter(i){const e=this.getAllDisplayedColumns(),t=e.indexOf(i);return t<e.length-1?e[t+1]:null}getDisplayedGroupAtDirection(i,e){const t=i.getProvidedColumnGroup().getLevel()+i.getPaddingLevel(),s=i.getDisplayedLeafColumns(),r=e==="After"?We(s):s[0],o=`getDisplayedCol${e}`;for(;;){const n=this[o](r);if(!n)return null;const a=this.getColumnGroupAtLevel(n,t);if(a!==i)return a}}getColumnGroupAtLevel(i,e){let t=i.getParent(),s,r;for(;s=t.getProvidedColumnGroup().getLevel(),r=t.getPaddingLevel(),!(s+r<=e);)t=t.getParent();return t}isPinningLeft(){return this.displayedColumnsLeft.length>0}isPinningRight(){return this.displayedColumnsRight.length>0}getPrimaryAndSecondaryAndAutoColumns(){return[].concat(this.primaryColumns||[],this.groupAutoColumns||[],this.secondaryColumns||[])}createStateItemFromColumn(i){const e=i.isRowGroupActive()?this.rowGroupColumns.indexOf(i):null,t=i.isPivotActive()?this.pivotColumns.indexOf(i):null,s=i.isValueActive()?i.getAggFunc():null,r=i.getSort()!=null?i.getSort():null,o=i.getSortIndex()!=null?i.getSortIndex():null,n=i.getFlex()!=null&&i.getFlex()>0?i.getFlex():null;return{colId:i.getColId(),width:i.getActualWidth(),hide:!i.isVisible(),pinned:i.getPinned(),sort:r,sortIndex:o,aggFunc:s,rowGroup:i.isRowGroupActive(),rowGroupIndex:e,pivot:i.isPivotActive(),pivotIndex:t,flex:n}}getColumnState(){if(be(this.primaryColumns)||!this.isAlive())return[];const e=this.getPrimaryAndSecondaryAndAutoColumns().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(e),e}orderColumnStateList(i){const e=fr(this.gridColumns.map((t,s)=>[t.getColId(),s]));i.sort((t,s)=>{const r=e.has(t.colId)?e.get(t.colId):-1,o=e.has(s.colId)?e.get(s.colId):-1;return r-o})}resetColumnState(i){if(zi(this.primaryColumns))return;const e=this.getColumnsFromTree(this.primaryColumnTree),t=[];let s=1e3,r=1e3,o=[];this.groupAutoColumns&&(o=o.concat(this.groupAutoColumns)),e&&(o=o.concat(e)),o.forEach(n=>{const a=this.getColumnStateFromColDef(n);be(a.rowGroupIndex)&&a.rowGroup&&(a.rowGroupIndex=s++),be(a.pivotIndex)&&a.pivot&&(a.pivotIndex=r++),t.push(a)}),this.applyColumnState({state:t,applyOrder:!0},i)}getColumnStateFromColDef(i){const e=(y,f)=>y??f??null,t=i.getColDef(),s=e(t.sort,t.initialSort),r=e(t.sortIndex,t.initialSortIndex),o=e(t.hide,t.initialHide),n=e(t.pinned,t.initialPinned),a=e(t.width,t.initialWidth),l=e(t.flex,t.initialFlex);let u=e(t.rowGroupIndex,t.initialRowGroupIndex),h=e(t.rowGroup,t.initialRowGroup);u==null&&(h==null||h==!1)&&(u=null,h=null);let d=e(t.pivotIndex,t.initialPivotIndex),c=e(t.pivot,t.initialPivot);d==null&&(c==null||c==!1)&&(d=null,c=null);const p=e(t.aggFunc,t.initialAggFunc);return{colId:i.getColId(),sort:s,sortIndex:r,hide:o,pinned:n,width:a,flex:l,rowGroup:h,rowGroupIndex:u,pivot:c,pivotIndex:d,aggFunc:p}}applyColumnState(i,e){if(zi(this.primaryColumns))return!1;if(i&&i.state&&!i.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 t=(o,n,a)=>{const l=this.compareColumnStatesAndDispatchEvents(e);this.autoGroupsNeedBuilding=!0;const u=n.slice(),h={},d={},c=[],p=[];let y=0;const f=this.rowGroupColumns.slice(),w=this.pivotColumns.slice();o.forEach(D=>{const M=D.colId||"";if(M.startsWith(pn)){c.push(D),p.push(D);return}const N=a(M);N?(this.syncColumnWithStateItem(N,D,i.defaultState,h,d,!1,e),_i(u,N)):(p.push(D),y+=1)});const _=D=>this.syncColumnWithStateItem(D,null,i.defaultState,h,d,!1,e);u.forEach(_);const P=(D,M,O,N)=>{const z=D[O.getId()],Y=D[N.getId()],W=z!=null,$=Y!=null;if(W&&$)return z-Y;if(W)return-1;if($)return 1;const ee=M.indexOf(O),re=M.indexOf(N),me=ee>=0,he=re>=0;return me&&he?ee-re:me?-1:1};this.rowGroupColumns.sort(P.bind(this,h,f)),this.pivotColumns.sort(P.bind(this,d,w)),this.updateGridColumns();const T=this.groupAutoColumns?this.groupAutoColumns.slice():[];return c.forEach(D=>{const M=this.getAutoColumn(D.colId);_i(T,M),this.syncColumnWithStateItem(M,D,i.defaultState,null,null,!0,e)}),T.forEach(_),this.applyOrderAfterApplyState(i),this.updateDisplayedColumns(e),this.dispatchEverythingChanged(e),l(),{unmatchedAndAutoStates:p,unmatchedCount:y}};this.columnAnimationService.start();let{unmatchedAndAutoStates:s,unmatchedCount:r}=t(i.state||[],this.primaryColumns||[],o=>this.getPrimaryColumn(o));return(s.length>0||K(i.defaultState))&&(r=t(s,this.secondaryColumns||[],o=>this.getSecondaryColumn(o)).unmatchedCount),this.columnAnimationService.finish(),r===0}applyOrderAfterApplyState(i){if(!i.applyOrder||!i.state)return;let e=[];const t={};i.state.forEach(r=>{if(!r.colId||t[r.colId])return;const o=this.gridColumnsMap[r.colId];o&&(e.push(o),t[r.colId]=!0)});let s=0;if(this.gridColumns.forEach(r=>{const o=r.getColId();if(t[o]!=null)return;o.startsWith(pn)?Oa(e,r,s++):e.push(r)}),e=this.placeLockedColumns(e),!this.doesMovePassMarryChildren(e)){console.warn("AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.");return}this.gridColumns=e}compareColumnStatesAndDispatchEvents(i){const e={rowGroupColumns:this.rowGroupColumns.slice(),pivotColumns:this.pivotColumns.slice(),valueColumns:this.valueColumns.slice()},t=this.getColumnState(),s={};return t.forEach(r=>{s[r.colId]=r}),()=>{const r=this.getPrimaryAndSecondaryAndAutoColumns(),o=(f,w,_,P)=>{const T=w.map(P),D=_.map(P);if(Ts(T,D))return;const O=new Set(w);_.forEach(Y=>{O.delete(Y)||O.add(Y)});const N=[...O],z={type:f,columns:N,column:N.length===1?N[0]:null,source:i};this.eventService.dispatchEvent(z)},n=f=>{const w=[];return r.forEach(_=>{const P=s[_.getColId()];P&&f(P,_)&&w.push(_)}),w},a=f=>f.getColId();o(b.EVENT_COLUMN_ROW_GROUP_CHANGED,e.rowGroupColumns,this.rowGroupColumns,a),o(b.EVENT_COLUMN_PIVOT_CHANGED,e.pivotColumns,this.pivotColumns,a);const u=n((f,w)=>{const _=f.aggFunc!=null,P=_!=w.isValueActive(),T=_&&f.aggFunc!=w.getAggFunc();return P||T});u.length>0&&this.dispatchColumnChangedEvent(b.EVENT_COLUMN_VALUE_CHANGED,u,i);const h=(f,w)=>f.width!=w.getActualWidth();this.dispatchColumnResizedEvent(n(h),!0,i);const d=(f,w)=>f.pinned!=w.getPinned();this.dispatchColumnPinnedEvent(n(d),i);const c=(f,w)=>f.hide==w.isVisible();this.dispatchColumnVisibleEvent(n(c),i);const y=n((f,w)=>f.sort!=w.getSort()||f.sortIndex!=w.getSortIndex());y.length>0&&this.sortController.dispatchSortChangedEvents(i,y),this.normaliseColumnMovedEventForColumnState(t,i)}}getCommonValue(i,e){if(!i||i.length==0)return;const t=e(i[0]);for(let s=1;s<i.length;s++)if(t!==e(i[s]))return;return t}normaliseColumnMovedEventForColumnState(i,e){const t=this.getColumnState(),s={};t.forEach(l=>s[l.colId]=l);const r={};i.forEach(l=>{s[l.colId]&&(r[l.colId]=!0)});const o=i.filter(l=>r[l.colId]),n=t.filter(l=>r[l.colId]),a=[];n.forEach((l,u)=>{const h=o&&o[u];if(h&&h.colId!==l.colId){const d=this.getGridColumn(h.colId);d&&a.push(d)}}),a.length&&this.dispatchColumnMovedEvent({movedColumns:a,source:e,finished:!0})}syncColumnWithStateItem(i,e,t,s,r,o,n){var a;if(!i)return;const l=(D,M)=>{const O={value1:void 0,value2:void 0};let N=!1;return e&&(e[D]!==void 0&&(O.value1=e[D],N=!0),K(M)&&e[M]!==void 0&&(O.value2=e[M],N=!0)),!N&&t&&(t[D]!==void 0&&(O.value1=t[D]),K(M)&&t[M]!==void 0&&(O.value2=t[M])),O},u=l("hide").value1;u!==void 0&&i.setVisible(!u,n);const h=l("pinned").value1;h!==void 0&&i.setPinned(h);const d=(a=i.getColDef().minWidth)!=null?a:this.environment.getMinColWidth(),c=l("flex").value1;if(c!==void 0&&i.setFlex(c),c==null){const D=l("width").value1;D!=null&&d!=null&&D>=d&&i.setActualWidth(D,n)}const p=l("sort").value1;p!==void 0&&(p==="desc"||p==="asc"?i.setSort(p,n):i.setSort(void 0,n));const y=l("sortIndex").value1;if(y!==void 0&&i.setSortIndex(y),o||!i.isPrimary())return;const f=l("aggFunc").value1;f!==void 0&&(typeof f=="string"?(i.setAggFunc(f),i.isValueActive()||(i.setValueActive(!0,n),this.valueColumns.push(i))):(K(f)&&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."),i.isValueActive()&&(i.setValueActive(!1,n),_i(this.valueColumns,i))));const{value1:w,value2:_}=l("rowGroup","rowGroupIndex");(w!==void 0||_!==void 0)&&(typeof _=="number"||w?(i.isRowGroupActive()||(i.setRowGroupActive(!0,n),this.rowGroupColumns.push(i)),s&&typeof _=="number"&&(s[i.getId()]=_)):i.isRowGroupActive()&&(i.setRowGroupActive(!1,n),_i(this.rowGroupColumns,i)));const{value1:P,value2:T}=l("pivot","pivotIndex");(P!==void 0||T!==void 0)&&(typeof T=="number"||P?(i.isPivotActive()||(i.setPivotActive(!0,n),this.pivotColumns.push(i)),r&&typeof T=="number"&&(r[i.getId()]=T)):i.isPivotActive()&&(i.setPivotActive(!1,n),_i(this.pivotColumns,i)))}getGridColumns(i){return this.getColumns(i,this.getGridColumn.bind(this))}getColumns(i,e){const t=[];return i&&i.forEach(s=>{const r=e(s);r&&t.push(r)}),t}getColumnWithValidation(i){if(i==null)return null;const e=this.getGridColumn(i);return e||console.warn("AG Grid: could not find column "+i),e}getPrimaryColumn(i){return this.primaryColumns?this.getColumn(i,this.primaryColumns,this.primaryColumnsMap):null}getGridColumn(i){return this.getColumn(i,this.gridColumns,this.gridColumnsMap)}lookupGridColumn(i){return this.gridColumnsMap[i]}getSecondaryColumn(i){return this.secondaryColumns?this.getColumn(i,this.secondaryColumns,this.secondaryColumnsMap):null}getColumn(i,e,t){if(!i||!t)return null;if(typeof i=="string"&&t[i])return t[i];for(let s=0;s<e.length;s++)if(this.columnsMatch(e[s],i))return e[s];return this.getAutoColumn(i)}getSourceColumnsForGroupColumn(i){const e=i.getColDef().showRowGroup;if(!e)return null;if(e===!0)return this.rowGroupColumns.slice(0);const t=this.getPrimaryColumn(e);return t?[t]:null}getAutoColumn(i){return!this.groupAutoColumns||!K(this.groupAutoColumns)||be(this.groupAutoColumns)?null:this.groupAutoColumns.find(e=>this.columnsMatch(e,i))||null}columnsMatch(i,e){const t=i===e,s=i.getColDef()===e,r=i.getColId()==e;return t||s||r}getDisplayNameForColumn(i,e,t=!1){if(!i)return null;const s=this.getHeaderName(i.getColDef(),i,null,null,e);return t?this.wrapHeaderNameWithAggFunc(i,s):s}getDisplayNameForProvidedColumnGroup(i,e,t){const s=e?e.getColGroupDef():null;return s?this.getHeaderName(s,null,i,e,t):null}getDisplayNameForColumnGroup(i,e){return this.getDisplayNameForProvidedColumnGroup(i,i.getProvidedColumnGroup(),e)}getHeaderName(i,e,t,s,r){const o=i.headerValueGetter;if(o){const n=this.gos.addGridCommonParams({colDef:i,column:e,columnGroup:t,providedColumnGroup:s,location:r});return typeof o=="function"?o(n):typeof o=="string"?this.expressionService.evaluate(o,n):(console.warn("AG Grid: headerValueGetter must be a function or a string"),"")}else{if(i.headerName!=null)return i.headerName;if(i.field)return Lm(i.field)}return""}wrapHeaderNameWithAggFunc(i,e){if(this.gos.get("suppressAggFuncInHeader"))return e;const t=i.getColDef().pivotValueColumn,s=K(t);let r=null,o;if(s){const n=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&this.valueColumns.length===1,a=i.getColDef().pivotTotalColumnIds!==void 0;if(n&&!a)return e;r=t?t.getAggFunc():null,o=!0}else{const n=i.isValueActive(),a=this.pivotMode||!this.isRowGroupEmpty();n&&a?(r=i.getAggFunc(),o=!0):o=!1}if(o){const n=typeof r=="string"?r:"func";return`${this.localeService.getLocaleTextFunc()(n,n)}(${e})`}return e}getColumnGroup(i,e){if(!i)return null;if(i instanceof jt)return i;const t=this.getAllDisplayedTrees(),s=typeof e=="number";let r=null;return Yr(t,!1,o=>{if(o instanceof jt){const n=o;let a;s?a=i===n.getGroupId()&&e===n.getPartId():a=i===n.getGroupId(),a&&(r=n)}}),r}isReady(){return this.ready}extractValueColumns(i,e){this.valueColumns=this.extractColumns(e,this.valueColumns,(t,s)=>t.setValueActive(s,i),()=>{},()=>{},t=>{const s=t.aggFunc;if(s===null||s==="")return null;if(s!==void 0)return!!s},t=>t.initialAggFunc!=null&&t.initialAggFunc!=""),this.valueColumns.forEach(t=>{const s=t.getColDef();s.aggFunc!=null&&s.aggFunc!=""?t.setAggFunc(s.aggFunc):t.getAggFunc()||t.setAggFunc(s.initialAggFunc)})}extractRowGroupColumns(i,e){this.rowGroupColumns=this.extractColumns(e,this.rowGroupColumns,(t,s)=>t.setRowGroupActive(s,i),t=>t.rowGroupIndex,t=>t.initialRowGroupIndex,t=>t.rowGroup,t=>t.initialRowGroup)}extractColumns(i=[],e=[],t,s,r,o,n){const a=[],l=[];(this.primaryColumns||[]).forEach(d=>{const c=i.indexOf(d)<0,p=d.getColDef(),y=Xu(o(p)),f=Xu(n(p)),w=vr(s(p)),_=vr(r(p));let P;y!==void 0?P=y:w!==void 0?w===null?P=!1:P=w>=0:c?f!==void 0?P=f:_!==void 0?P=_!=null&&_>=0:P=!1:P=e.indexOf(d)>=0,P&&((c?w!=null||_!=null:w!=null)?a.push(d):l.push(d))});const u=d=>{const c=s(d.getColDef()),p=r(d.getColDef());return c??p};a.sort((d,c)=>{const p=u(d),y=u(c);return p===y?0:p<y?-1:1});const h=[].concat(a);return e.forEach(d=>{l.indexOf(d)>=0&&h.push(d)}),l.forEach(d=>{h.indexOf(d)<0&&h.push(d)}),e.forEach(d=>{h.indexOf(d)<0&&t(d,!1)}),h.forEach(d=>{e.indexOf(d)<0&&t(d,!0)}),h}extractPivotColumns(i,e){this.pivotColumns=this.extractColumns(e,this.pivotColumns,(t,s)=>t.setPivotActive(s,i),t=>t.pivotIndex,t=>t.initialPivotIndex,t=>t.pivot,t=>t.initialPivot)}resetColumnGroupState(i){if(!this.primaryColumnTree)return;const e=[];Us(null,this.primaryColumnTree,t=>{if(t instanceof At){const s=t.getColGroupDef(),r={groupId:t.getGroupId(),open:s?s.openByDefault:void 0};e.push(r)}}),this.setColumnGroupState(e,i)}getColumnGroupState(){const i=[];return Us(null,this.gridBalancedTree,e=>{e instanceof At&&i.push({groupId:e.getGroupId(),open:e.isExpanded()})}),i}setColumnGroupState(i,e){if(!this.gridBalancedTree)return;this.columnAnimationService.start();const t=[];if(i.forEach(s=>{const r=s.groupId,o=s.open,n=this.getProvidedColumnGroup(r);n&&n.isExpanded()!==o&&(this.logger.log("columnGroupOpened("+n.getGroupId()+","+o+")"),n.setExpanded(o),t.push(n))}),this.updateGroupsAndDisplayedColumns(e),this.setFirstRightAndLastLeftPinned(e),t.length){const s={type:b.EVENT_COLUMN_GROUP_OPENED,columnGroup:At.length===1?t[0]:void 0,columnGroups:t};this.eventService.dispatchEvent(s)}this.columnAnimationService.finish()}setColumnGroupOpened(i,e,t){let s;i instanceof At?s=i.getId():s=i||"",this.setColumnGroupState([{groupId:s,open:e}],t)}getProvidedColumnGroup(i){typeof i!="string"&&console.error("AG Grid: group key must be a string");let e=null;return Us(null,this.gridBalancedTree,t=>{t instanceof At&&t.getId()===i&&(e=t)}),e}calculateColumnsForDisplay(){let i;return this.pivotMode&&be(this.secondaryColumns)?i=this.gridColumns.filter(e=>{const t=this.groupAutoColumns&&ki(this.groupAutoColumns,e),s=this.valueColumns&&ki(this.valueColumns,e);return t||s}):i=this.gridColumns.filter(e=>this.groupAutoColumns&&ki(this.groupAutoColumns,e)||e.isVisible()),i}checkColSpanActiveInCols(i){let e=!1;return i.forEach(t=>{K(t.getColDef().colSpan)&&(e=!0)}),e}calculateColumnsForGroupDisplay(){this.groupDisplayColumns=[],this.groupDisplayColumnsMap={};const i=e=>{const t=e.getColDef(),s=t.showRowGroup;t&&K(s)&&(this.groupDisplayColumns.push(e),typeof s=="string"?this.groupDisplayColumnsMap[s]=e:s===!0&&this.getRowGroupColumns().forEach(r=>{this.groupDisplayColumnsMap[r.getId()]=e}))};this.gridColumns.forEach(i)}getGroupDisplayColumns(){return this.groupDisplayColumns}getGroupDisplayColumnForGroup(i){return this.groupDisplayColumnsMap[i]}updateDisplayedColumns(i){const e=this.calculateColumnsForDisplay();this.buildDisplayedTrees(e),this.updateGroupsAndDisplayedColumns(i),this.setFirstRightAndLastLeftPinned(i)}isSecondaryColumnsPresent(){return K(this.secondaryColumns)}setSecondaryColumns(i,e){if(!this.gridColumns)return;const t=i;if(!(!t&&be(this.secondaryColumns))){if(t){this.processSecondaryColumnDefinitions(i);const s=this.columnFactory.createColumnTree(i,!1,this.secondaryBalancedTree||this.previousSecondaryColumns||void 0,e);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(r=>this.secondaryColumnsMap[r.getId()]=r),this.previousSecondaryColumns=null}else this.previousSecondaryColumns=this.secondaryBalancedTree,this.secondaryBalancedTree=null,this.secondaryHeaderRowCount=-1,this.secondaryColumns=null,this.secondaryColumnsMap={};this.updateGridColumns(),this.updateDisplayedColumns(e)}}processSecondaryColumnDefinitions(i){const e=this.gos.get("processPivotResultColDef"),t=this.gos.get("processPivotResultColGroupDef");if(!e&&!t)return;const s=r=>{r.forEach(o=>{if(K(o.children)){const a=o;t&&t(a),s(a.children)}else e&&e(o)})};i&&s(i)}updateGridColumns(){const i=this.gridBalancedTree;if(this.gridColsArePrimary?this.lastPrimaryOrder=this.gridColumns:this.lastSecondaryOrder=this.gridColumns,this.createGroupAutoColumnsIfNeeded()){const s=fr(this.groupAutoColumns.map(r=>[r,!0]));this.lastPrimaryOrder&&(this.lastPrimaryOrder=this.lastPrimaryOrder.filter(r=>!s.has(r)),this.lastPrimaryOrder=[...this.groupAutoColumns,...this.lastPrimaryOrder]),this.lastSecondaryOrder&&(this.lastSecondaryOrder=this.lastSecondaryOrder.filter(r=>!s.has(r)),this.lastSecondaryOrder=[...this.groupAutoColumns,...this.lastSecondaryOrder])}let t;if(this.secondaryColumns&&this.secondaryBalancedTree){const s=this.secondaryColumns.some(r=>this.gridColumnsMap[r.getColId()]!==void 0);this.gridBalancedTree=this.secondaryBalancedTree.slice(),this.gridHeaderRowCount=this.secondaryHeaderRowCount,this.gridColumns=this.secondaryColumns.slice(),this.gridColsArePrimary=!1,s&&(t=this.lastSecondaryOrder)}else this.primaryColumns&&(this.gridBalancedTree=this.primaryColumnTree.slice(),this.gridHeaderRowCount=this.primaryHeaderRowCount,this.gridColumns=this.primaryColumns.slice(),this.gridColsArePrimary=!0,t=this.lastPrimaryOrder);if(this.addAutoGroupToGridColumns(),this.orderGridColsLike(t),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(),!Ts(i,this.gridBalancedTree)){const s={type:b.EVENT_GRID_COLUMNS_CHANGED};this.eventService.dispatchEvent(s)}}setAutoHeightActive(){this.autoHeightActive=this.gridColumns.filter(i=>i.isAutoHeight()).length>0,this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,this.gos.isRowModelType("clientSide")||this.gos.isRowModelType("serverSide")||fe("autoHeight columns only work with Client Side Row Model and Server Side Row Model."))}orderGridColsLike(i){if(be(i))return;const e=fr(i.map((l,u)=>[l,u]));let t=!0;if(this.gridColumns.forEach(l=>{e.has(l)&&(t=!1)}),t)return;const s=fr(this.gridColumns.map(l=>[l,!0])),r=i.filter(l=>s.has(l)),o=fr(r.map(l=>[l,!0])),n=this.gridColumns.filter(l=>!o.has(l)),a=r.slice();n.forEach(l=>{let u=l.getOriginalParent();if(!u){a.push(l);return}const h=[];for(;!h.length&&u;)u.getLeafColumns().forEach(y=>{const f=a.indexOf(y)>=0,w=h.indexOf(y)<0;f&&w&&h.push(y)}),u=u.getOriginalParent();if(!h.length){a.push(l);return}const d=h.map(p=>a.indexOf(p)),c=Math.max(...d);Oa(a,l,c+1)}),this.gridColumns=a}isPrimaryColumnGroupsPresent(){return this.primaryHeaderRowCount>1}refreshQuickFilterColumns(){var i;let e=(i=this.isPivotMode()&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")?this.secondaryColumns:this.primaryColumns)!=null?i:[];this.groupAutoColumns&&(e=e.concat(this.groupAutoColumns)),this.columnsForQuickFilter=this.gos.get("includeHiddenColumnsInQuickFilter")?e:e.filter(t=>t.isVisible()||t.isRowGroupActive())}placeLockedColumns(i){const e=[],t=[],s=[];return i.forEach(r=>{const o=r.getColDef().lockPosition;o==="right"?s.push(r):o==="left"||o===!0?e.push(r):t.push(r)}),[...e,...t,...s]}addAutoGroupToGridColumns(){if(be(this.groupAutoColumns)){this.destroyOldColumns(this.groupAutoColsBalancedTree),this.groupAutoColsBalancedTree=null;return}this.gridColumns=this.groupAutoColumns?this.groupAutoColumns.concat(this.gridColumns):this.gridColumns;const i=this.columnFactory.createForAutoGroups(this.groupAutoColumns,this.gridBalancedTree);this.destroyOldColumns(this.groupAutoColsBalancedTree,i),this.groupAutoColsBalancedTree=i,this.gridBalancedTree=i.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(i){this.updateOpenClosedVisibilityInColumnGroups(),this.deriveDisplayedColumns(i),this.refreshFlexedColumns(),this.extractViewport(),this.updateBodyWidths();const e={type:b.EVENT_DISPLAYED_COLUMNS_CHANGED};this.eventService.dispatchEvent(e)}deriveDisplayedColumns(i){this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft,this.displayedColumnsLeft),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre,this.displayedColumnsCenter),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight,this.displayedColumnsRight),this.joinColumnsAriaOrder(),this.joinDisplayedColumns(),this.setLeftValues(i),this.displayedAutoHeightCols=this.displayedColumns.filter(e=>e.isAutoHeight())}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}joinColumnsAriaOrder(){const i=this.getAllGridColumns(),e=[],t=[],s=[];for(const r of i){const o=r.getPinned();o?o===!0||o==="left"?e.push(r):s.push(r):t.push(r)}this.ariaOrderColumns=e.concat(t).concat(s)}joinDisplayedColumns(){this.gos.get("enableRtl")?this.displayedColumns=this.displayedColumnsRight.concat(this.displayedColumnsCenter).concat(this.displayedColumnsLeft):this.displayedColumns=this.displayedColumnsLeft.concat(this.displayedColumnsCenter).concat(this.displayedColumnsRight)}setLeftValues(i){this.setLeftValuesOfColumns(i),this.setLeftValuesOfGroups()}setLeftValuesOfColumns(i){if(!this.primaryColumns)return;const e=this.getPrimaryAndSecondaryAndAutoColumns().slice(0),t=this.gos.get("enableRtl");[this.displayedColumnsLeft,this.displayedColumnsRight,this.displayedColumnsCenter].forEach(s=>{if(t){let r=this.getWidthOfColsInList(s);s.forEach(o=>{r-=o.getActualWidth(),o.setLeft(r,i)})}else{let r=0;s.forEach(o=>{o.setLeft(r,i),r+=o.getActualWidth()})}_m(e,s)}),e.forEach(s=>{s.setLeft(null,i)})}setLeftValuesOfGroups(){[this.displayedTreeLeft,this.displayedTreeRight,this.displayedTreeCentre].forEach(i=>{i.forEach(e=>{e instanceof jt&&e.checkLeft()})})}derivedDisplayedColumnsFromDisplayedTree(i,e){e.length=0,Yr(i,!0,t=>{t instanceof Qe&&e.push(t)})}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}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(i,e){let t;switch(i){case"left":t=this.viewportRowLeft[e];break;case"right":t=this.viewportRowRight[e];break;default:t=this.viewportRowCenter[e];break}return be(t)&&(t=[]),t}calculateHeaderRows(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={};const i={};this.headerViewportColumns.forEach(t=>i[t.getId()]=!0);const e=(t,s,r)=>{let o=!1;for(let n=0;n<t.length;n++){const a=t[n];let l=!1;if(a instanceof Qe)l=i[a.getId()]===!0;else{const h=a.getDisplayedChildren();h&&(l=e(h,s,r+1))}l&&(o=!0,s[r]||(s[r]=[]),s[r].push(a))}return o};e(this.displayedTreeLeft,this.viewportRowLeft,0),e(this.displayedTreeRight,this.viewportRowRight,0),e(this.displayedTreeCentre,this.viewportRowCenter,0)}extractViewport(){const i=s=>`${s.getId()}-${s.getPinned()||"normal"}`;this.extractViewportColumns();const e=this.viewportColumns.map(i).join("#"),t=this.viewportColumnsHash!==e;return t&&(this.viewportColumnsHash=e,this.calculateHeaderRows()),t}refreshFlexedColumns(i={}){var e;const t=i.source?i.source:"flex";if(i.viewportWidth!=null&&(this.flexViewportWidth=i.viewportWidth),!this.flexViewportWidth)return[];let s=-1;if(i.resizingCols){const c=new Set(i.resizingCols);let p=this.displayedColumnsCenter;for(let y=p.length-1;y>=0;y--)if(c.has(p[y])){s=y;break}}let r=0,o=[],n=0,a=0;for(let c=0;c<this.displayedColumnsCenter.length;c++)this.displayedColumnsCenter[c].getFlex()&&c>s?(o.push(this.displayedColumnsCenter[c]),a+=this.displayedColumnsCenter[c].getFlex(),n+=(e=this.displayedColumnsCenter[c].getMinWidth())!=null?e:0):r+=this.displayedColumnsCenter[c].getActualWidth();if(!o.length)return[];let l=[];r+n>this.flexViewportWidth&&(o.forEach(c=>{var p;return c.setActualWidth((p=c.getMinWidth())!=null?p:0,t)}),l=o,o=[]);const u=[];let h;e:for(;;){h=this.flexViewportWidth-r;const c=h/a;for(let p=0;p<o.length;p++){const y=o[p],f=c*y.getFlex();let w=0;const _=y.getMinWidth(),P=y.getMaxWidth();if(K(_)&&f<_?w=_:K(P)&&f>P&&(w=P),w){y.setActualWidth(w,t),pp(o,y),a-=y.getFlex(),l.push(y),r+=y.getActualWidth();continue e}u[p]=Math.round(f)}break}let d=h;return o.forEach((c,p)=>{c.setActualWidth(Math.min(u[p],d),t),l.push(c),d-=u[p]}),i.skipSetLeft||this.setLeftValues(t),i.updateBodyWidths&&this.updateBodyWidths(),i.fireResizedEvent&&this.dispatchColumnResizedEvent(l,!0,t,o),o}sizeColumnsToFit(i,e="sizeColumnsToFit",t,s){var r,o,n,a,l;if(this.shouldQueueResizeOperations){this.resizeOperationQueue.push(()=>this.sizeColumnsToFit(i,e,t,s));return}const u={};s&&((r=s?.columnLimits)==null||r.forEach(_=>{var P=_,{key:T}=P,D=Kw(P,["key"]);u[typeof T=="string"?T:T.getColId()]=D}));const h=this.getAllDisplayedColumns(),d=i===this.getWidthOfColsInList(h);if(i<=0||!h.length||d)return;const c=[],p=[];h.forEach(_=>{_.getColDef().suppressSizeToFit===!0?p.push(_):c.push(_)});const y=c.slice(0);let f=!1;const w=_=>{_i(c,_),p.push(_)};for(c.forEach(_=>{var P,T;_.resetActualWidth(e);const D=u?.[_.getId()],M=(P=D?.minWidth)!=null?P:s?.defaultMinWidth,O=(T=D?.maxWidth)!=null?T:s?.defaultMaxWidth,N=_.getActualWidth();typeof M=="number"&&N<M?_.setActualWidth(M,e,!0):typeof O=="number"&&N>O&&_.setActualWidth(O,e,!0)});!f;){f=!0;const _=i-this.getWidthOfColsInList(p);if(_<=0)c.forEach(P=>{var T,D;const M=(D=(T=u?.[P.getId()])==null?void 0:T.minWidth)!=null?D:s?.defaultMinWidth;if(typeof M=="number"){P.setActualWidth(M,e,!0);return}P.setMinimum(e)});else{const P=_/this.getWidthOfColsInList(c);let T=_;for(let D=c.length-1;D>=0;D--){const M=c[D],O=u?.[M.getId()],N=(o=O?.minWidth)!=null?o:s?.defaultMinWidth,z=(n=O?.maxWidth)!=null?n:s?.defaultMaxWidth,Y=(a=M.getMinWidth())!=null?a:0,W=(l=M.getMaxWidth())!=null?l:Number.MAX_VALUE,$=typeof N=="number"&&N>Y?N:M.getMinWidth(),ee=typeof z=="number"&&z<W?z:M.getMaxWidth();let re=Math.round(M.getActualWidth()*P);K($)&&re<$?(re=$,w(M),f=!1):K(ee)&&re>ee?(re=ee,w(M),f=!1):D===0&&(re=T),M.setActualWidth(re,e,!0),T-=re}}}y.forEach(_=>{_.fireColumnWidthChangedEvent(e)}),this.setLeftValues(e),this.updateBodyWidths(),!t&&this.dispatchColumnResizedEvent(y,!0,e)}buildDisplayedTrees(i){const e=[],t=[],s=[];i.forEach(o=>{switch(o.getPinned()){case"left":e.push(o);break;case"right":t.push(o);break;default:s.push(o);break}});const r=new Fm;this.displayedTreeLeft=this.displayedGroupCreator.createDisplayedGroups(e,r,"left",this.displayedTreeLeft),this.displayedTreeRight=this.displayedGroupCreator.createDisplayedGroups(t,r,"right",this.displayedTreeRight),this.displayedTreeCentre=this.displayedGroupCreator.createDisplayedGroups(s,r,null,this.displayedTreeCentre),this.updateDisplayedMap()}updateDisplayedMap(){this.displayedColumnsAndGroupsMap={};const i=e=>{this.displayedColumnsAndGroupsMap[e.getUniqueId()]=e};Yr(this.displayedTreeCentre,!1,i),Yr(this.displayedTreeLeft,!1,i),Yr(this.displayedTreeRight,!1,i)}isDisplayed(i){return this.displayedColumnsAndGroupsMap[i.getUniqueId()]===i}updateOpenClosedVisibilityInColumnGroups(){const i=this.getAllDisplayedTrees();Yr(i,!1,e=>{e instanceof jt&&e.calculateDisplayedColumns()})}getGroupAutoColumns(){return this.groupAutoColumns}createGroupAutoColumnsIfNeeded(){const i=this.forceRecreateAutoGroups;if(this.forceRecreateAutoGroups=!1,!this.autoGroupsNeedBuilding)return!1;this.autoGroupsNeedBuilding=!1;const e=this.gos.isGroupUseEntireRow(this.pivotMode),t=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isGroupSuppressAutoColumn();if((this.rowGroupColumns.length>0||this.gos.get("treeData"))&&!t&&!e){const o=this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);if(!this.autoColsEqual(o,this.groupAutoColumns)||i)return this.groupAutoColumns=o,!0}else this.groupAutoColumns=null;return!1}isGroupSuppressAutoColumn(){return this.gos.get("groupDisplayType")==="custom"?!0:this.gos.get("treeDataDisplayType")==="custom"}autoColsEqual(i,e){return Ts(i,e,(t,s)=>t.getColId()===s.getColId())}getWidthOfColsInList(i){return i.reduce((e,t)=>e+t.getActualWidth(),0)}getFirstDisplayedColumn(){const i=this.gos.get("enableRtl"),e=["getDisplayedLeftColumns","getDisplayedCenterColumns","getDisplayedRightColumns"];i&&e.reverse();for(let t=0;t<e.length;t++){const s=this[e[t]]();if(s.length)return i?We(s):s[0]}return null}setColumnHeaderHeight(i,e){if(i.setAutoHeaderHeight(e)){const s={type:b.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,column:i,columns:[i],source:"autosizeColumnHeaderHeight"};this.eventService.dispatchEvent(s)}}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const i=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),e=this.getAllDisplayedColumns().filter(t=>t.isAutoHeaderHeight()).map(t=>t.getAutoHeaderHeight()||0);return Math.max(i,...e)}getHeaderHeight(){var i;return(i=this.gos.get("headerHeight"))!=null?i:this.environment.getFromTheme(25,"headerHeight")}getFloatingFiltersHeight(){var i;return(i=this.gos.get("floatingFiltersHeight"))!=null?i:this.getHeaderHeight()}getGroupHeaderHeight(){var i;return(i=this.gos.get("groupHeaderHeight"))!=null?i:this.getHeaderHeight()}getPivotHeaderHeight(){var i;return(i=this.gos.get("pivotHeaderHeight"))!=null?i:this.getHeaderHeight()}getPivotGroupHeaderHeight(){var i;return(i=this.gos.get("pivotGroupHeaderHeight"))!=null?i:this.getGroupHeaderHeight()}queueResizeOperations(){this.shouldQueueResizeOperations=!0}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach(i=>i()),this.resizeOperationQueue=[]}resetColumnDefIntoColumn(i,e){const t=i.getUserProvidedColDef();if(!t)return!1;const s=this.columnFactory.addColumnDefaultAndTypes(t,i.getColId());return i.setColDef(s,t,e),!0}isColumnGroupingLocked(i){const e=this.gos.get("groupLockGroupColumns");if(!i.isRowGroupActive()||e===0)return!1;if(e===-1)return!0;const t=this.rowGroupColumns.findIndex(s=>s.getColId()===i.getColId());return e>t}generateColumnStateForRowGroupAndPivotIndexes(i,e){let t={};const s=(r,o,n,a,l,u)=>{if(!o.length||!this.primaryColumns)return[];const h=Object.keys(r),d=new Set(h),c=new Set(h),p=new Set(o.map(M=>{const O=M.getColId();return c.delete(O),O}).concat(h)),y=[],f={};let w=0;for(let M=0;M<this.primaryColumns.length;M++){const O=this.primaryColumns[M].getColId();p.has(O)&&(y.push(O),f[O]=w++)}let _=1e3,P=!1,T=0;const D=M=>{const O=f[M];for(let N=T;N<O;N++){const z=y[N];c.has(z)&&(r[z][l]=_++,c.delete(z))}T=O};o.forEach(M=>{const O=M.getColId();if(d.has(O))D(O),r[O][l]=_++;else{const N=M.getColDef();(N[l]===null||N[l]===void 0&&N[u]==null)&&(P||(N[n]||N[n]===void 0&&N[a]?D(O):(c.forEach(W=>{r[W][l]=_+f[W]}),_+=y.length,P=!0)),t[O]||(t[O]={colId:O}),t[O][l]=_++)}})};return s(i,this.rowGroupColumns,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),s(e,this.pivotColumns,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(t)}onColumnsReady(){const i=this.gos.get("autoSizeStrategy");if(!i)return;const{type:e}=i;setTimeout(()=>{if(e==="fitGridWidth"){const{columnLimits:t,defaultMinWidth:s,defaultMaxWidth:r}=i,o=t?.map(({colId:n,minWidth:a,maxWidth:l})=>({key:n,minWidth:a,maxWidth:l}));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:s,defaultMaxWidth:r,columnLimits:o})}else e==="fitProvidedWidth"&&this.sizeColumnsToFit(i.width,"sizeColumnsToFit")})}onFirstDataRendered(){const i=this.gos.get("autoSizeStrategy");if(i?.type!=="fitCellContents")return;const{colIds:e,skipHeader:t}=i;setTimeout(()=>{e?this.autoSizeColumns({columns:e,skipHeader:t,source:"autosizeColumns"}):this.autoSizeAllColumns("autosizeColumns",t)})}};g([R("expressionService")],Xt.prototype,"expressionService",2);g([R("columnFactory")],Xt.prototype,"columnFactory",2);g([R("displayedGroupCreator")],Xt.prototype,"displayedGroupCreator",2);g([R("ctrlsService")],Xt.prototype,"ctrlsService",2);g([R("autoWidthCalculator")],Xt.prototype,"autoWidthCalculator",2);g([R("columnAnimationService")],Xt.prototype,"columnAnimationService",2);g([R("autoGroupColService")],Xt.prototype,"autoGroupColService",2);g([R("valueCache")],Xt.prototype,"valueCache",2);g([R("animationFrameService")],Xt.prototype,"animationFrameService",2);g([R("sortController")],Xt.prototype,"sortController",2);g([R("columnDefFactory")],Xt.prototype,"columnDefFactory",2);g([Ke("aggFuncService")],Xt.prototype,"aggFuncService",2);g([J],Xt.prototype,"init",1);g([vi],Xt.prototype,"destroyColumns",1);g([gs(0,Ki("loggerFactory"))],Xt.prototype,"setBeans",1);Xt=g([le("columnModel")],Xt);function sn(i){return i==="gridOptionsUpdated"?"gridOptionsChanged":i}function Yr(i,e,t){if(i)for(let s=0;s<i.length;s++){const r=i[s];if(r instanceof jt){const o=e?r.getDisplayedChildren():r.getChildren();Yr(o,e,t)}t(r)}}var Lc=class extends Z{createDisplayedGroups(i,e,t,s){const r=this.mapOldGroupsById(s),o=[];let n=i;for(;n.length;){const a=n;n=[];let l=0;const u=h=>{const d=l;l=h;const c=a[d],y=(c instanceof jt?c.getProvidedColumnGroup():c).getOriginalParent();if(y==null){for(let w=d;w<h;w++)o.push(a[w]);return}const f=this.createColumnGroup(y,e,r,t);for(let w=d;w<h;w++)f.addChild(a[w]);n.push(f)};for(let h=1;h<a.length;h++){const d=a[h],p=(d instanceof jt?d.getProvidedColumnGroup():d).getOriginalParent(),y=a[l],w=(y instanceof jt?y.getProvidedColumnGroup():y).getOriginalParent();p!==w&&u(h)}l<a.length&&u(a.length)}return this.setupParentsIntoColumns(o,null),o}createColumnGroup(i,e,t,s){const r=i.getGroupId(),o=e.getInstanceIdForKey(r),n=jt.createUniqueId(r,o);let a=t[n];return a&&a.getProvidedColumnGroup()!==i&&(a=null),K(a)?a.reset():(a=new jt(i,r,o,s),this.context.createBean(a)),a}mapOldGroupsById(i){const e={},t=s=>{s.forEach(r=>{if(r instanceof jt){const o=r;e[r.getUniqueId()]=o,t(o.getChildren())}})};return i&&t(i),e}setupParentsIntoColumns(i,e){i.forEach(t=>{if(t.setParent(e),t instanceof jt){const s=t;this.setupParentsIntoColumns(s.getChildren(),s)}})}};Lc=g([le("displayedGroupCreator")],Lc);var fb={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},Gt=class{};Gt.STRING_PROPERTIES=["rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","grandTotalRow"];Gt.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"];Gt.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"];Gt.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"];Gt.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","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval"];Gt.OTHER_PROPERTIES=["suppressStickyTotalRow"];Gt.FUNCTIONAL_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher"];Gt.CALLBACK_PROPERTIES=["getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","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","groupTotalRow"];Gt.FUNCTION_PROPERTIES=[...Gt.FUNCTIONAL_PROPERTIES,...Gt.CALLBACK_PROPERTIES];Gt.ALL_PROPERTIES=[...Gt.ARRAY_PROPERTIES,...Gt.OBJECT_PROPERTIES,...Gt.STRING_PROPERTIES,...Gt.NUMBER_PROPERTIES,...Gt.FUNCTION_PROPERTIES,...Gt.BOOLEAN_PROPERTIES,...Gt.OTHER_PROPERTIES];var Ga=Gt,Zt=class Ou{static getCallbackForEvent(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}static getGridOptionKeys(){return this.ALL_PROPERTIES_AND_CALLBACKS}static combineAttributesAndGridOptions(e,t){typeof e!="object"&&(e={});const s=de({},e);return Ou.getGridOptionKeys().forEach(o=>{const n=t[o];typeof n<"u"&&n!==Ou.VUE_OMITTED_PROPERTY&&(s[o]=n)}),s}static processOnChange(e,t,s){if(!e)return;const r={};let o=!1;if(Object.keys(e).filter(a=>Ou.ALL_PROPERTIES_AND_CALLBACKS_SET.has(a)).forEach(a=>{r[a]=e[a],o=!0}),!o)return;t.__internalUpdateGridOptions(r,!0);const n={type:b.EVENT_COMPONENT_STATE_CHANGED};si(r,(a,l)=>{n[a]=l}),t.dispatchEvent(n)}};Zt.EVENTS=io(b);Zt.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY";Zt.EXCLUDED_INTERNAL_EVENTS=[b.EVENT_SCROLLBAR_WIDTH_CHANGED,b.EVENT_CHECKBOX_CHANGED,b.EVENT_HEIGHT_SCALE_CHANGED,b.EVENT_BODY_HEIGHT_CHANGED,b.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,b.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,b.EVENT_SCROLL_VISIBILITY_CHANGED,b.EVENT_COLUMN_HOVER_CHANGED,b.EVENT_FLASH_CELLS,b.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,b.EVENT_DISPLAYED_ROWS_CHANGED,b.EVENT_LEFT_PINNED_WIDTH_CHANGED,b.EVENT_RIGHT_PINNED_WIDTH_CHANGED,b.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,b.EVENT_STORE_UPDATED,b.EVENT_COLUMN_PANEL_ITEM_DRAG_START,b.EVENT_COLUMN_PANEL_ITEM_DRAG_END,b.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,b.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,b.EVENT_FULL_WIDTH_ROW_FOCUSED,b.EVENT_HEADER_HEIGHT_CHANGED,b.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,b.EVENT_CELL_FOCUS_CLEARED,b.EVENT_GRID_STYLES_CHANGED,b.EVENT_FILTER_DESTROYED,b.EVENT_ROW_DATA_UPDATE_STARTED,b.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,b.EVENT_DATA_TYPES_INFERRED,b.EVENT_FIELD_VALUE_CHANGED,b.EVENT_FIELD_PICKER_VALUE_SELECTED,b.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,b.EVENT_SUPPRESS_MENU_HIDE_CHANGED,b.EVENT_SUPPRESS_FIELD_DOT_NOTATION,b.EVENT_ROW_COUNT_READY,b.EVENT_SIDE_BAR_UPDATED];Zt.PUBLIC_EVENTS=Zt.EVENTS.filter(i=>!ki(Zt.EXCLUDED_INTERNAL_EVENTS,i));Zt.EVENT_CALLBACKS=Zt.EVENTS.map(i=>Zt.getCallbackForEvent(i));Zt.BOOLEAN_PROPERTIES=Ga.BOOLEAN_PROPERTIES;Zt.ALL_PROPERTIES=Ga.ALL_PROPERTIES;Zt.ALL_PROPERTIES_AND_CALLBACKS=[...Zt.ALL_PROPERTIES,...Zt.EVENT_CALLBACKS];Zt.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(Zt.ALL_PROPERTIES_AND_CALLBACKS);var eh=Zt,Ic=class extends Z{constructor(){super(...arguments),this.componentsMappedByName={}}setupComponents(i){i&&i.forEach(e=>this.addComponent(e))}addComponent(i){const t=i.componentName.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().toUpperCase();this.componentsMappedByName[t]=i.componentClass}getComponentClass(i){return this.componentsMappedByName[i]}};Ic=g([le("agStackComponentsRegistry")],Ic);var Nm={};qt(Nm,{getAriaCheckboxStateName:()=>Wh,getAriaLabel:()=>Hm,getAriaLevel:()=>mb,getAriaPosInSet:()=>Vm,getAriaSortState:()=>Gm,removeAriaExpanded:()=>Um,removeAriaSort:()=>qm,setAriaActiveDescendant:()=>Cp,setAriaAtomic:()=>Bm,setAriaChecked:()=>Cb,setAriaColCount:()=>$m,setAriaColIndex:()=>wp,setAriaColSpan:()=>Km,setAriaControls:()=>bp,setAriaDescribedBy:()=>vb,setAriaDisabled:()=>vp,setAriaExpanded:()=>Xs,setAriaHidden:()=>_l,setAriaLabel:()=>Gi,setAriaLabelledBy:()=>gn,setAriaLevel:()=>jm,setAriaLive:()=>mp,setAriaMultiSelectable:()=>zm,setAriaPosInSet:()=>Bh,setAriaRelevant:()=>Wm,setAriaRole:()=>yt,setAriaRowCount:()=>Ym,setAriaRowIndex:()=>yp,setAriaSelected:()=>fn,setAriaSetSize:()=>Hh,setAriaSort:()=>Xm});function ts(i,e,t){t==null||typeof t=="string"&&t==""?fp(i,e):is(i,e,t)}function is(i,e,t){i.setAttribute(km(e),t.toString())}function fp(i,e){i.removeAttribute(km(e))}function km(i){return`aria-${i}`}function yt(i,e){e?i.setAttribute("role",e):i.removeAttribute("role")}function Gm(i){let e;return i==="asc"?e="ascending":i==="desc"?e="descending":i==="mixed"?e="other":e="none",e}function mb(i){return parseInt(i.getAttribute("aria-level"),10)}function Vm(i){return parseInt(i.getAttribute("aria-posinset"),10)}function Hm(i){return i.getAttribute("aria-label")}function Gi(i,e){ts(i,"label",e)}function gn(i,e){ts(i,"labelledby",e)}function vb(i,e){ts(i,"describedby",e)}function mp(i,e){ts(i,"live",e)}function Bm(i,e){ts(i,"atomic",e)}function Wm(i,e){ts(i,"relevant",e)}function jm(i,e){ts(i,"level",e)}function vp(i,e){ts(i,"disabled",e)}function _l(i,e){ts(i,"hidden",e)}function Cp(i,e){ts(i,"activedescendant",e)}function Xs(i,e){is(i,"expanded",e)}function Um(i){fp(i,"expanded")}function Hh(i,e){is(i,"setsize",e)}function Bh(i,e){is(i,"posinset",e)}function zm(i,e){is(i,"multiselectable",e)}function Ym(i,e){is(i,"rowcount",e)}function yp(i,e){is(i,"rowindex",e)}function $m(i,e){is(i,"colcount",e)}function wp(i,e){is(i,"colindex",e)}function Km(i,e){is(i,"colspan",e)}function Xm(i,e){is(i,"sort",e)}function qm(i){fp(i,"sort")}function fn(i,e){ts(i,"selected",e)}function Cb(i,e){is(i,"checked",e===void 0?"mixed":e)}function bp(i,e){ts(i,"controls",e.id),gn(e,i.id)}function Wh(i,e){return e===void 0?i("ariaIndeterminate","indeterminate"):e===!0?i("ariaChecked","checked"):i("ariaUnchecked","unchecked")}var Qm={};qt(Qm,{browserSupportsPreventScroll:()=>xp,getBodyHeight:()=>ev,getBodyWidth:()=>Jm,getMaxDivHeight:()=>Zm,getSafariVersion:()=>Sp,getScrollbarWidth:()=>tv,getTabIndex:()=>th,isBrowserChrome:()=>jh,isBrowserFirefox:()=>_p,isBrowserSafari:()=>Os,isIOSUserAgent:()=>Js,isInvisibleScrollbar:()=>Rp,isMacOsUserAgent:()=>Ep});var zd,mu,Yd,$d,Kd,Xd,Oc,Nc;function Os(){return zd===void 0&&(zd=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),zd}function Sp(){if(mu===void 0)if(Os()){const i=navigator.userAgent.match(/version\/(\d+)/i);i&&(mu=i[1]!=null?parseFloat(i[1]):0)}else mu=0;return mu}function jh(){if(Yd===void 0){const i=window;Yd=!!i.chrome&&(!!i.chrome.webstore||!!i.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return Yd}function _p(){return $d===void 0&&($d=/(firefox)/i.test(navigator.userAgent)),$d}function Ep(){return Kd===void 0&&(Kd=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),Kd}function Js(){return Xd===void 0&&(Xd=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),Xd}function xp(){return!Os()||Sp()>=15}function th(i){if(!i)return null;const e=i.tabIndex,t=i.getAttribute("tabIndex");return e===-1&&(t===null||t===""&&!_p())?null:e.toString()}function Zm(){if(!document.body)return-1;let i=1e6;const e=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,t=document.createElement("div");for(document.body.appendChild(t);;){const s=i*2;if(t.style.height=s+"px",s>e||t.clientHeight!==s)break;i=s}return document.body.removeChild(t),i}function Jm(){var i,e,t;return(t=(i=document.body)==null?void 0:i.clientWidth)!=null?t:window.innerHeight||((e=document.documentElement)==null?void 0:e.clientWidth)||-1}function ev(){var i,e,t;return(t=(i=document.body)==null?void 0:i.clientHeight)!=null?t:window.innerHeight||((e=document.documentElement)==null?void 0:e.clientHeight)||-1}function tv(){return Nc==null&&iv(),Nc}function iv(){const i=document.body,e=document.createElement("div");e.style.width=e.style.height="100px",e.style.opacity="0",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar",e.style.position="absolute",i.appendChild(e);let t=e.offsetWidth-e.clientWidth;t===0&&e.clientWidth===0&&(t=null),e.parentNode&&e.parentNode.removeChild(e),t!=null&&(Nc=t,Oc=t===0)}function Rp(){return Oc==null&&iv(),Oc}var sv={};qt(sv,{dateToFormattedString:()=>un,parseDateTimeFromString:()=>xi,serialiseDate:()=>Qi});var rv={};qt(rv,{cleanNumber:()=>yb,createArrayOfNumbers:()=>ov,decToHex:()=>wb,formatNumberCommas:()=>Dp,formatNumberTwoDecimalPlacesAndCommas:()=>bb,padStartWidthZeros:()=>ln,sum:()=>Sb});function ln(i,e){return i.toString().padStart(e,"0")}function ov(i,e){const t=[];for(let s=i;s<=e;s++)t.push(s);return t}function yb(i){return typeof i=="string"&&(i=parseInt(i,10)),typeof i=="number"?Math.floor(i):null}function wb(i,e){let t="";for(let s=0;s<e;s++)t+=String.fromCharCode(i&255),i>>>=8;return t}function bb(i,e,t){return typeof i!="number"?"":Dp(Math.round(i*100)/100,e,t)}function Dp(i,e,t){return typeof i!="number"?"":i.toString().replace(".",t).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${e}`)}function Sb(i){return i==null?null:i.reduce((e,t)=>e+t,0)}function Qi(i,e=!0,t="-"){if(!i)return null;let s=[i.getFullYear(),i.getMonth()+1,i.getDate()].map(r=>ln(r,2)).join(t);return e&&(s+=" "+[i.getHours(),i.getMinutes(),i.getSeconds()].map(r=>ln(r,2)).join(":")),s}var qd=i=>{if(i>3&&i<21)return"th";switch(i%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function un(i,e="YYYY-MM-DD"){const t=ln(i.getFullYear(),4),s=["January","February","March","April","May","June","July","August","September","October","November","December"],r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o={YYYY:()=>t.slice(t.length-4,t.length),YY:()=>t.slice(t.length-2,t.length),Y:()=>`${i.getFullYear()}`,MMMM:()=>s[i.getMonth()],MMM:()=>s[i.getMonth()].slice(0,3),MM:()=>ln(i.getMonth()+1,2),Mo:()=>`${i.getMonth()+1}${qd(i.getMonth()+1)}`,M:()=>`${i.getMonth()+1}`,Do:()=>`${i.getDate()}${qd(i.getDate())}`,DD:()=>ln(i.getDate(),2),D:()=>`${i.getDate()}`,dddd:()=>r[i.getDay()],ddd:()=>r[i.getDay()].slice(0,3),dd:()=>r[i.getDay()].slice(0,2),do:()=>`${i.getDay()}${qd(i.getDay())}`,d:()=>`${i.getDay()}`},n=new RegExp(Object.keys(o).join("|"),"g");return e.replace(n,a=>a in o?o[a]():a)}function xi(i){if(!i)return null;const[e,t]=i.split(" ");if(!e)return null;const s=e.split("-").map(d=>parseInt(d,10));if(s.filter(d=>!isNaN(d)).length!==3)return null;const[r,o,n]=s,a=new Date(r,o-1,n);if(a.getFullYear()!==r||a.getMonth()!==o-1||a.getDate()!==n)return null;if(!t||t==="00:00:00")return a;const[l,u,h]=t.split(":").map(d=>parseInt(d,10));return l>=0&&l<24&&a.setHours(l),u>=0&&u<60&&a.setMinutes(u),h>=0&&h<60&&a.setSeconds(h),a}var nv={};qt(nv,{FOCUSABLE_EXCLUDE:()=>Pp,FOCUSABLE_SELECTOR:()=>av,addOrRemoveAttribute:()=>Ms,addStylesToElement:()=>Op,bindCellRendererToHtmlElement:()=>kp,clearElement:()=>Rt,copyNodeList:()=>cv,ensureDomOrder:()=>Lp,formatSize:()=>Uh,getAbsoluteHeight:()=>Ap,getAbsoluteWidth:()=>Va,getElementRectWithOffset:()=>Fp,getElementSize:()=>Rr,getInnerHeight:()=>El,getInnerWidth:()=>To,getScrollLeft:()=>Ba,insertWithDomOrder:()=>uv,isElementChildOfClass:()=>so,isFocusableFormField:()=>Tp,isHorizontalScrollShowing:()=>hv,isInDOM:()=>Mp,isNodeOrElement:()=>xl,isRtlNegativeScroll:()=>Ha,isVerticalScrollShowing:()=>dv,isVisible:()=>Pi,iterateNamedNodeMap:()=>pv,loadTemplate:()=>Ri,nodeListForEach:()=>Np,radioCssClass:()=>kc,removeFromParent:()=>fs,setDisabled:()=>mn,setDisplayed:()=>Ge,setDomChildOrder:()=>Ip,setElementHeight:()=>_b,setElementWidth:()=>ja,setFixedHeight:()=>ro,setFixedWidth:()=>Zi,setScrollLeft:()=>Wa,setVisible:()=>lv});var vu;function kc(i,e,t){const s=i.parentElement;let r=s&&s.firstChild;for(;r;)e&&r.classList.toggle(e,r===i),t&&r.classList.toggle(t,r!==i),r=r.nextSibling}var av="[tabindex], input, select, button, textarea, [href]",Pp="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Tp(i){const e=Element.prototype.matches||Element.prototype.msMatchesSelector,s=e.call(i,"input, select, button, textarea"),r=e.call(i,Pp),o=Pi(i);return s&&!r&&o}function Ge(i,e,t={}){const{skipAriaHidden:s}=t;i.classList.toggle("ag-hidden",!e),s||_l(i,!e)}function lv(i,e,t={}){const{skipAriaHidden:s}=t;i.classList.toggle("ag-invisible",!e),s||_l(i,!e)}function mn(i,e){const t="disabled",s=e?r=>r.setAttribute(t,""):r=>r.removeAttribute(t);s(i),Np(i.querySelectorAll("input"),r=>s(r))}function so(i,e,t){let s=0;for(;i;){if(i.classList.contains(e))return!0;if(i=i.parentElement,typeof t=="number"){if(++s>t)break}else if(i===t)break}return!1}function Rr(i){const{height:e,width:t,borderTopWidth:s,borderRightWidth:r,borderBottomWidth:o,borderLeftWidth:n,paddingTop:a,paddingRight:l,paddingBottom:u,paddingLeft:h,marginTop:d,marginRight:c,marginBottom:p,marginLeft:y,boxSizing:f}=window.getComputedStyle(i);return{height:parseFloat(e||"0"),width:parseFloat(t||"0"),borderTopWidth:parseFloat(s||"0"),borderRightWidth:parseFloat(r||"0"),borderBottomWidth:parseFloat(o||"0"),borderLeftWidth:parseFloat(n||"0"),paddingTop:parseFloat(a||"0"),paddingRight:parseFloat(l||"0"),paddingBottom:parseFloat(u||"0"),paddingLeft:parseFloat(h||"0"),marginTop:parseFloat(d||"0"),marginRight:parseFloat(c||"0"),marginBottom:parseFloat(p||"0"),marginLeft:parseFloat(y||"0"),boxSizing:f}}function El(i){const e=Rr(i);return e.boxSizing==="border-box"?e.height-e.paddingTop-e.paddingBottom:e.height}function To(i){const e=Rr(i);return e.boxSizing==="border-box"?e.width-e.paddingLeft-e.paddingRight:e.width}function Ap(i){const e=Rr(i),t=e.marginBottom+e.marginTop;return Math.ceil(i.offsetHeight+t)}function Va(i){const e=Rr(i),t=e.marginLeft+e.marginRight;return Math.ceil(i.offsetWidth+t)}function Fp(i){const e=i.getBoundingClientRect(),{borderTopWidth:t,borderLeftWidth:s,borderRightWidth:r,borderBottomWidth:o}=Rr(i);return{top:e.top+(t||0),left:e.left+(s||0),right:e.right+(r||0),bottom:e.bottom+(o||0)}}function Ha(){if(typeof vu=="boolean")return vu;const i=document.createElement("div");return i.style.direction="rtl",i.style.width="1px",i.style.height="1px",i.style.position="fixed",i.style.top="0px",i.style.overflow="hidden",i.dir="rtl",i.innerHTML=`<div style="width: 2px">
<span style="display: inline-block; width: 1px"></span>
<span style="display: inline-block; width: 1px"></span>
</div>`,document.body.appendChild(i),i.scrollLeft=1,vu=Math.floor(i.scrollLeft)===0,document.body.removeChild(i),vu}function Ba(i,e){let t=i.scrollLeft;return e&&(t=Math.abs(t),jh()&&!Ha()&&(t=i.scrollWidth-i.clientWidth-t)),t}function Wa(i,e,t){t&&(Ha()?e*=-1:(Os()||jh())&&(e=i.scrollWidth-i.clientWidth-e)),i.scrollLeft=e}function Rt(i){for(;i&&i.firstChild;)i.removeChild(i.firstChild)}function fs(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function Mp(i){return!!i.offsetParent}function Pi(i){const e=i;return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!Mp(i)||window.getComputedStyle(i).visibility!=="visible")}function Ri(i){const e=document.createElement("div");return e.innerHTML=(i||"").trim(),e.firstChild}function Lp(i,e,t){t&&t.nextSibling===e||(t?t.nextSibling?i.insertBefore(e,t.nextSibling):i.appendChild(e):i.firstChild&&i.firstChild!==e&&i.insertAdjacentElement("afterbegin",e))}function Ip(i,e){for(let t=0;t<e.length;t++){const s=e[t],r=i.children[t];r!==s&&i.insertBefore(s,r)}}function uv(i,e,t){t?t.insertAdjacentElement("afterend",e):i.firstChild?i.insertAdjacentElement("afterbegin",e):i.appendChild(e)}function Op(i,e){if(e)for(const[t,s]of Object.entries(e)){if(!t||!t.length||s==null)continue;const r=Im(t),o=s.toString(),n=o.replace(/\s*!important/g,""),a=n.length!=o.length?"important":void 0;i.style.setProperty(r,n,a)}}function hv(i){return i.clientWidth<i.scrollWidth}function dv(i){return i.clientHeight<i.scrollHeight}function ja(i,e){e==="flex"?(i.style.removeProperty("width"),i.style.removeProperty("minWidth"),i.style.removeProperty("maxWidth"),i.style.flex="1 1 auto"):Zi(i,e)}function Zi(i,e){e=Uh(e),i.style.width=e.toString(),i.style.maxWidth=e.toString(),i.style.minWidth=e.toString()}function _b(i,e){e==="flex"?(i.style.removeProperty("height"),i.style.removeProperty("minHeight"),i.style.removeProperty("maxHeight"),i.style.flex="1 1 auto"):ro(i,e)}function ro(i,e){e=Uh(e),i.style.height=e.toString(),i.style.maxHeight=e.toString(),i.style.minHeight=e.toString()}function Uh(i){return typeof i=="number"?`${i}px`:i}function xl(i){return i instanceof Node||i instanceof HTMLElement}function cv(i){if(i==null)return[];const e=[];return Np(i,t=>e.push(t)),e}function pv(i,e){if(i)for(let t=0;t<i.length;t++){const s=i[t];e(s.name,s.value)}}function Ms(i,e,t){t==null?i.removeAttribute(e):i.setAttribute(e,t.toString())}function Np(i,e){if(i!=null)for(let t=0;t<i.length;t++)e(i[t])}function kp(i,e){i.then(t=>{const s=t.getGui();s!=null&&(typeof s=="object"?e.appendChild(s):e.innerHTML=s)})}var gv={};qt(gv,{fuzzyCheckStrings:()=>fv,fuzzySuggestions:()=>Rl});function fv(i,e,t){const s={},r=i.filter(o=>!e.some(n=>n===o));return r.length>0&&r.forEach(o=>s[o]=Rl(o,t).values),s}function Rl(i,e,t,s){let r=e.map((a,l)=>({value:a,relevance:Eb(i.toLowerCase(),a.toLocaleLowerCase()),idx:l}));if(r.sort((a,l)=>l.relevance-a.relevance),t&&(r=r.filter(a=>a.relevance!==0)),r.length>0&&s&&s>0){const l=r[0].relevance*s;r=r.filter(u=>l-u.relevance<0)}const o=[],n=[];for(const a of r)o.push(a.value),n.push(a.idx);return{values:o,indices:n}}function Eb(i,e){const t=i.replace(/\s/g,""),s=e.replace(/\s/g,"");let r=0,o=-1;for(let n=0;n<t.length;n++){const a=s.indexOf(t[n],o+1);a!==-1&&(o=a,r+=100-o*100/1e4*100)}return r}var mv={};qt(mv,{createIcon:()=>Ui,createIconNoSpan:()=>dt,iconNameClassMap:()=>vv});var vv={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 Ui(i,e,t){const s=dt(i,e,t);if(s){const{className:o}=s;if(typeof o=="string"&&o.indexOf("ag-icon")>-1||typeof o=="object"&&o["ag-icon"])return s}const r=document.createElement("span");return r.appendChild(s),r}function dt(i,e,t,s){let r=null;const o=t&&t.getColDef().icons;if(o&&(r=o[i]),e&&!r){const n=e.get("icons");n&&(r=n[i])}if(r){let n;if(typeof r=="function")n=r();else if(typeof r=="string")n=r;else throw new Error("icon from grid options needs to be a string or a function");if(typeof n=="string")return Ri(n);if(xl(n))return n;console.warn("AG Grid: iconRenderer should return back a string or a dom object")}else{const n=document.createElement("span");let a=vv[i];return a||(s?a=i:(console.warn(`AG Grid: Did not find icon ${i}`),a="")),n.setAttribute("class",`ag-icon ag-icon-${a}`),n.setAttribute("unselectable","on"),yt(n,"presentation"),n}}var Cv={};qt(Cv,{isDeleteKey:()=>bv,isEventFromPrintableCharacter:()=>zh,isUserSuppressingHeaderKeyboardEvent:()=>yv,isUserSuppressingKeyboardEvent:()=>ih,normaliseQwertyAzerty:()=>wv});var k=class{};k.BACKSPACE="Backspace";k.TAB="Tab";k.ENTER="Enter";k.ESCAPE="Escape";k.SPACE=" ";k.LEFT="ArrowLeft";k.UP="ArrowUp";k.RIGHT="ArrowRight";k.DOWN="ArrowDown";k.DELETE="Delete";k.F2="F2";k.PAGE_UP="PageUp";k.PAGE_DOWN="PageDown";k.PAGE_HOME="Home";k.PAGE_END="End";k.A="KeyA";k.C="KeyC";k.D="KeyD";k.V="KeyV";k.X="KeyX";k.Y="KeyY";k.Z="KeyZ";var xb=65,Rb=67,Db=86,Pb=68,Tb=90,Ab=89;function zh(i){return i.altKey||i.ctrlKey||i.metaKey?!1:i.key.length===1}function ih(i,e,t,s,r){const o=s?s.getColDef().suppressKeyboardEvent:void 0;if(!o)return!1;const n=i.addGridCommonParams({event:e,editing:r,column:s,node:t,data:t.data,colDef:s.getColDef()});return!!(o&&o(n))}function yv(i,e,t,s){const r=s.getDefinition(),o=r&&r.suppressHeaderKeyboardEvent;if(!K(o))return!1;const n=i.addGridCommonParams({colDef:r,column:s,headerRowIndex:t,event:e});return!!o(n)}function wv(i){const{keyCode:e}=i;let t;switch(e){case xb:t=k.A;break;case Rb:t=k.C;break;case Db:t=k.V;break;case Pb:t=k.D;break;case Tb:t=k.Z;break;case Ab:t=k.Y;break;default:t=i.code}return t}function bv(i,e=!1){return i===k.DELETE?!0:!e&&i===k.BACKSPACE?Ep():!1}var Sv={};qt(Sv,{areEventsNear:()=>Gp});function Gp(i,e,t){if(t===0)return!1;const s=Math.abs(i.clientX-e.clientX),r=Math.abs(i.clientY-e.clientY);return Math.max(s,r)<=t}var _v={};qt(_v,{sortRowNodesByOrder:()=>Fb});function Fb(i,e){if(!i)return!1;const t=(n,a)=>{const l=e[n.id],u=e[a.id],h=l!==void 0,d=u!==void 0,c=h&&d,p=!h&&!d;return c?l-u:p?n.__objectId-a.__objectId:h?1:-1};let s,r,o=!1;for(let n=0;n<i.length-1;n++)if(s=i[n],r=i[n+1],t(s,r)>0){o=!0;break}return o?(i.sort(t),!0):!1}var Ev={};qt(Ev,{convertToSet:()=>Vp});function Vp(i){const e=new Set;return i.forEach(t=>e.add(t)),e}var Mb=de(de(de(de(de(de(de(de(de(de(de(de(de(de(de(de(de(de({},Nm),wm),Qm),sv),nv),ym),dm),gv),lm),mv),Cv),Om),Sv),rv),um),_v),Ev),Mm),ye=Mb,vn=class{constructor(i=0,e=1){this.nextValue=i,this.step=e}next(){const i=this.nextValue;return this.nextValue+=this.step,i}peek(){return this.nextValue}skip(i){this.nextValue+=i}},Lt=class Nu{constructor(e){this.status=0,this.resolution=null,this.waiters=[],e(t=>this.onDone(t),t=>this.onReject(t))}static all(e){return new Nu(t=>{let s=e.length;const r=new Array(s);e.forEach((o,n)=>{o.then(a=>{r[n]=a,s--,s===0&&t(r)})})})}static resolve(e=null){return new Nu(t=>t(e))}then(e){return new Nu(t=>{this.status===1?t(e(this.resolution)):this.waiters.push(s=>t(e(s)))})}resolveNow(e,t){return this.status===1?t(this.resolution):e}onDone(e){this.status=1,this.resolution=e,this.waiters.forEach(t=>t(e))}onReject(e){console.warn("TBI")}},Dl=class{constructor(i){this.cssClassStates={},this.getGui=i}addCssClass(i){const e=(i||"").split(" ");if(e.length>1){e.forEach(s=>this.addCssClass(s));return}if(this.cssClassStates[i]!==!0&&i.length){const s=this.getGui();s&&s.classList.add(i),this.cssClassStates[i]=!0}}removeCssClass(i){const e=(i||"").split(" ");if(e.length>1){e.forEach(s=>this.removeCssClass(s));return}if(this.cssClassStates[i]!==!1&&i.length){const s=this.getGui();s&&s.classList.remove(i),this.cssClassStates[i]=!1}}containsCssClass(i){const e=this.getGui();return e?e.classList.contains(i):!1}addOrRemoveCssClass(i,e){if(!i)return;if(i.indexOf(" ")>=0){const s=(i||"").split(" ");if(s.length>1){s.forEach(r=>this.addOrRemoveCssClass(r,e));return}}if(this.cssClassStates[i]!==e&&i.length){const s=this.getGui();s&&s.classList.toggle(i,e),this.cssClassStates[i]=e}}},Pl=class $r extends Z{constructor(e,t,s,r){super(),this.parentComp=e,this.tooltipShowDelayOverride=t,this.tooltipHideDelayOverride=s,this.shouldDisplayTooltip=r,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.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const e=this.parentComp.getGui();this.tooltipTrigger===0&&(this.addManagedListener(e,"mouseenter",this.onMouseEnter.bind(this)),this.addManagedListener(e,"mouseleave",this.onMouseLeave.bind(this))),this.tooltipTrigger===1&&(this.addManagedListener(e,"focusin",this.onFocusIn.bind(this)),this.addManagedListener(e,"focusout",this.onFocusOut.bind(this))),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.interactionEnabled||(this.addManagedListener(e,"mousedown",this.onMouseDown.bind(this)),this.addManagedListener(e,"keydown",this.onKeyDown.bind(this)))}getGridOptionsTooltipDelay(e){const t=this.gos.get(e);return t<0&&fe(`${e} should not be lower than 0`),Math.max(200,t)}getTooltipDelay(e){var t,s;return e==="show"?(t=this.tooltipShowDelayOverride)!=null?t:this.getGridOptionsTooltipDelay("tooltipShowDelay"):(s=this.tooltipHideDelayOverride)!=null?s:this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gos.get("tooltipTrigger");return!e||e==="hover"?0:1}onMouseEnter(e){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),!Js()&&($r.isLocked?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(e)},this.INTERACTIVE_HIDE_DELAY):this.prepareToShowTooltip(e))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&this.state===2&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){var t;const s=e.relatedTarget,r=this.parentComp.getGui(),o=(t=this.tooltipComp)==null?void 0:t.getGui();this.isInteractingWithTooltip||r.contains(s)||this.interactionEnabled&&o?.contains(s)||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(e){if(this.state!=0||$r.isLocked)return;let t=0;e&&(t=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=e||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),t),this.state=1}isLastTooltipHiddenRecently(){const e=new Date().getTime(),t=$r.lastTooltipHideTime;return e-t<this.SHOW_QUICK_TOOLTIP_DIFF}setToDoNothing(){this.state===2&&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 e=de({},this.parentComp.getTooltipParams());if(!K(e.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip()){this.setToDoNothing();return}this.state=2,this.tooltipInstanceCount++;const t=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(e).newAgStackInstance().then(t)}hideTooltip(e){if(!e&&this.isInteractingWithTooltip)return;this.tooltipComp&&(this.destroyTooltipComp(),$r.lastTooltipHideTime=new Date().getTime());const t={type:b.EVENT_TOOLTIP_HIDE,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(t),this.state=0}newTooltipComponentCallback(e,t){if(this.state!==2||this.tooltipInstanceCount!==e){this.getContext().destroyBean(t);return}const r=t.getGui();this.tooltipComp=t,r.classList.contains("ag-tooltip")||r.classList.add("ag-tooltip-custom"),this.tooltipTrigger===0&&r.classList.add("ag-tooltip-animate"),this.interactionEnabled&&r.classList.add("ag-tooltip-interactive");const o=this.localeService.getLocaleTextFunc(),n=this.popupService.addPopup({eChild:r,ariaLabel:o("ariaLabelTooltip","Tooltip")});n&&(this.tooltipPopupDestroyFunc=n.hideFunc),this.positionTooltip(),this.tooltipTrigger===1&&(this.onBodyScrollEventCallback=this.addManagedListener(this.eventService,b.EVENT_BODY_SCROLL,this.setToDoNothing.bind(this)),this.onColumnMovedEventCallback=this.addManagedListener(this.eventService,b.EVENT_COLUMN_MOVED,this.setToDoNothing.bind(this))),this.interactionEnabled&&(this.tooltipTrigger===0?(this.tooltipMouseEnterListener=this.addManagedListener(r,"mouseenter",this.onTooltipMouseEnter.bind(this))||null,this.tooltipMouseLeaveListener=this.addManagedListener(r,"mouseleave",this.onTooltipMouseLeave.bind(this))||null):(this.tooltipFocusInListener=this.addManagedListener(r,"focusin",this.onTooltipFocusIn.bind(this))||null,this.tooltipFocusOutListener=this.addManagedListener(r,"focusout",this.onTooltipFocusOut.bind(this))||null));const a={type:b.EVENT_TOOLTIP_SHOW,tooltipGui:r,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(a),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}onTooltipFocusOut(e){var t;const s=this.parentComp.getGui(),r=(t=this.tooltipComp)==null?void 0:t.getGui(),o=e.relatedTarget;r?.contains(o)||(this.isInteractingWithTooltip=!1,s.contains(o)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent(lt(de({},e),{mouseEvent:this.lastMouseEvent})):this.popupService.positionPopupByComponent(lt(de({},e),{eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5}))}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const e=this.tooltipPopupDestroyFunc,t=this.tooltipComp,s=this.tooltipTrigger===0?this.FADE_OUT_TOOLTIP_TIMEOUT:0;window.setTimeout(()=>{e(),this.getContext().destroyBean(t)},s),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach(e=>{e&&e()}),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){$r.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},this.INTERACTIVE_HIDE_DELAY)}unlockService(){$r.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()}};Pl.isLocked=!1;g([R("popupService")],Pl.prototype,"popupService",2);g([R("userComponentFactory")],Pl.prototype,"userComponentFactory",2);g([J],Pl.prototype,"postConstruct",1);var Lb=Pl,er=class extends Z{constructor(i,e){super(),this.ctrl=i,e&&(this.beans=e)}postConstruct(){this.refreshToolTip()}setBrowserTooltip(i){const e="title",t=this.ctrl.getGui();t&&(i!=null&&i!=""?t.setAttribute(e,i):t.removeAttribute(e))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){var i,e,t,s;if(this.tooltipManager!=null)return;const r={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new Lb(r,(e=(i=this.ctrl).getTooltipShowDelayOverride)==null?void 0:e.call(i),(s=(t=this.ctrl).getTooltipHideDelayOverride)==null?void 0:s.call(t),this.ctrl.shouldDisplayTooltip),this.beans.context)}refreshToolTip(){this.browserTooltips=this.beans.gos.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 i=this.ctrl,e=i.getColumn?i.getColumn():void 0,t=i.getColDef?i.getColDef():void 0,s=i.getRowNode?i.getRowNode():void 0;return{location:i.getLocation(),colDef:t,column:e,rowIndex:i.getRowIndex?i.getRowIndex():void 0,node:s,data:s?s.data:void 0,value:this.getTooltipText(),valueFormatted:i.getValueFormatted?i.getValueFormatted():void 0,hideTooltipCallback:()=>{var r;return(r=this.tooltipManager)==null?void 0:r.hideTooltip(!0)}}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}};g([R("beans")],er.prototype,"beans",2);g([J],er.prototype,"postConstruct",1);var Ib=new vn,Tl=class Gc extends Z{constructor(e){super(),this.displayed=!0,this.visible=!0,this.compId=Ib.next(),this.cssClassManager=new Dl(()=>this.eGui),e&&this.setTemplate(e)}preConstructOnComponent(){this.usingBrowserTooltips=this.gos.get("enableBrowserTooltips")}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(e){const{newTooltipText:t,showDelayOverride:s,hideDelayOverride:r,location:o,shouldDisplayTooltip:n}=e||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==t&&(this.tooltipText=t);const a=()=>this.tooltipText;t!=null&&(this.tooltipFeature=this.createBean(new er({getTooltipValue:a,getGui:()=>this.getGui(),getLocation:()=>o??"UNKNOWN",getColDef:e?.getColDef,getColumn:e?.getColumn,getTooltipShowDelayOverride:s!=null?()=>s:void 0,getTooltipHideDelayOverride:r!=null?()=>r:void 0,shouldDisplayTooltip:n})))}createChildComponentsFromTags(e,t){cv(e.childNodes).forEach(r=>{if(!(r instanceof HTMLElement))return;const o=this.createComponentFromElement(r,n=>{n.getGui()&&this.copyAttributesFromNode(r,n.getGui())},t);if(o){if(o.addItems&&r.children.length){this.createChildComponentsFromTags(r,t);const n=Array.prototype.slice.call(r.children);o.addItems(n)}this.swapComponentForNode(o,e,r)}else r.childNodes&&this.createChildComponentsFromTags(r,t)})}createComponentFromElement(e,t,s){const r=e.nodeName,o=s?s[e.getAttribute("ref")]:void 0,n=this.agStackComponentsRegistry.getComponentClass(r);if(n){Gc.elementGettingCreated=e;const a=new n(o);return a.setParentComponent(this),this.createBean(a,null,t),a}return null}copyAttributesFromNode(e,t){pv(e.attributes,(s,r)=>t.setAttribute(s,r))}swapComponentForNode(e,t,s){const r=e.getGui();t.replaceChild(r,s),t.insertBefore(document.createComment(s.nodeName),r),this.addDestroyFunc(this.destroyBean.bind(this,e)),this.swapInComponentForQuerySelectors(e,s)}swapInComponentForQuerySelectors(e,t){const s=this;this.iterateOverQuerySelectors(r=>{s[r.attributeName]===t&&(s[r.attributeName]=e)})}iterateOverQuerySelectors(e){let t=Object.getPrototypeOf(this);for(;t!=null;){const s=t.__agComponentMetaData,r=Oh(t.constructor);s&&s[r]&&s[r].querySelectors&&s[r].querySelectors.forEach(o=>e(o)),t=Object.getPrototypeOf(t)}}activateTabIndex(e){const t=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui()),e.forEach(s=>s.setAttribute("tabindex",t.toString()))}setTemplate(e,t){const s=Ri(e);this.setTemplateFromElement(s,t)}setTemplateFromElement(e,t){this.eGui=e,this.eGui.__agComponent=this,this.wireQuerySelectors(),this.getContext()&&this.createChildComponentsFromTags(this.getGui(),t)}createChildComponentsPreConstruct(){this.getGui()&&this.createChildComponentsFromTags(this.getGui())}wireQuerySelectors(){if(!this.eGui)return;const e=this;this.iterateOverQuerySelectors(t=>{const s=o=>e[t.attributeName]=o;if(t.refSelector&&this.getAttribute("ref")===t.refSelector)s(this.eGui);else{const o=this.eGui.querySelector(t.querySelector);o&&s(o.__agComponent||o)}})}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}queryForHtmlInputElement(e){return this.eGui.querySelector(e)}appendChild(e,t){if(e!=null)if(t||(t=this.eGui),xl(e))t.appendChild(e);else{const s=e;t.appendChild(s.getGui())}}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:s}=t;lv(this.eGui,e,{skipAriaHidden:s})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:s}=t;Ge(this.eGui,e,{skipAriaHidden:s});const r={type:Gc.EVENT_DISPLAYED_CHANGED,visible:this.displayed};this.dispatchEvent(r)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const e=this.eGui;e&&e.__agComponent&&(e.__agComponent=void 0),super.destroy()}addGuiEventListener(e,t,s){this.eGui.addEventListener(e,t,s),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,t))}addCssClass(e){this.cssClassManager.addCssClass(e)}removeCssClass(e){this.cssClassManager.removeCssClass(e)}containsCssClass(e){return this.cssClassManager.containsCssClass(e)}addOrRemoveCssClass(e,t){this.cssClassManager.addOrRemoveCssClass(e,t)}getAttribute(e){const{eGui:t}=this;return t?t.getAttribute(e):null}getRefElement(e){return this.queryForHtmlElement(`[ref="${e}"]`)}};Tl.EVENT_DISPLAYED_CHANGED="displayedChanged";g([R("agStackComponentsRegistry")],Tl.prototype,"agStackComponentsRegistry",2);g([fm],Tl.prototype,"preConstructOnComponent",1);g([fm],Tl.prototype,"createChildComponentsPreConstruct",1);var Se=Tl;function te(i){return Ob.bind(this,`[ref=${i}]`,i)}function Ob(i,e,t,s,r){if(i===null){console.error("AG Grid: QuerySelector selector should not be null");return}if(typeof r=="number"){console.error("AG Grid: QuerySelector should be on an attribute");return}Nb(t,"querySelectors",{attributeName:s,querySelector:i,refSelector:e})}function Nb(i,e,t){const s=kb(i,Oh(i.constructor));s[e]||(s[e]=[]),s[e].push(t)}function kb(i,e){return i.__agComponentMetaData||(i.__agComponentMetaData={}),i.__agComponentMetaData[e]||(i.__agComponentMetaData[e]={}),i.__agComponentMetaData[e]}var Hp=class extends Se{constructor(){super(`
<div class="ag-floating-filter-input" role="presentation">
<ag-input-text-field ref="eFloatingFilterText"></ag-input-text-field>
</div>`)}destroy(){super.destroy()}init(i){this.params=i;const e=this.columnModel.getDisplayNameForColumn(i.column,"header",!0),t=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${e} ${t("ariaFilterInput","Filter Input")}`)}onParentModelChanged(i){if(i==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(e=>{if(e.getModelAsString){const t=e.getModelAsString(i);this.eFloatingFilterText.setValue(t)}})}onParamsUpdated(i){this.refresh(i)}refresh(i){this.init(i)}};g([te("eFloatingFilterText")],Hp.prototype,"eFloatingFilterText",2);g([R("columnModel")],Hp.prototype,"columnModel",2);var xv=class{constructor(i,e,t,s,r){this.alive=!0,this.context=i,this.eParent=s,e.getDateCompDetails(t).newAgStackInstance().then(a=>{if(!this.alive){i.destroyBean(a);return}this.dateComp=a,a&&(s.appendChild(a.getGui()),a.afterGuiAttached&&a.afterGuiAttached(),this.tempValue&&a.setDate(this.tempValue),this.disabled!=null&&this.setDateCompDisabled(this.disabled),r?.(this))})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(i){this.dateComp?this.dateComp.setDate(i):this.tempValue=i}setDisabled(i){this.dateComp?this.setDateCompDisabled(i):this.disabled=i}setDisplayed(i){Ge(this.eParent,i)}setInputPlaceholder(i){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(i)}setInputAriaLabel(i){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(i)}afterGuiAttached(i){this.dateComp&&typeof this.dateComp.afterGuiAttached=="function"&&this.dateComp.afterGuiAttached(i)}updateParams(i){var e,t;let s=!1;(e=this.dateComp)!=null&&e.refresh&&typeof this.dateComp.refresh=="function"&&this.dateComp.refresh(i)!==null&&(s=!0),!s&&((t=this.dateComp)!=null&&t.onParamsUpdated)&&typeof this.dateComp.onParamsUpdated=="function"&&this.dateComp.onParamsUpdated(i)!==null&&fe("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}setDateCompDisabled(i){this.dateComp!=null&&this.dateComp.setDisabled!=null&&this.dateComp.setDisabled(i)}},Rv=class{constructor(){this.customFilterOptions={}}init(i,e){this.filterOptions=i.filterOptions||e,this.mapCustomOptions(),this.selectDefaultItem(i)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach(i=>{if(typeof i=="string")return;const e=[["displayKey"],["displayName"],["predicate","test"]],t=s=>s.some(r=>i[r]!=null)?!0:(console.warn(`AG Grid: ignoring FilterOptionDef as it doesn't contain one of '${s}'`),!1);if(!e.every(t)){this.filterOptions=this.filterOptions.filter(s=>s===i)||[];return}this.customFilterOptions[i.displayKey]=i})}selectDefaultItem(i){if(i.defaultOption)this.defaultOption=i.defaultOption;else if(this.filterOptions.length>=1){const e=this.filterOptions[0];typeof e=="string"?this.defaultOption=e:e.displayKey?this.defaultOption=e.displayKey:console.warn("AG Grid: invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else console.warn("AG Grid: no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(i){return this.customFilterOptions[i]}},Dv={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"},Yh=class Pv extends Z{constructor(e,t={}){super(),this.eFocusableElement=e,this.callbacks=t,this.callbacks=de({shouldStopEventPropagation:()=>!1,onTabKeyDown:s=>{if(s.defaultPrevented)return;const r=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,s.shiftKey);r&&(r.focus(),s.preventDefault())}},t)}postConstruct(){this.eFocusableElement.classList.add(Pv.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(e){this.addManagedListener(e,"keydown",t=>{if(!(t.defaultPrevented||vs(t))){if(this.callbacks.shouldStopEventPropagation(t)){ws(t);return}t.key===k.TAB?this.callbacks.onTabKeyDown(t):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(t)}})}};Yh.FOCUS_MANAGED_CLASS="ag-focus-managed";g([R("focusService")],Yh.prototype,"focusService",2);g([J],Yh.prototype,"postConstruct",1);var Dr=Yh,Tv="ag-resizer-wrapper",Gb=`<div class="${Tv}">
<div ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>
<div ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>
<div ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>
<div ref="eRightResizer" class="ag-resizer ag-resizer-right"></div>
<div ref="eBottomRightResizer" class="ag-resizer ag-resizer-bottomRight"></div>
<div ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>
<div ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>
<div ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>
</div>`,On=class extends Z{constructor(i,e){super(),this.element=i,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},e)}center(){const{clientHeight:i,clientWidth:e}=this.offsetParent,t=e/2-this.getWidth()/2,s=i/2-this.getHeight()/2;this.offsetElement(t,s)}initialisePosition(){if(this.positioned)return;const{centered:i,forcePopupParentAsOffsetParent:e,minWidth:t,width:s,minHeight:r,height:o,x:n,y:a}=this.config;this.offsetParent||this.setOffsetParent();let l=0,u=0;const h=Pi(this.element);if(h){const d=this.findBoundaryElement(),c=window.getComputedStyle(d);if(c.minWidth!=null){const p=d.offsetWidth-this.element.offsetWidth;u=parseInt(c.minWidth,10)-p}if(c.minHeight!=null){const p=d.offsetHeight-this.element.offsetHeight;l=parseInt(c.minHeight,10)-p}}if(this.minHeight=r||l,this.minWidth=t||u,s&&this.setWidth(s),o&&this.setHeight(o),(!s||!o)&&this.refreshSize(),i)this.center();else if(n||a)this.offsetElement(n,a);else if(h&&e){let d=this.boundaryEl,c=!0;if(d||(d=this.findBoundaryElement(),c=!1),d){const p=parseFloat(d.style.top),y=parseFloat(d.style.left);c?this.offsetElement(isNaN(y)?0:y,isNaN(p)?0:p):this.setPosition(y,p)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(i,e){if(!this.config.popup||i===this.movable)return;this.movable=i;const t=this.moveElementDragListener||{eElement:e,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};i?(this.dragService.addDragSource(t),this.moveElementDragListener=t):(this.dragService.removeDragSource(t),this.moveElementDragListener=void 0)}setResizable(i){if(this.clearResizeListeners(),i?this.addResizers():this.removeResizers(),typeof i=="boolean"){if(i===!1)return;i={topLeft:i,top:i,topRight:i,right:i,bottomRight:i,bottom:i,bottomLeft:i,left:i}}Object.keys(i).forEach(e=>{const s=!!i[e],r=this.getResizerElement(e),o={dragStartPixels:0,eElement:r,onDragStart:n=>this.onResizeStart(n,e),onDragging:this.onResize.bind(this),onDragStop:n=>this.onResizeEnd(n,e)};(s||!this.isAlive()&&!s)&&(s?(this.dragService.addDragSource(o),this.resizeListeners.push(o),r.style.pointerEvents="all"):r.style.pointerEvents="none",this.resizable[e]=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:i,width:e}=this.lastSize;e!==-1&&(this.element.style.width=`${e}px`),i!==-1&&(this.element.style.height=`${i}px`)}getHeight(){return this.element.offsetHeight}setHeight(i){const{popup:e}=this.config,t=this.element;let s=!1;if(typeof i=="string"&&i.indexOf("%")!==-1)ro(t,i),i=Ap(t),s=!0;else if(i=Math.max(this.minHeight,i),this.positioned){const r=this.getAvailableHeight();r&&i>r&&(i=r)}this.getHeight()!==i&&(s?(t.style.maxHeight="unset",t.style.minHeight="unset"):e?ro(t,i):(t.style.height=`${i}px`,t.style.flex="0 0 auto",this.lastSize.height=typeof i=="number"?i:parseFloat(i)))}getAvailableHeight(){const{popup:i,forcePopupParentAsOffsetParent:e}=this.config;this.positioned||this.initialisePosition();const{clientHeight:t}=this.offsetParent;if(!t)return null;const s=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),o=i?this.position.y:s.top,n=i?0:r.top;let a=0;if(e){const u=this.element.parentElement;if(u){const{bottom:h}=u.getBoundingClientRect();a=h-s.bottom}}return t+n-o-a}getWidth(){return this.element.offsetWidth}setWidth(i){const e=this.element,{popup:t}=this.config;let s=!1;if(typeof i=="string"&&i.indexOf("%")!==-1)Zi(e,i),i=Va(e),s=!0;else if(this.positioned){i=Math.max(this.minWidth,i);const{clientWidth:r}=this.offsetParent,o=t?this.position.x:this.element.getBoundingClientRect().left;r&&i+o>r&&(i=r-o)}this.getWidth()!==i&&(s?(e.style.maxWidth="unset",e.style.minWidth="unset"):this.config.popup?Zi(e,i):(e.style.width=`${i}px`,e.style.flex=" unset",this.lastSize.width=typeof i=="number"?i:parseFloat(i)))}offsetElement(i=0,e=0){const{forcePopupParentAsOffsetParent:t}=this.config,s=t?this.boundaryEl:this.element;s&&(this.popupService.positionPopup({ePopup:s,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:i,y:e})}),this.setPosition(parseFloat(s.style.left),parseFloat(s.style.top)))}constrainSizeToAvailableHeight(i){if(!this.config.forcePopupParentAsOffsetParent)return;const e=()=>{const t=this.getAvailableHeight();this.element.style.setProperty("max-height",`${t}px`)};i?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),e):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(i,e){this.position.x=i,this.position.y=e}updateDragStartPosition(i,e){this.dragStartPosition={x:i,y:e}}calculateMouseMovement(i){const{e,isLeft:t,isTop:s,anywhereWithin:r,topBuffer:o}=i,n=e.clientX-this.dragStartPosition.x,a=e.clientY-this.dragStartPosition.y,l=this.shouldSkipX(e,!!t,!!r,n)?0:n,u=this.shouldSkipY(e,!!s,o,a)?0:a;return{movementX:l,movementY:u}}shouldSkipX(i,e,t,s){const r=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.x:r.left;let l=a<=0&&o.left>=i.clientX||o.right<=i.clientX&&o.right<=n.right;return l?!0:(e?l=s<0&&i.clientX>a+o.left||s>0&&i.clientX<a+o.left:t?l=s<0&&i.clientX>n.right||s>0&&i.clientX<a+o.left:l=s<0&&i.clientX>n.right||s>0&&i.clientX<n.right,l)}shouldSkipY(i,e,t=0,s){const r=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.y:r.top;let l=a<=0&&o.top>=i.clientY||o.bottom<=i.clientY&&o.bottom<=n.bottom;return l?!0:(e?l=s<0&&i.clientY>a+o.top+t||s>0&&i.clientY<a+o.top:l=s<0&&i.clientY>n.bottom||s>0&&i.clientY<n.bottom,l)}createResizeMap(){const i=this.element;this.resizerMap={topLeft:{element:i.querySelector("[ref=eTopLeftResizer]")},top:{element:i.querySelector("[ref=eTopResizer]")},topRight:{element:i.querySelector("[ref=eTopRightResizer]")},right:{element:i.querySelector("[ref=eRightResizer]")},bottomRight:{element:i.querySelector("[ref=eBottomRightResizer]")},bottom:{element:i.querySelector("[ref=eBottomResizer]")},bottomLeft:{element:i.querySelector("[ref=eBottomLeftResizer]")},left:{element:i.querySelector("[ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const i=this.element;if(!i)return;const t=new DOMParser().parseFromString(Gb,"text/html").body;i.appendChild(t.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const i=this.element.querySelector(`.${Tv}`);i&&this.element.removeChild(i),this.resizersAdded=!1}getResizerElement(i){return this.resizerMap[i].element}onResizeStart(i,e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!e.match(/top/i),isRight:!!e.match(/right/i),isBottom:!!e.match(/bottom/i),isLeft:!!e.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[e].element.classList.add("ag-active");const{popup:t,forcePopupParentAsOffsetParent:s}=this.config;!t&&!s&&this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(i.clientX,i.clientY)}getSiblings(){const e=this.element.parentElement;return e?Array.prototype.slice.call(e.children).filter(t=>!t.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const i=this.getSiblings()||[];let e=0,t=0;for(let s=0;s<i.length;s++){const r=i[s],o=!!r.style.flex&&r.style.flex!=="0 0 auto";if(r===this.element)continue;let n=this.minHeight||0,a=this.minWidth||0;if(o){const l=window.getComputedStyle(r);l.minHeight&&(n=parseInt(l.minHeight,10)),l.minWidth&&(a=parseInt(l.minWidth,10))}else n=r.offsetHeight,a=r.offsetWidth;e+=n,t+=a}return{height:e,width:t}}applySizeToSiblings(i){let e=null;const t=this.getSiblings();if(t){for(let s=0;s<t.length;s++){const r=t[s];r!==e&&(i?r.style.height=`${r.offsetHeight}px`:r.style.width=`${r.offsetWidth}px`,r.style.flex="0 0 auto",r===this.element&&(e=t[s+1]))}e&&(e.style.removeProperty("height"),e.style.removeProperty("min-height"),e.style.removeProperty("max-height"),e.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(i=>i)}onResize(i){if(!this.isResizing||!this.currentResizer)return;const{popup:e,forcePopupParentAsOffsetParent:t}=this.config,{isTop:s,isRight:r,isBottom:o,isLeft:n}=this.currentResizer,a=r||n,l=o||s,{movementX:u,movementY:h}=this.calculateMouseMovement({e:i,isLeft:n,isTop:s}),d=this.position.x,c=this.position.y;let p=0,y=0;if(a&&u){const f=n?-1:1,w=this.getWidth(),_=w+u*f;let P=!1;n&&(p=w-_,(d+p<=0||_<=this.minWidth)&&(P=!0,p=0)),P||this.setWidth(_)}if(l&&h){const f=s?-1:1,w=this.getHeight(),_=w+h*f;let P=!1;s?(y=w-_,(c+y<=0||_<=this.minHeight)&&(P=!0,y=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&w<_&&this.getMinSizeOfSiblings().height+_>this.element.parentElement.offsetHeight&&(P=!0),P||this.setHeight(_)}this.updateDragStartPosition(i.clientX,i.clientY),((e||t)&&p||y)&&this.offsetElement(d+p,c+y)}onResizeEnd(i,e){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null;const t={type:"resize"};this.element.classList.remove("ag-resizing"),this.resizerMap[e].element.classList.remove("ag-active"),this.dispatchEvent(t)}refreshSize(){const i=this.element;this.config.popup&&(this.config.width||this.setWidth(i.offsetWidth),this.config.height||this.setHeight(i.offsetHeight))}onMoveStart(i){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(i.clientX,i.clientY)}onMove(i){if(!this.isMoving)return;const{x:e,y:t}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:r,movementY:o}=this.calculateMouseMovement({e:i,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(e+r,t+o),this.updateDragStartPosition(i.clientX,i.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let i=this.element;for(;i;){if(window.getComputedStyle(i).position!=="static")return i;i=i.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const i=this.resizeListeners.pop();this.dragService.removeDragSource(i)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}};g([R("popupService")],On.prototype,"popupService",2);g([R("resizeObserverService")],On.prototype,"resizeObserverService",2);g([R("dragService")],On.prototype,"dragService",2);var $h=class wa extends Se{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.buttonListeners=[]}postConstruct(){this.resetTemplate(),this.createManagedBean(new Dr(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new On(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(e){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(e){let t=this.getGui();t&&t.removeEventListener("submit",this.onFormSubmit);const s=`
<form class="ag-filter-wrapper">
<div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" ref="eFilterBody">
${this.createBodyTemplate()}
</div>
</form>`;this.setTemplate(s,e),t=this.getGui(),t&&t.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.providedFilterParams.readOnly}init(e){this.setParams(e),this.resetUiToDefaults(!0).then(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}setParams(e){this.providedFilterParams=e,this.applyActive=wa.isUseApplyButton(e),this.resetButtonsPanel()}updateParams(e){this.providedFilterParams=e,this.applyActive=wa.isUseApplyButton(e),this.resetUiToActiveModel(this.getModel(),()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}resetButtonsPanel(){const{buttons:e}=this.providedFilterParams,t=e&&e.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(Rt(this.eButtonsPanel),this.buttonListeners.forEach(o=>o?.()),this.buttonListeners=[]):t&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!t){this.eButtonsPanel&&fs(this.eButtonsPanel);return}const s=document.createDocumentFragment(),r=o=>{let n,a;switch(o){case"apply":n=this.translate("applyFilter"),a=h=>this.onBtApply(!1,!1,h);break;case"clear":n=this.translate("clearFilter"),a=()=>this.onBtClear();break;case"reset":n=this.translate("resetFilter"),a=()=>this.onBtReset();break;case"cancel":n=this.translate("cancelFilter"),a=h=>{this.onBtCancel(h)};break;default:console.warn("AG Grid: Unknown button type specified");return}const u=Ri(`<button
type="${o==="apply"?"submit":"button"}"
ref="${o}FilterButton"
class="ag-button ag-standard-button ag-filter-apply-panel-button"
>${n}
</button>`);this.buttonListeners.push(this.addManagedListener(u,"click",a)),s.append(u)};Vp(e).forEach(o=>r(o)),this.eButtonsPanel.append(s),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const e=wa.getDebounceMs(this.providedFilterParams,this.getDefaultDebounceMs()),t=ci(this.checkApplyDebounce.bind(this),e);this.onBtApplyDebounce=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?this.appliedModel:null}setModel(e){return(e!=null?this.setModelIntoUi(e):this.resetUiToDefaults()).then(()=>{this.updateUiVisibility(),this.applyModel("api")})}onBtCancel(e){this.resetUiToActiveModel(this.getModel(),()=>{this.handleCancelEnd(e)})}handleCancelEnd(e){this.providedFilterParams.closeOnApply&&this.close(e)}resetUiToActiveModel(e,t){const s=()=>{this.onUiChanged(!1,"prevent"),t?.()};e!=null?this.setModelIntoUi(e).then(s):this.resetUiToDefaults().then(s)}onBtClear(){this.resetUiToDefaults().then(()=>this.onUiChanged())}onBtReset(){this.onBtClear(),this.onBtApply()}applyModel(e="api"){const t=this.getModelFromUi();if(!this.isModelValid(t))return!1;const s=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(s,t)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,t=!1,s){s&&s.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")&&this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t,source:"columnFilter"});const{closeOnApply:r}=this.providedFilterParams;r&&this.applyActive&&!e&&!t&&this.close(s)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const t=e,s=t&&t.key;let r;(s==="Enter"||s==="Space")&&(r={keyboardEvent:t}),this.hidePopup(r),this.hidePopup=null}onUiChanged(e=!1,t){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const s=this.isModelValid(this.getModelFromUi()),r=this.getRefElement("applyFilterButton");r&&mn(r,!s)}e&&!t||t==="immediately"?this.onBtApply(e):(!this.applyActive&&!t||t==="debounce")&&this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(e?.container)}refreshFilterResizer(e){if(!this.positionableFeature||e==="toolPanel")return;const t=e==="floatingFilter"||e==="columnFilter",{positionableFeature:s,gos:r}=this;t?(s.restoreLastSize(),s.setResizable(r.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(e,t){return wa.isUseApplyButton(e)?(e.debounceMs!=null&&console.warn("AG Grid: debounceMs is ignored when apply button is present"),0):e.debounceMs!=null?e.debounceMs:t}static isUseApplyButton(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}refresh(e){return this.providedFilterParams=e,!0}destroy(){const e=this.getGui();e&&e.removeEventListener("submit",this.onFormSubmit),this.hidePopup=null,this.positionableFeature&&(this.positionableFeature=this.destroyBean(this.positionableFeature)),this.appliedModel=null,super.destroy()}translate(e){return this.localeService.getLocaleTextFunc()(e,Dv[e])}getCellValue(e){return this.providedFilterParams.getValue(e)}getPositionableElement(){return this.eFilterBody}};g([R("rowModel")],$h.prototype,"rowModel",2);g([te("eFilterBody")],$h.prototype,"eFilterBody",2);g([J],$h.prototype,"postConstruct",1);var sh=$h,Bp=class extends Se{constructor(i,e){super(e),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=i||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:i,label:e,labelWidth:t,labelAlignment:s,disabled:r}=this.config;r!=null&&this.setDisabled(r),i!=null&&this.setLabelSeparator(i),e!=null&&this.setLabel(e),t!=null&&this.setLabelWidth(t),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){Rt(this.eLabel),typeof this.label=="string"?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),this.label===""?(Ge(this.eLabel,!1),yt(this.eLabel,"presentation")):(Ge(this.eLabel,!0),yt(this.eLabel,null))}setLabelSeparator(i){return this.labelSeparator===i?this:(this.labelSeparator=i,this.label!=null&&this.refreshLabel(),this)}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(i){return this.label===i?this:(this.label=i,this.refreshLabel(),this)}setLabelAlignment(i){const t=this.getGui().classList;return t.toggle("ag-label-align-left",i==="left"),t.toggle("ag-label-align-right",i==="right"),t.toggle("ag-label-align-top",i==="top"),this}setLabelEllipsis(i){return this.eLabel.classList.toggle("ag-label-ellipsis",i),this}setLabelWidth(i){return this.label==null?this:(ja(this.eLabel,i),this)}setDisabled(i){i=!!i;const e=this.getGui();return mn(e,i),e.classList.toggle("ag-disabled",i),this.disabled=i,this}isDisabled(){return!!this.disabled}};g([J],Bp.prototype,"postConstruct",1);var Av=class extends Bp{constructor(i,e,t){super(i,e),this.className=t}postConstruct(){super.postConstruct();const{width:i,value:e,onValueChange:t}=this.config;i!=null&&this.setWidth(i),e!=null&&this.setValue(e),t!=null&&this.onValueChange(t),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}refreshAriaLabelledBy(){const i=this.getAriaElement(),e=this.getLabelId();Hm(i)!==null?gn(i,""):gn(i,e??"")}setAriaLabel(i){return Gi(this.getAriaElement(),i),this.refreshAriaLabelledBy(),this}onValueChange(i){return this.addManagedListener(this,b.EVENT_FIELD_VALUE_CHANGED,()=>i(this.getValue())),this}getWidth(){return this.getGui().clientWidth}setWidth(i){return Zi(this.getGui(),i),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(i,e){return this.value===i?this:(this.previousValue=this.value,this.value=i,e||this.dispatchEvent({type:b.EVENT_FIELD_VALUE_CHANGED}),this)}},Vb=`
<div class="ag-picker-field" role="presentation">
<div ref="eLabel"></div>
<div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">
<div ref="eDisplayField" class="ag-picker-field-display"></div>
<div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>
</div>
</div>`,Ao=class extends Av{constructor(i){if(super(i,i?.template||Vb,i?.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.ariaRole=i?.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!i)return;const{pickerGap:e,maxPickerHeight:t,variableWidth:s,minPickerWidth:r,maxPickerWidth:o}=i;e!=null&&(this.pickerGap=e),this.variableWidth=!!s,t!=null&&this.setPickerMaxHeight(t),r!=null&&this.setPickerMinWidth(r),o!=null&&this.setPickerMaxWidth(o)}postConstruct(){super.postConstruct(),this.setupAria();const i=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",i);const e=this.getAriaElement();this.addManagedListener(e,"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:t,inputWidth:s}=this.config;if(t){const r=dt(t,this.gos);r&&this.eIcon.appendChild(r)}s!=null&&this.setInputWidth(s)}setupAria(){const i=this.getAriaElement();i.setAttribute("tabindex",this.gos.get("tabIndex").toString()),Xs(i,!1),this.ariaRole&&yt(i,this.ariaRole)}onLabelOrWrapperMouseDown(i){if(i){const e=this.getFocusableElement();if(e!==this.eWrapper&&i?.target===e)return;i.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(i){switch(i.key){case k.UP:case k.DOWN:case k.ENTER:case k.SPACE:i.preventDefault(),this.onLabelOrWrapperMouseDown();break;case k.ESCAPE:this.isPickerDisplayed&&(i.preventDefault(),i.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker());break}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const i=this.pickerComponent.getGui();i.addEventListener("focusin",this.onPickerFocusIn),i.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const i=this.gos.getDocument(),e=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||(this.destroyMouseWheelFunc=this.addManagedListener(this.eventService,b.EVENT_BODY_SCROLL,()=>{this.hidePicker()}));const t=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:s,pickerAriaLabelValue:r,modalPicker:o=!0}=this.config,n={modal:o,eChild:e,closeOnEsc:!0,closedCallback:()=>{const p=this.gos.getActiveDomElement(),y=!p||p===i.body;this.beforeHidePicker(),y&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:t(s,r)},a=this.popupService.addPopup(n),{maxPickerHeight:l,minPickerWidth:u,maxPickerWidth:h,variableWidth:d}=this;d?(u&&(e.style.minWidth=u),e.style.width=Uh(Va(this.eWrapper)),h&&(e.style.maxWidth=h)):ja(e,h??Va(this.eWrapper));const c=l??`${El(this.popupService.getPopupParent())}px`;return e.style.setProperty("max-height",c),e.style.position="absolute",this.alignPickerToComponent(),a.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:i}=this.config,{pickerGap:e}=this,t=this.gos.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:i,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:t,keepWithinBounds:!0,nudgeY:e})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const i=this.pickerComponent.getGui();i.removeEventListener("focusin",this.onPickerFocusIn),i.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(i){if(!this.isAlive())return;const e=this.getAriaElement();Xs(e,i),this.eWrapper.classList.toggle("ag-picker-expanded",i),this.eWrapper.classList.toggle("ag-picker-collapsed",!i)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(i){var e;(e=this.pickerComponent)!=null&&e.getGui().contains(i.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(i){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",i)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(i){return ja(this.eWrapper,i),this}getFocusableElement(){return this.eWrapper}setPickerGap(i){return this.pickerGap=i,this}setPickerMinWidth(i){return typeof i=="number"&&(i=`${i}px`),this.minPickerWidth=i??void 0,this}setPickerMaxWidth(i){return typeof i=="number"&&(i=`${i}px`),this.maxPickerWidth=i??void 0,this}setPickerMaxHeight(i){return typeof i=="number"&&(i=`${i}px`),this.maxPickerHeight=i??void 0,this}destroy(){this.hidePicker(),super.destroy()}};g([R("popupService")],Ao.prototype,"popupService",2);g([te("eLabel")],Ao.prototype,"eLabel",2);g([te("eWrapper")],Ao.prototype,"eWrapper",2);g([te("eDisplayField")],Ao.prototype,"eDisplayField",2);g([te("eIcon")],Ao.prototype,"eIcon",2);var Kh=class ku extends Se{constructor(e="default",t=!1){super(`<div class="ag-list ag-${e}-list" role="listbox"></div>`),this.cssIdentifier=e,this.unFocusable=t,this.options=[],this.itemEls=[]}init(){const e=this.getGui();this.addManagedListener(e,"mouseleave",()=>this.clearHighlighted()),!this.unFocusable&&this.addManagedListener(e,"keydown",this.handleKeyDown.bind(this))}handleKeyDown(e){const t=e.key;switch(t){case k.ENTER:if(!this.highlightedEl)this.setValue(this.getValue());else{const s=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(s)}break;case k.DOWN:case k.UP:e.preventDefault(),this.navigate(t);break;case k.PAGE_DOWN:case k.PAGE_UP:case k.PAGE_HOME:case k.PAGE_END:e.preventDefault(),this.navigateToPage(t);break}}navigate(e){const t=e===k.DOWN;let s;if(!this.highlightedEl)s=this.itemEls[t?0:this.itemEls.length-1];else{let o=this.itemEls.indexOf(this.highlightedEl)+(t?1:-1);o=Math.min(Math.max(o,0),this.itemEls.length-1),s=this.itemEls[o]}this.highlightItem(s)}navigateToPage(e){if(!this.highlightedEl||this.itemEls.length===0)return;const t=this.itemEls.indexOf(this.highlightedEl),s=this.options.length-1,r=this.itemEls[0].clientHeight,o=Math.floor(this.getGui().clientHeight/r);let n=-1;e===k.PAGE_HOME?n=0:e===k.PAGE_END?n=s:e===k.PAGE_DOWN?n=Math.min(t+o,s):e===k.PAGE_UP&&(n=Math.max(t-o,0)),n!==-1&&this.highlightItem(this.itemEls[n])}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){const{value:t,text:s}=e,r=s||t;return this.options.push({value:t,text:r}),this.renderOption(t,r),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0),this.itemEls.forEach(e=>{fs(e)}),this.itemEls=[]}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach((t,s)=>{Bh(t,s+1),Hh(t,e.length)})}renderOption(e,t){const s=this.gos.getDocument(),r=s.createElement("div");yt(r,"option"),r.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`);const o=s.createElement("span");r.appendChild(o),o.textContent=t,this.unFocusable||(r.tabIndex=-1),this.itemEls.push(r),this.addManagedListener(r,"mousemove",()=>this.highlightItem(r)),this.addManagedListener(r,"mousedown",n=>{n.preventDefault(),this.setValue(e)}),this.createManagedBean(new er({getTooltipValue:()=>t,getGui:()=>r,getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>o.scrollWidth>o.clientWidth})),this.getGui().appendChild(r)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(t),this;const s=this.options.findIndex(r=>r.value===e);if(s!==-1){const r=this.options[s];this.value=r.value,this.displayValue=r.text,this.highlightItem(this.itemEls[s]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(t=>t.value===this.value);e!==-1&&this.highlightItem(this.itemEls[e])}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}highlightItem(e){if(!Pi(e))return;this.clearHighlighted(),this.highlightedEl=e,this.highlightedEl.classList.add(ku.ACTIVE_CLASS),fn(this.highlightedEl,!0);const t=this.getGui(),{scrollTop:s,clientHeight:r}=t,{offsetTop:o,offsetHeight:n}=e;(o+n>s+r||o<s)&&this.highlightedEl.scrollIntoView({block:"nearest"}),this.unFocusable||this.highlightedEl.focus()}clearHighlighted(){!this.highlightedEl||!Pi(this.highlightedEl)||(this.highlightedEl.classList.remove(ku.ACTIVE_CLASS),fn(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchEvent({type:b.EVENT_FIELD_VALUE_CHANGED}),this.fireItemSelected()}fireItemSelected(){this.dispatchEvent({type:ku.EVENT_ITEM_SELECTED})}};Kh.EVENT_ITEM_SELECTED="selectedItem";Kh.ACTIVE_CLASS="ag-active-item";g([J],Kh.prototype,"init",1);var jg=Kh,Fv=class Mv extends Ao{constructor(e){super(de({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"combobox"},e))}postConstruct(){super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:s}=this.config;e!=null&&this.addOptions(e),t!=null&&this.setValue(t,!0),s&&t==null&&(this.eDisplayField.textContent=s),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new jg("select",!0)),this.listComponent.setParentComponent(this);const e=this.listComponent.getAriaElement(),t=`ag-select-list-${this.listComponent.getCompId()}`;e.setAttribute("id",t),bp(this.getAriaElement(),e),this.listComponent.addManagedListener(this.listComponent,jg.EVENT_ITEM_SELECTED,()=>{this.hidePicker(),this.dispatchEvent({type:Mv.EVENT_ITEM_SELECTED})}),this.listComponent.addManagedListener(this.listComponent,b.EVENT_FIELD_VALUE_CHANGED,()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())})}createPickerComponent(){return this.listComponent}onKeyDown(e){var t;const{key:s}=e;switch(s===k.TAB&&this.hidePicker(),s){case k.ENTER:case k.UP:case k.DOWN:case k.PAGE_UP:case k.PAGE_DOWN:case k.PAGE_HOME:case k.PAGE_END:e.preventDefault(),this.isPickerDisplayed?(t=this.listComponent)==null||t.handleKeyDown(e):super.onKeyDown(e);break;case k.ESCAPE:super.onKeyDown(e);break}}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){var e;return(e=this.listComponent)==null||e.clearOptions(),this}setValue(e,t,s){if(this.value===e||!this.listComponent)return this;if(s||this.listComponent.setValue(e,!0),this.listComponent.getValue()===this.getValue())return this;let o=this.listComponent.getDisplayValue();return o==null&&this.config.placeholder&&(o=this.config.placeholder),this.eDisplayField.textContent=o,this.setTooltip({newTooltipText:o??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth}),super.setValue(e,t)}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),super.destroy()}};Fv.EVENT_ITEM_SELECTED="selectedItem";var Xh=Fv,ms=class extends Av{constructor(i,e,t="text",s="input"){super(i,`
<div role="presentation">
<div ref="eLabel" class="ag-input-field-label"></div>
<div ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">
<${s} ref="eInput" class="ag-input-field-input"></${s}>
</div>
</div>`,e),this.inputType=t,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:i,inputWidth:e}=this.config;i!=null&&this.setInputName(i),e!=null&&this.setInputWidth(e),this.addInputListeners(),this.activateTabIndex([this.eInput])}addInputListeners(){this.addManagedListener(this.eInput,"input",i=>this.setValue(i.target.value))}setInputType(){this.displayFieldTag==="input"&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(i){return ja(this.eWrapper,i),this}setInputName(i){return this.getInputElement().setAttribute("name",i),this}getFocusableElement(){return this.eInput}setMaxLength(i){const e=this.eInput;return e.maxLength=i,this}setInputPlaceholder(i){return Ms(this.eInput,"placeholder",i),this}setInputAriaLabel(i){return Gi(this.eInput,i),this.refreshAriaLabelledBy(),this}setDisabled(i){return mn(this.eInput,i),super.setDisabled(i)}setAutoComplete(i){if(i===!0)Ms(this.eInput,"autocomplete",null);else{const e=typeof i=="string"?i:"off";Ms(this.eInput,"autocomplete",e)}return this}};g([te("eLabel")],ms.prototype,"eLabel",2);g([te("eWrapper")],ms.prototype,"eWrapper",2);g([te("eInput")],ms.prototype,"eInput",2);var qh=class extends ms{constructor(i,e="ag-checkbox",t="checkbox"){super(i,e,t),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:i,passive:e}=this.config;typeof i=="boolean"&&this.setReadOnly(i),typeof e=="boolean"&&this.setPassive(e)}addInputListeners(){this.addManagedListener(this.eInput,"click",this.onCheckboxClick.bind(this)),this.addManagedListener(this.eLabel,"click",this.toggle.bind(this))}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(i){this.passive=i}isReadOnly(){return this.readOnly}setReadOnly(i){this.eWrapper.classList.toggle("ag-disabled",i),this.eInput.disabled=i,this.readOnly=i}setDisabled(i){return this.eWrapper.classList.toggle("ag-disabled",i),super.setDisabled(i)}toggle(){if(this.eInput.disabled)return;const i=this.isSelected(),e=this.getNextValue();this.passive?this.dispatchChange(e,i):this.setValue(e)}getValue(){return this.isSelected()}setValue(i,e){return this.refreshSelectedClass(i),this.setSelected(i,e),this}setName(i){const e=this.getInputElement();return e.name=i,this}isSelected(){return this.selected}setSelected(i,e){this.isSelected()!==i&&(this.previousValue=this.isSelected(),i=this.selected=typeof i=="boolean"?i:void 0,this.eInput.checked=i,this.eInput.indeterminate=i===void 0,e||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(i,e,t){this.dispatchEvent({type:b.EVENT_FIELD_VALUE_CHANGED,selected:i,previousValue:e,event:t});const s=this.getInputElement(),r={type:b.EVENT_CHECKBOX_CHANGED,id:s.id,name:s.name,selected:i,previousValue:e};this.eventService.dispatchEvent(r)}onCheckboxClick(i){if(this.passive||this.eInput.disabled)return;const e=this.isSelected(),t=this.selected=i.target.checked;this.refreshSelectedClass(t),this.dispatchChange(t,e,i)}refreshSelectedClass(i){this.eWrapper.classList.toggle("ag-checked",i===!0),this.eWrapper.classList.toggle("ag-indeterminate",i==null)}},Lv=class extends qh{constructor(i){super(i,"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,b.EVENT_CHECKBOX_CHANGED,this.onChange.bind(this))}onChange(i){i.selected&&i.name&&this.eInput.name&&this.eInput.name===i.name&&i.id&&this.eInput.id!==i.id&&this.setValue(!1,!0)}},Wp=class{constructor(i,e,t){this.localeService=i,this.optionsFactory=e,this.valueFormatter=t}getModelAsString(i){if(!i)return null;const e=i.operator!=null,t=this.localeService.getLocaleTextFunc();if(e){const s=i;let{conditions:r}=s;if(!r){const{condition1:a,condition2:l}=s;r=[a,l]}const o=r.map(a=>this.getModelAsString(a)),n=s.operator==="AND"?"andCondition":"orCondition";return o.join(` ${t(n,Dv[n])} `)}else{if(i.type===vt.BLANK||i.type===vt.NOT_BLANK)return t(i.type,i.type);{const s=i,r=this.optionsFactory.getCustomOption(s.type),{displayKey:o,displayName:n,numberOfInputs:a}=r||{};return o&&n&&a===0?(t(o,n),n):this.conditionToString(s,r)}}}updateParams(i){this.optionsFactory=i.optionsFactory}formatValue(i){var e;return this.valueFormatter?(e=this.valueFormatter(i??null))!=null?e:"":String(i)}},Ci=class Qo extends sh{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(e){const t=this.optionsFactory.getCustomOption(e);if(t){const{numberOfInputs:r}=t;return r??1}const s=[Qo.EMPTY,Qo.NOT_BLANK,Qo.BLANK];return e&&s.indexOf(e)>=0?0:e===Qo.IN_RANGE?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,s)=>{s===0?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),condition1:e[0],condition2:e[1],conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return this.eJoinOperatorsOr.length===0?this.defaultJoinOperator:this.eJoinOperatorsOr[0].getValue()===!0?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const s=!e.operator,r=!t.operator;if(!s&&r||s&&!r)return!1;let n;if(s){const a=e,l=t;n=this.areSimpleModelsEqual(a,l)}else{const a=e,l=t;n=a.operator===l.operator&&Ts(a.conditions,l.conditions,(u,h)=>this.areSimpleModelsEqual(u,h))}return n}shouldRefresh(e){var t,s,r;const o=this.getModel(),n=o?(t=o.conditions)!=null?t:[o]:null,a=(r=(s=e.filterOptions)==null?void 0:s.map(u=>typeof u=="string"?u:u.displayKey))!=null?r:this.getDefaultFilterOptions();return!(!(!n||n.every(u=>a.find(h=>h===u.type)!==void 0))||typeof e.maxNumConditions=="number"&&n&&n.length>e.maxNumConditions)}refresh(e){return!this.shouldRefresh(e)||!super.refresh(e)?!1:(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),!0)}setModelIntoUi(e){if(e.operator){let s=e;s.conditions||(s.conditions=[s.condition1,s.condition2]);const r=this.validateAndUpdateConditions(s.conditions),o=this.getNumConditions();if(r<o)this.removeConditionsAndOperators(r);else if(r>o)for(let a=o;a<r;a++)this.createJoinOperatorPanel(),this.createOption();const n=s.operator==="OR";this.eJoinOperatorsAnd.forEach(a=>a.setValue(!n,!0)),this.eJoinOperatorsOr.forEach(a=>a.setValue(n,!0)),s.conditions.forEach((a,l)=>{this.eTypes[l].setValue(a.type,!0),this.setConditionIntoUi(a,l)})}else{const s=e;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(),Lt.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),fe('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),t=this.maxNumConditions),t}doesFilterPass(e){var t;const s=this.getModel();if(s==null)return!0;const{operator:r}=s,o=[];if(r){const a=s;o.push(...(t=a.conditions)!=null?t:[])}else o.push(s);return o[r&&r==="OR"?"some":"every"](a=>this.individualConditionPasses(e,a))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new Rv,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){var t,s;e.suppressAndOrCondition!=null&&fe('Since v29.2 "filterParams.suppressAndOrCondition" is deprecated. Use "filterParams.maxNumConditions = 1" instead.'),e.alwaysShowBothConditions!=null&&fe('Since v29.2 "filterParams.alwaysShowBothConditions" is deprecated. Use "filterParams.numAlwaysVisibleConditions = 2" instead.'),this.maxNumConditions=(t=e.maxNumConditions)!=null?t:e.suppressAndOrCondition?1:2,this.maxNumConditions<1&&(fe('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=(s=e.numAlwaysVisibleConditions)!=null?s:e.alwaysShowBothConditions?2:1,this.numAlwaysVisibleConditions<1&&(fe('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(fe('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new Xh);this.eTypes.push(e),e.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(e.getGui());const t=this.createValueElement();this.eConditionBodies.push(t),this.eFilterBody.appendChild(t),this.putOptionsIntoDropdown(e),this.resetType(e);const s=this.getNumConditions()-1;this.forEachPositionInput(s,r=>this.resetInput(r)),this.addChangedListeners(e,s)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),s=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const r=this.eJoinOperatorPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,r,o),this.resetJoinOperatorOr(s,r,o),this.isReadOnly()||(t.onValueChange(this.listener),s.onValueChange(this.listener))}createJoinOperator(e,t,s){const r=this.createManagedBean(new Lv);return e.push(r),r.addCssClass("ag-filter-condition-operator"),r.addCssClass(`ag-filter-condition-operator-${s}`),t.appendChild(r.getGui()),r}getDefaultJoinOperator(e){return e==="AND"||e==="OR"?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map(t=>typeof t=="string"?this.createBoilerplateListOption(t):this.createCustomListOption(t))}putOptionsIntoDropdown(e){this.filterListOptions.forEach(t=>{e.addOption(t)}),e.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,s=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:s?this.localeService.getLocaleTextFunc()(s.displayKey,s.displayName):this.translate(t)}}isAllowTwoConditions(){return this.maxNumConditions>=2}createBodyTemplate(){return""}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){var e;let t=-1,s=!0;for(let r=0;r<this.getNumConditions();r++)this.isConditionUiComplete(r)?t=r:s=!1;if(this.shouldAddNewConditionAtEnd(s))this.createJoinOperatorPanel(),this.createOption();else{const r=(e=this.lastUiCompletePosition)!=null?e:this.getNumConditions()-2;if(t<r){this.removeConditionsAndOperators(r+1);const o=t+1,n=r-o;n>0&&this.removeConditionsAndOperators(o,n),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=t}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((r,o)=>{const n=this.isConditionDisabled(o,e);r.setDisabled(n||this.filterListOptions.length<=1),o===1&&(mn(this.eJoinOperatorPanels[0],n),this.eJoinOperatorsAnd[0].setDisabled(n),this.eJoinOperatorsOr[0].setDisabled(n))}),this.eConditionBodies.forEach((r,o)=>{Ge(r,this.isConditionBodyVisible(o))});const s=(t??this.getJoinOperator())==="OR";this.eJoinOperatorsAnd.forEach((r,o)=>{r.setValue(!s,!0)}),this.eJoinOperatorsOr.forEach((r,o)=>{r.setValue(s,!0)}),this.forEachInput((r,o,n,a)=>{this.setElementDisplayed(r,o<a),this.setElementDisabled(r,this.isConditionDisabled(n,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;this.removeComponents(this.eTypes,e,t),this.removeElements(this.eConditionBodies,e,t),this.removeValueElements(e,t);const s=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,s,t),this.removeComponents(this.eJoinOperatorsAnd,s,t),this.removeComponents(this.eJoinOperatorsOr,s,t)}removeElements(e,t,s){this.removeItems(e,t,s).forEach(o=>fs(o))}removeComponents(e,t,s){this.removeItems(e,t,s).forEach(o=>{fs(o.getGui()),this.destroyBean(o)})}removeItems(e,t,s){return s==null?e.splice(t):e.splice(t,s)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!e?.suppressFocus)if(this.isReadOnly())this.eFilterBody.focus();else{const t=this.getInputs(0)[0];if(!t)return;t instanceof ms&&t.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let t=-1,s=-1,r=!1;const o=this.getJoinOperator();for(let a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))t===-1&&(t=a,s=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),u=a<t;(l||u)&&(this.removeConditionsAndOperators(a,1),r=!0,u&&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,o),r&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=s}getPlaceholderText(e,t){let s=this.translate(e);if(Nh(this.filterPlaceholder)){const r=this.filterPlaceholder,o=this.eTypes[t].getValue(),n=this.translate(o);s=r({filterOptionKey:o,filterOption:n,placeholder:s})}else typeof this.filterPlaceholder=="string"&&(s=this.filterPlaceholder);return s}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput((t,s,r,o)=>{if(!(t instanceof ms))return;const n=s===0&&o>1?"inRangeStart":s===0?"filterOoo":"inRangeEnd",a=s===0&&o>1?e("ariaFilterFromValue","Filter from value"):s===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(n,r)),t.setInputAriaLabel(a)})}setElementValue(e,t,s){e instanceof ms&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){e instanceof Se&&Ge(e.getGui(),t)}setElementDisabled(e,t){e instanceof Se&&mn(e.getGui(),t)}attachElementOnChange(e,t){e instanceof ms&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,s)=>{this.forEachPositionTypeInput(s,t,e)})}forEachPositionInput(e,t){const s=this.getConditionType(e);this.forEachPositionTypeInput(e,s,t)}forEachPositionTypeInput(e,t,s){const r=this.getNumberOfInputs(t),o=this.getInputs(e);for(let n=0;n<o.length;n++){const a=o[n];a!=null&&s(a,n,e,r)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)===Qo.EMPTY||this.getValues(e).some(s=>s==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinOperatorsAnd.forEach((t,s)=>this.resetJoinOperatorAnd(t,s,this.joinOperatorId+s)),this.eJoinOperatorsOr.forEach((t,s)=>this.resetJoinOperatorOr(t,s,this.joinOperatorId+s)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),Lt.resolve()}resetType(e){const s=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(s).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,s){this.resetJoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),s)}resetJoinOperatorOr(e,t,s){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),s)}resetJoinOperator(e,t,s,r,o){this.updateJoinOperatorDisabled(e.setValue(s,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(r),t)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t)),this.eJoinOperatorsOr.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t))}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const s=this.mapValuesFromModel(e);this.forEachInput((r,o,n,a)=>{n===t&&this.setElementValue(r,s[o]!=null?s[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,s,r,o)=>{this.setElementValue(t,s===0&&r===0?e:null,!0)})}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,s=>{this.attachElementOnChange(s,this.listener)}))}individualConditionPasses(e,t){const s=this.getCellValue(e.node),r=this.mapValuesFromModel(t),o=this.optionsFactory.getCustomOption(t.type),n=this.evaluateCustomFilter(o,r,s);return n??(s==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(r,s,t,e))}evaluateCustomFilter(e,t,s){if(e==null)return;const{predicate:r}=e;if(r!=null&&!t.some(o=>o==null))return r(t,s)}isBlank(e){return e==null||typeof e=="string"&&e.trim().length===0}hasInvalidInputs(){return!1}};Ci.EMPTY="empty";Ci.BLANK="blank";Ci.NOT_BLANK="notBlank";Ci.EQUALS="equals";Ci.NOT_EQUAL="notEqual";Ci.LESS_THAN="lessThan";Ci.LESS_THAN_OR_EQUAL="lessThanOrEqual";Ci.GREATER_THAN="greaterThan";Ci.GREATER_THAN_OR_EQUAL="greaterThanOrEqual";Ci.IN_RANGE="inRange";Ci.CONTAINS="contains";Ci.NOT_CONTAINS="notContains";Ci.STARTS_WITH="startsWith";Ci.ENDS_WITH="endsWith";var vt=Ci,Nt=class Bt extends vt{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(e){switch(e){case Bt.EQUALS:case Bt.NOT_EQUAL:if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case Bt.GREATER_THAN:case Bt.GREATER_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case Bt.LESS_THAN:case Bt.LESS_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case Bt.IN_RANGE:if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case Bt.BLANK:return!0;case Bt.NOT_BLANK:return!1}return!1}evaluateNonNullValue(e,t,s){const r=this.comparator(),o=e[0]!=null?r(e[0],t):0;switch(s.type){case Bt.EQUALS:return o===0;case Bt.NOT_EQUAL:return o!==0;case Bt.GREATER_THAN:return o>0;case Bt.GREATER_THAN_OR_EQUAL:return o>=0;case Bt.LESS_THAN:return o<0;case Bt.LESS_THAN_OR_EQUAL:return o<=0;case Bt.IN_RANGE:{const n=r(e[1],t);return this.scalarFilterParams.inRangeInclusive?o>=0&&n<=0:o>0&&n<0}case Bt.BLANK:return this.isBlank(t);case Bt.NOT_BLANK:return!this.isBlank(t);default:return console.warn('AG Grid: Unexpected type of filter "'+s.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}},Ug=1e3,zg=1/0,Iv=class extends Wp{constructor(i,e,t){super(e,t),this.dateFilterParams=i}conditionToString(i,e){const{type:t}=i,{numberOfInputs:s}=e||{},r=t==vt.IN_RANGE||s===2,o=xi(i.dateFrom),n=xi(i.dateTo),a=this.dateFilterParams.inRangeFloatingFilterDateFormat;if(r){const l=o!==null?un(o,a):"null",u=n!==null?un(n,a):"null";return`${l}-${u}`}return o!=null?un(o,a):`${t}`}updateParams(i){super.updateParams(i),this.dateFilterParams=i.dateFilterParams}},jp=class Ov extends Nt{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=Ug,this.maxValidYear=zg,this.minValidDate=null,this.maxValidDate=null}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:s,type:r}=e||{};return[t&&xi(t)||null,s&&xi(s)||null].slice(0,this.getNumberOfInputs(r))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){const s=t;return t==null||s<e?-1:s>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(s,r)=>{if(e[s]!=null)if(isNaN(e[s]))console.warn(`AG Grid: DateFilter ${s} is not a number`);else return e[s]==null?r:Number(e[s]);return r};this.minValidYear=t("minValidYear",Ug),this.maxValidYear=t("maxValidYear",zg),this.minValidYear>this.maxValidYear&&console.warn("AG Grid: DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:xi(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:xi(e.maxValidDate):this.maxValidDate=null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&console.warn("AG Grid: DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new Iv(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new xv(this.getContext(),this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc(()=>t.destroy()),t}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}getDefaultFilterOptions(){return Ov.DEFAULT_FILTER_OPTIONS}createValueElement(){const t=this.gos.getDocument().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(e,t,s,r){const n=this.gos.getDocument().createElement("div");n.classList.add(`ag-filter-${r}`),n.classList.add(`ag-filter-date-${r}`),t.push(n),e.appendChild(n),s.push(this.createDateCompWrapper(n))}removeValueElements(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),this.removeItems(this.eConditionPanelsFrom,e,t),this.removeItems(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,s){this.removeItems(e,t,s).forEach(o=>o.destroy())}isValidDateValue(e){if(e===null)return!1;if(this.minValidDate){if(e<this.minValidDate)return!1}else if(e.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(e>this.maxValidDate)return!1}else if(e.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((s,r,o,n)=>{o!==e||!t||r>=n||(t=t&&this.isValidDateValue(s.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}getFilterType(){return"date"}createCondition(e){const t=this.getConditionType(e),s={},r=this.getValues(e);return r.length>0&&(s.dateFrom=Qi(r[0])),r.length>1&&(s.dateTo=Qi(r[1])),de({dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t},s)}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),s=e("ariaFilterValue","Filter Value");this.forEachInput(r=>{r.setInputPlaceholder(t),r.setInputAriaLabel(s)})}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(s,r,o,n)=>{r<n&&t.push(s.getDate())}),t}translate(e){return e===Nt.LESS_THAN?super.translate("before"):e===Nt.GREATER_THAN?super.translate("after"):super.translate(e)}getModelAsString(e){var t;return(t=this.filterModelFormatter.getModelAsString(e))!=null?t:""}};jp.DEFAULT_FILTER_OPTIONS=[Nt.EQUALS,Nt.NOT_EQUAL,Nt.LESS_THAN,Nt.GREATER_THAN,Nt.IN_RANGE,Nt.BLANK,Nt.NOT_BLANK];g([R("userComponentFactory")],jp.prototype,"userComponentFactory",2);var Nv=jp,Up=class extends Se{getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(i){return i&&i.afterFloatingFilter}isEventFromDataChange(i){return i?.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(i){if(!i){this.lastType=this.optionsFactory.getDefaultOption();return}const e=i.operator;let t;e?t=i.conditions[0]:t=i,this.lastType=t.type}canWeEditAfterModelFromParentFilter(i){if(!i)return this.isTypeEditable(this.lastType);if(i.operator)return!1;const t=i;return this.isTypeEditable(t.type)}init(i){this.setSimpleParams(i,!1)}setSimpleParams(i,e=!0){this.optionsFactory=new Rv,this.optionsFactory.init(i.filterParams,this.getDefaultFilterOptions()),e||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!i.filterParams.readOnly;const t=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(t)}onParamsUpdated(i){this.refresh(i)}refresh(i){this.setSimpleParams(i)}doesFilterHaveSingleInput(i){const e=this.optionsFactory.getCustomOption(i),{numberOfInputs:t}=e||{};return t==null||t==1}isTypeEditable(i){const e=[vt.IN_RANGE,vt.EMPTY,vt.BLANK,vt.NOT_BLANK];return!!i&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(i)&&e.indexOf(i)<0}getAriaLabel(i){const e=this.columnModel.getDisplayNameForColumn(i.column,"header",!0),t=this.localeService.getLocaleTextFunc();return`${e} ${t("ariaFilterInput","Filter Input")}`}};g([R("columnModel")],Up.prototype,"columnModel",2);var Qh=class extends Up{constructor(){super(`
<div class="ag-floating-filter-input" role="presentation">
<ag-input-text-field ref="eReadOnlyText"></ag-input-text-field>
<div ref="eDateWrapper" style="display: flex;"></div>
</div>`)}getDefaultFilterOptions(){return Nv.DEFAULT_FILTER_OPTIONS}init(i){super.init(i),this.params=i,this.filterParams=i.filterParams,this.createDateComponent(),this.filterModelFormatter=new Iv(this.filterParams,this.localeService,this.optionsFactory);const e=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(e("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(i){this.refresh(i)}refresh(i){super.refresh(i),this.params=i,this.filterParams=i.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams}),this.updateCompOnModelChange(i.currentParentModel())}updateCompOnModelChange(i){const e=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(i);if(this.setEditable(e),e){if(i){const t=i;this.dateComp.setDate(xi(t.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(i)),this.dateComp.setDate(null)}setEditable(i){Ge(this.eDateWrapper,i),Ge(this.eReadOnlyText.getGui(),!i)}onParentModelChanged(i,e){this.isEventFromFloatingFilter(e)||this.isEventFromDataChange(e)||(super.setLastTypeFromModel(i),this.updateCompOnModelChange(i))}onDateChanged(){const i=this.dateComp.getDate(),e=Qi(i);this.params.parentFilterInstance(t=>{if(t){const s=xi(e);t.onFloatingFilterChanged(this.getLastType()||null,s)}})}getDateComponentParams(){const i=sh.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:ci(this.onDateChanged.bind(this),i),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new xv(this.getContext(),this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper,i=>{i.setInputAriaLabel(this.getAriaLabel(this.params))}),this.addDestroyFunc(()=>this.dateComp.destroy())}updateDateComponent(){const i=this.gos.addGridCommonParams(this.getDateComponentParams());this.dateComp.updateParams(i)}getFilterModelFormatter(){return this.filterModelFormatter}};g([R("userComponentFactory")],Qh.prototype,"userComponentFactory",2);g([te("eReadOnlyText")],Qh.prototype,"eReadOnlyText",2);g([te("eDateWrapper")],Qh.prototype,"eDateWrapper",2);var kv=class extends Se{constructor(){super(`
<div class="ag-filter-filter">
<ag-input-text-field class="ag-date-filter" ref="eDateInput"></ag-input-text-field>
</div>`)}destroy(){super.destroy()}init(i){this.params=i,this.setParams(i);const e=this.eDateInput.getInputElement();this.addManagedListener(e,"mousedown",()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||e.focus()}),this.addManagedListener(e,"input",t=>{t.target===this.gos.getActiveDomElement()&&(this.eDateInput.isDisabled()||this.params.onDateChanged())})}setParams(i){const e=this.eDateInput.getInputElement(),t=this.shouldUseBrowserDatePicker(i);this.usingSafariDatePicker=t&&Os(),e.type=t?"date":"text";const{minValidYear:s,maxValidYear:r,minValidDate:o,maxValidDate:n}=i.filterParams||{};if(o&&s&&fe("DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."),n&&r&&fe("DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),o&&n){const[a,l]=[o,n].map(u=>u instanceof Date?u:xi(u));a&&l&&a.getTime()>l.getTime()&&fe("DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.")}o?o instanceof Date?e.min=un(o):e.min=o:s&&(e.min=`${s}-01-01`),n?n instanceof Date?e.max=un(n):e.max=n:r&&(e.max=`${r}-12-31`)}onParamsUpdated(i){this.refresh(i)}refresh(i){this.params=i,this.setParams(i)}getDate(){return xi(this.eDateInput.getValue())}setDate(i){this.eDateInput.setValue(Qi(i,!1))}setInputPlaceholder(i){this.eDateInput.setInputPlaceholder(i)}setInputAriaLabel(i){this.eDateInput.setAriaLabel(i)}setDisabled(i){this.eDateInput.setDisabled(i)}afterGuiAttached(i){(!i||!i.suppressFocus)&&this.eDateInput.getInputElement().focus()}shouldUseBrowserDatePicker(i){return i.filterParams&&i.filterParams.browserDatePicker!=null?i.filterParams.browserDatePicker:jh()||_p()||Os()&&Sp()>=14.1}};g([te("eDateInput")],kv.prototype,"eDateInput",2);var Fo=class extends ms{constructor(i,e="ag-text-field",t="text"){super(i,e,t)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(i,e){return this.eInput.value!==i&&(this.eInput.value=K(i)?i:""),super.setValue(i,e)}setStartValue(i){this.setValue(i,!0)}preventDisallowedCharacters(){const i=new RegExp(`[${this.config.allowedCharPattern}]`),e=t=>{zh(t)&&t.key&&!i.test(t.key)&&t.preventDefault()};this.addManagedListener(this.eInput,"keydown",e),this.addManagedListener(this.eInput,"paste",t=>{var s;const r=(s=t.clipboardData)==null?void 0:s.getData("text");r&&r.split("").some(o=>!i.test(o))&&t.preventDefault()})}},zp=class extends Fo{constructor(i){super(i,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"blur",()=>{const r=parseFloat(this.eInput.value),o=isNaN(r)?"":this.normalizeValue(r.toString());this.value!==o&&this.setValue(o)}),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this)),this.eInput.step="any";const{precision:i,min:e,max:t,step:s}=this.config;typeof i=="number"&&this.setPrecision(i),typeof e=="number"&&this.setMin(e),typeof t=="number"&&this.setMax(t),typeof s=="number"&&this.setStep(s)}onWheel(i){this.gos.getActiveDomElement()===this.eInput&&i.preventDefault()}normalizeValue(i){if(i==="")return"";this.precision!=null&&(i=this.adjustPrecision(i));const e=parseFloat(i);return this.min!=null&&e<this.min?i=this.min.toString():this.max!=null&&e>this.max&&(i=this.max.toString()),i}adjustPrecision(i,e){if(this.precision==null)return i;if(e){const s=parseFloat(i).toFixed(this.precision);return parseFloat(s).toString()}const t=String(i).split(".");if(t.length>1){if(t[1].length<=this.precision)return i;if(this.precision>0)return`${t[0]}.${t[1].slice(0,this.precision)}`}return t[0]}setMin(i){return this.min===i?this:(this.min=i,Ms(this.eInput,"min",i),this)}setMax(i){return this.max===i?this:(this.max=i,Ms(this.eInput,"max",i),this)}setPrecision(i){return this.precision=i,this}setStep(i){return this.step===i?this:(this.step=i,Ms(this.eInput,"step",i),this)}setValue(i,e){return this.setValueOrInputValue(t=>super.setValue(t,e),()=>this,i)}setStartValue(i){return this.setValueOrInputValue(e=>super.setValue(e,!0),e=>{this.eInput.value=e},i)}setValueOrInputValue(i,e,t){if(K(t)){let s=this.isScientificNotation(t);if(s&&this.eInput.validity.valid)return i(t);if(!s){t=this.adjustPrecision(t);const r=this.normalizeValue(t);s=t!=r}if(s)return e(t)}return i(t)}getValue(){if(!this.eInput.validity.valid)return;const i=this.eInput.value;return this.isScientificNotation(i)?this.adjustPrecision(i,!0):super.getValue()}isScientificNotation(i){return typeof i=="string"&&i.includes("e")}},Gv=class extends Wp{conditionToString(i,e){const{numberOfInputs:t}=e||{};return i.type==vt.IN_RANGE||t===2?`${this.formatValue(i.filter)}-${this.formatValue(i.filterTo)}`:i.filter!=null?this.formatValue(i.filter):`${i.type}`}};function Vc(i){const{allowedCharPattern:e}=i??{};return e??null}var Vv=class Hv extends Nt{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern!==e.allowedCharPattern?!1:super.refresh(e)}mapValuesFromModel(e){const{filter:t,filterTo:s,type:r}=e||{};return[this.processValue(t),this.processValue(s)].slice(0,this.getNumberOfInputs(r))}getDefaultDebounceMs(){return 500}comparator(){return(e,t)=>e===t?0:e<t?1:-1}setParams(e){this.numberFilterParams=e,super.setParams(e),this.filterModelFormatter=new Gv(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return Hv.DEFAULT_FILTER_OPTIONS}setElementValue(e,t,s){const r=!s&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(t??null):t;super.setElementValue(e,r)}createValueElement(){const e=Vc(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),yt(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,s,r){const o=this.createManagedBean(r?new Fo({allowedCharPattern:r}):new zp);o.addCssClass(`ag-filter-${s}`),o.addCssClass("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,(s,r,o,n)=>{r<n&&t.push(this.processValue(this.stringToFloat(s.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return e==null||isNaN(e)?null:e}stringToFloat(e){if(typeof e=="number")return e;let t=Fs(e);return t!=null&&t.trim()===""&&(t=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(t):t==null||t.trim()==="-"?null:parseFloat(t)}createCondition(e){const t=this.getConditionType(e),s={filterType:this.getFilterType(),type:t},r=this.getValues(e);return r.length>0&&(s.filter=r[0]),r.length>1&&(s.filterTo=r[1]),s}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){var t;return(t=this.filterModelFormatter.getModelAsString(e))!=null?t:""}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{if(!t.getInputElement().validity.valid){e=!0;return}}),e}};Vv.DEFAULT_FILTER_OPTIONS=[Nt.EQUALS,Nt.NOT_EQUAL,Nt.GREATER_THAN,Nt.GREATER_THAN_OR_EQUAL,Nt.LESS_THAN,Nt.LESS_THAN_OR_EQUAL,Nt.IN_RANGE,Nt.BLANK,Nt.NOT_BLANK];var Bv=Vv,Wv=class extends Wp{conditionToString(i,e){const{numberOfInputs:t}=e||{};return i.type==vt.IN_RANGE||t===2?`${i.filter}-${i.filterTo}`:i.filter!=null?`${i.filter}`:`${i.type}`}},us=class Zo extends vt{constructor(){super("textFilter"),this.eValuesFrom=[],this.eValuesTo=[]}static trimInput(e){const t=e&&e.trim();return t===""?e:t}getDefaultDebounceMs(){return 500}setParams(e){this.textFilterParams=e,super.setParams(e),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?Zo.DEFAULT_FORMATTER:Zo.DEFAULT_LOWERCASE_FORMATTER),this.filterModelFormatter=new Wv(this.localeService,this.optionsFactory)}getTextMatcher(){const e=this.textFilterParams.textCustomComparator;return e?(ye.warnOnce("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:t,value:s,filterText:r})=>e(t,s,r)):this.textFilterParams.textMatcher||Zo.DEFAULT_MATCHER}createCondition(e){const t=this.getConditionType(e),s={filterType:this.getFilterType(),type:t},r=this.getValuesWithSideEffects(e,!0);return r.length>0&&(s.filter=r[0]),r.length>1&&(s.filterTo=r[1]),s}getFilterType(){return"text"}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getValues(e){return this.getValuesWithSideEffects(e,!1)}getValuesWithSideEffects(e,t){const s=[];return this.forEachPositionInput(e,(r,o,n,a)=>{var l;if(o<a){let u=Fs(r.getValue());t&&this.textFilterParams.trimInput&&(u=(l=Zo.trimInput(u))!=null?l:null,r.setValue(u,!0)),s.push(u)}}),s}getDefaultFilterOptions(){return Zo.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),yt(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,s){const r=this.createManagedBean(new Fo);r.addCssClass(`ag-filter-${s}`),r.addCssClass("ag-filter-filter"),t.push(r),e.appendChild(r.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:s,type:r}=e||{};return[t||null,s||null].slice(0,this.getNumberOfInputs(r))}evaluateNullValue(e){const t=[vt.NOT_EQUAL,vt.NOT_CONTAINS,vt.BLANK];return e?t.indexOf(e)>=0:!1}evaluateNonNullValue(e,t,s,r){const o=e.map(y=>this.formatter(y))||[],n=this.formatter(t),{api:a,colDef:l,column:u,columnApi:h,context:d,textFormatter:c}=this.textFilterParams;if(s.type===vt.BLANK)return this.isBlank(t);if(s.type===vt.NOT_BLANK)return!this.isBlank(t);const p={api:a,colDef:l,column:u,columnApi:h,context:d,node:r.node,data:r.data,filterOption:s.type,value:n,textFormatter:c};return o.some(y=>this.matcher(lt(de({},p),{filterText:y})))}getModelAsString(e){var t;return(t=this.filterModelFormatter.getModelAsString(e))!=null?t:""}};us.DEFAULT_FILTER_OPTIONS=[vt.CONTAINS,vt.NOT_CONTAINS,vt.EQUALS,vt.NOT_EQUAL,vt.STARTS_WITH,vt.ENDS_WITH,vt.BLANK,vt.NOT_BLANK];us.DEFAULT_FORMATTER=i=>i;us.DEFAULT_LOWERCASE_FORMATTER=i=>i==null?null:i.toString().toLowerCase();us.DEFAULT_MATCHER=({filterOption:i,value:e,filterText:t})=>{if(t==null)return!1;switch(i){case us.CONTAINS:return e.indexOf(t)>=0;case us.NOT_CONTAINS:return e.indexOf(t)<0;case us.EQUALS:return e===t;case us.NOT_EQUAL:return e!=t;case us.STARTS_WITH:return e.indexOf(t)===0;case us.ENDS_WITH:const s=e.lastIndexOf(t);return s>=0&&s===e.length-t.length;default:return!1}};var Yp=us,jv=class extends Z{constructor(i){super(),this.params=i,this.valueChangedListener=()=>{}}setupGui(i){var e;this.eFloatingFilterTextInput=this.createManagedBean(new Fo((e=this.params)==null?void 0:e.config));const t=this.eFloatingFilterTextInput.getGui();i.appendChild(t),this.addManagedListener(t,"input",s=>this.valueChangedListener(s)),this.addManagedListener(t,"keydown",s=>this.valueChangedListener(s))}setEditable(i){this.eFloatingFilterTextInput.setDisabled(!i)}setAutoComplete(i){this.eFloatingFilterTextInput.setAutoComplete(i)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(i,e){this.eFloatingFilterTextInput.setValue(i,e)}setValueChangedListener(i){this.valueChangedListener=i}setParams(i){this.setAriaLabel(i.ariaLabel),i.autoComplete!==void 0&&this.setAutoComplete(i.autoComplete)}setAriaLabel(i){this.eFloatingFilterTextInput.setInputAriaLabel(i)}},Zh=class extends Up{postConstruct(){this.setTemplate(`
<div class="ag-floating-filter-input" role="presentation" ref="eFloatingFilterInputContainer"></div>
`)}getDefaultDebounceMs(){return 500}onParentModelChanged(i,e){this.isEventFromFloatingFilter(e)||this.isEventFromDataChange(e)||(this.setLastTypeFromModel(i),this.setEditable(this.canWeEditAfterModelFromParentFilter(i)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(i)))}init(i){this.setupFloatingFilterInputService(i),super.init(i),this.setTextInputParams(i)}setupFloatingFilterInputService(i){this.floatingFilterInputService=this.createFloatingFilterInputService(i),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(i){var e;this.params=i;const t=(e=i.browserAutoComplete)!=null?e:!1;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(i),autoComplete:t}),this.applyActive=sh.isUseApplyButton(this.params.filterParams),!this.isReadOnly()){const s=sh.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),r=ci(this.syncUpWithParentFilter.bind(this),s);this.floatingFilterInputService.setValueChangedListener(r)}}onParamsUpdated(i){this.refresh(i)}refresh(i){super.refresh(i),this.setTextInputParams(i)}recreateFloatingFilterInputService(i){const e=this.floatingFilterInputService.getValue();Rt(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(i),this.floatingFilterInputService.setValue(e,!0)}syncUpWithParentFilter(i){const e=i.key===k.ENTER;if(this.applyActive&&!e)return;let t=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(t=Yp.trimInput(t),this.floatingFilterInputService.setValue(t,!0)),this.params.parentFilterInstance(s=>{s&&s.onFloatingFilterChanged(this.getLastType()||null,t||null)})}setEditable(i){this.floatingFilterInputService.setEditable(i)}};g([te("eFloatingFilterInputContainer")],Zh.prototype,"eFloatingFilterInputContainer",2);g([J],Zh.prototype,"postConstruct",1);var Hb=class extends Z{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(i){this.eFloatingFilterNumberInput=this.createManagedBean(new zp),this.eFloatingFilterTextInput=this.createManagedBean(new Fo),this.eFloatingFilterTextInput.setDisabled(!0);const e=this.eFloatingFilterNumberInput.getGui(),t=this.eFloatingFilterTextInput.getGui();i.appendChild(e),i.appendChild(t),this.setupListeners(e,s=>this.valueChangedListener(s)),this.setupListeners(t,s=>this.valueChangedListener(s))}setEditable(i){this.numberInputActive=i,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(i){this.eFloatingFilterNumberInput.setAutoComplete(i),this.eFloatingFilterTextInput.setAutoComplete(i)}getValue(){return this.getActiveInputElement().getValue()}setValue(i,e){this.getActiveInputElement().setValue(i,e)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(i){this.valueChangedListener=i}setupListeners(i,e){this.addManagedListener(i,"input",e),this.addManagedListener(i,"keydown",e)}setParams(i){this.setAriaLabel(i.ariaLabel),i.autoComplete!==void 0&&this.setAutoComplete(i.autoComplete)}setAriaLabel(i){this.eFloatingFilterNumberInput.setInputAriaLabel(i),this.eFloatingFilterTextInput.setInputAriaLabel(i)}},Bb=class extends Zh{init(i){var e;super.init(i),this.filterModelFormatter=new Gv(this.localeService,this.optionsFactory,(e=i.filterParams)==null?void 0:e.numberFormatter)}onParamsUpdated(i){this.refresh(i)}refresh(i){Vc(i.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(i),super.refresh(i),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return Bv.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(i){return this.allowedCharPattern=Vc(i.filterParams),this.allowedCharPattern?this.createManagedBean(new jv({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new Hb)}},Wb=class extends Zh{init(i){super.init(i),this.filterModelFormatter=new Wv(this.localeService,this.optionsFactory)}onParamsUpdated(i){this.refresh(i)}refresh(i){super.refresh(i),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return Yp.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new jv)}},Al=class ba{constructor(e,t=!1){this.destroyFuncs=[],this.touching=!1,this.eventService=new ys,this.eElement=e,this.preventMouseClick=t;const s=this.onTouchStart.bind(this),r=this.onTouchMove.bind(this),o=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",s,{passive:!0}),this.eElement.addEventListener("touchmove",r,{passive:!0}),this.eElement.addEventListener("touchend",o,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",s,{passive:!0}),this.eElement.removeEventListener("touchmove",r,{passive:!0}),this.eElement.removeEventListener("touchend",o,{passive:!1})})}getActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}addEventListener(e,t){this.eventService.addEventListener(e,t)}removeEventListener(e,t){this.eventService.removeEventListener(e,t)}onTouchStart(e){if(this.touching)return;this.touchStart=e.touches[0],this.touching=!0,this.moved=!1;const t=this.touchStart;window.setTimeout(()=>{const s=this.touchStart===t;if(this.touching&&s&&!this.moved){this.moved=!0;const r={type:ba.EVENT_LONG_TAP,touchStart:this.touchStart,touchEvent:e};this.eventService.dispatchEvent(r)}},500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);if(!t)return;!Gp(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(e){if(this.touching){if(!this.moved){const t={type:ba.EVENT_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(t),this.checkForDoubleTap()}this.preventMouseClick&&e.cancelable&&e.preventDefault(),this.touching=!1}}checkForDoubleTap(){const e=new Date().getTime();if(this.lastTapTime&&this.lastTapTime>0)if(e-this.lastTapTime>ba.DOUBLE_TAP_MILLIS){const s={type:ba.EVENT_DOUBLE_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(s),this.lastTapTime=null}else this.lastTapTime=e;else this.lastTapTime=e}destroy(){this.destroyFuncs.forEach(e=>e())}};Al.EVENT_TAP="tap";Al.EVENT_DOUBLE_TAP="doubleTap";Al.EVENT_LONG_TAP="longTap";Al.DOUBLE_TAP_MILLIS=500;var Kt=Al,tr=class Uv extends Se{constructor(e){super(),e||this.setTemplate(Uv.TEMPLATE)}attachCustomElements(e,t,s,r,o){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=s,this.eSortMixed=r,this.eSortNone=o}setupSort(e,t=!1){this.column=e,this.suppressOrder=t,this.setupMultiSortIndicator(),!(!this.column.isSortable()&&!this.column.getColDef().showRowGroup)&&(this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e),this.addManagedPropertyListener("unSortIcon",()=>this.updateIcons()),this.addManagedListener(this.eventService,b.EVENT_NEW_COLUMNS_LOADED,()=>this.updateIcons()),this.addManagedListener(this.eventService,b.EVENT_SORT_CHANGED,()=>this.onSortChanged()),this.addManagedListener(this.eventService,b.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onSortChanged()),this.onSortChanged())}addInIcon(e,t,s){if(t==null)return;const r=dt(e,this.gos,s);r&&t.appendChild(r)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const t=e==="asc";Ge(this.eSortAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t=e==="desc";Ge(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gos.get("unSortIcon"),s=e==null;Ge(this.eSortNone,!t&&s,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;this.gos.isColumnsSortingCoupledToGroup()&&e&&(this.addManagedListener(this.eventService,b.EVENT_SORT_CHANGED,()=>this.updateMultiSortIndicator()),this.addManagedListener(this.eventService,b.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateMultiSortIndicator()),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e=this.sortController.getDisplaySortForColumn(this.column)==="mixed";Ge(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){var e;if(!this.eSortOrder)return;const t=this.sortController.getColumnsWithSortingOrdered(),s=(e=this.sortController.getDisplaySortIndexForColumn(this.column))!=null?e:-1,r=t.some(n=>{var a;return(a=this.sortController.getDisplaySortIndexForColumn(n))!=null?a:!1}),o=s>=0&&r;Ge(this.eSortOrder,o,{skipAriaHidden:!0}),s>=0?this.eSortOrder.textContent=(s+1).toString():Rt(this.eSortOrder)}};tr.TEMPLATE=`<span class="ag-sort-indicator-container">
<span ref="eSortOrder" class="ag-sort-indicator-icon ag-sort-order ag-hidden" aria-hidden="true"></span>
<span ref="eSortAsc" class="ag-sort-indicator-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>
<span ref="eSortDesc" class="ag-sort-indicator-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>
<span ref="eSortMixed" class="ag-sort-indicator-icon ag-sort-mixed-icon ag-hidden" aria-hidden="true"></span>
<span ref="eSortNone" class="ag-sort-indicator-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>
</span>`;g([te("eSortOrder")],tr.prototype,"eSortOrder",2);g([te("eSortAsc")],tr.prototype,"eSortAsc",2);g([te("eSortDesc")],tr.prototype,"eSortDesc",2);g([te("eSortMixed")],tr.prototype,"eSortMixed",2);g([te("eSortNone")],tr.prototype,"eSortNone",2);g([R("columnModel")],tr.prototype,"columnModel",2);g([R("sortController")],tr.prototype,"sortController",2);var $p=tr,oi=class zv extends Se{constructor(){super(...arguments),this.lastMovingChanged=0}destroy(){super.destroy()}refresh(e){const t=this.params;return this.params=e,this.workOutTemplate()!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||this.workOutSort()!=this.currentSort||this.shouldSuppressMenuHide()!=this.currentSuppressMenuHide||t.enableFilterButton!=e.enableFilterButton||t.enableFilterIcon!=e.enableFilterIcon?!1:(this.setDisplayName(e),!0)}workOutTemplate(){var e;let t=(e=this.params.template)!=null?e:zv.TEMPLATE;return t=t&&t.trim?t.trim():t,t}init(e){this.params=e,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate),this.setupTap(),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setupFilterButton(),this.setDisplayName(e)}setDisplayName(e){if(this.currentDisplayName!=e.displayName){this.currentDisplayName=e.displayName;const t=Ft(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=t)}}addInIcon(e,t,s){if(t==null)return;const r=dt(e,this.gos,s);r&&t.appendChild(r)}setupTap(){const{gos:e}=this;if(e.get("suppressTouch"))return;const t=new Kt(this.getGui(),!0),s=this.shouldSuppressMenuHide(),r=s&&K(this.eMenu),o=r?new Kt(this.eMenu,!0):t;if(this.params.enableMenu){const n=r?"EVENT_TAP":"EVENT_LONG_TAP",a=l=>this.params.showColumnMenuAfterMouseClick(l.touchStart);this.addManagedListener(o,Kt[n],a)}if(this.params.enableSorting){const n=a=>{var l,u;const h=a.touchStart.target;s&&((l=this.eMenu)!=null&&l.contains(h)||(u=this.eFilterButton)!=null&&u.contains(h))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListener(t,Kt.EVENT_TAP,n)}if(this.params.enableFilterButton){const n=new Kt(this.eFilterButton,!0);this.addManagedListener(n,"tap",()=>this.params.showFilter(this.eFilterButton)),this.addDestroyFunc(()=>n.destroy())}this.addDestroyFunc(()=>t.destroy()),r&&this.addDestroyFunc(()=>o.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){fs(this.eMenu),this.eMenu=void 0;return}const e=this.menuService.isLegacyMenuEnabled();this.addInIcon(e?"menu":"menuAlt",this.eMenu,this.params.column),this.eMenu.classList.toggle("ag-header-menu-icon",!e),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(e){var t,s,r,o;const{column:n}=this.params,a=this.menuService.isLegacyMenuEnabled();if(e&&!a){if(this.menuService.isFilterMenuInHeaderEnabled(n))return this.params.showFilter((s=(t=this.eFilterButton)!=null?t:this.eMenu)!=null?s:this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu((o=(r=this.eMenu)!=null?r:this.eFilterButton)!=null?o: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 $p(!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,Qe.EVENT_MOVING_CHANGED,()=>{this.lastMovingChanged=new Date().getTime()}),this.eLabel&&this.addManagedListener(this.eLabel,"click",t=>{const s=this.params.column.isMoving(),o=new Date().getTime()-this.lastMovingChanged<50;if(!(s||o)){const l=this.gos.get("multiSortKey")==="ctrl"?t.ctrlKey||t.metaKey:t.shiftKey;this.params.progressSort(l)}});const e=()=>{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 t=this.columnModel.getSourceColumnsForGroupColumn(this.params.column),r=!t?.every(o=>this.params.column.getSort()==o.getSort());this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",r)}};this.addManagedListener(this.eventService,b.EVENT_SORT_CHANGED,e),this.addManagedListener(this.eventService,b.EVENT_COLUMN_ROW_GROUP_CHANGED,e)}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){if(!this.eFilterButton)return;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(e,t,s){if(!e)return fs(t),!1;const{column:r}=this.params;return this.addInIcon("filter",t,r),this.addManagedListener(r,Qe.EVENT_FILTER_CHANGED,s),s(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();Ge(this.eFilter,e,{skipAriaHidden:!0})}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){var t,s,r,o;return e?(s=(t=this.eFilterButton)!=null?t:this.eMenu)!=null?s:this.getGui():(o=(r=this.eMenu)!=null?r:this.eFilterButton)!=null?o:this.getGui()}};oi.TEMPLATE=`<div class="ag-cell-label-container" role="presentation">
<span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>
<span ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span>
<div ref="eLabel" class="ag-header-cell-label" role="presentation">
<span ref="eText" class="ag-header-cell-text"></span>
<span ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>
<ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>
</div>
</div>`;g([R("sortController")],oi.prototype,"sortController",2);g([R("menuService")],oi.prototype,"menuService",2);g([R("columnModel")],oi.prototype,"columnModel",2);g([te("eFilter")],oi.prototype,"eFilter",2);g([te("eFilterButton")],oi.prototype,"eFilterButton",2);g([te("eSortIndicator")],oi.prototype,"eSortIndicator",2);g([te("eMenu")],oi.prototype,"eMenu",2);g([te("eLabel")],oi.prototype,"eLabel",2);g([te("eText")],oi.prototype,"eText",2);g([te("eSortOrder")],oi.prototype,"eSortOrder",2);g([te("eSortAsc")],oi.prototype,"eSortAsc",2);g([te("eSortDesc")],oi.prototype,"eSortDesc",2);g([te("eSortMixed")],oi.prototype,"eSortMixed",2);g([te("eSortNone")],oi.prototype,"eSortNone",2);var Hc=oi,Fl=class Yv extends Se{constructor(){super(Yv.TEMPLATE)}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&fe("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 e=r=>{if(vs(r))return;const o=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),o,"uiColumnExpanded")};this.addTouchAndClickListeners(this.eCloseIcon,e),this.addTouchAndClickListeners(this.eOpenIcon,e);const t=r=>{ws(r)};this.addManagedListener(this.eCloseIcon,"dblclick",t),this.addManagedListener(this.eOpenIcon,"dblclick",t),this.addManagedListener(this.getGui(),"dblclick",e),this.updateIconVisibility();const s=this.params.columnGroup.getProvidedColumnGroup();this.addManagedListener(s,At.EVENT_EXPANDED_CHANGED,this.updateIconVisibility.bind(this)),this.addManagedListener(s,At.EVENT_EXPANDABLE_CHANGED,this.updateIconVisibility.bind(this))}addTouchAndClickListeners(e,t){const s=new Kt(e,!0);this.addManagedListener(s,Kt.EVENT_TAP,t),this.addDestroyFunc(()=>s.destroy()),this.addManagedListener(e,"click",t)}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const t=this.params.columnGroup.isExpanded();Ge(this.eOpenIcon,t),Ge(this.eCloseIcon,!t)}else Ge(this.eOpenIcon,!1),Ge(this.eCloseIcon,!1)}addInIcon(e,t){const s=dt(e,this.gos,null);s&&this.getRefElement(t).appendChild(s)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable()){Ge(this.eOpenIcon,!1),Ge(this.eCloseIcon,!1);return}}setupLabel(){var e;const{displayName:t,columnGroup:s}=this.params;if(K(t)){const r=Ft(t,!0);this.getRefElement("agLabel").textContent=r}this.addOrRemoveCssClass("ag-sticky-label",!((e=s.getColGroupDef())!=null&&e.suppressStickyLabel))}};Fl.TEMPLATE=`<div class="ag-header-group-cell-label" ref="agContainer" role="presentation">
<span ref="agLabel" class="ag-header-group-text" role="presentation"></span>
<span ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>
<span ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>
</div>`;g([R("columnModel")],Fl.prototype,"columnModel",2);g([te("agOpened")],Fl.prototype,"eOpenIcon",2);g([te("agClosed")],Fl.prototype,"eCloseIcon",2);var jb=Fl,Mo=class extends Se{isPopup(){return!0}setParentComponent(i){i.addCssClass("ag-has-popup"),super.setParentComponent(i)}destroy(){const i=this.parentComponent;i&&i.isAlive()&&i.getGui().classList.remove("ag-has-popup"),super.destroy()}},Kp=class $v extends Mo{constructor(){super($v.TEMPLATE)}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),K(e.value,!0)&&this.eTextArea.setValue(e.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}onKeyDown(e){const t=e.key;(t===k.LEFT||t===k.UP||t===k.RIGHT||t===k.DOWN||e.shiftKey&&t===k.ENTER)&&e.stopPropagation()}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(e("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()}getValue(){const e=this.eTextArea.getValue();return!K(e)&&!K(this.params.value)?this.params.value:this.params.parseValue(e)}};Kp.TEMPLATE=`<div class="ag-large-text">
<ag-input-text-area ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>
</div>`;g([te("eTextArea")],Kp.prototype,"eTextArea",2);var Ub=Kp,Xp=class extends Mo{constructor(){super(`<div class="ag-cell-edit-wrapper">
<ag-select class="ag-cell-editor" ref="eSelect"></ag-select>
</div>`),this.startedByEnter=!1}init(i){this.focusAfterAttached=i.cellStartedEdit;const{eSelect:e,valueService:t,gos:s}=this,{values:r,value:o,eventKey:n}=i;if(be(r)){console.warn("AG Grid: no values found for select cellEditor");return}this.startedByEnter=n!=null?n===k.ENTER:!1;let a=!1;r.forEach(d=>{const c={value:d},p=t.formatValue(i.column,null,d),y=p!=null;c.text=y?p:d,e.addOption(c),a=a||o===d}),a?e.setValue(i.value,!0):i.values.length&&e.setValue(i.values[0],!0);const{valueListGap:l,valueListMaxWidth:u,valueListMaxHeight:h}=i;l!=null&&e.setPickerGap(l),h!=null&&e.setPickerMaxHeight(h),u!=null&&e.setPickerMaxWidth(u),s.get("editType")!=="fullRow"&&this.addManagedListener(this.eSelect,Xh.EVENT_ITEM_SELECTED,()=>i.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}};g([R("valueService")],Xp.prototype,"valueService",2);g([te("eSelect")],Xp.prototype,"eSelect",2);var Ml=class extends Mo{constructor(i){super(`
<div class="ag-cell-edit-wrapper">
${i.getTemplate()}
</div>`),this.cellEditorInput=i}init(i){this.params=i;const e=this.eInput;this.cellEditorInput.init(e,i);let t;if(i.cellStartedEdit){this.focusAfterAttached=!0;const s=i.eventKey;s===k.BACKSPACE||i.eventKey===k.DELETE?t="":s&&s.length===1?t=s:(t=this.cellEditorInput.getStartValue(),s!==k.F2&&(this.highlightAllOnFocus=!0))}else this.focusAfterAttached=!1,t=this.cellEditorInput.getStartValue();t!=null&&e.setStartValue(t),this.addManagedListener(e.getGui(),"keydown",s=>{const{key:r}=s;(r===k.PAGE_UP||r===k.PAGE_DOWN)&&s.preventDefault()})}afterGuiAttached(){var i,e;const t=this.localeService.getLocaleTextFunc(),s=this.eInput;if(s.setInputAriaLabel(t("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;Os()||s.getFocusableElement().focus();const r=s.getInputElement();this.highlightAllOnFocus?r.select():(e=(i=this.cellEditorInput).setCaret)==null||e.call(i)}focusIn(){const i=this.eInput,e=i.getFocusableElement(),t=i.getInputElement();e.focus(),t.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}};g([te("eInput")],Ml.prototype,"eInput",2);var zb=class{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" ref="eInput"></ag-input-text-field>'}init(i,e){this.eInput=i,this.params=e,e.maxLength!=null&&i.setMaxLength(e.maxLength)}getValue(){const i=this.eInput.getValue();return!K(i)&&!K(this.params.value)?this.params.value:this.params.parseValue(i)}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const i=this.eInput.getValue(),e=K(i)&&i.length||0;e&&this.eInput.getInputElement().setSelectionRange(e,e)}},Yg=class extends Ml{constructor(){super(new zb)}},Yb="↑",$b="↓",Kv=class extends Se{constructor(){super(),this.refreshCount=0;const i=document.createElement("span"),e=document.createElement("span");e.setAttribute("class","ag-value-change-delta");const t=document.createElement("span");t.setAttribute("class","ag-value-change-value"),i.appendChild(e),i.appendChild(t),this.setTemplateFromElement(i)}init(i){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(i,!0)}showDelta(i,e){const t=Math.abs(e),s=i.formatValue(t),r=K(s)?s:t,o=e>=0;o?this.eDelta.textContent=Yb+r:this.eDelta.textContent=$b+r,this.eDelta.classList.toggle("ag-value-change-delta-up",o),this.eDelta.classList.toggle("ag-value-change-delta-down",!o)}setTimerToRemoveDelta(){this.refreshCount++;const i=this.refreshCount;this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{i===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Rt(this.eDelta)}refresh(i,e=!1){const t=i.value;if(t===this.lastValue||(K(i.valueFormatted)?this.eValue.textContent=i.valueFormatted:K(i.value)?this.eValue.textContent=t:Rt(this.eValue),this.filterManager.isSuppressFlashingCellsBecauseFiltering()))return!1;if(typeof t=="number"&&typeof this.lastValue=="number"){const s=t-this.lastValue;this.showDelta(i,s)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),e||this.setTimerToRemoveDelta(),this.lastValue=t,!0}};g([R("filterManager")],Kv.prototype,"filterManager",2);var Xv=class extends Se{constructor(){super(),this.refreshCount=0;const i=document.createElement("span"),e=document.createElement("span");e.setAttribute("class","ag-value-slide-current"),i.appendChild(e),this.setTemplateFromElement(i),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}init(i){this.refresh(i,!0)}addSlideAnimation(){this.refreshCount++;const i=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const e=document.createElement("span");e.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=e,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{i===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{i===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)},3e3)})}refresh(i,e=!1){let t=i.value;return be(t)&&(t=""),t===this.lastValue||this.filterManager.isSuppressFlashingCellsBecauseFiltering()?!1:(e||this.addSlideAnimation(),this.lastValue=t,K(i.valueFormatted)?this.eCurrent.textContent=i.valueFormatted:K(i.value)?this.eCurrent.textContent=t:Rt(this.eCurrent),!0)}};g([R("filterManager")],Xv.prototype,"filterManager",2);var ut=class et{constructor(e){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=et.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=e}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const s=this.data;this.data=e,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const r=this.createDataChangedEvent(e,s,t);this.dispatchLocalEvent(r)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(e,t,s){return{type:et.EVENT_DATA_CHANGED,node:this,oldData:t,newData:e,update:s}}createLocalRowEvent(e){return{type:e,node:this}}getRowIndexString(){return this.rowPinned==="top"?"t-"+this.rowIndex:this.rowPinned==="bottom"?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const e=new et(this.beans);return e.id=this.id,e.data=this.data,e.__daemon=!0,e.selected=this.selected,e.level=this.level,e}setDataAndId(e,t){const s=K(this.id)?this.createDaemonNode():null,r=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,s);const o=this.createDataChangedEvent(e,r,!1);this.dispatchLocalEvent(o)}checkRowSelectable(){const e=this.beans.gos.get("isRowSelectable");this.setRowSelectable(e?e(this):!0)}setRowSelectable(e,t){if(this.selectable!==e){if(this.selectable=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_SELECTABLE_CHANGED)),t)return;if(this.beans.gos.get("groupSelectsChildren")){const r=this.calculateSelectedFromChildren();this.setSelectedParams({newValue:r??!1,source:"selectableChanged"});return}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(e){const t=this.beans.gos.getCallback("getRowId");if(t)if(this.data){const s=this.getGroupKeys(!0);this.id=t({data:this.data,parentKeys:s.length>0?s:void 0,level:this.level}),this.id!==null&&typeof this.id=="string"&&this.id.startsWith(et.ID_PREFIX_ROW_GROUP)&&console.error(`AG Grid: Row IDs cannot start with ${et.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`),this.id!==null&&typeof this.id!="string"&&(this.id=""+this.id)}else this.id=void 0;else this.id=e}getGroupKeys(e=!1){const t=[];let s=this;for(e&&(s=s.parent);s&&s.level>=0;)t.push(s.key),s=s.parent;return t.reverse(),t}isPixelInRange(e){return!K(this.rowTop)||!K(this.rowHeight)?!1:e>=this.rowTop&&e<this.rowTop+this.rowHeight}setFirstChild(e){this.firstChild!==e&&(this.firstChild=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_FIRST_CHILD_CHANGED)))}setLastChild(e){this.lastChild!==e&&(this.lastChild=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_LAST_CHILD_CHANGED)))}setChildIndex(e){this.childIndex!==e&&(this.childIndex=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_CHILD_INDEX_CHANGED)))}setRowTop(e){this.oldRowTop=this.rowTop,this.rowTop!==e&&(this.rowTop=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_TOP_CHANGED)),this.setDisplayed(e!==null))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(e){this.displayed!==e&&(this.displayed=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_DISPLAYED_CHANGED)))}setDragging(e){this.dragging!==e&&(this.dragging=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_DRAGGING_CHANGED)))}setHighlighted(e){e!==this.highlighted&&(this.highlighted=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_HIGHLIGHT_CHANGED)))}setHovered(e){this.hovered!==e&&(this.hovered=e)}isHovered(){return this.hovered}setAllChildrenCount(e){this.allChildrenCount!==e&&(this.allChildrenCount=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_ALL_CHILDREN_COUNT_CHANGED)))}setMaster(e){this.master!==e&&(this.master&&!e&&(this.expanded=!1),this.master=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_MASTER_CHANGED)))}setGroup(e){this.group!==e&&(this.group&&!e&&(this.expanded=!1),this.group=e,this.updateHasChildren(),this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_GROUP_CHANGED)))}setRowHeight(e,t=!1){this.rowHeight=e,this.rowHeightEstimated=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_HEIGHT_CHANGED))}setRowAutoHeight(e,t){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[t.getId()]=e,e!=null&&(this.checkAutoHeightsDebounced==null&&(this.checkAutoHeightsDebounced=ci(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let e=!1,t=!0,s=0;const r=this.__autoHeights;if(r==null||(this.beans.columnModel.getAllDisplayedAutoHeightCols().forEach(a=>{let l=r[a.getId()];if(l==null)if(this.beans.columnModel.isColSpanActive()){let u=[];switch(a.getPinned()){case"left":u=this.beans.columnModel.getDisplayedLeftColumnsForRow(this);break;case"right":u=this.beans.columnModel.getDisplayedRightColumnsForRow(this);break;case null:u=this.beans.columnModel.getViewportCenterColumnsForRow(this);break}if(u.includes(a)){e=!0;return}l=-1}else{e=!0;return}else t=!1;l>s&&(s=l)}),e)||((t||s<10)&&(s=this.beans.gos.getRowHeightForNode(this).height),s==this.rowHeight))return;this.setRowHeight(s);const n=this.beans.rowModel;n.onRowHeightChangedDebounced&&n.onRowHeightChangedDebounced()}setRowIndex(e){this.rowIndex!==e&&(this.rowIndex=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_ROW_INDEX_CHANGED)))}setUiLevel(e){this.uiLevel!==e&&(this.uiLevel=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_UI_LEVEL_CHANGED)))}setExpanded(e,t,s){if(this.expanded===e)return;this.expanded=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_EXPANDED_CHANGED));const r=Object.assign({},this.createGlobalRowEvent(b.EVENT_ROW_GROUP_OPENED),{expanded:e,event:t||null});this.beans.rowNodeEventThrottle.dispatchExpanded(r,s),this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(e){return this.beans.gos.addGridCommonParams({type:e,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned})}dispatchLocalEvent(e){this.eventService&&this.eventService.dispatchEvent(e)}setDataValue(e,t,s){const o=(()=>{var l;return typeof e!="string"?e:(l=this.beans.columnModel.getGridColumn(e))!=null?l:this.beans.columnModel.getPrimaryColumn(e)})(),n=this.getValueFromValueService(o);if(this.beans.gos.get("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(o,n,t,s),!1;const a=this.beans.valueService.setValue(this,o,t,s);return this.dispatchCellChangedEvent(o,t,n),this.checkRowSelectable(),a}getValueFromValueService(e){var t,s;const r=this.leafGroup&&this.beans.columnModel.isPivotMode(),o=this.group&&this.expanded&&!this.footer&&!r;let n=!1;const a=(t=this.beans.gos.get("groupTotalRow"))!=null?t:this.beans.gos.get("groupIncludeFooter");typeof a!="function"?n=!!a:n=!!((s=this.beans.gos.getCallback("groupTotalRow"))!=null?s:this.beans.gos.getCallback("groupIncludeFooter"))({node:this});const l=this.beans.gos.get("groupSuppressBlankHeader"),u=o&&n&&!l;return this.beans.valueService.getValue(e,this,!1,u)}dispatchEventForSaveValueReadOnly(e,t,s,r){const o=this.beans.gos.addGridCommonParams({type:b.EVENT_CELL_EDIT_REQUEST,event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:e,colDef:e.getColDef(),data:this.data,node:this,oldValue:t,newValue:s,value:s,source:r});this.beans.eventService.dispatchEvent(o)}setGroupValue(e,t){const s=this.beans.columnModel.getGridColumn(e);be(this.groupData)&&(this.groupData={});const r=s.getColId(),o=this.groupData[r];o!==t&&(this.groupData[r]=t,this.dispatchCellChangedEvent(s,t,o))}setAggData(e){const t=this.aggData;if(this.aggData=e,this.eventService){const s=r=>{const o=this.aggData?this.aggData[r]:void 0,n=t?t[r]:void 0;if(o===n)return;const a=this.beans.columnModel.lookupGridColumn(r);a&&this.dispatchCellChangedEvent(a,o,n)};for(const r in this.aggData)s(r);for(const r in e)r in this.aggData||s(r)}}updateHasChildren(){let e=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gos.isRowModelType("serverSide")){const s=this.beans.gos.get("treeData"),r=this.beans.gos.get("isServerSideGroup");e=!this.stub&&!this.footer&&(s?!!r&&r(this.data):!!this.group)}e!==this.__hasChildren&&(this.__hasChildren=!!e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(et.EVENT_HAS_CHILDREN_CHANGED)))}hasChildren(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return this.group&&zi(this.childrenAfterGroup)}dispatchCellChangedEvent(e,t,s){const r={type:et.EVENT_CELL_CHANGED,node:this,column:e,newValue:t,oldValue:s};this.dispatchLocalEvent(r)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.footer?!1:this.beans.columnModel.isPivotMode()?this.hasChildren()&&!this.leafGroup:this.hasChildren()||!!this.master}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(e){this.childrenAfterGroup&&this.childrenAfterGroup.forEach(t=>t.depthFirstSearch(e)),e(this)}calculateSelectedFromChildren(){var e;let t=!1,s=!1,r=!1;if(!((e=this.childrenAfterGroup)!=null&&e.length))return this.selectable?this.selected:null;for(let o=0;o<this.childrenAfterGroup.length;o++){const n=this.childrenAfterGroup[o];let a=n.isSelected();if(!n.selectable){const l=n.calculateSelectedFromChildren();if(l===null)continue;a=l}switch(a){case!0:t=!0;break;case!1:s=!0;break;default:r=!0;break}}if(!(r||t&&s))return t?!0:s?!1:this.selectable?this.selected:null}setSelectedInitialValue(e){this.selected=e}selectThisNode(e,t,s="api"){const r=!this.selectable&&e,o=this.selected===e;if(r||o)return!1;this.selected=e,this.eventService&&this.dispatchLocalEvent(this.createLocalRowEvent(et.EVENT_ROW_SELECTED));const n=this.sibling;n&&n.footer&&n.eventService&&n.dispatchLocalEvent(n.createLocalRowEvent(et.EVENT_ROW_SELECTED));const a=lt(de({},this.createGlobalRowEvent(b.EVENT_ROW_SELECTED)),{event:t||null,source:s});return this.beans.eventService.dispatchEvent(a),!0}setSelected(e,t=!1,s="api"){if(typeof s=="boolean"){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.");return}this.setSelectedParams({newValue:e,clearSelection:t,rangeSelect:!1,source:s})}setSelectedParams(e){return this.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),0):this.id===void 0?(console.warn("AG Grid: cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected(lt(de({},e),{nodes:[this.footer?this.sibling:this]}))}isRowPinned(){return this.rowPinned==="top"||this.rowPinned==="bottom"}isParentOfNode(e){let t=this.parent;for(;t;){if(t===e)return!0;t=t.parent}return!1}addEventListener(e,t){var s,r;this.eventService||(this.eventService=new ys),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new cp(this.beans.frameworkOverrides));const o=(r=(s=this.frameworkEventListenerService)==null?void 0:s.wrap(t))!=null?r:t;this.eventService.addEventListener(e,o)}removeEventListener(e,t){var s,r;if(!this.eventService)return;const o=(r=(s=this.frameworkEventListenerService)==null?void 0:s.unwrap(t))!=null?r:t;this.eventService.removeEventListener(e,o),this.eventService.noRegisteredListenersExist()&&(this.eventService=null)}onMouseEnter(){this.dispatchLocalEvent(this.createLocalRowEvent(et.EVENT_MOUSE_ENTER))}onMouseLeave(){this.dispatchLocalEvent(this.createLocalRowEvent(et.EVENT_MOUSE_LEAVE))}getFirstChildOfFirstChild(e){let t=this,s=!0,r=!1,o=null;for(;s&&!r;){const n=t.parent;K(n)&&t.firstChild?n.rowGroupColumn===e&&(r=!0,o=n):s=!1,t=n}return r?o:null}isFullWidthCell(){if(this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return e?e({rowNode:this}):!1}getRoute(){if(this.key==null)return;const e=[];let t=this;for(;t.key!=null;)e.push(t.key),t=t.parent;return e.reverse()}createFooter(){if(this.sibling)return;const e=new Set(["eventService","__objectId","sticky"]),t=new et(this.beans);Object.keys(this).forEach(s=>{e.has(s)||(t[s]=this[s])}),t.footer=!0,t.setRowTop(null),t.setRowIndex(null),t.oldRowTop=null,t.id="rowGroupFooter_"+this.id,t.sibling=this,this.sibling=t}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}};ut.ID_PREFIX_ROW_GROUP="row-group-";ut.ID_PREFIX_TOP_PINNED="t-";ut.ID_PREFIX_BOTTOM_PINNED="b-";ut.OBJECT_ID_SEQUENCE=0;ut.EVENT_ROW_SELECTED="rowSelected";ut.EVENT_DATA_CHANGED="dataChanged";ut.EVENT_CELL_CHANGED="cellChanged";ut.EVENT_ALL_CHILDREN_COUNT_CHANGED="allChildrenCountChanged";ut.EVENT_MASTER_CHANGED="masterChanged";ut.EVENT_GROUP_CHANGED="groupChanged";ut.EVENT_MOUSE_ENTER="mouseEnter";ut.EVENT_MOUSE_LEAVE="mouseLeave";ut.EVENT_HEIGHT_CHANGED="heightChanged";ut.EVENT_TOP_CHANGED="topChanged";ut.EVENT_DISPLAYED_CHANGED="displayedChanged";ut.EVENT_FIRST_CHILD_CHANGED="firstChildChanged";ut.EVENT_LAST_CHILD_CHANGED="lastChildChanged";ut.EVENT_CHILD_INDEX_CHANGED="childIndexChanged";ut.EVENT_ROW_INDEX_CHANGED="rowIndexChanged";ut.EVENT_EXPANDED_CHANGED="expandedChanged";ut.EVENT_HAS_CHILDREN_CHANGED="hasChildrenChanged";ut.EVENT_SELECTABLE_CHANGED="selectableChanged";ut.EVENT_UI_LEVEL_CHANGED="uiLevelChanged";ut.EVENT_HIGHLIGHT_CHANGED="rowHighlightChanged";ut.EVENT_DRAGGING_CHANGED="draggingChanged";var Me=ut,Jh=class extends Se{constructor(){super(`
<div class="ag-selection-checkbox" role="presentation">
<ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>
</div>`)}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const i=this.localeService.getLocaleTextFunc(),e=this.rowNode.isSelected(),t=Wh(i,e),[s,r]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],o=i(s,r);this.eCheckbox.setValue(e,!0),this.eCheckbox.setInputAriaLabel(`${o} (${t})`)}onClicked(i,e,t){return this.rowNode.setSelectedParams({newValue:i,rangeSelect:t.shiftKey,groupSelectsFiltered:e,event:t,source:"checkboxSelected"})}init(i){if(this.rowNode=i.rowNode,this.column=i.column,this.overrides=i.overrides,this.onSelectionChanged(),this.addManagedListener(this.eCheckbox.getInputElement(),"dblclick",s=>{ws(s)}),this.addManagedListener(this.eCheckbox.getInputElement(),"click",s=>{ws(s);const r=this.gos.get("groupSelectsFiltered"),o=this.eCheckbox.getValue();this.shouldHandleIndeterminateState(o,r)?this.onClicked(!0,r,s||{})===0&&this.onClicked(!1,r,s):o?this.onClicked(!1,r,s):this.onClicked(!0,r,s||{})}),this.addManagedListener(this.rowNode,Me.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.rowNode,Me.EVENT_DATA_CHANGED,this.onDataChanged.bind(this)),this.addManagedListener(this.rowNode,Me.EVENT_SELECTABLE_CHANGED,this.onSelectableChanged.bind(this)),this.gos.get("isRowSelectable")||typeof this.getIsVisible()=="function"){const s=this.showOrHideSelect.bind(this);this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_CHANGED,s),this.addManagedListener(this.rowNode,Me.EVENT_DATA_CHANGED,s),this.addManagedListener(this.rowNode,Me.EVENT_CELL_CHANGED,s),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(i,e){return e&&(this.eCheckbox.getPreviousValue()===void 0||i===void 0)&&this.gos.isRowModelType("clientSide")}showOrHideSelect(){var i,e,t;let s=this.rowNode.selectable;const r=this.getIsVisible();if(s)if(typeof r=="function"){const n=(i=this.overrides)==null?void 0:i.callbackParams;if(!this.column)s=r(lt(de({},n),{node:this.rowNode,data:this.rowNode.data}));else{const a=this.column.createColumnFunctionCallbackParams(this.rowNode);s=r(de(de({},n),a))}}else s=r??!1;if((e=this.column)==null?void 0:e.getColDef().showDisabledCheckboxes){this.eCheckbox.setDisabled(!s),this.setVisible(!0),this.setDisplayed(!0);return}if((t=this.overrides)!=null&&t.removeHidden){this.setDisplayed(s);return}this.setVisible(s)}getIsVisible(){var i,e;return this.overrides?this.overrides.isVisible:(e=(i=this.column)==null?void 0:i.getColDef())==null?void 0:e.checkboxSelection}};g([te("eCheckbox")],Jh.prototype,"eCheckbox",2);g([J],Jh.prototype,"postConstruct",1);var qv=(i=>(i[i.Left=0]="Left",i[i.Right=1]="Right",i))(qv||{}),Re=class extends Z{constructor(){super(...arguments),this.dragSourceAndParamsList=[],this.dropTargets=[]}init(){this.ePinnedIcon=Ui("columnMovePin",this.gos,null),this.eHideIcon=Ui("columnMoveHide",this.gos,null),this.eMoveIcon=Ui("columnMoveMove",this.gos,null),this.eLeftIcon=Ui("columnMoveLeft",this.gos,null),this.eRightIcon=Ui("columnMoveRight",this.gos,null),this.eGroupIcon=Ui("columnMoveGroup",this.gos,null),this.eAggregateIcon=Ui("columnMoveValue",this.gos,null),this.ePivotIcon=Ui("columnMovePivot",this.gos,null),this.eDropNotAllowedIcon=Ui("dropNotAllowed",this.gos,null)}addDragSource(i,e=!1){const t={eElement:i.eElement,dragStartPixels:i.dragStartPixels,onDragStart:this.onDragStart.bind(this,i),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:e};this.dragSourceAndParamsList.push({params:t,dragSource:i}),this.dragService.addDragSource(t)}removeDragSource(i){const e=this.dragSourceAndParamsList.find(t=>t.dragSource===i);e&&(this.dragService.removeDragSource(e.params),_i(this.dragSourceAndParamsList,e))}clearDragSourceParamsList(){this.dragSourceAndParamsList.forEach(i=>this.dragService.removeDragSource(i.params)),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(i,e){this.dragging=!0,this.dragSource=i,this.eventLastTime=e,this.dragItem=this.dragSource.getDragItem(),this.lastDropTarget=void 0,this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(i){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const e=this.createDropTargetEvent(this.lastDropTarget,i,null,null,!1);this.lastDropTarget.onDragStop(e)}this.lastDropTarget=null,this.dragItem=null,this.removeGhost()}onDragging(i,e){var t,s,r,o;const n=this.getHorizontalDirection(i),a=this.getVerticalDirection(i);this.eventLastTime=i,this.positionGhost(i);const l=this.dropTargets.filter(h=>this.isMouseOnDropTarget(i,h)),u=this.findCurrentDropTarget(i,l);if(u!==this.lastDropTarget)this.leaveLastTargetIfExists(i,n,a,e),this.lastDropTarget!==null&&u===null&&((s=(t=this.dragSource).onGridExit)==null||s.call(t,this.dragItem)),this.lastDropTarget===null&&u!==null&&((o=(r=this.dragSource).onGridEnter)==null||o.call(r,this.dragItem)),this.enterDragTargetIfExists(u,i,n,a,e),this.lastDropTarget=u;else if(u&&u.onDragging){const h=this.createDropTargetEvent(u,i,n,a,e);u.onDragging(h)}}getAllContainersFromDropTarget(i){const e=i.getSecondaryContainers?i.getSecondaryContainers():null,t=[[i.getContainer()]];return e?t.concat(e):t}allContainersIntersect(i,e){for(const t of e){const s=t.getBoundingClientRect();if(s.width===0||s.height===0)return!1;const r=i.clientX>=s.left&&i.clientX<s.right,o=i.clientY>=s.top&&i.clientY<s.bottom;if(!r||!o)return!1}return!0}isMouseOnDropTarget(i,e){const t=this.getAllContainersFromDropTarget(e);let s=!1;for(const r of t)if(this.allContainersIntersect(i,r)){s=!0;break}return e.targetContainsSource&&!e.getContainer().contains(this.dragSource.eElement)?!1:s&&e.isInterestedIn(this.dragSource.type,this.dragSource.eElement)}findCurrentDropTarget(i,e){const t=e.length;if(t===0)return null;if(t===1)return e[0];const r=this.gos.getRootNode().elementsFromPoint(i.clientX,i.clientY);for(const o of r)for(const n of e)if(xm(this.getAllContainersFromDropTarget(n)).indexOf(o)!==-1)return n;return null}enterDragTargetIfExists(i,e,t,s,r){if(i){if(i.onDragEnter){const o=this.createDropTargetEvent(i,e,t,s,r);i.onDragEnter(o)}this.setGhostIcon(i.getIconName?i.getIconName():null)}}leaveLastTargetIfExists(i,e,t,s){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const r=this.createDropTargetEvent(this.lastDropTarget,i,e,t,s);this.lastDropTarget.onDragLeave(r)}this.setGhostIcon(null)}}addDropTarget(i){this.dropTargets.push(i)}removeDropTarget(i){this.dropTargets=this.dropTargets.filter(e=>e.getContainer()!==i.getContainer())}hasExternalDropZones(){return this.dropTargets.some(i=>i.external)}findExternalZone(i){return this.dropTargets.filter(t=>t.external).find(t=>t.getContainer()===i.getContainer())||null}getHorizontalDirection(i){const e=this.eventLastTime&&this.eventLastTime.clientX,t=i.clientX;return e===t?null:e>t?0:1}getVerticalDirection(i){const e=this.eventLastTime&&this.eventLastTime.clientY,t=i.clientY;return e===t?null:e>t?0:1}createDropTargetEvent(i,e,t,s,r){const o=i.getContainer(),n=o.getBoundingClientRect(),{gridApi:a,columnApi:l,dragItem:u,dragSource:h}=this,d=e.clientX-n.left,c=e.clientY-n.top;return{event:e,x:d,y:c,vDirection:s,hDirection:t,dragSource:h,fromNudge:r,dragItem:u,api:a,columnApi:l,dropZoneTarget:o}}positionGhost(i){const e=this.eGhost;if(!e)return;const s=e.getBoundingClientRect().height,r=Jm()-2,o=ev()-2,n=Fp(e.offsetParent),{clientY:a,clientX:l}=i;let u=a-n.top-s/2,h=l-n.left-10;const d=this.gos.getDocument(),c=d.defaultView||window,p=c.pageYOffset||d.documentElement.scrollTop,y=c.pageXOffset||d.documentElement.scrollLeft;r>0&&h+e.clientWidth>r+y&&(h=r+y-e.clientWidth),h<0&&(h=0),o>0&&u+e.clientHeight>o+p&&(u=o+p-e.clientHeight),u<0&&(u=0),e.style.left=`${h}px`,e.style.top=`${u}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=Ri(Re.GHOST_TEMPLATE),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost);const{theme:i}=this.environment.getTheme();i&&this.eGhost.classList.add(i),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const e=this.eGhost.querySelector(".ag-dnd-ghost-label");let t=this.dragSource.dragItemName;Nh(t)&&(t=t()),e.innerHTML=Ft(t)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const s=this.gos.getDocument();let r=null,o=null;try{r=s.fullscreenElement}catch{}finally{r||(r=this.gos.getRootNode());const n=r.querySelector("body");n?o=n:r instanceof ShadowRoot?o=r:r instanceof Document?o=r?.documentElement:o=r}this.eGhostParent=o,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):console.warn("AG Grid: could not find document body, it is needed for dragging columns")}setGhostIcon(i,e=!1){Rt(this.eGhostIcon);let t=null;switch(i||(i=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():Re.ICON_NOT_ALLOWED),i){case Re.ICON_PINNED:t=this.ePinnedIcon;break;case Re.ICON_MOVE:t=this.eMoveIcon;break;case Re.ICON_LEFT:t=this.eLeftIcon;break;case Re.ICON_RIGHT:t=this.eRightIcon;break;case Re.ICON_GROUP:t=this.eGroupIcon;break;case Re.ICON_AGGREGATE:t=this.eAggregateIcon;break;case Re.ICON_PIVOT:t=this.ePivotIcon;break;case Re.ICON_NOT_ALLOWED:t=this.eDropNotAllowedIcon;break;case Re.ICON_HIDE:t=this.eHideIcon;break}this.eGhostIcon.classList.toggle("ag-shake-left-to-right",e),!(t===this.eHideIcon&&this.gos.get("suppressDragLeaveHidesColumns"))&&t&&this.eGhostIcon.appendChild(t)}};Re.ICON_PINNED="pinned";Re.ICON_MOVE="move";Re.ICON_LEFT="left";Re.ICON_RIGHT="right";Re.ICON_GROUP="group";Re.ICON_AGGREGATE="aggregate";Re.ICON_PIVOT="pivot";Re.ICON_NOT_ALLOWED="notAllowed";Re.ICON_HIDE="hide";Re.GHOST_TEMPLATE=`<div class="ag-dnd-ghost ag-unselectable">
<span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>
<div class="ag-dnd-ghost-label"></div>
</div>`;g([R("dragService")],Re.prototype,"dragService",2);g([R("mouseEventService")],Re.prototype,"mouseEventService",2);g([R("columnApi")],Re.prototype,"columnApi",2);g([R("gridApi")],Re.prototype,"gridApi",2);g([J],Re.prototype,"init",1);g([vi],Re.prototype,"clearDragSourceParamsList",1);Re=g([le("dragAndDropService")],Re);var ho=class extends Se{constructor(i,e,t,s,r,o){super(),this.cellValueFn=i,this.rowNode=e,this.column=t,this.customGui=s,this.dragStartPixels=r,this.suppressVisibilityChange=o,this.dragSource=null}isCustomGui(){return this.customGui!=null}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(dt("rowDrag",this.gos,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const i=this.gos.get("rowDragManaged")?new Jv(this,this.beans,this.rowNode,this.column):new Zv(this,this.beans,this.rowNode,this.column);this.createManagedBean(i,this.beans.context)}}setDragElement(i,e){this.setTemplateFromElement(i),this.addDragSource(e)}getSelectedNodes(){if(!this.gos.get("rowDragMultiRow"))return[this.rowNode];const e=this.beans.selectionService.getSelectedNodes();return e.indexOf(this.rowNode)!==-1?e:[this.rowNode]}checkCompatibility(){const i=this.gos.get("rowDragManaged");this.gos.get("treeData")&&i&&fe("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(i){if(i){const e=i.getColDef();if(e.rowDragText)return e.rowDragText}return this.gos.get("rowDragText")}addDragSource(i=4){this.dragSource&&this.removeDragSource();const e=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:this.getGui(),dragItemName:()=>{var t;const s=this.getDragItem(),r=((t=s.rowNodes)==null?void 0:t.length)||1,o=this.getRowDragText(this.column);return o?o(s,r):r===1?this.cellValueFn():`${r} ${e("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:i,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}removeDragSource(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null}};g([R("beans")],ho.prototype,"beans",2);g([J],ho.prototype,"postConstruct",1);g([vi],ho.prototype,"removeDragSource",1);var Qv=class extends Z{constructor(i,e,t){super(),this.parent=i,this.rowNode=e,this.column=t}setDisplayedOrVisible(i){const e={skipAriaHidden:!0};if(i)this.parent.setDisplayed(!1,e);else{let t=!0,s=!1;this.column&&(t=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),s=Nh(this.column.getColDef().rowDrag)),s?(this.parent.setDisplayed(!0,e),this.parent.setVisible(t,e)):(this.parent.setDisplayed(t,e),this.parent.setVisible(!0,e))}}},Zv=class extends Qv{constructor(i,e,t,s){super(i,t,s),this.beans=e}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.addManagedListener(this.rowNode,Me.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Me.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Me.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,b.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const i=this.gos.get("suppressRowDrag");this.setDisplayedOrVisible(i)}};g([J],Zv.prototype,"postConstruct",1);var Jv=class extends Qv{constructor(i,e,t,s){super(i,t,s),this.beans=e}postConstruct(){this.addManagedListener(this.beans.eventService,b.EVENT_SORT_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,b.EVENT_FILTER_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,b.EVENT_COLUMN_ROW_GROUP_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,b.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Me.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Me.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature(),t=e&&e.shouldPreventRowMove(),s=this.gos.get("suppressRowDrag"),r=this.beans.dragAndDropService.hasExternalDropZones(),o=t&&!r||s;this.setDisplayedOrVisible(o)}};g([J],Jv.prototype,"postConstruct",1);var Lo=class extends Z{init(i,e,t,s,r,o,n){var a,l,u,h;this.params=n,this.eGui=e,this.eCheckbox=t,this.eExpanded=s,this.eContracted=r,this.comp=i,this.compClass=o;const{node:d,value:c,colDef:p}=n,y=this.isTopLevelFooter();if(!y){if(this.isEmbeddedRowMismatch())return;if(d.footer&&this.gos.get("groupHideOpenParents")){const w=p&&p.showRowGroup,_=d.rowGroupColumn&&d.rowGroupColumn.getColId();if(w!==_)return}}if(this.setupShowingValueForOpenedParent(),this.findDisplayedGroupNode(),!y){const f=n.node.footer&&n.node.rowGroupIndex===this.columnModel.getRowGroupColumns().findIndex(O=>{var N;return O.getColId()===((N=n.colDef)==null?void 0:N.showRowGroup)}),_=this.gos.get("groupDisplayType")!="multipleColumns"||this.gos.get("treeData")||this.gos.get("showOpenedGroup")&&!n.node.footer&&(!n.node.group||n.node.rowGroupIndex!=null&&n.node.rowGroupIndex>this.columnModel.getRowGroupColumns().findIndex(O=>{var N;return O.getColId()===((N=n.colDef)==null?void 0:N.showRowGroup)})),P=!d.group&&(((a=this.params.colDef)==null?void 0:a.field)||((l=this.params.colDef)==null?void 0:l.valueGetter)),T=this.isExpandable(),D=this.columnModel.isPivotMode()&&d.leafGroup&&((u=d.rowGroupColumn)==null?void 0:u.getColId())===((h=n.column)==null?void 0:h.getColDef().showRowGroup);if(!this.showingValueForOpenedParent&&!T&&!P&&!_&&!f&&!D)return}this.addExpandAndContract(),this.addFullWidthRowDraggerIfNeeded(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded()}getCellAriaRole(){var i,e;const t=(i=this.params.colDef)==null?void 0:i.cellAriaRole,s=(e=this.params.column)==null?void 0:e.getColDef().cellAriaRole;return t||s||"gridcell"}destroy(){super.destroy(),this.expandListener=null}refreshAriaExpanded(){const{node:i,eGridCell:e}=this.params;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable()){Um(e);return}const t=()=>{Xs(e,!!i.expanded)};this.expandListener=this.addManagedListener(i,Me.EVENT_EXPANDED_CHANGED,t)||null,t()}isTopLevelFooter(){if(!this.gos.getGrandTotalRow()||this.params.value!=null||this.params.node.level!=-1)return!1;const e=this.params.colDef;if(e==null||e.showRowGroup===!0)return!0;const s=this.columnModel.getRowGroupColumns();return!s||s.length===0?!0:s[0].getId()===e.showRowGroup}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;const i=this.params.pinned==="left",e=this.params.pinned==="right",t=!i&&!e;return this.gos.get("enableRtl")?this.columnModel.isPinningLeft()?!e:!t:this.columnModel.isPinningLeft()?!i:!t}findDisplayedGroupNode(){const i=this.params.column,e=this.params.node;if(this.showingValueForOpenedParent){let t=e.parent;for(;t!=null;){if(t.rowGroupColumn&&i.isRowGroupDisplayed(t.rowGroupColumn.getId())){this.displayedGroupNode=t;break}t=t.parent}}be(this.displayedGroupNode)&&(this.displayedGroupNode=e)}setupShowingValueForOpenedParent(){const i=this.params.node,e=this.params.column;if(!this.gos.get("groupHideOpenParents")){this.showingValueForOpenedParent=!1;return}if(!i.groupData){this.showingValueForOpenedParent=!1;return}if(i.rowGroupColumn!=null){const r=i.rowGroupColumn.getId();if(e.isRowGroupDisplayed(r)){this.showingValueForOpenedParent=!1;return}}const s=i.groupData[e.getId()]!=null;this.showingValueForOpenedParent=s}addValueElement(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())}addGroupValue(){var i;const e=this.adjustParamsWithDetailsFromRelatedColumn(),t=this.getInnerCompDetails(e),{valueFormatted:s,value:r}=e;let o=s;if(o==null){const n=this.displayedGroupNode.rowGroupColumn&&((i=this.params.column)==null?void 0:i.isRowGroupDisplayed(this.displayedGroupNode.rowGroupColumn.getId()));this.displayedGroupNode.key===""&&this.displayedGroupNode.group&&n?o=this.localeService.getLocaleTextFunc()("blanks","(Blanks)"):o=r??null}this.comp.setInnerRenderer(t,o)}adjustParamsWithDetailsFromRelatedColumn(){const i=this.displayedGroupNode.rowGroupColumn,e=this.params.column;if(!i)return this.params;if(e!=null&&!e.isRowGroupDisplayed(i.getId()))return this.params;const s=this.params,{value:r,node:o}=this.params,n=this.valueService.formatValue(i,o,r);return lt(de({},s),{valueFormatted:n})}addFooterValue(){let i=this.params.totalValueGetter;if(!i){const s=this.params.footerValueGetter;s&&(i=s,fe("As of v31.3, footerValueGetter is deprecated. Use `totalValueGetter` instead."))}let e="";if(i){const s=hp(this.params);s.value=this.params.value,typeof i=="function"?e=i(s):typeof i=="string"?e=this.expressionService.evaluate(i,s):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else e=this.localeService.getLocaleTextFunc()("footerTotal","Total")+" "+(this.params.value!=null?this.params.value:"");const t=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(t,e)}getInnerCompDetails(i){if(i.fullWidth)return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gos.get("groupRowRendererParams"),i);const e=this.userComponentFactory.getInnerRendererDetails(i,i),t=n=>n&&n.componentClass==this.compClass;if(e&&!t(e))return e;const s=this.displayedGroupNode.rowGroupColumn,r=s?s.getColDef():void 0;if(!r)return;const o=this.userComponentFactory.getCellRendererDetails(r,i);if(o&&!t(o))return o;if(t(o)&&r.cellRendererParams&&r.cellRendererParams.innerRenderer)return this.userComponentFactory.getInnerRendererDetails(r.cellRendererParams,i)}addChildCount(){this.params.suppressCount||(this.addManagedListener(this.displayedGroupNode,Me.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())}updateChildCount(){const i=this.displayedGroupNode.allChildrenCount,s=this.isShowRowGroupForThisRow()&&i!=null&&i>=0?`(${i})`:"";this.comp.setChildCount(s)}isShowRowGroupForThisRow(){if(this.gos.get("treeData"))return!0;const i=this.displayedGroupNode.rowGroupColumn;if(!i)return!1;const e=this.params.column;return e==null||e.isRowGroupDisplayed(i.getId())}addExpandAndContract(){var i;const e=this.params,t=dt("groupExpanded",this.gos,null),s=dt("groupContracted",this.gos,null);t&&this.eExpanded.appendChild(t),s&&this.eContracted.appendChild(s);const r=e.eGridCell;!(((i=this.params.column)==null?void 0:i.isCellEditable(e.node))&&this.gos.get("enableGroupEdit"))&&this.isExpandable()&&!e.suppressDoubleClickExpand&&this.addManagedListener(r,"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(r,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(e.node,Me.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();const n=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,Me.EVENT_ALL_CHILDREN_COUNT_CHANGED,n),this.addManagedListener(this.displayedGroupNode,Me.EVENT_MASTER_CHANGED,n),this.addManagedListener(this.displayedGroupNode,Me.EVENT_GROUP_CHANGED,n),this.addManagedListener(this.displayedGroupNode,Me.EVENT_HAS_CHILDREN_CHANGED,n)}onExpandClicked(i){vs(i)||(ws(i),this.onExpandOrContract(i))}onExpandOrContract(i){const e=this.displayedGroupNode,t=!e.expanded;!t&&e.sticky&&this.scrollToStickyNode(e),e.setExpanded(t,i)}scrollToStickyNode(i){this.ctrlsService.getGridBodyCtrl().getScrollFeature().setVerticalScrollPosition(i.rowTop-i.stickyRowTop)}isExpandable(){if(this.showingValueForOpenedParent)return!0;const i=this.displayedGroupNode,e=this.columnModel.isPivotMode()&&i.leafGroup;if(!(i.isExpandable()&&!i.footer&&!e))return!1;const s=this.params.column;return s!=null&&typeof s.getColDef().showRowGroup=="string"?this.isShowRowGroupForThisRow():!0}showExpandAndContractIcons(){const{params:i,displayedGroupNode:e,columnModel:t}=this,{node:s}=i,r=this.isExpandable();if(r){const u=this.showingValueForOpenedParent?!0:s.expanded;this.comp.setExpandedDisplayed(u),this.comp.setContractedDisplayed(!u)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);const o=t.isPivotMode(),n=o&&e.leafGroup,a=r&&!n,l=s.footer&&s.level===-1;this.comp.addOrRemoveCssClass("ag-cell-expandable",a),this.comp.addOrRemoveCssClass("ag-row-group",a),o?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",n):l||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!a)}onRowNodeIsExpandableChanged(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()}setupIndent(){const i=this.params.node;this.params.suppressPadding||(this.addManagedListener(i,Me.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())}setIndent(){if(this.gos.get("groupHideOpenParents"))return;const i=this.params,e=i.node,t=!!i.colDef,s=this.gos.get("treeData"),o=!t||s||i.colDef.showRowGroup===!0?e.uiLevel:0;this.indentClass&&this.comp.addOrRemoveCssClass(this.indentClass,!1),this.indentClass="ag-row-group-indent-"+o,this.comp.addOrRemoveCssClass(this.indentClass,!0)}addFullWidthRowDraggerIfNeeded(){if(!this.params.fullWidth||!this.params.rowDrag)return;const i=new ho(()=>this.params.value,this.params.node);this.createManagedBean(i,this.context),this.eGui.insertAdjacentElement("afterbegin",i.getGui())}isUserWantsSelected(){const i=this.params.checkbox;return typeof i=="function"||i===!0}addCheckboxIfNeeded(){const i=this.displayedGroupNode,e=this.isUserWantsSelected()&&!i.footer&&!i.rowPinned&&!i.detail;if(e){const t=new Jh;this.getContext().createBean(t),t.init({rowNode:this.params.node,column:this.params.column,overrides:{isVisible:this.params.checkbox,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(t.getGui()),this.addDestroyFunc(()=>this.getContext().destroyBean(t))}this.comp.setCheckboxVisible(e)}onKeyDown(i){!(i.key===k.ENTER)||this.params.suppressEnterExpand||this.params.column&&this.params.column.isCellEditable(this.params.node)||this.onExpandOrContract(i)}onCellDblClicked(i){if(vs(i))return;Ju(this.eExpanded,i)||Ju(this.eContracted,i)||this.onExpandOrContract(i)}};g([R("expressionService")],Lo.prototype,"expressionService",2);g([R("valueService")],Lo.prototype,"valueService",2);g([R("columnModel")],Lo.prototype,"columnModel",2);g([R("userComponentFactory")],Lo.prototype,"userComponentFactory",2);g([R("ctrlsService")],Lo.prototype,"ctrlsService",2);var Io=class eC extends Se{constructor(){super(eC.TEMPLATE)}init(e){const t={setInnerRenderer:(n,a)=>this.setRenderDetails(n,a),setChildCount:n=>this.eChildCount.textContent=n,addOrRemoveCssClass:(n,a)=>this.addOrRemoveCssClass(n,a),setContractedDisplayed:n=>Ge(this.eContracted,n),setExpandedDisplayed:n=>Ge(this.eExpanded,n),setCheckboxVisible:n=>this.eCheckbox.classList.toggle("ag-invisible",!n)},s=this.createManagedBean(new Lo),r=!e.colDef,o=this.getGui();s.init(t,o,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),r&&yt(o,s.getCellAriaRole())}setRenderDetails(e,t){if(e){const s=e.newAgStackInstance();if(!s)return;s.then(r=>{if(!r)return;const o=()=>this.context.destroyBean(r);this.isAlive()?(this.eValue.appendChild(r.getGui()),this.addDestroyFunc(o)):o()})}else this.eValue.innerText=t}destroy(){this.getContext().destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}};Io.TEMPLATE=`<span class="ag-cell-wrapper">
<span class="ag-group-expanded" ref="eExpanded"></span>
<span class="ag-group-contracted" ref="eContracted"></span>
<span class="ag-group-checkbox ag-invisible" ref="eCheckbox"></span>
<span class="ag-group-value" ref="eValue"></span>
<span class="ag-group-child-count" ref="eChildCount"></span>
</span>`;g([te("eExpanded")],Io.prototype,"eExpanded",2);g([te("eContracted")],Io.prototype,"eContracted",2);g([te("eCheckbox")],Io.prototype,"eCheckbox",2);g([te("eValue")],Io.prototype,"eValue",2);g([te("eChildCount")],Io.prototype,"eChildCount",2);var $g=Io,ed=class tC extends Se{constructor(){super(tC.TEMPLATE)}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=dt("groupLoading",this.gos,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}};ed.TEMPLATE=`<div class="ag-loading">
<span class="ag-loading-icon" ref="eLoadingIcon"></span>
<span class="ag-loading-text" ref="eLoadingText"></span>
</div>`;g([te("eLoadingIcon")],ed.prototype,"eLoadingIcon",2);g([te("eLoadingText")],ed.prototype,"eLoadingText",2);var Kb=ed,iC=class sC extends Se{constructor(){super(sC.TEMPLATE)}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>gn(e.eParentOfValue)),gn(e.eParentOfValue,t),e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.getGui().innerText=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");Gi(this.getGui(),t)}setupLoading(){const t=this.gos.getDocument().createElement("div");t.classList.add("ag-skeleton-effect"),this.getGui().appendChild(t);const r=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");Gi(this.getGui(),r)}refresh(e){return!1}destroy(){super.destroy()}};iC.TEMPLATE='<div class="ag-skeleton-container"></div>';var Xb=iC,rC=class oC extends Se{constructor(){super()}destroy(){super.destroy()}init(e){const t=this.gos.get("overlayLoadingTemplate");if(this.setTemplate(t??oC.DEFAULT_LOADING_OVERLAY_TEMPLATE),!t){const s=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=s("loadingOoo","Loading...")})}}};rC.DEFAULT_LOADING_OVERLAY_TEMPLATE='<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>';var qb=rC,nC=class aC extends Se{constructor(){super()}destroy(){super.destroy()}init(e){const t=this.gos.get("overlayNoRowsTemplate");if(this.setTemplate(t??aC.DEFAULT_NO_ROWS_TEMPLATE),!t){const s=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=s("noRowsToShow","No Rows To Show")})}}};nC.DEFAULT_NO_ROWS_TEMPLATE='<span class="ag-overlay-no-rows-center"></span>';var Qb=nC,Zb=class extends Mo{constructor(){super('<div class="ag-tooltip"></div>')}init(i){const{value:e}=i;this.getGui().textContent=Ft(e,!0)}},Jb=class{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" ref="eInput"></ag-input-number-field>'}init(i,e){this.eInput=i,this.params=e,e.max!=null&&i.setMax(e.max),e.min!=null&&i.setMin(e.min),e.precision!=null&&i.setPrecision(e.precision),e.step!=null&&i.setStep(e.step);const t=i.getInputElement();e.preventStepping?i.addManagedListener(t,"keydown",this.preventStepping):e.showStepperButtons&&t.classList.add("ag-number-field-input-stepper")}preventStepping(i){(i.key===k.UP||i.key===k.DOWN)&&i.preventDefault()}getValue(){const i=this.eInput.getValue();if(!K(i)&&!K(this.params.value))return this.params.value;let e=this.params.parseValue(i);if(e==null)return e;if(typeof e=="string"){if(e==="")return null;e=Number(e)}return isNaN(e)?null:e}getStartValue(){return this.params.value}},eS=class extends Ml{constructor(){super(new Jb)}},tS=class{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(i,e){this.eInput=i,this.params=e,e.min!=null&&i.setMin(e.min),e.max!=null&&i.setMax(e.max),e.step!=null&&i.setStep(e.step)}getValue(){const i=this.eInput.getDate();return!K(i)&&!K(this.params.value)?this.params.value:i??null}getStartValue(){const{value:i}=this.params;if(i instanceof Date)return Qi(i,!1)}},iS=class extends Ml{constructor(){super(new tS)}},sS=class{constructor(i){this.getDataTypeService=i}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(i,e){this.eInput=i,this.params=e,e.min!=null&&i.setMin(e.min),e.max!=null&&i.setMax(e.max),e.step!=null&&i.setStep(e.step)}getValue(){const i=this.formatDate(this.eInput.getDate());return!K(i)&&!K(this.params.value)?this.params.value:this.params.parseValue(i??"")}getStartValue(){var i,e;return Qi((e=this.parseDate((i=this.params.value)!=null?i:void 0))!=null?e:null,!1)}parseDate(i){return this.getDataTypeService().getDateParserFunction(this.params.column)(i)}formatDate(i){return this.getDataTypeService().getDateFormatterFunction(this.params.column)(i)}},lC=class extends Ml{constructor(){super(new sS(()=>this.dataTypeService))}};g([R("dataTypeService")],lC.prototype,"dataTypeService",2);var qp=class uC extends Se{constructor(){super(uC.TEMPLATE)}init(e){this.params=e,this.updateCheckbox(e);const t=this.eCheckbox.getInputElement();t.setAttribute("tabindex","-1"),mp(t,"polite"),this.addManagedListener(t,"click",s=>{if(ws(s),this.eCheckbox.isDisabled())return;const r=this.eCheckbox.getValue();this.onCheckboxChanged(r)}),this.addManagedListener(t,"dblclick",s=>{ws(s)}),this.addManagedListener(this.params.eGridCell,"keydown",s=>{if(s.key===k.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===this.gos.getActiveDomElement()&&this.eCheckbox.toggle();const r=this.eCheckbox.getValue();this.onCheckboxChanged(r),s.preventDefault()}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){var t,s,r;let o,n=!0;if(e.node.group&&e.column){const d=e.column.getColId();d.startsWith(pn)?o=e.value==null||e.value===""?void 0:e.value==="true":e.node.aggData&&e.node.aggData[d]!==void 0?o=(t=e.value)!=null?t:void 0:n=!1}else o=(s=e.value)!=null?s:void 0;if(!n){this.eCheckbox.setDisplayed(!1);return}this.eCheckbox.setValue(o);const a=e.disabled!=null?e.disabled:!((r=e.column)!=null&&r.isCellEditable(e.node));this.eCheckbox.setDisabled(a);const l=this.localeService.getLocaleTextFunc(),u=Wh(l,o),h=a?u:`${l("ariaToggleCellValue","Press SPACE to toggle cell value")} (${u})`;this.eCheckbox.setInputAriaLabel(h)}onCheckboxChanged(e){const{column:t,node:s,rowIndex:r,value:o}=this.params,n={type:b.EVENT_CELL_EDITING_STARTED,column:t,colDef:t?.getColDef(),data:s.data,node:s,rowIndex:r,rowPinned:s.rowPinned,value:o};this.eventService.dispatchEvent(n);const a=this.params.node.setDataValue(this.params.column,e,"edit"),l={type:b.EVENT_CELL_EDITING_STOPPED,column:t,colDef:t?.getColDef(),data:s.data,node:s,rowIndex:r,rowPinned:s.rowPinned,value:o,oldValue:o,newValue:e,valueChanged:a};this.eventService.dispatchEvent(l)}};qp.TEMPLATE=`
<div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">
<ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>
</div>`;g([te("eCheckbox")],qp.prototype,"eCheckbox",2);var rS=qp,hC=class extends Mo{constructor(){super(`
<div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">
<ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>
</div>`)}init(i){var e;this.params=i;const t=(e=i.value)!=null?e:void 0;this.eCheckbox.setValue(t),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListener(this.eCheckbox,b.EVENT_FIELD_VALUE_CHANGED,r=>this.setAriaLabel(r.selected))}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(i){const e=this.localeService.getLocaleTextFunc(),t=Wh(e,i),s=e("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${s} (${t})`)}};g([te("eCheckbox")],hC.prototype,"eCheckbox",2);var oS=class extends Se{constructor(){super(),this.setTemplate("<div></div>")}init(i){var e;this.params=i,this.cssClassPrefix=(e=this.params.cssClassPrefix)!=null?e:"ag-menu-option",this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addIcon(){if(this.params.isCompact)return;const i=Ri(`<span ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`);this.params.checked?i.appendChild(dt("check",this.gos)):this.params.icon&&(xl(this.params.icon)?i.appendChild(this.params.icon):typeof this.params.icon=="string"?i.innerHTML=this.params.icon:console.warn("AG Grid: menu item icon must be DOM node or string")),this.getGui().appendChild(i)}addName(){const i=Ri(`<span ref="eName" class="${this.getClassName("part")} ${this.getClassName("text")}">${this.params.name||""}</span>`);this.getGui().appendChild(i)}addShortcut(){if(this.params.isCompact)return;const i=Ri(`<span ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(i)}addSubMenu(){const i=Ri(`<span ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`),e=this.getGui();if(this.params.subMenu){const t=this.gos.get("enableRtl")?"smallLeft":"smallRight";Xs(e,!1),i.appendChild(dt(t,this.gos))}e.appendChild(i)}getClassName(i){return`${this.cssClassPrefix}-${i}`}destroy(){super.destroy()}},rh=class extends Z{constructor(){super(...arguments),this.agGridDefaults={agDateInput:kv,agColumnHeader:Hc,agColumnGroupHeader:jb,agSortIndicator:$p,agTextColumnFloatingFilter:Wb,agNumberColumnFloatingFilter:Bb,agDateColumnFloatingFilter:Qh,agReadOnlyFloatingFilter:Hp,agAnimateShowChangeCellRenderer:Kv,agAnimateSlideCellRenderer:Xv,agGroupCellRenderer:$g,agGroupRowRenderer:$g,agLoadingCellRenderer:Kb,agSkeletonCellRenderer:Xb,agCheckboxCellRenderer:rS,agCellEditor:Yg,agTextCellEditor:Yg,agNumberCellEditor:eS,agDateCellEditor:iS,agDateStringCellEditor:lC,agSelectCellEditor:Xp,agLargeTextCellEditor:Ub,agCheckboxCellEditor:hC,agTextColumnFilter:Yp,agNumberColumnFilter:Bv,agDateColumnFilter:Nv,agLoadingOverlay:qb,agNoRowsOverlay:Qb,agTooltipComponent:Zb,agMenuItem:oS},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(){const i=this.gos.get("components");i!=null&&si(i,(e,t)=>this.registerJsComponent(e,t))}registerDefaultComponent(i,e){if(this.agGridDefaults[i]){console.error("Trying to overwrite a default component. You should call registerComponent");return}this.agGridDefaults[i]=e}registerJsComponent(i,e){this.jsComps[i]=e}retrieve(i,e){const t=(a,l)=>({componentFromFramework:l,component:a}),s=this.getFrameworkOverrides().frameworkComponent(e,this.gos.get("components"));if(s!=null)return t(s,!0);const r=this.jsComps[e];if(r){const a=this.getFrameworkOverrides().isFrameworkComponent(r);return t(r,a)}const o=this.agGridDefaults[e];if(o)return t(o,!1);const n=this.enterpriseAgDefaultCompsModule[e];return n?ze.__assertRegistered(n,`AG Grid '${i}' component: ${e}`,this.context.getGridId()):cn(()=>{this.warnAboutMissingComponent(i,e)},"MissingComp"+e),null}warnAboutMissingComponent(i,e){const t=[...Object.keys(this.agGridDefaults).filter(r=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(r)),...Object.keys(this.jsComps)],s=Rl(e,t,!0,.8).values;console.warn(`AG Grid: Could not find '${e}' component. It was configured as "${i}: '${e}'" 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/")}`)}};g([J],rh.prototype,"init",1);rh=g([le("userComponentRegistry")],rh);var nS={propertyName:"dateComponent",cellRenderer:!1},aS={propertyName:"headerComponent",cellRenderer:!1},lS={propertyName:"headerGroupComponent",cellRenderer:!1},Kg={propertyName:"cellRenderer",cellRenderer:!0},uS={propertyName:"loadingCellRenderer",cellRenderer:!0},hS={propertyName:"cellEditor",cellRenderer:!1},Xg={propertyName:"innerRenderer",cellRenderer:!0},dS={propertyName:"loadingOverlayComponent",cellRenderer:!1},cS={propertyName:"noRowsOverlayComponent",cellRenderer:!1},pS={propertyName:"tooltipComponent",cellRenderer:!1},Bc={propertyName:"filter",cellRenderer:!1},gS={propertyName:"floatingFilterComponent",cellRenderer:!1},fS={propertyName:"toolPanel",cellRenderer:!1},mS={propertyName:"statusPanel",cellRenderer:!1},vS={propertyName:"fullWidthCellRenderer",cellRenderer:!0},CS={propertyName:"loadingCellRenderer",cellRenderer:!0},yS={propertyName:"groupRowRenderer",cellRenderer:!0},wS={propertyName:"detailCellRenderer",cellRenderer:!0},bS={propertyName:"menuItem",cellRenderer:!1},dC=class{static getFloatingFilterType(i){return this.filterToFloatingFilterMapping[i]}};dC.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 yr=class extends Z{getHeaderCompDetails(i,e){return this.getCompDetails(i,aS,"agColumnHeader",e)}getHeaderGroupCompDetails(i){const e=i.columnGroup.getColGroupDef();return this.getCompDetails(e,lS,"agColumnGroupHeader",i)}getFullWidthCellRendererDetails(i){return this.getCompDetails(this.gridOptions,vS,null,i,!0)}getFullWidthLoadingCellRendererDetails(i){return this.getCompDetails(this.gridOptions,CS,"agLoadingCellRenderer",i,!0)}getFullWidthGroupCellRendererDetails(i){return this.getCompDetails(this.gridOptions,yS,"agGroupRowRenderer",i,!0)}getFullWidthDetailCellRendererDetails(i){return this.getCompDetails(this.gridOptions,wS,"agDetailCellRenderer",i,!0)}getInnerRendererDetails(i,e){return this.getCompDetails(i,Xg,null,e)}getFullWidthGroupRowInnerCellRenderer(i,e){return this.getCompDetails(i,Xg,null,e)}getCellRendererDetails(i,e){return this.getCompDetails(i,Kg,null,e)}getLoadingCellRendererDetails(i,e){return this.getCompDetails(i,uS,"agSkeletonCellRenderer",e,!0)}getCellEditorDetails(i,e){return this.getCompDetails(i,hS,"agCellEditor",e,!0)}getFilterDetails(i,e,t){return this.getCompDetails(i,Bc,t,e,!0)}getDateCompDetails(i){return this.getCompDetails(this.gridOptions,nS,"agDateInput",i,!0)}getLoadingOverlayCompDetails(i){return this.getCompDetails(this.gridOptions,dS,"agLoadingOverlay",i,!0)}getNoRowsOverlayCompDetails(i){return this.getCompDetails(this.gridOptions,cS,"agNoRowsOverlay",i,!0)}getTooltipCompDetails(i){return this.getCompDetails(i.colDef,pS,"agTooltipComponent",i,!0)}getSetFilterCellRendererDetails(i,e){return this.getCompDetails(i,Kg,null,e)}getFloatingFilterCompDetails(i,e,t){return this.getCompDetails(i,gS,t,e)}getToolPanelCompDetails(i,e){return this.getCompDetails(i,fS,null,e,!0)}getStatusPanelCompDetails(i,e){return this.getCompDetails(i,mS,null,e,!0)}getMenuItemCompDetails(i,e){return this.getCompDetails(i,bS,"agMenuItem",e,!0)}getCompDetails(i,e,t,s,r=!1){const{propertyName:o,cellRenderer:n}=e;let{compName:a,jsComp:l,fwComp:u,paramsFromSelector:h,popupFromSelector:d,popupPositionFromSelector:c}=this.getCompKeys(i,e,s);const p=_=>{const P=this.userComponentRegistry.retrieve(o,_);P&&(l=P.componentFromFramework?void 0:P.component,u=P.componentFromFramework?P.component:void 0)};if(a!=null&&p(a),l==null&&u==null&&t!=null&&p(t),l&&n&&!this.agComponentUtils.doesImplementIComponent(l)&&(l=this.agComponentUtils.adaptFunction(o,l)),!l&&!u){r&&console.error(`AG Grid: Could not find component ${a}, did you forget to configure this component?`);return}const y=this.mergeParamsWithApplicationProvidedParams(i,e,s,h),f=l==null,w=l||u;return{componentFromFramework:f,componentClass:w,params:y,type:e,popupFromSelector:d,popupPositionFromSelector:c,newAgStackInstance:()=>this.newAgStackInstance(w,f,y,e)}}getCompKeys(i,e,t){const{propertyName:s}=e;let r,o,n,a,l,u;if(i){const h=i,d=h[s+"Selector"],c=d?d(t):null,p=y=>{typeof y=="string"?r=y:y!=null&&y!==!0&&(this.getFrameworkOverrides().isFrameworkComponent(y)?n=y:o=y)};c?(p(c.component),a=c.params,l=c.popup,u=c.popupPosition):p(h[s])}return{compName:r,jsComp:o,fwComp:n,paramsFromSelector:a,popupFromSelector:l,popupPositionFromSelector:u}}newAgStackInstance(i,e,t,s){const r=s.propertyName,o=!e;let n;if(o)n=new i;else{const l=this.componentMetadataProvider.retrieve(r);n=this.frameworkComponentWrapper.wrap(i,l.mandatoryMethodList,l.optionalMethodList,s)}const a=this.initComponent(n,t);return a==null?Lt.resolve(n):a.then(()=>n)}mergeParamsWithApplicationProvidedParams(i,e,t,s=null){const r=this.gos.getGridCommonParams();Ei(r,t);const o=i,n=o&&o[e.propertyName+"Params"];if(typeof n=="function"){const a=n(t);Ei(r,a)}else typeof n=="object"&&Ei(r,n);return Ei(r,s),r}initComponent(i,e){if(this.context.createBean(i),i.init!=null)return i.init(e)}getDefaultFloatingFilterType(i,e){if(i==null)return null;let t=null,{compName:s,jsComp:r,fwComp:o}=this.getCompKeys(i,Bc);return s?t=dC.getFloatingFilterType(s):r==null&&o==null&&i.filter===!0&&(t=e()),t}};g([R("gridOptions")],yr.prototype,"gridOptions",2);g([R("agComponentUtils")],yr.prototype,"agComponentUtils",2);g([R("componentMetadataProvider")],yr.prototype,"componentMetadataProvider",2);g([R("userComponentRegistry")],yr.prototype,"userComponentRegistry",2);g([Ke("frameworkComponentWrapper")],yr.prototype,"frameworkComponentWrapper",2);yr=g([le("userComponentFactory")],yr);var cC=class{constructor(i){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=i.scrollContainer,this.scrollHorizontally=i.scrollAxis.indexOf("x")!==-1,this.scrollVertically=i.scrollAxis.indexOf("y")!==-1,this.scrollByTick=i.scrollByTick!=null?i.scrollByTick:20,i.onScrollCallback&&(this.onScrollCallback=i.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=i.getVerticalPosition,this.setVerticalPosition=i.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=i.getHorizontalPosition,this.setHorizontalPosition=i.setHorizontalPosition),this.shouldSkipVerticalScroll=i.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=i.shouldSkipHorizontalScroll||(()=>!1)}check(i,e=!1){const t=e||this.shouldSkipVerticalScroll();if(t&&this.shouldSkipHorizontalScroll())return;const s=this.scrollContainer.getBoundingClientRect(),r=this.scrollByTick;this.tickLeft=i.clientX<s.left+r,this.tickRight=i.clientX>s.right-r,this.tickUp=i.clientY<s.top+r&&!t,this.tickDown=i.clientY>s.bottom-r&&!t,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){this.tickingInterval===null&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;let i;if(i=this.tickCount>20?200:this.tickCount>10?80:40,this.scrollVertically){const e=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(e-i),this.tickDown&&this.setVerticalPosition(e+i)}if(this.scrollHorizontally){const e=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(e-i),this.tickRight&&this.setHorizontalPosition(e+i)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Bi=class extends Z{constructor(i){super(),this.eContainer=i}postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(i=>{const e=i.gridBodyCtrl;this.autoScrollService=new cC({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(i){return i===2}getIconName(){return this.gos.get("rowDragManaged")&&this.shouldPreventRowMove()?Re.ICON_NOT_ALLOWED:Re.ICON_MOVE}shouldPreventRowMove(){return!!(this.columnModel.getRowGroupColumns().length||this.filterManager.isAnyFilterPresent()||this.sortController.isSortActive())}getRowNodes(i){if(!this.isFromThisGrid(i))return i.dragItem.rowNodes||[];const e=i.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const s=[...this.selectionService.getSelectedNodes()].sort((r,o)=>r.rowIndex==null||o.rowIndex==null?0:this.getRowIndexNumber(r)-this.getRowIndexNumber(o));if(s.indexOf(e)!==-1)return s}return[e]}onDragEnter(i){i.dragItem.rowNodes=this.getRowNodes(i),this.dispatchGridEvent(b.EVENT_ROW_DRAG_ENTER,i),this.getRowNodes(i).forEach(e=>{e.setDragging(!0)}),this.onEnterOrDragging(i)}onDragging(i){this.onEnterOrDragging(i)}isFromThisGrid(i){const{dragSourceDomDataKey:e}=i.dragSource;return e===this.gos.getDomDataKey()}isDropZoneWithinThisGrid(i){const t=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:s}=i;return!t.contains(s)}onEnterOrDragging(i){this.dispatchGridEvent(b.EVENT_ROW_DRAG_MOVE,i),this.lastDraggingEvent=i;const e=this.mouseEventService.getNormalisedPosition(i).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(i,e),this.autoScrollService.check(i.event)}doManagedDrag(i,e){const t=this.isFromThisGrid(i),s=this.gos.get("rowDragManaged"),r=i.dragItem.rowNodes;s&&this.shouldPreventRowMove()||(this.gos.get("suppressMoveWhenRowDragging")||!t?this.isDropZoneWithinThisGrid(i)||this.clientSideRowModel.highlightRowAtPixel(r[0],e):this.moveRows(r,e))}getRowIndexNumber(i){return parseInt(We(i.getRowIndexString().split("-")),10)}moveRowAndClearHighlight(i){const e=this.clientSideRowModel.getLastHighlightedRowNode(),t=e&&e.highlighted===1,s=this.mouseEventService.getNormalisedPosition(i).y,r=i.dragItem.rowNodes;let o=t?1:0;if(this.isFromThisGrid(i))r.forEach(n=>{n.rowTop<s&&(o-=1)}),this.moveRows(r,s,o);else{const n=this.gos.getCallback("getRowId");let a=this.clientSideRowModel.getRowIndexAtPixel(s)+1;this.clientSideRowModel.getHighlightPosition(s)===0&&a--,this.clientSideRowModel.updateRowData({add:r.map(l=>l.data).filter(l=>!this.clientSideRowModel.getRowNode(n?n({data:l,level:0}):l.id)),addIndex:a})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(i,e,t=0){var s;this.clientSideRowModel.ensureRowsAtPixel(i,e,t)&&(this.focusService.clearFocusedCell(),(s=this.rangeService)==null||s.removeAllCellRanges())}addRowDropZone(i){if(!i.getContainer()){fe("addRowDropZone - A container target needs to be provided");return}if(this.dragAndDropService.findExternalZone(i)){console.warn("AG Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");return}let e={getContainer:i.getContainer};i.fromGrid?e=i:(i.onDragEnter&&(e.onDragEnter=t=>{i.onDragEnter(this.draggingToRowDragEvent(b.EVENT_ROW_DRAG_ENTER,t))}),i.onDragLeave&&(e.onDragLeave=t=>{i.onDragLeave(this.draggingToRowDragEvent(b.EVENT_ROW_DRAG_LEAVE,t))}),i.onDragging&&(e.onDragging=t=>{i.onDragging(this.draggingToRowDragEvent(b.EVENT_ROW_DRAG_MOVE,t))}),i.onDragStop&&(e.onDragStop=t=>{i.onDragStop(this.draggingToRowDragEvent(b.EVENT_ROW_DRAG_END,t))})),this.dragAndDropService.addDropTarget(de({isInterestedIn:t=>t===2,getIconName:()=>Re.ICON_MOVE,external:!0},e))}getRowDropZone(i){const e=this.getContainer.bind(this),t=this.onDragEnter.bind(this),s=this.onDragLeave.bind(this),r=this.onDragging.bind(this),o=this.onDragStop.bind(this);return i?{getContainer:e,onDragEnter:i.onDragEnter?n=>{t(n),i.onDragEnter(this.draggingToRowDragEvent(b.EVENT_ROW_DRAG_ENTER,n))}:t,onDragLeave:i.onDragLeave?n=>{s(n),i.onDragLeave(this.draggingToRowDragEvent(b.EVENT_ROW_DRAG_LEAVE,n))}:s,onDragging:i.onDragging?n=>{r(n),i.onDragging(this.draggingToRowDragEvent(b.EVENT_ROW_DRAG_MOVE,n))}:r,onDragStop:i.onDragStop?n=>{o(n),i.onDragStop(this.draggingToRowDragEvent(b.EVENT_ROW_DRAG_END,n))}:o,fromGrid:!0}:{getContainer:e,onDragEnter:t,onDragLeave:s,onDragging:r,onDragStop:o,fromGrid:!0}}draggingToRowDragEvent(i,e){const t=this.mouseEventService.getNormalisedPosition(e).y,s=t>this.paginationProxy.getCurrentPageHeight();let r=-1,o;s||(r=this.rowModel.getRowIndexAtPixel(t),o=this.rowModel.getRow(r));let n;switch(e.vDirection){case 1:n="down";break;case 0:n="up";break;default:n=null;break}return this.gos.addGridCommonParams({type:i,event:e.event,node:e.dragItem.rowNode,nodes:e.dragItem.rowNodes,overIndex:r,overNode:o,y:t,vDirection:n})}dispatchGridEvent(i,e){const t=this.draggingToRowDragEvent(i,e);this.eventService.dispatchEvent(t)}onDragLeave(i){this.dispatchGridEvent(b.EVENT_ROW_DRAG_LEAVE,i),this.stopDragging(i),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(i){this.dispatchGridEvent(b.EVENT_ROW_DRAG_END,i),this.stopDragging(i),this.gos.get("rowDragManaged")&&(this.gos.get("suppressMoveWhenRowDragging")||!this.isFromThisGrid(i))&&!this.isDropZoneWithinThisGrid(i)&&this.moveRowAndClearHighlight(i)}stopDragging(i){this.autoScrollService.ensureCleared(),this.getRowNodes(i).forEach(e=>{e.setDragging(!1)})}};g([R("dragAndDropService")],Bi.prototype,"dragAndDropService",2);g([R("rowModel")],Bi.prototype,"rowModel",2);g([R("paginationProxy")],Bi.prototype,"paginationProxy",2);g([R("columnModel")],Bi.prototype,"columnModel",2);g([R("focusService")],Bi.prototype,"focusService",2);g([R("sortController")],Bi.prototype,"sortController",2);g([R("filterManager")],Bi.prototype,"filterManager",2);g([R("selectionService")],Bi.prototype,"selectionService",2);g([R("mouseEventService")],Bi.prototype,"mouseEventService",2);g([R("ctrlsService")],Bi.prototype,"ctrlsService",2);g([Ke("rangeService")],Bi.prototype,"rangeService",2);g([J],Bi.prototype,"postConstruct",1);var Ua=class extends Z{constructor(){super(...arguments),this.dragEndFunctions=[],this.dragSources=[]}removeAllListeners(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0}removeListener(i){const e=i.dragSource.eElement,t=i.mouseDownListener;if(e.removeEventListener("mousedown",t),i.touchEnabled){const s=i.touchStartListener;e.removeEventListener("touchstart",s,{passive:!0})}}removeDragSource(i){const e=this.dragSources.find(t=>t.dragSource===i);e&&(this.removeListener(e),_i(this.dragSources,e))}isDragging(){return this.dragging}addDragSource(i){const e=this.onMouseDown.bind(this,i),{eElement:t,includeTouch:s,stopPropagationForTouch:r}=i;t.addEventListener("mousedown",e);let o=null;const n=this.gos.get("suppressTouch");s&&!n&&(o=a=>{Tp(a.target)||(a.cancelable&&(a.preventDefault(),r&&a.stopPropagation()),this.onTouchStart(i,a))},t.addEventListener("touchstart",o,{passive:!1})),this.dragSources.push({dragSource:i,mouseDownListener:e,touchStartListener:o,touchEnabled:!!s})}getStartTarget(){return this.startTarget}onTouchStart(i,e){this.currentDragParams=i,this.dragging=!1;const t=e.touches[0];this.touchLastTime=t,this.touchStart=t;const s=l=>this.onTouchMove(l,i.eElement),r=l=>this.onTouchUp(l,i.eElement),o=l=>{l.cancelable&&l.preventDefault()},n=e.target,a=[{target:this.gos.getRootNode(),type:"touchmove",listener:o,options:{passive:!1}},{target:n,type:"touchmove",listener:s,options:{passive:!0}},{target:n,type:"touchend",listener:r,options:{passive:!0}},{target:n,type:"touchcancel",listener:r,options:{passive:!0}}];this.addTemporaryEvents(a),i.dragStartPixels===0&&this.onCommonMove(t,this.touchStart,i.eElement)}onMouseDown(i,e){const t=e;if(i.skipMouseEvent&&i.skipMouseEvent(e)||t._alreadyProcessedByDragService||(t._alreadyProcessedByDragService=!0,e.button!==0))return;this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.currentDragParams=i,this.dragging=!1,this.mouseStartEvent=e,this.startTarget=e.target;const s=l=>this.onMouseMove(l,i.eElement),r=l=>this.onMouseUp(l,i.eElement),o=l=>l.preventDefault(),n=this.gos.getRootNode(),a=[{target:n,type:"mousemove",listener:s},{target:n,type:"mouseup",listener:r},{target:n,type:"contextmenu",listener:o}];this.addTemporaryEvents(a),i.dragStartPixels===0&&this.onMouseMove(e,i.eElement)}addTemporaryEvents(i){i.forEach(e=>{const{target:t,type:s,listener:r,options:o}=e;t.addEventListener(s,r,o)}),this.dragEndFunctions.push(()=>{i.forEach(e=>{const{target:t,type:s,listener:r,options:o}=e;t.removeEventListener(s,r,o)})})}isEventNearStartEvent(i,e){const{dragStartPixels:t}=this.currentDragParams,s=K(t)?t:4;return Gp(i,e,s)}getFirstActiveTouch(i){for(let e=0;e<i.length;e++)if(i[e].identifier===this.touchStart.identifier)return i[e];return null}onCommonMove(i,e,t){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(i,e))return;this.dragging=!0;const s={type:b.EVENT_DRAG_STARTED,target:t};this.eventService.dispatchEvent(s),this.currentDragParams.onDragStart(e),this.currentDragParams.onDragging(e)}this.currentDragParams.onDragging(i)}onTouchMove(i,e){const t=this.getFirstActiveTouch(i.touches);t&&this.onCommonMove(t,this.touchStart,e)}onMouseMove(i,e){var t;Os()&&((t=this.gos.getDocument().getSelection())==null||t.removeAllRanges()),this.shouldPreventMouseEvent(i)&&i.preventDefault(),this.onCommonMove(i,this.mouseStartEvent,e)}shouldPreventMouseEvent(i){const e=this.gos.get("enableCellTextSelection"),t=i.type==="mousemove";return e&&t&&i.cancelable&&this.mouseEventService.isEventFromThisGrid(i)&&!this.isOverFormFieldElement(i)}isOverFormFieldElement(i){const e=i.target,t=e?.tagName.toLocaleLowerCase();return!!t?.match("^a$|textarea|input|select|button")}onTouchUp(i,e){let t=this.getFirstActiveTouch(i.changedTouches);t||(t=this.touchLastTime),this.onUpCommon(t,e)}onMouseUp(i,e){this.onUpCommon(i,e)}onUpCommon(i,e){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(i);const t={type:b.EVENT_DRAG_STOPPED,target:e};this.eventService.dispatchEvent(t)}this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach(t=>t()),this.dragEndFunctions.length=0}};g([R("mouseEventService")],Ua.prototype,"mouseEventService",2);g([vi],Ua.prototype,"removeAllListeners",1);Ua=g([le("dragService")],Ua);var Qd="ag-list-item-hovered",pC=class extends Z{constructor(i,e,t){super(),this.comp=i,this.virtualList=e,this.params=t,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(i){this.currentDragValue=this.params.getCurrentDragValue(i),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){const i={isInterestedIn:e=>e===this.params.dragSourceType,getIconName:()=>this.moveBlocked?Re.ICON_PINNED:Re.ICON_MOVE,getContainer:()=>this.comp.getGui(),onDragging:e=>this.onDragging(e),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave()};this.dragAndDropService.addDropTarget(i)}createAutoScrollService(){const i=this.virtualList.getGui();this.autoScrollService=new cC({scrollContainer:i,scrollAxis:"y",getVerticalPosition:()=>i.scrollTop,setVerticalPosition:e=>i.scrollTop=e})}onDragging(i){if(!this.currentDragValue||this.moveBlocked)return;const e=this.getListDragItem(i),t=this.virtualList.getComponentAt(e.rowIndex);if(!t)return;const s=t.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===e.rowIndex&&this.lastHoveredListItem.position===e.position||(this.autoScrollService.check(i.event),this.clearHoveredItems(),this.lastHoveredListItem=e,kc(s,Qd),kc(s,`ag-item-highlight-${e.position}`))}getListDragItem(i){const e=this.virtualList.getGui(),t=parseFloat(window.getComputedStyle(e).paddingTop),s=this.virtualList.getRowHeight(),r=this.virtualList.getScrollTop(),o=Math.max(0,(i.y-t+r)/s),n=this.params.getNumRows(this.comp)-1,a=Math.min(n,o)|0;return{rowIndex:a,position:Math.round(o)>o||o>n?"bottom":"top",component:this.virtualList.getComponentAt(a)}}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(`.${Qd}`).forEach(e=>{[Qd,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach(t=>{e.classList.remove(t)})}),this.lastHoveredListItem=null}};g([R("dragAndDropService")],pC.prototype,"dragAndDropService",2);g([J],pC.prototype,"postConstruct",1);function Jr(i){const e=i;return e!=null&&e.getFrameworkComponentInstance!=null?e.getFrameworkComponentInstance():i}var Ne=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;break}this.ctrlsService.whenReady(i=>{this.gridBodyCtrl=i.gridBodyCtrl})}__getAlignedGridService(){return this.alignedGridsService}getGridId(){return this.context.getGridId()}addDetailGridInfo(i,e){this.detailGridInfoMap[i]=e}removeDetailGridInfo(i){delete this.detailGridInfoMap[i]}getDetailGridInfo(i){return this.detailGridInfoMap[i]}forEachDetailGridInfo(i){let e=0;si(this.detailGridInfoMap,(t,s)=>{K(s)&&(i(s,e),e++)})}getDataAsCsv(i){if(ze.__assertRegistered("@ag-grid-community/csv-export","api.getDataAsCsv",this.context.getGridId()))return this.csvCreator.getDataAsCsv(i)}exportDataAsCsv(i){ze.__assertRegistered("@ag-grid-community/csv-export","api.exportDataAsCsv",this.context.getGridId())&&this.csvCreator.exportDataAsCsv(i)}assertNotExcelMultiSheet(i,e){return ze.__assertRegistered("@ag-grid-enterprise/excel-export","api."+i,this.context.getGridId())?this.excelCreator.getFactoryMode()===1?(console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'"),!1):!0:!1}getDataAsExcel(i){if(this.assertNotExcelMultiSheet("getDataAsExcel",i))return this.excelCreator.getDataAsExcel(i)}exportDataAsExcel(i){this.assertNotExcelMultiSheet("exportDataAsExcel",i)&&this.excelCreator.exportDataAsExcel(i)}getSheetDataForExcel(i){if(ze.__assertRegistered("@ag-grid-enterprise/excel-export","api.getSheetDataForExcel",this.context.getGridId()))return this.excelCreator.setFactoryMode(1),this.excelCreator.getSheetDataForExcel(i)}getMultipleSheetsAsExcel(i){if(ze.__assertRegistered("@ag-grid-enterprise/excel-export","api.getMultipleSheetsAsExcel",this.context.getGridId()))return this.excelCreator.getMultipleSheetsAsExcel(i)}exportMultipleSheetsAsExcel(i){ze.__assertRegistered("@ag-grid-enterprise/excel-export","api.exportMultipleSheetsAsExcel",this.context.getGridId())&&this.excelCreator.exportMultipleSheetsAsExcel(i)}setGridAriaProperty(i,e){if(!i)return;const t=this.ctrlsService.getGridBodyCtrl().getGui(),s=`aria-${i}`;e===null?t.removeAttribute(s):t.setAttribute(s,e)}logMissingRowModel(i,...e){console.error(`AG Grid: api.${i} can only be called when gridOptions.rowModelType is ${e.join(" or ")}`)}logDeprecation(i,e,t,s){fe(`Since ${i} api.${e} is deprecated. Please use ${t} instead. ${s??""}`)}getPinnedTopRowCount(){return this.pinnedRowModel.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.pinnedRowModel.getPinnedBottomRowCount()}getPinnedTopRow(i){return this.pinnedRowModel.getPinnedTopRow(i)}getPinnedBottomRow(i){return this.pinnedRowModel.getPinnedBottomRow(i)}expireValueCache(){this.valueCache.expire()}getVerticalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getVScrollPosition()}getHorizontalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getHScrollPosition()}refreshCells(i={}){this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.refreshCells(i))}flashCells(i={}){const e=t=>fe(`Since v31.1 api.flashCells parameter '${t}Delay' is deprecated. Please use '${t}Duration' instead.`);K(i.fadeDelay)&&e("fade"),K(i.flashDelay)&&e("flash"),this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.flashCells(i))}redrawRows(i={}){const e=i?i.rowNodes:void 0;this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.redrawRows(e))}refreshHeader(){this.frameworkOverrides.wrapIncoming(()=>this.ctrlsService.getHeaderRowContainerCtrls().forEach(i=>i.refresh()))}isAnyFilterPresent(){return this.filterManager.isAnyFilterPresent()}isColumnFilterPresent(){return this.filterManager.isColumnFilterPresent()||this.filterManager.isAggregateFilterPresent()}isQuickFilterPresent(){return this.filterManager.isQuickFilterPresent()}getModel(){return fe("Since v31.1 getModel() is deprecated. Please use the appropriate grid API methods instead."),this.rowModel}setRowNodeExpanded(i,e,t,s){this.expansionService.setRowNodeExpanded(i,e,t,s)}onGroupExpandedOrCollapsed(){if(be(this.clientSideRowModel)){this.logMissingRowModel("onGroupExpandedOrCollapsed","clientSide");return}this.expansionService.onGroupExpandedOrCollapsed()}refreshClientSideRowModel(i){if(be(this.clientSideRowModel)){this.logMissingRowModel("refreshClientSideRowModel","clientSide");return}this.clientSideRowModel.refreshModel(i)}isAnimationFrameQueueEmpty(){return this.animationFrameService.isQueueEmpty()}flushAllAnimationFrames(){this.animationFrameService.flushAllFrames()}getRowNode(i){return this.rowModel.getRowNode(i)}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(i,e,t){this.rowRenderer.addRenderedRowListener(i,e,t)}getQuickFilter(){return this.gos.get("quickFilterText")}getAdvancedFilterModel(){return ze.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.getAdvancedFilterModel",this.context.getGridId())?this.filterManager.getAdvancedFilterModel():null}setAdvancedFilterModel(i){this.filterManager.setAdvancedFilterModel(i)}showAdvancedFilterBuilder(){ze.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.setAdvancedFilterModel",this.context.getGridId())&&this.filterManager.showAdvancedFilterBuilder("api")}setNodesSelected(i){if(!i.nodes.every(n=>n.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),!1):n.id===void 0?(console.warn("AG Grid: cannot select node until id for node is known"),!1):!0))return;const{nodes:t,source:s,newValue:r}=i,o=t;this.selectionService.setNodesSelected({nodes:o,source:s??"api",newValue:r})}selectAll(i="apiSelectAll"){this.selectionService.selectAllRowNodes({source:i})}deselectAll(i="apiSelectAll"){this.selectionService.deselectAllRowNodes({source:i})}selectAllFiltered(i="apiSelectAllFiltered"){this.selectionService.selectAllRowNodes({source:i,justFiltered:!0})}deselectAllFiltered(i="apiSelectAllFiltered"){this.selectionService.deselectAllRowNodes({source:i,justFiltered:!0})}getServerSideSelectionState(){return be(this.serverSideRowModel)?(this.logMissingRowModel("getServerSideSelectionState","serverSide"),null):this.selectionService.getSelectionState()}setServerSideSelectionState(i){if(be(this.serverSideRowModel)){this.logMissingRowModel("setServerSideSelectionState","serverSide");return}this.selectionService.setSelectionState(i,"api")}selectAllOnCurrentPage(i="apiSelectAllCurrentPage"){this.selectionService.selectAllRowNodes({source:i,justCurrentPage:!0})}deselectAllOnCurrentPage(i="apiSelectAllCurrentPage"){this.selectionService.deselectAllRowNodes({source:i,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(be(this.clientSideRowModel)){this.logMissingRowModel("getBestCostNodeSelection","clientSide");return}return this.selectionService.getBestCostNodeSelection()}getRenderedNodes(){return this.rowRenderer.getRenderedNodes()}ensureColumnVisible(i,e="auto"){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureColumnVisible(i,e),"ensureVisible")}ensureIndexVisible(i,e){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(i,e),"ensureVisible")}ensureNodeVisible(i,e=null){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureNodeVisible(i,e),"ensureVisible")}forEachLeafNode(i){if(be(this.clientSideRowModel)){this.logMissingRowModel("forEachLeafNode","clientSide");return}this.clientSideRowModel.forEachLeafNode(i)}forEachNode(i,e){this.rowModel.forEachNode(i,e)}forEachNodeAfterFilter(i){if(be(this.clientSideRowModel)){this.logMissingRowModel("forEachNodeAfterFilter","clientSide");return}this.clientSideRowModel.forEachNodeAfterFilter(i)}forEachNodeAfterFilterAndSort(i){if(be(this.clientSideRowModel)){this.logMissingRowModel("forEachNodeAfterFilterAndSort","clientSide");return}this.clientSideRowModel.forEachNodeAfterFilterAndSort(i)}getFilterInstance(i,e){return fe("'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(i,e)}getColumnFilterInstance(i){return this.filterManager.getColumnFilterInstance(i)}destroyFilter(i){const e=this.columnModel.getPrimaryColumn(i);if(e)return this.filterManager.destroyFilter(e,"api")}getStatusPanel(i){if(!ze.__assertRegistered("@ag-grid-enterprise/status-bar","api.getStatusPanel",this.context.getGridId()))return;const e=this.statusBarService.getStatusPanel(i);return Jr(e)}getColumnDef(i){const e=this.columnModel.getPrimaryColumn(i);return e?e.getColDef():null}getColumnDefs(){return this.columnModel.getColumnDefs()}onFilterChanged(i="api"){this.filterManager.onFilterChanged({source:i})}onSortChanged(){this.sortController.onSortChanged("api")}setFilterModel(i){this.frameworkOverrides.wrapIncoming(()=>this.filterManager.setFilterModel(i))}getFilterModel(){return this.filterManager.getFilterModel()}getColumnFilterModel(i){return this.filterManager.getColumnFilterModel(i)}setColumnFilterModel(i,e){return this.filterManager.setColumnFilterModel(i,e)}getFocusedCell(){return this.focusService.getFocusedCell()}clearFocusedCell(){return this.focusService.clearFocusedCell()}setFocusedCell(i,e,t){this.focusService.setFocusedCell({rowIndex:i,column:e,rowPinned:t,forceBrowserFocus:!0})}addRowDropZone(i){this.gridBodyCtrl.getRowDragFeature().addRowDropZone(i)}removeRowDropZone(i){const e=this.dragAndDropService.findExternalZone(i);e&&this.dragAndDropService.removeDropTarget(e)}getRowDropZoneParams(i){return this.gridBodyCtrl.getRowDragFeature().getRowDropZone(i)}assertSideBarLoaded(i){return ze.__assertRegistered("@ag-grid-enterprise/side-bar","api."+i,this.context.getGridId())}isSideBarVisible(){return this.assertSideBarLoaded("isSideBarVisible")&&this.sideBarService.getSideBarComp().isDisplayed()}setSideBarVisible(i){this.assertSideBarLoaded("setSideBarVisible")&&this.sideBarService.getSideBarComp().setDisplayed(i)}setSideBarPosition(i){this.assertSideBarLoaded("setSideBarPosition")&&this.sideBarService.getSideBarComp().setSideBarPosition(i)}openToolPanel(i){this.assertSideBarLoaded("openToolPanel")&&this.sideBarService.getSideBarComp().openToolPanel(i,"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(i){if(this.assertSideBarLoaded("getToolPanelInstance")){const e=this.sideBarService.getSideBarComp().getToolPanelInstance(i);return Jr(e)}}getSideBar(){if(this.assertSideBarLoaded("getSideBar"))return this.sideBarService.getSideBarComp().getDef()}resetRowHeights(){if(K(this.clientSideRowModel)){if(this.columnModel.isAutoRowHeightActive()){console.warn("AG Grid: calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");return}this.clientSideRowModel.resetRowHeights()}}setRowCount(i,e){if(this.serverSideRowModel){if(this.columnModel.isRowGroupEmpty()){this.serverSideRowModel.setRowCount(i,e);return}console.error("AG Grid: setRowCount cannot be used while using row grouping.");return}if(this.infiniteRowModel){this.infiniteRowModel.setRowCount(i,e);return}this.logMissingRowModel("setRowCount","infinite","serverSide")}onRowHeightChanged(){this.clientSideRowModel?this.clientSideRowModel.onRowHeightChanged():this.serverSideRowModel&&this.serverSideRowModel.onRowHeightChanged()}getValue(i,e){return this.logDeprecation("31.3","getValue","getCellValue"),this.getCellValue({colKey:i,rowNode:e})}getCellValue(i){var e;const{colKey:t,rowNode:s,useFormatter:r}=i;let o=(e=this.columnModel.getPrimaryColumn(t))!=null?e:this.columnModel.getGridColumn(t);if(be(o))return null;const n=this.valueService.getValue(o,s);if(r){const a=this.valueService.formatValue(o,s,n);return a??Ft(n,!0)}return n}addEventListener(i,e){this.apiEventService.addEventListener(i,e)}addGlobalListener(i){this.apiEventService.addGlobalListener(i)}removeEventListener(i,e){this.apiEventService.removeEventListener(i,e)}removeGlobalListener(i){this.apiEventService.removeGlobalListener(i)}dispatchEvent(i){this.eventService.dispatchEvent(i)}destroy(){var i;const e=`See ${this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}`;if(this.destroyCalled)return;const t={type:b.EVENT_GRID_PRE_DESTROYED,state:this.getState()};this.dispatchEvent(t),this.destroyCalled=!0,(i=this.ctrlsService.get("gridCtrl"))==null||i.destroyGridUi(),this.context.destroy(),this.detailGridInfoMap={},hm(this,["isDestroyed"],e)}isDestroyed(){return this.destroyCalled}resetQuickFilter(){this.filterManager.resetQuickFilterCache()}getCellRanges(){return this.rangeService?this.rangeService.getCellRanges():(ze.__assertRegistered("@ag-grid-enterprise/range-selection","api.getCellRanges",this.context.getGridId()),null)}addCellRange(i){if(this.rangeService){this.rangeService.addCellRange(i);return}ze.__assertRegistered("@ag-grid-enterprise/range-selection","api.addCellRange",this.context.getGridId())}clearRangeSelection(){this.rangeService&&this.rangeService.removeAllCellRanges(),ze.__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(i,e){if(ze.__assertRegistered("@ag-grid-enterprise/charts","api."+i,this.context.getGridId()))return this.frameworkOverrides.wrapIncoming(()=>e())}getChartModels(){return this.assertChart("getChartModels",()=>this.chartService.getChartModels())}getChartRef(i){return this.assertChart("getChartRef",()=>this.chartService.getChartRef(i))}getChartImageDataURL(i){return this.assertChart("getChartImageDataURL",()=>this.chartService.getChartImageDataURL(i))}downloadChart(i){return this.assertChart("downloadChart",()=>this.chartService.downloadChart(i))}openChartToolPanel(i){return this.assertChart("openChartToolPanel",()=>this.chartService.openChartToolPanel(i))}closeChartToolPanel(i){return this.assertChart("closeChartToolPanel",()=>this.chartService.closeChartToolPanel(i.chartId))}createRangeChart(i){return this.assertChart("createRangeChart",()=>this.chartService.createRangeChart(i))}createPivotChart(i){return this.assertChart("createPivotChart",()=>this.chartService.createPivotChart(i))}createCrossFilterChart(i){return this.assertChart("createCrossFilterChart",()=>this.chartService.createCrossFilterChart(i))}updateChart(i){return this.assertChart("updateChart",()=>this.chartService.updateChart(i))}restoreChart(i,e){return this.assertChart("restoreChart",()=>this.chartService.restoreChart(i,e))}assertClipboard(i,e){ze.__assertRegistered("@ag-grid-enterprise/clipboard","api"+i,this.context.getGridId())&&e()}copyToClipboard(i){this.assertClipboard("copyToClipboard",()=>this.clipboardService.copyToClipboard(i))}cutToClipboard(i){this.assertClipboard("cutToClipboard",()=>this.clipboardService.cutToClipboard(i))}copySelectedRowsToClipboard(i){this.assertClipboard("copySelectedRowsToClipboard",()=>this.clipboardService.copySelectedRowsToClipboard(i))}copySelectedRangeToClipboard(i){this.assertClipboard("copySelectedRangeToClipboard",()=>this.clipboardService.copySelectedRangeToClipboard(i))}copySelectedRangeDown(){this.assertClipboard("copySelectedRangeDown",()=>this.clipboardService.copyRangeDown())}pasteFromClipboard(){this.assertClipboard("pasteFromClipboard",()=>this.clipboardService.pasteFromClipboard())}showColumnMenuAfterButtonClick(i,e){fe("'showColumnMenuAfterButtonClick' is deprecated. Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere.");const t=this.columnModel.getGridColumn(i);this.menuService.showColumnMenu({column:t,buttonElement:e,positionBy:"button"})}showColumnMenuAfterMouseClick(i,e){fe("'showColumnMenuAfterMouseClick' is deprecated. Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere.");let t=this.columnModel.getGridColumn(i);if(t||(t=this.columnModel.getPrimaryColumn(i)),!t){console.error(`AG Grid: column '${i}' not found`);return}this.menuService.showColumnMenu({column:t,mouseEvent:e,positionBy:"mouse"})}showContextMenu(i){const{rowNode:e,column:t,value:s,x:r,y:o}=i||{};let{x:n,y:a}=this.menuService.getContextMenuPosition(e,t);r!=null&&(n=r),o!=null&&(a=o),this.menuService.showContextMenu({mouseEvent:new MouseEvent("mousedown",{clientX:n,clientY:a}),rowNode:e,column:t,value:s})}showColumnChooser(i){this.menuService.showColumnChooser({chooserParams:i})}showColumnFilter(i){const e=this.columnModel.getGridColumn(i);if(!e){console.error(`AG Grid: column '${i}' not found`);return}this.menuService.showFilterMenu({column:e,containerType:"columnFilter",positionBy:"auto"})}showColumnMenu(i){const e=this.columnModel.getGridColumn(i);if(!e){console.error(`AG Grid: column '${i}' not found`);return}this.menuService.showColumnMenu({column:e,positionBy:"auto"})}hidePopupMenu(){this.menuService.hidePopupMenu()}hideColumnChooser(){this.menuService.hideColumnChooser()}tabToNextCell(i){return this.navigationService.tabToNextCell(!1,i)}tabToPreviousCell(i){return this.navigationService.tabToNextCell(!0,i)}getCellRendererInstances(i={}){return this.rowRenderer.getCellRendererInstances(i).map(Jr)}getCellEditorInstances(i={}){return this.rowRenderer.getCellEditorInstances(i).map(Jr)}getEditingCells(){return this.rowRenderer.getEditingCells()}stopEditing(i=!1){this.rowRenderer.stopEditing(i)}startEditingCell(i){const e=this.columnModel.getGridColumn(i.colKey);if(!e){console.warn(`AG Grid: no column found for ${i.colKey}`);return}const t={rowIndex:i.rowIndex,rowPinned:i.rowPinned||null,column:e};i.rowPinned==null&&this.ensureIndexVisible(i.rowIndex),this.ensureColumnVisible(i.colKey);const r=this.navigationService.getCellByPosition(t);r&&(this.focusService.isCellFocused(t)||this.focusService.setFocusedCell(t),r.startRowOrCellEdit(i.key))}addAggFunc(i,e){this.logDeprecation("v31.1","addAggFunc(key, func)","addAggFuncs({ key: func })"),this.aggFuncService&&this.aggFuncService.addAggFuncs({key:e})}addAggFuncs(i){this.aggFuncService&&this.aggFuncService.addAggFuncs(i)}clearAggFuncs(){this.aggFuncService&&this.aggFuncService.clear()}applyServerSideTransaction(i){if(!this.serverSideTransactionManager){this.logMissingRowModel("applyServerSideTransaction","serverSide");return}return this.serverSideTransactionManager.applyTransaction(i)}applyServerSideTransactionAsync(i,e){if(!this.serverSideTransactionManager){this.logMissingRowModel("applyServerSideTransactionAsync","serverSide");return}return this.serverSideTransactionManager.applyTransactionAsync(i,e)}applyServerSideRowData(i){var e,t;const s=(e=i.startRow)!=null?e:0,r=(t=i.route)!=null?t:[];if(s<0){console.warn(`AG Grid: invalid value ${i.startRow} for startRow, the value should be >= 0`);return}this.serverSideRowModel?this.serverSideRowModel.applyRowData(i.successParams,s,r):this.logMissingRowModel("setServerSideDatasource","serverSide")}retryServerSideLoads(){if(!this.serverSideRowModel){this.logMissingRowModel("retryServerSideLoads","serverSide");return}this.serverSideRowModel.retryLoads()}flushServerSideAsyncTransactions(){if(!this.serverSideTransactionManager){this.logMissingRowModel("flushServerSideAsyncTransactions","serverSide");return}return this.serverSideTransactionManager.flushAsyncTransactions()}applyTransaction(i){if(!this.clientSideRowModel){this.logMissingRowModel("applyTransaction","clientSide");return}return this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.updateRowData(i))}applyTransactionAsync(i,e){if(!this.clientSideRowModel){this.logMissingRowModel("applyTransactionAsync","clientSide");return}this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.batchUpdateRowData(i,e))}flushAsyncTransactions(){if(!this.clientSideRowModel){this.logMissingRowModel("flushAsyncTransactions","clientSide");return}this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.flushAsyncTransactions())}refreshInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.refreshCache():this.logMissingRowModel("refreshInfiniteCache","infinite")}purgeInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.purgeCache():this.logMissingRowModel("purgeInfiniteCache","infinite")}refreshServerSide(i){if(!this.serverSideRowModel){this.logMissingRowModel("refreshServerSide","serverSide");return}this.serverSideRowModel.refreshStore(i)}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(i){return this.rowModel.getRow(i)}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(i){this.paginationProxy.goToPage(i)}sizeColumnsToFit(i){typeof i=="number"?this.columnModel.sizeColumnsToFit(i,"api"):this.gridBodyCtrl.sizeColumnsToFit(i)}setColumnGroupOpened(i,e){this.columnModel.setColumnGroupOpened(i,e,"api")}getColumnGroup(i,e){return this.columnModel.getColumnGroup(i,e)}getProvidedColumnGroup(i){return this.columnModel.getProvidedColumnGroup(i)}getDisplayNameForColumn(i,e){return this.columnModel.getDisplayNameForColumn(i,e)||""}getDisplayNameForColumnGroup(i,e){return this.columnModel.getDisplayNameForColumnGroup(i,e)||""}getColumn(i){return this.columnModel.getPrimaryColumn(i)}getColumns(){return this.columnModel.getAllPrimaryColumns()}applyColumnState(i){return this.columnModel.applyColumnState(i,"api")}getColumnState(){return this.columnModel.getColumnState()}resetColumnState(){this.columnModel.resetColumnState("api")}getColumnGroupState(){return this.columnModel.getColumnGroupState()}setColumnGroupState(i){this.columnModel.setColumnGroupState(i,"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(i){return this.columnModel.getDisplayedColAfter(i)}getDisplayedColBefore(i){return this.columnModel.getDisplayedColBefore(i)}setColumnVisible(i,e){this.logDeprecation("v31.1","setColumnVisible(key,visible)","setColumnsVisible([key],visible)"),this.columnModel.setColumnsVisible([i],e,"api")}setColumnsVisible(i,e){this.columnModel.setColumnsVisible(i,e,"api")}setColumnPinned(i,e){this.logDeprecation("v31.1","setColumnPinned(key,pinned)","setColumnsPinned([key],pinned)"),this.columnModel.setColumnsPinned([i],e,"api")}setColumnsPinned(i,e){this.columnModel.setColumnsPinned(i,e,"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(i,e){this.logDeprecation("v31.1","moveColumn(key, toIndex)","moveColumns([key], toIndex)"),this.columnModel.moveColumns([i],e,"api")}moveColumnByIndex(i,e){this.columnModel.moveColumnByIndex(i,e,"api")}moveColumns(i,e){this.columnModel.moveColumns(i,e,"api")}moveRowGroupColumn(i,e){this.columnModel.moveRowGroupColumn(i,e,"api")}setColumnAggFunc(i,e){this.columnModel.setColumnAggFunc(i,e,"api")}setColumnWidth(i,e,t=!0,s="api"){this.logDeprecation("v31.1","setColumnWidth(col, width)","setColumnWidths([{key: col, newWidth: width}])"),this.columnModel.setColumnWidths([{key:i,newWidth:e}],!1,t,s)}setColumnWidths(i,e=!0,t="api"){this.columnModel.setColumnWidths(i,!1,e,t)}isPivotMode(){return this.columnModel.isPivotMode()}getPivotResultColumn(i,e){return this.columnModel.getSecondaryPivotColumn(i,e)}setValueColumns(i){this.columnModel.setValueColumns(i,"api")}getValueColumns(){return this.columnModel.getValueColumns()}removeValueColumn(i){this.logDeprecation("v31.1","removeValueColumn(colKey)","removeValueColumns([colKey])"),this.columnModel.removeValueColumns([i],"api")}removeValueColumns(i){this.columnModel.removeValueColumns(i,"api")}addValueColumn(i){this.logDeprecation("v31.1","addValueColumn(colKey)","addValueColumns([colKey])"),this.columnModel.addValueColumns([i],"api")}addValueColumns(i){this.columnModel.addValueColumns(i,"api")}setRowGroupColumns(i){this.columnModel.setRowGroupColumns(i,"api")}removeRowGroupColumn(i){this.logDeprecation("v31.1","removeRowGroupColumn(colKey)","removeRowGroupColumns([colKey])"),this.columnModel.removeRowGroupColumns([i],"api")}removeRowGroupColumns(i){this.columnModel.removeRowGroupColumns(i,"api")}addRowGroupColumn(i){this.logDeprecation("v31.1","addRowGroupColumn(colKey)","addRowGroupColumns([colKey])"),this.columnModel.addRowGroupColumns([i],"api")}addRowGroupColumns(i){this.columnModel.addRowGroupColumns(i,"api")}getRowGroupColumns(){return this.columnModel.getRowGroupColumns()}setPivotColumns(i){this.columnModel.setPivotColumns(i,"api")}removePivotColumn(i){this.logDeprecation("v31.1","removePivotColumn(colKey)","removePivotColumns([colKey])"),this.columnModel.removePivotColumns([i],"api")}removePivotColumns(i){this.columnModel.removePivotColumns(i,"api")}addPivotColumn(i){this.logDeprecation("v31.1","addPivotColumn(colKey)","addPivotColumns([colKey])"),this.columnModel.addPivotColumns([i],"api")}addPivotColumns(i){this.columnModel.addPivotColumns(i,"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(i,e){return this.logDeprecation("v31.1","autoSizeColumn(key, skipHeader)","autoSizeColumns([key], skipHeader)"),this.columnModel.autoSizeColumns({columns:[i],skipHeader:e,source:"api"})}autoSizeColumns(i,e){this.columnModel.autoSizeColumns({columns:i,skipHeader:e,source:"api"})}autoSizeAllColumns(i){this.columnModel.autoSizeAllColumns("api",i)}setPivotResultColumns(i){this.columnModel.setSecondaryColumns(i,"api")}getPivotResultColumns(){return this.columnModel.getSecondaryColumns()}getState(){return this.stateService.getState()}getGridOption(i){return this.gos.get(i)}setGridOption(i,e){this.updateGridOptions({[i]:e})}updateGridOptions(i){this.gos.updateGridOptions({options:i})}__internalUpdateGridOptions(i,e){this.gos.updateGridOptions({options:i,force:e,source:"gridOptionsUpdated"})}deprecatedUpdateGridOption(i,e){fe(`set${i.charAt(0).toUpperCase()}${i.slice(1,i.length)} is deprecated. Please use 'api.setGridOption('${i}', newValue)' or 'api.updateGridOptions({ ${i}: newValue })' instead.`),this.setGridOption(i,e)}setPivotMode(i){this.deprecatedUpdateGridOption("pivotMode",i)}setPinnedTopRowData(i){this.deprecatedUpdateGridOption("pinnedTopRowData",i)}setPinnedBottomRowData(i){this.deprecatedUpdateGridOption("pinnedBottomRowData",i)}setPopupParent(i){this.deprecatedUpdateGridOption("popupParent",i)}setSuppressModelUpdateAfterUpdateTransaction(i){this.deprecatedUpdateGridOption("suppressModelUpdateAfterUpdateTransaction",i)}setDataTypeDefinitions(i){this.deprecatedUpdateGridOption("dataTypeDefinitions",i)}setPagination(i){this.deprecatedUpdateGridOption("pagination",i)}paginationSetPageSize(i){this.deprecatedUpdateGridOption("paginationPageSize",i)}setSideBar(i){this.deprecatedUpdateGridOption("sideBar",i)}setSuppressClipboardPaste(i){this.deprecatedUpdateGridOption("suppressClipboardPaste",i)}setGroupRemoveSingleChildren(i){this.deprecatedUpdateGridOption("groupRemoveSingleChildren",i)}setGroupRemoveLowestSingleChildren(i){this.deprecatedUpdateGridOption("groupRemoveLowestSingleChildren",i)}setGroupDisplayType(i){this.deprecatedUpdateGridOption("groupDisplayType",i)}setGroupIncludeFooter(i){this.deprecatedUpdateGridOption("groupIncludeFooter",i)}setGroupIncludeTotalFooter(i){this.deprecatedUpdateGridOption("groupIncludeTotalFooter",i)}setRowClass(i){this.deprecatedUpdateGridOption("rowClass",i)}setDeltaSort(i){this.deprecatedUpdateGridOption("deltaSort",i)}setSuppressRowDrag(i){this.deprecatedUpdateGridOption("suppressRowDrag",i)}setSuppressMoveWhenRowDragging(i){this.deprecatedUpdateGridOption("suppressMoveWhenRowDragging",i)}setSuppressRowClickSelection(i){this.deprecatedUpdateGridOption("suppressRowClickSelection",i)}setEnableAdvancedFilter(i){this.deprecatedUpdateGridOption("enableAdvancedFilter",i)}setIncludeHiddenColumnsInAdvancedFilter(i){this.deprecatedUpdateGridOption("includeHiddenColumnsInAdvancedFilter",i)}setAdvancedFilterParent(i){this.deprecatedUpdateGridOption("advancedFilterParent",i)}setAdvancedFilterBuilderParams(i){this.deprecatedUpdateGridOption("advancedFilterBuilderParams",i)}setQuickFilter(i){fe("setQuickFilter is deprecated. Please use 'api.setGridOption('quickFilterText', newValue)' or 'api.updateGridOptions({ quickFilterText: newValue })' instead."),this.gos.updateGridOptions({options:{quickFilterText:i}})}setExcludeHiddenColumnsFromQuickFilter(i){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",!i)}setIncludeHiddenColumnsInQuickFilter(i){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",i)}setQuickFilterParser(i){this.deprecatedUpdateGridOption("quickFilterParser",i)}setQuickFilterMatcher(i){this.deprecatedUpdateGridOption("quickFilterMatcher",i)}setAlwaysShowHorizontalScroll(i){this.deprecatedUpdateGridOption("alwaysShowHorizontalScroll",i)}setAlwaysShowVerticalScroll(i){this.deprecatedUpdateGridOption("alwaysShowVerticalScroll",i)}setFunctionsReadOnly(i){this.deprecatedUpdateGridOption("functionsReadOnly",i)}setColumnDefs(i,e="api"){fe("setColumnDefs is deprecated. Please use 'api.setGridOption('columnDefs', newValue)' or 'api.updateGridOptions({ columnDefs: newValue })' instead."),this.gos.updateGridOptions({options:{columnDefs:i},source:e})}setAutoGroupColumnDef(i,e="api"){fe("setAutoGroupColumnDef is deprecated. Please use 'api.setGridOption('autoGroupColumnDef', newValue)' or 'api.updateGridOptions({ autoGroupColumnDef: newValue })' instead."),this.gos.updateGridOptions({options:{autoGroupColumnDef:i},source:e})}setDefaultColDef(i,e="api"){fe("setDefaultColDef is deprecated. Please use 'api.setGridOption('defaultColDef', newValue)' or 'api.updateGridOptions({ defaultColDef: newValue })' instead."),this.gos.updateGridOptions({options:{defaultColDef:i},source:e})}setColumnTypes(i,e="api"){fe("setColumnTypes is deprecated. Please use 'api.setGridOption('columnTypes', newValue)' or 'api.updateGridOptions({ columnTypes: newValue })' instead."),this.gos.updateGridOptions({options:{columnTypes:i},source:e})}setTreeData(i){this.deprecatedUpdateGridOption("treeData",i)}setServerSideDatasource(i){this.deprecatedUpdateGridOption("serverSideDatasource",i)}setCacheBlockSize(i){this.deprecatedUpdateGridOption("cacheBlockSize",i)}setDatasource(i){this.deprecatedUpdateGridOption("datasource",i)}setViewportDatasource(i){this.deprecatedUpdateGridOption("viewportDatasource",i)}setRowData(i){this.deprecatedUpdateGridOption("rowData",i)}setEnableCellTextSelection(i){this.deprecatedUpdateGridOption("enableCellTextSelection",i)}setHeaderHeight(i){this.deprecatedUpdateGridOption("headerHeight",i)}setDomLayout(i){this.deprecatedUpdateGridOption("domLayout",i)}setFillHandleDirection(i){this.deprecatedUpdateGridOption("fillHandleDirection",i)}setGroupHeaderHeight(i){this.deprecatedUpdateGridOption("groupHeaderHeight",i)}setFloatingFiltersHeight(i){this.deprecatedUpdateGridOption("floatingFiltersHeight",i)}setPivotHeaderHeight(i){this.deprecatedUpdateGridOption("pivotHeaderHeight",i)}setPivotGroupHeaderHeight(i){this.deprecatedUpdateGridOption("pivotGroupHeaderHeight",i)}setAnimateRows(i){this.deprecatedUpdateGridOption("animateRows",i)}setIsExternalFilterPresent(i){this.deprecatedUpdateGridOption("isExternalFilterPresent",i)}setDoesExternalFilterPass(i){this.deprecatedUpdateGridOption("doesExternalFilterPass",i)}setNavigateToNextCell(i){this.deprecatedUpdateGridOption("navigateToNextCell",i)}setTabToNextCell(i){this.deprecatedUpdateGridOption("tabToNextCell",i)}setTabToNextHeader(i){this.deprecatedUpdateGridOption("tabToNextHeader",i)}setNavigateToNextHeader(i){this.deprecatedUpdateGridOption("navigateToNextHeader",i)}setRowGroupPanelShow(i){this.deprecatedUpdateGridOption("rowGroupPanelShow",i)}setGetGroupRowAgg(i){this.deprecatedUpdateGridOption("getGroupRowAgg",i)}setGetBusinessKeyForNode(i){this.deprecatedUpdateGridOption("getBusinessKeyForNode",i)}setGetChildCount(i){this.deprecatedUpdateGridOption("getChildCount",i)}setProcessRowPostCreate(i){this.deprecatedUpdateGridOption("processRowPostCreate",i)}setGetRowId(i){fe("getRowId is a static property and can no longer be updated.")}setGetRowClass(i){this.deprecatedUpdateGridOption("getRowClass",i)}setIsFullWidthRow(i){this.deprecatedUpdateGridOption("isFullWidthRow",i)}setIsRowSelectable(i){this.deprecatedUpdateGridOption("isRowSelectable",i)}setIsRowMaster(i){this.deprecatedUpdateGridOption("isRowMaster",i)}setPostSortRows(i){this.deprecatedUpdateGridOption("postSortRows",i)}setGetDocument(i){this.deprecatedUpdateGridOption("getDocument",i)}setGetContextMenuItems(i){this.deprecatedUpdateGridOption("getContextMenuItems",i)}setGetMainMenuItems(i){this.deprecatedUpdateGridOption("getMainMenuItems",i)}setProcessCellForClipboard(i){this.deprecatedUpdateGridOption("processCellForClipboard",i)}setSendToClipboard(i){this.deprecatedUpdateGridOption("sendToClipboard",i)}setProcessCellFromClipboard(i){this.deprecatedUpdateGridOption("processCellFromClipboard",i)}setProcessPivotResultColDef(i){this.deprecatedUpdateGridOption("processPivotResultColDef",i)}setProcessPivotResultColGroupDef(i){this.deprecatedUpdateGridOption("processPivotResultColGroupDef",i)}setPostProcessPopup(i){this.deprecatedUpdateGridOption("postProcessPopup",i)}setInitialGroupOrderComparator(i){this.deprecatedUpdateGridOption("initialGroupOrderComparator",i)}setGetChartToolbarItems(i){this.deprecatedUpdateGridOption("getChartToolbarItems",i)}setPaginationNumberFormatter(i){this.deprecatedUpdateGridOption("paginationNumberFormatter",i)}setGetServerSideGroupLevelParams(i){this.deprecatedUpdateGridOption("getServerSideGroupLevelParams",i)}setIsServerSideGroupOpenByDefault(i){this.deprecatedUpdateGridOption("isServerSideGroupOpenByDefault",i)}setIsApplyServerSideTransaction(i){this.deprecatedUpdateGridOption("isApplyServerSideTransaction",i)}setIsServerSideGroup(i){this.deprecatedUpdateGridOption("isServerSideGroup",i)}setGetServerSideGroupKey(i){this.deprecatedUpdateGridOption("getServerSideGroupKey",i)}setGetRowStyle(i){this.deprecatedUpdateGridOption("getRowStyle",i)}setGetRowHeight(i){this.deprecatedUpdateGridOption("getRowHeight",i)}};g([R("rowRenderer")],Ne.prototype,"rowRenderer",2);g([R("navigationService")],Ne.prototype,"navigationService",2);g([R("filterManager")],Ne.prototype,"filterManager",2);g([R("columnModel")],Ne.prototype,"columnModel",2);g([R("selectionService")],Ne.prototype,"selectionService",2);g([R("gridOptionsService")],Ne.prototype,"gos",2);g([R("valueService")],Ne.prototype,"valueService",2);g([R("alignedGridsService")],Ne.prototype,"alignedGridsService",2);g([R("eventService")],Ne.prototype,"eventService",2);g([R("pinnedRowModel")],Ne.prototype,"pinnedRowModel",2);g([R("context")],Ne.prototype,"context",2);g([R("rowModel")],Ne.prototype,"rowModel",2);g([R("sortController")],Ne.prototype,"sortController",2);g([R("paginationProxy")],Ne.prototype,"paginationProxy",2);g([R("focusService")],Ne.prototype,"focusService",2);g([R("dragAndDropService")],Ne.prototype,"dragAndDropService",2);g([R("menuService")],Ne.prototype,"menuService",2);g([R("valueCache")],Ne.prototype,"valueCache",2);g([R("animationFrameService")],Ne.prototype,"animationFrameService",2);g([R("ctrlsService")],Ne.prototype,"ctrlsService",2);g([R("overlayService")],Ne.prototype,"overlayService",2);g([R("stateService")],Ne.prototype,"stateService",2);g([R("expansionService")],Ne.prototype,"expansionService",2);g([R("apiEventService")],Ne.prototype,"apiEventService",2);g([R("frameworkOverrides")],Ne.prototype,"frameworkOverrides",2);g([R("undoRedoService")],Ne.prototype,"undoRedoService",2);g([R("rowNodeBlockLoader")],Ne.prototype,"rowNodeBlockLoader",2);g([Ke("csvCreator")],Ne.prototype,"csvCreator",2);g([Ke("excelCreator")],Ne.prototype,"excelCreator",2);g([Ke("rangeService")],Ne.prototype,"rangeService",2);g([Ke("clipboardService")],Ne.prototype,"clipboardService",2);g([Ke("aggFuncService")],Ne.prototype,"aggFuncService",2);g([Ke("statusBarService")],Ne.prototype,"statusBarService",2);g([Ke("chartService")],Ne.prototype,"chartService",2);g([Ke("ssrmTransactionManager")],Ne.prototype,"serverSideTransactionManager",2);g([Ke("sideBarService")],Ne.prototype,"sideBarService",2);g([J],Ne.prototype,"init",1);Ne=g([le("gridApi")],Ne);var Di=class extends Z{constructor(){super(...arguments),this.quickFilter=null,this.quickFilterParts=null}postConstruct(){this.addManagedListener(this.eventService,b.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,b.EVENT_NEW_COLUMNS_LOADED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,b.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,b.EVENT_COLUMN_VISIBLE,()=>{this.gos.get("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}),this.addManagedPropertyListener("quickFilterText",i=>this.setQuickFilter(i.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onQuickFilterColumnConfigChanged()),this.quickFilter=this.parseQuickFilter(this.gos.get("quickFilterText")),this.parser=this.gos.get("quickFilterParser"),this.matcher=this.gos.get("quickFilterMatcher"),this.setQuickFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setQuickFilterParserAndMatcher())}isQuickFilterPresent(){return this.quickFilter!==null}doesRowPassQuickFilter(i){const e=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(e,i):this.quickFilterParts.every(t=>e?this.doesRowPassQuickFilterCache(i,t):this.doesRowPassQuickFilterNoCache(i,t))}resetQuickFilterCache(){this.rowModel.forEachNode(i=>i.quickFilterAggregateText=null)}setQuickFilterParts(){const{quickFilter:i,parser:e}=this;i?this.quickFilterParts=e?e(i):i.split(" "):this.quickFilterParts=null}parseQuickFilter(i){return K(i)?this.gos.isRowModelType("clientSide")?i.toUpperCase():(console.warn("AG Grid - Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(i){if(i!=null&&typeof i!="string"){console.warn(`AG Grid - Grid option quickFilterText only supports string inputs, received: ${typeof i}`);return}const e=this.parseQuickFilter(i);this.quickFilter!==e&&(this.quickFilter=e,this.setQuickFilterParts(),this.dispatchEvent({type:Di.EVENT_QUICK_FILTER_CHANGED}))}setQuickFilterParserAndMatcher(){const i=this.gos.get("quickFilterParser"),e=this.gos.get("quickFilterMatcher"),t=i!==this.parser||e!==this.matcher;this.parser=i,this.matcher=e,t&&(this.setQuickFilterParts(),this.dispatchEvent({type:Di.EVENT_QUICK_FILTER_CHANGED}))}onQuickFilterColumnConfigChanged(){this.columnModel.refreshQuickFilterColumns(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchEvent({type:Di.EVENT_QUICK_FILTER_CHANGED})}doesRowPassQuickFilterNoCache(i,e){return this.columnModel.getAllColumnsForQuickFilter().some(s=>{const r=this.getQuickFilterTextForColumn(s,i);return K(r)&&r.indexOf(e)>=0})}doesRowPassQuickFilterCache(i,e){return this.checkGenerateQuickFilterAggregateText(i),i.quickFilterAggregateText.indexOf(e)>=0}doesRowPassQuickFilterMatcher(i,e){let t;i?(this.checkGenerateQuickFilterAggregateText(e),t=e.quickFilterAggregateText):t=this.getQuickFilterAggregateText(e);const{quickFilterParts:s,matcher:r}=this;return r(s,t)}checkGenerateQuickFilterAggregateText(i){i.quickFilterAggregateText||(i.quickFilterAggregateText=this.getQuickFilterAggregateText(i))}getQuickFilterTextForColumn(i,e){let t=this.valueService.getValue(i,e,!0);const s=i.getColDef();if(s.getQuickFilterText){const r=this.gos.addGridCommonParams({value:t,node:e,data:e.data,column:i,colDef:s});t=s.getQuickFilterText(r)}return K(t)?t.toString().toUpperCase():null}getQuickFilterAggregateText(i){const e=[];return this.columnModel.getAllColumnsForQuickFilter().forEach(s=>{const r=this.getQuickFilterTextForColumn(s,i);K(r)&&e.push(r)}),e.join(Di.QUICK_FILTER_SEPARATOR)}};Di.EVENT_QUICK_FILTER_CHANGED="quickFilterChanged";Di.QUICK_FILTER_SEPARATOR=`
`;g([R("valueService")],Di.prototype,"valueService",2);g([R("columnModel")],Di.prototype,"columnModel",2);g([R("rowModel")],Di.prototype,"rowModel",2);g([J],Di.prototype,"postConstruct",1);Di=g([le("quickFilterService")],Di);var Ji=class extends Z{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 i,e,t;this.addManagedListener(this.eventService,b.EVENT_GRID_COLUMNS_CHANGED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,b.EVENT_COLUMN_VALUE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,b.EVENT_COLUMN_PIVOT_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,b.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,b.EVENT_NEW_COLUMNS_LOADED,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,b.EVENT_COLUMN_VISIBLE,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,b.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,b.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,({enabled:s})=>this.onAdvancedFilterEnabledChanged(s)),this.addManagedListener(this.eventService,b.EVENT_DATA_TYPES_INFERRED,()=>this.processFilterModelUpdateQueue()),this.addManagedListener(this.quickFilterService,Di.EVENT_QUICK_FILTER_CHANGED,()=>this.onFilterChanged({source:"quickFilter"})),this.initialFilterModel=de({},(t=(e=(i=this.gos.get("initialState"))==null?void 0:i.filter)==null?void 0:e.filterModel)!=null?t:{})}isExternalFilterPresentCallback(){const i=this.gos.getCallback("isExternalFilterPresent");return typeof i=="function"?i({}):!1}doesExternalFilterPass(i){const e=this.gos.get("doesExternalFilterPass");return typeof e=="function"?e(i):!1}setFilterModel(i,e="api"){if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}if(this.dataTypeService.isPendingInference()){this.filterModelUpdateQueue.push({model:i,source:e});return}const t=[],s=this.getFilterModel();if(i){const r=Vp(Object.keys(i));this.allColumnFilters.forEach((o,n)=>{const a=i[n];t.push(this.setModelOnFilterWrapper(o.filterPromise,a)),r.delete(n)}),r.forEach(o=>{const n=this.columnModel.getPrimaryColumn(o)||this.columnModel.getGridColumn(o);if(!n){console.warn("AG Grid: setFilterModel() - no column found for colId: "+o);return}if(!n.isFilterAllowed()){console.warn("AG Grid: setFilterModel() - unable to fully apply model, filtering disabled for colId: "+o);return}const a=this.getOrCreateFilterWrapper(n,"NO_UI");if(!a){console.warn("AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: "+o);return}t.push(this.setModelOnFilterWrapper(a.filterPromise,i[o]))})}else this.allColumnFilters.forEach(r=>{t.push(this.setModelOnFilterWrapper(r.filterPromise,null))});Lt.all(t).then(()=>{const r=this.getFilterModel(),o=[];this.allColumnFilters.forEach((n,a)=>{const l=s?s[a]:null,u=r?r[a]:null;ye.jsonEquals(l,u)||o.push(n.column)}),o.length>0&&this.onFilterChanged({columns:o,source:e})})}setModelOnFilterWrapper(i,e){return new Lt(t=>{i.then(s=>{typeof s.setModel!="function"&&(console.warn("AG Grid: filter missing setModel method, which is needed for setFilterModel"),t()),(s.setModel(e)||Lt.resolve()).then(()=>t())})})}getFilterModel(){const i={};return this.allColumnFilters.forEach((e,t)=>{const s=this.getModelFromFilterWrapper(e);K(s)&&(i[t]=s)}),i}getModelFromFilterWrapper(i){var e;const s=i.filterPromise.resolveNow(null,r=>r);return s==null?(e=this.initialFilterModel[i.column.getColId()])!=null?e:null:typeof s.getModel!="function"?(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(i){var e;i?this.allColumnFilters.size&&(this.allColumnFilters.forEach(t=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),this.onFilterChanged({source:"advancedFilter"})):(e=this.advancedFilterService)!=null&&e.isFilterPresent()&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){var i;return!!((i=this.advancedFilterService)!=null&&i.isEnabled())}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}doAggregateFiltersPass(i,e){return this.doColumnFiltersPass(i,e,!0)}updateActiveFilters(){this.activeColumnFilters.length=0,this.activeAggregateFilters.length=0;const i=s=>s?s.isFilterActive?s.isFilterActive():(console.warn("AG Grid: Filter is missing isFilterActive() method"),!1):!1,e=!!this.gos.getGroupAggFiltering(),t=s=>{if(!s.isPrimary())return!0;const o=!this.columnModel.isPivotActive();return!s.isValueActive()||!o?!1:this.columnModel.isPivotMode()?!0:e};this.allColumnFilters.forEach(s=>{if(s.filterPromise.resolveNow(!1,i)){const r=s.filterPromise.resolveNow(null,o=>o);t(s.column)?this.activeAggregateFilters.push(r):this.activeColumnFilters.push(r)}})}updateFilterFlagInColumns(i,e){this.allColumnFilters.forEach(t=>{const s=t.filterPromise.resolveNow(!1,r=>r.isFilterActive());t.column.setFilterActive(s,i,e)})}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}doColumnFiltersPass(i,e,t){const{data:s,aggData:r}=i,o=t?this.activeAggregateFilters:this.activeColumnFilters,n=t?r:s;for(let a=0;a<o.length;a++){const l=o[a];if(!(l==null||l===e)){if(typeof l.doesFilterPass!="function")throw new Error("Filter is missing method doesFilterPass");if(!l.doesFilterPass({node:i,data:n}))return!1}}return!0}resetQuickFilterCache(){this.quickFilterService.resetQuickFilterCache()}refreshFiltersForAggregations(){this.gos.getGroupAggFiltering()&&this.onFilterChanged()}callOnFilterChangedOutsideRenderCycle(i){const e=()=>this.onFilterChanged(i);this.rowRenderer.isRefreshInProgress()?setTimeout(e,0):e()}onFilterChanged(i={}){const{source:e,filterInstance:t,additionalEventAttributes:s,columns:r}=i;this.updateDependantFilters(),this.updateActiveFilters(),this.updateFilterFlagInColumns("filterChanged",s),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.allColumnFilters.forEach(n=>{n.filterPromise&&n.filterPromise.then(a=>{a&&a!==t&&a.onAnyFilterChanged&&a.onAnyFilterChanged()})});const o={source:e,type:b.EVENT_FILTER_CHANGED,columns:r||[]};s&&Ei(o,s),this.processingFilterChange=!0,this.eventService.dispatchEvent(o),this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){var i;return!((i=this.gos.get("allowShowChangeAfterFilter"))!=null?i:!1)&&this.processingFilterChange}isQuickFilterPresent(){return this.quickFilterService.isQuickFilterPresent()}updateAggFiltering(){this.aggFiltering=!!this.gos.getGroupAggFiltering()}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.columnModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(i,e){return this.doesRowPassFilter({rowNode:e,filterInstanceToSkip:i})}doesRowPassAggregateFilters(i){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(i.rowNode)||this.isAggregateFilterPresent()&&!this.doAggregateFiltersPass(i.rowNode,i.filterInstanceToSkip))}doesRowPassFilter(i){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(i.rowNode)||this.isExternalFilterPresent()&&!this.doesExternalFilterPass(i.rowNode)||this.isColumnFilterPresent()&&!this.doColumnFiltersPass(i.rowNode,i.filterInstanceToSkip)||this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(i.rowNode))}onNewRowsLoaded(i){this.allColumnFilters.forEach(e=>{e.filterPromise.then(t=>{t.onNewRowsLoaded&&t.onNewRowsLoaded()})}),this.updateFilterFlagInColumns(i,{afterDataChange:!0}),this.updateActiveFilters()}createValueGetter(i){return({node:e})=>this.valueService.getValue(i,e,!0)}createGetValue(i){return(e,t)=>{const s=t?this.columnModel.getGridColumn(t):i;return s?this.valueService.getValue(s,e,!0):void 0}}getFilterComponent(i,e,t=!0){var s;if(t)return((s=this.getOrCreateFilterWrapper(i,e))==null?void 0:s.filterPromise)||null;const r=this.cachedFilter(i);return r?r.filterPromise:null}isFilterActive(i){const e=this.cachedFilter(i);return!!e&&e.filterPromise.resolveNow(!1,t=>t.isFilterActive())}getOrCreateFilterWrapper(i,e){if(!i.isFilterAllowed())return null;let t=this.cachedFilter(i);return t||(t=this.createFilterWrapper(i,e),this.setColumnFilterWrapper(i,t)),t}cachedFilter(i){return this.allColumnFilters.get(i.getColId())}getDefaultFilter(i){let e;if(ze.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))e="agSetColumnFilter";else{const t=this.dataTypeService.getBaseDataType(i);t==="number"?e="agNumberColumnFilter":t==="date"||t==="dateString"?e="agDateColumnFilter":e="agTextColumnFilter"}return e}getDefaultFloatingFilter(i){let e;if(ze.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))e="agSetColumnFloatingFilter";else{const t=this.dataTypeService.getBaseDataType(i);t==="number"?e="agNumberColumnFloatingFilter":t==="date"||t==="dateString"?e="agDateColumnFloatingFilter":e="agTextColumnFloatingFilter"}return e}createFilterInstance(i){const e=this.getDefaultFilter(i),t=i.getColDef();let s;const r=lt(de({},this.createFilterParams(i,t)),{filterModifiedCallback:()=>this.filterModifiedCallbackFactory(s,i)(),filterChangedCallback:n=>this.filterChangedCallbackFactory(s,i)(n),doesRowPassOtherFilter:n=>this.doesRowPassOtherFilters(s,n)}),o=this.userComponentFactory.getFilterDetails(t,r,e);return o?{filterPromise:()=>{const n=o.newAgStackInstance();return n&&n.then(a=>s=a),n},compDetails:o}:{filterPromise:null,compDetails:null}}createFilterParams(i,e){return this.gos.addGridCommonParams({column:i,colDef:hp(e),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(i),getValue:this.createGetValue(i),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(i,e){var t;const s={column:i,filterPromise:null,compiledElement:null,compDetails:null},{filterPromise:r,compDetails:o}=this.createFilterInstance(i);return s.filterPromise=(t=r?.())!=null?t:null,s.compDetails=o,s}onColumnsChanged(){const i=[];this.allColumnFilters.forEach((e,t)=>{let s;e.column.isPrimary()?s=this.columnModel.getPrimaryColumn(t):s=this.columnModel.getGridColumn(t),!(s&&s===e.column)&&(i.push(e.column),this.disposeFilterWrapper(e,"columnChanged"),this.disposeColumnListener(t))}),i.length>0?this.onFilterChanged({columns:i,source:"api"}):this.updateDependantFilters()}updateDependantFilters(){const i=this.columnModel.getGroupAutoColumns();i?.forEach(e=>{e.getColDef().filter==="agGroupColumnFilter"&&this.getOrCreateFilterWrapper(e,"NO_UI")})}isFilterAllowed(i){var e,t;if(this.isAdvancedFilterEnabled()||!i.isFilterAllowed())return!1;const r=this.allColumnFilters.get(i.getColId());return(t=(e=r?.filterPromise)==null?void 0:e.resolveNow(!0,o=>typeof o?.isFilterAllowed=="function"?o?.isFilterAllowed():!0))!=null?t:!0}getFloatingFilterCompDetails(i,e){const t=l=>{const u=this.getFilterComponent(i,"NO_UI");u?.then(h=>{l(Jr(h))})},s=i.getColDef(),r=lt(de({},this.createFilterParams(i,s)),{filterChangedCallback:()=>t(l=>this.filterChangedCallbackFactory(l,i)())}),o=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(s,Bc,r);let n=this.userComponentFactory.getDefaultFloatingFilterType(s,()=>this.getDefaultFloatingFilter(i));n==null&&(n="agReadOnlyFloatingFilter");const a={column:i,filterParams:o,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(i),parentFilterInstance:t,showParentFilter:e,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(s,a,n)}getCurrentFloatingFilterParentModel(i){const e=this.getFilterComponent(i,"NO_UI",!1);return e?e.resolveNow(null,t=>t&&t.getModel()):null}destroyFilter(i,e="api"){const t=i.getColId(),s=this.allColumnFilters.get(t);this.disposeColumnListener(t),delete this.initialFilterModel[t],s&&(this.disposeFilterWrapper(s,e),this.onFilterChanged({columns:[i],source:"api"}))}disposeColumnListener(i){const e=this.allColumnListeners.get(i);e&&(this.allColumnListeners.delete(i),e())}disposeFilterWrapper(i,e){i.filterPromise.then(t=>{this.getContext().destroyBean(t),i.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(i.column.getColId());const s={type:b.EVENT_FILTER_DESTROYED,source:e,column:i.column};this.eventService.dispatchEvent(s)})}filterModifiedCallbackFactory(i,e){return()=>{const t={type:b.EVENT_FILTER_MODIFIED,column:e,filterInstance:i};this.eventService.dispatchEvent(t)}}filterChangedCallbackFactory(i,e){return t=>{var s;const r=(s=t?.source)!=null?s:"api",o={filter:i,additionalEventAttributes:t,columns:[e],source:r};this.callOnFilterChangedOutsideRenderCycle(o)}}checkDestroyFilter(i){const e=this.allColumnFilters.get(i);if(!e)return;const t=e.column,{compDetails:s}=t.isFilterAllowed()?this.createFilterInstance(t):{compDetails:null};if(this.areFilterCompsDifferent(e.compDetails,s)){this.destroyFilter(t,"paramsUpdated");return}const r=t.getColDef().filterParams;if(!e.filterPromise){this.destroyFilter(t,"paramsUpdated");return}e.filterPromise.then(o=>{(o?.refresh?o.refresh(de(lt(de({},this.createFilterParams(t,t.getColDef())),{filterModifiedCallback:this.filterModifiedCallbackFactory(o,t),filterChangedCallback:this.filterChangedCallbackFactory(o,t),doesRowPassOtherFilter:a=>this.doesRowPassOtherFilters(o,a)}),r)):!0)===!1&&this.destroyFilter(t,"paramsUpdated")})}setColumnFilterWrapper(i,e){const t=i.getColId();this.allColumnFilters.set(t,e),this.allColumnListeners.set(t,this.addManagedListener(i,Qe.EVENT_COL_DEF_CHANGED,()=>this.checkDestroyFilter(t)))}areFilterCompsDifferent(i,e){if(!e||!i)return!0;const{componentClass:t}=i,{componentClass:s}=e;return!(t===s||t?.render&&s?.render&&t.render===s.render)}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(i){if(this.isAdvancedFilterEnabled()){if(this.dataTypeService.isPendingInference()){this.advancedFilterModelUpdateQueue.push(i);return}this.advancedFilterService.setModel(i??null),this.onFilterChanged({source:"advancedFilter"})}}showAdvancedFilterBuilder(i){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder(i,!0)}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return this.isAdvancedFilterEnabled()?!1:this.columnModel.getAllGridColumns().some(e=>e.getColDef().floatingFilter)}getFilterInstance(i,e){if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}const t=this.getFilterInstanceImpl(i,r=>{if(!e)return;const o=Jr(r);e(o)});return Jr(t)}getColumnFilterInstance(i){return new Promise(e=>{this.getFilterInstance(i,t=>{e(t)})})}getFilterInstanceImpl(i,e){const t=this.columnModel.getPrimaryColumn(i);if(!t)return;const s=this.getFilterComponent(t,"NO_UI"),r=s&&s.resolveNow(null,o=>o);return r?setTimeout(e,0,r):s&&s.then(o=>{e(o)}),r}warnAdvancedFilters(){fe("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(i){var e;(e=this.advancedFilterService)==null||e.getCtrl().setupHeaderComp(i)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach(({model:i,source:e})=>this.setFilterModel(i,e)),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach(({key:i,model:e,resolve:t})=>{this.setColumnFilterModel(i,e).then(()=>t())}),this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue.forEach(i=>this.setAdvancedFilterModel(i)),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(i){const e=this.getFilterWrapper(i);return e?this.getModelFromFilterWrapper(e):null}setColumnFilterModel(i,e){if(this.isAdvancedFilterEnabled())return this.warnAdvancedFilters(),Promise.resolve();if(this.dataTypeService.isPendingInference()){let o=()=>{};const n=new Promise(a=>{o=a});return this.columnFilterModelUpdateQueue.push({key:i,model:e,resolve:o}),n}const t=this.columnModel.getPrimaryColumn(i),s=t?this.getOrCreateFilterWrapper(t,"NO_UI"):null;return s?(o=>new Promise(n=>{o.then(a=>n(a))}))(this.setModelOnFilterWrapper(s.filterPromise,e)):Promise.resolve()}getFilterWrapper(i){var e;const t=this.columnModel.getPrimaryColumn(i);return t&&(e=this.cachedFilter(t))!=null?e:null}destroy(){super.destroy(),this.allColumnFilters.forEach(i=>this.disposeFilterWrapper(i,"gridDestroyed")),this.allColumnListeners.clear()}};g([R("valueService")],Ji.prototype,"valueService",2);g([R("columnModel")],Ji.prototype,"columnModel",2);g([R("rowModel")],Ji.prototype,"rowModel",2);g([R("userComponentFactory")],Ji.prototype,"userComponentFactory",2);g([R("rowRenderer")],Ji.prototype,"rowRenderer",2);g([R("dataTypeService")],Ji.prototype,"dataTypeService",2);g([R("quickFilterService")],Ji.prototype,"quickFilterService",2);g([Ke("advancedFilterService")],Ji.prototype,"advancedFilterService",2);g([J],Ji.prototype,"init",1);Ji=g([le("filterManager")],Ji);var td=class extends Se{constructor(i,e){super('<div class="ag-filter"></div>'),this.column=i,this.source=e,this.filterWrapper=null}postConstruct(){this.createFilter(!0),this.addManagedListener(this.eventService,b.EVENT_FILTER_DESTROYED,this.onFilterDestroyed.bind(this))}hasFilter(){return!!this.filterWrapper}getFilter(){var i,e;return(e=(i=this.filterWrapper)==null?void 0:i.filterPromise)!=null?e:null}afterInit(){var i,e,t;return(t=(e=(i=this.filterWrapper)==null?void 0:i.filterPromise)==null?void 0:e.then(()=>{}))!=null?t:Lt.resolve()}afterGuiAttached(i){var e,t;(t=(e=this.filterWrapper)==null?void 0:e.filterPromise)==null||t.then(s=>{var r;(r=s?.afterGuiAttached)==null||r.call(s,i)})}afterGuiDetached(){var i,e;(e=(i=this.filterWrapper)==null?void 0:i.filterPromise)==null||e.then(t=>{var s;(s=t?.afterGuiDetached)==null||s.call(t)})}createFilter(i){var e;const{column:t,source:s}=this;this.filterWrapper=this.filterManager.getOrCreateFilterWrapper(t,s),(e=this.filterWrapper)!=null&&e.filterPromise&&this.filterWrapper.filterPromise.then(r=>{let o=r.getGui();if(K(o)||console.warn(`AG Grid: getGui method from filter returned ${o}, it should be a DOM element or an HTML template string.`),typeof o=="string"&&(o=Ri(o)),this.appendChild(o),i){const n={type:b.EVENT_FILTER_OPENED,column:t,source:s,eGui:this.getGui()};this.eventService.dispatchEvent(n)}})}onFilterDestroyed(i){(i.source==="api"||i.source==="paramsUpdated")&&i.column.getId()===this.column.getId()&&this.columnModel.getPrimaryColumn(this.column)&&(Rt(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}};g([R("filterManager")],td.prototype,"filterManager",2);g([R("columnModel")],td.prototype,"columnModel",2);g([J],td.prototype,"postConstruct",1);var Qp=class extends Se{constructor(i,e){super(i),this.ctrl=e}getCtrl(){return this.ctrl}},Oo=class gC extends Qp{constructor(e){super(gC.TEMPLATE,e)}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(s,r)=>this.addOrRemoveCssClass(s,r),addOrRemoveBodyCssClass:(s,r)=>this.eFloatingFilterBody.classList.toggle(s,r),setButtonWrapperDisplayed:s=>Ge(this.eButtonWrapper,s),setCompDetails:s=>this.setCompDetails(s),getFloatingFilterComp:()=>this.compPromise,setWidth:s=>e.style.width=s,setMenuIcon:s=>this.eButtonShowMainFilter.appendChild(s)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody)}setCompDetails(e){if(!e){this.destroyFloatingFilterComp(),this.compPromise=null;return}this.compPromise=e.newAgStackInstance(),this.compPromise.then(t=>this.afterCompCreated(t))}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(e){if(e){if(!this.isAlive()){this.destroyBean(e);return}this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached()}}};Oo.TEMPLATE=`<div class="ag-header-cell ag-floating-filter" role="gridcell">
<div ref="eFloatingFilterBody" role="presentation"></div>
<div class="ag-floating-filter-button ag-hidden" ref="eButtonWrapper" role="presentation">
<button type="button" class="ag-button ag-floating-filter-button-button" ref="eButtonShowMainFilter" tabindex="-1"></button>
</div>
</div>`;g([te("eFloatingFilterBody")],Oo.prototype,"eFloatingFilterBody",2);g([te("eButtonWrapper")],Oo.prototype,"eButtonWrapper",2);g([te("eButtonShowMainFilter")],Oo.prototype,"eButtonShowMainFilter",2);g([J],Oo.prototype,"postConstruct",1);g([vi],Oo.prototype,"destroyFloatingFilterComp",1);var SS=Oo,id=class extends Z{constructor(i){super(),this.view=i}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const i=this.getDomLayout(),e={autoHeight:i==="autoHeight",normal:i==="normal",print:i==="print"},t=e.autoHeight?"ag-layout-auto-height":e.print?"ag-layout-print":"ag-layout-normal";this.view.updateLayoutClasses(t,e)}getDomLayout(){var i;const e=(i=this.gos.get("domLayout"))!=null?i:"normal";return["normal","print","autoHeight"].indexOf(e)===-1?(fe(`${e} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"normal"):e}};g([J],id.prototype,"postConstruct",1);var ir=class extends Z{constructor(i){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=i,this.resetLastHScrollDebounced=ci(()=>this.lastScrollSource[1]=null,500),this.resetLastVScrollDebounced=ci(()=>this.lastScrollSource[0]=null,500)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this)),this.ctrlsService.whenReady(i=>{this.centerRowsCtrl=i.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}addScrollListener(){const{fakeHScrollComp:i,fakeVScrollComp:e}=this.ctrlsService.getParams();this.addManagedListener(this.centerRowsCtrl.getViewportElement(),"scroll",this.onHScroll.bind(this)),i.onScrollCallback(this.onFakeHScroll.bind(this));const t=this.gos.get("debounceVerticalScrollbar"),s=t?ci(this.onVScroll.bind(this),100):this.onVScroll.bind(this),r=t?ci(this.onFakeVScroll.bind(this),100):this.onFakeVScroll.bind(this);this.addManagedListener(this.eBodyViewport,"scroll",s),e.onScrollCallback(r)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(i){if(this.centerRowsCtrl==null)return;i===void 0&&(i=this.centerRowsCtrl.getCenterViewportScrollLeft());const t=this.enableRtl?i:-i,{topCenter:s,stickyTopCenter:r,stickyBottomCenter:o,centerHeader:n,bottomCenter:a,fakeHScrollComp:l}=this.ctrlsService.getParams();n.setHorizontalScroll(-t),a.setContainerTranslateX(t),s.setContainerTranslateX(t),r.setContainerTranslateX(t),o.setContainerTranslateX(t);const u=this.centerRowsCtrl.getViewportElement(),h=this.lastScrollSource[1]===0;i=Math.abs(i),h?l.setScrollPosition(i):Wa(u,i,this.enableRtl)}isControllingScroll(i,e){return this.lastScrollSource[e]==null?(this.lastScrollSource[e]=i,!0):this.lastScrollSource[e]===i}onFakeHScroll(){this.isControllingScroll(1,1)&&this.onHScrollCommon(1)}onHScroll(){this.isControllingScroll(0,1)&&this.onHScrollCommon(0)}onHScrollCommon(i){const e=this.centerRowsCtrl.getViewportElement(),{scrollLeft:t}=e;if(this.shouldBlockScrollUpdate(1,t,!0))return;let s;i===0?s=Ba(e,this.enableRtl):s=this.ctrlsService.get("fakeHScrollComp").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(i){let e;i===0?e=this.eBodyViewport.scrollTop:e=this.ctrlsService.get("fakeVScrollComp").getScrollPosition(),!this.shouldBlockScrollUpdate(0,e,!0)&&(this.animationFrameService.setScrollTop(e),this.nextScrollTop=e,i===0?this.ctrlsService.get("fakeVScrollComp").setScrollPosition(e):this.eBodyViewport.scrollTop=e,this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(i){const e=this.ctrlsService.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===i&&i===e||(this.scrollLeft=i,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(i),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(i){const e={type:b.EVENT_BODY_SCROLL,direction:i===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(e),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(()=>{const t=lt(de({},e),{type:b.EVENT_BODY_SCROLL_END});this.eventService.dispatchEvent(t)},100)}shouldBlockScrollUpdate(i,e,t=!1){return t&&!Js()?!1:i===0?this.shouldBlockVerticalScroll(e):this.shouldBlockHorizontalScroll(e)}shouldBlockVerticalScroll(i){const e=El(this.eBodyViewport),{scrollHeight:t}=this.eBodyViewport;return i<0||i+e>t}shouldBlockHorizontalScroll(i){const e=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:t}=this.centerRowsCtrl.getViewportElement();if(this.enableRtl&&Ha()){if(i>0)return!0}else if(i<0)return!0;return Math.abs(i)+e>t}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(0)}scrollGridIfNeeded(){const i=this.scrollTop!=this.nextScrollTop;return i&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),i}setHorizontalScrollPosition(i,e=!1){const s=this.centerRowsCtrl.getViewportElement().scrollWidth-this.centerRowsCtrl.getCenterWidth();!e&&this.shouldBlockScrollUpdate(1,i)&&(this.enableRtl&&Ha()?i=i>0?0:s:i=Math.min(Math.max(i,0),s)),Wa(this.centerRowsCtrl.getViewportElement(),Math.abs(i),this.enableRtl),this.doHorizontalScroll(i)}setVerticalScrollPosition(i){this.eBodyViewport.scrollTop=i}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.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowsCtrl.isHorizontalScrollShowing()}scrollHorizontally(i){const e=this.centerRowsCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(e+i),this.centerRowsCtrl.getViewportElement().scrollLeft-e}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(i,e=null){const t=this.rowModel.getRowCount();let s=-1;for(let r=0;r<t;r++){const o=this.rowModel.getRow(r);if(typeof i=="function"){if(o&&i(o)){s=r;break}}else if(i===o||i===o.data){s=r;break}}s>=0&&this.ensureIndexVisible(s,e)}ensureIndexVisible(i,e){if(this.gos.isDomLayout("print"))return;const t=this.paginationProxy.getRowCount();if(typeof i!="number"||i<0||i>=t){console.warn("AG Grid: Invalid row index for ensureIndexVisible: "+i);return}const r=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming(()=>{r||this.paginationProxy.goToPageWithIndex(i);const o=this.ctrlsService.getGridBodyCtrl(),n=o.getStickyTopHeight(),a=o.getStickyBottomHeight(),l=this.paginationProxy.getRow(i);let u;do{const h=l.rowTop,d=l.rowHeight,c=this.paginationProxy.getPixelOffset(),p=l.rowTop-c,y=p+l.rowHeight,f=this.getVScrollPosition(),w=this.heightScaler.getDivStretchOffset(),_=f.top+w,P=f.bottom+w,T=P-_,D=this.heightScaler.getScrollPositionForPixel(p),M=this.heightScaler.getScrollPositionForPixel(y-T),O=Math.min((D+M)/2,p),N=_+n>p,z=P-a<y;let Y=null;e==="top"?Y=D:e==="bottom"?Y=M:e==="middle"?Y=O:N?Y=D-n:z&&(Y=M+a),Y!==null&&(this.setVerticalScrollPosition(Y),this.rowRenderer.redraw({afterScroll:!0})),u=h!==l.rowTop||d!==l.rowHeight}while(u);this.animationFrameService.flushAllFrames()})}ensureColumnVisible(i,e="auto"){const t=this.columnModel.getGridColumn(i);if(!t||t.isPinned()||!this.columnModel.isColumnDisplayed(t))return;const s=this.getPositionedHorizontalScroll(t,e);this.getFrameworkOverrides().wrapIncoming(()=>{s!==null&&this.centerRowsCtrl.setCenterViewportScrollLeft(s),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()})}setScrollPosition(i,e){this.getFrameworkOverrides().wrapIncoming(()=>{this.centerRowsCtrl.setCenterViewportScrollLeft(e),this.setVerticalScrollPosition(i),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()})}getPositionedHorizontalScroll(i,e){const{columnBeforeStart:t,columnAfterEnd:s}=this.isColumnOutsideViewport(i),r=this.centerRowsCtrl.getCenterWidth()<i.getActualWidth(),o=this.centerRowsCtrl.getCenterWidth(),n=this.enableRtl;let a=(n?t:s)||r,l=n?s:t;e!=="auto"&&(a=e==="start",l=e==="end");const u=e==="middle";if(a||l||u){const{colLeft:h,colMiddle:d,colRight:c}=this.getColumnBounds(i);return u?d-o/2:a?n?c:h:n?h-o:c-o}return null}isColumnOutsideViewport(i){const{start:e,end:t}=this.getViewportBounds(),{colLeft:s,colRight:r}=this.getColumnBounds(i),o=this.enableRtl,n=o?e>r:t<r,a=o?t<s:e>s;return{columnBeforeStart:n,columnAfterEnd:a}}getColumnBounds(i){const e=this.enableRtl,t=this.columnModel.getBodyContainerWidth(),s=i.getActualWidth(),r=i.getLeft(),o=e?-1:1,n=e?t-r:r,a=n+s*o,l=n+s/2*o;return{colLeft:n,colMiddle:l,colRight:a}}getViewportBounds(){const i=this.centerRowsCtrl.getCenterWidth(),e=this.centerRowsCtrl.getCenterViewportScrollLeft(),t=e,s=i+e;return{start:t,end:s,width:i}}};g([R("ctrlsService")],ir.prototype,"ctrlsService",2);g([R("animationFrameService")],ir.prototype,"animationFrameService",2);g([R("paginationProxy")],ir.prototype,"paginationProxy",2);g([R("rowModel")],ir.prototype,"rowModel",2);g([R("rowContainerHeightService")],ir.prototype,"heightScaler",2);g([R("rowRenderer")],ir.prototype,"rowRenderer",2);g([R("columnModel")],ir.prototype,"columnModel",2);g([J],ir.prototype,"postConstruct",1);var fC="ag-force-vertical-scroll",_S="ag-selectable",ES="ag-column-moving",ni=class extends Z{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(i,e,t,s,r,o,n){this.comp=i,this.eGridBody=e,this.eBodyViewport=t,this.eTop=s,this.eBottom=r,this.eStickyTop=o,this.eStickyBottom=n,this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",a=>this.setCellTextSelection(a.currentValue)),this.createManagedBean(new id(this.comp)),this.bodyScrollFeature=this.createManagedBean(new ir(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,t,r,o,n]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.filterManager.setupAdvancedFilterHeaderComp(s),this.ctrlsService.register("gridBodyCtrl",this)}getComp(){return this.comp}addEventListeners(){this.addManagedListener(this.eventService,b.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}addFocusListeners(i){i.forEach(e=>{this.addManagedListener(e,"focusin",t=>{const{target:s}=t,r=so(s,"ag-root",e);e.classList.toggle("ag-has-focus",!r)}),this.addManagedListener(e,"focusout",t=>{const{target:s,relatedTarget:r}=t,o=e.contains(r),n=so(r,"ag-root",e);so(s,"ag-root",e)||(!o||n)&&e.classList.remove("ag-has-focus")})})}setColumnMovingCss(i){this.comp.setColumnMovingCss(ES,i)}setCellTextSelection(i=!1){this.comp.setCellSelectableCss(_S,i)}onScrollVisibilityChanged(){const i=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(i),this.setStickyWidth(i),this.setStickyBottomOffsetBottom();const e=i&&this.gos.getScrollbarWidth()||0,t=Rp()?16:0,s=`calc(100% + ${e+t}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setBodyViewportWidth(s))}onGridColumnsChanged(){const i=this.columnModel.getAllGridColumns();this.comp.setColumnCount(i.length)}disableBrowserDragging(){this.addManagedListener(this.eGridBody,"dragstart",i=>{if(i.target instanceof HTMLImageElement)return i.preventDefault(),!1})}addStopEditingWhenGridLosesFocus(){if(!this.gos.get("stopEditingWhenCellsLoseFocus"))return;const i=t=>{const s=t.relatedTarget;if(th(s)===null){this.rowRenderer.stopEditing();return}let r=e.some(o=>o.contains(s))&&this.mouseEventService.isElementInThisGrid(s);if(!r){const o=this.popupService;r=o.getActivePopups().some(n=>n.contains(s))||o.isElementWithinCustomPopup(s)}r||this.rowRenderer.stopEditing()},e=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom];e.forEach(t=>this.addManagedListener(t,"focusout",i))}updateRowCount(){const i=this.headerNavigationService.getHeaderRowCount()+this.filterManager.getHeaderRowCount(),e=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,t=e===-1?-1:i+e;this.comp.setRowCount(t)}registerBodyViewportResizeListener(i){this.comp.registerBodyViewportResizeListener(i)}setVerticalScrollPaddingVisible(i){const e=i?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(e)}isVerticalScrollShowing(){const i=this.gos.get("alwaysShowVerticalScroll"),e=i?fC:null,t=this.gos.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(e,i),i||t&&dv(this.eBodyViewport)}setupRowAnimationCssClass(){const i=()=>{const e=this.gos.isAnimateRows()&&!this.rowContainerHeightService.isStretching(),t=e?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(t,e)};i(),this.addManagedListener(this.eventService,b.EVENT_HEIGHT_SCALE_CHANGED,i),this.addManagedPropertyListener("animateRows",i)}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const i=this.onBodyViewportContextMenu.bind(this);this.addManagedListener(this.eBodyViewport,"contextmenu",i),this.mockContextMenuForIPad(i),this.addManagedListener(this.eBodyViewport,"wheel",this.onBodyViewportWheel.bind(this)),this.addManagedListener(this.eStickyTop,"wheel",this.onStickyWheel.bind(this)),this.addManagedListener(this.eStickyBottom,"wheel",this.onStickyWheel.bind(this)),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const i=this.eBodyViewport.querySelector(".ag-full-width-container"),e=this.eBodyViewport.querySelector(".ag-center-cols-viewport");i&&e&&this.addManagedListener(i,"wheel",t=>this.onFullWidthContainerWheel(t,e))}onFullWidthContainerWheel(i,e){!i.deltaX||Math.abs(i.deltaY)>Math.abs(i.deltaX)||!this.mouseEventService.isEventFromThisGrid(i)||(i.preventDefault(),e.scrollBy({left:i.deltaX}))}onBodyViewportContextMenu(i,e,t){if(!i&&!t)return;this.gos.get("preventDefaultOnContextMenu")&&(i||t).preventDefault();const{target:s}=i||e;(s===this.eBodyViewport||s===this.ctrlsService.get("center").getViewportElement())&&this.menuService.showContextMenu({mouseEvent:i,touchEvent:t,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(i){if(!Js())return;const e=new Kt(this.eBodyViewport),t=s=>{i(void 0,s.touchStart,s.touchEvent)};this.addManagedListener(e,Kt.EVENT_LONG_TAP,t),this.addDestroyFunc(()=>e.destroy())}onBodyViewportWheel(i){this.gos.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&i.preventDefault()}onStickyWheel(i){i.preventDefault(),i.offsetY&&this.scrollVertically(i.deltaY)}getGui(){return this.eGridBody}scrollVertically(i){const e=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(e+i),this.eBodyViewport.scrollTop-e}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new Bi(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}getRowDragFeature(){return this.rowDragFeature}onPinnedRowDataChanged(){this.setFloatingHeights()}setFloatingHeights(){const{pinnedRowModel:i}=this;let e=i.getPinnedTopTotalHeight(),t=i.getPinnedBottomTotalHeight();this.comp.setTopHeight(e),this.comp.setBottomHeight(t),this.comp.setTopDisplay(e?"inherit":"none"),this.comp.setBottomDisplay(t?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(i=0){this.comp.setStickyTopHeight(`${i}px`),this.stickyTopHeight=i}getStickyTopHeight(){return this.stickyTopHeight}setStickyBottomHeight(i=0){this.comp.setStickyBottomHeight(`${i}px`),this.stickyBottomHeight=i}getStickyBottomHeight(){return this.stickyBottomHeight}setStickyWidth(i){if(!i)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{const e=this.gos.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${e}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${e}px)`)}}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const e=this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight()+this.filterManager.getHeaderHeight(),t=this.pinnedRowModel.getPinnedTopTotalHeight();let s=0;e>0&&(s+=e),t>0&&(s+=t),s>0&&(s+=1),this.comp.setStickyTopTop(`${s}px`)}setStickyBottomOffsetBottom(){const i=this.pinnedRowModel.getPinnedBottomTotalHeight(),t=this.scrollVisibleService.isHorizontalScrollShowing()&&this.gos.getScrollbarWidth()||0,s=i+t;this.comp.setStickyBottomBottom(`${s}px`)}sizeColumnsToFit(i,e){const s=this.isVerticalScrollShowing()?this.gos.getScrollbarWidth():0,o=To(this.eGridBody)-s;if(o>0){this.columnModel.sizeColumnsToFit(o,"sizeColumnsToFit",!1,i);return}e===void 0?window.setTimeout(()=>{this.sizeColumnsToFit(i,100)},0):e===100?window.setTimeout(()=>{this.sizeColumnsToFit(i,500)},100):e===500?window.setTimeout(()=>{this.sizeColumnsToFit(i,-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(i){this.eBodyViewport.addEventListener("scroll",i,{passive:!0})}removeScrollEventListener(i){this.eBodyViewport.removeEventListener("scroll",i)}};g([R("animationFrameService")],ni.prototype,"animationFrameService",2);g([R("rowContainerHeightService")],ni.prototype,"rowContainerHeightService",2);g([R("ctrlsService")],ni.prototype,"ctrlsService",2);g([R("columnModel")],ni.prototype,"columnModel",2);g([R("scrollVisibleService")],ni.prototype,"scrollVisibleService",2);g([R("menuService")],ni.prototype,"menuService",2);g([R("headerNavigationService")],ni.prototype,"headerNavigationService",2);g([R("dragAndDropService")],ni.prototype,"dragAndDropService",2);g([R("pinnedRowModel")],ni.prototype,"pinnedRowModel",2);g([R("rowRenderer")],ni.prototype,"rowRenderer",2);g([R("popupService")],ni.prototype,"popupService",2);g([R("mouseEventService")],ni.prototype,"mouseEventService",2);g([R("rowModel")],ni.prototype,"rowModel",2);g([R("filterManager")],ni.prototype,"filterManager",2);var va="ag-cell-range-selected",xS="ag-cell-range-chart",RS="ag-cell-range-single-cell",DS="ag-cell-range-chart-category",PS="ag-cell-range-handle",TS="ag-cell-range-top",AS="ag-cell-range-right",FS="ag-cell-range-bottom",MS="ag-cell-range-left",LS=class{constructor(i,e){this.beans=i,this.rangeService=i.rangeService,this.selectionHandleFactory=i.selectionHandleFactory,this.cellCtrl=e}setComp(i,e){this.cellComp=i,this.eGui=e,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(va,this.rangeCount!==0),this.cellComp.addOrRemoveCssClass(`${va}-1`,this.rangeCount===1),this.cellComp.addOrRemoveCssClass(`${va}-2`,this.rangeCount===2),this.cellComp.addOrRemoveCssClass(`${va}-3`,this.rangeCount===3),this.cellComp.addOrRemoveCssClass(`${va}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass(xS,this.hasChartRange),fn(this.eGui,this.rangeCount>0?!0:void 0),this.cellComp.addOrRemoveCssClass(RS,this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const i=this.getRangeBorders(),e=this.isSingleCell(),t=!e&&i.top,s=!e&&i.right,r=!e&&i.bottom,o=!e&&i.left;this.cellComp.addOrRemoveCssClass(TS,t),this.cellComp.addOrRemoveCssClass(AS,s),this.cellComp.addOrRemoveCssClass(FS,r),this.cellComp.addOrRemoveCssClass(MS,o)}isSingleCell(){const{rangeService:i}=this.beans;return this.rangeCount===1&&!!i&&!i.isMoreThanOneCell()}getHasChartRange(){const{rangeService:i}=this.beans;if(!this.rangeCount||!i)return!1;const e=i.getCellRanges();return e.length>0&&e.every(t=>ki([1,0],t.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const i=this.beans.gos.get("enableRtl");let e=!1,t=!1,s=!1,r=!1;const o=this.cellCtrl.getCellPosition().column,n=this.beans.columnModel;let a,l;i?(a=n.getDisplayedColAfter(o),l=n.getDisplayedColBefore(o)):(a=n.getDisplayedColBefore(o),l=n.getDisplayedColAfter(o));const u=this.rangeService.getCellRanges().filter(h=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),h));a||(r=!0),l||(t=!0);for(let h=0;h<u.length&&!(e&&t&&s&&r);h++){const d=u[h],c=this.rangeService.getRangeStartRow(d),p=this.rangeService.getRangeEndRow(d);!e&&this.beans.rowPositionUtils.sameRow(c,this.cellCtrl.getCellPosition())&&(e=!0),!s&&this.beans.rowPositionUtils.sameRow(p,this.cellCtrl.getCellPosition())&&(s=!0),!r&&a&&d.columns.indexOf(a)<0&&(r=!0),!t&&l&&d.columns.indexOf(l)<0&&(t=!0)}return{top:e,right:t,bottom:s,left:r}}refreshHandle(){if(this.beans.context.isDestroyed())return;const i=this.shouldHaveSelectionHandle();this.selectionHandle&&!i&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),i&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass(PS,!!this.selectionHandle)}shouldHaveSelectionHandle(){const i=this.beans.gos,e=this.rangeService.getCellRanges(),t=e.length;if(this.rangeCount<1||t<1)return!1;const s=We(e),r=this.cellCtrl.getCellPosition(),o=i.get("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),n=i.get("enableRangeHandle");let a=t===1&&!this.cellCtrl.isEditing()&&(o||n);if(this.hasChartRange){const u=e[0].type===1&&this.rangeService.isCellInSpecificRange(r,e[0]);this.cellComp.addOrRemoveCssClass(DS,u),a=s.type===0}return a&&s.endRow!=null&&this.rangeService.isContiguousRange(s)&&this.rangeService.isBottomRightCell(s,r)}addSelectionHandle(){const i=this.beans.gos,e=We(this.rangeService.getCellRanges()).type,s=i.get("enableFillHandle")&&be(e)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==s&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.selectionHandleFactory.createSelectionHandle(s)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},IS=class extends Z{constructor(i,e){super(),this.cellCtrl=i,this.beans=e,this.column=i.getColumn(),this.rowNode=i.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListener(this.beans.eventService,b.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}setComp(i){this.eGui=i,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const i=this.column.getRowSpan(this.rowNode);this.rowSpan!==i&&(this.rowSpan=i,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const i=this.getColSpanningList();Ts(this.colsSpanning,i)||(this.colsSpanning=i,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){this.column.getColDef().colSpan!=null&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListener(this.beans.eventService,b.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayColumnsChanged.bind(this)),this.addManagedListener(this.beans.eventService,b.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onWidthChanged.bind(this)))}onWidthChanged(){if(!this.eGui)return;const i=this.getCellWidth();this.eGui.style.width=`${i}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((i,e)=>i+e.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const i=this.column.getColSpan(this.rowNode),e=[];if(i===1)e.push(this.column);else{let t=this.column;const s=this.column.getPinned();for(let r=0;t&&r<i&&(e.push(t),t=this.beans.columnModel.getDisplayedColAfter(t),!(!t||be(t)||s!==t.getPinned()));r++);}return e}onLeftChanged(){if(!this.eGui)return;const i=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=i+"px"}getCellLeft(){let i;return this.beans.gos.get("enableRtl")&&this.colsSpanning?i=We(this.colsSpanning):i=this.column,i.getLeft()}modifyLeftForPrintLayout(i){if(!this.cellCtrl.isPrintLayout()||this.column.getPinned()==="left")return i;const e=this.beans.columnModel.getDisplayedColumnsLeftWidth();if(this.column.getPinned()==="right"){const t=this.beans.columnModel.getBodyContainerWidth();return e+t+(i||0)}return e+(i||0)}applyRowSpan(i){if(this.rowSpan===1&&!i)return;const t=this.beans.gos.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=`${t}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},OS=class extends Z{constructor(i,e){super(),this.staticClasses=[],this.cellCtrl=i,this.beans=e,this.column=i.getColumn(),this.rowNode=i.getRowNode()}setComp(i){this.cellComp=i,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const i=this.column.getColDef(),{cellClassRules:e}=i,t=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:i,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(e===this.cellClassRules?void 0:this.cellClassRules,e,t,s=>this.cellComp.addOrRemoveCssClass(s,!0),s=>this.cellComp.addOrRemoveCssClass(s,!1)),this.cellClassRules=e}applyUserStyles(){const i=this.column.getColDef();if(!i.cellStyle)return;let e;if(typeof i.cellStyle=="function"){const t=this.beans.gos.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:i,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex}),s=i.cellStyle;e=s(t)}else e=i.cellStyle;e&&this.cellComp.setUserStyles(e)}applyClassesFromColDef(){const i=this.column.getColDef(),e=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:i,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach(t=>this.cellComp.addOrRemoveCssClass(t,!1)),this.staticClasses=this.beans.stylingService.getStaticCellClasses(i,e),this.staticClasses.length&&this.staticClasses.forEach(t=>this.cellComp.addOrRemoveCssClass(t,!0))}destroy(){super.destroy()}},Ae=class{postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.gos.isRowModelType("serverSide")&&(this.serverSideRowModel=this.rowModel)}};g([R("resizeObserverService")],Ae.prototype,"resizeObserverService",2);g([R("paginationProxy")],Ae.prototype,"paginationProxy",2);g([R("context")],Ae.prototype,"context",2);g([R("gridOptionsService")],Ae.prototype,"gos",2);g([R("environment")],Ae.prototype,"environment",2);g([R("rowRenderer")],Ae.prototype,"rowRenderer",2);g([R("valueService")],Ae.prototype,"valueService",2);g([R("eventService")],Ae.prototype,"eventService",2);g([R("columnModel")],Ae.prototype,"columnModel",2);g([R("headerNavigationService")],Ae.prototype,"headerNavigationService",2);g([R("navigationService")],Ae.prototype,"navigationService",2);g([R("columnAnimationService")],Ae.prototype,"columnAnimationService",2);g([R("focusService")],Ae.prototype,"focusService",2);g([R("popupService")],Ae.prototype,"popupService",2);g([R("stylingService")],Ae.prototype,"stylingService",2);g([R("columnHoverService")],Ae.prototype,"columnHoverService",2);g([R("userComponentFactory")],Ae.prototype,"userComponentFactory",2);g([R("userComponentRegistry")],Ae.prototype,"userComponentRegistry",2);g([R("animationFrameService")],Ae.prototype,"animationFrameService",2);g([R("dragService")],Ae.prototype,"dragService",2);g([R("dragAndDropService")],Ae.prototype,"dragAndDropService",2);g([R("sortController")],Ae.prototype,"sortController",2);g([R("filterManager")],Ae.prototype,"filterManager",2);g([R("rowContainerHeightService")],Ae.prototype,"rowContainerHeightService",2);g([R("frameworkOverrides")],Ae.prototype,"frameworkOverrides",2);g([R("cellPositionUtils")],Ae.prototype,"cellPositionUtils",2);g([R("rowPositionUtils")],Ae.prototype,"rowPositionUtils",2);g([R("selectionService")],Ae.prototype,"selectionService",2);g([R("rowCssClassCalculator")],Ae.prototype,"rowCssClassCalculator",2);g([R("rowModel")],Ae.prototype,"rowModel",2);g([R("ctrlsService")],Ae.prototype,"ctrlsService",2);g([R("ctrlsFactory")],Ae.prototype,"ctrlsFactory",2);g([R("agStackComponentsRegistry")],Ae.prototype,"agStackComponentsRegistry",2);g([R("valueCache")],Ae.prototype,"valueCache",2);g([R("rowNodeEventThrottle")],Ae.prototype,"rowNodeEventThrottle",2);g([R("localeService")],Ae.prototype,"localeService",2);g([R("syncService")],Ae.prototype,"syncService",2);g([R("ariaAnnouncementService")],Ae.prototype,"ariaAnnouncementService",2);g([Ke("rangeService")],Ae.prototype,"rangeService",2);g([Ke("selectionHandleFactory")],Ae.prototype,"selectionHandleFactory",2);g([J],Ae.prototype,"postConstruct",1);Ae=g([le("beans")],Ae);var NS=class extends Ae{constructor(i,e,t){super(),this.cellCtrl=i,this.beans=e,this.column=t}onMouseEvent(i,e){if(!vs(e))switch(i){case"click":this.onCellClicked(e);break;case"mousedown":case"touchstart":this.onMouseDown(e);break;case"dblclick":this.onCellDoubleClicked(e);break;case"mouseout":this.onMouseOut(e);break;case"mouseover":this.onMouseOver(e);break}}onCellClicked(i){if(this.isDoubleClickOnIPad()){this.onCellDoubleClicked(i),i.preventDefault();return}const{eventService:e,rangeService:t,gos:s}=this.beans,r=i.ctrlKey||i.metaKey;t&&r&&t.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&t.intersectLastRange(!0);const o=this.cellCtrl.createEvent(i,b.EVENT_CELL_CLICKED);e.dispatchEvent(o);const n=this.column.getColDef();n.onCellClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{n.onCellClicked(o)})},0),(s.get("singleClickEdit")||n.singleClickEdit)&&!s.get("suppressClickEdit")&&!(i.shiftKey&&t?.getCellRanges().length!=0)&&this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!Js()||gp("dblclick"))return!1;const i=new Date().getTime(),e=i-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=i,e}onCellDoubleClicked(i){const e=this.column.getColDef(),t=this.cellCtrl.createEvent(i,b.EVENT_CELL_DOUBLE_CLICKED);this.beans.eventService.dispatchEvent(t),typeof e.onCellDoubleClicked=="function"&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{e.onCellDoubleClicked(t)})},0),!this.beans.gos.get("singleClickEdit")&&!this.beans.gos.get("suppressClickEdit")&&this.cellCtrl.startRowOrCellEdit(null,i)}onMouseDown(i){const{ctrlKey:e,metaKey:t,shiftKey:s}=i,r=i.target,{cellCtrl:o,beans:n}=this,{eventService:a,rangeService:l,focusService:u}=n;if(this.isRightClickInExistingRange(i))return;const h=l&&l.getCellRanges().length!=0;if(!s||!h){const d=Os()&&!o.isEditing()&&!Tp(r);o.focusCell(d)}if(s&&h&&!u.isCellFocused(o.getCellPosition())){i.preventDefault();const d=u.getFocusedCell();if(d){const{column:c,rowIndex:p,rowPinned:y}=d,f=n.rowRenderer.getRowByPosition({rowIndex:p,rowPinned:y}),w=f?.getCellCtrl(c);w?.isEditing()&&w.stopEditing(),u.setFocusedCell({column:c,rowIndex:p,rowPinned:y,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(r)){if(l){const d=this.cellCtrl.getCellPosition();if(s)l.extendLatestRangeToCell(d);else{const c=e||t;l.setRangeToCell(d,c)}}a.dispatchEvent(this.cellCtrl.createEvent(i,b.EVENT_CELL_MOUSE_DOWN))}}isRightClickInExistingRange(i){const{rangeService:e}=this.beans;if(e){const t=e.isCellInAnyRange(this.cellCtrl.getCellPosition()),s=i.button===2||i.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(t&&s)return!0}return!1}containsWidget(i){return so(i,"ag-selection-checkbox",3)}onMouseOut(i){if(this.mouseStayingInsideCell(i))return;const e=this.cellCtrl.createEvent(i,b.EVENT_CELL_MOUSE_OUT);this.beans.eventService.dispatchEvent(e),this.beans.columnHoverService.clearMouseOver()}onMouseOver(i){if(this.mouseStayingInsideCell(i))return;const e=this.cellCtrl.createEvent(i,b.EVENT_CELL_MOUSE_OVER);this.beans.eventService.dispatchEvent(e),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(i){if(!i.target||!i.relatedTarget)return!1;const e=this.cellCtrl.getGui(),t=e.contains(i.target),s=e.contains(i.relatedTarget);return t&&s}destroy(){}},kS=class extends Z{constructor(i,e,t,s,r){super(),this.cellCtrl=i,this.beans=e,this.rowNode=s,this.rowCtrl=r}setComp(i){this.eGui=i}onKeyDown(i){const e=i.key;switch(e){case k.ENTER:this.onEnterKeyDown(i);break;case k.F2:this.onF2KeyDown(i);break;case k.ESCAPE:this.onEscapeKeyDown(i);break;case k.TAB:this.onTabKeyDown(i);break;case k.BACKSPACE:case k.DELETE:this.onBackspaceOrDeleteKeyDown(e,i);break;case k.DOWN:case k.UP:case k.RIGHT:case k.LEFT:this.onNavigationKeyDown(i,e);break}}onNavigationKeyDown(i,e){this.cellCtrl.isEditing()||(i.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(i):this.beans.navigationService.navigateToNextCell(i,e,this.cellCtrl.getCellPosition(),!0),i.preventDefault())}onShiftRangeSelect(i){if(!this.beans.rangeService)return;const e=this.beans.rangeService.extendLatestRangeInDirection(i);e&&this.beans.navigationService.ensureCellVisible(e)}onTabKeyDown(i){this.beans.navigationService.onTabKeyDown(this.cellCtrl,i)}onBackspaceOrDeleteKeyDown(i,e){var t;const{cellCtrl:s,beans:r,rowNode:o}=this,{gos:n,rangeService:a,eventService:l}=r;if(!s.isEditing()){if(l.dispatchEvent({type:b.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),bv(i,n.get("enableCellEditingOnBackspace"))){if(a&&n.get("enableRangeSelection"))a.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(s.isCellEditable()){const u=s.getColumn(),h=(t=this.beans.valueService.parseValue(u,o,"",o.getValueFromValueService(u)))!=null?t:null;o.setDataValue(u,h,"cellClear")}}else s.startRowOrCellEdit(i,e);l.dispatchEvent({type:b.EVENT_KEY_SHORTCUT_CHANGED_CELL_END})}}onEnterKeyDown(i){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,i.shiftKey);else if(this.beans.gos.get("enterNavigatesVertically")){const e=i.shiftKey?k.UP:k.DOWN;this.beans.navigationService.navigateToNextCell(null,e,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(k.ENTER,i),this.cellCtrl.isEditing()&&i.preventDefault()}onF2KeyDown(i){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(k.F2,i)}onEscapeKeyDown(i){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(i){if(i.target!==this.eGui||this.cellCtrl.isEditing())return;const s=i.key;s===" "?this.onSpaceKeyDown(i):(this.cellCtrl.startRowOrCellEdit(s,i),i.preventDefault())}onSpaceKeyDown(i){const{gos:e}=this.beans;if(!this.cellCtrl.isEditing()&&e.isRowSelection()){const t=this.rowNode.isSelected(),s=!t;if(s||!e.get("suppressRowDeselection")){const r=this.beans.gos.get("groupSelectsFiltered"),o=this.rowNode.setSelectedParams({newValue:s,rangeSelect:i.shiftKey,groupSelectsFiltered:r,event:i,source:"spaceKey"});t===void 0&&o===0&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:i.shiftKey,groupSelectsFiltered:r,event:i,source:"spaceKey"})}}i.preventDefault()}destroy(){super.destroy()}},mC=class extends Se{constructor(i,e,t){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=i,this.column=e,this.eCell=t}postConstruct(){this.getGui().appendChild(dt("rowDrag",this.gos,null)),this.addGuiEventListener("mousedown",e=>{e.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(i){const e=this.column.getColDef().dndSourceOnRowDrag;i.dataTransfer.setDragImage(this.eCell,0,0);const t=()=>{try{const s=JSON.stringify(this.rowNode.data);i.dataTransfer.setData("application/json",s),i.dataTransfer.setData("text/plain",s)}catch{}};if(e){const s=this.gos.addGridCommonParams({rowNode:this.rowNode,dragEvent:i});e(s)}else t()}checkVisibility(){const i=this.column.isDndSource(this.rowNode);this.setDisplayed(i)}};g([J],mC.prototype,"postConstruct",1);var GS="ag-column-first",VS="ag-column-last",sd=class{static getHeaderClassesFromColDef(i,e,t,s){return be(i)?[]:this.getColumnClassesFromCollDef(i.headerClass,i,e,t,s)}static getToolPanelClassesFromColDef(i,e,t,s){return be(i)?[]:this.getColumnClassesFromCollDef(i.toolPanelClass,i,e,t,s)}static refreshFirstAndLastStyles(i,e,t){i.addOrRemoveCssClass(GS,t.isColumnAtEdge(e,"first")),i.addOrRemoveCssClass(VS,t.isColumnAtEdge(e,"last"))}static getClassParams(i,e,t,s){return e.addGridCommonParams({colDef:i,column:t,columnGroup:s})}static getColumnClassesFromCollDef(i,e,t,s,r){if(be(i))return[];let o;if(typeof i=="function"){const n=this.getClassParams(e,t,s,r);o=i(n)}else o=i;return typeof o=="string"?[o]:Array.isArray(o)?[...o]:[]}},HS="ag-cell",BS="ag-cell-auto-height",WS="ag-cell-normal-height",jS="ag-cell-focus",US="ag-cell-first-right-pinned",zS="ag-cell-last-left-pinned",YS="ag-cell-not-inline-editing",$S="ag-column-hover",KS="ag-cell-wrap-text",XS=0,vC=class Wc extends Z{constructor(e,t,s,r){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=e,this.rowNode=t,this.beans=s,this.rowCtrl=r,this.instanceId=e.getId()+"-"+XS++,this.colIdSanitised=Ft(this.column.getId()),s.gos.get("suppressCellFocus")||(this.tabIndex=-1),this.createCellPosition(),this.addFeatures(),this.updateAndFormatValue(!1)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}addFeatures(){this.cellPositionFeature=new IS(this,this.beans),this.addDestroyFunc(()=>{var t;(t=this.cellPositionFeature)==null||t.destroy(),this.cellPositionFeature=null}),this.cellCustomStyleFeature=new OS(this,this.beans),this.addDestroyFunc(()=>{var t;(t=this.cellCustomStyleFeature)==null||t.destroy(),this.cellCustomStyleFeature=null}),this.cellMouseListenerFeature=new NS(this,this.beans,this.column),this.addDestroyFunc(()=>{var t;(t=this.cellMouseListenerFeature)==null||t.destroy(),this.cellMouseListenerFeature=null}),this.cellKeyboardListenerFeature=new kS(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc(()=>{var t;(t=this.cellKeyboardListenerFeature)==null||t.destroy(),this.cellKeyboardListenerFeature=null}),this.column.isTooltipEnabled()&&(this.enableTooltipFeature(),this.addDestroyFunc(()=>{this.disableTooltipFeature()})),this.beans.rangeService&&this.beans.gos.get("enableRangeSelection")&&(this.cellRangeFeature=new LS(this.beans,this),this.addDestroyFunc(()=>{var t;(t=this.cellRangeFeature)==null||t.destroy(),this.cellRangeFeature=null}))}enableTooltipFeature(e,t){const s=()=>{const n=this.column.getColDef(),a=this.rowNode.data;if(n.tooltipField&&K(a))return an(a,n.tooltipField,this.column.isTooltipFieldContainsDots());const l=n.tooltipValueGetter;return l?l(this.beans.gos.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},r=this.beans.gos.get("tooltipShowMode")==="whenTruncated";!t&&r&&!this.isCellRenderer()&&(t=()=>{const n=this.getGui(),a=n.children.length===0?n:n.querySelector(".ag-cell-value");return a?a.scrollWidth>a.clientWidth:!0});const o={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:e!=null?()=>e:s,getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:t};this.tooltipFeature=new er(o,this.beans)}disableTooltipFeature(){this.tooltipFeature&&(this.tooltipFeature.destroy(),this.tooltipFeature=null)}setComp(e,t,s,r,o){var n,a,l,u;this.cellComp=e,this.eGui=t,this.printLayout=r,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(),(n=this.cellPositionFeature)==null||n.setComp(t),(a=this.cellCustomStyleFeature)==null||a.setComp(e),(l=this.tooltipFeature)==null||l.refreshToolTip(),(u=this.cellKeyboardListenerFeature)==null||u.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(e,t),o&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach(h=>h()),this.onCellCompAttachedFuncs=[])}setupAutoHeight(e){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!e)return;const t=e.parentElement,s=this.beans.gos.getRowHeightForNode(this.rowNode).height,r=a=>{if(this.editing||!this.isAlive())return;const{paddingTop:l,paddingBottom:u,borderBottomWidth:h,borderTopWidth:d}=Rr(t),c=l+u+h+d,y=e.offsetHeight+c;if(a<5){const w=this.beans.gos.getDocument(),_=!w||!w.contains(e),P=y==0;if(_||P){window.setTimeout(()=>r(a+1),0);return}}const f=Math.max(y,s);this.rowNode.setRowAutoHeight(f,this.column)},o=()=>r(0);o();const n=this.beans.resizeObserverService.observeResize(e,o);this.addDestroyFunc(()=>{n(),this.rowNode.setRowAutoHeight(void 0,this.column)})}getCellAriaRole(){var e;return(e=this.column.getColDef().cellAriaRole)!=null?e:"gridcell"}getInstanceId(){return this.instanceId}getColumnIdSanitised(){return this.colIdSanitised}getTabIndex(){return this.tabIndex}isCellRenderer(){const e=this.column.getColDef();return e.cellRenderer!=null||e.cellRendererSelector!=null}getValueToDisplay(){var e;return(e=this.valueFormatted)!=null?e:this.value}showValue(e=!1){var t;const s=this.getValueToDisplay();let r;if(this.rowNode.stub){const o=this.createCellRendererParams();r=this.beans.userComponentFactory.getLoadingCellRendererDetails(this.column.getColDef(),o)}else if(this.isCellRenderer()){const o=this.createCellRendererParams();r=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),o)}this.cellComp.setRenderDetails(r,s,e),(t=this.cellRangeFeature)==null||t.refreshHandle()}setupControlComps(){const e=this.column.getColDef();this.includeSelection=this.isIncludeControl(e.checkboxSelection),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(e){return this.rowNode.rowPinned!=null?!1:typeof e=="function"||e===!0}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(e.checkboxSelection),s=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),r=this.includeDndSource!=this.isIncludeControl(e.dndSource),o=this.isAutoHeight!=this.column.isAutoHeight();return t||s||r||o}startEditing(e=null,t=!1,s=null){if(!this.isCellEditable()||this.editing)return;if(!this.cellComp){this.onCellCompAttachedFuncs.push(()=>{this.startEditing(e,t,s)});return}const r=this.createCellEditorParams(e,t),o=this.column.getColDef(),n=this.beans.userComponentFactory.getCellEditorDetails(o,r);this.editCompDetails=n;const a=n?.popupFromSelector!=null?n.popupFromSelector:!!o.cellEditorPopup,l=n?.popupPositionFromSelector!=null?n.popupPositionFromSelector:o.cellEditorPopupPosition;this.setEditing(!0),this.cellComp.setEditDetails(n,a,l,this.beans.gos.get("reactiveCustomComponents"));const u=this.createEvent(s,b.EVENT_CELL_EDITING_STARTED);this.beans.eventService.dispatchEvent(u)}setEditing(e){var t;this.editing!==e&&(this.editing=e,(t=this.cellRangeFeature)==null||t.refreshHandle())}stopRowOrCellEdit(e=!1){this.beans.gos.get("editType")==="fullRow"?this.rowCtrl.stopEditing(e):this.stopEditing(e)}onPopupEditorClosed(){this.isEditing()&&this.stopEditingAndFocus()}takeValueFromCellEditor(e){const t={newValueExists:!1};if(e)return t;const s=this.cellComp.getCellEditor();return!s||s.isCancelAfterEnd&&s.isCancelAfterEnd()?t:{newValue:s.getValue(),newValueExists:!0}}saveNewValue(e,t){if(t===e)return!1;this.suppressRefreshCell=!0;const s=this.rowNode.setDataValue(this.column,t,"edit");return this.suppressRefreshCell=!1,s}stopEditing(e=!1){if(!this.editing)return!1;const{newValue:t,newValueExists:s}=this.takeValueFromCellEditor(e),r=this.rowNode.getValueFromValueService(this.column);let o=!1;return s&&(o=this.saveNewValue(r,t)),this.setEditing(!1),this.cellComp.setEditDetails(),this.editCompDetails=void 0,this.updateAndFormatValue(!1),this.refreshCell({forceRefresh:!0,suppressFlash:!0}),this.dispatchEditingStoppedEvent(r,t,!e&&!!o),o}dispatchEditingStoppedEvent(e,t,s){const r=lt(de({},this.createEvent(null,b.EVENT_CELL_EDITING_STOPPED)),{oldValue:e,newValue:t,valueChanged:s});this.beans.eventService.dispatchEvent(r)}createCellEditorParams(e,t){return this.beans.gos.addGridCommonParams({value:this.rowNode.getValueFromValueService(this.column),eventKey:e,column:this.column,colDef:this.column.getColDef(),rowIndex:this.getCellPosition().rowIndex,node:this.rowNode,data:this.rowNode.data,cellStartedEdit:t,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.gos.addGridCommonParams({value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.rowNode.getValueFromValueService(this.column),setValue:t=>this.beans.valueService.setValue(this.rowNode,this.column,t),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:(t,s,r,o)=>this.registerRowDragger(t,s,o),setTooltip:(t,s)=>{var r;this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(t,s),(r=this.tooltipFeature)==null||r.refreshToolTip()}})}parseValue(e){return this.beans.valueService.parseValue(this.column,this.rowNode,e,this.getValue())}setFocusOutOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusOut&&e.focusOut()}setFocusInOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusIn?e.focusIn():this.focusCell(!0)}onCellChanged(e){e.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(e){var t;this.refreshShouldDestroy()?(t=this.rowCtrl)==null||t.recreateCell(this):this.refreshCell(e)}refreshCell(e){var t,s,r,o;if(this.suppressRefreshCell||this.editing)return;const n=this.column.getColDef(),a=e!=null&&!!e.newData,l=e!=null&&!!e.suppressFlash||!!n.suppressCellFlash,u=n.field==null&&n.valueGetter==null&&n.showRowGroup==null,h=e&&e.forceRefresh||u||a,d=!!this.cellComp,c=this.updateAndFormatValue(d),p=h||c;if(d){if(p){this.showValue(a);const y=this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();!l&&!y&&(this.beans.gos.get("enableCellChangeFlash")||n.enableCellChangeFlash)&&this.flashCell(),(t=this.cellCustomStyleFeature)==null||t.applyUserStyles(),(s=this.cellCustomStyleFeature)==null||s.applyClassesFromColDef()}(r=this.tooltipFeature)==null||r.refreshToolTip(),(o=this.cellCustomStyleFeature)==null||o.applyCellClassRules()}}stopEditingAndFocus(e=!1,t=!1){this.stopRowOrCellEdit(),this.focusCell(!0),e||this.navigateAfterEdit(t)}navigateAfterEdit(e){if(this.beans.gos.get("enterNavigatesVerticallyAfterEdit")){const s=e?k.UP:k.DOWN;this.beans.navigationService.navigateToNextCell(null,s,this.getCellPosition(),!1)}}flashCell(e){var t,s;const r=(t=e?.flashDuration)!=null?t:e?.flashDelay,o=(s=e?.fadeDuration)!=null?s:e?.fadeDelay;this.animateCell("data-changed",r,o)}animateCell(e,t,s){if(!this.cellComp)return;const r=`ag-cell-${e}`,o=`ag-cell-${e}-animation`,{gos:n}=this.beans;t||(t=n.get("cellFlashDuration")),K(s)||(s=n.get("cellFadeDuration")),this.cellComp.addOrRemoveCssClass(r,!0),this.cellComp.addOrRemoveCssClass(o,!1),this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(r,!1),this.cellComp.addOrRemoveCssClass(o,!0),this.eGui.style.transition=`background-color ${s}ms`,window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(o,!1),this.eGui.style.transition="")},s))},t)})}onFlashCells(e){if(!this.cellComp)return;const t=this.beans.cellPositionUtils.createId(this.getCellPosition());e.cells[t]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(e){var t;return(t=this.callValueFormatter(e))!=null?t:e}callValueFormatter(e){return this.beans.valueService.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e){const t=this.value,s=this.valueFormatted;return this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value),e?!this.valuesAreEqual(t,this.value)||this.valueFormatted!=s:!0}valuesAreEqual(e,t){const s=this.column.getColDef();return s.equals?s.equals(e,t):e===t}getComp(){return this.cellComp}getValue(){return this.value}addDomData(){const e=this.getGui();this.beans.gos.setDomData(e,Wc.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc(()=>this.beans.gos.setDomData(e,Wc.DOM_DATA_KEY_CELL_CTRL,null))}createEvent(e,t){return this.beans.gos.addGridCommonParams({type:t,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),rowPinned:this.rowNode.rowPinned,event:e,rowIndex:this.rowNode.rowIndex})}processCharacter(e){var t;(t=this.cellKeyboardListenerFeature)==null||t.processCharacter(e)}onKeyDown(e){var t;(t=this.cellKeyboardListenerFeature)==null||t.onKeyDown(e)}onMouseEvent(e,t){var s;(s=this.cellMouseListenerFeature)==null||s.onMouseEvent(e,t)}getGui(){return this.eGui}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){var e;this.cellComp&&((e=this.cellPositionFeature)==null||e.onLeftChanged())}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:e,column:t,beans:s}=this;sd.refreshFirstAndLastStyles(e,t,s.columnModel)}refreshAriaColIndex(){const e=this.beans.columnModel.getAriaColumnIndex(this.column);wp(this.getGui(),e)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){var e;return(e=this.cellPositionFeature)==null?void 0:e.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}isPrintLayout(){return this.printLayout}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(e,t=null){if(!this.cellComp){this.onCellCompAttachedFuncs.push(()=>{this.startRowOrCellEdit(e,t)});return}this.beans.gos.get("editType")==="fullRow"?this.rowCtrl.startRowEditing(e,this):this.startEditing(e,!0,t)}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 this.cellRangeFeature!=null}focusCell(e=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:e})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}onFirstRightPinnedChanged(){if(!this.cellComp)return;const e=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass(US,e)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const e=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass(zS,e)}onCellFocused(e){if(this.beans.gos.get("suppressCellFocus"))return;const t=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp){t&&e?.forceBrowserFocus&&(this.focusEventToRestore=e);return}this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass(jS,t),t&&e&&e.forceBrowserFocus&&this.cellComp.getFocusableElement().focus({preventScroll:!!e.preventScrollOnBrowserFocus});const s=this.beans.gos.get("editType")==="fullRow";!t&&!s&&this.editing&&this.stopRowOrCellEdit(),t&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:Fs(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass(HS,!0),this.cellComp.addOrRemoveCssClass(YS,!0);const e=this.column.isAutoHeight()==!0;this.cellComp.addOrRemoveCssClass(BS,e),this.cellComp.addOrRemoveCssClass(WS,!e)}onColumnHover(){if(!this.cellComp||!this.beans.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass($S,e)}onColDefChanged(){if(!this.cellComp)return;if(this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),!this.editing)this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0});else{const t=this.getCellEditor();if(t?.refresh){const{eventKey:s,cellStartedEdit:r}=this.editCompDetails.params,o=this.createCellEditorParams(s,r),n=this.column.getColDef(),a=this.beans.userComponentFactory.getCellEditorDetails(n,o);t.refresh(a.params)}}}setWrapText(){const e=this.column.getColDef().wrapText==!0;this.cellComp.addOrRemoveCssClass(KS,e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),s=this.createEvent(e,b.EVENT_CELL_CONTEXT_MENU);this.beans.eventService.dispatchEvent(s),t.onCellContextMenu&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{t.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 e=new Jh;return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=new mC(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(e),e}registerRowDragger(e,t,s){if(this.customRowDragComp){this.customRowDragComp.setDragElement(e,t);return}const r=this.createRowDragComp(e,t,s);r&&(this.customRowDragComp=r,this.addDestroyFunc(()=>{this.beans.context.destroyBean(r),this.customRowDragComp=null}))}createRowDragComp(e,t,s){const r=this.beans.gos.get("pagination"),o=this.beans.gos.get("rowDragManaged"),n=this.beans.gos.isRowModelType("clientSide");if(o){if(!n){fe("managed row dragging is only allowed in the Client Side Row Model");return}if(r){fe("managed row dragging is not possible when doing pagination");return}}const a=new ho(()=>this.value,this.rowNode,this.column,e,t,s);return this.beans.context.createBean(a),a}};vC.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var oo=vC,qS=0,CC=class jc extends Z{constructor(e,t,s,r,o){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=t,this.gos=t.gos,this.rowNode=e,this.paginationPage=t.paginationProxy.getCurrentPage(),this.useAnimationFrameForCreate=r,this.printLayout=o,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=e.id+"-"+qS++,this.rowId=Ft(e.id),this.initRowBusinessKey(),this.rowFocused=t.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=t.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.setAnimateFlags(s),this.rowStyles=this.processStylesFromGridOptions(),this.isFullWidth()&&!this.gos.get("suppressCellFocus")&&(this.tabIndex=-1),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if(typeof this.businessKeyForNodeFunc!="function")return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=Ft(e)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}getTabIndex(){return this.tabIndex}isSticky(){return this.rowNode.sticky}getInstanceId(){return this.instanceId}setComp(e,t,s){const r={rowComp:e,element:t,containerType:s};this.allRowGuis.push(r),s==="left"?this.leftGui=r:s==="right"?this.rightGui=r:s==="fullWidth"?this.fullWidthGui=r:this.centerGui=r,this.initialiseRowComp(r),this.rowType!=="FullWidthLoading"&&!this.rowNode.rowPinned&&this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(e){switch(this.allRowGuis=this.allRowGuis.filter(t=>t.containerType!==e),e){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;break}}isCacheable(){return this.rowType==="FullWidthDetail"&&this.gos.get("keepDetailRows")}setCached(e){const t=e?"none":"";this.allRowGuis.forEach(s=>s.element.style.display=t)}initialiseRowComp(e){const t=this.gos;this.listenOnDomOrder(e),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(e),this.updateRowIndexes(e),this.setFocusedClasses(e),this.setStylesFromGridOptions(!1,e),t.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(e),this.updateColumnLists(!this.useAnimationFrameForCreate);const s=e.rowComp;this.getInitialRowClasses(e.containerType).forEach(o=>s.addOrRemoveCssClass(o,!0)),this.executeSlideAndFadeAnimations(e),this.rowNode.group&&Xs(e.element,this.rowNode.expanded==!0),this.setRowCompRowId(s),this.setRowCompRowBusinessKey(s),t.setDomData(e.element,jc.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc(()=>t.setDomData(e.element,jc.DOM_DATA_KEY_ROW_CTRL,null)),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,e.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(e.element),this.isFullWidth()&&this.setupFullWidth(e),t.get("rowDragEntireRow")&&this.addRowDraggerToRow(e),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask(()=>{this.isAlive()&&e.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){this.businessKeySanitised!=null&&e.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(e){this.rowId=Ft(this.rowNode.id),this.rowId!=null&&e.setRowId(this.rowId)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&(Pc(()=>{this.onTopChanged()}),this.slideInAnimation[t]=!1),this.fadeInAnimation[t]&&(Pc(()=>{e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[t]=!1)}addRowDraggerToRow(e){if(this.gos.get("enableRangeSelection")){fe("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `enableRangeSelection: true`");return}const t=this.beans.localeService.getLocaleTextFunc(),s=new ho(()=>`1 ${t("rowDragRow","row")}`,this.rowNode,void 0,e.element,void 0,!0),r=this.createBean(s,this.beans.context);this.rowDragComps.push(r)}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType);if(this.rowType=="FullWidthDetail"&&!ze.__assertRegistered("@ag-grid-enterprise/master-detail","cell renderer 'agDetailCellRenderer' (for master detail)",this.beans.context.getGridId()))return;const s=this.createFullWidthCompDetails(e.element,t);e.rowComp.showFullWidth(s)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){var e,t;return this.gos.get("embedFullWidthRows")?this.allRowGuis.map(s=>{var r;return(r=s?.rowComp)==null?void 0:r.getFullWidthCellRenderer()}):[(t=(e=this.fullWidthGui)==null?void 0:e.rowComp)==null?void 0:t.getFullWidthCellRenderer()]}getCellElement(e){const t=this.getCellCtrl(e);return t?t.getGui():null}executeProcessRowPostCreateFunc(){const e=this.gos.getCallback("processRowPostCreate");if(!e||!this.areAllContainersReady())return;const 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)};e(t)}areAllContainersReady(){const e=!!this.leftGui||!this.beans.columnModel.isPinningLeft(),t=!!this.centerGui,s=!!this.rightGui||!this.beans.columnModel.isPinningRight();return e&&t&&s}setRowType(){const e=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow"),t=this.rowNode.isFullWidthCell(),s=this.gos.get("masterDetail")&&this.rowNode.detail,r=this.beans.columnModel.isPivotMode(),n=!!this.rowNode.group&&!this.rowNode.footer&&this.gos.isGroupUseEntireRow(r);e?this.rowType="FullWidthLoading":s?this.rowType="FullWidthDetail":t?this.rowType="FullWidth":n?this.rowType="FullWidthGroup":this.rowType="Normal"}updateColumnLists(e=!1,t=!1){if(this.isFullWidth())return;if(e||this.gos.get("suppressAnimationFrame")||this.printLayout){this.updateColumnListsImpl(t);return}this.updateColumnListsPending||(this.beans.animationFrameService.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0)}createCellCtrls(e,t,s=null){const r={list:[],map:{}},o=(n,a)=>{r.list.push(a),r.map[n]=a};return t.forEach(n=>{const a=n.getInstanceId();let l=e.map[a];l||(l=new oo(n,this.rowNode,this.beans,this)),o(a,l)}),e.list.forEach(n=>{if(r.map[n.getColumn().getInstanceId()]!=null)return;if(!this.isCellEligibleToBeRemoved(n,s)){o(n.getColumn().getInstanceId(),n);return}n.destroy()}),r}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){this.allRowGuis.forEach(t=>{const s=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(s,e)})}getCellCtrlsForContainer(e){switch(e){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list;default:const t=e;throw new Error(`Unhandled case: ${t}`)}}createAllCellCtrls(){const e=this.beans.columnModel;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,e.getAllDisplayedColumns()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const t=e.getViewportCenterColumnsForRow(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,t);const s=e.getDisplayedLeftColumnsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,s,"left");const r=e.getDisplayedRightColumnsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,r,"right")}}isCellEligibleToBeRemoved(e,t){if(e.getColumn().getPinned()!=t)return!0;const n=e.isEditing(),a=this.beans.focusService.isCellFocused(e.getCellPosition());if(n||a){const u=e.getColumn();return!(this.beans.columnModel.getAllDisplayedColumns().indexOf(u)>=0)}return!0}getDomOrder(){return this.gos.get("ensureDomOrder")||this.gos.isDomLayout("print")}listenOnDomOrder(e){const t=()=>{e.rowComp.setDomOrder(this.getDomOrder())};this.addManagedPropertyListener("domLayout",t),this.addManagedPropertyListener("ensureDomOrder",t)}setAnimateFlags(e){if(this.isSticky()||!e)return;const t=K(this.rowNode.oldRowTop),s=this.beans.columnModel.isPinningLeft(),r=this.beans.columnModel.isPinningRight();if(t){if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){this.slideInAnimation.fullWidth=!0;return}this.slideInAnimation.center=!0,this.slideInAnimation.left=s,this.slideInAnimation.right=r}else{if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){this.fadeInAnimation.fullWidth=!0;return}this.fadeInAnimation.center=!0,this.fadeInAnimation.left=s,this.fadeInAnimation.right=r}}isEditing(){return this.editingRow}isFullWidth(){return this.rowType!=="Normal"}refreshFullWidth(){const e=(a,l)=>a?a.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(a.element,l).params):!0,t=e(this.fullWidthGui,null),s=e(this.centerGui,null),r=e(this.leftGui,"left"),o=e(this.rightGui,"right");return t&&s&&r&&o}addListeners(){this.addManagedListener(this.rowNode,Me.EVENT_HEIGHT_CHANGED,()=>this.onRowHeightChanged()),this.addManagedListener(this.rowNode,Me.EVENT_ROW_SELECTED,()=>this.onRowSelected()),this.addManagedListener(this.rowNode,Me.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,Me.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,Me.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,Me.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.rowNode.detail&&this.addManagedListener(this.rowNode.parent,Me.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,Me.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,Me.EVENT_CELL_CHANGED,this.postProcessCss.bind(this)),this.addManagedListener(this.rowNode,Me.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,Me.EVENT_DRAGGING_CHANGED,this.postProcessRowDragging.bind(this)),this.addManagedListener(this.rowNode,Me.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));const e=this.beans.eventService;this.addManagedListener(e,b.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOffsetChanged.bind(this)),this.addManagedListener(e,b.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(e,b.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(e,b.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(e,b.EVENT_CELL_FOCUSED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,b.EVENT_CELL_FOCUS_CLEARED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,b.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(e,b.EVENT_MODEL_UPDATED,this.refreshFirstAndLastRowStyles.bind(this)),this.addManagedListener(e,b.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"],()=>{if(this.gos.get("rowDragEntireRow")){this.allRowGuis.forEach(s=>{this.addRowDraggerToRow(s)});return}this.destroyBeans(this.rowDragComps,this.beans.context),this.rowDragComps=[]}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListener(this.rowNode,Me.EVENT_ROW_INDEX_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onRowIndexChanged())}),this.addManagedListener(this.rowNode,Me.EVENT_CELL_CHANGED,e=>{this.getAllCellCtrls().forEach(t=>t.onCellChanged(e))})}onRowNodeDataChanged(e){if(this.isFullWidth()!==!!this.rowNode.isFullWidthCell()){this.beans.rowRenderer.redrawRow(this.rowNode);return}if(this.isFullWidth()){this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode);return}this.getAllCellCtrls().forEach(s=>s.refreshCell({suppressFlash:!e.update,newData:!e.update})),this.allRowGuis.forEach(s=>{this.setRowCompRowId(s.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(s.rowComp)}),this.onRowSelected(),this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const e=this.rowNode.highlighted;this.allRowGuis.forEach(t=>{const s=e===0,r=e===1;t.rowComp.addOrRemoveCssClass("ag-row-highlight-above",s),t.rowComp.addOrRemoveCssClass("ag-row-highlight-below",r)})}postProcessRowDragging(){const e=this.rowNode.dragging;this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-row-dragging",e))}updateExpandedCss(){const e=this.rowNode.isExpandable(),t=this.rowNode.expanded==!0;this.allRowGuis.forEach(s=>{s.rowComp.addOrRemoveCssClass("ag-row-group",e),s.rowComp.addOrRemoveCssClass("ag-row-group-expanded",e&&t),s.rowComp.addOrRemoveCssClass("ag-row-group-contracted",e&&!t),Xs(s.element,e&&t)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:Fs(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.allRowGuis.find(l=>l.element.contains(e.target));if(!((t?t.element:null)===e.target))return;const o=this.rowNode,n=this.beans.focusService.getFocusedCell(),a={rowIndex:o.rowIndex,rowPinned:o.rowPinned,column:n&&n.column};this.beans.navigationService.navigateToNextCell(e,e.key,a,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||vs(e))return;const t=this.allRowGuis.find(n=>n.element.contains(e.target)),s=t?t.element:null,r=s===e.target;let o=null;r||(o=this.beans.focusService.findNextFocusableElement(s,!1,e.shiftKey)),(this.isFullWidth()&&r||!o)&&this.beans.navigationService.onTabKeyDown(this,e)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){var e;const t=(e=this.allRowGuis.find(s=>Pi(s.element)))==null?void 0:e.element;return t?t.getBoundingClientRect().top:0}onFullWidthRowFocused(e){var t;const s=this.rowNode,r=e?this.isFullWidth()&&e.rowIndex===s.rowIndex&&e.rowPinned==s.rowPinned:!1,o=this.fullWidthGui?this.fullWidthGui.element:(t=this.centerGui)==null?void 0:t.element;o&&(o.classList.toggle("ag-full-width-focus",r),r&&o.focus({preventScroll:!0}))}recreateCell(e){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,e),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,e),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,e),e.destroy(),this.updateColumnLists()}removeCellCtrl(e,t){const s={list:[],map:{}};return e.list.forEach(r=>{r!==t&&(s.list.push(r),s.map[r.getColumn().getInstanceId()]=r)}),s}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"touchstart":case"mousedown":this.onRowMouseDown(t);break}}createRowEvent(e,t){return this.gos.addGridCommonParams({type:e,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,event:t})}createRowEventWithSource(e,t){const s=this.createRowEvent(e,t);return s.source=this,s}onRowDblClick(e){if(vs(e))return;const t=this.createRowEventWithSource(b.EVENT_ROW_DOUBLE_CLICKED,e);this.beans.eventService.dispatchEvent(t)}onRowMouseDown(e){if(this.lastMouseDownOnDragger=so(e.target,"ag-row-drag",3),!this.isFullWidth())return;const t=this.rowNode,s=this.beans.columnModel;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges(),this.beans.focusService.setFocusedCell({rowIndex:t.rowIndex,column:s.getAllDisplayedColumns()[0],rowPinned:t.rowPinned,forceBrowserFocus:!0})}onRowClick(e){if(vs(e)||this.lastMouseDownOnDragger)return;const s=this.createRowEventWithSource(b.EVENT_ROW_CLICKED,e);this.beans.eventService.dispatchEvent(s);const r=e.ctrlKey||e.metaKey,o=e.shiftKey;if(this.gos.get("groupSelectsChildren")&&this.rowNode.group||this.isRowSelectionBlocked()||this.gos.get("suppressRowClickSelection"))return;const a=this.gos.get("rowMultiSelectWithClick"),l=!this.gos.get("suppressRowDeselection"),u="rowClicked";if(this.rowNode.isSelected())a?this.rowNode.setSelectedParams({newValue:!1,event:e,source:u}):r?l&&this.rowNode.setSelectedParams({newValue:!1,event:e,source:u}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!o,rangeSelect:o,event:e,source:u});else{const h=a?!1:!r;this.rowNode.setSelectedParams({newValue:!0,clearSelection:h,rangeSelect:o,event:e,source:u})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!this.gos.isRowSelection()}setupDetailRowAutoHeight(e){if(this.rowType!=="FullWidthDetail"||!this.gos.get("detailRowAutoHeight"))return;const t=()=>{const r=e.clientHeight;if(r!=null&&r>0){const o=()=>{this.rowNode.setRowHeight(r),this.beans.clientSideRowModel?this.beans.clientSideRowModel.onRowHeightChanged():this.beans.serverSideRowModel&&this.beans.serverSideRowModel.onRowHeightChanged()};window.setTimeout(o,0)}},s=this.beans.resizeObserverService.observeResize(e,t);this.addDestroyFunc(s),t()}createFullWidthCompDetails(e,t){const s=this.gos.addGridCommonParams({fullWidth:!0,data:this.rowNode.data,node:this.rowNode,value:this.rowNode.key,valueFormatted:this.rowNode.key,rowIndex:this.rowNode.rowIndex,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(r,o,n,a)=>this.addFullWidthRowDragging(r,o,n,a),setTooltip:(r,o)=>this.refreshRowTooltip(r,o)});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(e,t){if(!this.fullWidthGui)return;const s={getGui:()=>this.fullWidthGui.element,getTooltipValue:()=>e,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:t};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new er(s,this.beans))}addFullWidthRowDragging(e,t,s="",r){if(!this.isFullWidth())return;const o=new ho(()=>s,this.rowNode,void 0,e,t,r);this.createBean(o,this.beans.context),this.addDestroyFunc(()=>{this.destroyBean(o,this.beans.context)})}onUiLevelChanged(){const e=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,s="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(r=>{r.rowComp.addOrRemoveCssClass(t,!0),r.rowComp.addOrRemoveCssClass(s,!1)})}this.rowLevel=e}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageLastRow()}refreshFirstAndLastRowStyles(){const e=this.isFirstRowOnPage(),t=this.isLastRowOnPage();this.firstRowOnPage!==e&&(this.firstRowOnPage=e,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-first",e))),this.lastRowOnPage!==t&&(this.lastRowOnPage=t,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-last",t)))}stopEditing(e=!1){if(this.stoppingRowEdit)return;const t=this.getAllCellCtrls(),s=this.editingRow;this.stoppingRowEdit=!0;let r=!1;for(const o of t){const n=o.stopEditing(e);s&&!e&&!r&&n&&(r=!0)}if(r){const o=this.createRowEvent(b.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(o)}s&&this.setEditingRow(!1),this.stoppingRowEdit=!1}setInlineEditingCss(e){this.allRowGuis.forEach(t=>{t.rowComp.addOrRemoveCssClass("ag-row-inline-editing",e),t.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!e)})}setEditingRow(e){this.editingRow=e,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-editing",e));const t=e?this.createRowEvent(b.EVENT_ROW_EDITING_STARTED):this.createRowEvent(b.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(t)}startRowEditing(e=null,t=null,s=null){if(this.editingRow)return;this.getAllCellCtrls().reduce((o,n)=>{const a=n===t;return a?n.startEditing(e,a,s):n.startEditing(null,a,s),o?!0:n.isEditing()},!1)&&this.setEditingRow(!0)}getAllCellCtrls(){return this.leftCellCtrls.list.length===0&&this.rightCellCtrls.list.length===0?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const e=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);!e||!e.length||e.forEach(t=>{this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass(t,!0))})}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!0))},e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!1))})}setStylesFromGridOptions(e,t){e&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(t,s=>s.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(e){return e==="left"?"left":e==="right"?"right":null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),s={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[e],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:t};return this.beans.rowCssClassCalculator.getInitialRowClasses(s)}processStylesFromGridOptions(){const e=this.gos.get("rowStyle");if(e&&typeof e=="function"){console.warn("AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");return}const t=this.gos.getCallback("getRowStyle");let s;if(t){const r={data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex};s=t(r)}return s||e?Object.assign({},e,s):this.emptyStyle}onRowSelected(e){const t=!!this.rowNode.isSelected();this.forEachGui(e,s=>{s.rowComp.addOrRemoveCssClass("ag-row-selected",t),fn(s.element,t),s.element.contains(this.beans.gos.getActiveDomElement())&&(s===this.centerGui||s===this.fullWidthGui)&&this.announceDescription()})}announceDescription(){if(this.isRowSelectionBlocked())return;const e=this.rowNode.isSelected();if(e&&this.beans.gos.get("suppressRowDeselection"))return;const s=this.beans.localeService.getLocaleTextFunc()(e?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${e?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(s)}addHoverFunctionality(e){this.active&&(this.addManagedListener(e,"mouseenter",()=>this.rowNode.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.rowNode.onMouseLeave()),this.addManagedListener(this.rowNode,Me.EVENT_MOUSE_ENTER,()=>{!this.beans.dragService.isDragging()&&!this.gos.get("suppressRowHoverHighlight")&&(e.classList.add("ag-row-hover"),this.rowNode.setHovered(!0))}),this.addManagedListener(this.rowNode,Me.EVENT_MOUSE_LEAVE,()=>{e.classList.remove("ag-row-hover"),this.rowNode.setHovered(!1)}))}roundRowTopToBounds(e){const t=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),s=this.applyPaginationOffset(t.top,!0)-100,r=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(s,e),r)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(e,t){e?t(e):this.allRowGuis.forEach(t)}onRowHeightChanged(e){if(this.rowNode.rowHeight==null)return;const t=this.rowNode.rowHeight,s=this.beans.environment.getDefaultRowHeight(),o=this.gos.isGetRowHeightFunction()?this.gos.getRowHeightForNode(this.rowNode).height:void 0,n=o?`${Math.min(s,o)-2}px`:void 0;this.forEachGui(e,a=>{a.element.style.height=`${t}px`,n&&a.element.style.setProperty("--ag-line-height",n)})}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}destroyFirstPass(e=!1){if(this.active=!1,!e&&this.gos.isAnimateRows()&&!this.isSticky())if(this.rowNode.rowTop!=null){const r=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(r)}else this.allRowGuis.forEach(r=>r.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0));this.rowNode.setHovered(!1);const t=this.createRowEvent(b.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(t),this.beans.eventService.dispatchEvent(t),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const e=t=>(t.list.forEach(s=>s.destroy()),{list:[],map:{}});this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,t=>{t.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),t.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){const e=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);e!==this.rowFocused&&(this.rowFocused=e,this.setFocusedClasses()),!e&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){const e=this.beans.paginationProxy.getCurrentPage();this.paginationPage!==e&&(this.paginationPage=e,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(e,t=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return e;const s=this.beans.paginationProxy.getPixelOffset();return e+s*(t?1:-1)}setRowTop(e){if(!this.printLayout&&K(e)){const t=this.applyPaginationOffset(e),o=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeightService.getRealPixelPosition(t)}px`;this.setRowTopStyle(o)}}getInitialRowTop(e){return this.suppressRowTransform?this.getInitialRowTopShared(e):void 0}getInitialTransform(e){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(e)})`}getInitialRowTopShared(e){if(this.printLayout)return"";let t;if(this.isSticky())t=this.rowNode.stickyRowTop;else{const s=this.slideInAnimation[e]?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop,r=this.applyPaginationOffset(s);t=this.rowNode.isRowPinned()?r:this.beans.rowContainerHeightService.getRealPixelPosition(r)}return t+"px"}setRowTopStyle(e){this.allRowGuis.forEach(t=>this.suppressRowTransform?t.rowComp.setTop(e):t.rowComp.setTransform(`translateY(${e})`))}getRowNode(){return this.rowNode}getCellCtrl(e){let t=null;return this.getAllCellCtrls().forEach(s=>{s.getColumn()==e&&(t=s)}),t!=null||this.getAllCellCtrls().forEach(s=>{s.getColSpanningList().indexOf(e)>=0&&(t=s)}),t}onRowIndexChanged(){this.rowNode.rowIndex!=null&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(e){const t=this.rowNode.getRowIndexString(),s=this.beans.headerNavigationService.getHeaderRowCount()+this.beans.filterManager.getHeaderRowCount(),r=this.rowNode.rowIndex%2===0,o=s+this.rowNode.rowIndex+1;this.forEachGui(e,n=>{n.rowComp.setRowIndex(t),n.rowComp.addOrRemoveCssClass("ag-row-even",r),n.rowComp.addOrRemoveCssClass("ag-row-odd",!r),yp(n.element,o)})}};CC.DOM_DATA_KEY_ROW_CTRL="renderedRow";var no=CC,Ti=class extends Z{constructor(i){super(),this.element=i}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const i="keydown",e=this.processKeyboardEvent.bind(this,i);this.addManagedListener(this.element,i,e)}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",gp("touchstart")?"touchstart":"mousedown"].forEach(t=>{const s=this.processMouseEvent.bind(this,t);this.addManagedListener(this.element,t,s)})}processMouseEvent(i,e){if(!this.mouseEventService.isEventFromThisGrid(e)||vs(e))return;const t=this.getRowForEvent(e),s=this.mouseEventService.getRenderedCellForEvent(e);i==="contextmenu"?this.handleContextMenuMouseEvent(e,void 0,t,s):(s&&s.onMouseEvent(i,e),t&&t.onMouseEvent(i,e))}mockContextMenuForIPad(){if(!Js())return;const i=new Kt(this.element),e=t=>{const s=this.getRowForEvent(t.touchEvent),r=this.mouseEventService.getRenderedCellForEvent(t.touchEvent);this.handleContextMenuMouseEvent(void 0,t.touchEvent,s,r)};this.addManagedListener(i,Kt.EVENT_LONG_TAP,e),this.addDestroyFunc(()=>i.destroy())}getRowForEvent(i){let e=i.target;for(;e;){const t=this.gos.getDomData(e,no.DOM_DATA_KEY_ROW_CTRL);if(t)return t;e=e.parentElement}return null}handleContextMenuMouseEvent(i,e,t,s){const r=t?t.getRowNode():null,o=s?s.getColumn():null;let n=null;if(o){const u=i||e;s.dispatchCellContextMenuEvent(u??null),n=this.valueService.getValue(o,r)}const a=this.ctrlsService.getGridBodyCtrl(),l=s?s.getGui():a.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:i,touchEvent:e,rowNode:r,column:o,value:n,anchorToElement:l})}getControlsForEventTarget(i){return{cellCtrl:Zu(this.gos,i,oo.DOM_DATA_KEY_CELL_CTRL),rowCtrl:Zu(this.gos,i,no.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(i,e){const{cellCtrl:t,rowCtrl:s}=this.getControlsForEventTarget(e.target);e.defaultPrevented||(t?this.processCellKeyboardEvent(t,i,e):s&&s.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,i,e))}processCellKeyboardEvent(i,e,t){const s=i.getRowNode(),r=i.getColumn(),o=i.isEditing();if(!ih(this.gos,t,s,r,o)&&e==="keydown"&&(!o&&this.navigationService.handlePageScrollingKey(t)||i.onKeyDown(t),this.doGridOperations(t,i.isEditing()),zh(t)&&i.processCharacter(t)),e==="keydown"){const a=i.createEvent(t,b.EVENT_CELL_KEY_DOWN);this.eventService.dispatchEvent(a)}}processFullWidthRowKeyboardEvent(i,e,t){const s=i.getRowNode(),r=this.focusService.getFocusedCell(),o=r&&r.column;if(!ih(this.gos,t,s,o,!1)){const a=t.key;if(e==="keydown")switch(a){case k.PAGE_HOME:case k.PAGE_END:case k.PAGE_UP:case k.PAGE_DOWN:this.navigationService.handlePageScrollingKey(t,!0);break;case k.UP:case k.DOWN:i.onKeyboardNavigate(t);break;case k.TAB:i.onTabKeyDown(t);break}}if(e==="keydown"){const a=i.createRowEvent(b.EVENT_CELL_KEY_DOWN,t);this.eventService.dispatchEvent(a)}}doGridOperations(i,e){if(!i.ctrlKey&&!i.metaKey||e||!this.mouseEventService.isEventFromThisGrid(i))return;const t=wv(i);if(t===k.A)return this.onCtrlAndA(i);if(t===k.C)return this.onCtrlAndC(i);if(t===k.D)return this.onCtrlAndD(i);if(t===k.V)return this.onCtrlAndV(i);if(t===k.X)return this.onCtrlAndX(i);if(t===k.Y)return this.onCtrlAndY();if(t===k.Z)return this.onCtrlAndZ(i)}onCtrlAndA(i){const{pinnedRowModel:e,paginationProxy:t,rangeService:s}=this;if(s&&t.isRowsToRender()){const[r,o]=[e.isEmpty("top"),e.isEmpty("bottom")],n=r?null:"top";let a,l;o?(a=null,l=this.paginationProxy.getRowCount()-1):(a="bottom",l=e.getPinnedBottomRowData().length-1);const u=this.columnModel.getAllDisplayedColumns();if(zi(u))return;s.setCellRange({rowStartIndex:0,rowStartPinned:n,rowEndIndex:l,rowEndPinned:a,columnStart:u[0],columnEnd:We(u)})}i.preventDefault()}onCtrlAndC(i){if(!this.clipboardService||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:e,rowCtrl:t}=this.getControlsForEventTarget(i.target);e?.isEditing()||t?.isEditing()||(i.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(i){if(!this.clipboardService||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:e,rowCtrl:t}=this.getControlsForEventTarget(i.target);e?.isEditing()||t?.isEditing()||(i.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(i){const{cellCtrl:e,rowCtrl:t}=this.getControlsForEventTarget(i.target);e?.isEditing()||t?.isEditing()||this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(i){this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),i.preventDefault()}onCtrlAndZ(i){this.gos.get("undoRedoCellEditing")&&(i.preventDefault(),i.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService.redo("ui")}};g([R("mouseEventService")],Ti.prototype,"mouseEventService",2);g([R("valueService")],Ti.prototype,"valueService",2);g([R("menuService")],Ti.prototype,"menuService",2);g([R("ctrlsService")],Ti.prototype,"ctrlsService",2);g([R("navigationService")],Ti.prototype,"navigationService",2);g([R("focusService")],Ti.prototype,"focusService",2);g([R("undoRedoService")],Ti.prototype,"undoRedoService",2);g([R("columnModel")],Ti.prototype,"columnModel",2);g([R("paginationProxy")],Ti.prototype,"paginationProxy",2);g([R("pinnedRowModel")],Ti.prototype,"pinnedRowModel",2);g([Ke("rangeService")],Ti.prototype,"rangeService",2);g([Ke("clipboardService")],Ti.prototype,"clipboardService",2);g([J],Ti.prototype,"postConstruct",1);var Nn=class extends Z{constructor(i){super(),this.centerContainerCtrl=i}postConstruct(){this.ctrlsService.whenReady(i=>{this.gridBodyCtrl=i.gridBodyCtrl,this.listenForResize()}),this.addManagedListener(this.eventService,b.EVENT_SCROLLBAR_WIDTH_CHANGED,this.onScrollbarWidthChanged.bind(this)),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const i=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(i),this.gridBodyCtrl.registerBodyViewportResizeListener(i)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const i=this.centerContainerCtrl.getCenterWidth();i!==this.centerWidth&&(this.centerWidth=i,this.columnModel.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const i=this.gridBodyCtrl.getBodyViewportElement(),e=To(i);if(e<=50)return;let t=this.getPinnedColumnsOverflowingViewport(e-50);const s=this.gos.getCallback("processUnpinnedColumns");t.length&&(s&&(t=s({columns:t,viewportWidth:e})),this.columnModel.setColumnsPinned(t,null,"viewportSizeFeature"))}getPinnedColumnsOverflowingViewport(i){const e=this.pinnedWidthService.getPinnedRightWidth(),t=this.pinnedWidthService.getPinnedLeftWidth(),s=e+t;if(s<i)return[];const r=[...this.columnModel.getDisplayedLeftColumns()],o=[...this.columnModel.getDisplayedRightColumns()];let n=0,a=0,l=0;const u=[];let h=s-l-i;for(;(a<r.length||n<o.length)&&h>0;){if(n<o.length){const d=o[n++];h-=d.getActualWidth(),u.push(d)}if(a<r.length&&h>0){const d=r[a++];h-=d.getActualWidth(),u.push(d)}}return u}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const i=this.gridBodyCtrl.getBodyViewportElement(),e=El(i);if(this.bodyHeight!==e){this.bodyHeight=e;const t={type:b.EVENT_BODY_HEIGHT_CHANGED};this.eventService.dispatchEvent(t)}}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const i={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(i)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const i=this.centerContainerCtrl.getCenterWidth(),e=this.centerContainerCtrl.getViewportScrollLeft();this.columnModel.setViewportPosition(i,e)}};g([R("ctrlsService")],Nn.prototype,"ctrlsService",2);g([R("pinnedWidthService")],Nn.prototype,"pinnedWidthService",2);g([R("columnModel")],Nn.prototype,"columnModel",2);g([R("scrollVisibleService")],Nn.prototype,"scrollVisibleService",2);g([J],Nn.prototype,"postConstruct",1);var Zp=class extends Z{constructor(i){super(),this.element=i}postConstruct(){this.addManagedListener(this.eventService,b.EVENT_LEFT_PINNED_WIDTH_CHANGED,this.onPinnedLeftWidthChanged.bind(this))}onPinnedLeftWidthChanged(){const i=this.pinnedWidthService.getPinnedLeftWidth(),e=i>0;Ge(this.element,e),Zi(this.element,i)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}};g([R("pinnedWidthService")],Zp.prototype,"pinnedWidthService",2);g([J],Zp.prototype,"postConstruct",1);var Jp=class extends Z{constructor(i){super(),this.element=i}postConstruct(){this.addManagedListener(this.eventService,b.EVENT_RIGHT_PINNED_WIDTH_CHANGED,this.onPinnedRightWidthChanged.bind(this))}onPinnedRightWidthChanged(){const i=this.pinnedWidthService.getPinnedRightWidth(),e=i>0;Ge(this.element,e),Zi(this.element,i)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}};g([R("pinnedWidthService")],Jp.prototype,"pinnedWidthService",2);g([J],Jp.prototype,"postConstruct",1);var rd=class extends Z{constructor(i,e){super(),this.eContainer=i,this.eViewport=e}postConstruct(){this.addManagedListener(this.eventService,b.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onHeightChanged.bind(this))}onHeightChanged(){const i=this.maxDivHeightScaler.getUiContainerHeight(),e=i!=null?`${i}px`:"";this.eContainer.style.height=e,this.eViewport&&(this.eViewport.style.height=e)}};g([R("rowContainerHeightService")],rd.prototype,"maxDivHeightScaler",2);g([J],rd.prototype,"postConstruct",1);var od=class extends Z{constructor(i){super(),this.eContainer=i}postConstruct(){if(!this.rangeService)return;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",e=>{if(e.currentValue){this.enableFeature();return}this.disableFeature()}),this.addDestroyFunc(()=>this.disableFeature()),this.gos.get("enableRangeSelection")&&this.enableFeature()}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}};g([R("dragService")],od.prototype,"dragService",2);g([Ke("rangeService")],od.prototype,"rangeService",2);g([J],od.prototype,"postConstruct",1);var kn=class extends Z{constructor(i,e=!1){super(),this.callback=i,this.addSpacer=e}postConstruct(){const i=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",i),this.addManagedListener(this.eventService,b.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_CHANGED,i),this.addManagedListener(this.eventService,b.EVENT_LEFT_PINNED_WIDTH_CHANGED,i),this.addSpacer&&(this.addManagedListener(this.eventService,b.EVENT_RIGHT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,b.EVENT_SCROLL_VISIBILITY_CHANGED,i),this.addManagedListener(this.eventService,b.EVENT_SCROLLBAR_WIDTH_CHANGED,i)),this.setWidth()}setWidth(){const{columnModel:i}=this,e=this.gos.isDomLayout("print"),t=i.getBodyContainerWidth(),s=i.getDisplayedColumnsLeftWidth(),r=i.getDisplayedColumnsRightWidth();let o;e?o=t+s+r:(o=t,this.addSpacer&&(this.gos.get("enableRtl")?s:r)===0&&this.scrollVisibleService.isVerticalScrollShowing()&&(o+=this.gos.getScrollbarWidth())),this.callback(o)}};g([R("columnModel")],kn.prototype,"columnModel",2);g([R("scrollVisibleService")],kn.prototype,"scrollVisibleService",2);g([J],kn.prototype,"postConstruct",1);var at=(i=>(i.LEFT="left",i.RIGHT="right",i.CENTER="center",i.FULL_WIDTH="fullWidth",i.TOP_LEFT="topLeft",i.TOP_RIGHT="topRight",i.TOP_CENTER="topCenter",i.TOP_FULL_WIDTH="topFullWidth",i.STICKY_TOP_LEFT="stickyTopLeft",i.STICKY_TOP_RIGHT="stickyTopRight",i.STICKY_TOP_CENTER="stickyTopCenter",i.STICKY_TOP_FULL_WIDTH="stickyTopFullWidth",i.STICKY_BOTTOM_LEFT="stickyBottomLeft",i.STICKY_BOTTOM_RIGHT="stickyBottomRight",i.STICKY_BOTTOM_CENTER="stickyBottomCenter",i.STICKY_BOTTOM_FULL_WIDTH="stickyBottomFullWidth",i.BOTTOM_LEFT="bottomLeft",i.BOTTOM_RIGHT="bottomRight",i.BOTTOM_CENTER="bottomCenter",i.BOTTOM_FULL_WIDTH="bottomFullWidth",i))(at||{});function yC(i){switch(i){case"center":case"topCenter":case"stickyTopCenter":case"bottomCenter":case"stickyBottomCenter":return"center";case"left":case"topLeft":case"stickyTopLeft":case"bottomLeft":case"stickyBottomLeft":return"left";case"right":case"topRight":case"stickyTopRight":case"bottomRight":case"stickyBottomRight":return"right";case"fullWidth":case"topFullWidth":case"stickyTopFullWidth":case"bottomFullWidth":case"stickyBottomFullWidth":return"fullWidth";default:throw Error("Invalid Row Container Type")}}var QS=fr([["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"],["stickyBottomCenter","ag-sticky-bottom-container"],["stickyBottomLeft","ag-pinned-left-sticky-bottom"],["stickyBottomRight","ag-pinned-right-sticky-bottom"],["stickyBottomFullWidth","ag-sticky-bottom-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"]]),ZS=fr([["center","ag-center-cols-viewport"],["topCenter","ag-floating-top-viewport"],["stickyTopCenter","ag-sticky-top-viewport"],["bottomCenter","ag-floating-bottom-viewport"],["stickyBottomCenter","ag-sticky-bottom-viewport"]]),No=class wC extends Z{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.isFullWithContainer=this.name==="topFullWidth"||this.name==="stickyTopFullWidth"||this.name==="stickyBottomFullWidth"||this.name==="bottomFullWidth"||this.name==="fullWidth"}static getRowContainerCssClasses(e){const t=QS.get(e),s=ZS.get(e);return{container:t,viewport:s}}static getPinned(e){switch(e){case"bottomLeft":case"topLeft":case"stickyTopLeft":case"stickyBottomLeft":case"left":return"left";case"bottomRight":case"topRight":case"stickyTopRight":case"stickyBottomRight":case"right":return"right";default:return null}}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>this.viewportSizeFeature=this.createManagedBean(new Nn(this)))}registerWithCtrlsService(){switch(this.name){case"fullWidth":case"topFullWidth":case"stickyTopFullWidth":case"bottomFullWidth":case"stickyBottomFullWidth":return;default:this.ctrlsService.register(this.name,this)}}forContainers(e,t){e.indexOf(this.name)>=0&&t()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,t,s){this.comp=e,this.eContainer=t,this.eViewport=s,this.createManagedBean(new Ti(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows();const r=["topCenter","topLeft","topRight"],o=["stickyTopCenter","stickyTopLeft","stickyTopRight"],n=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],a=["bottomCenter","bottomLeft","bottomRight"],l=["center","left","right"],u=[...r,...a,...l,...o,...n],h=["center","left","right","fullWidth"],d=["center","topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],c=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],p=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"];this.forContainers(c,()=>{this.pinnedWidthFeature=this.createManagedBean(new Zp(this.eContainer)),this.addManagedListener(this.eventService,b.EVENT_LEFT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(p,()=>{this.pinnedWidthFeature=this.createManagedBean(new Jp(this.eContainer)),this.addManagedListener(this.eventService,b.EVENT_RIGHT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(h,()=>this.createManagedBean(new rd(this.eContainer,this.name==="center"?s:void 0))),this.forContainers(u,()=>this.createManagedBean(new od(this.eContainer))),this.forContainers(d,()=>this.createManagedBean(new kn(y=>this.comp.setContainerWidth(`${y}px`)))),this.addListeners(),this.registerWithCtrlsService()}addListeners(){this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>this.onDisplayedColumnsChanged()),this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>this.onDisplayedColumnsWidthChanged()),this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_ROWS_CHANGED,e=>this.onDisplayedRowsChanged(e.afterScroll)),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if(["stickyTopCenter","stickyTopLeft","stickyTopRight","stickyTopFullWidth","stickyBottomCenter","stickyBottomLeft","stickyBottomRight","stickyBottomFullWidth"].indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}const s=()=>{const r=this.gos.get("ensureDomOrder"),o=this.gos.isDomLayout("print");this.comp.setDomOrder(r||o)};this.addManagedPropertyListener("domLayout",s),s()}stopHScrollOnPinnedRows(){this.forContainers(["topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],()=>{const e=()=>this.eViewport.scrollLeft=0;this.addManagedListener(this.eViewport,"scroll",e)})}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const e=t=>{this.dragService.isDragging()&&t.cancelable&&t.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",e))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),s=this.getCenterViewportScrollLeft();this.columnModel.setViewportPosition(t,s,e)}getCenterWidth(){return To(this.eViewport)}getCenterViewportScrollLeft(){return Ba(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return Mp(this.eViewport)}getViewportScrollLeft(){return Ba(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||hv(this.eViewport)}getViewportElement(){return this.eViewport}setContainerTranslateX(e){this.eContainer.style.transform=`translateX(${e}px)`}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){Wa(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!wC.getPinned(this.name)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.getRowCtrls();if(!this.visible||t.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}const s=this.gos.isDomLayout("print"),o=this.gos.get("embedFullWidthRows")||s,n=t.filter(a=>{const l=a.isFullWidth();return this.isFullWithContainer?!o&&l:o||!l});this.comp.setRowCtrls({rowCtrls:n,useFlushSync:e})}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"stickyBottomCenter":case"stickyBottomLeft":case"stickyBottomRight":case"stickyBottomFullWidth":return this.rowRenderer.getStickyBottomRowCtrls();case"bottomCenter":case"bottomLeft":case"bottomRight":case"bottomFullWidth":return this.rowRenderer.getBottomRowCtrls();default:return this.rowRenderer.getCentreRowCtrls()}}};g([R("dragService")],No.prototype,"dragService",2);g([R("ctrlsService")],No.prototype,"ctrlsService",2);g([R("columnModel")],No.prototype,"columnModel",2);g([R("resizeObserverService")],No.prototype,"resizeObserverService",2);g([R("rowRenderer")],No.prototype,"rowRenderer",2);g([J],No.prototype,"postConstruct",1);var oh=No,JS=`<div class="ag-root ag-unselectable" role="treegrid">
<ag-header-root ref="gridHeader"></ag-header-root>
<div class="ag-floating-top" ref="eTop" role="presentation">
<ag-row-container ref="topLeftContainer" name="topLeft"></ag-row-container>
<ag-row-container ref="topCenterContainer" name="topCenter"></ag-row-container>
<ag-row-container ref="topRightContainer" name="topRight"></ag-row-container>
<ag-row-container ref="topFullWidthContainer" name="topFullWidth"></ag-row-container>
</div>
<div class="ag-body" ref="eBody" role="presentation">
<div class="ag-body-viewport" ref="eBodyViewport" role="presentation">
<ag-row-container ref="leftContainer" name="left"></ag-row-container>
<ag-row-container ref="centerContainer" name="center"></ag-row-container>
<ag-row-container ref="rightContainer" name="right"></ag-row-container>
<ag-row-container ref="fullWidthContainer" name="fullWidth"></ag-row-container>
</div>
<ag-fake-vertical-scroll></ag-fake-vertical-scroll>
</div>
<div class="ag-sticky-top" ref="eStickyTop" role="presentation">
<ag-row-container ref="stickyTopLeftContainer" name="stickyTopLeft"></ag-row-container>
<ag-row-container ref="stickyTopCenterContainer" name="stickyTopCenter"></ag-row-container>
<ag-row-container ref="stickyTopRightContainer" name="stickyTopRight"></ag-row-container>
<ag-row-container ref="stickyTopFullWidthContainer" name="stickyTopFullWidth"></ag-row-container>
</div>
<div class="ag-sticky-bottom" ref="eStickyBottom" role="presentation">
<ag-row-container ref="stickyBottomLeftContainer" name="stickyBottomLeft"></ag-row-container>
<ag-row-container ref="stickyBottomCenterContainer" name="stickyBottomCenter"></ag-row-container>
<ag-row-container ref="stickyBottomRightContainer" name="stickyBottomRight"></ag-row-container>
<ag-row-container ref="stickyBottomFullWidthContainer" name="stickyBottomFullWidth"></ag-row-container>
</div>
<div class="ag-floating-bottom" ref="eBottom" role="presentation">
<ag-row-container ref="bottomLeftContainer" name="bottomLeft"></ag-row-container>
<ag-row-container ref="bottomCenterContainer" name="bottomCenter"></ag-row-container>
<ag-row-container ref="bottomRightContainer" name="bottomRight"></ag-row-container>
<ag-row-container ref="bottomFullWidthContainer" name="bottomFullWidth"></ag-row-container>
</div>
<ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>
<ag-overlay-wrapper></ag-overlay-wrapper>
</div>`,Es=class extends Se{constructor(){super(JS)}init(){const e=(s,r)=>{const o=`${s}px`;r.style.minHeight=o,r.style.height=o},t={setRowAnimationCssOnBodyViewport:(s,r)=>this.setRowAnimationCssOnBodyViewport(s,r),setColumnCount:s=>$m(this.getGui(),s),setRowCount:s=>Ym(this.getGui(),s),setTopHeight:s=>e(s,this.eTop),setBottomHeight:s=>e(s,this.eBottom),setTopDisplay:s=>this.eTop.style.display=s,setBottomDisplay:s=>this.eBottom.style.display=s,setStickyTopHeight:s=>this.eStickyTop.style.height=s,setStickyTopTop:s=>this.eStickyTop.style.top=s,setStickyTopWidth:s=>this.eStickyTop.style.width=s,setStickyBottomHeight:s=>this.eStickyBottom.style.height=s,setStickyBottomBottom:s=>this.eStickyBottom.style.bottom=s,setStickyBottomWidth:s=>this.eStickyBottom.style.width=s,setColumnMovingCss:(s,r)=>this.addOrRemoveCssClass(s,r),updateLayoutClasses:(s,r)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach(n=>{n.toggle("ag-layout-auto-height",r.autoHeight),n.toggle("ag-layout-normal",r.normal),n.toggle("ag-layout-print",r.print)}),this.addOrRemoveCssClass("ag-layout-auto-height",r.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",r.normal),this.addOrRemoveCssClass("ag-layout-print",r.print)},setAlwaysVerticalScrollClass:(s,r)=>this.eBodyViewport.classList.toggle(fC,r),registerBodyViewportResizeListener:s=>{const r=this.resizeObserverService.observeResize(this.eBodyViewport,s);this.addDestroyFunc(()=>r())},setPinnedTopBottomOverflowY:s=>this.eTop.style.overflowY=this.eBottom.style.overflowY=s,setCellSelectableCss:(s,r)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach(o=>o.classList.toggle(s,r))},setBodyViewportWidth:s=>this.eBodyViewport.style.width=s};this.ctrl=this.createManagedBean(new ni),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(this.rangeService&&this.gos.get("enableRangeSelection")||this.gos.get("rowSelection")==="multiple")&&zm(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const s=this.eBodyViewport.classList;s.toggle("ag-row-animation",t),s.toggle("ag-row-no-animation",!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}};g([R("resizeObserverService")],Es.prototype,"resizeObserverService",2);g([Ke("rangeService")],Es.prototype,"rangeService",2);g([te("eBodyViewport")],Es.prototype,"eBodyViewport",2);g([te("eStickyTop")],Es.prototype,"eStickyTop",2);g([te("eStickyBottom")],Es.prototype,"eStickyBottom",2);g([te("eTop")],Es.prototype,"eTop",2);g([te("eBottom")],Es.prototype,"eBottom",2);g([te("gridHeader")],Es.prototype,"headerRootComp",2);g([te("eBody")],Es.prototype,"eBody",2);g([J],Es.prototype,"init",1);var Cn=class extends Z{postConstruct(){this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,b.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 i=this.ctrlsService.get("center");if(!i||this.columnAnimationService.isActive())return;const e={horizontalScrollShowing:i.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(e)}setScrollsVisible(i){if(this.horizontalScrollShowing!==i.horizontalScrollShowing||this.verticalScrollShowing!==i.verticalScrollShowing){this.horizontalScrollShowing=i.horizontalScrollShowing,this.verticalScrollShowing=i.verticalScrollShowing;const t={type:b.EVENT_SCROLL_VISIBILITY_CHANGED};this.eventService.dispatchEvent(t)}}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}};g([R("ctrlsService")],Cn.prototype,"ctrlsService",2);g([R("columnAnimationService")],Cn.prototype,"columnAnimationService",2);g([J],Cn.prototype,"postConstruct",1);Cn=g([le("scrollVisibleService")],Cn);var Ys=class extends Z{constructor(){super(...arguments),this.gridInstanceId=Ys.gridInstanceSequence.next()}stampTopLevelGridCompWithGridInstance(i){i[Ys.GRID_DOM_KEY]=this.gridInstanceId}getRenderedCellForEvent(i){return Zu(this.gos,i.target,oo.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(i){return this.isElementInThisGrid(i.target)}isElementInThisGrid(i){let e=i;for(;e;){const t=e[Ys.GRID_DOM_KEY];if(K(t))return t===this.gridInstanceId;e=e.parentElement}return!1}getCellPositionForEvent(i){const e=this.getRenderedCellForEvent(i);return e?e.getCellPosition():null}getNormalisedPosition(i){const e=this.gos.isDomLayout("normal"),t=i;let s,r;if(t.clientX!=null||t.clientY!=null?(s=t.clientX,r=t.clientY):(s=t.x,r=t.y),e){const o=this.ctrlsService.getGridBodyCtrl(),n=o.getScrollFeature().getVScrollPosition(),a=o.getScrollFeature().getHScrollPosition();s+=a.left,r+=n.top}return{x:s,y:r}}};Ys.gridInstanceSequence=new vn;Ys.GRID_DOM_KEY="__ag_grid_instance";g([R("ctrlsService")],Ys.prototype,"ctrlsService",2);Ys=g([le("mouseEventService")],Ys);var ri=class extends Z{constructor(){super(),this.onPageDown=Tc(this.onPageDown,100),this.onPageUp=Tc(this.onPageUp,100)}postConstruct(){this.ctrlsService.whenReady(i=>{this.gridBodyCon=i.gridBodyCtrl})}handlePageScrollingKey(i,e=!1){const t=i.key,s=i.altKey,r=i.ctrlKey||i.metaKey,o=!!this.rangeService&&i.shiftKey,n=this.mouseEventService.getCellPositionForEvent(i);let a=!1;switch(t){case k.PAGE_HOME:case k.PAGE_END:!r&&!s&&(this.onHomeOrEndKey(t),a=!0);break;case k.LEFT:case k.RIGHT:case k.UP:case k.DOWN:if(!n)return!1;r&&!s&&!o&&(this.onCtrlUpDownLeftRight(t,n),a=!0);break;case k.PAGE_DOWN:case k.PAGE_UP:!r&&!s&&(a=this.handlePageUpDown(t,n,e));break}return a&&i.preventDefault(),a}handlePageUpDown(i,e,t){return t&&(e=this.focusService.getFocusedCell()),e?(i===k.PAGE_UP?this.onPageUp(e):this.onPageDown(e),!0):!1}navigateTo(i){var e;const{scrollIndex:t,scrollType:s,scrollColumn:r,focusIndex:o,focusColumn:n}=i;K(r)&&!r.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(r),K(t)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(t,s),i.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(o),this.focusService.setFocusedCell({rowIndex:o,column:n,rowPinned:null,forceBrowserFocus:!0}),(e=this.rangeService)==null||e.setRangeToCell({rowIndex:o,rowPinned:null,column:n})}onPageDown(i){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.getViewportHeight(),r=this.paginationProxy.getPixelOffset(),o=t.top+s,n=this.paginationProxy.getRowIndexAtPixel(o+r);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(i,n):this.navigateToNextPage(i,n)}onPageUp(i){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.paginationProxy.getPixelOffset(),r=t.top,o=this.paginationProxy.getRowIndexAtPixel(r+s);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(i,o,!0):this.navigateToNextPage(i,o,!0)}navigateToNextPage(i,e,t=!1){const s=this.getViewportHeight(),r=this.paginationProxy.getPageFirstRow(),o=this.paginationProxy.getPageLastRow(),n=this.paginationProxy.getPixelOffset(),a=this.paginationProxy.getRow(i.rowIndex),l=t?a?.rowHeight-s-n:s-n,u=a?.rowTop+l;let h=this.paginationProxy.getRowIndexAtPixel(u+n);if(h===i.rowIndex){const c=t?-1:1;e=h=i.rowIndex+c}let d;t?(d="bottom",h<r&&(h=r),e<r&&(e=r)):(d="top",h>o&&(h=o),e>o&&(e=o)),this.isRowTallerThanView(h)&&(e=h,d="top"),this.navigateTo({scrollIndex:e,scrollType:d,scrollColumn:null,focusIndex:h,focusColumn:i.column})}navigateToNextPageWithAutoHeight(i,e,t=!1){this.navigateTo({scrollIndex:e,scrollType:t?"bottom":"top",scrollColumn:null,focusIndex:e,focusColumn:i.column}),setTimeout(()=>{const s=this.getNextFocusIndexForAutoHeight(i,t);this.navigateTo({scrollIndex:e,scrollType:t?"bottom":"top",scrollColumn:null,focusIndex:s,focusColumn:i.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(i,e=!1){var t;const s=e?-1:1,r=this.getViewportHeight(),o=this.paginationProxy.getPageLastRow();let n=0,a=i.rowIndex;for(;a>=0&&a<=o;){const l=this.paginationProxy.getRow(a);if(l){const u=(t=l.rowHeight)!=null?t:0;if(n+u>r)break;n+=u}a+=s}return Math.max(0,Math.min(a,o))}getViewportHeight(){const{gridBodyCtrl:i,center:e}=this.ctrlsService.getParams(),t=i.getScrollFeature().getVScrollPosition(),s=this.gos.getScrollbarWidth();let r=t.bottom-t.top;return e.isHorizontalScrollShowing()&&(r-=s),r}isRowTallerThanView(i){const e=this.paginationProxy.getRow(i);if(!e)return!1;const t=e.rowHeight;return typeof t!="number"?!1:t>this.getViewportHeight()}onCtrlUpDownLeftRight(i,e){const t=this.cellNavigationService.getNextCellToFocus(i,e,!0),{rowIndex:s,column:r}=t;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:r,focusIndex:s,focusColumn:r})}onHomeOrEndKey(i){const e=i===k.PAGE_HOME,t=this.columnModel.getAllDisplayedColumns(),s=e?t[0]:We(t),r=e?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow();this.navigateTo({scrollIndex:r,scrollType:null,scrollColumn:s,focusIndex:r,focusColumn:s})}onTabKeyDown(i,e){const t=e.shiftKey,s=this.tabToNextCellCommon(i,t,e);if(s!==!1){s&&e.preventDefault();return}if(t){const{rowIndex:r,rowPinned:o}=i.getRowPosition();(o?r===0:r===this.paginationProxy.getPageFirstRow())&&(this.gos.get("headerHeight")===0||this.gos.get("suppressHeaderFocus")?this.focusService.focusNextGridCoreContainer(!0,!0):(e.preventDefault(),this.focusService.focusPreviousFromFirstCell(e)))}else i instanceof oo&&i.focusCell(!0),this.focusService.focusNextGridCoreContainer(t)&&e.preventDefault()}tabToNextCell(i,e){const t=this.focusService.getFocusedCell();if(!t)return!1;let s=this.getCellByPosition(t);return!s&&(s=this.rowRenderer.getRowByPosition(t),!s||!s.isFullWidth())?!1:!!this.tabToNextCellCommon(s,i,e)}tabToNextCellCommon(i,e,t){let s=i.isEditing();if(!s&&i instanceof oo){const n=i.getRowCtrl();n&&(s=n.isEditing())}let r;return s?this.gos.get("editType")==="fullRow"?r=this.moveToNextEditingRow(i,e,t):r=this.moveToNextEditingCell(i,e,t):r=this.moveToNextCellNotEditing(i,e),r===null?r:r||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(i,e,t=null){const s=i.getCellPosition();i.getGui().focus(),i.stopEditing();const r=this.findNextCellToFocusOn(s,e,!0);return r===!1?null:r==null?!1:(r.startEditing(null,!0,t),r.focusCell(!1),!0)}moveToNextEditingRow(i,e,t=null){const s=i.getCellPosition(),r=this.findNextCellToFocusOn(s,e,!0);if(r===!1)return null;if(r==null)return!1;const o=r.getCellPosition(),n=this.isCellEditable(s),a=this.isCellEditable(o),l=o&&s.rowIndex===o.rowIndex&&s.rowPinned===o.rowPinned;return n&&i.setFocusOutOnEditor(),l||(i.getRowCtrl().stopEditing(),r.getRowCtrl().startRowEditing(void 0,void 0,t)),a?(r.setFocusInOnEditor(),r.focusCell()):r.focusCell(!0),!0}moveToNextCellNotEditing(i,e){const t=this.columnModel.getAllDisplayedColumns();let s;i instanceof no?s=lt(de({},i.getRowPosition()),{column:e?t[0]:We(t)}):s=i.getCellPosition();const r=this.findNextCellToFocusOn(s,e,!1);if(r===!1)return null;if(r instanceof oo)r.focusCell(!0);else if(r)return this.tryToFocusFullWidthRow(r.getRowPosition(),e);return K(r)}findNextCellToFocusOn(i,e,t){var s;let r=i;for(;;){i!==r&&(i=r),e||(r=this.getLastCellOfColSpan(r)),r=this.cellNavigationService.getNextTabbedCell(r,e);const o=this.gos.getCallback("tabToNextCell");if(K(o)){const u=o({backwards:e,editing:t,previousCellPosition:i,nextCellPosition:r||null});if(u===!0||u===null)u===null&&fe("Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."),r=i;else{if(u===!1)return!1;u.floating&&(fe("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),u.rowPinned=u.floating),r={rowIndex:u.rowIndex,column:u.column,rowPinned:u.rowPinned}}}if(!r)return null;if(r.rowIndex<0){const l=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l+r.rowIndex,column:r.column},fromCell:!0}),null}const n=this.gos.get("editType")==="fullRow";if(t&&!n&&!this.isCellEditable(r))continue;this.ensureCellVisible(r);const a=this.getCellByPosition(r);if(!a){const l=this.rowRenderer.getRowByPosition(r);if(!l||!l.isFullWidth()||t)continue;return l}if(!a.isSuppressNavigable())return(s=this.rangeService)==null||s.setRangeToCell(r),a}}isCellEditable(i){const e=this.lookupRowNodeForCell(i);return e?i.column.isCellEditable(e):!1}getCellByPosition(i){const e=this.rowRenderer.getRowByPosition(i);return e?e.getCellCtrl(i.column):null}lookupRowNodeForCell(i){return i.rowPinned==="top"?this.pinnedRowModel.getPinnedTopRow(i.rowIndex):i.rowPinned==="bottom"?this.pinnedRowModel.getPinnedBottomRow(i.rowIndex):this.paginationProxy.getRow(i.rowIndex)}navigateToNextCell(i,e,t,s){let r=t,o=!1;for(;r&&(r===t||!this.isValidNavigateCell(r));)this.gos.get("enableRtl")?e===k.LEFT&&(r=this.getLastCellOfColSpan(r)):e===k.RIGHT&&(r=this.getLastCellOfColSpan(r)),r=this.cellNavigationService.getNextCellToFocus(e,r),o=be(r);if(o&&i&&i.key===k.UP&&(r={rowIndex:-1,rowPinned:null,column:t.column}),s){const a=this.gos.getCallback("navigateToNextCell");if(K(a)){const u=a({key:e,previousCellPosition:t,nextCellPosition:r||null,event:i});K(u)?(u.floating&&(fe("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),u.rowPinned=u.floating),r={rowPinned:u.rowPinned,rowIndex:u.rowIndex,column:u.column}):r=null}}if(!r)return;if(r.rowIndex<0){const a=this.headerNavigationService.getHeaderRowCount();this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a+r.rowIndex,column:t.column},event:i||void 0,fromCell:!0});return}const n=this.getNormalisedPosition(r);n?this.focusPosition(n):this.tryToFocusFullWidthRow(r)}getNormalisedPosition(i){this.ensureCellVisible(i);const e=this.getCellByPosition(i);return e?(i=e.getCellPosition(),this.ensureCellVisible(i),i):null}tryToFocusFullWidthRow(i,e=!1){const t=this.columnModel.getAllDisplayedColumns(),s=this.rowRenderer.getRowByPosition(i);if(!s||!s.isFullWidth())return!1;const r=this.focusService.getFocusedCell(),o={rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:i.column||(e?We(t):t[0])};this.focusPosition(o);const n=r!=null?this.rowPositionUtils.before(o,r):!1,a={type:b.EVENT_FULL_WIDTH_ROW_FOCUSED,rowIndex:o.rowIndex,rowPinned:o.rowPinned,column:o.column,isFullWidthCell:!0,floating:o.rowPinned,fromBelow:n};return this.eventService.dispatchEvent(a),!0}focusPosition(i){var e;this.focusService.setFocusedCell({rowIndex:i.rowIndex,column:i.column,rowPinned:i.rowPinned,forceBrowserFocus:!0}),(e=this.rangeService)==null||e.setRangeToCell(i)}isValidNavigateCell(i){return!!this.rowPositionUtils.getRowNode(i)}getLastCellOfColSpan(i){const e=this.getCellByPosition(i);if(!e)return i;const t=e.getColSpanningList();return t.length===1?i:{rowIndex:i.rowIndex,column:We(t),rowPinned:i.rowPinned}}ensureCellVisible(i){const e=this.gos.isGroupRowsSticky(),t=this.rowModel.getRow(i.rowIndex);!(e&&t?.sticky)&&be(i.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(i.rowIndex),i.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(i.column)}};g([R("mouseEventService")],ri.prototype,"mouseEventService",2);g([R("paginationProxy")],ri.prototype,"paginationProxy",2);g([R("focusService")],ri.prototype,"focusService",2);g([R("columnModel")],ri.prototype,"columnModel",2);g([R("rowModel")],ri.prototype,"rowModel",2);g([R("ctrlsService")],ri.prototype,"ctrlsService",2);g([R("rowRenderer")],ri.prototype,"rowRenderer",2);g([R("headerNavigationService")],ri.prototype,"headerNavigationService",2);g([R("rowPositionUtils")],ri.prototype,"rowPositionUtils",2);g([R("cellNavigationService")],ri.prototype,"cellNavigationService",2);g([R("pinnedRowModel")],ri.prototype,"pinnedRowModel",2);g([Ke("rangeService")],ri.prototype,"rangeService",2);g([J],ri.prototype,"postConstruct",1);ri=g([le("navigationService")],ri);var eg=class bC extends Mo{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){this.gos.setDomData(this.getGui(),bC.DOM_KEY_POPUP_EDITOR_WRAPPER,!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,s=r=>{ih(this.gos,r,t.node,t.column,!0)||t.onKeyDown(r)};this.addManagedListener(e,"keydown",s)}};eg.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper";g([J],eg.prototype,"postConstruct",1);var SC=eg,e_=class extends Se{constructor(e,t,s,r,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=r,this.cellCtrl=t;const n=document.createElement("div");n.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(n);const a=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const l=(d,c)=>{c!=null&&c!=""?a.setAttribute(d,c):a.removeAttribute(d)};yt(a,t.getCellAriaRole()),l("col-id",t.getColumnIdSanitised());const u=t.getTabIndex();u!==void 0&&l("tabindex",u.toString());const h={addOrRemoveCssClass:(d,c)=>this.addOrRemoveCssClass(d,c),setUserStyles:d=>Op(a,d),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:d=>this.includeSelection=d,setIncludeRowDrag:d=>this.includeRowDrag=d,setIncludeDndSource:d=>this.includeDndSource=d,setRenderDetails:(d,c,p)=>this.setRenderDetails(d,c,p),setEditDetails:(d,c,p)=>this.setEditDetails(d,c,p),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(h,this.getGui(),this.eCellWrapper,s,o)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,s){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;const o=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!(s||o)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t))}setEditDetails(e,t,s){e?this.createCellEditorInstance(e,t,s):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,s=t||this.forceWrapper,r=s&&this.eCellWrapper==null;if(r){const h=document.createElement("div");h.setAttribute("role","presentation"),h.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=h,this.getGui().appendChild(this.eCellWrapper)}const o=!s&&this.eCellWrapper!=null;o&&(fs(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!s);const n=!e&&s,a=n&&this.eCellValue==null;if(a){const h=document.createElement("span");h.setAttribute("role","presentation"),h.setAttribute("class","ag-cell-value"),this.eCellValue=h,this.eCellWrapper.appendChild(this.eCellValue)}const l=!n&&this.eCellValue!=null;l&&(fs(this.eCellValue),this.eCellValue=void 0);const u=r||o||a||l;return u&&this.removeControls(),e||t&&this.addControls(),u}addControls(){this.includeRowDrag&&this.rowDraggingComp==null&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&this.dndSourceComp==null&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&this.checkboxSelectionComp==null&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,s){const r=this.editorVersion,o=e.newAgStackInstance();if(!o)return;const{params:n}=e;o.then(l=>this.afterCellEditorCreated(r,l,n,t,s)),be(this.cellEditor)&&n.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();Rt(t);const s=e!=null?Ft(e,!0):null;s!=null&&(t.textContent=s)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),fs(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),fs(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(this.cellRenderer==null||this.cellRenderer.refresh==null||this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return t===!0||t===void 0}createCellRendererInstance(e){const s=!this.beans.gos.get("suppressAnimationFrame"),r=this.rendererVersion,{componentClass:o}=e,n=()=>{if(this.rendererVersion!==r||!this.isAlive())return;const l=e.newAgStackInstance(),u=this.afterCellRendererCreated.bind(this,r,o);l&&l.then(u)};s&&this.firstRender?this.beans.animationFrameService.createTask(n,this.rowNode.rowIndex,"createTasksP2"):n()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,s){if(!this.isAlive()||e!==this.rendererVersion){this.beans.context.destroyBean(s);return}if(this.cellRenderer=s,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),this.cellRendererGui!=null){const o=this.getParentOfValue();Rt(o),o.appendChild(this.cellRendererGui)}}afterCellEditorCreated(e,t,s,r,o){if(e!==this.editorVersion){this.beans.context.destroyBean(t);return}if(t.isCancelBeforeStart&&t.isCancelBeforeStart()){this.beans.context.destroyBean(t),this.cellCtrl.stopEditing(!0);return}if(!t.getGui){console.warn(`AG Grid: cellEditor for column ${this.column.getId()} is missing getGui() method`),this.beans.context.destroyBean(t);return}this.cellEditor=t,this.cellEditorGui=t.getGui();const l=r||t.isPopup!==void 0&&t.isPopup();l?this.addPopupCellEditor(s,o):this.addInCellEditor(),this.refreshEditStyles(!0,l),t.afterGuiAttached&&t.afterGuiAttached()}refreshEditStyles(e,t){var s;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),(s=this.rowCtrl)==null||s.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){this.beans.gos.get("editType")==="fullRow"&&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 s=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(new SC(e));const r=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&r.appendChild(this.cellEditorGui);const o=this.beans.popupService,n=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),a=t??(s.getPopupPosition?s.getPopupPosition():"over"),l=this.beans.gos.get("enableRtl"),u={ePopup:r,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:a,alignSide:l?"right":"left",keepWithinBounds:!0},h=o.positionPopupByComponent.bind(o,u),d=this.beans.localeService.getLocaleTextFunc(),c=o.addPopup({modal:n,eChild:r,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:h,ariaLabel:d("ariaLabelCellEditor","Cell Editor")});c&&(this.hideEditorPopup=c.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&xp()&&e.focus({preventScroll:!0}),Rt(this.getParentOfValue())}},t_=class extends Se{constructor(e,t,s){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const r=document.createElement("div");r.setAttribute("comp-id",`${this.getCompId()}`),r.setAttribute("style",this.getInitialStyle(s)),this.setTemplateFromElement(r);const o=this.getGui(),n=o.style;this.domOrder=this.rowCtrl.getDomOrder(),yt(o,"row");const a=this.rowCtrl.getTabIndex();a!=null&&o.setAttribute("tabindex",a.toString());const l={setDomOrder:u=>this.domOrder=u,setCellCtrls:u=>this.setCellCtrls(u),showFullWidth:u=>this.showFullWidth(u),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(u,h)=>this.addOrRemoveCssClass(u,h),setUserStyles:u=>Op(o,u),setTop:u=>n.top=u,setTransform:u=>n.transform=u,setRowIndex:u=>o.setAttribute("row-index",u),setRowId:u=>o.setAttribute("row-id",u),setRowBusinessKey:u=>o.setAttribute("row-business-key",u),refreshFullWidth:u=>this.refreshFullWidth(u)};e.setComp(l,this.getGui(),s),this.addDestroyFunc(()=>{e.unsetComp(s)})}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const t=r=>{if(this.isAlive()){const o=r.getGui();this.getGui().appendChild(o),this.rowCtrl.setupDetailRowAutoHeight(o),this.setFullWidthRowComp(r)}else this.beans.context.destroyBean(r)},s=e.newAgStackInstance();s&&s.then(t)}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach(r=>{const o=r.getInstanceId();this.cellComps[o]==null?this.newCellComp(r):t[o]=null});const s=Cr(t).filter(r=>r!=null);this.destroyCells(s),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach(s=>{const r=this.cellComps[s.getInstanceId()];r&&t.push(r.getGui())}),Ip(this.getGui(),t)}newCellComp(e){const t=new e_(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=Cr(this.cellComps).filter(t=>t!=null);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 s=t.getCtrl().getInstanceId();this.cellComps[s]===t&&(t.detach(),t.destroy(),this.cellComps[s]=null)})}refreshFullWidth(e){const{fullWidthCellRenderer:t}=this;if(!t||!t.refresh)return!1;const s=e();return t.refresh(s)}};function i_(){const i=Se.elementGettingCreated.getAttribute("name"),e=oh.getRowContainerCssClasses(i);let t;return i==="center"||i==="topCenter"||i==="stickyTopCenter"||i==="bottomCenter"||i==="stickyBottomCenter"?t=`<div class="${e.viewport}" ref="eViewport" role="presentation">
<div class="${e.container}" ref="eContainer"></div>
</div>`:t=`<div class="${e.container}" ref="eContainer"></div>`,t}var Gn=class extends Se{constructor(){super(i_()),this.rowComps={},this.name=Se.elementGettingCreated.getAttribute("name"),this.type=yC(this.name)}postConstruct(){const e={setViewportHeight:s=>this.eViewport.style.height=s,setRowCtrls:({rowCtrls:s})=>this.setRowCtrls(s),setDomOrder:s=>{this.domOrder=s},setContainerWidth:s=>this.eContainer.style.width=s};this.createManagedBean(new oh(this.name)).setComp(e,this.eContainer,this.eViewport)}preDestroy(){this.setRowCtrls([])}setRowCtrls(e){const t=de({},this.rowComps);this.rowComps={},this.lastPlacedElement=null;const s=r=>{const o=r.getInstanceId(),n=t[o];if(n)this.rowComps[o]=n,delete t[o],this.ensureDomOrder(n.getGui());else{if(!r.getRowNode().displayed)return;const a=new t_(r,this.beans,this.type);this.rowComps[o]=a,this.appendRow(a.getGui())}};e.forEach(s),Cr(t).forEach(r=>{this.eContainer.removeChild(r.getGui()),r.destroy()}),yt(this.eContainer,"rowgroup")}appendRow(e){this.domOrder?uv(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(Lp(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}};g([R("beans")],Gn.prototype,"beans",2);g([te("eViewport")],Gn.prototype,"eViewport",2);g([te("eContainer")],Gn.prototype,"eContainer",2);g([J],Gn.prototype,"postConstruct",1);g([vi],Gn.prototype,"preDestroy",1);var tg=class{constructor(i){this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=i}onDragEnter(i){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const e=i.dragItem.columns;e&&e.forEach(t=>{t.isPrimary()&&(t.isAnyFunctionActive()||(t.isAllowValue()?this.columnsToAggregate.push(t):t.isAllowRowGroup()?this.columnsToGroup.push(t):t.isAllowPivot()&&this.columnsToPivot.push(t)))})}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?Re.ICON_PINNED:Re.ICON_MOVE:null}onDragLeave(i){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(i){}onDragStop(i){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")}};g([R("columnModel")],tg.prototype,"columnModel",2);g([R("gridOptionsService")],tg.prototype,"gos",2);var ao=class{static attemptMoveColumns(i){const{isFromHeader:e,hDirection:t,xPosition:s,fromEnter:r,fakeEvent:o,pinned:n,gos:a,columnModel:l}=i,u=t===0,h=t===1;let{allMovingColumns:d}=i;if(e){let D=[];d.forEach(M=>{var O;let N=null,z=M.getParent();for(;z!=null&&z.getDisplayedLeafColumns().length===1;)N=z,z=z.getParent();N!=null?(!!((O=N.getColGroupDef())!=null&&O.marryChildren)?N.getProvidedColumnGroup().getLeafColumns():N.getLeafColumns()).forEach($=>{D.includes($)||D.push($)}):D.includes(M)||D.push(M)}),d=D}const c=d.slice();l.sortColumnsLikeGridColumns(c);const p=this.calculateValidMoves({movingCols:c,draggingRight:h,xPosition:s,pinned:n,gos:a,columnModel:l}),y=this.calculateOldIndex(c,l);if(p.length===0)return;const f=p[0];let w=y!==null&&!r;if(e&&(w=y!==null),w&&!o&&(u&&f>=y||h&&f<=y))return;const _=l.getAllDisplayedColumns();let P=[],T=null;for(let D=0;D<p.length;D++){const M=p[D],O=l.getProposedColumnOrder(c,M);if(!l.doesOrderPassRules(O))continue;const N=O.filter(Y=>_.includes(Y));if(T===null)T=N;else if(!Ts(N,T))break;const z=this.groupFragCount(O);P.push({move:M,fragCount:z})}if(P.length!==0)return P.sort((D,M)=>D.fragCount-M.fragCount),this.moveColumns(d,P[0].move,"uiColumnMoved",!1,l)}static moveColumns(i,e,t,s,r){return r.moveColumns(i,e,t,s),s?null:{columns:i,toIndex:e}}static calculateOldIndex(i,e){const t=e.getAllGridColumns(),s=Sm(i.map(l=>t.indexOf(l))),r=s[0];return We(s)-r!==s.length-1?null:r}static groupFragCount(i){function e(s){let r=[],o=s.getOriginalParent();for(;o!=null;)r.push(o),o=o.getOriginalParent();return r}let t=0;for(let s=0;s<i.length-1;s++){let r=e(i[s]),o=e(i[s+1]);[r,o]=r.length>o.length?[r,o]:[o,r],r.forEach(n=>{o.indexOf(n)===-1&&t++})}return t}static getDisplayedColumns(i,e){switch(e){case"left":return i.getDisplayedLeftColumns();case"right":return i.getDisplayedRightColumns();default:return i.getDisplayedCenterColumns()}}static calculateValidMoves(i){const{movingCols:e,draggingRight:t,xPosition:s,pinned:r,gos:o,columnModel:n}=i;if(o.get("suppressMovableColumns")||e.some(P=>P.getColDef().suppressMovable))return[];const l=this.getDisplayedColumns(n,r),u=n.getAllGridColumns(),h=l.filter(P=>ki(e,P)),d=l.filter(P=>!ki(e,P)),c=u.filter(P=>!ki(e,P));let p=0,y=s;if(t){let P=0;h.forEach(T=>P+=T.getActualWidth()),y-=P}if(y>0){for(let P=0;P<d.length;P++){const T=d[P];if(y-=T.getActualWidth(),y<0)break;p++}t&&p++}let f;if(p>0){const P=d[p-1];f=c.indexOf(P)+1}else f=c.indexOf(d[0]),f===-1&&(f=0);const w=[f],_=(P,T)=>P-T;if(t){let P=f+1;const T=u.length-1;for(;P<=T;)w.push(P),P++;w.sort(_)}else{let P=f;const T=u.length-1;let D=u[P];for(;P<=T&&l.indexOf(D)<0;)P++,w.push(P),D=u[P];P=f-1;const M=0;for(;P>=M;)w.push(P),P--;w.sort(_).reverse()}return w}static normaliseX(i,e,t,s,r){const o=r.getHeaderRowContainerCtrl(e).getViewport();return t&&(i-=o.getBoundingClientRect().left),s.get("enableRtl")&&(i=o.clientWidth-i),e==null&&(i+=r.get("center").getCenterViewportScrollLeft()),i}},Vn=class{constructor(i){this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=i,this.isCenterContainer=!K(i)}init(){this.ctrlsService.whenReady(i=>{this.gridBodyCon=i.gridBodyCtrl})}getIconName(){return this.pinned?Re.ICON_PINNED:Re.ICON_MOVE}onDragEnter(i){const e=i.dragItem.columns;if(i.dragSource.type===0)this.setColumnsVisible(e,!0,"uiColumnDragged");else{const s=i.dragItem.visibleState,r=(e||[]).filter(o=>s[o.getId()]);this.setColumnsVisible(r,!0,"uiColumnDragged")}this.setColumnsPinned(e,this.pinned,"uiColumnDragged"),this.onDragging(i,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(i,e,t){if(i){const s=i.filter(r=>!r.getColDef().lockVisible);this.columnModel.setColumnsVisible(s,e,t)}}setColumnsPinned(i,e,t){if(i){const s=i.filter(r=>!r.getColDef().lockPinned);this.columnModel.setColumnsPinned(s,e,t)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}checkCenterForScrolling(i){if(this.isCenterContainer){const e=this.ctrlsService.get("center"),t=e.getCenterViewportScrollLeft(),s=t+e.getCenterWidth();this.gos.get("enableRtl")?(this.needToMoveRight=i<t+50,this.needToMoveLeft=i>s-50):(this.needToMoveLeft=i<t+50,this.needToMoveRight=i>s-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(i=this.lastDraggingEvent,e=!1,t=!1,s=!1){var r;if(s){if(this.lastMovedInfo){const{columns:h,toIndex:d}=this.lastMovedInfo;ao.moveColumns(h,d,"uiColumnMoved",!0,this.columnModel)}return}if(this.lastDraggingEvent=i,be(i.hDirection))return;const o=ao.normaliseX(i.x,this.pinned,!1,this.gos,this.ctrlsService);e||this.checkCenterForScrolling(o);const n=this.normaliseDirection(i.hDirection),a=i.dragSource.type,l=((r=i.dragSource.getDragItem().columns)==null?void 0:r.filter(h=>h.getColDef().lockPinned?h.getPinned()==this.pinned:!0))||[],u=ao.attemptMoveColumns({allMovingColumns:l,isFromHeader:a===1,hDirection:n,xPosition:o,pinned:this.pinned,fromEnter:e,fakeEvent:t,gos:this.gos,columnModel:this.columnModel});u&&(this.lastMovedInfo=u)}normaliseDirection(i){if(this.gos.get("enableRtl"))switch(i){case 0:return 1;case 1:return 0;default:console.error(`AG Grid: Unknown direction ${i}`)}else return i}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.needToMoveLeft?this.dragAndDropService.setGhostIcon(Re.ICON_LEFT,!0):this.dragAndDropService.setGhostIcon(Re.ICON_RIGHT,!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon(Re.ICON_MOVE))}moveInterval(){let i;this.intervalCount++,i=10+this.intervalCount*5,i>100&&(i=100);let e=null;const t=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?e=t.scrollHorizontally(-i):this.needToMoveRight&&(e=t.scrollHorizontally(i)),e!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const r=this.lastDraggingEvent.dragItem.columns.filter(o=>!o.getColDef().lockPinned);if(r.length>0&&(this.dragAndDropService.setGhostIcon(Re.ICON_PINNED),this.failedMoveAttempts>7)){const o=this.needToMoveLeft?"left":"right";this.setColumnsPinned(r,o,"uiColumnDragged"),this.dragAndDropService.nudge()}}}};g([R("columnModel")],Vn.prototype,"columnModel",2);g([R("dragAndDropService")],Vn.prototype,"dragAndDropService",2);g([R("gridOptionsService")],Vn.prototype,"gos",2);g([R("ctrlsService")],Vn.prototype,"ctrlsService",2);g([J],Vn.prototype,"init",1);var Hn=class extends Z{constructor(i,e){super(),this.pinned=i,this.eContainer=e}postConstruct(){this.ctrlsService.whenReady(i=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[i.gridBodyCtrl.getBodyViewportElement(),i.left.getContainerElement()],[i.bottomLeft.getContainerElement()],[i.topLeft.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[i.gridBodyCtrl.getBodyViewportElement(),i.right.getContainerElement()],[i.bottomRight.getContainerElement()],[i.topRight.getContainerElement()]];break;default:this.eSecondaryContainers=[[i.gridBodyCtrl.getBodyViewportElement(),i.center.getViewportElement()],[i.bottomCenter.getViewportElement()],[i.topCenter.getViewportElement()]];break}})}isInterestedIn(i){return i===1||i===0&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}init(){this.moveColumnFeature=this.createManagedBean(new Vn(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new tg(this.pinned)),this.dragAndDropService.addDropTarget(this)}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(i){return this.columnModel.isPivotMode()&&i.dragSource.type===0}onDragEnter(i){this.currentDropListener=this.isDropColumnInPivotMode(i)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(i)}onDragLeave(i){this.currentDropListener.onDragLeave(i)}onDragging(i){this.currentDropListener.onDragging(i)}onDragStop(i){this.currentDropListener.onDragStop(i)}};g([R("dragAndDropService")],Hn.prototype,"dragAndDropService",2);g([R("columnModel")],Hn.prototype,"columnModel",2);g([R("ctrlsService")],Hn.prototype,"ctrlsService",2);g([J],Hn.prototype,"postConstruct",1);g([J],Hn.prototype,"init",1);var Bn=class _C extends Qp{constructor(e){super(_C.TEMPLATE,e),this.headerCompVersion=0,this.column=e.getColumnGroupChild(),this.pinned=e.getPinned()}postConstruct(){const e=this.getGui();((o,n)=>{n!=null&&n!=""?e.setAttribute(o,n):e.removeAttribute(o)})("col-id",this.column.getColId());const s={setWidth:o=>e.style.width=o,addOrRemoveCssClass:(o,n)=>this.addOrRemoveCssClass(o,n),setAriaSort:o=>o?Xm(e,o):qm(e),setUserCompDetails:o=>this.setUserCompDetails(o),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(s,this.getGui(),this.eResize,this.eHeaderCompWrapper);const r=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",r)}destroyHeaderComp(){this.headerComp&&(this.eHeaderCompWrapper.removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then(s=>this.afterCompCreated(t,s))}afterCompCreated(e,t){if(e!=this.headerCompVersion||!this.isAlive()){this.destroyBean(t);return}this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())}};Bn.TEMPLATE=`<div class="ag-header-cell" role="columnheader">
<div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>
<div ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>
</div>`;g([te("eResize")],Bn.prototype,"eResize",2);g([te("eHeaderCompWrapper")],Bn.prototype,"eHeaderCompWrapper",2);g([J],Bn.prototype,"postConstruct",1);g([vi],Bn.prototype,"destroyHeaderComp",1);var s_=Bn,nd=class EC extends Qp{constructor(e){super(EC.TEMPLATE,e)}postConstruct(){const e=this.getGui(),t=(r,o)=>o!=null?e.setAttribute(r,o):e.removeAttribute(r);e.setAttribute("col-id",this.ctrl.getColId());const s={addOrRemoveCssClass:(r,o)=>this.addOrRemoveCssClass(r,o),setResizableDisplayed:r=>Ge(this.eResize,r),setWidth:r=>e.style.width=r,setAriaExpanded:r=>t("aria-expanded",r),setUserCompDetails:r=>this.setUserCompDetails(r),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(s,e,this.eResize)}setUserCompDetails(e){e.newAgStackInstance().then(t=>this.afterHeaderCompCreated(t))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive()){t();return}const s=this.getGui(),r=e.getGui();s.appendChild(r),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(s)}};nd.TEMPLATE=`<div class="ag-header-group-cell" role="columnheader">
<div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>
</div>`;g([te("eResize")],nd.prototype,"eResize",2);g([J],nd.prototype,"postConstruct",1);var r_=nd,Uc=(i=>(i.COLUMN_GROUP="group",i.COLUMN="column",i.FLOATING_FILTER="filter",i))(Uc||{}),ig=class extends Se{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}init(){yp(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:t=>this.getGui().style.height=t,setTop:t=>this.getGui().style.top=t,setHeaderCtrls:(t,s)=>this.setHeaderCtrls(t,s),setWidth:t=>this.getGui().style.width=t};this.ctrl.setComp(e)}destroyHeaderCtrls(){this.setHeaderCtrls([],!1)}setHeaderCtrls(e,t){if(!this.isAlive())return;const s=this.headerComps;if(this.headerComps={},e.forEach(r=>{const o=r.getInstanceId();let n=s[o];delete s[o],n==null&&(n=this.createHeaderComp(r),this.getGui().appendChild(n.getGui())),this.headerComps[o]=n}),si(s,(r,o)=>{this.getGui().removeChild(o.getGui()),this.destroyBean(o)}),t){const r=Cr(this.headerComps);r.sort((n,a)=>{const l=n.getCtrl().getColumnGroupChild().getLeft(),u=a.getCtrl().getColumnGroupChild().getLeft();return l-u});const o=r.map(n=>n.getGui());Ip(this.getGui(),o)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case"group":t=new r_(e);break;case"filter":t=new SS(e);break;default:t=new s_(e);break}return this.createBean(t),t.setParentComponent(this),t}};g([J],ig.prototype,"init",1);g([vi],ig.prototype,"destroyHeaderCtrls",1);var o_=0,sr=class xC extends Z{constructor(e,t,s){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=e,this.parentRowCtrl=s,this.beans=t,this.instanceId=e.getUniqueId()+"-"+o_++}postConstruct(){this.addManagedPropertyListeners(["suppressHeaderFocus"],()=>this.refreshTabIndex())}shouldStopEventPropagation(e){const{headerRowIndex:t,column:s}=this.focusService.getFocusedHeader();return yv(this.gos,e,t,s)}getWrapperHasFocus(){return this.gos.getActiveDomElement()===this.eGui}setGui(e){this.eGui=e,this.addDomData(),this.addManagedListener(this.beans.eventService,b.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}onDisplayedColumnsChanged(){!this.comp||!this.column||(this.refreshFirstAndLastStyles(),this.refreshAriaColIndex())}refreshFirstAndLastStyles(){const{comp:e,column:t,beans:s}=this;sd.refreshFirstAndLastStyles(e,t,s.columnModel)}refreshAriaColIndex(){const{beans:e,column:t}=this,s=e.columnModel.getAriaColumnIndex(t);wp(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.gos.get("suppressHeaderFocus")?this.eGui.removeAttribute("tabindex"):this.eGui.setAttribute("tabindex","-1")}onGuiKeyDown(e){var t;const s=this.gos.getActiveDomElement(),r=e.key===k.LEFT||e.key===k.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),s!==this.eGui||!e.shiftKey&&!e.altKey||((this.isResizing||r)&&(e.preventDefault(),e.stopImmediatePropagation()),!r))return;const o=e.key===k.LEFT!==this.gos.get("enableRtl"),n=qv[o?"Left":"Right"];if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const a=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(a,e.shiftKey),(t=this.resizeFeature)==null||t.toggleColumnResizing(!0)}else this.moveHeader(n)}getViewportAdjustedResizeDiff(e){let t=this.getResizeDiff(e);if(this.column.getPinned()){const r=this.pinnedWidthService.getPinnedLeftWidth(),o=this.pinnedWidthService.getPinnedRightWidth(),n=To(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(r+o+t>n)if(n>r+o)t=n-r-o;else return 0}return t}getResizeDiff(e){let t=e.key===k.LEFT!==this.gos.get("enableRtl");const s=this.column.getPinned(),r=this.gos.get("enableRtl");return s&&r!==(s==="right")&&(t=!t),(t?-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 e;(e=this.resizeFeature)==null||e.toggleColumnResizing(!1)},150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case k.PAGE_DOWN:case k.PAGE_UP:case k.PAGE_HOME:case k.PAGE_END:t&&e.preventDefault()}}addDomData(){const e=xC.DOM_DATA_KEY_HEADER_CTRL;this.gos.setDomData(this.eGui,e,this),this.addDestroyFunc(()=>this.gos.setDomData(this.eGui,e,null))}getGui(){return this.eGui}focus(e){return this.eGui?(this.lastFocusEvent=e||null,this.eGui.focus(),!0):!1}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(e,t,s){const r=e??t;this.gos.get("preventDefaultOnContextMenu")&&r.preventDefault();const o=s instanceof Qe?s:void 0;this.menuService.isHeaderContextMenuEnabled(o)&&this.menuService.showHeaderContextMenu(o,e,t),this.dispatchColumnMouseEvent(b.EVENT_COLUMN_HEADER_CONTEXT_MENU,s)}dispatchColumnMouseEvent(e,t){const s={type:e,column:t};this.eventService.dispatchEvent(s)}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}};sr.DOM_DATA_KEY_HEADER_CTRL="headerCtrl";g([R("pinnedWidthService")],sr.prototype,"pinnedWidthService",2);g([R("focusService")],sr.prototype,"focusService",2);g([R("userComponentFactory")],sr.prototype,"userComponentFactory",2);g([R("ctrlsService")],sr.prototype,"ctrlsService",2);g([R("dragAndDropService")],sr.prototype,"dragAndDropService",2);g([R("menuService")],sr.prototype,"menuService",2);g([J],sr.prototype,"postConstruct",1);var ad=sr,ld=class extends Z{constructor(i,e,t,s){super(),this.columnOrGroup=i,this.eCell=e,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=s,this.beans=t}setColsSpanning(i){this.colsSpanning=i,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gos.get("enableRtl")&&this.colsSpanning?We(this.colsSpanning):this.columnOrGroup}postConstruct(){this.addManagedListener(this.columnOrGroup,Qe.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this)),this.setLeftFirstTime(),this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onLeftChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onLeftChanged.bind(this))}setLeftFirstTime(){const i=this.beans.gos.get("suppressColumnMoveAnimation"),e=K(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&e&&!i?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const i=this.getColumnOrGroup(),e=i.getLeft(),t=i.getOldLeft(),s=this.modifyLeftForPrintLayout(i,t),r=this.modifyLeftForPrintLayout(i,e);this.setLeft(s),this.actualLeft=r,this.beans.columnAnimationService.executeNextVMTurn(()=>{this.actualLeft===r&&this.setLeft(r)})}onLeftChanged(){const i=this.getColumnOrGroup(),e=i.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(i,e),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(i,e){if(!this.beans.gos.isDomLayout("print")||i.getPinned()==="left")return e;const s=this.beans.columnModel.getDisplayedColumnsLeftWidth();if(i.getPinned()==="right"){const r=this.beans.columnModel.getBodyContainerWidth();return s+r+e}return s+e}setLeft(i){if(K(i)&&(this.eCell.style.left=`${i}px`),this.columnOrGroup instanceof Qe)this.columnOrGroup;else{const t=this.columnOrGroup.getLeafColumns();if(!t.length)return;t.length>1&&Km(this.ariaEl,t.length),t[0]}}};g([J],ld.prototype,"postConstruct",1);var Ll=class extends Z{constructor(i,e){super(),this.columns=i,this.element=e}postConstruct(){this.gos.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)}};g([R("columnHoverService")],Ll.prototype,"columnHoverService",2);g([J],Ll.prototype,"postConstruct",1);var n_=class extends ad{constructor(i,e,t){super(i,e,t),this.iconCreated=!1,this.column=i}setComp(i,e,t,s){this.comp=i,this.eButtonShowMainFilter=t,this.eFloatingFilterBody=s,this.setGui(e),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,Qe.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this))}resizeHeader(){}moveHeader(){}setupActive(){const i=this.column.getColDef(),e=!!i.filter,t=!!i.floatingFilter;this.active=e&&t}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 i=dt("filter",this.gos,this.column);i&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(i))}setupFocus(){this.createManagedBean(new Dr(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const i=this.localeService.getLocaleTextFunc();Gi(this.eButtonShowMainFilter,i("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(i){if(this.gos.getActiveDomElement()===this.eGui)return;const s=this.focusService.findNextFocusableElement(this.eGui,null,i.shiftKey);if(s){this.beans.headerNavigationService.scrollToColumn(this.column),i.preventDefault(),s.focus();return}const r=this.findNextColumnWithFloatingFilter(i.shiftKey);r&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:r},event:i})&&i.preventDefault()}findNextColumnWithFloatingFilter(i){const e=this.beans.columnModel;let t=this.column;do if(t=i?e.getDisplayedColBefore(t):e.getDisplayedColAfter(t),!t)break;while(!t.getColDef().filter||!t.getColDef().floatingFilter);return t}handleKeyDown(i){super.handleKeyDown(i);const e=this.getWrapperHasFocus();switch(i.key){case k.UP:case k.DOWN:e||i.preventDefault();case k.LEFT:case k.RIGHT:if(e)return;i.stopPropagation();case k.ENTER:e&&this.focusService.focusInto(this.eGui)&&i.preventDefault();break;case k.ESCAPE:e||this.eGui.focus()}}onFocusIn(i){if(this.eGui.contains(i.relatedTarget))return;const t=!!i.relatedTarget&&!i.relatedTarget.classList.contains("ag-floating-filter"),s=!!i.relatedTarget&&so(i.relatedTarget,"ag-floating-filter");if(t&&s&&i.target===this.eGui){const o=this.lastFocusEvent,n=!!(o&&o.key===k.TAB);if(o&&n){const a=o.shiftKey;this.focusService.focusInto(this.eGui,a)}}const r=this.getRowIndex();this.beans.focusService.setFocusedHeader(r,this.column)}setupHover(){this.createManagedBean(new Ll([this.column],this.eGui));const i=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedListener(this.eventService,b.EVENT_COLUMN_HOVER_CHANGED,i),i()}setupLeft(){const i=new ld(this.column,this.eGui,this.beans);this.createManagedBean(i)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){if(!this.active)return;const i=this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());i&&this.setCompDetails(i)}setCompDetails(i){this.userCompDetails=i,this.comp.setCompDetails(i)}showParentFilter(){const i=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuService.showFilterMenu({column:this.column,buttonElement:i,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(){if(!this.active)return;const{filterManager:i}=this.beans,e=t=>{if(t?.source==="filterDestroyed"&&this.context.isDestroyed())return;const s=this.comp.getFloatingFilterComp();s&&s.then(r=>{var o;if(r){const n=i.getCurrentFloatingFilterParentModel(this.column);r.onParentModelChanged(n,t?this.gos.addGridCommonParams({columns:(o=t.columns)!=null?o:[],type:b.EVENT_FILTER_CHANGED,source:t.source==="api"?"api":"columnFilter"}):null)}})};this.destroySyncListener=this.addManagedListener(this.column,Qe.EVENT_FILTER_CHANGED,e),i.isFilterActive(this.column)&&e(null)}setupWidth(){const i=()=>{const e=`${this.column.getActualWidth()}px`;this.comp.setWidth(e)};this.addManagedListener(this.column,Qe.EVENT_WIDTH_CHANGED,i),i()}setupFilterChangedListener(){this.active&&(this.destroyFilterChangedListener=this.addManagedListener(this.column,Qe.EVENT_FILTER_CHANGED,this.updateFilterButton.bind(this)),this.updateFilterButton())}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){const i=this.beans.filterManager.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(i),this.highlightFilterButtonWhenActive&&i&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(){var i,e;const t=this.active;this.setupActive();const s=!t&&this.active;t&&!this.active&&((i=this.destroySyncListener)==null||i.call(this),(e=this.destroyFilterChangedListener)==null||e.call(this));const r=this.active?this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,o=this.comp.getFloatingFilterComp();!o||!r?this.updateCompDetails(r,s):o.then(n=>{var a;!n||this.beans.filterManager.areFilterCompsDifferent((a=this.userCompDetails)!=null?a:null,r)?this.updateCompDetails(r,s):this.updateFloatingFilterParams(r)})}updateCompDetails(i,e){this.isAlive()&&(this.setCompDetails(i),this.setupFilterButton(),this.setupUi(),e&&(this.setupSyncWithFilter(),this.setupFilterChangedListener()))}updateFloatingFilterParams(i){var e;if(!i)return;const t=i.params;(e=this.comp.getFloatingFilterComp())==null||e.then(s=>{let r=!1;s?.refresh&&typeof s.refresh=="function"&&s.refresh(t)!==null&&(r=!0),!r&&s?.onParamsUpdated&&typeof s.onParamsUpdated=="function"&&s.onParamsUpdated(t)!==null&&fe("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}},Wn=class extends Z{constructor(i,e,t,s,r){super(),this.pinned=i,this.column=e,this.eResize=t,this.comp=s,this.ctrl=r}postConstruct(){const i=[];let e,t;const s=()=>{if(Ge(this.eResize,e),!e)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(i.push(n),t){const a=this.gos.get("skipHeaderOnAutoSize"),l=()=>{this.columnModel.autoSizeColumn(this.column,"uiColumnResized",a)};this.eResize.addEventListener("dblclick",l);const u=new Kt(this.eResize);u.addEventListener(Kt.EVENT_DOUBLE_TAP,l),i.push(()=>{this.eResize.removeEventListener("dblclick",l),u.removeEventListener(Kt.EVENT_DOUBLE_TAP,l),u.destroy()})}},r=()=>{i.forEach(n=>n()),i.length=0},o=()=>{const n=this.column.isResizable(),a=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(n!==e||a!==t)&&(e=n,t=a,r(),s())};o(),this.addDestroyFunc(r),this.ctrl.addRefreshFunction(o)}onResizing(i,e){const{column:t,lastResizeAmount:s,resizeStartWidth:r}=this,o=this.normaliseResizeAmount(e),n=r+o,a=[{key:t,newWidth:n}];if(this.column.getPinned()){const l=this.pinnedWidthService.getPinnedLeftWidth(),u=this.pinnedWidthService.getPinnedRightWidth(),h=To(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(l+u+(o-s)>h)return}this.lastResizeAmount=o,this.columnModel.setColumnWidths(a,this.resizeWithShiftKey,i,"uiColumnResized"),i&&this.toggleColumnResizing(!1)}onResizeStart(i){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=i,this.toggleColumnResizing(!0)}toggleColumnResizing(i){this.comp.addOrRemoveCssClass("ag-column-resizing",i)}normaliseResizeAmount(i){let e=i;const t=this.pinned!=="left",s=this.pinned==="right";return this.gos.get("enableRtl")?t&&(e*=-1):s&&(e*=-1),e}};g([R("horizontalResizeService")],Wn.prototype,"horizontalResizeService",2);g([R("pinnedWidthService")],Wn.prototype,"pinnedWidthService",2);g([R("ctrlsService")],Wn.prototype,"ctrlsService",2);g([R("columnModel")],Wn.prototype,"columnModel",2);g([J],Wn.prototype,"postConstruct",1);var sg=class extends Z{constructor(i){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=i}onSpaceKeyDown(i){const e=this.cbSelectAll;e.isDisplayed()&&!e.getGui().contains(this.gos.getActiveDomElement())&&(i.preventDefault(),e.setValue(!e.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(i){this.headerCellCtrl=i,this.cbSelectAll=this.createManagedBean(new qh),this.cbSelectAll.addCssClass("ag-header-select-all"),yt(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedListener(this.eventService,b.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_SELECTION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_PAGINATION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_MODEL_UPDATED,this.onModelChanged.bind(this)),this.addManagedListener(this.cbSelectAll,b.EVENT_FIELD_VALUE_CHANGED,this.onCbSelectAll.bind(this)),_l(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 i=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(i);const e=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!e),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const i=this.localeService.getLocaleTextFunc(),t=this.cbSelectAll.getValue()?i("ariaChecked","checked"):i("ariaUnchecked","unchecked"),s=i("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${s} (${t})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(`${s} (${t})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(i){return this.gos.get("rowSelection")==="multiple"?!0:(console.warn(`AG Grid: ${i} is only available if using 'multiple' rowSelection.`),!1)}checkRightRowModelType(i){const e=this.rowModel.getType();return e==="clientSide"||e==="serverSide"?!0:(console.warn(`AG Grid: ${i} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${e}.`),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox||!this.cbSelectAllVisible)return;const i=this.cbSelectAll.getValue(),e=this.isFilteredOnly(),t=this.isCurrentPageOnly();let s="uiSelectAll";t?s="uiSelectAllCurrentPage":e&&(s="uiSelectAllFiltered");const r={source:s,justFiltered:e,justCurrentPage:t};i?this.selectionService.selectAllRowNodes(r):this.selectionService.deselectAllRowNodes(r)}isCheckboxSelection(){let i=this.column.getColDef().headerCheckboxSelection;if(typeof i=="function"){const e=i,t=this.gos.addGridCommonParams({column:this.column,colDef:this.column.getColDef()});i=e(t)}return i?this.checkRightRowModelType("headerCheckboxSelection")&&this.checkSelectionType("headerCheckboxSelection"):!1}isFilteredOnly(){return!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){return!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}};g([R("rowModel")],sg.prototype,"rowModel",2);g([R("selectionService")],sg.prototype,"selectionService",2);var a_=class extends ad{constructor(i,e,t){super(i,e,t),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=i}setComp(i,e,t,s){this.comp=i,this.setGui(e),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 Wn(this.getPinned(),this.column,t,i,this)),this.createManagedBean(new Ll([this.column],e)),this.createManagedBean(new ld(this.column,e,this.beans)),this.createManagedBean(new Dr(e,{shouldStopEventPropagation:r=>this.shouldStopEventPropagation(r),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,Qe.EVENT_COL_DEF_CHANGED,this.refresh.bind(this)),this.addManagedListener(this.eventService,b.EVENT_COLUMN_VALUE_CHANGED,this.onColumnValueChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onColumnRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_COLUMN_PIVOT_CHANGED,this.onColumnPivotChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}resizeHeader(i,e){var t,s;if(!this.column.isResizable())return;const r=this.column.getActualWidth(),o=(t=this.column.getMinWidth())!=null?t:0,n=(s=this.column.getMaxWidth())!=null?s:Number.MAX_SAFE_INTEGER,a=Math.min(Math.max(r+i,o),n);this.beans.columnModel.setColumnWidths([{key:this.column,newWidth:a}],e,!0,"uiColumnResized")}moveHeader(i){const{eGui:e,column:t,gos:s,ctrlsService:r}=this,o=this.getPinned(),n=e.getBoundingClientRect().left,a=t.getActualWidth(),l=s.get("enableRtl"),u=i===0!==l,h=ao.normaliseX(u?n-20:n+a+20,o,!0,s,r);ao.attemptMoveColumns({allMovingColumns:[t],isFromHeader:!0,hDirection:i,xPosition:h,pinned:o,fromEnter:!1,fakeEvent:!1,gos:s,columnModel:this.beans.columnModel}),r.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(t,"auto")}setupUserComp(){const i=this.lookupUserCompDetails();this.setCompDetails(i)}setCompDetails(i){this.userCompDetails=i,this.comp.setUserCompDetails(i)}lookupUserCompDetails(){const i=this.createParams(),e=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(e,i)}createParams(){return this.gos.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:e=>{this.menuService.showColumnMenu({column:this.column,buttonElement:e,positionBy:"button"})},showColumnMenuAfterMouseClick:e=>{this.menuService.showColumnMenu({column:this.column,mouseEvent:e,positionBy:"mouse"})},showFilter:e=>{this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"columnFilter",positionBy:"button"})},progressSort:e=>{this.beans.sortController.progressSort(this.column,!!e,"uiColumnSorted")},setSort:(e,t)=>{this.beans.sortController.setSortForColumn(this.column,e,!!t,"uiColumnSorted")},eGridHeader:this.getGui(),setTooltip:(e,t)=>{this.setupTooltip(e,t)}})}setupSelectAll(){this.selectAllFeature=this.createManagedBean(new sg(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(i){super.handleKeyDown(i),i.key===k.SPACE&&this.selectAllFeature.onSpaceKeyDown(i),i.key===k.ENTER&&this.onEnterKeyDown(i),i.key===k.DOWN&&i.altKey&&this.showMenuOnKeyPress(i,!1)}onEnterKeyDown(i){if(i.ctrlKey||i.metaKey)this.showMenuOnKeyPress(i,!0);else if(this.sortable){const e=i.shiftKey;this.beans.sortController.progressSort(this.column,e,"uiColumnSorted")}}showMenuOnKeyPress(i,e){const t=this.comp.getUserCompInstance();!t||!(t instanceof Hc)||t.onMenuKeyboardShortcut(e)&&i.preventDefault()}onFocusIn(i){if(!this.getGui().contains(i.relatedTarget)){const e=this.getRowIndex();this.focusService.setFocusedHeader(e,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(i){this.getGui().contains(i.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(i,e){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const t=this.gos.get("tooltipShowMode")==="whenTruncated",s=this.eGui,r=this.column.getColDef();!e&&t&&!r.headerComponent&&(e=()=>{const a=s.querySelector(".ag-header-cell-text");return a?a.scrollWidth>a.clientWidth:!0});const o={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>s,getLocation:()=>"header",getTooltipValue:()=>i??this.column.getColDef().headerTooltip,shouldDisplayTooltip:e},n=this.createManagedBean(new er(o));this.refreshFunctions.push(()=>n.refreshToolTip())}setupClassesFromColDef(){const i=()=>{const e=this.column.getColDef(),t=sd.getHeaderClassesFromColDef(e,this.gos,this.column,null),s=this.userHeaderClasses;this.userHeaderClasses=new Set(t),t.forEach(r=>{s.has(r)?s.delete(r):this.comp.addOrRemoveCssClass(r,!0)}),s.forEach(r=>this.comp.addOrRemoveCssClass(r,!1))};this.refreshFunctions.push(i),i()}setDragSource(i){if(this.dragSourceElement=i,this.removeDragSource(),!i||!this.draggable)return;const{column:e,beans:t,displayName:s,dragAndDropService:r,gos:o}=this,{columnModel:n}=t;let a=!this.gos.get("suppressDragLeaveHidesColumns");const l=this.dragSource={type:1,eElement:i,getDefaultIconName:()=>a?Re.ICON_HIDE:Re.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(e),dragItemName:s,onDragStarted:()=>{a=!o.get("suppressDragLeaveHidesColumns"),e.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>e.setMoving(!1,"uiColumnMoved"),onGridEnter:u=>{var h;if(a){const d=((h=u?.columns)==null?void 0:h.filter(c=>!c.getColDef().lockVisible))||[];n.setColumnsVisible(d,!0,"uiColumnMoved")}},onGridExit:u=>{var h;if(a){const d=((h=u?.columns)==null?void 0:h.filter(c=>!c.getColDef().lockVisible))||[];n.setColumnsVisible(d,!1,"uiColumnMoved")}}};r.addDragSource(l,!0)}createDragItem(i){const e={};return e[i.getId()]=i.isVisible(),{columns:[i],visibleState:e}}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(i){this.refreshFunctions.push(i)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach(i=>i())}refreshHeaderComp(){const i=this.lookupUserCompDetails();(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==i.componentClass?this.attemptHeaderCompRefresh(i.params):!1)?this.setDragSource(this.dragSourceElement):this.setCompDetails(i)}attemptHeaderCompRefresh(i){const e=this.comp.getUserCompInstance();return!e||!e.refresh?!1:e.refresh(i)}calculateDisplayName(){return this.beans.columnModel.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const i=this.column.getColDef();return!!(!this.gos.get("suppressMovableColumns")&&!i.suppressMovable&&!i.lockPosition)||!!i.enableRowGroup||!!i.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const i=()=>{const e=this.column.getActualWidth();this.comp.setWidth(`${e}px`)};this.addManagedListener(this.column,Qe.EVENT_WIDTH_CHANGED,i),i()}setupMovingCss(){const i=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListener(this.column,Qe.EVENT_MOVING_CHANGED,i),i()}setupMenuClass(){const i=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListener(this.column,Qe.EVENT_MENU_VISIBLE_CHANGED,i),i()}setupSortableClass(){const i=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};i(),this.addRefreshFunction(i),this.addManagedListener(this.eventService,Qe.EVENT_SORT_CHANGED,this.refreshAriaSort.bind(this))}setupFilterClass(){const i=()=>{const e=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",e),this.refreshAria()};this.addManagedListener(this.column,Qe.EVENT_FILTER_ACTIVE_CHANGED,i),i()}setupWrapTextClass(){const i=()=>{const e=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",e)};i(),this.addRefreshFunction(i)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:i,column:e,comp:t,beans:s}=this;if(!e.isSpanHeaderHeight()){i.style.removeProperty("top"),i.style.removeProperty("height"),t.addOrRemoveCssClass("ag-header-span-height",!1),t.addOrRemoveCssClass("ag-header-span-total",!1);return}const{numberOfParents:r,isSpanningTotal:o}=this.column.getColumnGroupPaddingInfo();t.addOrRemoveCssClass("ag-header-span-height",r>0);const{columnModel:n}=s,a=n.getColumnHeaderRowHeight();if(r===0){t.addOrRemoveCssClass("ag-header-span-total",!1),i.style.setProperty("top","0px"),i.style.setProperty("height",`${a}px`);return}t.addOrRemoveCssClass("ag-header-span-total",o);const u=n.isPivotMode()?n.getPivotGroupHeaderHeight():n.getGroupHeaderHeight(),h=r*u;i.style.setProperty("top",`${-h}px`),i.style.setProperty("height",`${a+h}px`)}setupAutoHeight(i){const{columnModel:e,resizeObserverService:t}=this.beans,s=u=>{if(!this.isAlive())return;const{paddingTop:h,paddingBottom:d,borderBottomWidth:c,borderTopWidth:p}=Rr(this.getGui()),y=h+d+c+p,w=i.offsetHeight+y;if(u<5){const _=this.beans.gos.getDocument(),P=!_||!_.contains(i),T=w==0;if(P||T){window.setTimeout(()=>s(u+1),0);return}}e.setColumnHeaderHeight(this.column,w)};let r=!1,o;const n=()=>{const u=this.column.isAutoHeaderHeight();u&&!r&&a(),!u&&r&&l()},a=()=>{r=!0,s(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),o=t.observeResize(i,()=>s(0))},l=()=>{r=!1,o&&o(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),o=void 0};n(),this.addDestroyFunc(()=>l()),this.addManagedListener(this.column,Qe.EVENT_WIDTH_CHANGED,()=>r&&s(0)),this.addManagedListener(this.eventService,Qe.EVENT_SORT_CHANGED,()=>{r&&window.setTimeout(()=>s(0))}),this.addRefreshFunction(n)}refreshAriaSort(){if(this.sortable){const i=this.localeService.getLocaleTextFunc(),e=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(Gm(e)),this.setAriaDescriptionProperty("sort",i("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const i=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",i("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const i=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",i("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const i=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",i("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(i,e){e!=null?this.ariaDescriptionProperties.set(i,e):this.ariaDescriptionProperties.delete(i)}announceAriaDescription(){if(!this.eGui.contains(this.beans.gos.getActiveDomElement()))return;const i=Array.from(this.ariaDescriptionProperties.keys()).sort((e,t)=>e==="filter"?-1:t.charCodeAt(0)-e.charCodeAt(0)).map(e=>this.ariaDescriptionProperties.get(e)).join(". ");this.beans.ariaAnnouncementService.announceValue(i)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(){const i=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedListener(this.eventService,b.EVENT_COLUMN_HOVER_CHANGED,i),i()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(){const i=s=>this.handleMouseOverChange(s.type==="mouseenter"),e=()=>this.dispatchColumnMouseEvent(b.EVENT_COLUMN_HEADER_CLICKED,this.column),t=s=>this.handleContextMenuMouseEvent(s,void 0,this.column);this.addManagedListener(this.getGui(),"mouseenter",i),this.addManagedListener(this.getGui(),"mouseleave",i),this.addManagedListener(this.getGui(),"click",e),this.addManagedListener(this.getGui(),"contextmenu",t)}handleMouseOverChange(i){this.setActiveHeader(i);const t={type:i?b.EVENT_COLUMN_HEADER_MOUSE_OVER:b.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column};this.eventService.dispatchEvent(t)}setActiveHeader(i){this.comp.addOrRemoveCssClass("ag-header-active",i)}getAnchorElementForMenu(i){const e=this.comp.getUserCompInstance();return e instanceof Hc?e.getAnchorElementForMenu(i):this.getGui()}destroy(){super.destroy(),this.refreshFunctions=null,this.selectAllFeature=null,this.dragSourceElement=null,this.userCompDetails=null,this.userHeaderClasses=null,this.ariaDescriptionProperties=null}},Il=class extends Z{constructor(i,e,t,s){super(),this.eResize=e,this.comp=i,this.pinned=t,this.columnGroup=s}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}const i=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(i),!this.gos.get("suppressAutoSize")){const e=this.gos.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",()=>{const t=[];this.columnGroup.getDisplayedLeafColumns().forEach(r=>{r.getColDef().suppressAutoSize||t.push(r.getColId())}),t.length>0&&this.columnModel.autoSizeColumns({columns:t,skipHeader:e,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")})}}onResizeStart(i){const e=this.getInitialValues(i);this.storeLocalValues(e),this.toggleColumnResizing(!0)}onResizing(i,e,t="uiColumnResized"){const s=this.normaliseDragChange(e),r=this.resizeStartWidth+s;this.resizeColumnsFromLocalValues(r,t,i)}getInitialValues(i){const e=this.getColumnsToResize(),t=this.getInitialSizeOfColumns(e),s=this.getSizeRatiosOfColumns(e,t),r={columnsToResize:e,resizeStartWidth:t,resizeRatios:s};let o=null;if(i&&(o=this.columnModel.getDisplayedGroupAtDirection(this.columnGroup,"After")),o){const n=o.getDisplayedLeafColumns(),a=r.groupAfterColumns=n.filter(u=>u.isResizable()),l=r.groupAfterStartWidth=this.getInitialSizeOfColumns(a);r.groupAfterRatios=this.getSizeRatiosOfColumns(a,l)}else r.groupAfterColumns=void 0,r.groupAfterStartWidth=void 0,r.groupAfterRatios=void 0;return r}storeLocalValues(i){const{columnsToResize:e,resizeStartWidth:t,resizeRatios:s,groupAfterColumns:r,groupAfterStartWidth:o,groupAfterRatios:n}=i;this.resizeCols=e,this.resizeStartWidth=t,this.resizeRatios=s,this.resizeTakeFromCols=r,this.resizeTakeFromStartWidth=o,this.resizeTakeFromRatios=n}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(i){const e=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),t=this.getInitialValues();e>t.resizeStartWidth&&this.resizeColumns(t,e,i,!0)}resizeColumnsFromLocalValues(i,e,t=!0){var s,r,o;if(!this.resizeCols||!this.resizeRatios)return;const n={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:(s=this.resizeTakeFromCols)!=null?s:void 0,groupAfterStartWidth:(r=this.resizeTakeFromStartWidth)!=null?r:void 0,groupAfterRatios:(o=this.resizeTakeFromRatios)!=null?o:void 0};this.resizeColumns(n,i,e,t)}resizeColumns(i,e,t,s=!0){const{columnsToResize:r,resizeStartWidth:o,resizeRatios:n,groupAfterColumns:a,groupAfterStartWidth:l,groupAfterRatios:u}=i,h=[];if(h.push({columns:r,ratios:n,width:e}),a){const d=e-o;h.push({columns:a,ratios:u,width:l-d})}this.columnModel.resizeColumnSets({resizeSets:h,finished:s,source:t}),s&&this.toggleColumnResizing(!1)}toggleColumnResizing(i){this.comp.addOrRemoveCssClass("ag-column-resizing",i)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(e=>e.isResizable())}getInitialSizeOfColumns(i){return i.reduce((e,t)=>e+t.getActualWidth(),0)}getSizeRatiosOfColumns(i,e){return i.map(t=>t.getActualWidth()/e)}normaliseDragChange(i){let e=i;return this.gos.get("enableRtl")?this.pinned!=="left"&&(e*=-1):this.pinned==="right"&&(e*=-1),e}destroy(){super.destroy(),this.clearLocalValues()}};g([R("horizontalResizeService")],Il.prototype,"horizontalResizeService",2);g([R("autoWidthCalculator")],Il.prototype,"autoWidthCalculator",2);g([R("columnModel")],Il.prototype,"columnModel",2);g([J],Il.prototype,"postConstruct",1);var RC=class extends Z{constructor(i,e){super(),this.removeChildListenersFuncs=[],this.columnGroup=e,this.comp=i}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListener(this.columnGroup,jt.EVENT_DISPLAYED_CHILDREN_CHANGED,this.onDisplayedChildrenChanged.bind(this)),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const i=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(e=>{e.addEventListener("widthChanged",i),e.addEventListener("visibleChanged",i),this.removeChildListenersFuncs.push(()=>{e.removeEventListener("widthChanged",i),e.removeEventListener("visibleChanged",i)})})}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach(i=>i()),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const i=this.columnGroup.getActualWidth();this.comp.setWidth(`${i}px`),this.comp.addOrRemoveCssClass("ag-hidden",i===0)}};g([J],RC.prototype,"postConstruct",1);var l_=class extends ad{constructor(i,e,t){super(i,e,t),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const s=this.getGui();this.setDragSource(s)}},this.column=i}setComp(i,e,t){this.comp=i,this.setGui(e),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(),r=this.column.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new Ll(r,e)),this.createManagedBean(new ld(this.column,e,this.beans)),this.createManagedBean(new RC(i,this.column)),this.resizeFeature=this.createManagedBean(new Il(i,t,s,this.column)),this.createManagedBean(new Dr(e,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addManagedPropertyListener(b.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners()}resizeHeader(i,e){if(!this.resizeFeature)return;const t=this.resizeFeature.getInitialValues(e);this.resizeFeature.resizeColumns(t,t.resizeStartWidth+i,"uiColumnResized",!0)}moveHeader(i){const{beans:e,eGui:t,column:s,gos:r,ctrlsService:o}=this,n=r.get("enableRtl"),a=i===0,l=this.getPinned(),u=t.getBoundingClientRect(),h=u.left,d=u.width,c=ao.normaliseX(a!==n?h-20:h+d+20,l,!0,r,o),p=s.getGroupId(),y=this.focusService.getFocusedHeader();ao.attemptMoveColumns({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,hDirection:i,xPosition:c,pinned:l,fromEnter:!1,fakeEvent:!1,gos:r,columnModel:e.columnModel});const f=s.getDisplayedLeafColumns(),w=a?f[0]:We(f);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(w,"auto"),!this.isAlive()&&y&&this.restoreFocus(p,s,y)}restoreFocus(i,e,t){const s=e.getLeafColumns();if(!s.length)return;const r=s[0].getParent();if(!r)return;const o=this.findGroupWidthId(r,i);o&&this.focusService.focusHeaderPosition({headerPosition:lt(de({},t),{column:o})})}findGroupWidthId(i,e){for(;i;){if(i.getGroupId()===e)return i;i=i.getParent()}return null}resizeLeafColumnsToFit(i){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(i)}setupUserComp(){const i=this.gos.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:t=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),t,"gridInitializing")},setTooltip:(t,s)=>{this.setupTooltip(t,s)}}),e=this.userComponentFactory.getHeaderGroupCompDetails(i);this.comp.setUserCompDetails(e)}addHeaderMouseListeners(){const i=s=>this.handleMouseOverChange(s.type==="mouseenter"),e=()=>this.dispatchColumnMouseEvent(b.EVENT_COLUMN_HEADER_CLICKED,this.column.getProvidedColumnGroup()),t=s=>this.handleContextMenuMouseEvent(s,void 0,this.column.getProvidedColumnGroup());this.addManagedListener(this.getGui(),"mouseenter",i),this.addManagedListener(this.getGui(),"mouseleave",i),this.addManagedListener(this.getGui(),"click",e),this.addManagedListener(this.getGui(),"contextmenu",t)}handleMouseOverChange(i){const t={type:i?b.EVENT_COLUMN_HEADER_MOUSE_OVER:b.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column.getProvidedColumnGroup()};this.eventService.dispatchEvent(t)}setupTooltip(i,e){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const t=this.column.getColGroupDef(),s=this.gos.get("tooltipShowMode")==="whenTruncated",r=this.eGui;!e&&s&&!t?.headerGroupComponent&&(e=()=>{const n=r.querySelector(".ag-header-group-text");return n?n.scrollWidth>n.clientWidth:!0});const o={getColumn:()=>this.column,getGui:()=>r,getLocation:()=>"headerGroup",getTooltipValue:()=>i??(t&&t.headerTooltip),shouldDisplayTooltip:e};t&&(o.getColDef=()=>t),this.createBean(new er(o))}setupExpandable(){const i=this.column.getProvidedColumnGroup();this.refreshExpanded(),this.addManagedListener(i,At.EVENT_EXPANDABLE_CHANGED,this.refreshExpanded.bind(this)),this.addManagedListener(i,At.EVENT_EXPANDED_CHANGED,this.refreshExpanded.bind(this))}refreshExpanded(){const i=this.column;this.expandable=i.isExpandable();const e=i.isExpanded();this.expandable?this.comp.setAriaExpanded(e?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const i=this.column.getColGroupDef(),e=sd.getHeaderClassesFromColDef(i,this.gos,null,this.column);this.column.isPadding()?(e.push("ag-header-group-cell-no-group"),this.column.getLeafColumns().every(s=>s.isSpanHeaderHeight())&&e.push("ag-header-span-height")):e.push("ag-header-group-cell-with-group"),e.forEach(t=>this.comp.addOrRemoveCssClass(t,!0))}setupMovingCss(){const e=this.column.getProvidedColumnGroup().getLeafColumns(),t=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());e.forEach(s=>{this.addManagedListener(s,Qe.EVENT_MOVING_CHANGED,t)}),t()}onFocusIn(i){if(!this.eGui.contains(i.relatedTarget)){const e=this.getRowIndex();this.beans.focusService.setFocusedHeader(e,this.column)}}handleKeyDown(i){super.handleKeyDown(i);const e=this.getWrapperHasFocus();if(!(!this.expandable||!e)&&i.key===k.ENTER){const t=this.column,s=!t.isExpanded();this.beans.columnModel.setColumnGroupOpened(t.getProvidedColumnGroup(),s,"uiColumnExpanded")}}setDragSource(i){if(!this.isAlive()||this.isSuppressMoving()||(this.removeDragSource(),!i))return;const{beans:e,column:t,displayName:s,gos:r,dragAndDropService:o}=this,{columnModel:n}=e,a=t.getProvidedColumnGroup().getLeafColumns();let l=!r.get("suppressDragLeaveHidesColumns");const u=this.dragSource={type:1,eElement:i,getDefaultIconName:()=>l?Re.ICON_HIDE:Re.ICON_NOT_ALLOWED,dragItemName:s,getDragItem:()=>this.getDragItemForGroup(t),onDragStarted:()=>{l=!r.get("suppressDragLeaveHidesColumns"),a.forEach(h=>h.setMoving(!0,"uiColumnDragged"))},onDragStopped:()=>a.forEach(h=>h.setMoving(!1,"uiColumnDragged")),onGridEnter:h=>{var d;if(l){const c=((d=h?.columns)==null?void 0:d.filter(p=>!p.getColDef().lockVisible))||[];n.setColumnsVisible(c,!0,"uiColumnMoved")}},onGridExit:h=>{var d;if(l){const c=((d=h?.columns)==null?void 0:d.filter(p=>!p.getColDef().lockVisible))||[];n.setColumnsVisible(c,!1,"uiColumnMoved")}}};o.addDragSource(u,!0)}getDragItemForGroup(i){const e=i.getProvidedColumnGroup().getLeafColumns(),t={};e.forEach(r=>t[r.getId()]=r.isVisible());const s=[];return this.beans.columnModel.getAllDisplayedColumns().forEach(r=>{e.indexOf(r)>=0&&(s.push(r),_i(e,r))}),e.forEach(r=>s.push(r)),{columns:s,visibleState:t}}isSuppressMoving(){let i=!1;return this.column.getLeafColumns().forEach(t=>{(t.getColDef().suppressMovable||t.getColDef().lockPosition)&&(i=!0)}),i||this.gos.get("suppressMovableColumns")}},u_=0,Ta=class extends Z{constructor(i,e,t){super(),this.instanceId=u_++,this.rowIndex=i,this.pinned=e,this.type=t;const s=t=="group"?"ag-header-row-column-group":t=="filter"?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${s}`}postConstruct(){this.isPrintLayout=this.gos.isDomLayout("print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}getInstanceId(){return this.instanceId}setComp(i,e=!0){this.comp=i,e&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners()}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(){this.addManagedListener(this.eventService,b.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this)),this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_VIRTUAL_COLUMNS_CHANGED,i=>this.onVirtualColumnsChanged(i.afterScroll)),this.addManagedListener(this.eventService,b.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_GRID_STYLES_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("ensureDomOrder",i=>this.isEnsureDomOrder=i.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(i){if(this.headerCellCtrls)return io(this.headerCellCtrls).find(e=>e.getColumnGroupChild()===i)}onDisplayedColumnsChanged(){this.isPrintLayout=this.gos.isDomLayout("print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const i=this.getWidthForRow();this.comp.setWidth(`${i}px`)}getWidthForRow(){const{columnModel:i}=this.beans;return this.isPrintLayout?this.pinned!=null?0:i.getContainerWidth("right")+i.getContainerWidth("left")+i.getContainerWidth(null):i.getContainerWidth(this.pinned)}onRowHeightChanged(){var{topOffset:i,rowHeight:e}=this.getTopAndHeight();this.comp.setTop(i+"px"),this.comp.setHeight(e+"px")}getTopAndHeight(){const{columnModel:i,filterManager:e}=this.beans;let t=i.getHeaderRowCount();const s=[];let r=0;e.hasFloatingFilters()&&(t++,r=1);const o=i.getColumnGroupHeaderRowHeight(),n=i.getColumnHeaderRowHeight(),a=1+r,l=t-a;for(let d=0;d<l;d++)s.push(o);s.push(n);for(let d=0;d<r;d++)s.push(i.getFloatingFiltersHeight());let u=0;for(let d=0;d<this.rowIndex;d++)u+=s[d];const h=s[this.rowIndex];return{topOffset:u,rowHeight:h}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(i=!1){const e=this.getHeaderCtrls(),t=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(e,t,i)}getHeaderCtrls(){const i=this.headerCellCtrls;this.headerCellCtrls=new Map;const e=this.getColumnsInViewport();for(const r of e)this.recycleAndCreateHeaderCtrls(r,i);const t=r=>{const{focusService:o,columnModel:n}=this.beans;return o.isHeaderWrapperFocused(r)?n.isDisplayed(r.getColumnGroupChild()):!1};if(i)for(const[r,o]of i)t(o)?this.headerCellCtrls.set(r,o):this.destroyBean(o);return Array.from(this.headerCellCtrls.values())}recycleAndCreateHeaderCtrls(i,e){if(!this.headerCellCtrls||i.isEmptyGroup())return;const t=i.getUniqueId();let s;if(e&&(s=e.get(t),e.delete(t)),s&&s.getColumnGroupChild()!=i&&(this.destroyBean(s),s=void 0),s==null)switch(this.type){case"filter":s=this.createBean(new n_(i,this.beans,this));break;case"group":s=this.createBean(new l_(i,this.beans,this));break;default:s=this.createBean(new a_(i,this.beans,this));break}this.headerCellCtrls.set(t,s)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(this.pinned!=null)return[];let i=[];const e=this.getActualDepth(),{columnModel:t}=this.beans;return["left",null,"right"].forEach(s=>{const r=t.getVirtualHeaderGroupRow(s,e);i=i.concat(r)}),i}getActualDepth(){return this.type=="filter"?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnModel.getVirtualHeaderGroupRow(this.pinned,this.getActualDepth())}focusHeader(i,e){if(!this.headerCellCtrls)return!1;const s=Array.from(this.headerCellCtrls.values()).find(r=>r.getColumnGroupChild()==i);return s?s.focus(e):!1}destroy(){this.headerCellCtrls&&this.headerCellCtrls.forEach(i=>{this.destroyBean(i)}),this.headerCellCtrls=void 0,super.destroy()}};g([R("beans")],Ta.prototype,"beans",2);g([J],Ta.prototype,"postConstruct",1);var Pr=class extends Z{constructor(i){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=i}setComp(i,e){this.comp=i,this.eViewport=e,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport),this.addManagedListener(this.eventService,b.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.ctrlsService.registerHeaderContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}setupDragAndDrop(i){const e=new Hn(this.pinned,i);this.createManagedBean(e)}refresh(i=!1){const e=new vn,t=this.focusService.getFocusHeaderToUseAfterRefresh(),s=()=>{const a=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let l=0;l<a;l++){const u=this.createBean(new Ta(e.next(),this.pinned,"group"));this.groupsRowCtrls.push(u)}},r=()=>{const a=e.next(),l=!this.hidden&&(this.columnsRowCtrl==null||!i||this.columnsRowCtrl.getRowIndex()!==a);(l||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),l&&(this.columnsRowCtrl=this.createBean(new Ta(a,this.pinned,"column")))},o=()=>{this.includeFloatingFilter=this.filterManager.hasFloatingFilters()&&!this.hidden;const a=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){a();return}const l=e.next();if(this.filtersRowCtrl){const u=this.filtersRowCtrl.getRowIndex()!==l;(!i||u)&&a()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new Ta(l,this.pinned,"filter")))};s(),r(),o();const n=this.getAllCtrls();this.comp.setCtrls(n),this.restoreFocusOnHeader(t)}restoreFocusOnHeader(i){i==null||i.column.getPinned()!=this.pinned||this.focusService.focusHeaderPosition({headerPosition:i})}getAllCtrls(){const i=[...this.groupsRowCtrls];return this.columnsRowCtrl&&i.push(this.columnsRowCtrl),this.filtersRowCtrl&&i.push(this.filtersRowCtrl),i}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const i=this.filterManager.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==i&&this.refresh(!0)}setupCenterWidth(){this.pinned==null&&this.createManagedBean(new kn(i=>this.comp.setCenterWidth(`${i}px`),!0))}setHorizontalScroll(i){this.comp.setViewportScrollLeft(i)}setupPinnedWidth(){if(this.pinned==null)return;const i=this.pinned==="left",e=this.pinned==="right";this.hidden=!0;const t=()=>{const s=i?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(s==null)return;const r=s==0,o=this.hidden!==r,n=this.gos.get("enableRtl"),a=this.gos.getScrollbarWidth(),u=this.scrollVisibleService.isVerticalScrollShowing()&&(n&&i||!n&&e)?s+a:s;this.comp.setPinnedContainerWidth(`${u}px`),this.comp.setDisplayed(!r),o&&(this.hidden=r,this.refresh())};this.addManagedListener(this.eventService,b.EVENT_LEFT_PINNED_WIDTH_CHANGED,t),this.addManagedListener(this.eventService,b.EVENT_RIGHT_PINNED_WIDTH_CHANGED,t),this.addManagedListener(this.eventService,b.EVENT_SCROLL_VISIBILITY_CHANGED,t),this.addManagedListener(this.eventService,b.EVENT_SCROLLBAR_WIDTH_CHANGED,t)}getHeaderCtrlForColumn(i){if(i instanceof Qe)return this.columnsRowCtrl?this.columnsRowCtrl.getHeaderCellCtrl(i):void 0;if(this.groupsRowCtrls.length!==0)for(let e=0;e<this.groupsRowCtrls.length;e++){const t=this.groupsRowCtrls[e].getHeaderCellCtrl(i);if(t)return t}}getHtmlElementForColumnHeader(i){const e=this.getHeaderCtrlForColumn(i);return e?e.getGui():null}getRowType(i){const t=this.getAllCtrls()[i];return t?t.getType():void 0}focusHeader(i,e,t){const r=this.getAllCtrls()[i];return r?r.focusHeader(e,t):!1}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()}};g([R("ctrlsService")],Pr.prototype,"ctrlsService",2);g([R("scrollVisibleService")],Pr.prototype,"scrollVisibleService",2);g([R("pinnedWidthService")],Pr.prototype,"pinnedWidthService",2);g([R("columnModel")],Pr.prototype,"columnModel",2);g([R("focusService")],Pr.prototype,"focusService",2);g([R("filterManager")],Pr.prototype,"filterManager",2);var ko=class Gu extends Se{constructor(e){super(),this.headerRowComps={},this.rowCompsList=[],this.pinned=e}init(){this.selectAndSetTemplate();const e={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 r=this.getGui();r.style.width=s,r.style.maxWidth=s,r.style.minWidth=s}};this.createManagedBean(new Pr(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e=this.pinned=="left",t=this.pinned=="right",s=e?Gu.PINNED_LEFT_TEMPLATE:t?Gu.PINNED_RIGHT_TEMPLATE:Gu.CENTER_TEMPLATE;this.setTemplate(s),this.eRowContainer=this.eCenterContainer?this.eCenterContainer:this.getGui()}destroyRowComps(){this.setCtrls([])}destroyRowComp(e){this.destroyBean(e),this.eRowContainer.removeChild(e.getGui())}setCtrls(e){const t=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let s;const r=o=>{const n=o.getGui();n.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(n),s&&Lp(this.eRowContainer,n,s),s=n};e.forEach(o=>{const n=o.getInstanceId(),a=t[n];delete t[n];const l=a||this.createBean(new ig(o));this.headerRowComps[n]=l,this.rowCompsList.push(l),r(l)}),Cr(t).forEach(o=>this.destroyRowComp(o))}};ko.PINNED_LEFT_TEMPLATE='<div class="ag-pinned-left-header" role="rowgroup"></div>';ko.PINNED_RIGHT_TEMPLATE='<div class="ag-pinned-right-header" role="rowgroup"></div>';ko.CENTER_TEMPLATE=`<div class="ag-header-viewport" role="presentation">
<div class="ag-header-container" ref="eCenterContainer" role="rowgroup"></div>
</div>`;g([te("eCenterContainer")],ko.prototype,"eCenterContainer",2);g([J],ko.prototype,"init",1);g([vi],ko.prototype,"destroyRowComps",1);var Zd=ko,co=class extends Z{constructor(){super(...arguments),this.currentHeaderRowWithoutSpan=-1}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl});const i=this.gos.getDocument();this.addManagedListener(i,"mousedown",()=>this.setCurrentHeaderRowWithoutSpan(-1))}getHeaderRowCount(){const i=this.ctrlsService.getHeaderRowContainerCtrl();return i?i.getRowCount():0}navigateVertically(i,e,t){if(e||(e=this.focusService.getFocusedHeader()),!e)return!1;const{headerRowIndex:s,column:r}=e,o=this.getHeaderRowCount(),n=i===0;let{headerRowIndex:a,column:l,headerRowIndexWithoutSpan:u}=n?this.headerPositionUtils.getColumnVisibleParent(r,s):this.headerPositionUtils.getColumnVisibleChild(r,s),h=!1;return a<0&&(a=0,l=r,h=!0),a>=o?(a=-1,this.setCurrentHeaderRowWithoutSpan(-1)):u!==void 0&&(this.currentHeaderRowWithoutSpan=u),!h&&!l?!1:this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a,column:l},allowUserOverride:!0,event:t})}setCurrentHeaderRowWithoutSpan(i){this.currentHeaderRowWithoutSpan=i}navigateHorizontally(i,e=!1,t){const s=this.focusService.getFocusedHeader(),r=i===2,o=this.gos.get("enableRtl");let n,a;if(this.currentHeaderRowWithoutSpan!==-1?s.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=s.headerRowIndex,r!==o?(a="Before",n=this.headerPositionUtils.findHeader(s,a)):(a="After",n=this.headerPositionUtils.findHeader(s,a)),n||!e)return this.focusService.focusHeaderPosition({headerPosition:n,direction:a,fromTab:e,allowUserOverride:!0,event:t});if(e){const l=this.gos.getCallback("tabToNextHeader");if(l)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:l,headerPosition:n,direction:a})}return this.focusNextHeaderRow(s,a,t)}focusNextHeaderRow(i,e,t){const s=i.headerRowIndex;let r=null,o;if(e==="Before"?s>0&&(o=s-1,this.currentHeaderRowWithoutSpan-=1,r=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"end")):(o=s+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),r=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"start")),!r)return!1;const{column:n,headerRowIndex:a}=this.headerPositionUtils.getHeaderIndexToFocus(r.column,r?.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:n,headerRowIndex:a},direction:e,fromTab:!0,allowUserOverride:!0,event:t})}scrollToColumn(i,e="After"){if(i.getPinned())return;let t;if(i instanceof jt){const s=i.getDisplayedLeafColumns();t=e==="Before"?We(s):s[0]}else t=i;this.gridBodyCon.getScrollFeature().ensureColumnVisible(t)}};g([R("focusService")],co.prototype,"focusService",2);g([R("headerPositionUtils")],co.prototype,"headerPositionUtils",2);g([R("ctrlsService")],co.prototype,"ctrlsService",2);g([J],co.prototype,"postConstruct",1);co=g([le("headerNavigationService")],co);var Tr=class extends Z{setComp(i,e,t){this.comp=i,this.eGui=e,this.createManagedBean(new Dr(t,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedListener(this.eventService,b.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,b.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.register("gridHeaderCtrl",this)}setupHeaderHeight(){const i=this.setHeaderHeight.bind(this);i(),this.addManagedPropertyListener("headerHeight",i),this.addManagedPropertyListener("pivotHeaderHeight",i),this.addManagedPropertyListener("groupHeaderHeight",i),this.addManagedPropertyListener("pivotGroupHeaderHeight",i),this.addManagedPropertyListener("floatingFiltersHeight",i),this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_CHANGED,i),this.addManagedListener(this.eventService,b.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,i),this.addManagedListener(this.eventService,b.EVENT_GRID_STYLES_CHANGED,i),this.addManagedListener(this.eventService,b.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,i)}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:i}=this;let e=0,t=i.getHeaderRowCount(),s;this.filterManager.hasFloatingFilters()&&(t++,e=1);const o=this.columnModel.getColumnGroupHeaderRowHeight(),n=this.columnModel.getColumnHeaderRowHeight(),a=1+e,l=t-a;if(s=e*i.getFloatingFiltersHeight(),s+=l*o,s+=n,this.headerHeight===s)return;this.headerHeight=s;const u=`${s+1}px`;this.comp.setHeightAndMinHeight(u),this.eventService.dispatchEvent({type:b.EVENT_HEADER_HEIGHT_CHANGED})}onPivotModeChanged(){const i=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",i),this.comp.addOrRemoveCssClass("ag-pivot-off",!i)}onDisplayedColumnsChanged(){const e=this.columnModel.getAllDisplayedColumns().some(t=>t.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",e)}onTabKeyDown(i){const e=this.gos.get("enableRtl"),t=i.shiftKey!==e?2:3;(this.headerNavigationService.navigateHorizontally(t,!0,i)||this.focusService.focusNextGridCoreContainer(i.shiftKey))&&i.preventDefault()}handleKeyDown(i){let e=null;switch(i.key){case k.LEFT:e=2;case k.RIGHT:K(e)||(e=3),this.headerNavigationService.navigateHorizontally(e,!1,i);break;case k.UP:e=0;case k.DOWN:K(e)||(e=1),this.headerNavigationService.navigateVertically(e,null,i)&&i.preventDefault();break;default:return}}onFocusOut(i){const{relatedTarget:e}=i;!e&&this.eGui.contains(this.gos.getActiveDomElement())||this.eGui.contains(e)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(i,e,t){if(!i&&!t||!this.menuService.isHeaderContextMenuEnabled())return;const{target:s}=i??e;(s===this.eGui||s===this.ctrlsService.getHeaderRowContainerCtrl().getViewport())&&this.menuService.showHeaderContextMenu(void 0,i,t)}mockContextMenuForIPad(i){if(!Js())return;const e=new Kt(this.eGui),t=s=>{i(void 0,s.touchStart,s.touchEvent)};this.addManagedListener(e,Kt.EVENT_LONG_TAP,t),this.addDestroyFunc(()=>e.destroy())}};g([R("headerNavigationService")],Tr.prototype,"headerNavigationService",2);g([R("focusService")],Tr.prototype,"focusService",2);g([R("columnModel")],Tr.prototype,"columnModel",2);g([R("ctrlsService")],Tr.prototype,"ctrlsService",2);g([R("filterManager")],Tr.prototype,"filterManager",2);g([R("menuService")],Tr.prototype,"menuService",2);var rg=class DC extends Se{constructor(){super(DC.TEMPLATE)}postConstruct(){const e={addOrRemoveCssClass:(r,o)=>this.addOrRemoveCssClass(r,o),setHeightAndMinHeight:r=>{this.getGui().style.height=r,this.getGui().style.minHeight=r}};this.createManagedBean(new Tr).setComp(e,this.getGui(),this.getFocusableElement());const s=r=>{this.createManagedBean(r),this.appendChild(r)};s(new Zd("left")),s(new Zd(null)),s(new Zd("right"))}};rg.TEMPLATE='<div class="ag-header" role="presentation"/>';g([J],rg.prototype,"postConstruct",1);var h_=rg,za=class extends Z{addResizeBar(i){const e={dragStartPixels:i.dragStartPixels||0,eElement:i.eResizeBar,onDragStart:this.onDragStart.bind(this,i),onDragStop:this.onDragStop.bind(this,i),onDragging:this.onDragging.bind(this,i),includeTouch:!0,stopPropagationForTouch:!0};return this.dragService.addDragSource(e),()=>this.dragService.removeDragSource(e)}onDragStart(i,e){this.dragStartX=e.clientX,this.setResizeIcons();const t=e instanceof MouseEvent&&e.shiftKey===!0;i.onResizeStart(t)}setResizeIcons(){const i=this.ctrlsService.get("gridCtrl");i.setResizeCursor(!0),i.disableUserSelect(!0)}onDragStop(i,e){i.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const i=this.ctrlsService.get("gridCtrl");i.setResizeCursor(!1),i.disableUserSelect(!1)}onDragging(i,e){this.resizeAmount=e.clientX-this.dragStartX,i.onResizing(this.resizeAmount)}};g([R("dragService")],za.prototype,"dragService",2);g([R("ctrlsService")],za.prototype,"ctrlsService",2);za=g([le("horizontalResizeService")],za);var wr=class extends Z{hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(i,e,t){this.showPopup(i,s=>{this.popupService.positionPopupUnderMouseEvent({column:i,type:t,mouseEvent:e,ePopup:s})},t,e.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(i,e,t){let s=-1,r="left";const o=this.menuService.isLegacyMenuEnabled();!o&&this.gos.get("enableRtl")&&(s=1,r="right");let n=o?void 0:4*s,a=o?void 0:4;this.showPopup(i,l=>{this.popupService.positionPopupByComponent({type:t,eventSource:e,ePopup:l,nudgeX:n,nudgeY:a,alignSide:r,keepWithinBounds:!0,position:"under",column:i})},t,e,o)}showPopup(i,e,t,s,r){const o=i?this.createBean(new td(i,"COLUMN_MENU")):void 0;if(this.activeMenu=o,!o?.hasFilter()||!i)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const n=document.createElement("div");yt(n,"presentation"),n.classList.add("ag-menu"),r||n.classList.add("ag-filter-menu"),this.tabListener=this.addManagedListener(n,"keydown",y=>this.trapFocusWithin(y,n)),n.appendChild(o?.getGui());let a;const l=()=>o?.afterGuiDetached(),u=this.menuService.isColumnMenuAnchoringEnabled()?s??this.ctrlsService.getGridBodyCtrl().getGui():void 0,h=y=>{i.setMenuVisible(!1,"contextMenu");const f=y instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),f&&s&&Pi(s)){const w=this.focusService.findTabbableParent(s);w&&w.focus()}l(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,t,i)},d=this.localeService.getLocaleTextFunc(),c=r&&t!=="columnFilter"?d("ariaLabelColumnMenu","Column Menu"):d("ariaLabelColumnFilter","Column Filter"),p=this.popupService.addPopup({modal:!0,eChild:n,closeOnEsc:!0,closedCallback:h,positionCallback:()=>e(n),anchorToElement:u,ariaLabel:c});p&&(this.hidePopup=a=p.hideFunc),o.afterInit().then(()=>{e(n),o.afterGuiAttached({container:t,hidePopup:a})}),i.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,t,i)}trapFocusWithin(i,e){i.key!==k.TAB||i.defaultPrevented||this.focusService.findNextFocusableElement(e,!1,i.shiftKey)||(i.preventDefault(),this.focusService.focusInto(e,i.shiftKey))}dispatchVisibleChangedEvent(i,e,t){const s={type:b.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:i,switchingTab:!1,key:e,column:t??null};this.eventService.dispatchEvent(s)}isMenuEnabled(i){var e;return i.isFilterAllowed()&&((e=i.getColDef().menuTabs)!=null?e:["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}};g([R("filterManager")],wr.prototype,"filterManager",2);g([R("popupService")],wr.prototype,"popupService",2);g([R("focusService")],wr.prototype,"focusService",2);g([R("ctrlsService")],wr.prototype,"ctrlsService",2);g([R("menuService")],wr.prototype,"menuService",2);wr=g([le("filterMenuFactory")],wr);var Vu=(i=>(i.TAB_GUARD="ag-tab-guard",i.TAB_GUARD_TOP="ag-tab-guard-top",i.TAB_GUARD_BOTTOM="ag-tab-guard-bottom",i))(Vu||{}),ud=class extends Z{constructor(i){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1;const{comp:e,eTopGuard:t,eBottomGuard:s,focusTrapActive:r,forceFocusOutWhenTabGuardsAreEmpty:o,focusInnerElement:n,onFocusIn:a,onFocusOut:l,shouldStopEventPropagation:u,onTabKeyDown:h,handleKeyDown:d,eFocusableElement:c}=i;this.comp=e,this.eTopGuard=t,this.eBottomGuard=s,this.providedFocusInnerElement=n,this.eFocusableElement=c,this.focusTrapActive=!!r,this.forceFocusOutWhenTabGuardsAreEmpty=!!o,this.providedFocusIn=a,this.providedFocusOut=l,this.providedShouldStopEventPropagation=u,this.providedOnTabKeyDown=h,this.providedHandleKeyDown=d}postConstruct(){this.createManagedBean(new Dr(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:i=>this.onTabKeyDown(i),handleKeyDown:i=>this.handleKeyDown(i),onFocusIn:i=>this.onFocusIn(i),onFocusOut:i=>this.onFocusOut(i)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach(i=>this.addManagedListener(i,"focus",this.onFocus.bind(this)))}handleKeyDown(i){this.providedHandleKeyDown&&this.providedHandleKeyDown(i)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return this.providedShouldStopEventPropagation?this.providedShouldStopEventPropagation():!1}activateTabGuards(){if(this.forcingFocusOut)return;const i=this.gos.get("tabIndex");this.comp.setTabIndex(i.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(i){if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty&&this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length===0){this.findNextElementOutsideAndFocus(i.target===this.eBottomGuard);return}const e=i.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(e):this.focusInnerElement(e)}findNextElementOutsideAndFocus(i){const e=this.gos.getDocument(),t=this.focusService.findFocusableElements(e.body,null,!0),s=t.indexOf(i?this.eTopGuard:this.eBottomGuard);if(s===-1)return;let r,o;i?(r=0,o=s):(r=s+1,o=t.length);const n=t.slice(r,o),a=this.gos.get("tabIndex");n.sort((l,u)=>{const h=parseInt(l.getAttribute("tabindex")||"0"),d=parseInt(u.getAttribute("tabindex")||"0");return d===a?1:h===a?-1:h===0?1:d===0?-1:h-d}),n[i?n.length-1:0].focus()}onFocusIn(i){this.focusTrapActive||(this.providedFocusIn&&this.providedFocusIn(i),this.deactivateTabGuards())}onFocusOut(i){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(i),this.eFocusableElement.contains(i.relatedTarget)||this.activateTabGuards())}onTabKeyDown(i){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(i);return}if(this.focusTrapActive||i.defaultPrevented)return;const e=this.tabGuardsAreActive();e&&this.deactivateTabGuards();const t=this.getNextFocusableElement(i.shiftKey);e&&setTimeout(()=>this.activateTabGuards(),0),t&&(t.focus(),i.preventDefault())}focusInnerElement(i=!1){const e=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(e.splice(0,1),e.splice(e.length-1,1)),e.length&&e[i?e.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(i){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,i)}forceFocusOutOfContainer(i=!1){if(this.forcingFocusOut)return;const e=i?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,e.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(i){return i===this.eTopGuard||i===this.eBottomGuard}};g([R("focusService")],ud.prototype,"focusService",2);g([J],ud.prototype,"postConstruct",1);var Ol=class extends Se{initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.getFocusableElement();const t=[this.eTopGuard,this.eBottomGuard],s={setTabIndex:r=>{t.forEach(o=>r!=null?o.setAttribute("tabindex",r):o.removeAttribute("tabindex"))}};this.addTabGuards(this.eTopGuard,this.eBottomGuard),this.tabGuardCtrl=this.createManagedBean(new ud({comp:s,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"),s=e==="top"?"ag-tab-guard-top":"ag-tab-guard-bottom";return t.classList.add("ag-tab-guard",s),yt(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];Rt(this.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t){xl(e)||(e=e.getGui());const{eBottomGuard:s}=this;s?s.insertAdjacentElement("beforebegin",e):super.appendChild(e,t)}},hd=class PC extends Ol{constructor(e){super(PC.getTemplate(e.cssClass)),this.items=[],this.tabbedItemScrollMap=new Map,this.params=e}postConstruct(){this.setupHeader(),this.params.items&&this.params.items.forEach(e=>this.addItem(e)),this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),focusInnerElement:this.focusInnerElement.bind(this),focusTrapActive:!0}),this.addDestroyFunc(()=>{var e,t,s;return(s=(t=(e=this.activeItem)==null?void 0:e.tabbedItem)==null?void 0:t.afterDetachedCallback)==null?void 0:s.call(t)})}static getTemplate(e){return`<div class="ag-tabs ${e}">
<div ref="eHeader"></div>
<div ref="eBody" role="presentation" class="ag-tabs-body ${e?`${e}-body`:""}"></div>
</div>`}setupHeader(){const{enableCloseButton:e,cssClass:t}=this.params,s=(r,o)=>{r.classList.add(`ag-tabs-${o}`),t&&r.classList.add(`${t}-${o}`)};e?(this.setupCloseButton(s),this.eTabHeader=this.gos.getDocument().createElement("div"),s(this.eHeader,"header-wrapper"),yt(this.eHeader,"presentation"),this.eHeader.appendChild(this.eTabHeader)):this.eTabHeader=this.eHeader,yt(this.eTabHeader,"tablist"),s(this.eTabHeader,"header")}setupCloseButton(e){const t=this.gos.getDocument(),s=t.createElement("button");e(s,"close-button");const r=dt("close",this.gos,void 0,!0);Gi(s,this.params.closeButtonAriaLabel),s.appendChild(r),this.addManagedListener(s,"click",()=>{var n,a;return(a=(n=this.params).onCloseClicked)==null?void 0:a.call(n)});const o=t.createElement("div");e(o,"close-button-wrapper"),yt(o,"presentation"),o.appendChild(s),this.eHeader.appendChild(o),this.eCloseButton=s}handleKeyDown(e){switch(e.key){case k.RIGHT:case k.LEFT:if(!this.eTabHeader.contains(this.gos.getActiveDomElement()))return;const t=e.key===k.RIGHT,s=this.gos.get("enableRtl"),r=this.items.indexOf(this.activeItem),o=t!==s?Math.min(r+1,this.items.length-1):Math.max(r-1,0);if(r===o)return;e.preventDefault();const n=this.items[o];this.showItemWrapper(n),n.eHeaderButton.focus();break;case k.UP:case k.DOWN:e.stopPropagation();break}}onTabKeyDown(e){var t,s,r,o;if(e.defaultPrevented)return;const{focusService:n,eHeader:a,eBody:l,activeItem:u,params:h}=this,{suppressTrapFocus:d,enableCloseButton:c}=h,p=this.gos.getActiveDomElement(),y=e.target,f=e.shiftKey;if(a.contains(p)){e.preventDefault(),c&&f&&!((t=this.eCloseButton)!=null&&t.contains(p))?(s=this.eCloseButton)==null||s.focus():d&&f?(r=this.focusService.findFocusableElementBeforeTabGuard(this.gos.getDocument().body,y))==null||r.focus():this.focusBody(e.shiftKey);return}let w=null;if(n.isTargetUnderManagedComponent(l,y)&&(f&&(w=this.focusService.findFocusableElementBeforeTabGuard(l,y)),!w&&!d&&(w=u.eHeaderButton)),!w&&l.contains(p)&&(w=n.findNextFocusableElement(l,!1,f),!w)){e.preventDefault(),d&&!f?this.forceFocusOutOfContainer(f):c&&!f?(o=this.eCloseButton)==null||o.focus():this.focusHeader();return}w&&(e.preventDefault(),w.focus())}focusInnerElement(e){e?this.focusHeader():this.focusBody(!0)}focusHeader(e){this.activeItem.eHeaderButton.focus({preventScroll:e})}focusBody(e){this.focusService.focusInto(this.eBody,e)}setAfterAttachedParams(e){this.afterAttachedParams=e}showFirstItem(){this.items.length>0&&this.showItemWrapper(this.items[0])}addItem(e){const t=document.createElement("span");yt(t,"tab"),t.setAttribute("tabindex","-1"),t.appendChild(e.title),t.classList.add("ag-tab"),this.eTabHeader.appendChild(t),Gi(t,e.titleLabel);const s={tabbedItem:e,eHeaderButton:t};this.items.push(s),t.addEventListener("click",this.showItemWrapper.bind(this,s))}showItem(e){const t=this.items.find(s=>s.tabbedItem===e);t&&this.showItemWrapper(t)}showItemWrapper(e){var t,s,r,o,n,a;const{tabbedItem:l,eHeaderButton:u}=e;if((s=(t=this.params).onItemClicked)==null||s.call(t,{item:l}),this.activeItem===e){(o=(r=this.params).onActiveItemClicked)==null||o.call(r);return}this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),Rt(this.eBody),l.bodyPromise.then(h=>{this.eBody.appendChild(h);const d=!this.focusService.isKeyboardMode();if(this.params.suppressFocusBodyOnOpen||this.focusService.focusInto(this.eBody,!1,d),l.afterAttachedCallback&&l.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const c=l.getScrollableContainer&&l.getScrollableContainer()||h;this.lastScrollListener=this.addManagedListener(c,"scroll",()=>{this.tabbedItemScrollMap.set(l.name,c.scrollTop)});const p=this.tabbedItemScrollMap.get(l.name);p!==void 0&&setTimeout(()=>{c.scrollTop=p},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),(a=(n=this.activeItem.tabbedItem).afterDetachedCallback)==null||a.call(n)),u.classList.add("ag-tab-selected"),this.activeItem=e}};g([R("focusService")],hd.prototype,"focusService",2);g([te("eHeader")],hd.prototype,"eHeader",2);g([te("eBody")],hd.prototype,"eBody",2);g([J],hd.prototype,"postConstruct",1);var d_=50,zc=class extends Z{constructor(){super(...arguments),this.polyfillFunctions=[]}observeResize(i,e){const t=this.gos.getWindow(),s=()=>{const a=new t.ResizeObserver(e);return a.observe(i),()=>a.disconnect()},r=()=>{var a,l;let u=(a=i?.clientWidth)!=null?a:0,h=(l=i?.clientHeight)!=null?l:0,d=!0;const c=()=>{var p,y;if(d){const f=(p=i?.clientWidth)!=null?p:0,w=(y=i?.clientHeight)!=null?y:0;(f!==u||w!==h)&&(u=f,h=w,e()),this.doNextPolyfillTurn(c)}};return c(),()=>d=!1},o=this.gos.get("suppressBrowserResizeObserver");return!!t.ResizeObserver&&!o?s():this.getFrameworkOverrides().wrapIncoming(()=>r(),"resize-observer")}doNextPolyfillTurn(i){this.polyfillFunctions.push(i),this.schedulePolyfill()}schedulePolyfill(){if(this.polyfillScheduled)return;const i=()=>{const e=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],e.forEach(t=>t())};this.polyfillScheduled=!0,window.setTimeout(i,d_)}};zc=g([le("resizeObserverService")],zc);var yn=class extends Z{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(i){const e=this.gos.get("pagination");if(this.scrollGoingDown=i>=this.lastScrollTop,e&&i===0){const t=this.paginationProxy.getCurrentPage();t!==this.lastPage&&(this.lastPage=t,this.scrollGoingDown=!0)}this.lastScrollTop=i}init(){this.useAnimationFrame=!this.gos.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(i){this.useAnimationFrame===!1&&console.warn(`AG Grid: AnimationFrameService.${i} called but animation frames are off`)}createTask(i,e,t){this.verifyAnimationFrameOn(t);const s={task:i,index:e,createOrder:++this.taskCount};this.addTaskToList(this[t],s),this.schedule()}cancelTask(i){this.cancelledTasks.add(i)}addTaskToList(i,e){i.list.push(e),i.sorted=!1}sortTaskList(i){if(i.sorted)return;const e=this.scrollGoingDown?1:-1;i.list.sort((t,s)=>t.index!==s.index?e*(s.index-t.index):s.createOrder-t.createOrder),i.sorted=!0}addDestroyTask(i){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(i),this.schedule()}executeFrame(i){this.verifyAnimationFrameOn("executeFrame");const e=this.createTasksP1,t=e.list,s=this.createTasksP2,r=s.list,o=this.destroyTasks,n=new Date().getTime();let a=new Date().getTime()-n;const l=i<=0,u=this.ctrlsService.getGridBodyCtrl();for(;l||a<i;){if(!u.getScrollFeature().scrollGridIfNeeded()){let d;if(t.length)this.sortTaskList(e),d=t.pop().task;else if(r.length)this.sortTaskList(s),d=r.pop().task;else if(o.length)d=o.pop();else{this.cancelledTasks.clear();break}this.cancelledTasks.has(d)||d()}a=new Date().getTime()-n}t.length||r.length||o.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 i=this.executeFrame.bind(this,60);this.requestAnimationFrame(i)}requestAnimationFrame(i){const e=this.gos.getWindow();e.requestAnimationFrame?e.requestAnimationFrame(i):e.webkitRequestAnimationFrame?e.webkitRequestAnimationFrame(i):e.setTimeout(i,0)}isQueueEmpty(){return!this.ticking}debounce(i){let e=!1;return()=>{if(!this.isOn()){window.setTimeout(i,0);return}e||(e=!0,this.addDestroyTask(()=>{e=!1,i()}))}}};g([R("ctrlsService")],yn.prototype,"ctrlsService",2);g([R("paginationProxy")],yn.prototype,"paginationProxy",2);g([J],yn.prototype,"init",1);yn=g([le("animationFrameService")],yn);var Ya=class extends Z{postConstruct(){this.isClientSideRowModel=this.rowModel.getType()==="clientSide"}expandRows(i){if(!this.isClientSideRowModel)return;const e=new Set(i);this.rowModel.forEachNode(t=>{t.id&&e.has(t.id)&&(t.expanded=!0)}),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const i=[];return this.rowModel.forEachNode(({expanded:e,id:t})=>{e&&t&&i.push(t)}),i}expandAll(i){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(i)}setRowNodeExpanded(i,e,t,s){i&&(t&&i.parent&&i.parent.level!==-1&&this.setRowNodeExpanded(i.parent,e,t,s),i.setExpanded(e,void 0,s))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}};g([R("rowModel")],Ya.prototype,"rowModel",2);g([J],Ya.prototype,"postConstruct",1);Ya=g([le("expansionService")],Ya);var es=class extends Z{postConstruct(){var i;this.activeMenuFactory=(i=this.enterpriseMenuFactory)!=null?i:this.filterMenuFactory}showColumnMenu(i){this.showColumnMenuCommon(this.activeMenuFactory,i,"columnMenu")}showFilterMenu(i){const e=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(e,i,i.containerType,!0)}showHeaderContextMenu(i,e,t){this.activeMenuFactory.showMenuAfterContextMenuEvent(i,e,t)}getContextMenuPosition(i,e){const t=this.getRowCtrl(i),s=this.getCellGui(t,e);if(!s)return t?{x:0,y:t.getRowYPosition()}:{x:0,y:0};const r=s.getBoundingClientRect();return{x:r.x+r.width/2,y:r.y+r.height/2}}showContextMenu(i){var e,t,s;const{column:r,rowNode:o}=i;let{anchorToElement:n,value:a}=i;o&&r&&a==null&&(a=o.getValueFromValueService(r)),n==null&&(n=this.getContextMenuAnchorElement(o,r)),(s=this.contextMenuFactory)==null||s.onContextMenu((e=i.mouseEvent)!=null?e:null,(t=i.touchEvent)!=null?t:null,o??null,r??null,a,n)}showColumnChooser(i){var e;(e=this.columnChooserFactory)==null||e.showColumnChooser(i)}hidePopupMenu(){var i;(i=this.contextMenuFactory)==null||i.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){var i;(i=this.columnChooserFactory)==null||i.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(i){const{suppressMenu:e,suppressHeaderMenuButton:t}=i.getColDef();return!(t??e)&&this.activeMenuFactory.isMenuEnabled(i)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(i){return!i.getColDef().suppressHeaderFilterButton&&this.filterManager.isFilterAllowed(i)}isHeaderContextMenuEnabled(i){return!i?.getColDef().suppressHeaderContextMenu&&this.getColumnMenuType()==="new"}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const i=!this.isSuppressMenuHide();return!(Js()&&i)}isHeaderFilterButtonEnabled(i){return this.isFilterMenuInHeaderEnabled(i)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(i)}isFilterMenuItemEnabled(i){return this.filterManager.isFilterAllowed(i)&&!this.isLegacyMenuEnabled()&&!this.isFilterMenuInHeaderEnabled(i)&&!this.isFloatingFilterButtonDisplayed(i)}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return this.getColumnMenuType()==="new"}isLegacyMenuEnabled(){return this.getColumnMenuType()==="legacy"}isFloatingFilterButtonEnabled(i){var e;const t=i.getColDef(),s=(e=t.floatingFilterComponentParams)==null?void 0:e.suppressFilterButton;return s!=null&&fe("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),t.suppressFloatingFilterButton==null?!s:!t.suppressFloatingFilterButton}getColumnMenuType(){var i;return(i=this.gos.get("columnMenu"))!=null?i:"legacy"}isFloatingFilterButtonDisplayed(i){return!!i.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(i)}isSuppressMenuHide(){const i=this.gos.get("suppressMenuHide");return this.isLegacyMenuEnabled()||this.gos.exists("suppressMenuHide")?i:!0}showColumnMenuCommon(i,e,t,s){const{column:r,positionBy:o}=e;if(o==="button"){const{buttonElement:n}=e;i.showMenuAfterButtonClick(r,n,t,s)}else if(o==="mouse"){const{mouseEvent:n}=e;i.showMenuAfterMouseEvent(r,n,t,s)}else r&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(r,"auto"),this.animationFrameService.requestAnimationFrame(()=>{const n=this.ctrlsService.getHeaderRowContainerCtrl(r.getPinned()).getHeaderCtrlForColumn(r);i.showMenuAfterButtonClick(r,n.getAnchorElementForMenu(s),t,!0)}))}getRowCtrl(i){const{rowIndex:e,rowPinned:t}=i||{};if(e!=null)return this.rowRenderer.getRowByPosition({rowIndex:e,rowPinned:t})||void 0}getCellGui(i,e){if(!i||!e)return;const t=i.getCellCtrl(e);return t?.getGui()||void 0}getContextMenuAnchorElement(i,e){const t=this.ctrlsService.getGridBodyCtrl().getGridBodyElement(),s=this.getRowCtrl(i);if(!s)return t;const r=this.getCellGui(s,e);return r||(s.isFullWidth()?s.getFullWidthElement():t)}};g([R("filterMenuFactory")],es.prototype,"filterMenuFactory",2);g([R("ctrlsService")],es.prototype,"ctrlsService",2);g([R("animationFrameService")],es.prototype,"animationFrameService",2);g([R("filterManager")],es.prototype,"filterManager",2);g([R("rowRenderer")],es.prototype,"rowRenderer",2);g([Ke("columnChooserFactory")],es.prototype,"columnChooserFactory",2);g([Ke("contextMenuFactory")],es.prototype,"contextMenuFactory",2);g([Ke("enterpriseMenuFactory")],es.prototype,"enterpriseMenuFactory",2);g([J],es.prototype,"postConstruct",1);es=g([le("menuService")],es);var po=class extends Z{postConstruct(){this.ctrlsService.whenReady(i=>{this.centerRowContainerCtrl=i.center})}getPreferredWidthForColumn(i,e){const t=this.getHeaderCellForColumn(i);if(!t)return-1;const s=this.rowRenderer.getAllCellsForColumn(i);return e||s.push(t),this.addElementsToContainerAndGetWidth(s)}getPreferredWidthForColumnGroup(i){const e=this.getHeaderCellForColumn(i);return e?this.addElementsToContainerAndGetWidth([e]):-1}addElementsToContainerAndGetWidth(i){const e=document.createElement("form");e.style.position="fixed";const t=this.centerRowContainerCtrl.getContainerElement();i.forEach(o=>this.cloneItemIntoDummy(o,e)),t.appendChild(e);const s=e.offsetWidth;t.removeChild(e);const r=this.getAutoSizePadding();return s+r}getAutoSizePadding(){return this.gos.get("autoSizePadding")}getHeaderCellForColumn(i){let e=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach(t=>{const s=t.getHtmlElementForColumnHeader(i);s!=null&&(e=s)}),e}cloneItemIntoDummy(i,e){const t=i.cloneNode(!0);t.style.width="",t.style.position="static",t.style.left="";const s=document.createElement("div"),r=s.classList;["ag-header-cell","ag-header-group-cell"].some(a=>t.classList.contains(a))?(r.add("ag-header","ag-header-row"),s.style.position="static"):r.add("ag-row");let n=i.parentElement;for(;n;){if(["ag-header-row","ag-row"].some(l=>n.classList.contains(l))){for(let l=0;l<n.classList.length;l++){const u=n.classList[l];u!="ag-row-position-absolute"&&r.add(u)}break}n=n.parentElement}s.appendChild(t),e.appendChild(s)}};g([R("rowRenderer")],po.prototype,"rowRenderer",2);g([R("ctrlsService")],po.prototype,"ctrlsService",2);g([R("rowCssClassCalculator")],po.prototype,"rowCssClassCalculator",2);g([J],po.prototype,"postConstruct",1);po=g([le("autoWidthCalculator")],po);var Nl=class extends Z{constructor(i,e){super(),this.createRowCon=i,this.destroyRowCtrls=e,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.topContainerHeight=0,this.bottomContainerHeight=0}postConstruct(){this.isClientSide=this.rowModel.getType()==="clientSide",this.ctrlsService.whenReady(i=>{this.gridBodyCtrl=i.gridBodyCtrl})}getStickyTopRowCtrls(){return this.stickyTopRowCtrls}getStickyBottomRowCtrls(){return this.stickyBottomRowCtrls}getLastPixelOfGroup(i){return this.isClientSide?this.getClientSideLastPixelOfGroup(i):this.getServerSideLastPixelOfGroup(i)}getFirstPixelOfGroup(i){return i.footer?i.sibling.rowTop+i.sibling.rowHeight-1:i.hasChildren()?i.rowTop-1:0}getServerSideLastPixelOfGroup(i){var e,t,s,r;if(this.isClientSide)throw new Error("This func should only be called in server side row model.");if(i.isExpandable()||i.footer){if(i.master)return i.detailNode.rowTop+i.detailNode.rowHeight;if(!i.sibling||Math.abs(i.sibling.rowIndex-i.rowIndex)===1){let n=(e=i.childStore)==null?void 0:e.getStoreBounds();return i.footer&&(n=(t=i.sibling.childStore)==null?void 0:t.getStoreBounds()),((s=n?.heightPx)!=null?s:0)+((r=n?.topPx)!=null?r:0)}return i.footer?i.rowTop+i.rowHeight:i.sibling.rowTop+i.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}getClientSideLastPixelOfGroup(i){if(!this.isClientSide)throw new Error("This func should only be called in client side row model.");if(i.isExpandable()||i.footer){const e=i.footer&&i.rowIndex===0,t=!i.sibling||Math.abs(i.sibling.rowIndex-i.rowIndex)===1;if(e||t){let s=i.footer?i.sibling:i;for(;s.isExpandable()&&s.expanded;)if(s.master)s=s.detailNode;else if(s.childrenAfterSort){if(s.childrenAfterSort.length===0)break;s=We(s.childrenAfterSort)}return s.rowTop+s.rowHeight}return i.footer?i.rowTop+i.rowHeight:i.sibling.rowTop+i.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}updateStickyRows(i){const e=i==="top";let t=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(i,new Set,t);const s=e?this.rowRenderer.getFirstVisibleVerticalPixel():this.rowRenderer.getLastVisibleVerticalPixel(),r=new Set,o=u=>{if(r.add(u),e){const h=this.getLastPixelOfGroup(u),d=s+t+u.rowHeight;h<d?u.stickyRowTop=t+(h-d):u.stickyRowTop=t}else{const h=this.getFirstPixelOfGroup(u),d=s-(t+u.rowHeight);h>d?u.stickyRowTop=t-(h-d):u.stickyRowTop=t}t=0,r.forEach(h=>{const d=h.stickyRowTop+h.rowHeight;t<d&&(t=d)})},n=this.areFooterRowsStickySuppressed(),a=this.gos.get("suppressGroupRowsSticky"),l=u=>u.displayed?u.footer?n===!0||n==="grand"&&u.level===-1||n==="group"&&u.level>-1?!1:!r.has(u):u.isExpandable()?a===!0?!1:!r.has(u)&&u.expanded:!1:!1;for(let u=0;u<100;u++){let h=s+t;e||(h=s-t);const d=this.rowModel.getRowIndexAtPixel(h),c=this.rowModel.getRow(d);if(c==null)break;const y=this.getStickyAncestors(c).find(w=>(e?w.rowIndex<d:w.rowIndex>d)&&l(w));if(y){o(y);continue}if((e?c.rowTop<h:c.rowTop+c.rowHeight>h)&&l(c)){o(c);continue}break}return e||r.forEach(u=>{u.stickyRowTop=t-(u.stickyRowTop+u.rowHeight)}),this.refreshNodesAndContainerHeight(i,r,t)}areFooterRowsStickySuppressed(){const i=this.gos.get("suppressStickyTotalRow");if(i===!0)return!0;const e=!!this.gos.get("groupIncludeFooter")||i==="group",t=!!this.gos.get("groupIncludeTotalFooter")||i==="grand";return e&&t?!0:t?"grand":e?"group":!1}canRowsBeSticky(){const i=this.gos.isGroupRowsSticky(),e=this.areFooterRowsStickySuppressed(),t=this.gos.get("suppressGroupRowsSticky");return i&&(!e||!t)}getStickyAncestors(i){const e=[];let t=i.footer?i.sibling:i.parent;for(;t;)t.sibling&&e.push(t.sibling),e.push(t),t=t.parent;return e.reverse()}checkStickyRows(){const i=this.updateStickyRows("top"),e=this.updateStickyRows("bottom");return i||e}destroyStickyCtrls(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(i){const e=new Set;if(this.stickyTopRowCtrls.some(t=>t.getRowNode()===i)){for(let t=0;t<this.stickyTopRowCtrls.length;t++){const s=this.stickyTopRowCtrls[t].getRowNode();s!==i&&e.add(s)}this.refreshNodesAndContainerHeight("top",e,this.topContainerHeight)&&this.checkStickyRows();return}for(let t=0;t<this.stickyBottomRowCtrls.length;t++){const s=this.stickyBottomRowCtrls[t].getRowNode();s!==i&&e.add(s)}this.refreshNodesAndContainerHeight("bottom",e,this.bottomContainerHeight)&&this.checkStickyRows()}refreshNodesAndContainerHeight(i,e,t){const s=i==="top",r=s?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,o={},n=[];for(let d=0;d<r.length;d++){const c=r[d].getRowNode();if(!e.has(c)){o[c.id]=r[d],c.sticky=!1;continue}n.push(r[d])}const a=new Set;for(let d=0;d<n.length;d++)a.add(n[d].getRowNode());const l=[];e.forEach(d=>{a.has(d)||(d.sticky=!0,l.push(this.createRowCon(d,!1,!1)))});let u=!!l.length||n.length!==r.length;s?this.topContainerHeight!==t&&(this.topContainerHeight=t,this.gridBodyCtrl.setStickyTopHeight(t),u=!0):this.bottomContainerHeight!==t&&(this.bottomContainerHeight=t,this.gridBodyCtrl.setStickyBottomHeight(t),u=!0),this.destroyRowCtrls(o,!1);const h=[...n,...l];return h.sort((d,c)=>c.getRowNode().rowIndex-d.getRowNode().rowIndex),s||h.reverse(),h.forEach(d=>d.setRowTop(d.getRowNode().stickyRowTop)),u?(s?this.stickyTopRowCtrls=h:this.stickyBottomRowCtrls=h,!0):!1}};g([R("rowModel")],Nl.prototype,"rowModel",2);g([R("rowRenderer")],Nl.prototype,"rowRenderer",2);g([R("ctrlsService")],Nl.prototype,"ctrlsService",2);g([J],Nl.prototype,"postConstruct",1);var Vi=class extends Z{constructor(){super(...arguments),this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const i=()=>{this.getAllCellCtrls().forEach(o=>o.onRangeSelectionChanged())},e=()=>{this.getAllCellCtrls().forEach(o=>o.updateRangeBordersIfRangeCount())},t=()=>{this.eventService.addEventListener(b.EVENT_RANGE_SELECTION_CHANGED,i),this.eventService.addEventListener(b.EVENT_COLUMN_MOVED,e),this.eventService.addEventListener(b.EVENT_COLUMN_PINNED,e),this.eventService.addEventListener(b.EVENT_COLUMN_VISIBLE,e)},s=()=>{this.eventService.removeEventListener(b.EVENT_RANGE_SELECTION_CHANGED,i),this.eventService.removeEventListener(b.EVENT_COLUMN_MOVED,e),this.eventService.removeEventListener(b.EVENT_COLUMN_PINNED,e),this.eventService.removeEventListener(b.EVENT_COLUMN_VISIBLE,e)};this.addDestroyFunc(()=>s()),this.addManagedPropertyListener("enableRangeSelection",o=>{o.currentValue?t():s()}),this.gos.get("enableRangeSelection")&&t()}}postConstruct(){this.ctrlsService.whenReady(i=>{this.gridBodyCtrl=i.gridBodyCtrl,this.initialise()})}initialise(){if(this.addManagedListener(this.eventService,b.EVENT_PAGINATION_CHANGED,this.onPageLoaded.bind(this)),this.addManagedListener(this.eventService,b.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_BODY_SCROLL,this.onBodyScroll.bind(this)),this.addManagedListener(this.eventService,b.EVENT_BODY_HEIGHT_CHANGED,this.redraw.bind(this)),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListeners(["suppressCellFocus","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],()=>this.redrawRows()),this.gos.isGroupRowsSticky()){const i=this.rowModel.getType();(i==="clientSide"||i==="serverSide")&&(this.stickyRowFeature=this.createManagedBean(new Nl(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this))))}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=this.gos.isDomLayout("print"),this.embedFullWidthRows=this.printLayout||this.gos.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const i=this.getKeepDetailRowsCount(),e=i??3;this.cachedRowCtrls=new c_(e)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const i=Cr(this.rowCtrlsByRowIndex),e=Cr(this.zombieRowCtrls),t=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];e.length>0||t.length>0?this.allRowCtrls=[...i,...e,...t]:this.allRowCtrls=i}onCellFocusChanged(i){this.getAllCellCtrls().forEach(e=>e.onCellFocused(i)),this.getFullWidthRowCtrls().forEach(e=>e.onFullWidthRowFocused(i))}registerCellEventListeners(){this.addManagedListener(this.eventService,b.EVENT_CELL_FOCUSED,i=>{this.onCellFocusChanged(i)}),this.addManagedListener(this.eventService,b.EVENT_CELL_FOCUS_CLEARED,()=>{this.onCellFocusChanged()}),this.addManagedListener(this.eventService,b.EVENT_FLASH_CELLS,i=>{this.getAllCellCtrls().forEach(e=>e.onFlashCells(i))}),this.addManagedListener(this.eventService,b.EVENT_COLUMN_HOVER_CHANGED,()=>{this.getAllCellCtrls().forEach(i=>i.onColumnHover())}),this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>{this.getAllCellCtrls().forEach(i=>i.onDisplayedColumnsChanged())}),this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>{this.printLayout&&this.getAllCellCtrls().forEach(i=>i.onLeftChanged())}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedListener(this.eventService,b.EVENT_GRID_COLUMNS_CHANGED,this.refreshListenersToColumnsForCellComps.bind(this)),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach(i=>i()),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners(),this.columnModel.getAllGridColumns().forEach(e=>{const t=l=>{this.getAllCellCtrls().forEach(u=>{u.getColumn()===e&&l(u)})},s=()=>{t(l=>l.onLeftChanged())},r=()=>{t(l=>l.onWidthChanged())},o=()=>{t(l=>l.onFirstRightPinnedChanged())},n=()=>{t(l=>l.onLastLeftPinnedChanged())},a=()=>{t(l=>l.onColDefChanged())};e.addEventListener("leftChanged",s),e.addEventListener("widthChanged",r),e.addEventListener("firstRightPinnedChanged",o),e.addEventListener("lastLeftPinnedChanged",n),e.addEventListener("colDefChanged",a),this.destroyFuncsForColumnListeners.push(()=>{e.removeEventListener("leftChanged",s),e.removeEventListener("widthChanged",r),e.removeEventListener("firstRightPinnedChanged",o),e.removeEventListener("lastLeftPinnedChanged",n),e.removeEventListener("colDefChanged",a)})})}onDomLayoutChanged(){const i=this.gos.isDomLayout("print"),e=i||this.gos.get("embedFullWidthRows"),t=e!==this.embedFullWidthRows||this.printLayout!==i;this.printLayout=i,this.embedFullWidthRows=e,t&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const i=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(i)}onPageLoaded(i){const e={recycleRows:i.keepRenderedRows,animate:i.animate,newData:i.newData,newPage:i.newPage,onlyBody:!0};this.redrawAfterModelUpdate(e)}getAllCellsForColumn(i){const e=[];return this.getAllRowCtrls().forEach(t=>{const s=t.getCellElement(i);s&&e.push(s)}),e}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(i,e){i.forEach(t=>{t.destroyFirstPass(),t.destroySecondPass()}),i.length=0,e&&e.forEach(t=>{const s=new no(t,this.beans,!1,!1,this.printLayout);i.push(s)})}onPinnedRowDataChanged(){const i={recycleRows:!0};this.redrawAfterModelUpdate(i)}redrawRow(i,e=!1){var t;if(i.sticky)this.stickyRowFeature.refreshStickyNode(i);else if((t=this.cachedRowCtrls)!=null&&t.has(i)){this.cachedRowCtrls.removeRow(i);return}else{const s=r=>{const o=r[i.rowIndex];o&&o.getRowNode()===i&&(o.destroyFirstPass(),o.destroySecondPass(),r[i.rowIndex]=this.createRowCon(i,!1,!1))};switch(i.rowPinned){case"top":s(this.topRowCtrls);break;case"bottom":s(this.bottomRowCtrls);break;default:s(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}e||this.dispatchDisplayedRowsChanged(!1)}redrawRows(i){if(i!=null){i?.forEach(t=>this.redrawRow(t,!0)),this.dispatchDisplayedRowsChanged(!1);return}this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(i){const e=i?.suppressKeepFocus?null:this.focusService.getFocusCellToUseAfterRefresh();if(e==null)return null;const t=this.gos.getActiveDomElement(),s=this.gos.getDomData(t,oo.DOM_DATA_KEY_CELL_CTRL),r=this.gos.getDomData(t,no.DOM_DATA_KEY_ROW_CTRL);return s||r?e:null}redrawAfterModelUpdate(i={}){this.getLockOnRefresh();const e=this.getCellToRestoreFocusToAfterRefresh(i);this.updateContainerHeights(),this.scrollToTopIfNewData(i);const t=!i.domLayoutChanged&&!!i.recycleRows,s=i.animate&&this.gos.isAnimateRows(),r=t?this.getRowsToRecycle():null;t||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature&&this.stickyRowFeature.checkStickyRows(),this.recycleRows(r,s),this.gridBodyCtrl.updateRowCount(),i.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),e!=null&&this.restoreFocusedCell(e),this.releaseLockOnRefresh()}scrollToTopIfNewData(i){const e=i.newData||i.newPage,t=this.gos.get("suppressScrollOnNewData");e&&!t&&this.gridBodyCtrl.getScrollFeature().scrollToTop()}updateContainerHeights(){if(this.printLayout){this.rowContainerHeightService.setModelHeight(null);return}let i=this.paginationProxy.getCurrentPageHeight();i===0&&(i=1),this.rowContainerHeightService.setModelHeight(i)}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(); }, 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(i){i&&(this.focusService.setRestoreFocusedCell(i),this.onCellFocusChanged(this.beans.gos.addGridCommonParams({rowIndex:i.rowIndex,column:i.column,rowPinned:i.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"mock"})))}stopEditing(i=!1){this.getAllRowCtrls().forEach(e=>{e.stopEditing(i)})}getAllCellCtrls(){const i=[],e=this.getAllRowCtrls(),t=e.length;for(let s=0;s<t;s++){const r=e[s].getAllCellCtrls(),o=r.length;for(let n=0;n<o;n++)i.push(r[n])}return i}getAllRowCtrls(){const i=this.stickyRowFeature&&this.stickyRowFeature.getStickyTopRowCtrls()||[],e=this.stickyRowFeature&&this.stickyRowFeature.getStickyBottomRowCtrls()||[],t=[...this.topRowCtrls,...this.bottomRowCtrls,...i,...e];for(const s in this.rowCtrlsByRowIndex)t.push(this.rowCtrlsByRowIndex[s]);return t}addRenderedRowListener(i,e,t){const s=this.rowCtrlsByRowIndex[e];s&&s.addEventListener(i,t)}flashCells(i={}){this.getCellCtrls(i.rowNodes,i.columns).forEach(e=>e.flashCell(i))}refreshCells(i={}){const e={forceRefresh:i.force,newData:!1,suppressFlash:i.suppressFlash};this.getCellCtrls(i.rowNodes,i.columns).forEach(t=>t.refreshOrDestroyCell(e)),i.rowNodes&&(this.getRowCtrls(i.rowNodes).forEach(t=>{if(!t.isFullWidth())return;t.refreshFullWidth()||this.redrawRow(t.getRowNode(),!0)}),this.dispatchDisplayedRowsChanged(!1))}getCellRendererInstances(i){var e;const t=this.getCellCtrls(i.rowNodes,i.columns).map(o=>o.getCellRenderer()).filter(o=>o!=null);if((e=i.columns)!=null&&e.length)return t;const s=[],r=this.mapRowNodes(i.rowNodes);return this.getAllRowCtrls().forEach(o=>{if(r&&!this.isRowInMap(o.getRowNode(),r)||!o.isFullWidth())return;const n=o.getFullWidthCellRenderers();for(let a=0;a<n.length;a++){const l=n[a];l!=null&&s.push(l)}}),[...s,...t]}getCellEditorInstances(i){const e=[];return this.getCellCtrls(i.rowNodes,i.columns).forEach(t=>{const s=t.getCellEditor();s&&e.push(s)}),e}getEditingCells(){const i=[];return this.getAllCellCtrls().forEach(e=>{if(e.isEditing()){const t=e.getCellPosition();i.push(t)}}),i}mapRowNodes(i){if(!i)return;const e={top:{},bottom:{},normal:{}};return i.forEach(t=>{const s=t.id;switch(t.rowPinned){case"top":e.top[s]=t;break;case"bottom":e.bottom[s]=t;break;default:e.normal[s]=t;break}}),e}isRowInMap(i,e){const t=i.id;switch(i.rowPinned){case"top":return e.top[t]!=null;case"bottom":return e.bottom[t]!=null;default:return e.normal[t]!=null}}getRowCtrls(i){const e=this.mapRowNodes(i),t=this.getAllRowCtrls();return!i||!e?t:t.filter(s=>{const r=s.getRowNode();return this.isRowInMap(r,e)})}getCellCtrls(i,e){let t;K(e)&&(t={},e.forEach(r=>{const o=this.columnModel.getGridColumn(r);K(o)&&(t[o.getId()]=!0)}));const s=[];return this.getRowCtrls(i).forEach(r=>{r.getAllCellCtrls().forEach(o=>{const n=o.getColumn().getId();t&&!t[n]||s.push(o)})}),s}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const i=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(i),this.stickyRowFeature&&this.stickyRowFeature.destroyStickyCtrls()}getRowsToRecycle(){const i=[];si(this.rowCtrlsByRowIndex,(t,s)=>{s.getRowNode().id==null&&i.push(t)}),this.removeRowCtrls(i);const e={};return si(this.rowCtrlsByRowIndex,(t,s)=>{const r=s.getRowNode();e[r.id]=s}),this.rowCtrlsByRowIndex={},e}removeRowCtrls(i,e=!1){i.forEach(t=>{const s=this.rowCtrlsByRowIndex[t];s&&(s.destroyFirstPass(e),s.destroySecondPass()),delete this.rowCtrlsByRowIndex[t]})}onBodyScroll(i){i.direction==="vertical"&&this.redraw({afterScroll:!0})}redraw(i={}){const{afterScroll:e}=i;let t;this.stickyRowFeature&&xp()&&(t=this.getCellToRestoreFocusToAfterRefresh()||void 0);const s=this.firstRenderedRow,r=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let o=!1;this.stickyRowFeature&&(o=this.stickyRowFeature.checkStickyRows());const n=this.firstRenderedRow!==s||this.lastRenderedRow!==r;if(!(e&&!o&&!n)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,e),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(e&&!o),t!=null)){const a=this.getCellToRestoreFocusToAfterRefresh();t!=null&&a==null&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(t))}}removeRowCompsNotToDraw(i,e){const t={};i.forEach(o=>t[o]=!0);const r=Object.keys(this.rowCtrlsByRowIndex).filter(o=>!t[o]);this.removeRowCtrls(r,e)}calculateIndexesToDraw(i){let e=ov(this.firstRenderedRow,this.lastRenderedRow);const t=(r,o)=>{const n=o.getRowNode().rowIndex;n!=null&&(n<this.firstRenderedRow||n>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(o)&&e.push(n)};si(this.rowCtrlsByRowIndex,t),si(i,t),e.sort((r,o)=>r-o);const s=[];for(let r=0;r<e.length;r++){const o=e[r],n=this.paginationProxy.getRow(o);n&&!n.sticky&&s.push(o)}return s}recycleRows(i,e=!1,t=!1){const s=this.calculateIndexesToDraw(i);(this.printLayout||t)&&(e=!1),this.removeRowCompsNotToDraw(s,!e),s.forEach(r=>{this.createOrUpdateRowCtrl(r,i,e,t)}),i&&(t&&!this.gos.get("suppressAnimationFrame")&&!this.printLayout?this.beans.animationFrameService.addDestroyTask(()=>{this.destroyRowCtrls(i,e),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}):this.destroyRowCtrls(i,e)),this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(i=!1){const e={type:b.EVENT_DISPLAYED_ROWS_CHANGED,afterScroll:i};this.eventService.dispatchEvent(e)}onDisplayedColumnsChanged(){const i=this.columnModel.isPinningLeft(),e=this.columnModel.isPinningRight();(this.pinningLeft!==i||e!==this.pinningRight)&&(this.pinningLeft=i,this.pinningRight=e,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const i=[];this.getFullWidthRowCtrls().forEach(e=>{const t=e.getRowNode().rowIndex;i.push(t.toString())}),this.refreshFloatingRowComps(),this.removeRowCtrls(i),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(i){const e=this.mapRowNodes(i);return this.getAllRowCtrls().filter(t=>{if(!t.isFullWidth())return!1;const s=t.getRowNode();return!(e!=null&&!this.isRowInMap(s,e))})}createOrUpdateRowCtrl(i,e,t,s){let r,o=this.rowCtrlsByRowIndex[i];if(o||(r=this.paginationProxy.getRow(i),K(r)&&K(e)&&e[r.id]&&r.alreadyRendered&&(o=e[r.id],e[r.id]=null)),!o)if(r||(r=this.paginationProxy.getRow(i)),K(r))o=this.createRowCon(r,t,s);else return;return r&&(r.alreadyRendered=!0),this.rowCtrlsByRowIndex[i]=o,o}destroyRowCtrls(i,e){const t=[];si(i,(s,r)=>{if(r){if(this.cachedRowCtrls&&r.isCacheable()){this.cachedRowCtrls.addRow(r);return}r.destroyFirstPass(!e),e?(this.zombieRowCtrls[r.getInstanceId()]=r,t.push(()=>{r.destroySecondPass(),delete this.zombieRowCtrls[r.getInstanceId()]})):r.destroySecondPass()}}),e&&(t.push(()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),cm(t))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){const i=this.getRowBuffer(),e=this.gos.getRowHeightAsNumber();return i*e}workOutFirstAndLastRowsToRender(){this.rowContainerHeightService.updateOffset();let i,e;if(!this.paginationProxy.isRowsToRender())i=0,e=-1;else if(this.printLayout)this.environment.refreshRowHeightVariable(),i=this.paginationProxy.getPageFirstRow(),e=this.paginationProxy.getPageLastRow();else{const a=this.getRowBufferInPixels(),l=this.ctrlsService.getGridBodyCtrl(),u=this.gos.get("suppressRowVirtualisation");let h=!1,d,c;do{const _=this.paginationProxy.getPixelOffset(),{pageFirstPixel:P,pageLastPixel:T}=this.paginationProxy.getCurrentPagePixelRange(),D=this.rowContainerHeightService.getDivStretchOffset(),M=l.getScrollFeature().getVScrollPosition(),O=M.top,N=M.bottom;u?(d=P+D,c=T+D):(d=Math.max(O+_-a,P)+D,c=Math.min(N+_+a,T)+D),this.firstVisibleVPixel=Math.max(O+_,P)+D,this.lastVisibleVPixel=Math.min(N+_,T)+D,h=this.ensureAllRowsInRangeHaveHeightsCalculated(d,c)}while(h);let p=this.paginationProxy.getRowIndexAtPixel(d),y=this.paginationProxy.getRowIndexAtPixel(c);const f=this.paginationProxy.getPageFirstRow(),w=this.paginationProxy.getPageLastRow();p<f&&(p=f),y>w&&(y=w),i=p,e=y}const t=this.gos.isDomLayout("normal"),s=this.gos.get("suppressMaxRenderedRowRestriction"),r=Math.max(this.getRowBuffer(),500);t&&!s&&e-i>r&&(e=i+r);const o=i!==this.firstRenderedRow,n=e!==this.lastRenderedRow;if(o||n){this.firstRenderedRow=i,this.lastRenderedRow=e;const a={type:b.EVENT_VIEWPORT_CHANGED,firstRow:i,lastRow:e};this.eventService.dispatchEvent(a)}}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const i={type:b.EVENT_FIRST_DATA_RENDERED,firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame(()=>{this.beans.eventService.dispatchEvent(i)})}ensureAllRowsInRangeHaveHeightsCalculated(i,e){const t=this.paginationProxy.ensureRowHeightsValid(i,e,-1,-1);return t&&this.updateContainerHeights(),t}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getLastVisibleVerticalPixel(){return this.lastVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(i){const s=i.getRowNode(),r=this.focusService.isRowNodeFocused(s),o=i.isEditing(),n=s.detail;return r||o||n?!!this.paginationProxy.isRowPresent(s):!1}createRowCon(i,e,t){const s=this.cachedRowCtrls?this.cachedRowCtrls.getRow(i):null;if(s)return s;const r=this.gos.get("suppressAnimationFrame"),o=t&&!r&&!this.printLayout;return new no(i,this.beans,e,o,this.printLayout)}getRenderedNodes(){const i=this.rowCtrlsByRowIndex;return Object.values(i).map(e=>e.getRowNode())}getRowByPosition(i){let e;const{rowIndex:t}=i;switch(i.rowPinned){case"top":e=this.topRowCtrls[t];break;case"bottom":e=this.bottomRowCtrls[t];break;default:e=this.rowCtrlsByRowIndex[t],e||(e=this.getStickyTopRowCtrls().find(s=>s.getRowNode().rowIndex===t)||null,e||(e=this.getStickyBottomRowCtrls().find(s=>s.getRowNode().rowIndex===t)||null));break}return e}isRangeInRenderedViewport(i,e){if(i==null||e==null)return!1;const s=i>this.lastRenderedRow;return!(e<this.firstRenderedRow)&&!s}};g([R("animationFrameService")],Vi.prototype,"animationFrameService",2);g([R("paginationProxy")],Vi.prototype,"paginationProxy",2);g([R("columnModel")],Vi.prototype,"columnModel",2);g([R("pinnedRowModel")],Vi.prototype,"pinnedRowModel",2);g([R("rowModel")],Vi.prototype,"rowModel",2);g([R("focusService")],Vi.prototype,"focusService",2);g([R("beans")],Vi.prototype,"beans",2);g([R("rowContainerHeightService")],Vi.prototype,"rowContainerHeightService",2);g([R("ctrlsService")],Vi.prototype,"ctrlsService",2);g([J],Vi.prototype,"postConstruct",1);Vi=g([le("rowRenderer")],Vi);var c_=class{constructor(i){this.entriesMap={},this.entriesList=[],this.maxCount=i}addRow(i){if(this.entriesMap[i.getRowNode().id]=i,this.entriesList.push(i),i.setCached(!0),this.entriesList.length>this.maxCount){const e=this.entriesList[0];e.destroyFirstPass(),e.destroySecondPass(),this.removeFromCache(e)}}getRow(i){if(i==null||i.id==null)return null;const e=this.entriesMap[i.id];return e?(this.removeFromCache(e),e.setCached(!1),e.getRowNode()!=i?null:e):null}has(i){return this.entriesMap[i.id]!=null}removeRow(i){const e=i.id,t=this.entriesMap[e];delete this.entriesMap[e],_i(this.entriesList,t)}removeFromCache(i){const e=i.getRowNode().id;delete this.entriesMap[e],_i(this.entriesList,i)}getEntries(){return this.entriesList}},$a=class extends Z{init(){this.setPinnedTopRowData(),this.setPinnedBottomRowData(),this.addManagedPropertyListener("pinnedTopRowData",()=>this.setPinnedTopRowData()),this.addManagedPropertyListener("pinnedBottomRowData",()=>this.setPinnedBottomRowData())}isEmpty(i){const e=i==="top"?this.pinnedTopRows:this.pinnedBottomRows;return zi(e)}isRowsToRender(i){return!this.isEmpty(i)}getRowAtPixel(i,e){const t=e==="top"?this.pinnedTopRows:this.pinnedBottomRows;if(zi(t))return 0;for(let s=0;s<t.length;s++){const r=t[s];if(r.rowTop+r.rowHeight-1>=i)return s}return t.length-1}setPinnedTopRowData(){const i=this.gos.get("pinnedTopRowData");this.pinnedTopRows=this.createNodesFromData(i,!0);const e={type:b.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(e)}setPinnedBottomRowData(){const i=this.gos.get("pinnedBottomRowData");this.pinnedBottomRows=this.createNodesFromData(i,!1);const e={type:b.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(e)}createNodesFromData(i,e){const t=[];if(i){let s=0;i.forEach((r,o)=>{const n=new Me(this.beans);n.data=r;const a=e?Me.ID_PREFIX_TOP_PINNED:Me.ID_PREFIX_BOTTOM_PINNED;n.id=a+o,n.rowPinned=e?"top":"bottom",n.setRowTop(s),n.setRowHeight(this.gos.getRowHeightForNode(n).height),n.setRowIndex(o),s+=n.rowHeight,t.push(n)})}return t}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(i){return this.pinnedTopRows[i]}getPinnedBottomRow(i){return this.pinnedBottomRows[i]}forEachPinnedTopRow(i){zi(this.pinnedTopRows)||this.pinnedTopRows.forEach(i)}forEachPinnedBottomRow(i){zi(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(i)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(i){if(!i||i.length===0)return 0;const e=We(i);return e.rowTop+e.rowHeight}};g([R("beans")],$a.prototype,"beans",2);g([J],$a.prototype,"init",1);$a=g([le("pinnedRowModel")],$a);var dd=class{constructor(i,e){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=i,this.pathRoot={rowNode:e,children:null},this.mapToItems[e.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(i,e){if(i.children)for(let t=0;t<i.children.length;t++)this.depthFirstSearchChangedPath(i.children[t],e);e(i.rowNode)}depthFirstSearchEverything(i,e,t){if(i.childrenAfterGroup)for(let s=0;s<i.childrenAfterGroup.length;s++){const r=i.childrenAfterGroup[s];r.childrenAfterGroup?this.depthFirstSearchEverything(i.childrenAfterGroup[s],e,t):t&&e(r)}e(i)}forEachChangedNodeDepthFirst(i,e=!1,t=!1){this.active&&!t?this.depthFirstSearchChangedPath(this.pathRoot,i):this.depthFirstSearchEverything(this.pathRoot.rowNode,i,e)}executeFromRootNode(i){i(this.pathRoot.rowNode)}createPathItems(i){let e=i,t=0;for(;!this.mapToItems[e.id];){const s={rowNode:e,children:null};this.mapToItems[e.id]=s,t++,e=e.parent}return t}populateColumnsMap(i,e){if(!this.keepingColumns||!e)return;let t=i;for(;t;)this.nodeIdsToColumns[t.id]||(this.nodeIdsToColumns[t.id]={}),e.forEach(s=>this.nodeIdsToColumns[t.id][s.getId()]=!0),t=t.parent}linkPathItems(i,e){let t=i;for(let s=0;s<e;s++){const r=this.mapToItems[t.id],o=this.mapToItems[t.parent.id];o.children||(o.children=[]),o.children.push(r),t=t.parent}}addParentNode(i,e){if(!i||i.isRowPinned())return;const t=this.createPathItems(i);this.linkPathItems(i,t),this.populateColumnsMap(i,e)}canSkip(i){return this.active&&!this.mapToItems[i.id]}getValueColumnsForNode(i,e){if(!this.keepingColumns)return e;const t=this.nodeIdsToColumns[i.id];return e.filter(r=>t[r.getId()])}getNotValueColumnsForNode(i,e){if(!this.keepingColumns)return null;const t=this.nodeIdsToColumns[i.id];return e.filter(r=>!t[r.getId()])}},jn=class Kr extends Z{constructor(e){super(),this.state=Kr.STATE_WAITING_TO_LOAD,this.version=0,this.id=e}getId(){return this.id}load(){this.state=Kr.STATE_LOADING,this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state=Kr.STATE_WAITING_TO_LOAD}getState(){return this.state}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state=Kr.STATE_FAILED,this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,s){this.successCommon(e,{rowData:t,rowCount:s})}isRequestMostRecentAndLive(e){const t=e===this.version,s=this.isAlive();return t&&s}successCommon(e,t){this.dispatchLoadCompleted(),this.isRequestMostRecentAndLive(e)&&(this.state=Kr.STATE_LOADED,this.processServerResult(t))}dispatchLoadCompleted(e=!0){const t={type:Kr.EVENT_LOAD_COMPLETE,success:e,block:this};this.dispatchEvent(t)}};jn.EVENT_LOAD_COMPLETE="loadComplete";jn.STATE_WAITING_TO_LOAD="needsLoading";jn.STATE_LOADING="loading";jn.STATE_LOADED="loaded";jn.STATE_FAILED="failed";var Yc=jn,Ns=class extends Z{constructor(){super(...arguments),this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const i=this.gos.get("blockLoadDebounceMillis");i&&i>0&&(this.checkBlockToLoadDebounce=ye.debounce(this.performCheckBlocksToLoad.bind(this),i))}setBeans(i){this.logger=i.create("RowNodeBlockLoader")}getMaxConcurrentDatasourceRequests(){const i=this.gos.get("maxConcurrentDatasourceRequests");if(i==null)return 2;if(!(i<=0))return i}addBlock(i){this.blocks.push(i),i.addEventListener(Yc.EVENT_LOAD_COMPLETE,this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(i){ye.removeFromArray(this.blocks,i)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchEvent({type:Ns.BLOCK_LOADED_EVENT}),this.activeBlockLoadsCount==0&&this.dispatchEvent({type:Ns.BLOCK_LOADER_FINISHED_EVENT})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){this.logger.log("checkBlockToLoad: max loads exceeded");return}const i=this.getAvailableLoadingCount(),e=this.blocks.filter(t=>t.getState()===Yc.STATE_WAITING_TO_LOAD).slice(0,i);this.registerLoads(e.length),e.forEach(t=>t.load()),this.printCacheStatus()}getBlockState(){if(this.gos.isRowModelType("serverSide"))return this.rowModel.getBlockStates();const i={};return this.blocks.forEach(e=>{const{id:t,state:s}=e.getBlockStateJson();i[t]=s}),i}printCacheStatus(){this.logger.isLogging()&&this.logger.log(`printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(i){this.activeBlockLoadsCount+=i}getAvailableLoadingCount(){return this.maxConcurrentRequests!==void 0?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}};Ns.BLOCK_LOADED_EVENT="blockLoaded";Ns.BLOCK_LOADER_FINISHED_EVENT="blockLoaderFinished";g([R("rowModel")],Ns.prototype,"rowModel",2);g([J],Ns.prototype,"postConstruct",1);g([gs(0,Ki("loggerFactory"))],Ns.prototype,"setBeans",1);Ns=g([le("rowNodeBlockLoader")],Ns);var Ka=class extends Z{constructor(){super(...arguments),this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.pixelOffset=0,this.masterRowCount=0}postConstruct(){this.active=this.gos.get("pagination"),this.pageSizeFromGridOptions=this.gos.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedListener(this.eventService,b.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this)),this.onModelUpdated()}ensureRowHeightsValid(i,e,t,s){const r=this.rowModel.ensureRowHeightsValid(i,e,this.getPageFirstRow(),this.getPageLastRow());return r&&this.calculatePages(),r}isPaginateChildRows(){return this.gos.get("groupRemoveSingleChildren")||this.gos.get("groupRemoveLowestSingleChildren")?!0:this.gos.get("paginateChildRows")}onModelUpdated(i){this.calculatePages();const e={type:b.EVENT_PAGINATION_CHANGED,animate:i?i.animate:!1,newData:i?i.newData:!1,newPage:i?i.newPage:!1,newPageSize:i?i.newPageSize:!1,keepRenderedRows:i?i.keepRenderedRows:!1};this.eventService.dispatchEvent(e)}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages();const i={type:b.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!1,keepRenderedRows:!0};this.eventService.dispatchEvent(i)}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(i){if(!this.active||this.currentPage===i||typeof this.currentPage!="number")return;this.currentPage=i,this.calculatePages();const e={type:b.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!0,newPageSize:!1,keepRenderedRows:!1};this.eventService.dispatchEvent(e)}getPixelOffset(){return this.pixelOffset}getRow(i){return this.rowModel.getRow(i)}getRowNode(i){return this.rowModel.getRowNode(i)}getRowIndexAtPixel(i){return this.rowModel.getRowIndexAtPixel(i)}getCurrentPageHeight(){return be(this.topRowBounds)||be(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){const i=this.topRowBounds?this.topRowBounds.rowTop:0,e=this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0;return{pageFirstPixel:i,pageLastPixel:e}}isRowPresent(i){return this.rowModel.isRowPresent(i)?i.rowIndex>=this.topDisplayedRowIndex&&i.rowIndex<=this.bottomDisplayedRowIndex:!1}isEmpty(){return this.rowModel.isEmpty()}isRowsToRender(){return this.rowModel.isRowsToRender()}forEachNode(i){return this.rowModel.forEachNode(i)}forEachNodeOnPage(i){const e=this.getPageFirstRow(),t=this.getPageLastRow();for(let s=e;s<=t;s++){const r=this.getRow(s);r&&i(r)}}getType(){return this.rowModel.getType()}getRowBounds(i){const e=this.rowModel.getRowBounds(i);return e.rowIndex=i,e}getPageFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getPageLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getRowCount(){return this.rowModel.getRowCount()}getPageForIndex(i){return Math.floor(i/this.pageSize)}goToPageWithIndex(i){if(!this.active)return;const e=this.getPageForIndex(i);this.goToPage(e)}isRowInPage(i){return this.active?this.getPageForIndex(i.rowIndex)===this.currentPage:!0}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 i=this.rowModel.getRowCount(),e=Math.floor(i/this.pageSize);this.goToPage(e)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(i){this.currentPage=i}get pageSize(){return K(this.pageSizeAutoCalculated)?this.pageSizeAutoCalculated:K(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:K(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:K(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const i=this.pageSizeAutoCalculated;if(this.pageSizeAutoCalculated=void 0,this.pageSize===i)return;this.calculatePages();const e={type:b.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!0,keepRenderedRows:!1};this.eventService.dispatchEvent(e)}setPageSize(i,e){const t=this.pageSize;switch(e){case"autoCalculated":this.pageSizeAutoCalculated=i;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=i,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=i;break;case"gridOptions":this.pageSizeFromGridOptions=i,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}if(t!==this.pageSize){this.calculatePages();const s={type:b.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!0,keepRenderedRows:!0};this.eventService.dispatchEvent(s)}}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.bottomDisplayedRowIndex),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=this.bottomDisplayedRowIndex),this.setPixelOffset(K(this.topRowBounds)?this.topRowBounds.rowTop:0)}setPixelOffset(i){this.pixelOffset!==i&&(this.pixelOffset=i,this.eventService.dispatchEvent({type:b.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){this.setZeroRows();return}const i=this.masterRowCount-1;this.totalPages=Math.floor(i/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const e=this.pageSize*this.currentPage;let t=this.pageSize*(this.currentPage+1)-1;if(t>i&&(t=i),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(e),t===i)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const s=this.rowModel.getTopLevelRowDisplayedIndex(t+1);this.bottomDisplayedRowIndex=s-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),this.masterRowCount===0){this.setZeroRows();return}const i=this.masterRowCount-1;this.totalPages=Math.floor(i/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>i&&(this.bottomDisplayedRowIndex=i)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}};g([R("rowModel")],Ka.prototype,"rowModel",2);g([J],Ka.prototype,"postConstruct",1);Ka=g([le("paginationProxy")],Ka);var nh=class extends Z{processAllCellClasses(i,e,t,s){this.processClassRules(void 0,i.cellClassRules,e,t,s),this.processStaticCellClasses(i,e,t)}processClassRules(i,e,t,s,r){if(e==null&&i==null)return;const o={},n={},a=(l,u)=>{l.split(" ").forEach(h=>{h.trim()!=""&&u(h)})};if(e){const l=Object.keys(e);for(let u=0;u<l.length;u++){const h=l[u],d=e[h];let c;typeof d=="string"?c=this.expressionService.evaluate(d,t):typeof d=="function"&&(c=d(t)),a(h,p=>{c?o[p]=!0:n[p]=!0})}}i&&r&&Object.keys(i).forEach(l=>a(l,u=>{o[u]||(n[u]=!0)})),r&&Object.keys(n).forEach(r),Object.keys(o).forEach(s)}getStaticCellClasses(i,e){const{cellClass:t}=i;if(!t)return[];let s;return typeof t=="function"?s=t(e):s=t,typeof s=="string"&&(s=[s]),s||[]}processStaticCellClasses(i,e,t){this.getStaticCellClasses(i,e).forEach(r=>{t(r)})}};g([R("expressionService")],nh.prototype,"expressionService",2);nh=g([le("stylingService")],nh);var TC=class extends qh{constructor(i){super(i,"ag-toggle-button")}setValue(i,e){return super.setValue(i,e),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}},p_=class extends ms{constructor(i){super(i,"ag-text-area",null,"textarea")}setValue(i,e){const t=super.setValue(i,e);return this.eInput.value=i,t}setCols(i){return this.eInput.cols=i,this}setRows(i){return this.eInput.rows=i,this}},g_=class extends Fo{constructor(i){super(i,"ag-date-field","date")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this));const i=Os();this.addManagedListener(this.eInput,"mousedown",()=>{this.isDisabled()||i||this.eInput.focus()}),this.eInput.step="any"}onWheel(i){this.gos.getActiveDomElement()===this.eInput&&i.preventDefault()}setMin(i){var e;const t=i instanceof Date?(e=Qi(i??null,!1))!=null?e:void 0:i;return this.min===t?this:(this.min=t,Ms(this.eInput,"min",t),this)}setMax(i){var e;const t=i instanceof Date?(e=Qi(i??null,!1))!=null?e:void 0:i;return this.max===t?this:(this.max=t,Ms(this.eInput,"max",t),this)}setStep(i){return this.step===i?this:(this.step=i,Ms(this.eInput,"step",i),this)}getDate(){var i;if(this.eInput.validity.valid)return(i=xi(this.getValue()))!=null?i:void 0}setDate(i,e){this.setValue(Qi(i??null,!1),e)}},f_=class extends ms{constructor(i){super(i,"ag-range-field","range")}postConstruct(){super.postConstruct();const{min:i,max:e,step:t}=this.config;i!=null&&this.setMinValue(i),e!=null&&this.setMaxValue(e),this.setStep(t||1)}addInputListeners(){this.addManagedListener(this.eInput,"input",i=>{const e=i.target.value;this.setValue(e)})}setMinValue(i){return this.min=i,this.eInput.setAttribute("min",i.toString()),this}setMaxValue(i){return this.max=i,this.eInput.setAttribute("max",i.toString()),this}setStep(i){return this.eInput.setAttribute("step",i.toString()),this}setValue(i,e){this.min!=null&&(i=Math.max(parseFloat(i),this.min).toString()),this.max!=null&&(i=Math.min(parseFloat(i),this.max).toString());const t=super.setValue(i,e);return this.eInput.value=i,t}},og=class extends Se{constructor(i,e){super('<div class="ag-rich-select-row" role="presentation"></div>'),this.params=i,this.wrapperEl=e}postConstruct(){this.addManagedListener(this.getGui(),"click",this.onClick.bind(this))}setState(i){let e="";this.params.valueFormatter&&(e=this.params.valueFormatter(i)),this.populateWithRenderer(i,e)||this.populateWithoutRenderer(i,e),this.value=i}highlightString(i){const{parsedValue:e}=this;if(this.params.cellRenderer||!K(e))return;let t=K(i);if(t){const s=e?.toLocaleLowerCase().indexOf(i.toLocaleLowerCase());if(s>=0){const r=s+i.length,o=Ft(e.slice(0,s),!0),n=Ft(e.slice(s,r),!0),a=Ft(e.slice(r));this.renderValueWithoutRenderer(`${o}<span class="ag-rich-select-row-text-highlight">${n}</span>${a}`)}else t=!1}t||this.renderValueWithoutRenderer(e)}updateHighlighted(i){var e;const t=this.getGui(),s=`ag-rich-select-row-${this.getCompId()}`;if((e=t.parentElement)==null||e.setAttribute("id",s),i){const r=this.getParentComponent().getAriaElement();Cp(r,s),this.wrapperEl.setAttribute("data-active-option",s)}fn(t.parentElement,i),this.addOrRemoveCssClass("ag-rich-select-row-selected",i)}populateWithoutRenderer(i,e){const t=this.gos.getDocument(),s=this.getGui(),r=t.createElement("span");r.style.overflow="hidden",r.style.textOverflow="ellipsis";const o=Ft(K(e)?e:i,!0);this.parsedValue=K(o)?o:null,s.appendChild(r),this.renderValueWithoutRenderer(o),this.setTooltip({newTooltipText:this.parsedValue,shouldDisplayTooltip:()=>r.scrollWidth>r.clientWidth})}renderValueWithoutRenderer(i){const e=this.getGui().querySelector("span");e&&(e.innerHTML=K(i)?i:" ")}populateWithRenderer(i,e){let t,s;return this.params.cellRenderer&&(s=this.userComponentFactory.getCellRendererDetails(this.params,{value:i,valueFormatted:e,setTooltip:(r,o)=>{this.setTooltip({newTooltipText:r,shouldDisplayTooltip:o})}})),s&&(t=s.newAgStackInstance()),t&&kp(t,this.getGui()),t?(t.then(r=>{this.addDestroyFunc(()=>{this.getContext().destroyBean(r)})}),!0):!1}onClick(){const i=this.getParentComponent(),e={type:b.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:!1,value:this.value};i?.dispatchEvent(e)}};g([R("userComponentFactory")],og.prototype,"userComponentFactory",2);g([J],og.prototype,"postConstruct",1);var kl=class AC extends Ol{constructor(e){super(AC.getTemplate(e?.cssIdentifier||"default")),this.renderedRows=new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0;const{cssIdentifier:t="default",ariaRole:s="listbox",listName:r}=e||{};this.cssIdentifier=t,this.ariaRole=s,this.listName=r}postConstruct(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e),focusInnerElement:e=>this.focusInnerElement(e),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)}),this.setAriaProperties(),this.addManagedListener(this.eventService,b.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanged.bind(this))}onGridStylesChanged(){this.rowHeight=this.getItemHeight(),this.refresh()}setAriaProperties(){const t=this.localeService.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),s=this.eContainer;yt(s,this.ariaRole),Gi(s,t)}addResizeObserver(){const e=()=>this.animationFrameService.requestAnimationFrame(()=>this.drawVirtualRows()),t=this.resizeObserverService.observeResize(this.getGui(),e);this.addDestroyFunc(t)}focusInnerElement(e){this.focusRow(e?this.model.getRowCount()-1:0)}onFocusIn(e){const t=e.target;t.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=Vm(t)-1)}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){switch(e.key){case k.UP:case k.DOWN:this.navigate(e.key===k.UP)&&e.preventDefault();break;case k.PAGE_HOME:case k.PAGE_END:case k.PAGE_UP:case k.PAGE_DOWN:this.navigateToPage(e.key)!==null&&e.preventDefault();break}}onTabKeyDown(e){this.navigate(e.shiftKey)?e.preventDefault():(ws(e),this.forceFocusOutOfContainer(e.shiftKey))}navigate(e){if(this.lastFocusedRowIndex==null)return!1;const t=this.lastFocusedRowIndex+(e?-1:1);return t<0||t>=this.model.getRowCount()?!1:(this.focusRow(t),!0)}navigateToPage(e,t="focused"){let s=!1;t==="focused"&&(t=this.getLastFocusedRow(),s=!0);const r=this.model.getRowCount()-1;let o=-1;return e===k.PAGE_HOME?o=0:e===k.PAGE_END?o=r:e===k.PAGE_DOWN?o=Math.min(t+this.pageSize,r):e===k.PAGE_UP&&(o=Math.max(t-this.pageSize,0)),o===-1?null:(s?this.focusRow(o):this.ensureIndexVisible(o),o)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.isScrolling||(this.isScrolling=!0,this.ensureIndexVisible(e),this.animationFrameService.requestAnimationFrame(()=>{if(this.isScrolling=!1,!this.isAlive())return;const t=this.renderedRows.get(e);t&&t.eDiv.focus()}))}getComponentAt(e){const t=this.renderedRows.get(e);return t&&t.rowComponent}forEachRenderedRow(e){this.renderedRows.forEach((t,s)=>e(t.rowComponent,s))}static getTemplate(e){return`<div class="ag-virtual-list-viewport ag-${e}-virtual-list-viewport" role="presentation">
<div class="ag-virtual-list-container ag-${e}-virtual-list-container" ref="eContainer"></div>
</div>`}getItemHeight(){return this.isHeightFromTheme?this.environment.getListItemHeight():this.rowHeight}ensureIndexVisible(e,t=!0){const s=this.model.getRowCount();if(typeof e!="number"||e<0||e>=s)return console.warn("AG Grid: invalid row index for ensureIndexVisible: "+e),!1;const r=e*this.rowHeight,o=r+this.rowHeight,n=this.getGui(),a=n.scrollTop,l=n.offsetHeight,u=a+l,h=t?0:this.rowHeight,d=a>r+h,c=u<o-h;if(d)return n.scrollTop=r,!0;if(c){const p=o-l;return n.scrollTop=p,!0}return!1}setComponentCreator(e){this.componentCreator=e}setComponentUpdater(e){this.componentUpdater=e}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(e){this.isHeightFromTheme=!1,this.rowHeight=e,this.refresh()}refresh(e){if(this.model==null||!this.isAlive())return;const t=this.model.getRowCount();this.eContainer.style.height=`${t*this.rowHeight}px`,dp(()=>this.eContainer.clientHeight>=t*this.rowHeight,()=>{this.isAlive()&&(this.canSoftRefresh(e)?this.drawVirtualRows(!0):(this.clearVirtualRows(),this.drawVirtualRows()))})}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&typeof this.model.areRowsEqual=="function"&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;const t=this.getGui(),s=t.scrollTop,r=s+t.offsetHeight,o=Math.floor(s/this.rowHeight),n=Math.floor(r/this.rowHeight);this.pageSize=Math.floor((r-s)/this.rowHeight),this.ensureRowsRendered(o,n,e)}ensureRowsRendered(e,t,s){this.renderedRows.forEach((r,o)=>{(o<e||o>t)&&o!==this.lastFocusedRowIndex&&this.removeRow(o)}),s&&this.refreshRows();for(let r=e;r<=t;r++)this.renderedRows.has(r)||r<this.model.getRowCount()&&this.insertRow(r)}insertRow(e){const t=this.model.getRow(e),s=document.createElement("div");s.classList.add("ag-virtual-list-item",`ag-${this.cssIdentifier}-virtual-list-item`),yt(s,this.ariaRole==="tree"?"treeitem":"option"),Hh(s,this.model.getRowCount()),Bh(s,e+1),s.setAttribute("tabindex","-1"),s.style.height=`${this.rowHeight}px`,s.style.top=`${this.rowHeight*e}px`;const r=this.componentCreator(t,s);r.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=e),s.appendChild(r.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement("afterend",s):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement("beforebegin",s):this.eContainer.appendChild(s),this.renderedRows.set(e,{rowComponent:r,eDiv:s,value:t})}removeRow(e){const t=this.renderedRows.get(e);this.eContainer.removeChild(t.eDiv),this.destroyBean(t.rowComponent),this.renderedRows.delete(e)}refreshRows(){const e=this.model.getRowCount();this.renderedRows.forEach((t,s)=>{var r,o;if(s>=e)this.removeRow(s);else{const n=this.model.getRow(s);(o=(r=this.model).areRowsEqual)!=null&&o.call(r,t.value,n)?this.componentUpdater(n,t.rowComponent):this.removeRow(s)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(e){this.model=e}getAriaElement(){return this.eContainer}destroy(){this.isAlive()&&(this.clearVirtualRows(),super.destroy())}};g([R("resizeObserverService")],kl.prototype,"resizeObserverService",2);g([R("animationFrameService")],kl.prototype,"animationFrameService",2);g([te("eContainer")],kl.prototype,"eContainer",2);g([J],kl.prototype,"postConstruct",1);var FC=kl,m_=`
<div class="ag-picker-field" role="presentation">
<div ref="eLabel"></div>
<div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed">
<div ref="eDisplayField" class="ag-picker-field-display"></div>
<ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>
<div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>
</div>
</div>`,cd=class extends Ao{constructor(i){var e,t;super(lt(de({pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"ag-list",className:"ag-rich-select",pickerIcon:"smallDown",ariaRole:"combobox",template:(e=i?.template)!=null?e:m_,modalPicker:!1},i),{maxPickerHeight:(t=i?.maxPickerHeight)!=null?t:"calc(var(--ag-row-height) * 6.5)"})),this.searchString="",this.highlightedItem=-1,this.lastRowHovered=-1,this.searchStringCreator=null;const{cellRowHeight:s,value:r,valueList:o,searchStringCreator:n}=i||{};s!=null&&(this.cellRowHeight=s),r!==void 0&&(this.value=r),o!=null&&(this.values=o),n&&(this.searchStringCreator=n)}postConstruct(){super.postConstruct(),this.createLoadingElement(),this.createListComponent();const{allowTyping:i,placeholder:e}=this.config;i?(this.eInput.setAutoComplete(!1).setInputPlaceholder(e),this.eDisplayField.classList.add("ag-hidden")):this.eInput.setDisplayed(!1),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{searchDebounceDelay:t=300}=this.config;this.clearSearchString=ci(this.clearSearchString,t),this.renderSelectedValue(),i&&(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 i=this.gos.getDocument(),e=this.localeService.getLocaleTextFunc(),t=i.createElement("div");t.classList.add("ag-loading-text"),t.innerText=e("loadingOoo","Loading..."),this.eLoading=t}createListComponent(){this.listComponent=this.createBean(new FC({cssIdentifier:"rich-select"})),this.listComponent.setComponentCreator(this.createRowComponent.bind(this));const i=(a,l)=>{};this.listComponent.setComponentUpdater(i),this.listComponent.setParentComponent(this),this.addManagedListener(this.listComponent,b.EVENT_FIELD_PICKER_VALUE_SELECTED,a=>{this.onListValueSelected(a.value,a.fromEnterKey)});const{cellRowHeight:e}=this;e&&this.listComponent.setRowHeight(e);const t=this.listComponent.getGui(),s=this.listComponent.getAriaElement();this.addManagedListener(t,"mousemove",this.onPickerMouseMove.bind(this)),this.addManagedListener(t,"mousedown",a=>a.preventDefault()),t.classList.add("ag-rich-select-list");const r=`ag-rich-select-list-${this.listComponent.getCompId()}`;s.setAttribute("id",r);const n=this.localeService.getLocaleTextFunc()(this.config.pickerAriaLabelKey,this.config.pickerAriaLabelValue);Gi(s,n),bp(this.eWrapper,s)}renderSelectedValue(){const{value:i,eDisplayField:e,config:t}=this,{allowTyping:s,initialInputValue:r}=this.config,o=this.config.valueFormatter?this.config.valueFormatter(i):i;if(s){this.eInput.setValue(r??o);return}let n;t.cellRenderer&&(n=this.userComponentFactory.getCellRendererDetails(this.config,{value:i,valueFormatted:o}));let a;if(n&&(a=n.newAgStackInstance()),a)Rt(e),kp(a,e),a.then(l=>{this.addDestroyFunc(()=>this.getContext().destroyBean(l))});else{if(K(this.value))e.innerText=o,e.classList.remove("ag-display-as-placeholder");else{const{placeholder:l}=t;K(l)?(e.innerHTML=`${Ft(l)}`,e.classList.add("ag-display-as-placeholder")):Rt(e)}this.setTooltip({newTooltipText:o??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth})}}getCurrentValueIndex(){const{currentList:i,value:e}=this;if(e==null||!i)return-1;for(let t=0;t<i.length;t++)if(i[t]===e)return t;return-1}highlightFilterMatch(){var i;(i=this.listComponent)==null||i.forEachRenderedRow((e,t)=>{e.highlightString(this.searchString)})}highlightSelectedValue(i){var e;i==null&&(i=this.getCurrentValueIndex()),this.highlightedItem=i,(e=this.listComponent)==null||e.forEachRenderedRow((t,s)=>{const r=i===-1?!1:this.highlightedItem===s;t.updateHighlighted(r)})}setRowHeight(i){i!==this.cellRowHeight&&(this.cellRowHeight=i),this.listComponent&&this.listComponent.setRowHeight(i)}createPickerComponent(){const{values:i}=this;return i&&this.setValueList({valueList:i}),this.listComponent}setSearchStringCreator(i){this.searchStringCreator=i}setValueList(i){const{valueList:e,refresh:t}=i;this.listComponent&&this.currentList!==e&&(this.currentList=e,this.listComponent.setModel({getRowCount:()=>e.length,getRow:s=>e[s],areRowsEqual:(s,r)=>s===r}),t&&(this.values?this.listComponent.refresh(!0):(this.values=e,this.isPickerDisplayed&&this.showCurrentValueInPicker())))}showPicker(){super.showPicker(),this.showCurrentValueInPicker(),this.displayOrHidePicker()}showCurrentValueInPicker(){var i,e;if(!this.listComponent)return;if(!this.currentList){this.isPickerDisplayed&&this.eLoading&&this.listComponent.appendChild(this.eLoading);return}(i=this.eLoading)!=null&&i.offsetParent&&((e=this.eLoading.parentElement)==null||e.removeChild(this.eLoading));const t=this.getCurrentValueIndex();t!==-1?(this.listComponent.refresh(),this.listComponent.ensureIndexVisible(t),this.listComponent.refresh(!0),this.highlightSelectedValue(t)):this.listComponent.refresh()}beforeHidePicker(){this.highlightedItem=-1,super.beforeHidePicker()}onWrapperFocus(){if(!this.eInput)return;const i=this.eInput.getFocusableElement();i.focus(),i.select()}onWrapperFocusOut(i){this.eWrapper.contains(i.relatedTarget)||this.hidePicker()}buildSearchStringFromKeyboardEvent(i){let{key:e}=i;if(e===k.BACKSPACE)this.searchString=this.searchString.slice(0,-1),e="";else if(!zh(i))return;i.preventDefault(),this.searchTextFromCharacter(e)}searchTextFromCharacter(i){this.searchString+=i,this.runSearch(),this.clearSearchString()}searchTextFromString(i){i==null&&(i=""),this.searchString=i,this.runSearch()}buildSearchStrings(i){const{valueFormatter:e=s=>s}=this.config;let t;return typeof i[0]=="number"||typeof i[0]=="string"?t=i.map(s=>e(s)):typeof i[0]=="object"&&this.searchStringCreator&&(t=this.searchStringCreator(i)),t}getSuggestionsAndFilteredValues(i,e){let t=[],s=[];if(!i.length)return{suggestions:t,filteredValues:s};const{searchType:r="fuzzy",filterList:o}=this.config;if(r==="fuzzy"){const n=Rl(this.searchString,e,!0);t=n.values;const a=n.indices;if(o&&a.length)for(let l=0;l<a.length;l++)s.push(this.values[a[l]])}else t=e.filter((n,a)=>{const l=n.toLocaleLowerCase(),u=this.searchString.toLocaleLowerCase(),h=r==="match"?l.startsWith(u):l.indexOf(u)!==-1;return o&&h&&s.push(this.values[a]),h});return{suggestions:t,filteredValues:s}}filterListModel(i){const{filterList:e}=this.config;e&&(this.setValueList({valueList:i,refresh:!0}),this.alignPickerToComponent())}runSearch(){var i,e;const{values:t}=this,s=this.buildSearchStrings(t);if(!s){this.highlightSelectedValue(-1);return}const{suggestions:r,filteredValues:o}=this.getSuggestionsAndFilteredValues(this.searchString,s),{filterList:n,highlightMatch:a,searchType:l="fuzzy"}=this.config,u=o.length,h=!!(n&&this.searchString!=="");if(this.filterListModel(h?o:t),r.length){const d=h?0:s.indexOf(r[0]);this.selectListItem(d)}else if(this.highlightSelectedValue(-1),!h||u)(i=this.listComponent)==null||i.ensureIndexVisible(0);else if(h){this.getAriaElement().removeAttribute("data-active-option");const d=(e=this.listComponent)==null?void 0:e.getAriaElement();d&&Cp(d,null)}a&&l!=="fuzzy"&&this.highlightFilterMatch(),this.displayOrHidePicker()}displayOrHidePicker(){var i;const e=(i=this.listComponent)==null?void 0:i.getGui(),t=this.currentList?this.currentList.length===0:!1;e?.classList.toggle("ag-hidden",t)}clearSearchString(){this.searchString=""}selectListItem(i,e){if(!this.isPickerDisplayed||!this.currentList||!this.listComponent||i<0||i>=this.currentList.length)return;this.listComponent.ensureIndexVisible(i,!e)&&!e&&this.listComponent.refresh(!0),this.highlightSelectedValue(i)}setValue(i,e,t){const s=this.currentList?this.currentList.indexOf(i):-1;return s===-1?this:(this.value=i,t||this.selectListItem(s),this.renderSelectedValue(),super.setValue(i,e))}createRowComponent(i){const e=new og(this.config,this.eWrapper);e.setParentComponent(this.listComponent),this.getContext().createBean(e),e.setState(i);const{highlightMatch:t,searchType:s="fuzzy"}=this.config;return t&&s!=="fuzzy"&&e.highlightString(this.searchString),e}getRowForMouseEvent(i){const{listComponent:e}=this;if(!e)return-1;const s=(e?.getGui()).getBoundingClientRect(),r=e.getScrollTop(),o=i.clientY-s.top+r;return Math.floor(o/e.getRowHeight())}onPickerMouseMove(i){if(!this.listComponent)return;const e=this.getRowForMouseEvent(i);e!==-1&&e!=this.lastRowHovered&&(this.lastRowHovered=e,this.selectListItem(e,!0))}onNavigationKeyDown(i,e){i.preventDefault();const t=e===k.DOWN;if(!this.isPickerDisplayed&&t){this.showPicker();return}const s=this.highlightedItem,o=s===-1?0:s+(t?1:-1);this.selectListItem(o)}onPageNavigation(i){var e;if(!this.isPickerDisplayed)return;const t=(e=this.listComponent)==null?void 0:e.navigateToPage(i,this.highlightedItem);t!=null&&this.animationFrameService.requestAnimationFrame(()=>{if(!this.isAlive())return null;this.highlightSelectedValue(t)})}onEnterKeyDown(i){this.isPickerDisplayed&&(i.preventDefault(),this.currentList&&this.onListValueSelected(this.currentList[this.highlightedItem],!0))}onTabKeyDown(){!this.isPickerDisplayed||!this.currentList||this.setValue(this.currentList[this.highlightedItem],!1,!0)}onListValueSelected(i,e){this.setValue(i,!1,!0),this.dispatchPickerEvent(i,e),this.hidePicker()}dispatchPickerEvent(i,e){const t={type:b.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:e,value:i};this.dispatchEvent(t)}getFocusableElement(){const{allowTyping:i}=this.config;return i?this.eInput.getFocusableElement():super.getFocusableElement()}onKeyDown(i){const e=i.key,{allowTyping:t}=this.config;switch(e){case k.LEFT:case k.RIGHT:t||i.preventDefault();break;case k.PAGE_HOME:case k.PAGE_END:if(t){i.preventDefault();const s=this.eInput.getInputElement(),r=e===k.PAGE_HOME?0:s.value.length;s.setSelectionRange(r,r);break}case k.PAGE_UP:case k.PAGE_DOWN:i.preventDefault(),this.onPageNavigation(e);break;case k.DOWN:case k.UP:this.onNavigationKeyDown(i,e);break;case k.ESCAPE:this.isPickerDisplayed&&(Pi(this.listComponent.getGui())&&(i.preventDefault(),ws(i)),this.hidePicker());break;case k.ENTER:this.onEnterKeyDown(i);break;case k.TAB:this.onTabKeyDown();break;default:t||this.buildSearchStringFromKeyboardEvent(i)}}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),this.eLoading=void 0,super.destroy()}};g([R("userComponentFactory")],cd.prototype,"userComponentFactory",2);g([R("animationFrameService")],cd.prototype,"animationFrameService",2);g([te("eInput")],cd.prototype,"eInput",2);var Un=class MC extends Bp{constructor(e){super(e,MC.TEMPLATE),this.labelAlignment="top"}init(){this.eSlider.addCssClass("ag-slider-field");const{minValue:e,maxValue:t,textFieldWidth:s,step:r,value:o,onValueChange:n}=this.config;e!=null&&this.setMinValue(e),t!=null&&this.setMaxValue(t),s!=null&&this.setTextFieldWidth(s),r!=null&&this.setStep(r),o!=null&&this.setValue(o),n!=null&&this.onValueChange(n)}onValueChange(e){const t=b.EVENT_FIELD_VALUE_CHANGED;return this.addManagedListener(this.eText,t,()=>{const s=parseFloat(this.eText.getValue());this.eSlider.setValue(s.toString(),!0),e(s||0)}),this.addManagedListener(this.eSlider,t,()=>{const s=this.eSlider.getValue();this.eText.setValue(s,!0),e(parseFloat(s))}),this}setSliderWidth(e){return this.eSlider.setWidth(e),this}setTextFieldWidth(e){return this.eText.setWidth(e),this}setMinValue(e){return this.eSlider.setMinValue(e),this.eText.setMin(e),this}setMaxValue(e){return this.eSlider.setMaxValue(e),this.eText.setMax(e),this}getValue(){return this.eText.getValue()}setValue(e,t){return this.getValue()===e?this:(this.eText.setValue(e,!0),this.eSlider.setValue(e,!0),t||this.dispatchEvent({type:b.EVENT_FIELD_VALUE_CHANGED}),this)}setStep(e){return this.eSlider.setStep(e),this.eText.setStep(e),this}};Un.TEMPLATE=`<div class="ag-slider">
<label ref="eLabel"></label>
<div class="ag-wrapper ag-slider-wrapper">
<ag-input-range ref="eSlider"></ag-input-range>
<ag-input-number-field ref="eText"></ag-input-number-field>
</div>
</div>`;g([te("eLabel")],Un.prototype,"eLabel",2);g([te("eSlider")],Un.prototype,"eSlider",2);g([te("eText")],Un.prototype,"eText",2);g([J],Un.prototype,"init",1);var v_=Un,Ar=class Jo extends Se{constructor(e={}){super(Jo.getTemplate(e)),this.params=e,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1;const{enabled:t,items:s,suppressEnabledCheckbox:r,expanded:o,suppressToggleExpandOnEnableChange:n,useToggle:a}=e;this.cssIdentifier=e.cssIdentifier||"default",this.enabled=t??!0,this.items=s||[],this.useToggle=a??!1,this.alignItems=e.alignItems||"center",this.expanded=o??!0,r!=null&&(this.suppressEnabledCheckbox=r),n!=null&&(this.suppressToggleExpandOnEnableChange=n)}static getTemplate(e){const t=e.cssIdentifier||"default",s=e.direction||"vertical";return`
<div class="ag-group ag-${t}-group" role="presentation">
<div ref="eToolbar" class="ag-group-toolbar ag-${t}-group-toolbar">
<ag-checkbox ref="cbGroupEnabled"></ag-checkbox>
</div>
<div ref="eContainer" class="ag-group-container ag-group-container-${s} ag-${t}-group-container"></div>
</div>
`}postConstruct(){if(this.setupTitleBar(),this.items.length){const r=this.items;this.items=[],this.addItems(r)}const e=this.localeService.getLocaleTextFunc();this.cbGroupEnabled.setLabel(e("enabled","Enabled")),this.enabled&&this.setEnabled(this.enabled,void 0,!0),this.setAlignItems(this.alignItems);const{onEnableChange:t,suppressOpenCloseIcons:s}=this.params;this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(s??!1),this.refreshChildDisplay(),Ge(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(r=>{this.setEnabled(r,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(r)}),t!=null&&this.onEnableChange(t)}refreshChildDisplay(){var e;Ge(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),(e=this.eTitleBar)==null||e.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){this.alignItems!==e&&this.removeCssClass(`ag-group-item-alignment-${this.alignItems}`),this.alignItems=e;const t=`ag-group-item-alignment-${this.alignItems}`;return this.addCssClass(t),this}toggleGroupExpand(e){var t;let s=!1;if((t=this.eTitleBar)!=null&&t.isSuppressCollapse()&&!this.useToggle)e=!0,s=!0;else if(e=e??!this.expanded,this.expanded===e)return this;return this.expanded=e,this.refreshChildDisplay(),Ge(this.eContainer,e),s||this.dispatchEvent({type:e?Jo.EVENT_EXPANDED:Jo.EVENT_COLLAPSED}),this}addItems(e){e.forEach(t=>this.addItem(t))}prependItem(e){this.insertItem(e,!0)}addItem(e){this.insertItem(e,!1)}insertItem(e,t){const s=this.eContainer,r=e instanceof Se?e.getGui():e;r.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),t?(s.insertAdjacentElement("afterbegin",r),this.items.unshift(r)):(s.appendChild(r),this.items.push(r))}hideItem(e,t){const s=this.items[t];Ge(s,!e)}getItemIndex(e){const t=e instanceof Se?e.getGui():e;return this.items.indexOf(t)}setTitle(e){var t;return(t=this.eTitleBar)==null||t.setTitle(e),this}addTitleBarWidget(e){var t;return(t=this.eTitleBar)==null||t.addWidget(e),this}addCssClassToTitleBar(e){var t;(t=this.eTitleBar)==null||t.addCssClass(e)}dispatchEnableChangeEvent(e){const t={type:Jo.EVENT_ENABLE_CHANGE,enabled:e};this.dispatchEvent(t)}setEnabled(e,t,s){var r;return this.enabled=e,this.refreshDisabledStyles(),s||this.toggleGroupExpand(e),t||(this.cbGroupEnabled.setValue(e),(r=this.eToggle)==null||r.setValue(e)),this}isEnabled(){return this.enabled}onEnableChange(e){return this.addManagedListener(this,Jo.EVENT_ENABLE_CHANGE,t=>e(t.enabled)),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){var t;return(t=this.eTitleBar)==null||t.hideOpenCloseIcons(e),this}refreshDisabledStyles(){var e;const t=!this.enabled;this.eContainer.classList.toggle("ag-disabled",t),(e=this.eTitleBar)==null||e.refreshDisabledStyles(this.suppressEnabledCheckbox&&t),this.eContainer.classList.toggle("ag-disabled-group-container",t)}setupTitleBar(){const e=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",e.getGui())}createDefaultTitleBar(){const e=this.createManagedBean(new qg(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListener(e,qg.EVENT_EXPAND_CHANGED,t=>this.toggleGroupExpand(t.expanded)),e}createToggleTitleBar(){var e;const t=this.createManagedBean(new TC({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:s=>{this.setEnabled(s,!0),this.dispatchEnableChangeEvent(s)}}));return t.addCssClass("ag-group-title-bar"),t.addCssClass(`ag-${(e=this.params.cssIdentifier)!=null?e:"default"}-group-title-bar ag-unselectable`),this.eToggle=t,this.toggleGroupExpand(this.enabled),t}};Ar.EVENT_EXPANDED="expanded";Ar.EVENT_COLLAPSED="collapsed";Ar.EVENT_ENABLE_CHANGE="enableChange";g([te("eToolbar")],Ar.prototype,"eToolbar",2);g([te("cbGroupEnabled")],Ar.prototype,"cbGroupEnabled",2);g([te("eContainer")],Ar.prototype,"eContainer",2);g([J],Ar.prototype,"postConstruct",1);var C_=Ar,Jd="ag-disabled-group-title-bar",zn=class $c extends Se{constructor(e={}){super($c.getTemplate(e)),this.suppressOpenCloseIcons=!1;const{title:t,suppressOpenCloseIcons:s}=e;t&&t.length>0&&(this.title=t),s!=null&&(this.suppressOpenCloseIcons=s)}static getTemplate(e){var t;const s=(t=e.cssIdentifier)!=null?t:"default";return`
<div class="ag-group-title-bar ag-${s}-group-title-bar ag-unselectable" role="button">
<span class="ag-group-title-bar-icon ag-${s}-group-title-bar-icon" ref="eGroupOpenedIcon" role="presentation"></span>
<span class="ag-group-title-bar-icon ag-${s}-group-title-bar-icon" ref="eGroupClosedIcon" role="presentation"></span>
<span ref="eTitle" class="ag-group-title ag-${s}-group-title"></span>
</div>
`}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){this.eGroupClosedIcon.appendChild(Ui("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(Ui("columnSelectOpen",this.gos,null)),this.addManagedListener(this.getGui(),"click",()=>this.dispatchExpandChanged()),this.addManagedListener(this.getGui(),"keydown",e=>{switch(e.key){case k.ENTER:case k.SPACE:e.preventDefault(),this.dispatchExpandChanged();break;case k.RIGHT:case k.LEFT:e.preventDefault(),this.dispatchExpandChanged(e.key===k.RIGHT);break}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||Xs(this.getGui(),e)}refreshOpenCloseIcons(e){const t=!this.suppressOpenCloseIcons;Ge(this.eGroupOpenedIcon,t&&e),Ge(this.eGroupClosedIcon,t&&!e)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(e){const t={type:$c.EVENT_EXPAND_CHANGED,expanded:e};this.dispatchEvent(t)}setTitle(e){const t=this.getGui(),s=!!e&&e.length>0;e=s?e:void 0,this.eTitle.textContent=e??"",Ge(t,s),e!==this.title&&(this.title=e);const r=t.classList.contains(Jd);return this.refreshDisabledStyles(r),this}addWidget(e){return this.getGui().appendChild(e),this}hideOpenCloseIcons(e){return this.suppressOpenCloseIcons=e,e&&this.dispatchExpandChanged(!0),this}refreshDisabledStyles(e){const t=this.getGui();e?(t.classList.add(Jd),t.removeAttribute("tabindex")):(t.classList.remove(Jd),typeof this.title=="string"?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex"))}};zn.EVENT_EXPAND_CHANGED="expandedChanged";g([te("eGroupOpenedIcon")],zn.prototype,"eGroupOpenedIcon",2);g([te("eGroupClosedIcon")],zn.prototype,"eGroupClosedIcon",2);g([te("eTitle")],zn.prototype,"eTitle",2);g([J],zn.prototype,"postConstruct",1);var qg=zn,ng=class extends Ol{constructor(i=0,e){super('<div class="ag-menu-list" role="tree"></div>'),this.level=i,this.menuItems=[],this.params=e??{column:null,node:null,value:null}}postConstruct(){this.initialiseTabGuard({onTabKeyDown:i=>this.onTabKeyDown(i),handleKeyDown:i=>this.handleKeyDown(i),onFocusIn:i=>this.handleFocusIn(i),onFocusOut:i=>this.handleFocusOut(i)})}onTabKeyDown(i){const e=this.getParentComponent(),t=e&&e.getGui();t&&t.classList.contains("ag-focus-managed")||i.preventDefault(),i.shiftKey&&this.closeIfIsChild(i)}handleKeyDown(i){switch(i.key){case k.UP:case k.RIGHT:case k.DOWN:case k.LEFT:i.preventDefault(),this.handleNavKey(i.key);break;case k.ESCAPE:this.closeIfIsChild()&&ws(i);break}}handleFocusIn(i){var e,t;const s=i.relatedTarget;!this.tabGuardCtrl.isTabGuard(s)&&(this.getGui().contains(s)||(t=(e=this.activeMenuItem)==null?void 0:e.getSubMenuGui())!=null&&t.contains(s))||(this.activeMenuItem?this.activeMenuItem.activate():this.activateFirstItem())}handleFocusOut(i){var e;const t=i.relatedTarget;!this.activeMenuItem||this.getGui().contains(t)||(e=this.activeMenuItem.getSubMenuGui())!=null&&e.contains(t)||this.activeMenuItem.isSubMenuOpening()||this.activeMenuItem.deactivate()}clearActiveItem(){this.activeMenuItem&&(this.activeMenuItem.deactivate(),this.activeMenuItem=null)}addMenuItems(i){i!=null&&Lt.all(i.map(e=>e==="separator"?Lt.resolve({eGui:this.createSeparator()}):typeof e=="string"?(console.warn(`AG Grid: unrecognised menu item ${e}`),Lt.resolve({eGui:null})):this.addItem(e))).then(e=>{e.forEach(t=>{t?.eGui&&(this.appendChild(t.eGui),t.comp&&this.menuItems.push(t.comp))})})}addItem(i){const e=this.createManagedBean(new Cu);return e.init({menuItemDef:i,isAnotherSubMenuOpen:()=>this.menuItems.some(t=>t.isSubMenuOpen()),level:this.level,contextParams:this.params}).then(()=>(e.setParentComponent(this),this.addManagedListener(e,Cu.EVENT_CLOSE_MENU,t=>{this.dispatchEvent(t)}),this.addManagedListener(e,Cu.EVENT_MENU_ITEM_ACTIVATED,t=>{this.activeMenuItem&&this.activeMenuItem!==t.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=t.menuItem}),{comp:e,eGui:e.getGui()}))}activateFirstItem(){const i=this.menuItems.filter(e=>!e.isDisabled())[0];i&&i.activate()}createSeparator(){return Ri(`
<div class="ag-menu-separator" aria-hidden="true">
<div class="ag-menu-separator-part"></div>
<div class="ag-menu-separator-part"></div>
<div class="ag-menu-separator-part"></div>
<div class="ag-menu-separator-part"></div>
</div>`)}handleNavKey(i){switch(i){case k.UP:case k.DOWN:const t=this.findNextItem(i===k.UP);t&&t!==this.activeMenuItem&&t.activate();return}const e=this.gos.get("enableRtl")?k.RIGHT:k.LEFT;i===e?this.closeIfIsChild():this.openChild()}closeIfIsChild(i){const e=this.getParentComponent();return e&&e instanceof Cu?(i&&i.preventDefault(),e.closeSubMenu(),e.getGui().focus(),!0):!1}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(i){const e=this.menuItems.filter(r=>!r.isDisabled());if(!e.length)return;if(!this.activeMenuItem)return i?We(e):e[0];i&&e.reverse();let t,s=!1;for(let r=0;r<e.length;r++){const o=e[r];if(!s){o===this.activeMenuItem&&(s=!0);continue}t=o;break}return s&&!t?e[0]:t||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}};g([R("focusService")],ng.prototype,"focusService",2);g([J],ng.prototype,"postConstruct",1);var LC=class extends Ol{constructor(i){super(),this.wrappedComponent=i,this.setTemplateFromElement(i.getGui())}postConstruct(){this.initialiseTabGuard({onTabKeyDown:i=>this.onTabKeyDown(i),handleKeyDown:i=>this.handleKeyDown(i)})}handleKeyDown(i){i.key===k.ESCAPE&&this.closePanel()}onTabKeyDown(i){i.defaultPrevented||(this.closePanel(),i.preventDefault())}closePanel(){const i=this.parentComponent;i.closeSubMenu(),setTimeout(()=>i.getGui().focus(),0)}};g([J],LC.prototype,"postConstruct",1);var Yn=class en extends Z{constructor(){super(...arguments),this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}init(e){var t,s;const{menuItemDef:r,isAnotherSubMenuOpen:o,level:n,childComponent:a,contextParams:l}=e;return this.params=e.menuItemDef,this.level=n,this.isAnotherSubMenuOpen=o,this.childComponent=a,this.contextParams=l,this.cssClassPrefix=(s=(t=this.params.menuItemParams)==null?void 0:t.cssClassPrefix)!=null?s:"ag-menu-option",this.userComponentFactory.getMenuItemCompDetails(this.params,lt(de({},r),{level:n,isAnotherSubMenuOpen:o,openSubMenu:h=>this.openSubMenu(h),closeSubMenu:()=>this.closeSubMenu(),closeMenu:h=>this.closeMenu(h),updateTooltip:(h,d)=>this.refreshTooltip(h,d),onItemActivated:()=>this.onItemActivated()})).newAgStackInstance().then(h=>{var d;this.menuItemComp=h;const c=(d=h.configureDefaults)==null?void 0:d.call(h);c&&this.configureDefaults(c===!0?void 0:c)})}addListeners(e,t){t?.suppressClick||this.addManagedListener(e,"click",s=>this.onItemSelected(s)),t?.suppressKeyboardSelect||this.addManagedListener(e,"keydown",s=>{(s.key===k.ENTER||s.key===k.SPACE)&&(s.preventDefault(),this.onItemSelected(s))}),t?.suppressMouseDown||this.addManagedListener(e,"mousedown",s=>{s.stopPropagation(),s.preventDefault()}),t?.suppressMouseOver||(this.addManagedListener(e,"mouseenter",()=>this.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.onMouseLeave()))}isDisabled(){return!!this.params.disabled}openSubMenu(e=!1){var t,s;if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;const r=Ri('<div class="ag-menu" role="presentation"></div>');this.eSubMenuGui=r;let o,n=()=>{this.subMenuIsOpening=!1};if(this.childComponent){const h=this.createBean(new LC(this.childComponent));h.setParentComponent(this);const d=h.getGui(),c="mouseenter",p=()=>this.cancelDeactivate();d.addEventListener(c,p),o=()=>d.removeEventListener(c,p),r.appendChild(d),this.childComponent.afterGuiAttached&&(n=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){const h=this.createBean(new ng(this.level+1,this.contextParams));h.setParentComponent(this),h.addMenuItems(this.params.subMenu),r.appendChild(h.getGui()),this.addManagedListener(h,en.EVENT_CLOSE_MENU,d=>this.dispatchEvent(d)),h.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),o=()=>this.destroyBean(h),e&&(n=()=>{h.activateFirstItem(),this.subMenuIsOpening=!1})}const a=this.popupService.positionPopupForMenu.bind(this.popupService,{eventSource:this.eGui,ePopup:r}),l=this.localeService.getLocaleTextFunc(),u=this.popupService.addPopup({modal:!0,eChild:r,positionCallback:a,anchorToElement:this.eGui,ariaLabel:l("ariaLabelSubMenu","SubMenu"),afterGuiAttached:n});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{var h,d;u&&u.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),o(),(d=(h=this.menuItemComp).setExpanded)==null||d.call(h,!1),this.eSubMenuGui=void 0},(s=(t=this.menuItemComp).setExpanded)==null||s.call(t,!0)}setAriaExpanded(e){this.suppressAria||Xs(this.eGui,e)}closeSubMenu(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1))}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(e){var t,s;this.cancelActivate(),!this.params.disabled&&(this.isActive=!0,this.suppressRootStyles||this.eGui.classList.add(`${this.cssClassPrefix}-active`),(s=(t=this.menuItemComp).setActive)==null||s.call(t,!0),this.suppressFocus||this.eGui.focus({preventScroll:!0}),e&&this.params.subMenu&&window.setTimeout(()=>{this.isAlive()&&this.isActive&&this.openSubMenu()},300),this.onItemActivated())}deactivate(){var e,t;this.cancelDeactivate(),this.suppressRootStyles||this.eGui.classList.remove(`${this.cssClassPrefix}-active`),(t=(e=this.menuItemComp).setActive)==null||t.call(e,!1),this.isActive=!1,this.subMenuIsOpen&&this.hideSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(e){this.parentComponent=e}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(e){var t,s;(s=(t=this.menuItemComp).select)==null||s.call(t),this.params.action?this.getFrameworkOverrides().wrapOutgoing(()=>this.params.action(this.gos.addGridCommonParams(de({},this.contextParams)))):this.openSubMenu(e&&e.type==="keydown"),!(this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect)&&this.closeMenu(e)}closeMenu(e){const t={type:en.EVENT_CLOSE_MENU};e&&(e instanceof MouseEvent?t.mouseEvent=e:t.keyboardEvent=e),this.dispatchEvent(t)}onItemActivated(){const e={type:en.EVENT_MENU_ITEM_ACTIVATED,menuItem:this};this.dispatchEvent(e)}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),en.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),en.ACTIVATION_DELAY):this.deactivate()}configureDefaults(e){var t,s,r;if(!this.menuItemComp){setTimeout(()=>this.configureDefaults(e));return}let o=this.menuItemComp.getGui();const n=(s=(t=this.menuItemComp).getRootElement)==null?void 0:s.call(t);n&&(e?.suppressRootStyles||o.classList.add("ag-menu-option-custom"),o=n),this.eGui=o,this.suppressRootStyles=!!e?.suppressRootStyles,this.suppressRootStyles||(o.classList.add(this.cssClassPrefix),(r=this.params.cssClasses)==null||r.forEach(a=>o.classList.add(a)),this.params.disabled&&o.classList.add(`${this.cssClassPrefix}-disabled`)),e?.suppressTooltip||this.refreshTooltip(this.params.tooltip),this.suppressAria=!!e?.suppressAria,this.suppressAria||(yt(o,"treeitem"),jm(o,this.level+1),this.params.disabled&&vp(o,!0)),e?.suppressTabIndex||o.setAttribute("tabindex","-1"),this.params.disabled||this.addListeners(o,e),this.suppressFocus=!!e?.suppressFocus}refreshTooltip(e,t){this.tooltip=e,this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),!(!e||!this.menuItemComp)&&(this.tooltipFeature=this.createBean(new er({getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:t})))}destroy(){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}};Yn.EVENT_CLOSE_MENU="closeMenu";Yn.EVENT_MENU_ITEM_ACTIVATED="menuItemActivated";Yn.ACTIVATION_DELAY=80;g([R("popupService")],Yn.prototype,"popupService",2);g([R("userComponentFactory")],Yn.prototype,"userComponentFactory",2);var Cu=Yn,Go=class Kc extends Se{constructor(e){super(Kc.getTemplate(e)),this.config=e,this.closable=!0}static getTemplate(e){const t=e.cssIdentifier||"default";return`<div class="ag-panel ag-${t}-panel" tabindex="-1">
<div ref="eTitleBar" class="ag-panel-title-bar ag-${t}-panel-title-bar ag-unselectable">
<span ref="eTitle" class="ag-panel-title-bar-title ag-${t}-panel-title-bar-title"></span>
<div ref="eTitleBarButtons" class="ag-panel-title-bar-buttons ag-${t}-panel-title-bar-buttons"></div>
</div>
<div ref="eContentWrapper" class="ag-panel-content-wrapper ag-${t}-panel-content-wrapper"></div>
</div>`}postConstruct(){const{component:e,closable:t,hideTitleBar:s,title:r,minWidth:o=250,width:n,minHeight:a=250,height:l,centered:u,popup:h,x:d,y:c}=this.config;this.positionableFeature=new On(this.getGui(),{minWidth:o,width:n,minHeight:a,height:l,centered:u,x:d,y:c,popup:h,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}),this.createManagedBean(this.positionableFeature);const p=this.getGui();e&&this.setBodyComponent(e),s?Ge(this.eTitleBar,!1):(r&&this.setTitle(r),this.setClosable(t??this.closable)),this.addManagedListener(this.eTitleBar,"mousedown",y=>{if(p.contains(y.relatedTarget)||p.contains(this.gos.getActiveDomElement())||this.eTitleBarButtons.contains(y.target)){y.preventDefault();return}const f=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");f&&f.focus()}),!(h&&this.positionableFeature.isPositioned())&&(this.renderComponent&&this.renderComponent(),this.positionableFeature.initialisePosition(),this.eContentWrapper.style.height="0")}renderComponent(){const e=this.getGui();e.focus(),this.close=()=>{e.parentElement.removeChild(e),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(e){this.positionableFeature.setHeight(e)}getWidth(){return this.positionableFeature.getWidth()}setWidth(e){this.positionableFeature.setWidth(e)}setClosable(e){if(e!==this.closable&&(this.closable=e),e){const t=this.closeButtonComp=new Se(Kc.CLOSE_BTN_TEMPLATE);this.getContext().createBean(t);const s=t.getGui(),r=dt("close",this.gos);r.classList.add("ag-panel-title-bar-button-icon"),s.appendChild(r),this.addTitleBarButton(t),t.addManagedListener(s,"click",this.onBtClose.bind(this))}else if(this.closeButtonComp){const t=this.closeButtonComp.getGui();t.parentElement.removeChild(t),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,t){const s=this.eTitleBarButtons,r=s.children,o=r.length;t==null&&(t=o),t=Math.max(0,Math.min(t,o)),e.addCssClass("ag-panel-title-bar-button");const n=e.getGui();t===0?s.insertAdjacentElement("afterbegin",n):t===o?s.insertAdjacentElement("beforeend",n):r[t-1].insertAdjacentElement("afterend",n),e.setParentComponent(this)}getBodyHeight(){return El(this.eContentWrapper)}getBodyWidth(){return To(this.eContentWrapper)}setTitle(e){this.eTitle.innerText=e}onBtClose(){this.close()}destroy(){this.closeButtonComp&&(this.closeButtonComp=this.destroyBean(this.closeButtonComp));const e=this.getGui();e&&Pi(e)&&this.close(),super.destroy()}};Go.CLOSE_BTN_TEMPLATE='<div class="ag-button"></div>';g([te("eContentWrapper")],Go.prototype,"eContentWrapper",2);g([te("eTitleBar")],Go.prototype,"eTitleBar",2);g([te("eTitleBarButtons")],Go.prototype,"eTitleBarButtons",2);g([te("eTitle")],Go.prototype,"eTitle",2);g([J],Go.prototype,"postConstruct",1);var y_=Go,w_=class extends y_{constructor(i){super(lt(de({},i),{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 i=this.getGui(),{movable:e,resizable:t,maximizable:s}=this.config;this.addCssClass("ag-dialog"),super.postConstruct(),this.addManagedListener(i,"focusin",r=>{this.popupService.bringPopupToFront(i)}),e&&this.setMovable(e),s&&this.setMaximizable(s),t&&this.setResizable(t)}renderComponent(){const i=this.getGui(),{alwaysOnTop:e,modal:t,title:s,afterGuiAttached:r}=this.config,o=this.localeService.getLocaleTextFunc(),n=this.popupService.addPopup({modal:t,eChild:i,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:e,ariaLabel:s||o("ariaLabelDialog","Dialog"),afterGuiAttached:r});n&&(this.close=n.hideFunc)}onClosed(i){var e,t;this.destroy(),(t=(e=this.config).closedCallback)==null||t.call(e,i)}toggleMaximize(){const i=this.positionableFeature.getPosition();if(this.isMaximized){const{x:e,y:t,width:s,height:r}=this.lastPosition;this.setWidth(s),this.setHeight(r),this.positionableFeature.offsetElement(e,t)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=i.x,this.lastPosition.y=i.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){Ge(this.maximizeIcon,!this.isMaximized),Ge(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){this.maximizeListeners.length&&(this.maximizeListeners.forEach(i=>i()),this.maximizeListeners.length=0),this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(i){this.positionableFeature.setResizable(i)}setMovable(i){this.positionableFeature.setMovable(i,this.eTitleBar)}setMaximizable(i){if(!i){this.clearMaximizebleListeners(),this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0);return}const e=this.eTitleBar;if(!e||i===this.isMaximizable)return;const t=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),t.addManagedListener(t.getGui(),"click",this.toggleMaximize.bind(this)),this.addTitleBarButton(t,0),this.maximizeListeners.push(this.addManagedListener(e,"dblclick",this.toggleMaximize.bind(this))),this.resizeListenerDestroy=this.addManagedListener(this,"resize",()=>{this.isMaximized=!1,this.refreshMaximizeIcon()})}buildMaximizeAndMinimizeElements(){const i=this.maximizeButtonComp=this.createBean(new Se('<div class="ag-dialog-button"></span>')),e=i.getGui();return this.maximizeIcon=dt("maximize",this.gos),e.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=dt("minimize",this.gos),e.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),i}};g([R("popupService")],w_.prototype,"popupService",2);var b_=0,qs=class extends Z{constructor(){super(...arguments),this.popupList=[]}postConstruct(){this.ctrlsService.whenReady(i=>{this.gridCtrl=i.gridCtrl}),this.addManagedListener(this.eventService,b.EVENT_GRID_STYLES_CHANGED,this.handleThemeChange.bind(this))}getPopupParent(){const i=this.gos.get("popupParent");return i||this.gridCtrl.getGui()}positionPopupForMenu(i){const{eventSource:e,ePopup:t}=i,s=this.getPopupIndex(t);if(s!==-1){const p=this.popupList[s];p.alignedToElement=e}const r=e.getBoundingClientRect(),o=this.getParentRect(),n=this.keepXYWithinBounds(t,r.top-o.top,0),a=t.clientWidth>0?t.clientWidth:200;t.style.minWidth=`${a}px`;const u=o.right-o.left-a;let h;this.gos.get("enableRtl")?(h=c(),h<0&&(h=d(),this.setAlignedStyles(t,"left")),h>u&&(h=0,this.setAlignedStyles(t,"right"))):(h=d(),h>u&&(h=c(),this.setAlignedStyles(t,"right")),h<0&&(h=0,this.setAlignedStyles(t,"left"))),t.style.left=`${h}px`,t.style.top=`${n}px`;function d(){return r.right-o.left-2}function c(){return r.left-o.left-a}}positionPopupUnderMouseEvent(i){const{ePopup:e,nudgeX:t,nudgeY:s,skipObserver:r}=i;this.positionPopup({ePopup:e,nudgeX:t,nudgeY:s,keepWithinBounds:!0,skipObserver:r,updatePosition:()=>this.calculatePointerAlign(i.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(i.type,i.ePopup,null,i.mouseEvent,i.column,i.rowNode)})}calculatePointerAlign(i){const e=this.getParentRect();return{x:i.clientX-e.left,y:i.clientY-e.top}}positionPopupByComponent(i){const{ePopup:e,nudgeX:t,nudgeY:s,keepWithinBounds:r,eventSource:o,alignSide:n="left",position:a="over",column:l,rowNode:u,type:h}=i,d=o.getBoundingClientRect(),c=this.getParentRect(),p=this.getPopupIndex(e);if(p!==-1){const f=this.popupList[p];f.alignedToElement=o}const y=()=>{let f=d.left-c.left;n==="right"&&(f-=e.offsetWidth-d.width);let w;return a==="over"?(w=d.top-c.top,this.setAlignedStyles(e,"over")):(this.setAlignedStyles(e,"under"),this.shouldRenderUnderOrAbove(e,d,c,i.nudgeY||0)==="under"?w=d.top-c.top+d.height:w=d.top-e.offsetHeight-(s||0)*2-c.top),{x:f,y:w}};this.positionPopup({ePopup:e,nudgeX:t,nudgeY:s,keepWithinBounds:r,updatePosition:y,postProcessCallback:()=>this.callPostProcessPopup(h,e,o,null,l,u)})}shouldRenderUnderOrAbove(i,e,t,s){const r=t.bottom-e.bottom,o=e.top-t.top,n=i.offsetHeight+s;return r>n?"under":o>n||o>r?"above":"under"}setAlignedStyles(i,e){const t=this.getPopupIndex(i);if(t===-1)return;const s=this.popupList[t],{alignedToElement:r}=s;!r||(["right","left","over","above","under"].forEach(n=>{r.classList.remove(`ag-has-popup-positioned-${n}`),i.classList.remove(`ag-popup-positioned-${n}`)}),!e)||(r.classList.add(`ag-has-popup-positioned-${e}`),i.classList.add(`ag-popup-positioned-${e}`))}callPostProcessPopup(i,e,t,s,r,o){const n=this.gos.getCallback("postProcessPopup");n&&n({column:r,rowNode:o,ePopup:e,type:i,eventSource:t,mouseEvent:s})}positionPopup(i){const{ePopup:e,keepWithinBounds:t,nudgeX:s,nudgeY:r,skipObserver:o,updatePosition:n}=i,a={width:0,height:0},l=(u=!1)=>{let{x:h,y:d}=n();u&&e.clientWidth===a.width&&e.clientHeight===a.height||(a.width=e.clientWidth,a.height=e.clientHeight,s&&(h+=s),r&&(d+=r),t&&(h=this.keepXYWithinBounds(e,h,1),d=this.keepXYWithinBounds(e,d,0)),e.style.left=`${h}px`,e.style.top=`${d}px`,i.postProcessCallback&&i.postProcessCallback())};if(l(),!o){const u=this.resizeObserverService.observeResize(e,()=>l(!0));setTimeout(()=>u(),qs.WAIT_FOR_POPUP_CONTENT_RESIZE)}}getActivePopups(){return this.popupList.map(i=>i.element)}getPopupList(){return this.popupList}getParentRect(){const i=this.gos.getDocument();let e=this.getPopupParent();return e===i.body?e=i.documentElement:getComputedStyle(e).position==="static"&&(e=e.offsetParent),Fp(e)}keepXYWithinBounds(i,e,t){const s=t===0,r=s?"clientHeight":"clientWidth",o=s?"top":"left",n=s?"offsetHeight":"offsetWidth",a=s?"scrollTop":"scrollLeft",l=this.gos.getDocument(),u=l.documentElement,h=this.getPopupParent(),d=h.getBoundingClientRect(),c=l.documentElement.getBoundingClientRect(),p=h===l.body,y=i[n];let w=p?(s?Ap:Va)(u)+u[a]:h[r];p&&(w-=Math.abs(c[o]-d[o]));const _=w-y;return Math.min(Math.max(e,0),Math.abs(_))}addPopup(i){const e=this.gos.getDocument(),{eChild:t,ariaLabel:s,alwaysOnTop:r,positionCallback:o,anchorToElement:n}=i;if(!e)return console.warn("AG Grid: could not find the document, document is empty"),{hideFunc:()=>{}};const a=this.getPopupIndex(t);if(a!==-1)return{hideFunc:this.popupList[a].hideFunc};this.initialisePopupPosition(t);const l=this.createPopupWrapper(t,s,!!r),u=this.addEventListenersToPopup(lt(de({},i),{wrapperEl:l}));return o&&o(),this.addPopupToPopupList(t,l,u,n),{hideFunc:u}}initialisePopupPosition(i){const t=this.getPopupParent().getBoundingClientRect();K(i.style.top)||(i.style.top=`${t.top*-1}px`),K(i.style.left)||(i.style.left=`${t.left*-1}px`)}createPopupWrapper(i,e,t){const s=this.getPopupParent(),r=document.createElement("div"),{allThemes:o}=this.environment.getTheme();return o.length&&r.classList.add(...o),r.classList.add("ag-popup"),i.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),i.hasAttribute("role")||yt(i,"dialog"),Gi(i,e),r.appendChild(i),s.appendChild(r),t?this.setAlwaysOnTop(i,!0):this.bringPopupToFront(i),r}handleThemeChange(){const{allThemes:i}=this.environment.getTheme();for(const e of this.popupList){for(const t of Array.from(e.wrapper.classList))t.startsWith("ag-theme-")&&e.wrapper.classList.remove(t);i.length&&e.wrapper.classList.add(...i)}}addEventListenersToPopup(i){const e=this.gos.getDocument(),t=this.getPopupParent(),{wrapperEl:s,eChild:r,closedCallback:o,afterGuiAttached:n,closeOnEsc:a,modal:l}=i;let u=!1;const h=y=>{if(!s.contains(this.gos.getActiveDomElement()))return;y.key===k.ESCAPE&&!vs(y)&&p({keyboardEvent:y})},d=y=>p({mouseEvent:y}),c=y=>p({touchEvent:y}),p=(y={})=>{const{mouseEvent:f,touchEvent:w,keyboardEvent:_,forceHide:P}=y;!P&&(this.isEventFromCurrentPopup({mouseEvent:f,touchEvent:w},r)||u)||(u=!0,t.removeChild(s),e.removeEventListener("keydown",h),e.removeEventListener("mousedown",d),e.removeEventListener("touchstart",c),e.removeEventListener("contextmenu",d),this.eventService.removeEventListener(b.EVENT_DRAG_STARTED,d),o&&o(f||w||_),this.removePopupFromPopupList(r))};return n&&n({hidePopup:p}),window.setTimeout(()=>{a&&e.addEventListener("keydown",h),l&&(e.addEventListener("mousedown",d),this.eventService.addEventListener(b.EVENT_DRAG_STARTED,d),e.addEventListener("touchstart",c),e.addEventListener("contextmenu",d))},0),p}addPopupToPopupList(i,e,t,s){this.popupList.push({element:i,wrapper:e,hideFunc:t,instanceId:b_++,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(i,s)}getPopupIndex(i){return this.popupList.findIndex(e=>e.element===i)}setPopupPositionRelatedToElement(i,e){const t=this.getPopupIndex(i);if(t===-1)return;const s=this.popupList[t];if(s.stopAnchoringPromise&&s.stopAnchoringPromise.then(o=>o&&o()),s.stopAnchoringPromise=void 0,s.isAnchored=!1,!e)return;const r=this.keepPopupPositionedRelativeTo({element:e,ePopup:i,hidePopup:s.hideFunc});return s.stopAnchoringPromise=r,s.isAnchored=!0,r}removePopupFromPopupList(i){this.setAlignedStyles(i,null),this.setPopupPositionRelatedToElement(i,null),this.popupList=this.popupList.filter(e=>e.element!==i)}keepPopupPositionedRelativeTo(i){const e=this.getPopupParent(),t=e.getBoundingClientRect(),{element:s,ePopup:r}=i,o=s.getBoundingClientRect(),n=t.top-o.top,a=t.left-o.left;let l=n,u=a;const h=r.style.top,d=parseInt(h.substring(0,h.length-1),10),c=r.style.left,p=parseInt(c.substring(0,c.length-1),10);return new Lt(y=>{this.getFrameworkOverrides().setInterval(()=>{const f=e.getBoundingClientRect(),w=s.getBoundingClientRect();if(w.top==0&&w.left==0&&w.height==0&&w.width==0){i.hidePopup();return}const P=f.top-w.top;if(P!=l){const D=this.keepXYWithinBounds(r,d+n-P,0);r.style.top=`${D}px`}l=P;const T=f.left-w.left;if(T!=u){const D=this.keepXYWithinBounds(r,p+a-T,1);r.style.left=`${D}px`}u=T},200).then(f=>{y(()=>{f!=null&&window.clearInterval(f)})})})}hasAnchoredPopup(){return this.popupList.some(i=>i.isAnchored)}isEventFromCurrentPopup(i,e){const{mouseEvent:t,touchEvent:s}=i,r=t||s;if(!r)return!1;const o=this.getPopupIndex(e);if(o===-1)return!1;for(let n=o;n<this.popupList.length;n++){const a=this.popupList[n];if(Ju(a.element,r))return!0}return this.isElementWithinCustomPopup(r.target)}isElementWithinCustomPopup(i){const e=this.gos.getDocument();for(;i&&i!==e.body;){if(i.classList.contains("ag-custom-component-popup")||i.parentElement===null)return!0;i=i.parentElement}return!1}getWrapper(i){for(;!i.classList.contains("ag-popup")&&i.parentElement;)i=i.parentElement;return i.classList.contains("ag-popup")?i:null}setAlwaysOnTop(i,e){const t=this.getWrapper(i);t&&(t.classList.toggle("ag-always-on-top",!!e),e&&this.bringPopupToFront(t))}bringPopupToFront(i){const e=this.getPopupParent(),t=Array.prototype.slice.call(e.querySelectorAll(".ag-popup")),s=t.length,r=Array.prototype.slice.call(e.querySelectorAll(".ag-popup.ag-always-on-top")),o=r.length,n=this.getWrapper(i);if(!n||s<=1||!e.contains(i))return;const a=t.indexOf(n),l=n.querySelectorAll("div"),u=[];for(l.forEach(h=>{h.scrollTop!==0&&u.push([h,h.scrollTop])}),o?n.classList.contains("ag-always-on-top")?a!==s-1&&We(r).insertAdjacentElement("afterend",n):a!==s-o-1&&r[0].insertAdjacentElement("beforebegin",n):a!==s-1&&We(t).insertAdjacentElement("afterend",n);u.length;){const h=u.pop();h[0].scrollTop=h[1]}}};qs.WAIT_FOR_POPUP_CONTENT_RESIZE=200;g([R("focusService")],qs.prototype,"focusService",2);g([R("ctrlsService")],qs.prototype,"ctrlsService",2);g([R("resizeObserverService")],qs.prototype,"resizeObserverService",2);g([J],qs.prototype,"postConstruct",1);qs=g([le("popupService")],qs);var S_=class extends Se{constructor(){super(`
<div class="ag-autocomplete-row" role="presentation">
<div class="ag-autocomplete-row-label"></div>
</div>`),this.hasHighlighting=!1}setState(i,e){this.value=i,this.render(),this.updateSelected(e)}updateSelected(i){this.addOrRemoveCssClass("ag-autocomplete-row-selected",i)}setSearchString(i){var e;let t=!1;if(K(i)){const s=(e=this.value)==null?void 0:e.toLocaleLowerCase().indexOf(i.toLocaleLowerCase());if(s>=0){t=!0,this.hasHighlighting=!0;const r=s+i.length,o=Ft(this.value.slice(0,s)),n=Ft(this.value.slice(s,r)),a=Ft(this.value.slice(r));this.getGui().lastElementChild.innerHTML=`${o}<b>${n}</b>${a}`}}!t&&this.hasHighlighting&&(this.hasHighlighting=!1,this.render())}render(){var i;this.getGui().lastElementChild.innerHTML=(i=Ft(this.value))!=null?i:" "}},pd=class IC extends Mo{constructor(e){super(IC.TEMPLATE),this.params=e,this.searchString=""}destroy(){super.destroy()}init(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new FC({cssIdentifier:"autocomplete"})),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.autocompleteEntries.length,getRow:t=>this.autocompleteEntries[t]});const e=this.virtualList.getGui();this.addManagedListener(e,"click",()=>this.params.onConfirmed()),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.addManagedListener(e,"mousedown",t=>t.preventDefault()),this.setSelectedValue(0)}onNavigationKeyDown(e,t){e.preventDefault();const s=this.autocompleteEntries.indexOf(this.selectedValue),r=t===k.UP?s-1:s+1;this.checkSetSelectedValue(r)}setSearch(e){this.searchString=e,K(e)?this.runSearch():(this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList.refresh(),this.checkSetSelectedValue(0)),this.updateSearchInList()}runContainsSearch(e,t){let s,r=!1;const o=e.toLocaleLowerCase(),n=t.filter(a=>{const u=a.toLocaleLowerCase().indexOf(o),h=u===0,d=u>=0;return d&&(!s||!r&&h||r===h&&a.length<s.length)&&(s=a,r=h),d});return!s&&n.length&&(s=n[0]),{topMatch:s,allMatches:n}}runSearch(){var e,t;const{autocompleteEntries:s}=this.params,r=s.map(u=>{var h;return(h=u.displayValue)!=null?h:u.key});let o,n;if(this.params.useFuzzySearch)o=Rl(this.searchString,r,!0).values,n=o.length?o[0]:void 0;else{const u=this.runContainsSearch(this.searchString,r);o=u.allMatches,n=u.topMatch}let a=s.filter(({key:u,displayValue:h})=>o.includes(h??u));if(!a.length&&this.selectedValue&&((t=(e=this.params)==null?void 0:e.forceLastSelection)!=null&&t.call(e,this.selectedValue,this.searchString))&&(a=[this.selectedValue]),this.autocompleteEntries=a,this.virtualList.refresh(),!n)return;const l=o.indexOf(n);this.checkSetSelectedValue(l)}updateSearchInList(){this.virtualList.forEachRenderedRow(e=>e.setSearchString(this.searchString))}checkSetSelectedValue(e){e>=0&&e<this.autocompleteEntries.length&&this.setSelectedValue(e)}setSelectedValue(e){const t=this.autocompleteEntries[e];this.selectedValue!==t&&(this.selectedValue=t,this.virtualList.ensureIndexVisible(e),this.virtualList.forEachRenderedRow((s,r)=>{s.updateSelected(e===r)}))}createRowComponent(e){var t;const s=new S_;return this.getContext().createBean(s),s.setState((t=e.displayValue)!=null?t:e.key,e===this.selectedValue),s}onMouseMove(e){const t=this.virtualList.getGui().getBoundingClientRect(),s=this.virtualList.getScrollTop(),r=e.clientY-t.top+s,o=Math.floor(r/this.virtualList.getRowHeight());this.checkSetSelectedValue(o)}afterGuiAttached(){this.virtualList.refresh()}getSelectedValue(){var e;return this.autocompleteEntries.length&&(e=this.selectedValue)!=null?e:null}};pd.TEMPLATE=`<div class="ag-autocomplete-list-popup">
<div ref="eList" class="ag-autocomplete-list"></div>
<div>`;g([te("eList")],pd.prototype,"eList",2);g([J],pd.prototype,"init",1);var __=pd,Fr=class Sa extends Se{constructor(){super(`
<div class="ag-autocomplete" role="presentation">
<ag-input-text-field ref="eAutocompleteInput"></ag-input-text-field>
</div>`),this.isListOpen=!1,this.lastPosition=0,this.valid=!0}postConstruct(){this.eAutocompleteInput.onValueChange(e=>this.onValueChanged(e)),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(e){const t=Fs(e);this.updateValue(t),this.updateAutocompleteList(t)}updateValue(e){this.updateLastPosition(),this.dispatchEvent({type:Sa.EVENT_VALUE_CHANGED,value:e}),this.validate(e)}updateAutocompleteList(e){var t,s,r,o;const n=(s=(t=this.listGenerator)==null?void 0:t.call(this,e,this.lastPosition))!=null?s:{enabled:!1};if((!n.type||n.type!==((r=this.autocompleteListParams)==null?void 0:r.type))&&this.isListOpen&&this.closeList(),this.autocompleteListParams=n,(o=this.autocompleteListParams)!=null&&o.enabled){this.isListOpen||this.openList();const{searchString:a}=this.autocompleteListParams;this.autocompleteList.setSearch(a??"")}else this.isListOpen&&this.closeList()}onKeyDown(e){const t=e.key;switch(this.updateLastPosition(),t){case k.ENTER:this.onEnterKeyDown(e);break;case k.TAB:this.onTabKeyDown(e);break;case k.DOWN:case k.UP:this.onUpDownKeyDown(e,t);break;case k.LEFT:case k.RIGHT:case k.PAGE_HOME:case k.PAGE_END:setTimeout(()=>{this.updatePositionAndList()});break;case k.ESCAPE:this.onEscapeKeyDown(e);break;case k.SPACE:e.ctrlKey&&!this.isListOpen&&(e.preventDefault(),this.forceOpenList());break}}confirmSelection(){var e;const t=(e=this.autocompleteList)==null?void 0:e.getSelectedValue();t&&(this.closeList(),this.dispatchEvent({type:Sa.EVENT_OPTION_SELECTED,value:this.getValue(),position:this.lastPosition,updateEntry:t,autocompleteType:this.autocompleteListParams.type}))}onTabKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.confirmSelection())}onEnterKeyDown(e){e.preventDefault(),this.isListOpen?this.confirmSelection():this.onCompleted()}onUpDownKeyDown(e,t){var s;e.preventDefault(),this.isListOpen?(s=this.autocompleteList)==null||s.onNavigationKeyDown(e,t):this.forceOpenList()}onEscapeKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.closeList(),this.setCaret(this.lastPosition,!0))}onFocusOut(){this.isListOpen&&this.closeList()}updatePositionAndList(){var e;this.updateLastPosition(),this.updateAutocompleteList((e=this.eAutocompleteInput.getValue())!=null?e:null)}setCaret(e,t){const s=this.gos.getDocument(),r=this.gos.getActiveDomElement();t&&(!r||r===s.body)&&this.eAutocompleteInput.getFocusableElement().focus();const o=this.eAutocompleteInput.getInputElement();o.setSelectionRange(e,e),e===o.value.length&&(o.scrollLeft=o.scrollWidth)}forceOpenList(){this.onValueChanged(this.eAutocompleteInput.getValue())}updateLastPosition(){var e;this.lastPosition=(e=this.eAutocompleteInput.getInputElement().selectionStart)!=null?e:0}validate(e){var t;this.validator&&(this.validationMessage=this.validator(e),this.eAutocompleteInput.getInputElement().setCustomValidity((t=this.validationMessage)!=null?t:""),this.valid=!this.validationMessage,this.dispatchEvent({type:Sa.EVENT_VALID_CHANGED,isValid:this.valid,validationMessage:this.validationMessage}))}openList(){this.isListOpen=!0,this.autocompleteList=this.createBean(new __({autocompleteEntries:this.autocompleteListParams.entries,onConfirmed:()=>this.confirmSelection(),forceLastSelection:this.forceLastSelection}));const e=this.autocompleteList.getGui(),t={ePopup:e,type:"autocomplete",eventSource:this.getGui(),position:"under",alignSide:this.gos.get("enableRtl")?"right":"left",keepWithinBounds:!0},s=this.popupService.addPopup({eChild:e,anchorToElement:this.getGui(),positionCallback:()=>this.popupService.positionPopupByComponent(t),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:Sa.EVENT_VALUE_CONFIRMED,value:this.getValue(),isValid:this.isValid()})}getValue(){return Fs(this.eAutocompleteInput.getValue())}setInputPlaceholder(e){return this.eAutocompleteInput.setInputPlaceholder(e),this}setInputAriaLabel(e){return this.eAutocompleteInput.setInputAriaLabel(e),this}setListAriaLabel(e){return this.listAriaLabel=e,this}setListGenerator(e){return this.listGenerator=e,this}setValidator(e){return this.validator=e,this}isValid(){return this.valid}setValue(e){const{value:t,position:s,silent:r,updateListOnlyIfOpen:o,restoreFocus:n}=e;this.eAutocompleteInput.setValue(t,!0),this.setCaret(s??this.lastPosition,n),r||this.updateValue(t),(!o||this.isListOpen)&&this.updateAutocompleteList(t)}setForceLastSelection(e){return this.forceLastSelection=e,this}setInputDisabled(e){return this.eAutocompleteInput.setDisabled(e),this}};Fr.EVENT_VALUE_CHANGED="eventValueChanged";Fr.EVENT_VALUE_CONFIRMED="eventValueConfirmed";Fr.EVENT_OPTION_SELECTED="eventOptionSelected";Fr.EVENT_VALID_CHANGED="eventValidChanged";g([R("popupService")],Fr.prototype,"popupService",2);g([te("eAutocompleteInput")],Fr.prototype,"eAutocompleteInput",2);g([J],Fr.prototype,"postConstruct",1);var E_=Fr,Mr=class Hu extends Se{constructor(e,t,s,r){super(),this.dragSourceDropTarget=e,this.ghost=t,this.horizontal=s,this.template=r}init(){var e;this.setTemplate((e=this.template)!=null?e:Hu.TEMPLATE);const t=this.getGui();this.addElementClasses(t),this.addElementClasses(this.eDragHandle,"drag-handle"),this.addElementClasses(this.eText,"text"),this.addElementClasses(this.eButton,"button"),this.eDragHandle.appendChild(dt("columnDrag",this.gos)),this.eButton.appendChild(dt("cancel",this.gos)),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 e=this.localeService.getLocaleTextFunc(),t=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(t,e),Gi(this.getGui(),t.join(". "))}addAdditionalAriaInstructions(e,t){if(this.isRemovable()){const s=t("ariaDropZoneColumnComponentDescription","Press DELETE to remove");e.push(s)}}setupTooltip(){const e=()=>{const t=this.getTooltip();this.setTooltip({newTooltipText:t})};e(),this.addManagedListener(this.eventService,b.EVENT_NEW_COLUMNS_LOADED,e)}getDragSourceId(){}getDefaultIconName(){return Re.ICON_NOT_ALLOWED}addDragSource(){const{dragAndDropService:e,eDragHandle:t}=this,s=this.createGetDragItem(),r=this.getDefaultIconName(),o={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:t,getDefaultIconName:()=>r,getDragItem:s,dragItemName:this.getDisplayName()};e.addDragSource(o,!0),this.addDestroyFunc(()=>e.removeDragSource(o))}setupComponents(){this.setTextValue(),this.setupRemove(),this.ghost&&this.addCssClass("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){Ge(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();const e={type:Hu.EVENT_COLUMN_REMOVE};this.addGuiEventListener("keydown",s=>this.onKeyDown(s)),this.addManagedListener(this.eButton,"click",s=>{this.dispatchEvent(e),s.stopPropagation()});const t=new Kt(this.eButton);this.addManagedListener(t,Kt.EVENT_TAP,()=>{this.dispatchEvent(e)}),this.addDestroyFunc(t.destroy.bind(t))}onKeyDown(e){e.key===k.DELETE&&this.isRemovable()&&(e.preventDefault(),this.dispatchEvent({type:Hu.EVENT_COLUMN_REMOVE}))}getDisplayValue(){return this.getDisplayName()}setTextValue(){const e=this.getDisplayValue(),t=Ft(e);this.eText.innerHTML=t}addElementClasses(e,t){t=t?`-${t}`:"";const s=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop-cell${t}`,`ag-column-drop-${s}-cell${t}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}};Mr.EVENT_COLUMN_REMOVE="columnRemove";Mr.TEMPLATE=`<span role="option">
<span ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>
<span ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>
<span ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>
</span>`;g([R("dragAndDropService")],Mr.prototype,"dragAndDropService",2);g([te("eText")],Mr.prototype,"eText",2);g([te("eDragHandle")],Mr.prototype,"eDragHandle",2);g([te("eButton")],Mr.prototype,"eButton",2);g([J],Mr.prototype,"init",1);var x_=Mr,Gl=class Ps extends Se{constructor(e){super('<div class="ag-unselectable" role="presentation"></div>'),this.horizontal=e,this.state=Ps.STATE_NOT_DRAGGING,this.guiDestroyFunctions=[],this.childPillComponents=[],this.resizeEnabled=!1,this.addElementClasses(this.getGui()),this.ePillDropList=document.createElement("div"),this.addElementClasses(this.ePillDropList,"list"),yt(this.ePillDropList,"listbox")}isHorizontal(){return this.horizontal}toggleResizable(e){this.positionableFeature.setResizable(e?{bottom:!0}:!1),this.resizeEnabled=e}isSourceEventFromTarget(e){const{dropZoneTarget:t,dragSource:s}=e;return t.contains(s.eElement)}destroy(){this.destroyGui(),super.destroy()}destroyGui(){this.guiDestroyFunctions.forEach(e=>e()),this.guiDestroyFunctions.length=0,this.childPillComponents.length=0,Rt(this.getGui()),Rt(this.ePillDropList)}init(e){this.params=e??{},this.createManagedBean(new Dr(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.setupDropTarget(),this.positionableFeature=new On(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature),this.refreshGui(),Gi(this.ePillDropList,this.getAriaLabel())}handleKeyDown(e){const t=!this.horizontal;let s=e.key===k.DOWN,r=e.key===k.UP;if(!t){const n=this.gos.get("enableRtl");s=!n&&e.key===k.RIGHT||n&&e.key===k.LEFT,r=!n&&e.key===k.LEFT||n&&e.key===k.RIGHT}if(!s&&!r)return;const o=this.focusService.findNextFocusableElement(this.getFocusableElement(),!1,r);o&&(e.preventDefault(),o.focus())}addElementClasses(e,t){t=t?`-${t}`:"";const s=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop${t}`,`ag-column-drop-${s}${t}`)}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(e){const t=this.getNewInsertIndex(e);if(t<0)return!1;const s=this.minimumAllowedNewInsertIndex(),r=Math.max(s,t),o=r!==this.insertIndex;return o&&(this.insertIndex=r),o}getNewInsertIndex(e){const t=e.event,s=this.horizontal?t.clientX:t.clientY,r=this.childPillComponents.map(n=>n.getGui().getBoundingClientRect()),o=r.findIndex(n=>this.horizontal?n.right>s&&n.left<s:n.top<s&&n.bottom>s);if(o===-1){const n=this.gos.get("enableRtl");return r.every(u=>s>(this.horizontal?u.right:u.bottom))?n&&this.horizontal?0:this.childPillComponents.length:r.every(u=>s<(this.horizontal?u.left:u.top))?n&&this.horizontal?this.childPillComponents.length:0:this.insertIndex}return this.insertIndex<=o?o+1:o}checkDragStartedBySelf(e){this.state===Ps.STATE_NOT_DRAGGING&&(this.state=Ps.STATE_REARRANGE_ITEMS,this.potentialDndItems=this.getItems(e.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(e),this.refreshGui())}onDragging(e){this.checkDragStartedBySelf(e),this.checkInsertIndex(e)&&this.refreshGui()}handleDragEnterEnd(e){}onDragEnter(e){const t=this.getItems(e.dragSource.getDragItem());this.state=Ps.STATE_NEW_ITEMS_IN;const s=t.filter(o=>this.isItemDroppable(o,e)),r=s.every(o=>this.childPillComponents.map(n=>n.getItem()).indexOf(o)!==-1);if(s.length!==0){if(this.potentialDndItems=s,r){this.state=Ps.STATE_NOT_DRAGGING;return}this.handleDragEnterEnd(e),this.checkInsertIndex(e),this.refreshGui()}}isPotentialDndItems(){return bm(this.potentialDndItems)}handleDragLeaveEnd(e){}onDragLeave(e){if(this.state===Ps.STATE_REARRANGE_ITEMS){const t=this.getItems(e.dragSource.getDragItem());this.removeItems(t)}this.isPotentialDndItems()&&(this.handleDragLeaveEnd(e),this.potentialDndItems=[],this.refreshGui()),this.state=Ps.STATE_NOT_DRAGGING}refreshOnDragStop(){return!0}onDragStop(){if(this.isPotentialDndItems()){let e=!1;this.state===Ps.STATE_NEW_ITEMS_IN?(this.addItems(this.potentialDndItems),e=!0):e=this.rearrangeItems(this.potentialDndItems),this.potentialDndItems=[],(this.refreshOnDragStop()||!e)&&this.refreshGui()}this.state=Ps.STATE_NOT_DRAGGING}removeItems(e){const t=this.getExistingItems().filter(s=>!ki(e,s));this.updateItems(t)}addItems(e){if(!e)return;const t=this.getExistingItems().slice(),s=e.filter(r=>t.indexOf(r)<0);Ac(t,s,this.insertIndex),this.updateItems(t)}addItem(e){this.insertIndex=this.getExistingItems().length,this.addItems([e]),this.refreshGui()}rearrangeItems(e){const t=this.getNonGhostItems().slice();return Ac(t,e,this.insertIndex),Ts(t,this.getExistingItems())?!1:(this.updateItems(t),!0)}refreshGui(){const e=this.ePillDropList.scrollTop,t=this.resizeEnabled,s=this.getFocusedItem();let r=this.focusService.findNextFocusableElement();r||(r=this.focusService.findNextFocusableElement(void 0,!1,!0)),this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),this.isHorizontal()||(this.ePillDropList.scrollTop=e),t&&this.toggleResizable(t),this.focusService.isKeyboardMode()&&this.restoreFocus(s,r)}getFocusedItem(){const e=this.getGui(),t=this.gos.getActiveDomElement();return e.contains(t)?Array.from(e.querySelectorAll(".ag-column-drop-cell")).indexOf(t):-1}restoreFocus(e,t){const s=this.getGui(),r=Array.from(s.querySelectorAll(".ag-column-drop-cell"));if(e===-1)return;r.length===0&&t.focus();const o=Math.min(r.length-1,e),n=r[o];n&&n.focus()}focusList(e){const t=e?this.childPillComponents.length-1:0;this.restoreFocus(t,this.getFocusableElement())}getNonGhostItems(){const e=this.getExistingItems();return this.isPotentialDndItems()?e.filter(t=>!ki(this.potentialDndItems,t)):e}addItemsToGui(){const t=this.getNonGhostItems().map(s=>this.createItemComponent(s,!1));if(this.isPotentialDndItems()){const s=this.potentialDndItems.map(r=>this.createItemComponent(r,!0));this.insertIndex>=t.length?t.push(...s):t.splice(this.insertIndex,0,...s)}this.appendChild(this.ePillDropList),t.forEach((s,r)=>{r>0&&this.addArrow(this.ePillDropList),this.ePillDropList.appendChild(s.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){this.childPillComponents.forEach((e,t)=>{const s=e.getGui();Bh(s,t+1),Hh(s,this.childPillComponents.length)})}createItemComponent(e,t){const s=this.createPillComponent(e,this.dropTarget,t,this.horizontal);return s.addEventListener(x_.EVENT_COLUMN_REMOVE,this.removeItems.bind(this,[e])),this.context.createBean(s),this.guiDestroyFunctions.push(()=>this.destroyBean(s)),t||this.childPillComponents.push(s),s}addIconAndTitleToGui(){const{title:e,icon:t}=this.params;if(!e||!t)return;const s=document.createElement("div");if(_l(s,!0),this.addElementClasses(s,"title-bar"),this.addElementClasses(t,"icon"),this.addOrRemoveCssClass("ag-column-drop-empty",this.isExistingItemsEmpty()),s.appendChild(t),!this.horizontal){const r=document.createElement("span");this.addElementClasses(r,"title"),r.innerHTML=e,s.appendChild(r)}this.appendChild(s)}isExistingItemsEmpty(){return this.getExistingItems().length===0}addEmptyMessageToGui(){const{emptyMessage:e}=this.params;if(!e||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;const t=document.createElement("span");t.innerHTML=e,this.addElementClasses(t,"empty-message"),this.ePillDropList.appendChild(t)}addArrow(e){if(this.horizontal){const t=this.gos.get("enableRtl"),s=dt(t?"smallLeft":"smallRight",this.gos);this.addElementClasses(s,"cell-separator"),e.appendChild(s)}}};Gl.STATE_NOT_DRAGGING="notDragging";Gl.STATE_NEW_ITEMS_IN="newItemsIn";Gl.STATE_REARRANGE_ITEMS="rearrangeItems";g([R("focusService")],Gl.prototype,"focusService",2);g([R("dragAndDropService")],Gl.prototype,"dragAndDropService",2);var R_=["touchstart","touchend","touchmove","touchcancel"],OC=class{constructor(i="javascript"){this.frameworkName=i,this.renderingEngine="vanilla",this.wrapIncoming=e=>e(),this.wrapOutgoing=e=>e()}setInterval(i,e){return new Lt(t=>{t(window.setInterval(i,e))})}addEventListener(i,e,t,s){const r=ki(R_,e);i.addEventListener(e,t,{capture:!!s,passive:r})}get shouldWrapOutgoing(){return!1}frameworkComponent(i){return null}isFrameworkComponent(i){return!1}getDocLink(i){return`https://www.ag-grid.com/${this.frameworkName==="solid"?"react":this.frameworkName}-data-grid${i?`/${i}`:""}`}},br=class extends Z{getNextCellToFocus(i,e,t=!1){return t?this.getNextCellToFocusWithCtrlPressed(i,e):this.getNextCellToFocusWithoutCtrlPressed(i,e)}getNextCellToFocusWithCtrlPressed(i,e){const t=i===k.UP,s=i===k.DOWN,r=i===k.LEFT;let o,n;if(t||s)n=t?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow(),o=e.column;else{const a=this.columnModel.getAllDisplayedColumns(),l=this.gos.get("enableRtl");n=e.rowIndex,o=r!==l?a[0]:We(a)}return{rowIndex:n,rowPinned:null,column:o}}getNextCellToFocusWithoutCtrlPressed(i,e){let t=e,s=!1;for(;!s;){switch(i){case k.UP:t=this.getCellAbove(t);break;case k.DOWN:t=this.getCellBelow(t);break;case k.RIGHT:this.gos.get("enableRtl")?t=this.getCellToLeft(t):t=this.getCellToRight(t);break;case k.LEFT:this.gos.get("enableRtl")?t=this.getCellToRight(t):t=this.getCellToLeft(t);break;default:t=null,console.warn("AG Grid: unknown key for navigation "+i);break}t?s=this.isCellGoodToFocusOn(t):s=!0}return t}isCellGoodToFocusOn(i){const e=i.column;let t;switch(i.rowPinned){case"top":t=this.pinnedRowModel.getPinnedTopRow(i.rowIndex);break;case"bottom":t=this.pinnedRowModel.getPinnedBottomRow(i.rowIndex);break;default:t=this.rowModel.getRow(i.rowIndex);break}return t?!e.isSuppressNavigable(t):!1}getCellToLeft(i){if(!i)return null;const e=this.columnModel.getDisplayedColBefore(i.column);return e?{rowIndex:i.rowIndex,column:e,rowPinned:i.rowPinned}:null}getCellToRight(i){if(!i)return null;const e=this.columnModel.getDisplayedColAfter(i.column);return e?{rowIndex:i.rowIndex,column:e,rowPinned:i.rowPinned}:null}getRowBelow(i){const e=i.rowIndex,t=i.rowPinned;if(this.isLastRowInContainer(i))switch(t){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(i.rowIndex),r=this.getNextStickyPosition(s);return r||{rowIndex:e+1,rowPinned:t}}getNextStickyPosition(i,e){if(!this.gos.isGroupRowsSticky()||!i||!i.sticky)return;const t=this.rowRenderer.getStickyTopRowCtrls().some(a=>a.getRowNode().rowIndex===i.rowIndex);let s=[];t?s=[...this.rowRenderer.getStickyTopRowCtrls()].sort((a,l)=>a.getRowNode().rowIndex-l.getRowNode().rowIndex):s=[...this.rowRenderer.getStickyBottomRowCtrls()].sort((a,l)=>l.getRowNode().rowIndex-a.getRowNode().rowIndex);const r=e?-1:1,o=s.findIndex(a=>a.getRowNode().rowIndex===i.rowIndex),n=s[o+r];if(n)return{rowIndex:n.getRowNode().rowIndex,rowPinned:null}}getCellBelow(i){if(!i)return null;const e=this.getRowBelow(i);return e?{rowIndex:e.rowIndex,column:i.column,rowPinned:e.rowPinned}:null}isLastRowInContainer(i){const e=i.rowPinned,t=i.rowIndex;return e==="top"?this.pinnedRowModel.getPinnedTopRowData().length-1<=t:e==="bottom"?this.pinnedRowModel.getPinnedBottomRowData().length-1<=t:this.paginationProxy.getPageLastRow()<=t}getRowAbove(i){const e=i.rowIndex,t=i.rowPinned;if(t?e===0:e===this.paginationProxy.getPageFirstRow())return t==="top"?null:t?this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null:this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const r=this.rowModel.getRow(i.rowIndex),o=this.getNextStickyPosition(r,!0);return o||{rowIndex:e-1,rowPinned:t}}getCellAbove(i){if(!i)return null;const e=this.getRowAbove({rowIndex:i.rowIndex,rowPinned:i.rowPinned});return e?{rowIndex:e.rowIndex,column:i.column,rowPinned:e.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.paginationProxy.getPageLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowData().length-1,rowPinned:"top"}}getNextTabbedCell(i,e){return e?this.getNextTabbedCellBackwards(i):this.getNextTabbedCellForwards(i)}getNextTabbedCellForwards(i){const e=this.columnModel.getAllDisplayedColumns();let t=i.rowIndex,s=i.rowPinned,r=this.columnModel.getDisplayedColAfter(i.column);if(!r){r=e[0];const o=this.getRowBelow(i);if(be(o)||!o.rowPinned&&!this.paginationProxy.isRowInPage(o))return null;t=o?o.rowIndex:null,s=o?o.rowPinned:null}return{rowIndex:t,column:r,rowPinned:s}}getNextTabbedCellBackwards(i){const e=this.columnModel.getAllDisplayedColumns();let t=i.rowIndex,s=i.rowPinned,r=this.columnModel.getDisplayedColBefore(i.column);if(!r){r=We(e);const o=this.getRowAbove({rowIndex:i.rowIndex,rowPinned:i.rowPinned});if(be(o)||!o.rowPinned&&!this.paginationProxy.isRowInPage(o))return null;t=o?o.rowIndex:null,s=o?o.rowPinned:null}return{rowIndex:t,column:r,rowPinned:s}}};g([R("columnModel")],br.prototype,"columnModel",2);g([R("rowModel")],br.prototype,"rowModel",2);g([R("rowRenderer")],br.prototype,"rowRenderer",2);g([R("pinnedRowModel")],br.prototype,"pinnedRowModel",2);g([R("paginationProxy")],br.prototype,"paginationProxy",2);br=g([le("cellNavigationService")],br);var go=class extends Z{constructor(){super(...arguments),this.consuming=!1}setBeans(i){this.logger=i.create("AlignedGridsService")}getAlignedGridApis(){var i;let e=(i=this.gos.get("alignedGrids"))!=null?i:[];const t=typeof e=="function";typeof e=="function"&&(e=e());const s=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return e.map(o=>{var n;if(!o){Zr("alignedGrids contains an undefined option."),t||Zr(`You may want to configure via a callback to avoid setup race conditions:
"alignedGrids: () => [linkedGrid]"`),Zr(s());return}if(o instanceof Ne)return o;const a=o;return"current"in a?(n=a.current)==null?void 0:n.api:(a.api||Zr(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${s()}`),a.api)}).filter(o=>!!o&&!o.isDestroyed())}init(){this.addManagedListener(this.eventService,b.EVENT_COLUMN_MOVED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,b.EVENT_COLUMN_VISIBLE,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,b.EVENT_COLUMN_PINNED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,b.EVENT_COLUMN_GROUP_OPENED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,b.EVENT_COLUMN_RESIZED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,b.EVENT_BODY_SCROLL,this.fireScrollEvent.bind(this))}fireEvent(i){this.consuming||this.getAlignedGridApis().forEach(e=>{if(e.isDestroyed())return;const t=e.__getAlignedGridService();i(t)})}onEvent(i){this.consuming=!0,i(),this.consuming=!1}fireColumnEvent(i){this.fireEvent(e=>{e.onColumnEvent(i)})}fireScrollEvent(i){i.direction==="horizontal"&&this.fireEvent(e=>{e.onScrollEvent(i)})}onScrollEvent(i){this.onEvent(()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(i.left,!0)})}getMasterColumns(i){const e=[];return i.columns?i.columns.forEach(t=>{e.push(t)}):i.column&&e.push(i.column),e}getColumnIds(i){const e=[];return i.columns?i.columns.forEach(t=>{e.push(t.getColId())}):i.column&&e.push(i.column.getColId()),e}onColumnEvent(i){this.onEvent(()=>{switch(i.type){case b.EVENT_COLUMN_MOVED:case b.EVENT_COLUMN_VISIBLE:case b.EVENT_COLUMN_PINNED:case b.EVENT_COLUMN_RESIZED:const e=i;this.processColumnEvent(e);break;case b.EVENT_COLUMN_GROUP_OPENED:const t=i;this.processGroupOpenedEvent(t);break;case b.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.");break}})}processGroupOpenedEvent(i){i.columnGroups.forEach(e=>{let t=null;if(e){const s=e.getGroupId();t=this.columnModel.getProvidedColumnGroup(s)}e&&!t||(this.logger.log("onColumnEvent-> processing "+i+" expanded = "+e.isExpanded()),this.columnModel.setColumnGroupOpened(t,e.isExpanded(),"alignedGridChanged"))})}processColumnEvent(i){var e;const t=i.column;let s=null;if(t&&(s=this.columnModel.getPrimaryColumn(t.getColId())),t&&!s)return;const r=this.getMasterColumns(i);switch(i.type){case b.EVENT_COLUMN_MOVED:{const u=i,d=i.api.getColumnState().map(c=>({colId:c.colId}));this.columnModel.applyColumnState({state:d,applyOrder:!0},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${i.type} toIndex = ${u.toIndex}`)}break;case b.EVENT_COLUMN_VISIBLE:{const u=i,d=i.api.getColumnState().map(c=>({colId:c.colId,hide:c.hide}));this.columnModel.applyColumnState({state:d},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${i.type} visible = ${u.visible}`)}break;case b.EVENT_COLUMN_PINNED:{const u=i,d=i.api.getColumnState().map(c=>({colId:c.colId,pinned:c.pinned}));this.columnModel.applyColumnState({state:d},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${i.type} pinned = ${u.pinned}`)}break;case b.EVENT_COLUMN_RESIZED:const a=i,l={};r.forEach(u=>{this.logger.log(`onColumnEvent-> processing ${i.type} actualWidth = ${u.getActualWidth()}`),l[u.getId()]={key:u.getColId(),newWidth:u.getActualWidth()}}),(e=a.flexColumns)==null||e.forEach(u=>{l[u.getId()]&&delete l[u.getId()]}),this.columnModel.setColumnWidths(Object.values(l),!1,a.finished,"alignedGridChanged");break}const n=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach(a=>{a.setGridOption("alwaysShowVerticalScroll",n)})}};g([R("columnModel")],go.prototype,"columnModel",2);g([R("ctrlsService")],go.prototype,"ctrlsService",2);g([gs(0,Ki("loggerFactory"))],go.prototype,"setBeans",1);g([J],go.prototype,"init",1);go=g([le("alignedGridsService")],go);var fo=class extends Z{constructor(){super(...arguments),this.selectedNodes=new Map,this.lastRowNode=null}init(){this.rowSelection=this.gos.get("rowSelection"),this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],()=>{this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.rowSelection=this.gos.get("rowSelection"),this.deselectAllRowNodes({source:"api"})}),this.addManagedListener(this.eventService,b.EVENT_ROW_SELECTED,this.onRowSelected.bind(this))}destroy(){super.destroy(),this.resetNodes(),this.lastRowNode=null}isMultiselect(){return this.rowSelection==="multiple"}setNodesSelected(i){var e;const{newValue:t,clearSelection:s,suppressFinishActions:r,rangeSelect:o,nodes:n,event:a,source:l="api"}=i;if(n.length===0)return 0;if(n.length>1&&!this.isMultiselect())return console.warn("AG Grid: cannot multi select while rowSelection='single'"),0;const u=this.groupSelectsChildren&&i.groupSelectsFiltered===!0,h=n.map(c=>c.footer?c.sibling:c);if(o){if(n.length>1)return console.warn("AG Grid: cannot range select while selecting multiple rows"),0;let c=null;if(l==="checkboxSelected"&&t===!1&&this.lastRowNode&&(this.lastRowNode.id?c=this.lastRowNode:this.lastRowNode=null),c==null&&(c=this.getLastSelectedNode()),c){const p=h[0];if(p!==c&&this.isMultiselect())return this.selectRange(p,c,t,l)}}this.lastRowNode=t?null:h[0];let d=0;for(let c=0;c<h.length;c++){const p=h[c];u&&p.group||p.selectThisNode(t,a,l)&&d++,this.groupSelectsChildren&&((e=p.childrenAfterGroup)!=null&&e.length)&&(d+=this.selectChildren(p,t,u,l))}if(!r&&(t&&(s||!this.isMultiselect())&&(d+=this.clearOtherNodes(h[0],l)),d>0)){this.updateGroupsFromChildrenSelections(l);const p={type:b.EVENT_SELECTION_CHANGED,source:l};this.eventService.dispatchEvent(p)}return d}selectRange(i,e,t=!0,s){const r=this.rowModel.getNodesInRangeForSelection(i,e);let o=0;r.forEach(a=>{if(a.group&&this.groupSelectsChildren)return;a.selectThisNode(t,void 0,s)&&o++}),this.updateGroupsFromChildrenSelections(s);const n={type:b.EVENT_SELECTION_CHANGED,source:s};return this.eventService.dispatchEvent(n),o}selectChildren(i,e,t,s){const r=t?i.childrenAfterAggFilter:i.childrenAfterGroup;return be(r)?0:this.setNodesSelected({newValue:e,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:t,source:s,nodes:r})}getLastSelectedNode(){const i=Array.from(this.selectedNodes.keys());if(i.length==0)return null;const e=this.selectedNodes.get(We(i));return e||null}getSelectedNodes(){const i=[];return this.selectedNodes.forEach(e=>{e&&i.push(e)}),i}getSelectedRows(){const i=[];return this.selectedNodes.forEach(e=>{e&&e.data&&i.push(e.data)}),i}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(i){const e=new Map;this.selectedNodes.forEach((t,s)=>{t&&i(t)&&e.set(s,t)}),this.selectedNodes=e}updateGroupsFromChildrenSelections(i,e){if(!this.groupSelectsChildren||this.rowModel.getType()!=="clientSide")return!1;const s=this.rowModel.getRootNode();e||(e=new dd(!0,s),e.setInactive());let r=!1;return e.forEachChangedNodeDepthFirst(o=>{if(o!==s){const n=o.calculateSelectedFromChildren();r=o.selectThisNode(n===null?!1:n,void 0,i)||r}}),r}clearOtherNodes(i,e){const t=new Map;let s=0;return this.selectedNodes.forEach(r=>{if(r&&r.id!==i.id){const o=this.selectedNodes.get(r.id);s+=o.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:e}),this.groupSelectsChildren&&r.parent&&t.set(r.parent.id,r.parent)}}),t.forEach(r=>{const o=r.calculateSelectedFromChildren();r.selectThisNode(o===null?!1:o,void 0,e)}),s}onRowSelected(i){const e=i.node;this.groupSelectsChildren&&e.group||(e.isSelected()?this.selectedNodes.set(e.id,e):this.selectedNodes.delete(e.id))}syncInRowNode(i,e){this.syncInOldRowNode(i,e),this.syncInNewRowNode(i)}syncInOldRowNode(i,e){if(K(e)&&i.id!==e.id&&e){const s=e.id;this.selectedNodes.get(s)==i&&this.selectedNodes.set(e.id,e)}}syncInNewRowNode(i){this.selectedNodes.has(i.id)?(i.setSelectedInitialValue(!0),this.selectedNodes.set(i.id,i)):i.setSelectedInitialValue(!1)}reset(i){const e=this.getSelectionCount();if(this.resetNodes(),e){const t={type:b.EVENT_SELECTION_CHANGED,source:i};this.eventService.dispatchEvent(t)}}resetNodes(){var i;(i=this.selectedNodes)==null||i.clear()}getBestCostNodeSelection(){if(this.rowModel.getType()!=="clientSide")return;const e=this.rowModel.getTopLevelNodes();if(e===null)return;const t=[];function s(r){for(let o=0,n=r.length;o<n;o++){const a=r[o];if(a.isSelected())t.push(a);else{const l=a;l.group&&l.children&&s(l.children)}}}return s(e),t}isEmpty(){let i=0;return this.selectedNodes.forEach(e=>{e&&i++}),i===0}deselectAllRowNodes(i){const e=a=>a.selectThisNode(!1,void 0,s),t=this.rowModel.getType()==="clientSide",{source:s,justFiltered:r,justCurrentPage:o}=i;if(o||r){if(!t){console.error("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'");return}this.getNodesToSelect(r,o).forEach(e)}else this.selectedNodes.forEach(a=>{a&&e(a)}),this.reset(s);t&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(s);const n={type:b.EVENT_SELECTION_CHANGED,source:s};this.eventService.dispatchEvent(n)}getSelectedCounts(i,e){let t=0,s=0;const r=o=>{this.groupSelectsChildren&&o.group||(o.isSelected()?t++:o.selectable&&s++)};return this.getNodesToSelect(i,e).forEach(r),{selectedCount:t,notSelectedCount:s}}getSelectAllState(i,e){const{selectedCount:t,notSelectedCount:s}=this.getSelectedCounts(i,e);return t===0&&s===0?!1:t>0&&s>0?null:t>0}hasNodesToSelect(i=!1,e=!1){return this.getNodesToSelect(i,e).filter(t=>t.selectable).length>0}getNodesToSelect(i=!1,e=!1){if(this.rowModel.getType()!=="clientSide")throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const t=[];if(e)return this.paginationProxy.forEachNodeOnPage(r=>{if(!r.group){t.push(r);return}if(!r.expanded){const o=n=>{var a;t.push(n),(a=n.childrenAfterFilter)!=null&&a.length&&n.childrenAfterFilter.forEach(o)};o(r);return}this.groupSelectsChildren||t.push(r)}),t;const s=this.rowModel;return i?(s.forEachNodeAfterFilter(r=>{t.push(r)}),t):(s.forEachNode(r=>{t.push(r)}),t)}selectAllRowNodes(i){if(this.rowModel.getType()!=="clientSide")throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const{source:e,justFiltered:t,justCurrentPage:s}=i,r=n=>n.selectThisNode(!0,void 0,e);this.getNodesToSelect(t,s).forEach(r),this.rowModel.getType()==="clientSide"&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(e);const o={type:b.EVENT_SELECTION_CHANGED,source:e};this.eventService.dispatchEvent(o)}getSelectionState(){const i=[];return this.selectedNodes.forEach(e=>{e?.id&&i.push(e.id)}),i.length?i:null}setSelectionState(i,e){if(!Array.isArray(i))return;const t=new Set(i),s=[];this.rowModel.forEachNode(r=>{t.has(r.id)&&s.push(r)}),this.setNodesSelected({newValue:!0,nodes:s,source:e})}};g([R("rowModel")],fo.prototype,"rowModel",2);g([R("paginationProxy")],fo.prototype,"paginationProxy",2);g([J],fo.prototype,"init",1);fo=g([le("selectionService")],fo);var wn=class{constructor(i){this.viaApi=(e,...t)=>(fe(`Since v31, 'columnApi.${e}' is deprecated and moved to 'api.${e}'.`),this.api[e](...t)),this.api=i}sizeColumnsToFit(i){this.viaApi("sizeColumnsToFit",i)}setColumnGroupOpened(i,e){this.viaApi("setColumnGroupOpened",i,e)}getColumnGroup(i,e){return this.viaApi("getColumnGroup",i,e)}getProvidedColumnGroup(i){return this.viaApi("getProvidedColumnGroup",i)}getDisplayNameForColumn(i,e){return this.viaApi("getDisplayNameForColumn",i,e)}getDisplayNameForColumnGroup(i,e){return this.viaApi("getDisplayNameForColumnGroup",i,e)}getColumn(i){return this.viaApi("getColumn",i)}getColumns(){return this.viaApi("getColumns")}applyColumnState(i){return this.viaApi("applyColumnState",i)}getColumnState(){return this.viaApi("getColumnState")}resetColumnState(){this.viaApi("resetColumnState")}getColumnGroupState(){return this.viaApi("getColumnGroupState")}setColumnGroupState(i){this.viaApi("setColumnGroupState",i)}resetColumnGroupState(){this.viaApi("resetColumnGroupState")}isPinning(){return this.viaApi("isPinning")}isPinningLeft(){return this.viaApi("isPinningLeft")}isPinningRight(){return this.viaApi("isPinningRight")}getDisplayedColAfter(i){return this.viaApi("getDisplayedColAfter",i)}getDisplayedColBefore(i){return this.viaApi("getDisplayedColBefore",i)}setColumnVisible(i,e){this.viaApi("setColumnVisible",i,e)}setColumnsVisible(i,e){this.viaApi("setColumnsVisible",i,e)}setColumnPinned(i,e){this.viaApi("setColumnPinned",i,e)}setColumnsPinned(i,e){this.viaApi("setColumnsPinned",i,e)}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(i,e){this.viaApi("moveColumn",i,e)}moveColumnByIndex(i,e){this.viaApi("moveColumnByIndex",i,e)}moveColumns(i,e){this.viaApi("moveColumns",i,e)}moveRowGroupColumn(i,e){this.viaApi("moveRowGroupColumn",i,e)}setColumnAggFunc(i,e){this.viaApi("setColumnAggFunc",i,e)}setColumnWidth(i,e,t=!0,s){this.viaApi("setColumnWidth",i,e,t,s)}setColumnWidths(i,e=!0,t){this.viaApi("setColumnWidths",i,e,t)}setPivotMode(i){this.viaApi("setPivotMode",i)}isPivotMode(){return this.viaApi("isPivotMode")}getPivotResultColumn(i,e){return this.viaApi("getPivotResultColumn",i,e)}setValueColumns(i){this.viaApi("setValueColumns",i)}getValueColumns(){return this.viaApi("getValueColumns")}removeValueColumn(i){this.viaApi("removeValueColumn",i)}removeValueColumns(i){this.viaApi("removeValueColumns",i)}addValueColumn(i){this.viaApi("addValueColumn",i)}addValueColumns(i){this.viaApi("addValueColumns",i)}setRowGroupColumns(i){this.viaApi("setRowGroupColumns",i)}removeRowGroupColumn(i){this.viaApi("removeRowGroupColumn",i)}removeRowGroupColumns(i){this.viaApi("removeRowGroupColumns",i)}addRowGroupColumn(i){this.viaApi("addRowGroupColumn",i)}addRowGroupColumns(i){this.viaApi("addRowGroupColumns",i)}getRowGroupColumns(){return this.viaApi("getRowGroupColumns")}setPivotColumns(i){this.viaApi("setPivotColumns",i)}removePivotColumn(i){this.viaApi("removePivotColumn",i)}removePivotColumns(i){this.viaApi("removePivotColumns",i)}addPivotColumn(i){this.viaApi("addPivotColumn",i)}addPivotColumns(i){this.viaApi("addPivotColumns",i)}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(i,e){return this.viaApi("autoSizeColumn",i,e)}autoSizeColumns(i,e){this.viaApi("autoSizeColumns",i,e)}autoSizeAllColumns(i){this.viaApi("autoSizeAllColumns",i)}setPivotResultColumns(i){this.viaApi("setPivotResultColumns",i)}getPivotResultColumns(){return this.viaApi("getPivotResultColumns")}};g([R("gridApi")],wn.prototype,"api",2);wn=g([le("columnApi")],wn);var Sr=class extends Z{constructor(){super(...arguments),this.initialised=!1,this.isSsrm=!1}init(){this.isSsrm=this.gos.isRowModelType("serverSide"),this.cellExpressions=this.gos.get("enableCellExpressions"),this.isTreeData=this.gos.get("treeData"),this.initialised=!0;const i=t=>this.callColumnCellValueChangedHandler(t),e=this.gos.useAsyncEvents();this.eventService.addEventListener(b.EVENT_CELL_VALUE_CHANGED,i,e),this.addDestroyFunc(()=>this.eventService.removeEventListener(b.EVENT_CELL_VALUE_CHANGED,i,e)),this.addManagedPropertyListener("treeData",t=>this.isTreeData=t.currentValue)}getValue(i,e,t=!1,s=!1){if(this.initialised||this.init(),!e)return;const r=i.getColDef(),o=r.field,n=i.getColId(),a=e.data;let l;const u=e.groupData&&e.groupData[n]!==void 0,h=!s&&e.aggData&&e.aggData[n]!==void 0,d=this.isSsrm&&s&&!!i.getColDef().aggFunc,c=this.isSsrm&&e.footer&&e.field&&(i.getColDef().showRowGroup===!0||i.getColDef().showRowGroup===e.field);if(t&&r.filterValueGetter?l=this.executeFilterValueGetter(r.filterValueGetter,a,i,e):this.isTreeData&&h?l=e.aggData[n]:this.isTreeData&&r.valueGetter?l=this.executeValueGetter(r.valueGetter,a,i,e):this.isTreeData&&o&&a?l=an(a,o,i.isFieldContainsDots()):u?l=e.groupData[n]:h?l=e.aggData[n]:r.valueGetter?l=this.executeValueGetter(r.valueGetter,a,i,e):c?l=an(a,e.field,i.isFieldContainsDots()):o&&a&&!d&&(l=an(a,o,i.isFieldContainsDots())),this.cellExpressions&&typeof l=="string"&&l.indexOf("=")===0){const p=l.substring(1);l=this.executeValueGetter(p,a,i,e)}if(l==null){const p=this.getOpenedGroup(e,i);if(p!=null)return p}return l}parseValue(i,e,t,s){const r=i.getColDef(),o=this.gos.addGridCommonParams({node:e,data:e?.data,oldValue:s,newValue:t,colDef:r,column:i}),n=r.valueParser;return K(n)?typeof n=="function"?n(o):this.expressionService.evaluate(n,o):t}formatValue(i,e,t,s,r=!0){let o=null,n;const a=i.getColDef();if(s?n=s:r&&(n=a.valueFormatter),n){const l=this.gos.addGridCommonParams({value:t,node:e,data:e?e.data:null,colDef:a,column:i});typeof n=="function"?o=n(l):o=this.expressionService.evaluate(n,l)}else if(a.refData)return a.refData[t]||"";return o==null&&Array.isArray(t)&&(o=t.join(", ")),o}getOpenedGroup(i,e){if(!this.gos.get("showOpenedGroup")||!e.getColDef().showRowGroup)return;const s=e.getColDef().showRowGroup;let r=i.parent;for(;r!=null;){if(r.rowGroupColumn&&(s===!0||s===r.rowGroupColumn.getColId()))return r.key;r=r.parent}}setValue(i,e,t,s){const r=this.columnModel.getPrimaryColumn(e);if(!i||!r)return!1;be(i.data)&&(i.data={});const{field:o,valueSetter:n}=r.getColDef();if(be(o)&&be(n))return console.warn("AG Grid: you need either field or valueSetter set on colDef for editing to work"),!1;if(!this.dataTypeService.checkType(r,t))return console.warn("AG Grid: Data type of the new value does not match the cell data type of the column"),!1;const a=this.gos.addGridCommonParams({node:i,data:i.data,oldValue:this.getValue(r,i),newValue:t,colDef:r.getColDef(),column:r});a.newValue=t;let l;if(K(n)?typeof n=="function"?l=n(a):l=this.expressionService.evaluate(n,a):l=this.setValueUsingField(i.data,o,t,r.isFieldContainsDots()),l===void 0&&(l=!0),!l)return!1;i.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),a.newValue=this.getValue(r,i);const u={type:b.EVENT_CELL_VALUE_CHANGED,event:null,rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:a.column,api:a.api,columnApi:a.columnApi,colDef:a.colDef,context:a.context,data:i.data,node:i,oldValue:a.oldValue,newValue:a.newValue,value:a.newValue,source:s};return this.eventService.dispatchEvent(u),!0}callColumnCellValueChangedHandler(i){const e=i.colDef.onCellValueChanged;typeof e=="function"&&this.getFrameworkOverrides().wrapOutgoing(()=>{e({node:i.node,data:i.data,oldValue:i.oldValue,newValue:i.newValue,colDef:i.colDef,column:i.column,api:i.api,columnApi:i.columnApi,context:i.context})})}setValueUsingField(i,e,t,s){if(!e)return!1;let r=!1;if(!s)r=i[e]===t,r||(i[e]=t);else{const o=e.split(".");let n=i;for(;o.length>0&&n;){const a=o.shift();o.length===0?(r=n[a]===t,r||(n[a]=t)):n=n[a]}}return!r}executeFilterValueGetter(i,e,t,s){const r=this.gos.addGridCommonParams({data:e,node:s,column:t,colDef:t.getColDef(),getValue:this.getValueCallback.bind(this,s)});return typeof i=="function"?i(r):this.expressionService.evaluate(i,r)}executeValueGetter(i,e,t,s){const r=t.getColId(),o=this.valueCache.getValue(s,r);if(o!==void 0)return o;const n=this.gos.addGridCommonParams({data:e,node:s,column:t,colDef:t.getColDef(),getValue:this.getValueCallback.bind(this,s)});let a;return typeof i=="function"?a=i(n):a=this.expressionService.evaluate(i,n),this.valueCache.setValue(s,r,a),a}getValueCallback(i,e){const t=this.columnModel.getPrimaryColumn(e);return t?this.getValue(t,i):null}getKeyForNode(i,e){const t=this.getValue(i,e),s=i.getColDef().keyCreator;let r=t;if(s){const o=this.gos.addGridCommonParams({value:t,colDef:i.getColDef(),column:i,node:e,data:e.data});r=s(o)}return typeof r=="string"||r==null||(r=String(r),r==="[object Object]"&&fe("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")),r}};g([R("expressionService")],Sr.prototype,"expressionService",2);g([R("columnModel")],Sr.prototype,"columnModel",2);g([R("valueCache")],Sr.prototype,"valueCache",2);g([R("dataTypeService")],Sr.prototype,"dataTypeService",2);g([J],Sr.prototype,"init",1);Sr=g([le("valueService")],Sr);var ah=class extends Z{constructor(){super(...arguments),this.expressionToFunctionCache={}}setBeans(i){this.logger=i.create("ExpressionService")}evaluate(i,e){if(typeof i=="string")return this.evaluateExpression(i,e);console.error("AG Grid: value should be either a string or a function",i)}evaluateExpression(i,e){try{return this.createExpressionFunction(i)(e.value,e.context,e.oldValue,e.newValue,e.value,e.node,e.data,e.colDef,e.rowIndex,e.api,e.columnApi,e.getValue,e.column,e.columnGroup)}catch(t){return console.log("Processing of the expression failed"),console.log("Expression = "+i),console.log("Params =",e),console.log("Exception = "+t),null}}createExpressionFunction(i){if(this.expressionToFunctionCache[i])return this.expressionToFunctionCache[i];const e=this.createFunctionBody(i),t=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup",e);return this.expressionToFunctionCache[i]=t,t}createFunctionBody(i){return i.indexOf("return")>=0?i:"return "+i+";"}};g([gs(0,Ki("loggerFactory"))],ah.prototype,"setBeans",1);ah=g([le("expressionService")],ah);var lh=class extends Z{setBeans(i){this.logging=i.get("debug")}create(i){return new ag(i,this.isLogging.bind(this))}isLogging(){return this.logging}};g([gs(0,Ki("gridOptionsService"))],lh.prototype,"setBeans",1);lh=g([le("loggerFactory")],lh);var ag=class{constructor(i,e){this.name=i,this.isLoggingFunc=e}isLogging(){return this.isLoggingFunc()}log(i){this.isLoggingFunc()&&console.log("AG Grid."+this.name+": "+i)}},Lr=class extends Z{setComp(i,e,t){this.view=i,this.eGridHostDiv=e,this.eGui=t,this.eGui.setAttribute("grid-id",this.context.getGridId()),this.dragAndDropService.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:r=>r===1||r===0,getIconName:()=>Re.ICON_NOT_ALLOWED}),this.mouseEventService.stampTopLevelGridCompWithGridInstance(e),this.createManagedBean(new id(this.view)),this.addRtlSupport();const s=this.resizeObserverService.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>s()),this.ctrlsService.register("gridCtrl",this)}isDetailGrid(){var i;const e=this.focusService.findTabbableParent(this.getGui());return((i=e?.getAttribute("row-id"))==null?void 0:i.startsWith("detail"))||!1}showDropZones(){return ze.__isRegistered("@ag-grid-enterprise/row-grouping",this.context.getGridId())}showSideBar(){return ze.__isRegistered("@ag-grid-enterprise/side-bar",this.context.getGridId())}showStatusBar(){return ze.__isRegistered("@ag-grid-enterprise/status-bar",this.context.getGridId())}showWatermark(){return ze.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId())}onGridSizeChanged(){const i={type:b.EVENT_GRID_SIZE_CHANGED,clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight};this.eventService.dispatchEvent(i)}addRtlSupport(){const i=this.gos.get("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(i)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(i){this.view.setCursor(i?"ew-resize":null)}disableUserSelect(i){this.view.setUserSelect(i?"none":null)}focusNextInnerContainer(i){const e=this.view.getFocusableContainers(),t=this.gos.getActiveDomElement(),r=e.findIndex(o=>o.contains(t))+(i?-1:1);return r<=0||r>=e.length?!1:this.focusService.focusInto(e[r])}focusInnerElement(i){const e=this.view.getFocusableContainers(),t=this.columnModel.getAllDisplayedColumns();if(i){if(e.length>1)return this.focusService.focusInto(We(e),!0);const s=We(t);if(this.focusService.focusGridView(s,!0))return!0}if(this.gos.get("headerHeight")===0||this.gos.get("suppressHeaderFocus")){if(this.focusService.focusGridView(t[0]))return!0;for(let s=1;s<e.length;s++)if(this.focusService.focusInto(e[s]))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(i=!1){this.view.forceFocusOutOfContainer(i)}};g([R("focusService")],Lr.prototype,"focusService",2);g([R("resizeObserverService")],Lr.prototype,"resizeObserverService",2);g([R("columnModel")],Lr.prototype,"columnModel",2);g([R("ctrlsService")],Lr.prototype,"ctrlsService",2);g([R("mouseEventService")],Lr.prototype,"mouseEventService",2);g([R("dragAndDropService")],Lr.prototype,"dragAndDropService",2);var Vl=class extends Ol{constructor(e){super(),this.eGridDiv=e}postConstruct(){this.logger=this.loggerFactory.create("GridComp");const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:s=>this.addCssClass(s),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:s=>{this.getGui().style.userSelect=s??"",this.getGui().style.webkitUserSelect=s??""},setCursor:s=>{this.getGui().style.cursor=s??""}};this.ctrl=this.createManagedBean(new Lr);const t=this.createTemplate();this.setTemplate(t),this.ctrl.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:s=>this.ctrl.focusInnerElement(s),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 s=this.eRootWrapperBody.classList;s.toggle("ag-layout-auto-height",t.autoHeight),s.toggle("ag-layout-normal",t.normal),s.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(){const e=this.ctrl.showDropZones()?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":"",t=this.ctrl.showSideBar()?'<ag-side-bar ref="sideBar"></ag-side-bar>':"",s=this.ctrl.showStatusBar()?'<ag-status-bar ref="statusBar"></ag-status-bar>':"",r=this.ctrl.showWatermark()?"<ag-watermark></ag-watermark>":"";return`<div class="ag-root-wrapper" role="presentation">
${e}
<div class="ag-root-wrapper-body" ref="rootWrapperBody" role="presentation">
<ag-grid-body ref="gridBody"></ag-grid-body>
${t}
</div>
${s}
<ag-pagination></ag-pagination>
${r}
</div>`}getFocusableElement(){return this.eRootWrapperBody}getFocusableContainers(){const e=[this.gridBodyComp.getGui()];return this.sideBarComp&&e.push(this.sideBarComp.getGui()),e.filter(t=>Pi(t))}};g([R("loggerFactory")],Vl.prototype,"loggerFactory",2);g([te("gridBody")],Vl.prototype,"gridBodyComp",2);g([te("sideBar")],Vl.prototype,"sideBarComp",2);g([te("rootWrapperBody")],Vl.prototype,"eRootWrapperBody",2);g([J],Vl.prototype,"postConstruct",1);var mo=class extends Z{progressSort(i,e,t){const s=this.getNextSortDirection(i);this.setSortForColumn(i,s,e,t)}setSortForColumn(i,e,t,s){e!=="asc"&&e!=="desc"&&(e=null);const r=this.gos.isColumnsSortingCoupledToGroup();let o=[i];if(r&&i.getColDef().showRowGroup){const l=this.columnModel.getSourceColumnsForGroupColumn(i),u=l?.filter(h=>h.isSortable());u&&(o=[i,...u])}o.forEach(l=>l.setSort(e,s));const n=(t||this.gos.get("alwaysMultiSort"))&&!this.gos.get("suppressMultiSort"),a=[];if(!n){const l=this.clearSortBarTheseColumns(o,s);a.push(...l)}this.updateSortIndex(i),a.push(...o),this.dispatchSortChangedEvents(s,a)}updateSortIndex(i){const e=this.gos.isColumnsSortingCoupledToGroup(),t=this.columnModel.getGroupDisplayColumnForGroup(i.getId()),s=e&&t||i,r=this.getColumnsWithSortingOrdered();this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(a=>a.setSortIndex(null));const o=r.filter(a=>e&&a.getColDef().showRowGroup?!1:a!==s);(s.getSort()?[...o,s]:o).forEach((a,l)=>{a.setSortIndex(l)})}onSortChanged(i,e){this.dispatchSortChangedEvents(i,e)}isSortActive(){const e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(t=>!!t.getSort());return e&&e.length>0}dispatchSortChangedEvents(i,e){const t={type:b.EVENT_SORT_CHANGED,source:i};e&&(t.columns=e),this.eventService.dispatchEvent(t)}clearSortBarTheseColumns(i,e){const t=[];return this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(s=>{i.includes(s)||(s.getSort()&&t.push(s),s.setSort(void 0,e))}),t}getNextSortDirection(i){let e;if(i.getColDef().sortingOrder?e=i.getColDef().sortingOrder:this.gos.get("sortingOrder")?e=this.gos.get("sortingOrder"):e=mo.DEFAULT_SORTING_ORDER,!Array.isArray(e)||e.length<=0)return console.warn(`AG Grid: sortingOrder must be an array with at least one element, currently it's ${e}`),null;const t=e.indexOf(i.getSort()),s=t<0,r=t==e.length-1;let o;return s||r?o=e[0]:o=e[t+1],mo.DEFAULT_SORTING_ORDER.indexOf(o)<0?(console.warn("AG Grid: invalid sort type "+o),null):o}getIndexedSortMap(){let i=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(o=>!!o.getSort());if(this.columnModel.isPivotMode()){const o=this.gos.isColumnsSortingCoupledToGroup();i=i.filter(n=>{const a=!!n.getAggFunc(),l=!n.isPrimary(),u=o?this.columnModel.getGroupDisplayColumnForGroup(n.getId()):n.getColDef().showRowGroup;return a||l||u})}const e=this.columnModel.getRowGroupColumns().filter(o=>!!o.getSort()),t={};i.forEach((o,n)=>t[o.getId()]=n),i.sort((o,n)=>{const a=o.getSortIndex(),l=n.getSortIndex();if(a!=null&&l!=null)return a-l;if(a==null&&l==null){const u=t[o.getId()],h=t[n.getId()];return u>h?1:-1}else return l==null?-1:1});const s=this.gos.isColumnsSortingCoupledToGroup()&&!!e.length;s&&(i=[...new Set(i.map(o=>{var n;return(n=this.columnModel.getGroupDisplayColumnForGroup(o.getId()))!=null?n:o}))]);const r=new Map;return i.forEach((o,n)=>r.set(o,n)),s&&e.forEach(o=>{const n=this.columnModel.getGroupDisplayColumnForGroup(o.getId());r.set(o,r.get(n))}),r}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([i,e],[t,s])=>e-s).map(([i])=>i)}getSortModel(){return this.getColumnsWithSortingOrdered().filter(i=>i.getSort()).map(i=>({sort:i.getSort(),colId:i.getId()}))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter(i=>i.getSort()).map(i=>({sort:i.getSort(),column:i}))}canColumnDisplayMixedSort(i){const e=this.gos.isColumnsSortingCoupledToGroup(),t=!!i.getColDef().showRowGroup;return e&&t}getDisplaySortForColumn(i){const e=this.columnModel.getSourceColumnsForGroupColumn(i);if(!this.canColumnDisplayMixedSort(i)||!e?.length)return i.getSort();const s=i.getColDef().field!=null||!!i.getColDef().valueGetter?[i,...e]:e,r=s[0].getSort();return s.every(n=>n.getSort()==r)?r:"mixed"}getDisplaySortIndexForColumn(i){return this.getIndexedSortMap().get(i)}};mo.DEFAULT_SORTING_ORDER=["asc","desc",null];g([R("columnModel")],mo.prototype,"columnModel",2);mo=g([le("sortController")],mo);var qe=class extends Z{static addKeyboardModeEvents(i){this.instanceCount>0||(i.addEventListener("keydown",qe.toggleKeyboardMode),i.addEventListener("mousedown",qe.toggleKeyboardMode))}static removeKeyboardModeEvents(i){this.instanceCount>0||(i.addEventListener("keydown",qe.toggleKeyboardMode),i.addEventListener("mousedown",qe.toggleKeyboardMode))}static toggleKeyboardMode(i){const e=qe.keyboardModeActive,t=i.type==="keydown";t&&(i.ctrlKey||i.metaKey||i.altKey)||e!==t&&(qe.keyboardModeActive=t)}static unregisterGridCompController(i){qe.removeKeyboardModeEvents(i)}init(){const i=this.clearFocusedCell.bind(this);this.addManagedListener(this.eventService,b.EVENT_COLUMN_PIVOT_MODE_CHANGED,i),this.addManagedListener(this.eventService,b.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverythingChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_COLUMN_GROUP_OPENED,i),this.addManagedListener(this.eventService,b.EVENT_COLUMN_ROW_GROUP_CHANGED,i),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl})}registerKeyboardFocusEvents(){const i=this.gos.getDocument();qe.addKeyboardModeEvents(i),qe.instanceCount++,this.addDestroyFunc(()=>{qe.instanceCount--,qe.unregisterGridCompController(i)})}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const i=this.focusedCellPosition.column,e=this.columnModel.getGridColumn(i.getId());i!==e&&this.clearFocusedCell()}isKeyboardMode(){return qe.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),no.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),ad.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(i,e){let t=i;for(;t;){if(this.gos.getDomData(t,e))return!1;t=t.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(i){return this.isCellRestoreFocused(i)?(setTimeout(()=>{this.restoredFocusedCellPosition=null},0),!0):!1}isCellRestoreFocused(i){return this.restoredFocusedCellPosition==null?!1:this.cellPositionUtils.equals(i,this.restoredFocusedCellPosition)}setRestoreFocusedCell(i){this.getFrameworkOverrides().renderingEngine==="react"&&(this.restoredFocusedCellPosition=i)}getFocusEventParams(){const{rowIndex:i,rowPinned:e,column:t}=this.focusedCellPosition,s={rowIndex:i,rowPinned:e,column:t,isFullWidthCell:!1},r=this.rowRenderer.getRowByPosition({rowIndex:i,rowPinned:e});return r&&(s.isFullWidthCell=r.isFullWidth()),s}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,this.focusedCellPosition==null)return;const i=de({type:b.EVENT_CELL_FOCUS_CLEARED},this.getFocusEventParams());this.focusedCellPosition=null,this.eventService.dispatchEvent(i)}setFocusedCell(i){const{column:e,rowIndex:t,rowPinned:s,forceBrowserFocus:r=!1,preventScrollOnBrowserFocus:o=!1}=i,n=this.columnModel.getGridColumn(e);if(!n){this.focusedCellPosition=null;return}this.focusedCellPosition=n?{rowIndex:t,rowPinned:Fs(s),column:n}:null;const a=lt(de({type:b.EVENT_CELL_FOCUSED},this.getFocusEventParams()),{forceBrowserFocus:r,preventScrollOnBrowserFocus:o,floating:null});this.eventService.dispatchEvent(a)}isCellFocused(i){return this.focusedCellPosition==null?!1:this.cellPositionUtils.equals(i,this.focusedCellPosition)}isRowNodeFocused(i){return this.isRowFocused(i.rowIndex,i.rowPinned)}isHeaderWrapperFocused(i){if(this.focusedHeaderPosition==null)return!1;const e=i.getColumnGroupChild(),t=i.getRowIndex(),s=i.getPinned(),{column:r,headerRowIndex:o}=this.focusedHeaderPosition;return e===r&&t===o&&s==r.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(i,e){this.focusedHeaderPosition={headerRowIndex:i,column:e}}focusHeaderPosition(i){if(this.gos.get("suppressHeaderFocus"))return!1;const{direction:e,fromTab:t,allowUserOverride:s,event:r,fromCell:o,rowWithoutSpanValue:n}=i;let{headerPosition:a}=i;if(o&&this.filterManager.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(a);if(s){const l=this.getFocusedHeader(),u=this.headerNavigationService.getHeaderRowCount();if(t){const h=this.gos.getCallback("tabToNextHeader");h&&(a=this.getHeaderPositionFromUserFunc({userFunc:h,direction:e,currentPosition:l,headerPosition:a,headerRowCount:u}))}else{const h=this.gos.getCallback("navigateToNextHeader");if(h&&r){const d={key:r.key,previousHeaderPosition:l,nextHeaderPosition:a,headerRowCount:u,event:r};a=h(d)}}}return a?this.focusProvidedHeaderPosition({headerPosition:a,direction:e,event:r,fromCell:o,rowWithoutSpanValue:n}):!1}focusHeaderPositionFromUserFunc(i){if(this.gos.get("suppressHeaderFocus"))return!1;const{userFunc:e,headerPosition:t,direction:s,event:r}=i,o=this.getFocusedHeader(),n=this.headerNavigationService.getHeaderRowCount(),a=this.getHeaderPositionFromUserFunc({userFunc:e,direction:s,currentPosition:o,headerPosition:t,headerRowCount:n});return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:s,event:r})}getHeaderPositionFromUserFunc(i){const{userFunc:e,direction:t,currentPosition:s,headerPosition:r,headerRowCount:o}=i,a=e({backwards:t==="Before",previousHeaderPosition:s,nextHeaderPosition:r,headerRowCount:o});return a===!0||a===null?(a===null&&fe("Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."),s):a===!1?null:a}focusProvidedHeaderPosition(i){const{headerPosition:e,direction:t,fromCell:s,rowWithoutSpanValue:r,event:o}=i;if(e.headerRowIndex===-1)return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(e):this.focusGridView(e.column);this.headerNavigationService.scrollToColumn(e.column,t);const a=this.ctrlsService.getHeaderRowContainerCtrl(e.column.getPinned()).focusHeader(e.headerRowIndex,e.column,o);return a&&(r!=null||s)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(r??-1),a}focusFirstHeader(){let i=this.columnModel.getAllDisplayedColumns()[0];if(!i)return!1;i.getParent()&&(i=this.columnModel.getColumnGroupAtLevel(i,0));const e=this.headerPositionUtils.getHeaderIndexToFocus(i,0);return this.focusHeaderPosition({headerPosition:e,rowWithoutSpanValue:0})}focusLastHeader(i){const e=this.headerNavigationService.getHeaderRowCount()-1,t=We(this.columnModel.getAllDisplayedColumns());return this.focusHeaderPosition({headerPosition:{headerRowIndex:e,column:t},rowWithoutSpanValue:-1,event:i})}focusPreviousFromFirstCell(i){return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(i)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(i,e){return this.focusedCellPosition==null?!1:this.focusedCellPosition.rowIndex===i&&this.focusedCellPosition.rowPinned===Fs(e)}findFocusableElements(i,e,t=!1){const s=av;let r=Pp;e&&(r+=", "+e),t&&(r+=', [tabindex="-1"]');const o=Array.prototype.slice.apply(i.querySelectorAll(s)).filter(l=>Pi(l)),n=Array.prototype.slice.apply(i.querySelectorAll(r));return n.length?((l,u)=>l.filter(h=>u.indexOf(h)===-1))(o,n):o}focusInto(i,e=!1,t=!1){const s=this.findFocusableElements(i,null,t),r=e?We(s):s[0];return r?(r.focus({preventScroll:!0}),!0):!1}findFocusableElementBeforeTabGuard(i,e){if(!e)return null;const t=this.findFocusableElements(i),s=t.indexOf(e);if(s===-1)return null;let r=-1;for(let o=s-1;o>=0;o--)if(t[o].classList.contains("ag-tab-guard-top")){r=o;break}return r<=0?null:t[r-1]}findNextFocusableElement(i=this.eGridDiv,e,t){const s=this.findFocusableElements(i,e?':not([tabindex="-1"])':null),r=this.gos.getActiveDomElement();let o;e?o=s.findIndex(a=>a.contains(r)):o=s.indexOf(r);const n=o+(t?-1:1);return n<0||n>=s.length?null:s[n]}isTargetUnderManagedComponent(i,e){if(!e)return!1;const t=i.querySelectorAll(`.${Dr.FOCUS_MANAGED_CLASS}`);if(!t.length)return!1;for(let s=0;s<t.length;s++)if(t[s].contains(e))return!0;return!1}findTabbableParent(i,e=5){let t=0;for(;i&&th(i)===null&&++t<=e;)i=i.parentElement;return th(i)===null?null:i}focusGridView(i,e){var t;if(this.gos.get("suppressCellFocus"))return e?this.gos.get("suppressHeaderFocus")?this.focusNextGridCoreContainer(!0,!0):this.focusLastHeader():this.focusNextGridCoreContainer(!1);const s=e?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!s)return!1;const{rowIndex:r,rowPinned:o}=s,n=this.getFocusedHeader();return!i&&n&&(i=n.column),r==null||!i?!1:(this.navigationService.ensureCellVisible({rowIndex:r,column:i,rowPinned:o}),this.setFocusedCell({rowIndex:r,column:i,rowPinned:Fs(o),forceBrowserFocus:!0}),(t=this.rangeService)==null||t.setRangeToCell({rowIndex:r,rowPinned:o,column:i}),!0)}focusNextGridCoreContainer(i,e=!1){return!e&&this.gridCtrl.focusNextInnerContainer(i)?!0:((e||!i&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(i),!1)}focusAdvancedFilter(i){var e,t;return this.advancedFilterFocusColumn=i?.column,(t=(e=this.advancedFilterService)==null?void 0:e.getCtrl().focusHeaderComp())!=null?t:!1}focusNextFromAdvancedFilter(i,e){var t,s;const r=(s=e?void 0:this.advancedFilterFocusColumn)!=null?s:(t=this.columnModel.getAllDisplayedColumns())==null?void 0:t[0];return i?this.focusHeaderPosition({headerPosition:{column:r,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(r)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}};qe.keyboardModeActive=!1;qe.instanceCount=0;g([R("eGridDiv")],qe.prototype,"eGridDiv",2);g([R("columnModel")],qe.prototype,"columnModel",2);g([R("headerNavigationService")],qe.prototype,"headerNavigationService",2);g([R("headerPositionUtils")],qe.prototype,"headerPositionUtils",2);g([R("rowRenderer")],qe.prototype,"rowRenderer",2);g([R("rowPositionUtils")],qe.prototype,"rowPositionUtils",2);g([R("cellPositionUtils")],qe.prototype,"cellPositionUtils",2);g([R("navigationService")],qe.prototype,"navigationService",2);g([R("ctrlsService")],qe.prototype,"ctrlsService",2);g([R("filterManager")],qe.prototype,"filterManager",2);g([Ke("rangeService")],qe.prototype,"rangeService",2);g([Ke("advancedFilterService")],qe.prototype,"advancedFilterService",2);g([J],qe.prototype,"init",1);qe=g([le("focusService")],qe);var Xc=class extends Z{setMouseOver(i){this.selectedColumns=i;const e={type:b.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(e)}clearMouseOver(){this.selectedColumns=null;const i={type:b.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(i)}isHovered(i){return!!this.selectedColumns&&this.selectedColumns.indexOf(i)>=0}};Xc=g([le("columnHoverService")],Xc);var Xa=class extends Z{constructor(){super(...arguments),this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.ctrlsService.whenReady(i=>this.gridBodyCtrl=i.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(i){this.suppressAnimation=i}start(){this.active||this.gos.get("suppressColumnMoveAnimation")||this.gos.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&this.flush(()=>{this.active=!1})}executeNextVMTurn(i){this.active?this.executeNextFuncs.push(i):i()}executeLaterVMTurn(i){this.active?this.executeLaterFuncs.push(i):i()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const i=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===i&&this.gridBodyCtrl.setColumnMovingCss(!1)})}flush(i){if(this.executeNextFuncs.length===0&&this.executeLaterFuncs.length===0){i();return}const e=t=>{for(;t.length;){const s=t.pop();s&&s()}};this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>e(this.executeNextFuncs),0),window.setTimeout(()=>{i(),e(this.executeLaterFuncs)},200)})}};g([R("ctrlsService")],Xa.prototype,"ctrlsService",2);g([J],Xa.prototype,"postConstruct",1);Xa=g([le("columnAnimationService")],Xa);var bn=class extends Z{postConstruct(){this.ctrlsService.whenReady(i=>{this.centerRowsCtrl=i.center,this.addManagedListener(this.eventService,b.EVENT_BODY_HEIGHT_CHANGED,this.checkPageSize.bind(this)),this.addManagedListener(this.eventService,b.EVENT_SCROLL_VISIBILITY_CHANGED,this.checkPageSize.bind(this)),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.paginationProxy.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const i=this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();if(i>0){const e=()=>{const t=this.gos.getRowHeightAsNumber(),s=Math.floor(i/t);this.paginationProxy.setPageSize(s,"autoCalculated")};this.isBodyRendered?ci(()=>e(),50)():(e(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};g([R("ctrlsService")],bn.prototype,"ctrlsService",2);g([R("paginationProxy")],bn.prototype,"paginationProxy",2);g([J],bn.prototype,"postConstruct",1);bn=g([le("paginationAutoPageSizeService")],bn);var uh=class extends Z{constructor(){super(...arguments),this.cacheVersion=0}init(){this.active=this.gos.get("valueCache"),this.neverExpires=this.gos.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(i,e,t){this.active&&(i.__cacheVersion!==this.cacheVersion&&(i.__cacheVersion=this.cacheVersion,i.__cacheData={}),i.__cacheData[e]=t)}getValue(i,e){if(!(!this.active||i.__cacheVersion!==this.cacheVersion))return i.__cacheData[e]}};g([J],uh.prototype,"init",1);uh=g([le("valueCache")],uh);var D_="paste",Sn=class extends Z{init(){this.rowModel.getType()==="clientSide"&&(this.clientSideRowModel=this.rowModel),this.addManagedListener(this.eventService,b.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged.bind(this))}onCellValueChanged(i){i.source!==D_&&this.doChangeDetection(i.node,i.column)}doChangeDetection(i,e){if(this.gos.get("suppressChangeDetection"))return;const t=[i];if(this.clientSideRowModel&&!i.isRowPinned()){const s=this.gos.get("aggregateOnlyChangedColumns"),r=new dd(s,this.clientSideRowModel.getRootNode());r.addParentNode(i.parent,[e]),this.clientSideRowModel.doAggregate(r),r.forEachChangedNodeDepthFirst(o=>{t.push(o)})}this.rowRenderer.refreshCells({rowNodes:t})}};g([R("rowModel")],Sn.prototype,"rowModel",2);g([R("rowRenderer")],Sn.prototype,"rowRenderer",2);g([J],Sn.prototype,"init",1);Sn=g([le("changeDetectionService")],Sn);var hh=class extends Z{adaptFunction(i,e){const t=this.componentMetadataProvider.retrieve(i);return t&&t.functionAdapter?t.functionAdapter(e):null}adaptCellRendererFunction(i){class e{refresh(s){return!1}getGui(){return this.eGui}init(s){const r=i(s),o=typeof r;if(o==="string"||o==="number"||o==="boolean"){this.eGui=Ri("<span>"+r+"</span>");return}if(r==null){this.eGui=Ri("<span></span>");return}this.eGui=r}}return e}doesImplementIComponent(i){return i?i.prototype&&"getGui"in i.prototype:!1}};g([R("componentMetadataProvider")],hh.prototype,"componentMetadataProvider",2);hh=g([le("agComponentUtils")],hh);var qa=class extends Z{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:[],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},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(i){return this.componentMetaData[i]}};g([R("agComponentUtils")],qa.prototype,"agComponentUtils",2);g([J],qa.prototype,"postConstruct",1);qa=g([le("componentMetadataProvider")],qa);var P_=25,Qg=10,ec=8,T_=4,tc=4,ic=6,A_=16,Zg=14,sc=8,F_={"ag-theme-custom":{headerHeight:25,headerCellMinWidth:24,listItemHeight:T_*5,rowHeight:25,chartMenuPanelWidth:220},"ag-theme-material":{headerHeight:ec*7,headerCellMinWidth:48,listItemHeight:ec*4,rowHeight:ec*6,chartMenuPanelWidth:240},"ag-theme-balham":{headerHeight:tc*8,headerCellMinWidth:24,listItemHeight:tc*6,rowHeight:tc*7,chartMenuPanelWidth:220},"ag-theme-alpine":{headerHeight:ic*8,headerCellMinWidth:36,listItemHeight:ic*4,rowHeight:ic*7,chartMenuPanelWidth:240},"ag-theme-quartz":{headerHeight:Zg+sc*4.25,headerCellMinWidth:36,listItemHeight:A_+sc,rowHeight:Zg+sc*3.5,chartMenuPanelWidth:260}},Jg={headerHeight:["ag-header-row"],headerCellMinWidth:["ag-header-cell"],listItemHeight:["ag-virtual-list-item"],rowHeight:["ag-row"],chartMenuPanelWidth:["ag-chart-docked-container"]},Qa=class extends Z{constructor(){super(...arguments),this.calculatedSizes={},this.calculatedTheme=null}postConstruct(){var i;const e=(i=this.getTheme().el)!=null?i:this.eGridDiv;this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.mutationObserver=new MutationObserver(()=>{this.calculatedSizes={},this.calculatedTheme=null,this.calculatedTheme=this.getTheme(),this.fireGridStylesChangedEvent()}),this.mutationObserver.observe(e||this.eGridDiv,{attributes:!0,attributeFilter:["class"]})}fireGridStylesChangedEvent(){const i={type:b.EVENT_GRID_STYLES_CHANGED};this.eventService.dispatchEvent(i)}getSassVariable(i){const{themeFamily:e,el:t}=this.getTheme();if(!e||e.indexOf("ag-theme")!==0)return;this.calculatedSizes||(this.calculatedSizes={}),this.calculatedSizes[e]||(this.calculatedSizes[e]={});const s=this.calculatedSizes[e][i];return s??(this.calculatedSizes[e][i]=this.calculateValueForSassProperty(i,e,t),this.calculatedSizes[e][i])}calculateValueForSassProperty(i,e,t){const s="ag-theme-"+(e.match("material")?"material":e.match("balham")?"balham":e.match("alpine")?"alpine":"custom"),r=F_[s][i],o=this.gos.getDocument();if(t||(t=this.eGridDiv),!Jg[i])return r;const n=Jg[i],a=o.createElement("div"),l=Array.from(t.classList);a.classList.add(e,...l),a.style.position="absolute";const u=n.reduce((d,c)=>{const p=o.createElement("div");return p.style.position="static",p.classList.add(c),d.appendChild(p),p},a);let h=0;if(o.body){o.body.appendChild(a);const d=i.toLowerCase().indexOf("height")!==-1?"height":"width";h=parseInt(window.getComputedStyle(u)[d],10),o.body.removeChild(a)}return h||r}isThemeDark(){const{theme:i}=this.getTheme();return!!i&&i.indexOf("dark")>=0}chartMenuPanelWidth(){return this.getSassVariable("chartMenuPanelWidth")}getTheme(){if(this.calculatedTheme)return this.calculatedTheme;const i=/\bag-(material|(?:theme-([\w\-]*)))\b/g;let e=this.eGridDiv,t=null,s=[];for(;e;)if(t=i.exec(e.className),!t)e=e.parentElement||void 0;else{const o=e.className.match(i);o&&(s=o);break}if(!t)return{allThemes:s};const r=t[0];return this.calculatedTheme={theme:r,el:e,themeFamily:r.replace(/-dark$/,""),allThemes:s},this.calculatedTheme}getFromTheme(i,e){var t;return(t=this.getSassVariable(e))!=null?t:i}getDefaultRowHeight(){return this.getFromTheme(P_,"rowHeight")}getListItemHeight(){return this.getFromTheme(20,"listItemHeight")}refreshRowHeightVariable(){const i=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),e=this.gos.get("rowHeight");if(e==null||isNaN(e)||!isFinite(e))return i!==null&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const t=`${e}px`;return i!=t?(this.eGridDiv.style.setProperty("--ag-line-height",t),e):i!=""?parseFloat(i):-1}getMinColWidth(){const i=this.getFromTheme(null,"headerCellMinWidth");return K(i)?Math.max(i,Qg):Qg}destroy(){this.calculatedSizes=null,this.mutationObserver&&this.mutationObserver.disconnect(),super.destroy()}};g([R("eGridDiv")],Qa.prototype,"eGridDiv",2);g([J],Qa.prototype,"postConstruct",1);Qa=g([le("environment")],Qa);var _n=class extends Z{constructor(){super(...arguments),this.scrollY=0,this.uiBodyHeight=0}agWire(i){this.logger=i.create("RowContainerHeightService")}postConstruct(){this.addManagedListener(this.eventService,b.EVENT_BODY_HEIGHT_CHANGED,this.updateOffset.bind(this)),this.maxDivHeight=Zm(),this.logger.log("maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,t=this.getUiBodyHeight();(e!==this.scrollY||t!==this.uiBodyHeight)&&(this.scrollY=e,this.uiBodyHeight=t,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const i=this.scrollY/this.maxScrollY,e=i*this.pixelsToShave;this.logger.log(`Div Stretch Offset = ${e} (${this.pixelsToShave} * ${i})`),this.setDivStretchOffset(e)}setUiContainerHeight(i){i!==this.uiContainerHeight&&(this.uiContainerHeight=i,this.eventService.dispatchEvent({type:b.EVENT_ROW_CONTAINER_HEIGHT_CHANGED}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(i){const e=typeof i=="number"?Math.floor(i):null;this.divStretchOffset!==e&&(this.divStretchOffset=e,this.eventService.dispatchEvent({type:b.EVENT_HEIGHT_SCALE_CHANGED}))}setModelHeight(i){this.modelHeight=i,this.stretching=i!=null&&this.maxDivHeight>0&&i>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(i){return i-this.divStretchOffset}getUiBodyHeight(){const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return e.bottom-e.top}getScrollPositionForPixel(i){if(this.pixelsToShave<=0)return i;const e=this.modelHeight-this.getUiBodyHeight(),t=i/e;return this.maxScrollY*t}};g([R("ctrlsService")],_n.prototype,"ctrlsService",2);g([gs(0,Ki("loggerFactory"))],_n.prototype,"agWire",1);g([J],_n.prototype,"postConstruct",1);_n=g([le("rowContainerHeightService")],_n);var En=class extends Z{init(){this.addManagedPropertyListener("isRowSelectable",()=>this.updateSelectable())}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(i=!1){const e=!!this.gos.get("rowSelection"),t=this.gos.get("isRowSelectable");if(!e||!t)return;const s=this.gos.get("groupSelectsChildren"),r=this.rowModel.getType()==="clientSide"&&s,o=[],n=a=>{if(i&&!a.group)return;if(r&&a.group){const u=a.childrenAfterGroup.some(h=>h.selectable===!0);a.setRowSelectable(u,!0);return}const l=t?t(a):!0;a.setRowSelectable(l,!0),!l&&a.isSelected()&&o.push(a)};if(r){const a=this.rowModel;new dd(!1,a.getRootNode()).forEachChangedNodeDepthFirst(n,!0,!0)}else this.rowModel.forEachNode(n);o.length&&this.selectionService.setNodesSelected({nodes:o,newValue:!1,source:"selectableChanged"}),r&&this.selectionService instanceof fo&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}};g([R("rowModel")],En.prototype,"rowModel",2);g([R("selectionService")],En.prototype,"selectionService",2);g([J],En.prototype,"init",1);En=g([le("selectableService")],En);var Ai=class extends Se{constructor(){super(),this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1}postConstruct(){const i=this.gos.get("enableRtl");this.setTemplate(this.getTemplate());const{btFirst:e,btPrevious:t,btNext:s,btLast:r,pageSizeComp:o}=this;this.activateTabIndex([e,t,s,r]),e.insertAdjacentElement("afterbegin",dt(i?"last":"first",this.gos)),t.insertAdjacentElement("afterbegin",dt(i?"next":"previous",this.gos)),s.insertAdjacentElement("afterbegin",dt(i?"previous":"next",this.gos)),r.insertAdjacentElement("afterbegin",dt(i?"first":"last",this.gos)),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 e=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(e),e&&(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,b.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(i=>{const{el:e,fn:t}=i;this.addManagedListener(e,"click",t),this.addManagedListener(e,"keydown",s=>{(s.key===k.ENTER||s.key===k.SPACE)&&(s.preventDefault(),t())})}),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToFirstPage()}setCurrentPageLabel(){const i=this.paginationProxy.getTotalPages()>0,e=this.paginationProxy.getCurrentPage(),t=i?e+1:0;this.lbCurrent.textContent=this.formatNumber(t)}formatNumber(i){const e=this.gos.getCallback("paginationNumberFormatter");if(e)return e({value:i});const t=this.localeService.getLocaleTextFunc(),s=t("thousandSeparator",","),r=t("decimalSeparator",".");return Dp(i,s,r)}getTemplate(){const i=this.localeService.getLocaleTextFunc(),e=i("page","Page"),t=i("to","to"),s=i("of","of"),r=i("firstPage","First Page"),o=i("previousPage","Previous Page"),n=i("nextPage","Next Page"),a=i("lastPage","Last Page"),l=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${l}">
<ag-page-size-selector ref="pageSizeComp"></ag-page-size-selector>
<span class="ag-paging-row-summary-panel" role="status">
<span id="ag-${l}-first-row" ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>
<span id="ag-${l}-to">${t}</span>
<span id="ag-${l}-last-row" ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>
<span id="ag-${l}-of">${s}</span>
<span id="ag-${l}-row-count" ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>
</span>
<span class="ag-paging-page-summary-panel" role="presentation">
<div ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>
<div ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>
<span class="ag-paging-description" role="status">
<span id="ag-${l}-start-page">${e}</span>
<span id="ag-${l}-start-page-number" ref="lbCurrent" class="ag-paging-number"></span>
<span id="ag-${l}-of-page">${s}</span>
<span id="ag-${l}-of-page-number" ref="lbTotal" class="ag-paging-number"></span>
</span>
<div ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${n}"></div>
<div ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${a}"></div>
</span>
</div>`}onBtNext(){this.nextButtonDisabled||this.paginationProxy.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationProxy.goToLastPage()}enableOrDisableButtons(){const i=this.paginationProxy.getCurrentPage(),e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages();this.previousAndFirstButtonsDisabled=i===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),r=i===t-1;this.nextButtonDisabled=r||s,this.lastButtonDisabled=!e||s||i===t-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(i,e){vp(i,e),i.classList.toggle("ag-disabled",e)}updateRowLabels(){const i=this.paginationProxy.getCurrentPage(),e=this.paginationProxy.getPageSize(),t=this.paginationProxy.isLastPageFound(),s=this.paginationProxy.isLastPageFound()?this.paginationProxy.getMasterRowCount():null;let r,o;if(this.isZeroPagesToDisplay()?r=o=0:(r=e*i+1,o=r+e-1,t&&o>s&&(o=s)),this.lbFirstRowOnPage.textContent=this.formatNumber(r),this.rowNodeBlockLoader.isLoading()){const n=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=n("pageLastRowUnknown","?")}else this.lbLastRowOnPage.textContent=this.formatNumber(o)}isZeroPagesToDisplay(){const i=this.paginationProxy.isLastPageFound(),e=this.paginationProxy.getTotalPages();return i&&e===0}setTotalLabels(){const i=this.paginationProxy.isLastPageFound(),e=this.paginationProxy.getTotalPages(),t=i?this.paginationProxy.getMasterRowCount():null;if(t===1){const s=this.paginationProxy.getRow(0);if(s&&s.group&&!(s.groupData||s.aggData)){this.setTotalLabelsToZero();return}}if(i)this.lbTotal.textContent=this.formatNumber(e),this.lbRecordCount.textContent=this.formatNumber(t);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)}};g([R("paginationProxy")],Ai.prototype,"paginationProxy",2);g([R("rowNodeBlockLoader")],Ai.prototype,"rowNodeBlockLoader",2);g([te("btFirst")],Ai.prototype,"btFirst",2);g([te("btPrevious")],Ai.prototype,"btPrevious",2);g([te("btNext")],Ai.prototype,"btNext",2);g([te("btLast")],Ai.prototype,"btLast",2);g([te("lbRecordCount")],Ai.prototype,"lbRecordCount",2);g([te("lbFirstRowOnPage")],Ai.prototype,"lbFirstRowOnPage",2);g([te("lbLastRowOnPage")],Ai.prototype,"lbLastRowOnPage",2);g([te("lbCurrent")],Ai.prototype,"lbCurrent",2);g([te("lbTotal")],Ai.prototype,"lbTotal",2);g([te("pageSizeComp")],Ai.prototype,"pageSizeComp",2);g([J],Ai.prototype,"postConstruct",1);var Hl=class NC extends Se{constructor(){super(NC.TEMPLATE),this.inProgress=!1,this.destroyRequested=!1}updateLayoutClasses(e,t){const s=this.eOverlayWrapper.classList;s.toggle("ag-layout-auto-height",t.autoHeight),s.toggle("ag-layout-normal",t.normal),s.toggle("ag-layout-print",t.print)}postConstruct(){this.createManagedBean(new id(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.overlayService.registerOverlayWrapperComp(this)}setWrapperTypeClass(e){const t=this.eOverlayWrapper.classList;this.activeOverlayWrapperCssClass&&t.toggle(this.activeOverlayWrapperCssClass,!1),this.activeOverlayWrapperCssClass=e,t.toggle(e,!0)}showOverlay(e,t,s){this.inProgress||(this.setWrapperTypeClass(t),this.destroyActiveOverlay(),this.inProgress=!0,e&&e.then(r=>{this.inProgress=!1,this.eOverlayWrapper.appendChild(r.getGui()),this.activeOverlay=r,this.updateListenerDestroyFunc=s,this.destroyRequested&&(this.destroyRequested=!1,this.destroyActiveOverlay())}),this.setDisplayed(!0,{skipAriaHidden:!0}))}destroyActiveOverlay(){var e;if(this.inProgress){this.destroyRequested=!0;return}this.activeOverlay&&(this.activeOverlay=this.getContext().destroyBean(this.activeOverlay),(e=this.updateListenerDestroyFunc)==null||e.call(this),Rt(this.eOverlayWrapper))}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.destroyActiveOverlay(),super.destroy()}};Hl.TEMPLATE=`
<div class="ag-overlay" role="presentation">
<div class="ag-overlay-panel" role="presentation">
<div class="ag-overlay-wrapper" ref="eOverlayWrapper" role="presentation"></div>
</div>
</div>`;g([R("overlayService")],Hl.prototype,"overlayService",2);g([te("eOverlayWrapper")],Hl.prototype,"eOverlayWrapper",2);g([J],Hl.prototype,"postConstruct",1);var M_=Hl,xn=class extends Z{getFirstRow(){let i=0,e;return this.pinnedRowModel.getPinnedTopRowCount()?e="top":this.rowModel.getRowCount()?(e=null,i=this.paginationProxy.getPageFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(e="bottom"),e===void 0?null:{rowIndex:i,rowPinned:e}}getLastRow(){let i,e=null;const t=this.pinnedRowModel.getPinnedBottomRowCount(),s=this.pinnedRowModel.getPinnedTopRowCount();return t?(e="bottom",i=t-1):this.rowModel.getRowCount()?(e=null,i=this.paginationProxy.getPageLastRow()):s&&(e="top",i=s-1),i===void 0?null:{rowIndex:i,rowPinned:e}}getRowNode(i){switch(i.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[i.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[i.rowIndex];default:return this.rowModel.getRow(i.rowIndex)}}sameRow(i,e){return!i&&!e?!0:i&&!e||!i&&e?!1:i.rowIndex===e.rowIndex&&i.rowPinned==e.rowPinned}before(i,e){switch(i.rowPinned){case"top":if(e.rowPinned!=="top")return!0;break;case"bottom":if(e.rowPinned!=="bottom")return!1;break;default:if(K(e.rowPinned))return e.rowPinned!=="top";break}return i.rowIndex<e.rowIndex}};g([R("rowModel")],xn.prototype,"rowModel",2);g([R("pinnedRowModel")],xn.prototype,"pinnedRowModel",2);g([R("paginationProxy")],xn.prototype,"paginationProxy",2);xn=g([le("rowPositionUtils")],xn);var qc=class extends Z{createId(i){const{rowIndex:e,rowPinned:t,column:s}=i;return this.createIdFromValues({rowIndex:e,column:s,rowPinned:t})}createIdFromValues(i){const{rowIndex:e,rowPinned:t,column:s}=i;return`${e}.${t??"null"}.${s.getId()}`}equals(i,e){const t=i.column===e.column,s=i.rowPinned===e.rowPinned,r=i.rowIndex===e.rowIndex;return t&&s&&r}};qc=g([le("cellPositionUtils")],qc);var _a=class{constructor(i){this.cellValueChanges=i}},rc=class extends _a{constructor(i,e,t,s){super(i),this.initialRange=e,this.finalRange=t,this.ranges=s}},kC=class GC{constructor(e){this.actionStack=[],this.maxStackSize=e||GC.DEFAULT_STACK_SIZE,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}};kC.DEFAULT_STACK_SIZE=10;var ef=kC,ks=class extends Z{constructor(){super(...arguments),this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=i=>{const e={column:i.column,rowIndex:i.rowIndex,rowPinned:i.rowPinned},t=this.activeCellEdit!==null&&this.cellPositionUtils.equals(this.activeCellEdit,e),s=this.activeRowEdit!==null&&this.rowPositionUtils.sameRow(this.activeRowEdit,e);if(!(t||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:o,rowIndex:n,column:a,oldValue:l,value:u}=i,h={rowPinned:o,rowIndex:n,columnId:a.getColId(),newValue:u,oldValue:l};this.cellValueChanges.push(h)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}init(){if(!this.gos.get("undoRedoCellEditing"))return;const i=this.gos.get("undoRedoCellEditingLimit");i<=0||(this.undoStack=new ef(i),this.redoStack=new ef(i),this.addRowEditingListeners(),this.addCellEditingListeners(),this.addPasteListeners(),this.addFillListeners(),this.addCellKeyListeners(),this.addManagedListener(this.eventService,b.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged),this.addManagedListener(this.eventService,b.EVENT_MODEL_UPDATED,e=>{e.keepUndoRedoStack||this.clearStacks()}),this.addManagedListener(this.eventService,b.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,b.EVENT_NEW_COLUMNS_LOADED,this.clearStacks),this.addManagedListener(this.eventService,b.EVENT_COLUMN_GROUP_OPENED,this.clearStacks),this.addManagedListener(this.eventService,b.EVENT_COLUMN_ROW_GROUP_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,b.EVENT_COLUMN_MOVED,this.clearStacks),this.addManagedListener(this.eventService,b.EVENT_COLUMN_PINNED,this.clearStacks),this.addManagedListener(this.eventService,b.EVENT_COLUMN_VISIBLE,this.clearStacks),this.addManagedListener(this.eventService,b.EVENT_ROW_DRAG_END,this.clearStacks),this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl}))}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(i){const e={type:b.EVENT_UNDO_STARTED,source:i};this.eventService.dispatchEvent(e);const t=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo"),s={type:b.EVENT_UNDO_ENDED,source:i,operationPerformed:t};this.eventService.dispatchEvent(s)}redo(i){const e={type:b.EVENT_REDO_STARTED,source:i};this.eventService.dispatchEvent(e);const t=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo"),s={type:b.EVENT_REDO_ENDED,source:i,operationPerformed:t};this.eventService.dispatchEvent(s)}undoRedo(i,e,t,s,r){if(!i)return!1;const o=i.pop();return!o||!o.cellValueChanges?!1:(this.processAction(o,n=>n[s],r),o instanceof rc?this.processRange(this.rangeService,o.ranges||[o[t]]):this.processCell(o.cellValueChanges),e.push(o),!0)}processAction(i,e,t){i.cellValueChanges.forEach(s=>{const{rowIndex:r,rowPinned:o,columnId:n}=s,a={rowIndex:r,rowPinned:o},l=this.rowPositionUtils.getRowNode(a);l.displayed&&l.setDataValue(n,e(s),t)})}processRange(i,e){let t;i.removeAllCellRanges(!0),e.forEach((s,r)=>{if(!s)return;const o=s.startRow,n=s.endRow;r===e.length-1&&(t={rowPinned:o.rowPinned,rowIndex:o.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:o.rowIndex,rowStartPinned:o.rowPinned,rowEndIndex:n.rowIndex,rowEndPinned:n.rowPinned,columnStart:s.startColumn,columns:s.columns};i.addCellRange(a)})}processCell(i){const e=i[0],{rowIndex:t,rowPinned:s}=e,r={rowIndex:t,rowPinned:s},o=this.rowPositionUtils.getRowNode(r),n={rowPinned:e.rowPinned,rowIndex:o.rowIndex,columnId:e.columnId};this.setLastFocusedCell(n,this.rangeService)}setLastFocusedCell(i,e){const{rowIndex:t,columnId:s,rowPinned:r}=i,o=this.gridBodyCtrl.getScrollFeature(),n=this.columnModel.getGridColumn(s);if(!n)return;o.ensureIndexVisible(t),o.ensureColumnVisible(n);const a={rowIndex:t,column:n,rowPinned:r};this.focusService.setFocusedCell(lt(de({},a),{forceBrowserFocus:!0})),e?.setRangeToCell(a)}addRowEditingListeners(){this.addManagedListener(this.eventService,b.EVENT_ROW_EDITING_STARTED,i=>{this.activeRowEdit={rowIndex:i.rowIndex,rowPinned:i.rowPinned}}),this.addManagedListener(this.eventService,b.EVENT_ROW_EDITING_STOPPED,()=>{const i=new _a(this.cellValueChanges);this.pushActionsToUndoStack(i),this.activeRowEdit=null})}addCellEditingListeners(){this.addManagedListener(this.eventService,b.EVENT_CELL_EDITING_STARTED,i=>{this.activeCellEdit={column:i.column,rowIndex:i.rowIndex,rowPinned:i.rowPinned}}),this.addManagedListener(this.eventService,b.EVENT_CELL_EDITING_STOPPED,i=>{if(this.activeCellEdit=null,i.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const t=new _a(this.cellValueChanges);this.pushActionsToUndoStack(t)}})}addPasteListeners(){this.addManagedListener(this.eventService,b.EVENT_PASTE_START,()=>{this.isPasting=!0}),this.addManagedListener(this.eventService,b.EVENT_PASTE_END,()=>{const i=new _a(this.cellValueChanges);this.pushActionsToUndoStack(i),this.isPasting=!1})}addFillListeners(){this.addManagedListener(this.eventService,b.EVENT_FILL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,b.EVENT_FILL_END,i=>{const e=new rc(this.cellValueChanges,i.initialRange,i.finalRange);this.pushActionsToUndoStack(e),this.isRangeInAction=!1})}addCellKeyListeners(){this.addManagedListener(this.eventService,b.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,b.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,()=>{let i;this.rangeService&&this.gos.get("enableRangeSelection")?i=new rc(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):i=new _a(this.cellValueChanges),this.pushActionsToUndoStack(i),this.isRangeInAction=!1})}pushActionsToUndoStack(i){this.undoStack.push(i),this.cellValueChanges=[],this.redoStack.clear()}};g([R("focusService")],ks.prototype,"focusService",2);g([R("ctrlsService")],ks.prototype,"ctrlsService",2);g([R("cellPositionUtils")],ks.prototype,"cellPositionUtils",2);g([R("rowPositionUtils")],ks.prototype,"rowPositionUtils",2);g([R("columnModel")],ks.prototype,"columnModel",2);g([Ke("rangeService")],ks.prototype,"rangeService",2);g([J],ks.prototype,"init",1);ks=g([le("undoRedoService")],ks);var Za=class extends Z{findHeader(i,e){let t,s;if(i.column instanceof jt?t=this.columnModel.getDisplayedGroupAtDirection(i.column,e):(s=`getDisplayedCol${e}`,t=this.columnModel[s](i.column)),!t)return;let{headerRowIndex:r}=i;if(this.getHeaderRowType(r)!=="filter"){const a=[t];for(;t.getParent();)t=t.getParent(),a.push(t);t=a[a.length-1-r]}const{column:o,headerRowIndex:n}=this.getHeaderIndexToFocus(t,r);return{column:o,headerRowIndex:n}}getHeaderIndexToFocus(i,e){let t;if(i instanceof jt&&this.isAnyChildSpanningHeaderHeight(i)&&i.isPadding()){const s=i;t=s.getLeafColumns()[0];let r=t;for(;r!==s;)e++,r=r.getParent()}return{column:t||i,headerRowIndex:e}}isAnyChildSpanningHeaderHeight(i){return i?i.getLeafColumns().some(e=>e.isSpanHeaderHeight()):!1}getColumnVisibleParent(i,e){const t=this.getHeaderRowType(e),s=t==="filter",r=t==="column";let o=s?i:i.getParent(),n=e-1,a=n;if(r&&this.isAnyChildSpanningHeaderHeight(i.getParent())){for(;o&&o.isPadding();)o=o.getParent(),n--;a=n,n<0&&(o=i,n=e,a=void 0)}return{column:o,headerRowIndex:n,headerRowIndexWithoutSpan:a}}getColumnVisibleChild(i,e,t="After"){const s=this.getHeaderRowType(e);let r=i,o=e+1,n=o;if(s==="group"){const a=i.getDisplayedLeafColumns(),l=t==="After"?a[0]:We(a),u=[];let h=l;for(;h.getParent()!==i;)h=h.getParent(),u.push(h);if(r=l,l.isSpanHeaderHeight())for(let d=u.length-1;d>=0;d--){const c=u[d];if(!c.isPadding()){r=c;break}o++}else r=We(u),r||(r=l)}return{column:r,headerRowIndex:o,headerRowIndexWithoutSpan:n}}getHeaderRowType(i){const e=this.ctrlsService.getHeaderRowContainerCtrl();if(e)return e.getRowType(i)}findColAtEdgeForHeaderRow(i,e){const t=this.columnModel.getAllDisplayedColumns(),s=t[e==="start"?0:t.length-1];if(!s)return;const o=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()).getRowType(i);if(o=="group"){const n=this.columnModel.getColumnGroupAtLevel(s,i);return{headerRowIndex:i,column:n}}return{headerRowIndex:o==null?-1:i,column:s}}};g([R("columnModel")],Za.prototype,"columnModel",2);g([R("ctrlsService")],Za.prototype,"ctrlsService",2);Za=g([le("headerPositionUtils")],Za);var Qc=class{buildColumnDefs(i,e,t){const s=[],r={};return i.forEach(o=>{const n=this.createDefFromColumn(o,e,t);let a=!0,l=n,u=o.getOriginalParent(),h=null;for(;u;){let d=null;if(u.isPadding()){u=u.getOriginalParent();continue}const c=r[u.getGroupId()];if(c){c.children.push(l),a=!1;break}if(d=this.createDefFromGroup(u),d&&(d.children=[l],r[d.groupId]=d,l=d,u=u.getOriginalParent()),u!=null&&h===u){a=!1;break}h=u}a&&s.push(l)}),s}createDefFromGroup(i){const e=qu(i.getColGroupDef(),["children"]);return e&&(e.groupId=i.getGroupId()),e}createDefFromColumn(i,e,t){const s=qu(i.getColDef());return s.colId=i.getColId(),s.width=i.getActualWidth(),s.rowGroup=i.isRowGroupActive(),s.rowGroupIndex=i.isRowGroupActive()?e.indexOf(i):null,s.pivot=i.isPivotActive(),s.pivotIndex=i.isPivotActive()?t.indexOf(i):null,s.aggFunc=i.isValueActive()?i.getAggFunc():null,s.hide=i.isVisible()?void 0:!0,s.pinned=i.isPinned()?i.getPinned():null,s.sort=i.getSort()?i.getSort():null,s.sortIndex=i.getSortIndex()!=null?i.getSortIndex():null,s}};Qc=g([le("columnDefFactory")],Qc);var Ja=class{getInitialRowClasses(i){const e=[];return K(i.extraCssClass)&&e.push(i.extraCssClass),e.push("ag-row"),e.push(i.rowFocused?"ag-row-focus":"ag-row-no-focus"),i.fadeRowIn&&e.push("ag-opacity-zero"),e.push(i.rowIsEven?"ag-row-even":"ag-row-odd"),i.rowNode.isRowPinned()&&e.push("ag-row-pinned"),i.rowNode.isSelected()&&e.push("ag-row-selected"),i.rowNode.footer&&e.push("ag-row-footer"),e.push("ag-row-level-"+i.rowLevel),i.rowNode.stub&&e.push("ag-row-loading"),i.fullWidthRow&&e.push("ag-full-width-row"),i.expandable&&(e.push("ag-row-group"),e.push(i.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),i.rowNode.dragging&&e.push("ag-row-dragging"),Mc(e,this.processClassesFromGridOptions(i.rowNode)),Mc(e,this.preProcessRowClassRules(i.rowNode)),e.push(i.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),i.firstRowOnPage&&e.push("ag-row-first"),i.lastRowOnPage&&e.push("ag-row-last"),i.fullWidthRow&&(i.pinned==="left"&&e.push("ag-cell-last-left-pinned"),i.pinned==="right"&&e.push("ag-cell-first-right-pinned")),e}processClassesFromGridOptions(i){const e=[],t=o=>{typeof o=="string"?e.push(o):Array.isArray(o)&&o.forEach(n=>e.push(n))},s=this.gos.get("rowClass");if(s){if(typeof s=="function")return console.warn("AG Grid: rowClass should not be a function, please use getRowClass instead"),[];t(s)}const r=this.gos.getCallback("getRowClass");if(r){const o={data:i.data,node:i,rowIndex:i.rowIndex},n=r(o);t(n)}return e}preProcessRowClassRules(i){const e=[];return this.processRowClassRules(i,t=>{e.push(t)},t=>{}),e}processRowClassRules(i,e,t){const s=this.gos.addGridCommonParams({data:i.data,node:i,rowIndex:i.rowIndex});this.stylingService.processClassRules(void 0,this.gos.get("rowClassRules"),s,e,t)}calculateRowLevel(i){return i.group?i.level:i.parent?i.parent.level+1:0}};g([R("stylingService")],Ja.prototype,"stylingService",2);g([R("gridOptionsService")],Ja.prototype,"gos",2);Ja=g([le("rowCssClassCalculator")],Ja);var Rn=class extends Z{init(){this.isAccentedSort=this.gos.get("accentedSort"),this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",i=>this.isAccentedSort=i.currentValue),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup())}doFullSort(i,e){const t=(r,o)=>({currentPos:o,rowNode:r}),s=i.map(t);return s.sort(this.compareRowNodes.bind(this,e)),s.map(r=>r.rowNode)}compareRowNodes(i,e,t){const s=e.rowNode,r=t.rowNode;for(let o=0,n=i.length;o<n;o++){const a=i[o],l=a.sort==="desc",u=this.getValue(s,a.column),h=this.getValue(r,a.column);let d;const c=this.getComparator(a,s);if(c?d=c(u,h,s,r,l):d=ye.defaultComparator(u,h,this.isAccentedSort),!isNaN(d)&&d!==0)return a.sort==="asc"?d:d*-1}return e.currentPos-t.currentPos}getComparator(i,e){const t=i.column,s=t.getColDef().comparator;if(s!=null)return s;if(!t.getColDef().showRowGroup)return;const r=!e.group&&t.getColDef().field;if(!r)return;const o=this.columnModel.getPrimaryColumn(r);if(o)return o.getColDef().comparator}getValue(i,e){var t,s;if(!this.primaryColumnsSortGroups)return this.valueService.getValue(e,i,!1,!1);if(i.rowGroupColumn===e){if(this.gos.isGroupUseEntireRow(this.columnModel.isPivotActive())){const a=(t=i.allLeafChildren)==null?void 0:t[0];return a?this.valueService.getValue(e,a,!1,!1):void 0}const n=this.columnModel.getGroupDisplayColumnForGroup(e.getId());return n?(s=i.groupData)==null?void 0:s[n.getId()]:void 0}if(!(i.group&&e.getColDef().showRowGroup))return this.valueService.getValue(e,i,!1,!1)}};g([R("valueService")],Rn.prototype,"valueService",2);g([R("columnModel")],Rn.prototype,"columnModel",2);g([J],Rn.prototype,"init",1);Rn=g([le("rowNodeSorter")],Rn);var lo=class extends Z{constructor(){super(...arguments),this.params={},this.ready=!1,this.readyCallbacks=[]}checkReady(){const i=this.params;this.ready=i.gridCtrl!=null&&i.gridBodyCtrl!=null&&i.center!=null&&i.left!=null&&i.right!=null&&i.bottomCenter!=null&&i.bottomLeft!=null&&i.bottomRight!=null&&i.topCenter!=null&&i.topLeft!=null&&i.topRight!=null&&i.stickyTopCenter!=null&&i.stickyTopLeft!=null&&i.stickyTopRight!=null&&i.stickyBottomCenter!=null&&i.stickyBottomLeft!=null&&i.stickyBottomRight!=null&&i.centerHeader!=null&&i.leftHeader!=null&&i.rightHeader!=null&&i.fakeHScrollComp!=null&&i.fakeVScrollComp!=null&&i.gridHeaderCtrl!=null,this.ready&&(this.readyCallbacks.forEach(e=>e(i)),this.readyCallbacks.length=0)}whenReady(i){this.ready?i(this.params):this.readyCallbacks.push(i)}register(i,e){this.params[i]=e,this.checkReady()}registerHeaderContainer(i,e){switch(e){case"left":this.params.leftHeader=i;break;case"right":this.params.rightHeader=i;break;default:this.params.centerHeader=i;break}this.checkReady()}get(i){return this.params[i]}getParams(){return this.params}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){return[this.params.leftHeader,this.params.rightHeader,this.params.centerHeader]}getHeaderRowContainerCtrl(i){switch(i){case"left":return this.params.leftHeader;case"right":return this.params.rightHeader;default:return this.params.centerHeader}}};lo.NAME="ctrlsService";lo=g([le(lo.NAME)],lo);var Zc=class extends Z{constructor(){super(...arguments),this.registry={}}register(i){this.registry[i.controllerName]=i.controllerClass}getInstance(i){const e=this.registry[i];if(e!=null)return new e}};Zc=g([le("ctrlsFactory")],Zc);var Vo=class extends Se{constructor(i,e){super(i),this.direction=e,this.hideTimeout=null}postConstruct(){this.addManagedListener(this.eventService,b.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",Ep()||Js())}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.invisibleScrollbar=Rp(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const i=["mouseenter","mousedown","touchstart"],e=["mouseleave","touchend"],t=this.getGui();i.forEach(s=>this.addManagedListener(t,s,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0))),e.forEach(s=>this.addManagedListener(t,s,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1)))}onScrollVisibilityChanged(){this.invisibleScrollbar===void 0&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame(()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedListener(this.eventService,b.EVENT_BODY_SCROLL,i=>{i.direction===this.direction&&(this.hideTimeout!==null&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))}),this.addManagedListener(this.eventService,b.EVENT_BODY_SCROLL_END,()=>{this.hideTimeout=window.setTimeout(()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null},400)})}attemptSettingScrollPosition(i){const e=this.getViewport();dp(()=>Pi(e),()=>this.setScrollPosition(i),100)}getViewport(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(i){this.addManagedListener(this.getViewport(),"scroll",i)}};g([te("eViewport")],Vo.prototype,"eViewport",2);g([te("eContainer")],Vo.prototype,"eContainer",2);g([R("scrollVisibleService")],Vo.prototype,"scrollVisibleService",2);g([R("ctrlsService")],Vo.prototype,"ctrlsService",2);g([R("animationFrameService")],Vo.prototype,"animationFrameService",2);var Ho=class VC extends Vo{constructor(){super(VC.TEMPLATE,"horizontal")}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,b.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.register("fakeHScrollComp",this),this.createManagedBean(new kn(t=>this.eContainer.style.width=`${t}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}onPinnedRowDataChanged(){this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.pinnedRowModel.getPinnedBottomTotalHeight();this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleService.isVerticalScrollShowing();let t=this.columnModel.getDisplayedColumnsRightWidth();const s=!this.enableRtl&&e,r=this.gos.getScrollbarWidth();s&&(t+=r),Zi(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=r);let o=this.columnModel.getDisplayedColumnsLeftWidth();this.enableRtl&&e&&(o+=r),Zi(this.eLeftSpacer,o),this.eLeftSpacer.classList.toggle("ag-scroller-corner",o<=r)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),t=this.invisibleScrollbar,s=this.gos.get("suppressHorizontalScroll"),r=e&&this.gos.getScrollbarWidth()||0,n=s?0:r===0&&t?16:r;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),ro(this.getGui(),n),ro(this.eViewport,n),ro(this.eContainer,n),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return Ba(this.getViewport(),this.enableRtl)}setScrollPosition(e){Pi(this.getViewport())||this.attemptSettingScrollPosition(e),Wa(this.getViewport(),e,this.enableRtl)}};Ho.TEMPLATE=`<div class="ag-body-horizontal-scroll" aria-hidden="true">
<div class="ag-horizontal-left-spacer" ref="eLeftSpacer"></div>
<div class="ag-body-horizontal-scroll-viewport" ref="eViewport">
<div class="ag-body-horizontal-scroll-container" ref="eContainer"></div>
</div>
<div class="ag-horizontal-right-spacer" ref="eRightSpacer"></div>
</div>`;g([te("eLeftSpacer")],Ho.prototype,"eLeftSpacer",2);g([te("eRightSpacer")],Ho.prototype,"eRightSpacer",2);g([R("columnModel")],Ho.prototype,"columnModel",2);g([R("pinnedRowModel")],Ho.prototype,"pinnedRowModel",2);g([J],Ho.prototype,"postConstruct",1);var L_=Ho,el=class extends Z{postConstruct(){const i=this.checkContainerWidths.bind(this);this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_CHANGED,i),this.addManagedListener(this.eventService,b.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,i),this.addManagedPropertyListener("domLayout",i)}checkContainerWidths(){const i=this.gos.isDomLayout("print"),e=i?0:this.columnModel.getDisplayedColumnsLeftWidth(),t=i?0:this.columnModel.getDisplayedColumnsRightWidth();e!=this.leftWidth&&(this.leftWidth=e,this.eventService.dispatchEvent({type:b.EVENT_LEFT_PINNED_WIDTH_CHANGED})),t!=this.rightWidth&&(this.rightWidth=t,this.eventService.dispatchEvent({type:b.EVENT_RIGHT_PINNED_WIDTH_CHANGED}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}};g([R("columnModel")],el.prototype,"columnModel",2);g([J],el.prototype,"postConstruct",1);el=g([le("pinnedWidthService")],el);var Dn=class extends Z{constructor(){super(...arguments),this.events=[]}postConstruct(){this.rowModel.getType()=="clientSide"&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(i,e){if(this.clientSideRowModel==null){this.eventService.dispatchEvent(i);return}this.events.push(i);const t=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach(s=>this.eventService.dispatchEvent(s)),this.events=[]};e?t():(this.dispatchExpandedDebounced==null&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(t)),this.dispatchExpandedDebounced())}};g([R("animationFrameService")],Dn.prototype,"animationFrameService",2);g([R("rowModel")],Dn.prototype,"rowModel",2);g([J],Dn.prototype,"postConstruct",1);Dn=g([le("rowNodeEventThrottle")],Dn);var I_={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`."}},hr=(i,e)=>{var t;return((t=e.rowModelType)!=null?t:"clientSide")==="clientSide"?{module:"@ag-grid-enterprise/row-grouping"}:null},O_={enableRowGroup:hr,rowGroup:hr,rowGroupIndex:hr,enablePivot:hr,enableValue:hr,pivot:hr,pivotIndex:hr,aggFunc:hr,cellEditor:i=>i.cellEditor==="agRichSelect"||i.cellEditor==="agRichSelectCellEditor"?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:i=>{var e;const t=["columnsMenuTab","generalMenuTab"];return(e=i.menuTabs)!=null&&e.some(s=>t.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:(i,{rowSelection:e})=>e==="multiple"?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],dependencies:(i,{rowSelection:e})=>e==="multiple"?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],dependencies:(i,{rowSelection:e})=>e==="multiple"?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>rn},N_={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,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0},k_=Object.keys(N_),rn={objectName:"colDef",allProperties:k_,docsUrl:"column-properties/",deprecations:I_,validations:O_},G_={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."},groupIncludeFooter:{version:"31.3",message:"Use `groupTotalRow` instead."},groupIncludeTotalFooter:{version:"31.3",message:"Use `grandTotalRow` instead."}},V_={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:" ",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,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1},H_={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:i=>{var e;const t=(e=i.rowModelType)!=null?e:"clientSide";switch(t){case"clientSide":const s=`treeData requires 'getDataPath' in the ${t} row model.`;return i.getDataPath?null:s;case"serverSide":const r=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${t} row model.`;return i.isServerSideGroup&&i.getServerSideGroupKey?null:r}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:i=>{var e;switch((e=i.rowModelType)!=null?e:"clientSide"){case"clientSide":return null;case"serverSide":return i.suppressServerSideInfiniteScroll?"groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll":null}return null}},groupIncludeTotalFooter:{supportedRowModels:["clientSide"]},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:()=>rn,defaultColDef:()=>rn,defaultColGroupDef:()=>rn,autoGroupColumnDef:()=>rn},B_={objectName:"gridOptions",allProperties:[...Ga.ALL_PROPERTIES,...eh.EVENT_CALLBACKS],propertyExceptions:["api","columnApi"],docsUrl:"grid-options/",deprecations:G_,validations:H_},Ye=class{constructor(){this.destroyed=!1,this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new ys,this.globalEventHandlerFactory=i=>(e,t)=>{if(this.destroyed)return;const s=Iu.has(e);if(s&&!i||!s&&i)return;const r=eh.getCallbackForEvent(e),o=this.gridOptions[r];typeof o=="function"&&this.frameworkOverrides.wrapOutgoing(()=>{o(t)})}}get context(){return this.gridOptions.context}init(){this.columnApi=new wn(this.api);const i=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),i),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(i){var e;return(e=this.gridOptions[i])!=null?e:V_[i]}getCallback(i){return this.mergeGridCommonParams(this.gridOptions[i])}exists(i){return K(this.gridOptions[i])}mergeGridCommonParams(i){return i&&(t=>{const s=t;return s.api=this.api,s.columnApi=this.columnApi,s.context=this.context,i(s)})}static toBoolean(i){return typeof i=="boolean"?i:typeof i=="string"?i.toUpperCase()==="TRUE"||i=="":!1}static toNumber(i){if(typeof i=="number")return i;if(typeof i=="string"){const e=parseInt(i);return isNaN(e)?void 0:e}}static toConstrainedNum(i,e){return t=>{const s=Ye.toNumber(t);if(!(s==null||s<i||s>e))return s}}static getCoercedValue(i,e){const t=Ye.PROPERTY_COERCIONS.get(i);return t?t(e):e}static getCoercedGridOptions(i){const e={};return Object.entries(i).forEach(([t,s])=>{const r=Ye.getCoercedValue(t,s);e[t]=r}),e}updateGridOptions({options:i,force:e,source:t="api"}){const s={id:Ye.changeSetId++,properties:[]},r=[];Object.entries(i).forEach(([o,n])=>{t==="api"&&fb[o]&&fe(`${o} is an initial property and cannot be updated.`);const a=Ye.getCoercedValue(o,n),l=e||typeof a=="object"&&t==="api",u=this.gridOptions[o];if(l||u!==a){this.gridOptions[o]=a;const h={type:o,currentValue:a,previousValue:u,changeSet:s,source:t};r.push(h)}}),this.validationService.processGridOptions(this.gridOptions),s.properties=r.map(o=>o.type),r.forEach(o=>{this.gridOptions.debug&&console.log(`AG Grid: Updated property ${o.type} from `,o.previousValue," to ",o.currentValue),this.propertyEventService.dispatchEvent(o)})}addEventListener(i,e){this.propertyEventService.addEventListener(i,e)}removeEventListener(i,e){this.propertyEventService.removeEventListener(i,e)}getScrollbarWidth(){if(this.scrollbarWidth==null){const e=typeof this.gridOptions.scrollbarWidth=="number"&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:tv();e!=null&&(this.scrollbarWidth=e,this.eventService.dispatchEvent({type:b.EVENT_SCROLLBAR_WIDTH_CHANGED}))}return this.scrollbarWidth}isRowModelType(i){return this.gridOptions.rowModelType===i||i==="clientSide"&&be(this.gridOptions.rowModelType)}isDomLayout(i){var e;return((e=this.gridOptions.domLayout)!=null?e:"normal")===i}isRowSelection(){return this.gridOptions.rowSelection==="single"||this.gridOptions.rowSelection==="multiple"}useAsyncEvents(){return!this.get("suppressAsyncEvents")}isGetRowHeightFunction(){return typeof this.gridOptions.getRowHeight=="function"}getRowHeightForNode(i,e=!1,t){if(t==null&&(t=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(e)return{height:t,estimated:!0};const r={node:i,data:i.data},o=this.getCallback("getRowHeight")(r);if(this.isNumeric(o))return o===0&&fe("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,o),estimated:!1}}return i.detail&&this.get("masterDetail")?this.getMasterDetailRowHeight():{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:t,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||be(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const i=this.environment.refreshRowHeightVariable();return i!==-1?i:(console.warn("AG Grid row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(i){return!isNaN(i)&&typeof i=="number"&&isFinite(i)}getDomDataKey(){return this.domDataKey}getDomData(i,e){const t=i[this.getDomDataKey()];return t?t[e]:void 0}setDomData(i,e,t){const s=this.getDomDataKey();let r=i[s];be(r)&&(r={},i[s]=r),r[e]=t}getDocument(){let i=null;return this.gridOptions.getDocument&&K(this.gridOptions.getDocument)?i=this.gridOptions.getDocument():this.eGridDiv&&(i=this.eGridDiv.ownerDocument),i&&K(i)?i:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getActiveDomElement(){return this.getRootNode().activeElement}getAsyncTransactionWaitMillis(){return K(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return this.get("ensureDomOrder")?!1:this.get("animateRows")}isGroupRowsSticky(){return!(this.get("paginateChildRows")||this.get("groupHideOpenParents")||this.isDomLayout("print"))}isColumnsSortingCoupledToGroup(){const i=this.gridOptions.autoGroupColumnDef;return!i?.comparator&&!this.get("treeData")}getGroupAggFiltering(){const i=this.gridOptions.groupAggFiltering;if(typeof i=="function")return this.getCallback("groupAggFiltering");if(i===!0)return()=>!0}getGrandTotalRow(){const i=this.gridOptions.grandTotalRow;if(i)return i;if(this.gridOptions.groupIncludeTotalFooter)return"bottom"}getGroupTotalRowCallback(){const i=this.get("groupTotalRow");if(typeof i=="function")return this.getCallback("groupTotalRow");if(i)return()=>i;const e=this.get("groupIncludeFooter");if(typeof e=="function"){const t=this.getCallback("groupIncludeFooter");return s=>t(s)?"bottom":void 0}return()=>e?"bottom":void 0}isGroupMultiAutoColumn(){return this.gridOptions.groupDisplayType?this.gridOptions.groupDisplayType==="multipleColumns":this.get("groupHideOpenParents")}isGroupUseEntireRow(i){return i?!1:this.gridOptions.groupDisplayType==="groupRows"}getGridCommonParams(){return{api:this.api,columnApi:this.columnApi,context:this.context}}addGridCommonParams(i){const e=i;return e.api=this.api,e.columnApi=this.columnApi,e.context=this.context,e}};Ye.PROPERTY_COERCIONS=new Map([...Ga.BOOLEAN_PROPERTIES.map(i=>[i,Ye.toBoolean]),...Ga.NUMBER_PROPERTIES.map(i=>[i,Ye.toNumber]),["groupAggFiltering",i=>typeof i=="function"?i:Ye.toBoolean(i)],["pageSize",Ye.toConstrainedNum(1,Number.MAX_VALUE)],["autoSizePadding",Ye.toConstrainedNum(0,Number.MAX_VALUE)],["keepDetailRowsCount",Ye.toConstrainedNum(1,Number.MAX_VALUE)],["rowBuffer",Ye.toConstrainedNum(0,Number.MAX_VALUE)],["infiniteInitialRowCount",Ye.toConstrainedNum(1,Number.MAX_VALUE)],["cacheOverflowSize",Ye.toConstrainedNum(1,Number.MAX_VALUE)],["cacheBlockSize",Ye.toConstrainedNum(1,Number.MAX_VALUE)],["serverSideInitialRowCount",Ye.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelPageSize",Ye.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelBufferSize",Ye.toConstrainedNum(0,Number.MAX_VALUE)]]);Ye.changeSetId=0;g([R("gridOptions")],Ye.prototype,"gridOptions",2);g([R("eventService")],Ye.prototype,"eventService",2);g([R("environment")],Ye.prototype,"environment",2);g([R("frameworkOverrides")],Ye.prototype,"frameworkOverrides",2);g([R("eGridDiv")],Ye.prototype,"eGridDiv",2);g([R("validationService")],Ye.prototype,"validationService",2);g([R("gridApi")],Ye.prototype,"api",2);g([J],Ye.prototype,"init",1);g([vi],Ye.prototype,"destroy",1);Ye=g([le("gridOptionsService")],Ye);var Jc=class extends Z{getLocaleTextFunc(){const i=this.gos.getCallback("getLocaleText");if(i)return(t,s,r)=>i({key:t,defaultValue:s,variableValues:r});const e=this.gos.get("localeText");return(t,s,r)=>{let o=e&&e[t];if(o&&r&&r.length){let n=0;for(;!(n>=r.length||o.indexOf("${variable}")===-1);)o=o.replace("${variable}",r[n++])}return o??s}}};Jc=g([le("localeService")],Jc);var lg=class HC extends Vo{constructor(){super(HC.TEMPLATE,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new rd(this.eContainer)),this.ctrlsService.register("fakeVScrollComp",this),this.addManagedListener(this.eventService,b.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onRowContainerHeightChanged.bind(this))}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,s=e&&this.gos.getScrollbarWidth()||0,r=s===0&&t?16:s;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Zi(this.getGui(),r),Zi(this.eViewport,r),Zi(this.eContainer,r),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,s=e.getGridBodyCtrl().getBodyViewportElement(),r=this.getScrollPosition(),o=s.scrollTop;r!=o&&this.setScrollPosition(o,!0)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(e,t){!t&&!Pi(this.getViewport())&&this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}};lg.TEMPLATE=`<div class="ag-body-vertical-scroll" aria-hidden="true">
<div class="ag-body-vertical-scroll-viewport" ref="eViewport">
<div class="ag-body-vertical-scroll-container" ref="eContainer"></div>
</div>
</div>`;g([J],lg.prototype,"postConstruct",1);var W_=lg,tf={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},sf=["january","february","march","april","may","june","july","august","september","october","november","december"],vo=class extends Z{constructor(){super(...arguments),this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}init(){this.groupHideOpenParents=this.gos.get("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",()=>{this.groupHideOpenParents=this.gos.get("groupHideOpenParents")}),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",i=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(sn(i.source))})}processDataTypeDefinitions(){var i;const e=this.getDefaultDataTypes();this.dataTypeDefinitions={},Object.entries(e).forEach(([s,r])=>{this.dataTypeDefinitions[s]=lt(de({},r),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(r)})});const t=(i=this.gos.get("dataTypeDefinitions"))!=null?i:{};this.dataTypeMatchers={},Object.entries(t).forEach(([s,r])=>{const o=this.processDataTypeDefinition(r,t,[s],e);o&&(this.dataTypeDefinitions[s]=o,r.dataTypeMatcher&&(this.dataTypeMatchers[s]=r.dataTypeMatcher))}),this.checkObjectValueHandlers(e),["dateString","text","number","boolean","date"].forEach(s=>{const r=this.dataTypeMatchers[s];r&&delete this.dataTypeMatchers[s],this.dataTypeMatchers[s]=r??e[s].dataTypeMatcher})}mergeDataTypeDefinitions(i,e){const t=de(de({},i),e);return i.columnTypes&&e.columnTypes&&e.appendColumnTypes&&(t.columnTypes=[...this.convertColumnTypes(i.columnTypes),...this.convertColumnTypes(e.columnTypes)]),t}processDataTypeDefinition(i,e,t,s){let r;const o=i.extendsDataType;if(i.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),i.extendsDataType===i.baseDataType){let n=s[o];const a=e[o];if(n&&a&&(n=a),!this.validateDataTypeDefinition(i,n,o))return;r=this.mergeDataTypeDefinitions(n,i)}else{if(t.includes(o)){fe('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');return}const n=e[o];if(!this.validateDataTypeDefinition(i,n,o))return;const a=this.processDataTypeDefinition(n,e,[...t,o],s);if(!a)return;r=this.mergeDataTypeDefinitions(a,i)}return lt(de({},r),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(r)})}validateDataTypeDefinition(i,e,t){return e?e.baseDataType!==i.baseDataType?(fe('The "baseDataType" property of a data type definition must match that of its parent.'),!1):!0:(fe(`The data type definition ${t} does not exist.`),!1)}createGroupSafeValueFormatter(i){if(i.valueFormatter)return e=>{var t,s;if((t=e.node)!=null&&t.group){const r=e.column.getAggFunc();if(r){if(r==="first"||r==="last")return i.valueFormatter(e);if(i.baseDataType==="number"&&r!=="count"){if(typeof e.value=="number")return i.valueFormatter(e);if(typeof e.value=="object"){if(!e.value)return;if("toNumber"in e.value)return i.valueFormatter(lt(de({},e),{value:e.value.toNumber()}));if("value"in e.value)return i.valueFormatter(lt(de({},e),{value:e.value.value}))}}}if(!this.gos.get("suppressGroupMaintainValueType"))return}else if(this.groupHideOpenParents&&e.column.isRowGroupActive()){if(typeof e.value!="string"||(s=i.dataTypeMatcher)!=null&&s.call(i,e.value))return i.valueFormatter(e);if(!this.gos.get("suppressGroupMaintainValueType"))return}return i.valueFormatter(e)}}updateColDefAndGetDataTypeDefinitionColumnType(i,e,t){let{cellDataType:s}=e;const{field:r}=e;if(s===void 0&&(s=i.cellDataType),(s==null||s===!0)&&(s=this.canInferCellDataType(i,e)?this.inferCellDataType(r,t):!1),!s){i.cellDataType=!1;return}const o=this.dataTypeDefinitions[s];if(!o){fe(`Missing data type definition - "${s}"`);return}return i.cellDataType=s,o.groupSafeValueFormatter&&(i.valueFormatter=o.groupSafeValueFormatter),o.valueParser&&(i.valueParser=o.valueParser),o.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(i,o,t),o.columnTypes}updateColDefAndGetColumnType(i,e,t){var s,r;const o=this.updateColDefAndGetDataTypeDefinitionColumnType(i,e,t),n=(r=(s=e.type)!=null?s:o)!=null?r:i.type;return i.type=n,n?this.convertColumnTypes(n):void 0}addColumnListeners(i){if(!this.isWaitingForRowData)return;const e=this.columnStateUpdatesPendingInference[i.getColId()];if(!e)return;const t=s=>{e.add(s.key)};i.addEventListener(Qe.EVENT_STATE_UPDATED,t),this.columnStateUpdateListenerDestroyFuncs.push(()=>i.removeEventListener(Qe.EVENT_STATE_UPDATED,t))}canInferCellDataType(i,e){var t;if(this.rowModel.getType()!=="clientSide")return!1;const s={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(e,s))return!1;const r=e.type===null?i.type:e.type;if(r){const o=(t=this.gos.get("columnTypes"))!=null?t:{};if(this.convertColumnTypes(r).some(a=>{const l=o[a.trim()];return l&&this.doColDefPropsPreventInference(l,s)}))return!1}return!this.doColDefPropsPreventInference(i,s)}doColDefPropsPreventInference(i,e){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([t,s])=>this.doesColDefPropPreventInference(i,e,t,s))}doesColDefPropPreventInference(i,e,t,s){if(!e[t])return!1;const r=i[t];return r===null?(e[t]=!1,!1):s===void 0?!!r:r===s}inferCellDataType(i,e){var t;if(!i)return;let s;const r=this.getInitialData();if(r){const n=i.indexOf(".")>=0&&!this.gos.get("suppressFieldDotNotation");s=an(r,i,n)}else this.initWaitForRowData(e);if(s==null)return;const[o]=(t=Object.entries(this.dataTypeMatchers).find(([n,a])=>a(s)))!=null?t:["object"];return o}getInitialData(){const i=this.gos.get("rowData");if(i?.length)return i[0];if(this.initialData)return this.initialData;{const e=this.rowModel.getRootNode().allLeafChildren;if(e?.length)return e[0].data}return null}initWaitForRowData(i){if(this.columnStateUpdatesPendingInference[i]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const e=this.isColumnTypeOverrideInDataTypeDefinitions;e&&this.columnModel.queueResizeOperations();const t=this.addManagedListener(this.eventService,b.EVENT_ROW_DATA_UPDATE_STARTED,s=>{const{firstRowData:r}=s;if(!r)return;t?.(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(r,e),this.columnStateUpdatesPendingInference={},e&&this.columnModel.processResizeOperations();const o={type:b.EVENT_DATA_TYPES_INFERRED};this.eventService.dispatchEvent(o)})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(i,e){this.initialData=i;const t=[];this.columnStateUpdateListenerDestroyFuncs.forEach(o=>o()),this.columnStateUpdateListenerDestroyFuncs=[];const s={},r={};Object.entries(this.columnStateUpdatesPendingInference).forEach(([o,n])=>{const a=this.columnModel.getGridColumn(o);if(!a)return;const l=a.getColDef();if(!this.columnModel.resetColumnDefIntoColumn(a,"cellDataTypeInferred"))return;const u=a.getColDef();if(e&&u.type&&u.type!==l.type){const h=this.getUpdatedColumnState(a,n);h.rowGroup&&h.rowGroupIndex==null&&(s[o]=h),h.pivot&&h.pivotIndex==null&&(r[o]=h),t.push(h)}}),e&&t.push(...this.columnModel.generateColumnStateForRowGroupAndPivotIndexes(s,r)),t.length&&this.columnModel.applyColumnState({state:t},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(i,e){const t=this.columnModel.getColumnStateFromColDef(i);return e.forEach(s=>{delete t[s],s==="rowGroup"?delete t.rowGroupIndex:s==="pivot"&&delete t.pivotIndex}),t}checkObjectValueHandlers(i){const e=this.dataTypeDefinitions.object,t=i.object;this.hasObjectValueParser=e.valueParser!==t.valueParser,this.hasObjectValueFormatter=e.valueFormatter!==t.valueFormatter}convertColumnTypes(i){let e=[];return i instanceof Array?i.some(s=>typeof s!="string")?console.warn("if colDef.type is supplied an array it should be of type 'string[]'"):e=i:typeof i=="string"?e=i.split(","):console.warn("colDef.type should be of type 'string' | 'string[]'"),e}getDateStringTypeDefinition(i){var e;return i?(e=this.getDataTypeDefinition(i))!=null?e:this.dataTypeDefinitions.dateString:this.dataTypeDefinitions.dateString}getDateParserFunction(i){return this.getDateStringTypeDefinition(i).dateParser}getDateFormatterFunction(i){return this.getDateStringTypeDefinition(i).dateFormatter}getDataTypeDefinition(i){const e=i.getColDef();if(e.cellDataType)return this.dataTypeDefinitions[e.cellDataType]}getBaseDataType(i){var e;return(e=this.getDataTypeDefinition(i))==null?void 0:e.baseDataType}checkType(i,e){var t;if(e==null)return!0;const s=(t=this.getDataTypeDefinition(i))==null?void 0:t.dataTypeMatcher;return s?s(e):!0}validateColDef(i){i.cellDataType==="object"&&(i.valueFormatter===this.dataTypeDefinitions.object.groupSafeValueFormatter&&!this.hasObjectValueFormatter&&fe('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"'),i.editable&&i.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&fe('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(i,e,t){const s=(a,l,u)=>{let h=a.getColDef().valueFormatter;return h===e.groupSafeValueFormatter&&(h=e.valueFormatter),this.valueService.formatValue(a,l,u,h)},r=ze.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()),o=this.localeService.getLocaleTextFunc(),n=a=>{const{filterParams:l}=i;i.filterParams=typeof l=="object"?de(de({},l),a):a};switch(e.baseDataType){case"number":{i.cellEditor="agNumberCellEditor",r&&n({comparator:(a,l)=>{const u=a==null?0:parseInt(a),h=l==null?0:parseInt(l);return u===h?0:u>h?1:-1}});break}case"boolean":{i.cellEditor="agCheckboxCellEditor",i.cellRenderer="agCheckboxCellRenderer",i.suppressKeyboardEvent=a=>!!a.colDef.editable&&a.event.key===k.SPACE,n(r?{valueFormatter:a=>K(a.value)?o(String(a.value),a.value?"True":"False"):o("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(a,l)=>l,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(a,l)=>l===!1,numberOfInputs:0}]});break}case"date":{i.cellEditor="agDateCellEditor",i.keyCreator=a=>s(a.column,a.node,a.value),r&&n({valueFormatter:a=>{const l=s(a.column,a.node,a.value);return K(l)?l:o("blanks","(Blanks)")},treeList:!0,treeListFormatter:(a,l)=>{if(l===1&&a!=null){const u=sf[Number(a)-1];return o(u,tf[u])}return a??o("blanks","(Blanks)")}});break}case"dateString":{i.cellEditor="agDateStringCellEditor",i.keyCreator=l=>s(l.column,l.node,l.value);const a=e.dateParser;n(r?{valueFormatter:l=>{const u=s(l.column,l.node,l.value);return K(u)?u:o("blanks","(Blanks)")},treeList:!0,treeListPathGetter:l=>{const u=a(l??void 0);return u?[String(u.getFullYear()),String(u.getMonth()+1),String(u.getDate())]:null},treeListFormatter:(l,u)=>{if(u===1&&l!=null){const h=sf[Number(l)-1];return o(h,tf[h])}return l??o("blanks","(Blanks)")}}:{comparator:(l,u)=>{const h=a(u);return u==null||h<l?-1:h>l?1:0}});break}case"object":{i.cellEditorParams={useFormatter:!0},i.comparator=(a,l)=>{const u=this.columnModel.getPrimaryColumn(t),h=u?.getColDef();if(!u||!h)return 0;const d=a==null?"":s(u,null,a),c=l==null?"":s(u,null,l);return d===c?0:d>c?1:-1},i.keyCreator=a=>s(a.column,a.node,a.value),r?n({valueFormatter:a=>{const l=s(a.column,a.node,a.value);return K(l)?l:o("blanks","(Blanks)")}}):i.filterValueGetter=a=>s(a.column,a.node,this.valueService.getValue(a.column,a.node));break}}}getDefaultDataTypes(){const i=t=>!!t.match("^\\d{4}-\\d{2}-\\d{2}$"),e=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:t=>{var s,r;return((r=(s=t.newValue)==null?void 0:s.trim)==null?void 0:r.call(s))===""?null:Number(t.newValue)},valueFormatter:t=>t.value==null?"":typeof t.value!="number"||isNaN(t.value)?e("invalidNumber","Invalid Number"):String(t.value),dataTypeMatcher:t=>typeof t=="number"},text:{baseDataType:"text",valueParser:t=>t.newValue===""?null:Ia(t.newValue),dataTypeMatcher:t=>typeof t=="string"},boolean:{baseDataType:"boolean",valueParser:t=>{var s,r;return t.newValue==null?t.newValue:((r=(s=t.newValue)==null?void 0:s.trim)==null?void 0:r.call(s))===""?null:String(t.newValue).toLowerCase()==="true"},valueFormatter:t=>t.value==null?"":String(t.value),dataTypeMatcher:t=>typeof t=="boolean"},date:{baseDataType:"date",valueParser:t=>xi(t.newValue==null?null:String(t.newValue)),valueFormatter:t=>{var s;return t.value==null?"":!(t.value instanceof Date)||isNaN(t.value.getTime())?e("invalidDate","Invalid Date"):(s=Qi(t.value,!1))!=null?s:""},dataTypeMatcher:t=>t instanceof Date},dateString:{baseDataType:"dateString",dateParser:t=>{var s;return(s=xi(t))!=null?s:void 0},dateFormatter:t=>{var s;return(s=Qi(t??null,!1))!=null?s:void 0},valueParser:t=>i(String(t.newValue))?t.newValue:null,valueFormatter:t=>i(String(t.value))?t.value:"",dataTypeMatcher:t=>typeof t=="string"&&i(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:t=>{var s;return(s=Ia(t.value))!=null?s:""}}}}};g([R("rowModel")],vo.prototype,"rowModel",2);g([R("columnModel")],vo.prototype,"columnModel",2);g([R("valueService")],vo.prototype,"valueService",2);g([J],vo.prototype,"init",1);vo=g([le("dataTypeService")],vo);var Co=class extends Z{constructor(){super(...arguments),this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",i=>this.setColumnDefs(i))}start(){this.ctrlsService.whenReady(()=>{const i=this.gos.get("columnDefs");i?this.setColumnsAndData(i):this.waitingForColumns=!0,this.gridReady()})}setColumnsAndData(i){this.columnModel.setColumnDefs(i??[],"gridInitializing"),this.rowModel.start()}gridReady(){this.dispatchGridReadyEvent();const i=ze.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId());new ag("AG Grid",()=>this.gos.get("debug")).log(`initialised successfully, enterprise = ${i}`)}dispatchGridReadyEvent(){const i={type:b.EVENT_GRID_READY};this.eventService.dispatchEvent(i)}setColumnDefs(i){const e=this.gos.get("columnDefs");if(e){if(this.waitingForColumns){this.waitingForColumns=!1,this.setColumnsAndData(e);return}this.columnModel.setColumnDefs(e,sn(i.source))}}};g([R("ctrlsService")],Co.prototype,"ctrlsService",2);g([R("columnModel")],Co.prototype,"columnModel",2);g([R("rowModel")],Co.prototype,"rowModel",2);g([J],Co.prototype,"postConstruct",1);Co=g([le("syncService")],Co);var yo=class extends Z{constructor(){super(...arguments),this.manuallyDisplayed=!1}postConstruct(){this.addManagedListener(this.eventService,b.EVENT_ROW_DATA_UPDATED,()=>this.onRowDataUpdated()),this.addManagedListener(this.eventService,b.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}registerOverlayWrapperComp(i){this.overlayWrapperComp=i,(!this.gos.get("columnDefs")||this.gos.isRowModelType("clientSide")&&!this.gos.get("rowData"))&&this.showLoadingOverlay()}showLoadingOverlay(){if(this.gos.get("suppressLoadingOverlay"))return;const i={},e=this.userComponentFactory.getLoadingOverlayCompDetails(i);this.showOverlay(e,"ag-overlay-loading-wrapper","loadingOverlayComponentParams")}showNoRowsOverlay(){if(this.gos.get("suppressNoRowsOverlay"))return;const i={},e=this.userComponentFactory.getNoRowsOverlayCompDetails(i);this.showOverlay(e,"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams")}showOverlay(i,e,t){const s=i.newAgStackInstance(),r=this.addManagedPropertyListener(t,({currentValue:o})=>{s.then(n=>{n.refresh&&n.refresh(this.gos.addGridCommonParams(de({},o??{})))})});this.manuallyDisplayed=this.columnModel.isReady()&&!this.paginationProxy.isEmpty(),this.overlayWrapperComp.showOverlay(s,e,r)}hideOverlay(){this.manuallyDisplayed=!1,this.overlayWrapperComp.hideOverlay()}showOrHideOverlay(){const i=this.paginationProxy.isEmpty(),e=this.gos.get("suppressNoRowsOverlay");i&&!e?this.showNoRowsOverlay():this.hideOverlay()}onRowDataUpdated(){this.showOrHideOverlay()}onNewColumnsLoaded(){this.columnModel.isReady()&&!this.paginationProxy.isEmpty()&&!this.manuallyDisplayed&&this.hideOverlay()}};g([R("userComponentFactory")],yo.prototype,"userComponentFactory",2);g([R("paginationProxy")],yo.prototype,"paginationProxy",2);g([R("columnModel")],yo.prototype,"columnModel",2);g([J],yo.prototype,"postConstruct",1);yo=g([le("overlayService")],yo);var gi=class extends Z{constructor(){super(...arguments),this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=ci(()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=ci(()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),0),this.onRowSelectedDebounced=ci(()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){var i;this.isClientSideRowModel=this.rowModel.getType()==="clientSide",this.cachedState=(i=this.gos.get("initialState"))!=null?i:{},this.ctrlsService.whenReady(()=>this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnGridReady()));const e=this.addManagedListener(this.eventService,b.EVENT_NEW_COLUMNS_LOADED,({source:r})=>{r==="gridInitializing"&&(e?.(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnColumnsInitialised()))}),t=this.addManagedListener(this.eventService,b.EVENT_ROW_COUNT_READY,()=>{t?.(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnRowCountReady())}),s=this.addManagedListener(this.eventService,b.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,b.EVENT_TOOL_PANEL_VISIBLE_CHANGED,()=>this.updateCachedState("sideBar",this.getSideBarState())),this.addManagedListener(this.eventService,b.EVENT_SIDE_BAR_UPDATED,()=>this.updateCachedState("sideBar",this.getSideBarState()))}setupStateOnColumnsInitialised(){var i;const e=(i=this.gos.get("initialState"))!=null?i:{};this.setColumnState(e),this.setColumnGroupState(e),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState()),this.addManagedListener(this.eventService,b.EVENT_COLUMN_VALUE_CHANGED,()=>this.updateColumnState(["aggregation"])),this.addManagedListener(this.eventService,b.EVENT_COLUMN_MOVED,()=>this.updateColumnState(["columnOrder"])),this.addManagedListener(this.eventService,b.EVENT_COLUMN_PINNED,()=>this.updateColumnState(["columnPinning"])),this.addManagedListener(this.eventService,b.EVENT_COLUMN_RESIZED,()=>this.updateColumnState(["columnSizing"])),this.addManagedListener(this.eventService,b.EVENT_COLUMN_VISIBLE,()=>this.updateColumnState(["columnVisibility"])),this.addManagedListener(this.eventService,b.EVENT_COLUMN_PIVOT_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,b.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,b.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateColumnState(["rowGroup"])),this.addManagedListener(this.eventService,b.EVENT_SORT_CHANGED,()=>this.updateColumnState(["sort"])),this.addManagedListener(this.eventService,b.EVENT_NEW_COLUMNS_LOADED,()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"])),this.addManagedListener(this.eventService,b.EVENT_COLUMN_GROUP_OPENED,()=>this.updateCachedState("columnGroup",this.getColumnGroupState()))}setupStateOnRowCountReady(){var i;const{filter:e,rowGroupExpansion:t,rowSelection:s,pagination:r}=(i=this.gos.get("initialState"))!=null?i:{},o=this.gos.get("advancedFilterModel");(e||o)&&this.setFilterState(e,o),t&&this.setRowGroupExpansionState(t),s&&this.setRowSelectionState(s),r&&this.setPaginationState(r),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState()),this.addManagedListener(this.eventService,b.EVENT_FILTER_CHANGED,()=>this.updateCachedState("filter",this.getFilterState())),this.addManagedListener(this.eventService,b.EVENT_ROW_GROUP_OPENED,()=>this.onRowGroupOpenedDebounced()),this.addManagedListener(this.eventService,b.EVENT_EXPAND_COLLAPSE_ALL,()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState())),this.addManagedListener(this.eventService,b.EVENT_SELECTION_CHANGED,()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()}),this.addManagedListener(this.eventService,b.EVENT_PAGINATION_CHANGED,n=>{(n.newPage||n.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())})}setupStateOnFirstDataRendered(){var i;const{scroll:e,rangeSelection:t,focusedCell:s,columnOrder:r}=(i=this.gos.get("initialState"))!=null?i:{};s&&this.setFocusedCellState(s),t&&this.setRangeSelectionState(t),e&&this.setScrollState(e),this.setColumnPivotState(!!r?.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,b.EVENT_CELL_FOCUSED,()=>this.updateCachedState("focusedCell",this.getFocusedCellState())),this.addManagedListener(this.eventService,b.EVENT_RANGE_SELECTION_CHANGED,o=>{o.finished&&this.updateCachedState("rangeSelection",this.getRangeSelectionState())}),this.addManagedListener(this.eventService,b.EVENT_BODY_SCROLL_END,()=>this.updateCachedState("scroll",this.getScrollState()))}getColumnState(){const i=this.columnModel.isPivotMode(),e=[],t=[],s=[],r=[],o=[],n=[],a=[],l=[],u=[],h=this.columnModel.getColumnState();for(let d=0;d<h.length;d++){const{colId:c,sort:p,sortIndex:y,rowGroup:f,rowGroupIndex:w,aggFunc:_,pivot:P,pivotIndex:T,pinned:D,hide:M,width:O,flex:N}=h[d];u.push(c),p&&(e[y??0]={colId:c,sort:p}),f&&(t[w??0]=c),typeof _=="string"&&s.push({colId:c,aggFunc:_}),P&&(r[T??0]=c),D&&(D==="right"?n:o).push(c),M&&a.push(c),(N||O)&&l.push({colId:c,flex:N??void 0,width:O})}return{sort:e.length?{sortModel:e}:void 0,rowGroup:t.length?{groupColIds:t}:void 0,aggregation:s.length?{aggregationModel:s}:void 0,pivot:r.length||i?{pivotMode:i,pivotColIds:r}:void 0,columnPinning:o.length||n.length?{leftColIds:o,rightColIds:n}:void 0,columnVisibility:a.length?{hiddenColIds:a}:void 0,columnSizing:l.length?{columnSizingModel:l}:void 0,columnOrder:u.length?{orderedColIds:u}:void 0}}setColumnState(i){const{sort:e,rowGroup:t,aggregation:s,pivot:r,columnPinning:o,columnVisibility:n,columnSizing:a,columnOrder:l}=i,u={},h=y=>{let f=u[y];return f||(f={colId:y},u[y]=f,f)};e&&e.sortModel.forEach(({colId:y,sort:f},w)=>{const _=h(y);_.sort=f,_.sortIndex=w}),t&&t.groupColIds.forEach((y,f)=>{const w=h(y);w.rowGroup=!0,w.rowGroupIndex=f}),s&&s.aggregationModel.forEach(({colId:y,aggFunc:f})=>{h(y).aggFunc=f}),r&&(r.pivotColIds.forEach((y,f)=>{const w=h(y);w.pivot=!0,w.pivotIndex=f}),this.gos.updateGridOptions({options:{pivotMode:r.pivotMode},source:"gridInitializing"})),o&&(o.leftColIds.forEach(y=>{h(y).pinned="left"}),o.rightColIds.forEach(y=>{h(y).pinned="right"})),n&&n.hiddenColIds.forEach(y=>{h(y).hide=!0}),a&&a.columnSizingModel.forEach(({colId:y,flex:f,width:w})=>{const _=h(y);_.flex=f??null,_.width=w});const d=l?.orderedColIds,c=!!d?.length,p=c?d.map(y=>h(y)):Object.values(u);if(p.length){this.columnStates=p;const y={sort:null,sortIndex:null,rowGroup:null,rowGroupIndex:null,aggFunc:null,pivot:null,pivotIndex:null,pinned:null,hide:null,flex:null};this.columnModel.applyColumnState({state:p,applyOrder:c,defaultState:y},"gridInitializing")}}setColumnPivotState(i){const e=this.columnStates;this.columnStates=void 0;const t=this.columnGroupStates;if(this.columnGroupStates=void 0,!!this.columnModel.isSecondaryColumnsPresent()){if(e){let s=[];for(const r of e)this.columnModel.getSecondaryColumn(r.colId)&&s.push(r);this.columnModel.applyColumnState({state:s,applyOrder:i},"gridInitializing")}t&&this.columnModel.setColumnGroupState(t,"gridInitializing")}}getColumnGroupState(){const i=this.columnModel.getColumnGroupState(),e=[];return i.forEach(({groupId:t,open:s})=>{s&&e.push(t)}),e.length?{openColumnGroupIds:e}:void 0}setColumnGroupState(i){var e;if(!i.hasOwnProperty("columnGroup"))return;const t=new Set((e=i.columnGroup)==null?void 0:e.openColumnGroupIds),r=this.columnModel.getColumnGroupState().map(({groupId:o})=>{const n=t.has(o);return n&&t.delete(o),{groupId:o,open:n}});t.forEach(o=>{r.push({groupId:o,open:!0})}),r.length&&(this.columnGroupStates=r),this.columnModel.setColumnGroupState(r,"gridInitializing")}getFilterState(){var i;let e=this.filterManager.getFilterModel();e&&Object.keys(e).length===0&&(e=void 0);const t=(i=this.filterManager.getAdvancedFilterModel())!=null?i:void 0;return e||t?{filterModel:e,advancedFilterModel:t}:void 0}setFilterState(i,e){const{filterModel:t,advancedFilterModel:s}=i??{advancedFilterModel:e};t&&this.filterManager.setFilterModel(t,"columnFilter"),s&&this.filterManager.setAdvancedFilterModel(s)}getRangeSelectionState(){var i;const e=(i=this.rangeService)==null?void 0:i.getCellRanges().map(t=>{const{id:s,type:r,startRow:o,endRow:n,columns:a,startColumn:l}=t;return{id:s,type:r,startRow:o,endRow:n,colIds:a.map(u=>u.getColId()),startColId:l.getColId()}});return e?.length?{cellRanges:e}:void 0}setRangeSelectionState(i){if(!this.gos.get("enableRangeSelection")||!this.rangeService)return;const e=[];i.cellRanges.forEach(t=>{const s=[];if(t.colIds.forEach(o=>{const n=this.columnModel.getGridColumn(o);n&&s.push(n)}),!s.length)return;let r=this.columnModel.getGridColumn(t.startColId);if(!r){const o=this.columnModel.getAllDisplayedColumns(),n=new Set(s);r=o.find(a=>n.has(a))}e.push(lt(de({},t),{columns:s,startColumn:r}))}),this.rangeService.setCellRanges(e)}getScrollState(){var i,e,t;if(!this.isClientSideRowModel)return;const s=(i=this.ctrlsService.getGridBodyCtrl())==null?void 0:i.getScrollFeature(),{left:r}=(e=s?.getHScrollPosition())!=null?e:{left:0},{top:o}=(t=s?.getVScrollPosition())!=null?t:{top:0};return o||r?{top:o,left:r}:void 0}setScrollState(i){var e;if(!this.isClientSideRowModel)return;const{top:t,left:s}=i;(e=this.ctrlsService.getGridBodyCtrl())==null||e.getScrollFeature().setScrollPosition(t,s)}getSideBarState(){var i,e;return(e=(i=this.sideBarService)==null?void 0:i.getSideBarComp())==null?void 0:e.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const i=this.focusService.getFocusedCell();if(i){const{column:e,rowIndex:t,rowPinned:s}=i;return{colId:e.getColId(),rowIndex:t,rowPinned:s}}}setFocusedCellState(i){if(!this.isClientSideRowModel)return;const{colId:e,rowIndex:t,rowPinned:s}=i;this.focusService.setFocusedCell({column:this.columnModel.getGridColumn(e),rowIndex:t,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const i=this.paginationProxy.getCurrentPage(),e=this.gos.get("paginationAutoPageSize")?void 0:this.paginationProxy.getPageSize();if(!(!i&&!e))return{page:i,pageSize:e}}setPaginationState(i){i.pageSize&&!this.gos.get("paginationAutoPageSize")&&this.paginationProxy.setPageSize(i.pageSize,"initialState"),typeof i.page=="number"&&this.paginationProxy.setPage(i.page)}getRowSelectionState(){var i;const e=this.selectionService.getSelectionState();return!e||!Array.isArray(e)&&(e.selectAll===!1||e.selectAllChildren===!1)&&!((i=e?.toggledNodes)!=null&&i.length)?void 0:e}setRowSelectionState(i){this.selectionService.setSelectionState(i,"gridInitializing")}getRowGroupExpansionState(){const i=this.expansionService.getExpandedRows();return i.length?{expandedRowGroupIds:i}:void 0}setRowGroupExpansionState(i){this.expansionService.expandRows(i.expandedRowGroupIds)}updateColumnState(i){const e=this.getColumnState();let t=!1;Object.entries(e).forEach(([s,r])=>{Dc(r,this.cachedState[s])||(t=!0)}),this.cachedState=de(de({},this.cachedState),e),t&&this.dispatchStateUpdateEvent(i)}updateCachedState(i,e){const t=this.cachedState[i];this.setCachedStateValue(i,e),Dc(e,t)||this.dispatchStateUpdateEvent([i])}setCachedStateValue(i,e){this.cachedState=lt(de({},this.cachedState),{[i]:e})}refreshStaleState(){this.staleStateKeys.forEach(i=>{switch(i){case"rowSelection":this.setCachedStateValue(i,this.getRowSelectionState());break}}),this.staleStateKeys.clear()}dispatchStateUpdateEvent(i){this.suppressEvents||(i.forEach(e=>this.queuedUpdateSources.add(e)),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const i=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear();const e={type:b.EVENT_STATE_UPDATED,sources:i,state:this.cachedState};this.eventService.dispatchEvent(e)}suppressEventsAndDispatchInitEvent(i){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),i(),setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))})}};g([R("filterManager")],gi.prototype,"filterManager",2);g([R("ctrlsService")],gi.prototype,"ctrlsService",2);g([R("focusService")],gi.prototype,"focusService",2);g([R("columnModel")],gi.prototype,"columnModel",2);g([R("paginationProxy")],gi.prototype,"paginationProxy",2);g([R("rowModel")],gi.prototype,"rowModel",2);g([R("selectionService")],gi.prototype,"selectionService",2);g([R("expansionService")],gi.prototype,"expansionService",2);g([R("columnAnimationService")],gi.prototype,"columnAnimationService",2);g([Ke("sideBarService")],gi.prototype,"sideBarService",2);g([Ke("rangeService")],gi.prototype,"rangeService",2);g([J],gi.prototype,"postConstruct",1);gi=g([le("stateService")],gi);var tl=class extends Z{init(){this.processGridOptions(this.gridOptions)}processGridOptions(i){this.processOptions(i,B_)}processColumnDefs(i){this.processOptions(i,rn)}processOptions(i,e){const{validations:t,deprecations:s,allProperties:r,propertyExceptions:o,objectName:n,docsUrl:a}=e;r&&this.gridOptions.suppressPropertyNamesCheck!==!0&&this.checkProperties(i,[...o??[],...Object.keys(s)],r,n,a);const l=new Set;Object.keys(i).forEach(h=>{var d;const c=s[h];if(c)if("renamed"in c){const{renamed:T,version:D}=c;l.add(`As of v${D}, ${String(h)} is deprecated. Please use ${String(T)} instead.`),i[T]=i[h]}else{const{message:T,version:D}=c;l.add(`As of v${D}, ${String(h)} is deprecated. ${T??""}`)}const p=i[h];if(p==null||p===!1)return;const y=t[h];let f;if(y)if(typeof y=="function"){const T=y(i,this.gridOptions);if(!T)return;if("objectName"in T){const D=i[h];if(Array.isArray(D)){D.forEach(M=>{this.processOptions(M,T)});return}this.processOptions(i[h],T);return}f=T}else f=y;else return;const{module:w,dependencies:_,supportedRowModels:P}=f;if(P){const T=(d=this.gridOptions.rowModelType)!=null?d:"clientSide";if(!P.includes(T)){l.add(`${String(h)} is not supported with the '${T}' row model.`);return}}if(w){const T=Array.isArray(w)?w:[w];let D=!0;if(T.forEach(M=>{ze.__assertRegistered(M,String(h),this.context.getGridId())||(D=!1,l.add(`${String(h)} is only available when ${M} is loaded.`))}),!D)return}if(_){const T=this.checkForWarning(h,_,i);if(T){l.add(T);return}}}),l.size>0&&l.forEach(h=>{fe(h)})}checkForWarning(i,e,t){if(typeof e=="function")return e(t,this.gridOptions);const r=Object.entries(e).find(([a,l])=>{const u=t[a];return!l.includes(u)});if(!r)return null;const[o,n]=r;return n.length>1?`'${String(i)}' requires '${o}' to be one of [${n.join(", ")}].`:`'${String(i)}' requires '${o}' to be ${n[0]}.`}checkProperties(i,e,t,s,r){const o=["__ob__","__v_skip","__metadata__"],n=fv(Object.getOwnPropertyNames(i),[...o,...e,...t],t);if(si(n,(a,l)=>{fe(`invalid ${s} property '${a}' did you mean any of these: ${l.slice(0,8).join(", ")}`)}),Object.keys(n).length>0&&r){const a=this.getFrameworkOverrides().getDocLink(r);fe(`to see all the valid ${s} properties please check: ${a}`)}}};g([R("gridOptions")],tl.prototype,"gridOptions",2);g([J],tl.prototype,"init",1);tl=g([le("validationService")],tl);var dh=class extends Z{constructor(){super(...arguments),this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new cp(this.getFrameworkOverrides())}addEventListener(i,e){const t=this.frameworkEventWrappingService.wrap(e),s=this.gos.useAsyncEvents()&&!Iu.has(i),r=s?this.asyncEventListeners:this.syncEventListeners;r.has(i)||r.set(i,new Set),r.get(i).add(t),this.eventService.addEventListener(i,t,s)}removeEventListener(i,e){var t;const s=this.frameworkEventWrappingService.unwrap(e),r=this.asyncEventListeners.get(i),o=!!r?.delete(s);o||(t=this.syncEventListeners.get(i))==null||t.delete(s),this.eventService.removeEventListener(i,s,o)}addGlobalListener(i){const e=this.frameworkEventWrappingService.wrapGlobal(i);if(this.gos.useAsyncEvents()){const s=(o,n)=>{Iu.has(o)&&e(o,n)},r=(o,n)=>{Iu.has(o)||e(o,n)};this.globalEventListenerPairs.set(i,{syncListener:s,asyncListener:r}),this.eventService.addGlobalListener(s,!1),this.eventService.addGlobalListener(r,!0)}else this.syncGlobalEventListeners.add(e),this.eventService.addGlobalListener(e,!1)}removeGlobalListener(i){const e=this.frameworkEventWrappingService.unwrapGlobal(i);if(this.globalEventListenerPairs.has(e)){const{syncListener:s,asyncListener:r}=this.globalEventListenerPairs.get(e);this.eventService.removeGlobalListener(s,!1),this.eventService.removeGlobalListener(r,!0),this.globalEventListenerPairs.delete(i)}else this.syncGlobalEventListeners.delete(e),this.eventService.removeGlobalListener(e,!1)}destroyEventListeners(i,e){i.forEach((t,s)=>{t.forEach(r=>this.eventService.removeEventListener(s,r,e)),t.clear()}),i.clear()}destroyGlobalListeners(i,e){i.forEach(t=>this.eventService.removeGlobalListener(t,e)),i.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach(({syncListener:i,asyncListener:e})=>{this.eventService.removeGlobalListener(i,!1),this.eventService.removeGlobalListener(e,!0)}),this.globalEventListenerPairs.clear()}};g([J],dh.prototype,"postConstruct",1);dh=g([le("apiEventService")],dh);var ug=class extends Se{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const i=this.selectPageSizeComp.getValue();if(!i)return;const e=Number(i);isNaN(e)||e<1||e===this.paginationProxy.getPageSize()||(this.paginationProxy.setPageSize(e,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}init(){this.addManagedPropertyListener("paginationPageSizeSelector",()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedListener(this.eventService,b.EVENT_PAGINATION_CHANGED,i=>this.handlePaginationChanged(i))}handlePaginationChanged(i){if(!this.selectPageSizeComp||!i?.newPageSize)return;const e=this.paginationProxy.getPageSize();this.getPageSizeSelectorValues().includes(e)?this.selectPageSizeComp.setValue(e.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(i){this.selectPageSizeComp&&this.reset(),i&&(this.reloadPageSizesSelector(),this.selectPageSizeComp&&this.appendChild(this.selectPageSizeComp))}reset(){Rt(this.getGui()),this.selectPageSizeComp&&(this.destroyBean(this.selectPageSizeComp),this.selectPageSizeComp=void 0)}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get("paginationPageSizeSelector")!==!1}reloadPageSizesSelector(){const i=this.getPageSizeSelectorValues(),e=this.paginationProxy.getPageSize(),t=!e||!i.includes(e);t&&(i.unshift(""),fe(`The paginationPageSize grid option is set to a value that is not in the list of page size options.
Please make sure that the paginationPageSize grid option is set to one of the values in the
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(),r=s("pageSizeSelectorLabel","Page Size:"),o=i.map(a=>({value:String(a),text:String(a)})),n=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new Xh).addOptions(o).setValue(String(t?"":e)).setAriaLabel(n).setLabel(r).onValueChange(()=>this.handlePageSizeItemSelected()),this.hasEmptyOption=t}getPageSizeSelectorValues(){const i=[20,50,100],e=this.gos.get("paginationPageSizeSelector");return!Array.isArray(e)||!this.validateValues(e)?i:[...e].sort((t,s)=>t-s)}validateValues(i){if(!i.length)return fe(`The paginationPageSizeSelector grid option is an empty array. This is most likely a mistake.
If you want to hide the page size selector, please set the paginationPageSizeSelector to false.`),!1;for(let e=0;e<i.length;e++){const t=i[e],s=typeof t=="number",r=t>0;if(!s)return fe(`The paginationPageSizeSelector grid option contains a non-numeric value.
Please make sure that all values in the paginationPageSizeSelector array are numbers.`),!1;if(!r)return fe(`The paginationPageSizeSelector grid option contains a negative number or zero.
Please make sure that all values in the paginationPageSizeSelector array are positive.`),!1}return!0}destroy(){this.toggleSelectDisplay(!1),super.destroy()}};g([R("paginationProxy")],ug.prototype,"paginationProxy",2);g([J],ug.prototype,"init",1);var il=class extends Z{constructor(){super(),this.descriptionContainer=null,this.announceValue=ci(this.announceValue.bind(this),200)}postConstruct(){const i=this.gos.getDocument(),e=this.descriptionContainer=i.createElement("div");e.classList.add("ag-aria-description-container"),mp(e,"polite"),Wm(e,"additions text"),Bm(e,!0),this.eGridDiv.appendChild(e)}announceValue(i){this.descriptionContainer&&(this.descriptionContainer.textContent="",setTimeout(()=>{this.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=i)},50))}destroy(){super.destroy();const{descriptionContainer:i}=this;i&&(Rt(i),i.parentElement&&i.parentElement.removeChild(i)),this.descriptionContainer=null,this.eGridDiv=null}};g([R("eGridDiv")],il.prototype,"eGridDiv",2);g([J],il.prototype,"postConstruct",1);il=g([le("ariaAnnouncementService")],il);var ep=class{};ep.gridOptions=void 0;var j_=1,U_=class{create(i,e,t,s,r){var o;let n={};ep.gridOptions?(Ei(n,ep.gridOptions,!0,!0),n=de(de({},n),e)):n=e;const a=Ye.getCoercedGridOptions(n),l=!!a.debug,u=(o=a.gridId)!=null?o:String(j_++),h=this.getRegisteredModules(r,u),d=this.createBeansList(a.rowModelType,h,u),c=this.createProvidedBeans(i,a,r);if(!d){Zr("Failed to create grid.");return}const p={providedBeanInstances:c,beanClasses:d,debug:l,gridId:u},y=new ag("Context",()=>p.debug),f=new eb(p,y),w=f.getBean("beans");return this.registerModuleUserComponents(w,h),this.registerStackComponents(w,h),this.registerControllers(w,h),t(f),w.syncService.start(),s&&s(f),f.getBean("gridApi")}registerControllers(i,e){e.forEach(t=>{t.controllers&&t.controllers.forEach(s=>i.ctrlsFactory.register(s))})}registerStackComponents(i,e){const t=this.createAgStackComponentsList(e);i.agStackComponentsRegistry.setupComponents(t)}getRegisteredModules(i,e){const t=i?i.modules:null,s=ze.__getRegisteredModules(e),r=[],o={},n=(a,l,u)=>{(d=>{o[d.moduleName]||(o[d.moduleName]=!0,r.push(d),ze.__register(d,a,u))})(l),l.dependantModules&&l.dependantModules.forEach(d=>n(a,d,u))};return t&&t.forEach(a=>n(!0,a,e)),s&&s.forEach(a=>n(!ze.__isPackageBased(),a,void 0)),r}registerModuleUserComponents(i,e){this.extractModuleEntity(e,s=>s.userComponents?s.userComponents:[]).forEach(s=>{i.userComponentRegistry.registerDefaultComponent(s.componentName,s.componentClass)})}createProvidedBeans(i,e,t){let s=t?t.frameworkOverrides:null;be(s)&&(s=new OC);const r={gridOptions:e,eGridDiv:i,globalEventListener:t?t.globalEventListener:null,globalSyncEventListener:t?t.globalSyncEventListener:null,frameworkOverrides:s};return t&&t.providedBeanInstances&&Object.assign(r,t.providedBeanInstances),r}createAgStackComponentsList(i){let e=[{componentName:"AgCheckbox",componentClass:qh},{componentName:"AgRadioButton",componentClass:Lv},{componentName:"AgToggleButton",componentClass:TC},{componentName:"AgInputTextField",componentClass:Fo},{componentName:"AgInputTextArea",componentClass:p_},{componentName:"AgInputNumberField",componentClass:zp},{componentName:"AgInputDateField",componentClass:g_},{componentName:"AgInputRange",componentClass:f_},{componentName:"AgRichSelect",componentClass:cd},{componentName:"AgSelect",componentClass:Xh},{componentName:"AgSlider",componentClass:v_},{componentName:"AgGridBody",componentClass:Es},{componentName:"AgHeaderRoot",componentClass:h_},{componentName:"AgSortIndicator",componentClass:$p},{componentName:"AgPagination",componentClass:Ai},{componentName:"AgPageSizeSelector",componentClass:ug},{componentName:"AgOverlayWrapper",componentClass:M_},{componentName:"AgGroupComponent",componentClass:C_},{componentName:"AgRowContainer",componentClass:Gn},{componentName:"AgFakeHorizontalScroll",componentClass:L_},{componentName:"AgFakeVerticalScroll",componentClass:W_},{componentName:"AgAutocomplete",componentClass:E_}];const t=this.extractModuleEntity(i,s=>s.agStackComponents?s.agStackComponents:[]);return e=e.concat(t),e}createBeansList(i="clientSide",e,t){const s=e.filter(l=>!l.rowModel||l.rowModel===i),r={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(!r[i]){Zr("Could not find row model for rowModelType = "+i);return}if(!ze.__assertRegistered(r[i],`rowModelType = '${i}'`,t))return;const o=[Ae,xn,qc,Za,bn,Ne,rh,hh,qa,zc,yr,_n,za,Jc,tl,$a,Ua,Lc,ys,Ye,qs,fo,Ji,Xt,co,Ka,Vi,ah,Na,go,ri,uh,Sr,lh,po,wr,Re,wn,qe,Ys,Qa,br,nh,Cn,mo,Xc,Xa,En,ka,Sn,yn,ks,Ic,Qc,Ja,Ns,Rn,lo,el,Dn,Zc,vo,Di,Co,yo,gi,Ya,dh,il,es],n=this.extractModuleEntity(s,l=>l.beans?l.beans:[]);o.push(...n);const a=[];return o.forEach(l=>{a.indexOf(l)<0&&a.push(l)}),a}extractModuleEntity(i,e){return[].concat(...i.map(e))}},z_=class{wrap(i,e,t=[],s){const r=this.createWrapper(i,s);return e.forEach(o=>{this.createMethod(r,o,!0)}),t.forEach(o=>{this.createMethod(r,o,!1)}),r}unwrap(i){return i}createMethod(i,e,t){i.addMethod(e,this.createMethodProxy(i,e,t))}createMethodProxy(i,e,t){return function(){return i.hasMethod(e)?i.callMethod(e,arguments):(t&&console.warn("AG Grid: Framework component is missing the method "+e+"()"),null)}}},$n=typeof global>"u"?{}:global;$n.HTMLElement=typeof HTMLElement>"u"?{}:HTMLElement;$n.HTMLButtonElement=typeof HTMLButtonElement>"u"?{}:HTMLButtonElement;$n.HTMLSelectElement=typeof HTMLSelectElement>"u"?{}:HTMLSelectElement;$n.HTMLInputElement=typeof HTMLInputElement>"u"?{}:HTMLInputElement;$n.Node=typeof Node>"u"?{}:Node;$n.MouseEvent=typeof MouseEvent>"u"?{}:MouseEvent;var hg=class Ea{constructor(e,t,s,r,o,n){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=e,this.gos=t,this.eventService=s,this.columnModel=r,this.beans=n,this.selectionService=o,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=Ea.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return ye.cloneObject(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(e){if(typeof e=="string"){console.warn("AG Grid: rowData must be an array.");return}this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e);const t=this.rootNode,s=this.rootNode.sibling;t.childrenAfterFilter=null,t.childrenAfterGroup=null,t.childrenAfterAggFilter=null,t.childrenAfterSort=null,t.childrenMapped=null,t.updateHasChildren(),this.nextId=0,this.allNodesMap={},e?t.allLeafChildren=e.map(r=>this.createNode(r,this.rootNode,Ea.TOP_LEVEL)):(t.allLeafChildren=[],t.childrenAfterGroup=[]),s&&(s.childrenAfterFilter=t.childrenAfterFilter,s.childrenAfterGroup=t.childrenAfterGroup,s.childrenAfterAggFilter=t.childrenAfterAggFilter,s.childrenAfterSort=t.childrenAfterSort,s.childrenMapped=t.childrenMapped,s.allLeafChildren=t.allLeafChildren)}updateRowData(e,t){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const s={remove:[],update:[],add:[]},r=[];return this.executeRemove(e,s,r),this.executeUpdate(e,s,r),this.executeAdd(e,s),this.updateSelection(r,"rowDataChanged"),t&&ye.sortRowNodesByOrder(this.rootNode.allLeafChildren,t),s}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){const t={type:b.EVENT_ROW_DATA_UPDATE_STARTED,firstRowData:e?.length?e[0]:null};this.eventService.dispatchEvent(t)}updateSelection(e,t){const s=e.length>0;if(s&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),s){const r={type:b.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(r)}}executeAdd(e,t){var s;const{add:r,addIndex:o}=e;if(ye.missingOrEmpty(r))return;const n=r.map(a=>this.createNode(a,this.rootNode,Ea.TOP_LEVEL));if(typeof o=="number"&&o>=0){const{allLeafChildren:a}=this.rootNode,l=a.length;let u=o;if(this.gos.get("treeData")&&o>0&&l>0){for(let p=0;p<l;p++)if(((s=a[p])==null?void 0:s.rowIndex)==o-1){u=p+1;break}}const d=a.slice(0,u),c=a.slice(u,a.length);this.rootNode.allLeafChildren=[...d,...n,...c]}else this.rootNode.allLeafChildren=[...this.rootNode.allLeafChildren,...n];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),t.add=n}executeRemove(e,t,s){const{remove:r}=e;if(ye.missingOrEmpty(r))return;const o={};r.forEach(n=>{const a=this.lookupRowNode(n);a&&(a.isSelected()&&s.push(a),a.clearRowTopAndRowIndex(),o[a.id]=!0,delete this.allNodesMap[a.id],t.remove.push(a))}),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter(n=>!o[n.id]),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(e,t,s){const{update:r}=e;ye.missingOrEmpty(r)||r.forEach(o=>{const n=this.lookupRowNode(o);n&&(n.updateData(o),!n.selectable&&n.isSelected()&&s.push(n),this.setMasterForRow(n,o,Ea.TOP_LEVEL,!1),t.update.push(n))})}lookupRowNode(e){const t=this.gos.getCallback("getRowId");let s;if(t){const r=t({data:e,level:0});if(s=this.allNodesMap[r],!s)return console.error(`AG Grid: could not find row id=${r}, data item was not found for this id`),null}else if(s=this.rootNode.allLeafChildren.find(r=>r.data===e),!s)return console.error("AG Grid: could not find data item as object was not found",e),console.error("Consider using getRowId to help the Grid find matching row data"),null;return s||null}createNode(e,t,s){const r=new Me(this.beans);r.group=!1,this.setMasterForRow(r,e,s,!0);const o=this.gos.get("suppressParentsInRowNodes");return t&&!o&&(r.parent=t),r.level=s,r.setDataAndId(e,this.nextId.toString()),this.allNodesMap[r.id]&&console.warn(`AG Grid: duplicate node id '${r.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[r.id]=r,this.nextId++,r}setMasterForRow(e,t,s,r){if(this.gos.get("treeData"))e.setMaster(!1),r&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const a=this.gos.get("isRowMaster");a?e.setMaster(a(t)):e.setMaster(!0)}else e.setMaster(!1);if(r){const a=this.columnModel.getRowGroupColumns(),l=a?a.length:0,u=s+l;e.expanded=e.master?this.isExpanded(u):!1}}}isExpanded(e){const t=this.gos.get("groupDefaultExpanded");return t===-1?!0:e<t}};hg.TOP_LEVEL=0;hg.ROOT_NODE_ID="ROOT_NODE_ID";var Y_=hg,fi=class extends Z{constructor(){super(...arguments),this.onRowHeightChanged_debounced=ye.debounce(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}init(){const i=this.refreshModel.bind(this,{step:"group"}),e=!this.gos.get("suppressAnimationFrame"),t=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:e});this.addManagedListener(this.eventService,b.EVENT_NEW_COLUMNS_LOADED,t),this.addManagedListener(this.eventService,b.EVENT_COLUMN_ROW_GROUP_CHANGED,i),this.addManagedListener(this.eventService,b.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:"pivot"})),this.addManagedListener(this.eventService,b.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_COLUMN_PIVOT_MODE_CHANGED,i),this.addManagedListener(this.eventService,b.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanges.bind(this)),this.addManagedListener(this.eventService,b.EVENT_GRID_READY,()=>this.onGridReady()),this.addPropertyListeners(),this.rootNode=new Me(this.beans),this.nodeManager=new Y_(this.rootNode,this.gos,this.eventService,this.columnModel,this.selectionService,this.beans)}addPropertyListeners(){const i=new Set(["treeData","masterDetail"]),e=new Set(["suppressParentsInRowNodes","groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),t=new Set(["excludeChildrenWhenTreeDataFiltering"]),s=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),r=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),o=new Set(["postSortRows","groupDisplayType","accentedSort"]),n=new Set([]),a=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),l=[...i,...e,...t,...s,...s,...r,...o,...n,...a];this.addManagedPropertyListeners(l,u=>{var h;const d=(h=u.changeSet)==null?void 0:h.properties;if(!d)return;const c=p=>d.some(y=>p.has(y));if(c(i)){this.setRowData(this.rootNode.allLeafChildren.map(p=>p.data));return}if(c(e)){this.refreshModel({step:"group"});return}if(c(t)){this.refreshModel({step:"filter"});return}if(c(s)){this.refreshModel({step:"pivot"});return}if(c(r)){this.refreshModel({step:"aggregate"});return}if(c(o)){this.refreshModel({step:"sort"});return}if(c(n)){this.refreshModel({step:"filter_aggregates"});return}c(a)&&this.refreshModel({step:"map"})}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const i=this.gos.get("rowData");i&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(i))}ensureRowHeightsValid(i,e,t,s){let r,o=!1;do{r=!1;const n=this.getRowIndexAtPixel(i),a=this.getRowIndexAtPixel(e),l=Math.max(n,t),u=Math.min(a,s);for(let h=l;h<=u;h++){const d=this.getRow(h);if(d.rowHeightEstimated){const c=this.gos.getRowHeightForNode(d);d.setRowHeight(c.height),r=!0,o=!0}}r&&this.setRowTopAndRowIndex()}while(r);return o}setRowTopAndRowIndex(){const i=this.environment.getDefaultRowHeight();let e=0;const t=new Set,s=this.gos.isDomLayout("normal");for(let r=0;r<this.rowsToDisplay.length;r++){const o=this.rowsToDisplay[r];if(o.id!=null&&t.add(o.id),o.rowHeight==null){const n=this.gos.getRowHeightForNode(o,s,i);o.setRowHeight(n.height,n.estimated)}o.setRowTop(e),o.setRowIndex(r),e+=o.rowHeight}return t}clearRowTopAndRowIndex(i,e){const t=i.isActive(),s=o=>{o&&o.id!=null&&!e.has(o.id)&&o.clearRowTopAndRowIndex()},r=o=>{if(s(o),s(o.detailNode),s(o.sibling),o.hasChildren()&&o.childrenAfterGroup){const n=o.level==-1;t&&!n&&!o.expanded||o.childrenAfterGroup.forEach(r)}};r(this.rootNode)}ensureRowsAtPixel(i,e,t=0){const s=this.getRowIndexAtPixel(e),r=this.getRow(s),o=!this.gos.get("suppressAnimationFrame");return r===i[0]?!1:(i.forEach(n=>{ye.removeFromArray(this.rootNode.allLeafChildren,n)}),i.forEach((n,a)=>{ye.insertIntoArray(this.rootNode.allLeafChildren,n,Math.max(s+t,0)+a)}),this.refreshModel({step:"group",keepRenderedRows:!0,keepEditingRows:!0,animate:o}),!0)}highlightRowAtPixel(i,e){const t=e!=null?this.getRowIndexAtPixel(e):null,s=t!=null?this.getRow(t):null;if(!s||!i||s===i||e==null){this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null);return}const r=this.getHighlightPosition(e,s);this.lastHighlightedRow&&this.lastHighlightedRow!==s&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),s.setHighlighted(r),this.lastHighlightedRow=s}getHighlightPosition(i,e){if(!e){const r=this.getRowIndexAtPixel(i);if(e=this.getRow(r||0),!e)return 1}const{rowTop:t,rowHeight:s}=e;return i-t<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 e=this.rootNode.childrenAfterAggFilter;return e?e.length:0}getTopLevelRowDisplayedIndex(i){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return i;let t=this.rootNode.childrenAfterSort[i];if(this.gos.get("groupHideOpenParents"))for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex}getRowBounds(i){if(ye.missing(this.rowsToDisplay))return null;const e=this.rowsToDisplay[i];return e?{rowTop:e.rowTop,rowHeight:e.rowHeight}:null}onRowGroupOpened(){const i=this.gos.isAnimateRows();this.refreshModel({step:"map",keepRenderedRows:!0,animate:i})}onFilterChanged(i){if(i.afterDataChange)return;const e=this.gos.isAnimateRows(),s=i.columns.length===0||i.columns.some(r=>r.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:s,keepRenderedRows:!0,animate:e})}onSortChanged(){const i=this.gos.isAnimateRows();this.refreshModel({step:"sort",keepRenderedRows:!0,animate:i,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:"pivot"}):this.refreshModel({step:"aggregate"})}createChangePath(i){const e=ye.missingOrEmpty(i),t=new dd(!1,this.rootNode);return(e||this.gos.get("treeData"))&&t.setInactive(),t}isSuppressModelUpdateAfterUpdateTransaction(i){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction")||i.rowNodeTransactions==null)return!1;const e=i.rowNodeTransactions.filter(s=>s.add!=null&&s.add.length>0||s.remove!=null&&s.remove.length>0);return e==null||e.length==0}buildRefreshModelParams(i){let e="group";const t={everything:"group",group:"group",filter:"filter",map:"map",aggregate:"aggregate",sort:"sort",pivot:"pivot"};if(ye.exists(i)&&(e=t[i]),ye.missing(e)){console.error(`AG Grid: invalid step ${i}, available steps are ${Object.keys(t).join(", ")}`);return}const s=!this.gos.get("suppressAnimationFrame");return{step:e,keepRenderedRows:!0,keepEditingRows:!0,animate:s}}refreshModel(i){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.shouldRowModelIgnoreRefresh())return;let e=typeof i=="object"&&"step"in i?i:this.buildRefreshModelParams(i);if(!e||this.isSuppressModelUpdateAfterUpdateTransaction(e))return;const t=this.createChangePath(e.rowNodeTransactions);switch(this.isRefreshingModel=!0,e.step){case"group":this.doRowGrouping(e.rowNodeTransactions,e.rowNodeOrder,t,!!e.afterColumnsChanged);case"filter":this.doFilter(t);case"pivot":this.doPivot(t);case"aggregate":this.doAggregate(t);case"filter_aggregates":this.doFilterAggregates(t);case"sort":this.doSort(e.rowNodeTransactions,t);case"map":this.doRowsToDisplay()}const s=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(t,s),this.isRefreshingModel=!1;const r={type:b.EVENT_MODEL_UPDATED,animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack};this.eventService.dispatchEvent(r)}isEmpty(){const i=ye.missing(this.rootNode.allLeafChildren)||this.rootNode.allLeafChildren.length===0;return ye.missing(this.rootNode)||i||!this.columnModel.isReady()}isRowsToRender(){return ye.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(i,e){let t=!e,s=!1;const r=[],o=this.gos.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort(n=>{if(s)return;if(t&&(n===e||n===i)&&(s=!0,n.group&&o)){r.push(...n.allLeafChildren);return}if(!t){if(n!==e&&n!==i)return;t=!0}if(!n.group||!o){r.push(n);return}}),r}setDatasource(i){console.error("AG Grid: should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(i){return this.rowsToDisplay[i]}isRowPresent(i){return this.rowsToDisplay.indexOf(i)>=0}getRowIndexAtPixel(i){if(this.isEmpty()||this.rowsToDisplay.length===0)return-1;let e=0,t=this.rowsToDisplay.length-1;if(i<=0)return 0;if(ye.last(this.rowsToDisplay).rowTop<=i)return this.rowsToDisplay.length-1;let r=-1,o=-1;for(;;){const n=Math.floor((e+t)/2),a=this.rowsToDisplay[n];if(this.isRowInPixel(a,i)||(a.rowTop<i?e=n+1:a.rowTop>i&&(t=n-1),r===e&&o===t))return n;r=e,o=t}}isRowInPixel(i,e){const t=i.rowTop,s=i.rowTop+i.rowHeight;return t<=e&&s>e}forEachLeafNode(i){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((e,t)=>i(e,t))}forEachNode(i,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:i,recursionType:0,index:0,includeFooterNodes:e})}forEachNodeAfterFilter(i,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:i,recursionType:1,index:0,includeFooterNodes:e})}forEachNodeAfterFilterAndSort(i,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:i,recursionType:2,index:0,includeFooterNodes:e})}forEachPivotNode(i,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:i,recursionType:3,index:0,includeFooterNodes:e})}recursivelyWalkNodesAndCallback(i){const{nodes:e,callback:t,recursionType:s,includeFooterNodes:r}=i;let{index:o}=i;const n=a=>{var l;const u=(l=e[0])==null?void 0:l.parent;if(!u)return;const h=r&&this.gos.getGrandTotalRow(),d=this.gos.getGroupTotalRowCallback(),c=r&&d({node:u});if(u===this.rootNode){h===a&&(u.createFooter(),t(u.sibling,o++));return}c===a&&(u.createFooter(),t(u.sibling,o++))};n("top");for(let a=0;a<e.length;a++){const l=e[a];if(t(l,o++),l.hasChildren()&&!l.footer){let u=null;switch(s){case 0:u=l.childrenAfterGroup;break;case 1:u=l.childrenAfterAggFilter;break;case 2:u=l.childrenAfterSort;break;case 3:u=l.leafGroup?null:l.childrenAfterSort;break}u&&(o=this.recursivelyWalkNodesAndCallback({nodes:[...u],callback:t,recursionType:s,index:o,includeFooterNodes:r}))}}return n("bottom"),o}doAggregate(i){var e;(e=this.aggregationStage)==null||e.execute({rowNode:this.rootNode,changedPath:i})}doFilterAggregates(i){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:i}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(i){const e=this.gos.get("treeData"),t=this.columnModel.isPivotActive(),s=n=>{n&&n.forEach(a=>{const l=()=>{a.expanded=i,s(a.childrenAfterGroup)};if(e){ye.exists(a.childrenAfterGroup)&&l();return}if(t){!a.leafGroup&&l();return}a.group&&l()})};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:"map"});const r=i?"expandAll":"collapseAll",o={type:b.EVENT_EXPAND_COLLAPSE_ALL,source:r};this.eventService.dispatchEvent(o)}doSort(i,e){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:i,changedPath:e})}doRowGrouping(i,e,t,s){if(this.groupStage){if(i?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:i,rowNodeOrder:e,changedPath:t}):this.groupStage.execute({rowNode:this.rootNode,changedPath:t,afterColumnsChanged:s}),this.gos.get("groupSelectsChildren")&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",t)){const o={type:b.EVENT_SELECTION_CHANGED,source:"rowGroupChanged"};this.eventService.dispatchEvent(o)}}else 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:b.EVENT_ROW_COUNT_READY}))}doFilter(i){this.filterStage.execute({rowNode:this.rootNode,changedPath:i})}doPivot(i){var e;(e=this.pivotStage)==null||e.execute({rowNode:this.rootNode,changedPath:i})}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(i){if(typeof i=="string"&&i.indexOf(Me.ID_PREFIX_ROW_GROUP)==0){let t;return this.forEachNode(s=>{s.id===i&&(t=s)}),t}return this.nodeManager.getRowNode(i)}setRowData(i){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(i),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){const i={type:b.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(i),this.refreshModel({step:"group",newData:!0})}batchUpdateRowData(i,e){if(this.applyAsyncTransactionsTimeout==null){this.rowDataTransactionBatch=[];const t=this.gos.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.executeBatchUpdateRowData()},t)}this.rowDataTransactionBatch.push({rowDataTransaction:i,callback:e})}flushAsyncTransactions(){this.applyAsyncTransactionsTimeout!=null&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const i=[],e=[];let t=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach(s=>{const r=this.nodeManager.updateRowData(s.rowDataTransaction,void 0);e.push(r),s.callback&&i.push(s.callback.bind(null,r)),typeof s.rowDataTransaction.addIndex=="number"&&(t=!0)}),this.commonUpdateRowData(e,void 0,t),i.length>0&&window.setTimeout(()=>{i.forEach(s=>s())},0),e.length>0){const s={type:b.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:e};this.eventService.dispatchEvent(s)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(i,e){this.valueCache.onDataChanged();const t=this.nodeManager.updateRowData(i,e),s=typeof i.addIndex=="number";return this.commonUpdateRowData([t],e,s),t}createRowNodeOrder(){if(this.gos.get("suppressMaintainUnsortedOrder"))return;const e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(let t=0;t<this.rootNode.allLeafChildren.length;t++){const s=this.rootNode.allLeafChildren[t];e[s.id]=t}return e}commonUpdateRowData(i,e,t){if(!this.hasStarted)return;const s=!this.gos.get("suppressAnimationFrame");t&&(e=this.createRowNodeOrder());const r={type:b.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(r),this.refreshModel({step:"group",rowNodeTransactions:i,rowNodeOrder:e,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 i=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),i&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let i=!1;return this.forEachNode(e=>{e.setRowHeight(e.rowHeight,!0);const t=e.detailNode;t&&t.setRowHeight(t.rowHeight,!0),e.sibling&&e.sibling.setRowHeight(e.sibling.rowHeight,!0),i=!0}),i}onGridStylesChanges(){this.columnModel.isAutoRowHeightActive()||this.resetRowHeights()}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}};g([R("columnModel")],fi.prototype,"columnModel",2);g([R("selectionService")],fi.prototype,"selectionService",2);g([R("valueCache")],fi.prototype,"valueCache",2);g([R("beans")],fi.prototype,"beans",2);g([R("filterStage")],fi.prototype,"filterStage",2);g([R("sortStage")],fi.prototype,"sortStage",2);g([R("flattenStage")],fi.prototype,"flattenStage",2);g([Ke("groupStage")],fi.prototype,"groupStage",2);g([Ke("aggregationStage")],fi.prototype,"aggregationStage",2);g([Ke("pivotStage")],fi.prototype,"pivotStage",2);g([Ke("filterAggregatesStage")],fi.prototype,"filterAggregatesStage",2);g([J],fi.prototype,"init",1);fi=g([le("rowModel")],fi);var ch=class extends Z{execute(i){const{changedPath:e}=i;this.filterService.filter(e)}};g([R("filterService")],ch.prototype,"filterService",2);ch=g([le("filterStage")],ch);var sl=class extends Z{execute(i){const e=this.sortController.getSortOptions(),t=ye.exists(e)&&e.length>0,s=t&&ye.exists(i.rowNodeTransactions)&&this.gos.get("deltaSort"),r=e.some(o=>this.gos.isColumnsSortingCoupledToGroup()?o.column.isPrimary()&&o.column.isRowGroupActive():!!o.column.getColDef().showRowGroup);this.sortService.sort(e,t,s,i.rowNodeTransactions,i.changedPath,r)}};g([R("sortService")],sl.prototype,"sortService",2);g([R("sortController")],sl.prototype,"sortController",2);sl=g([le("sortStage")],sl);var ph=class extends Z{execute(i){const e=i.rowNode,t=[],s=this.beans.columnModel.isPivotMode(),r=s&&e.leafGroup,o=r?[e]:e.childrenAfterSort,n=this.getFlattenDetails();this.recursivelyAddToRowsToDisplay(n,o,t,s,0);const a=t.length>0;if(!r&&a&&n.grandTotalRow){e.createFooter();const u=n.grandTotalRow==="top";this.addRowNodeToRowsToDisplay(n,e.sibling,t,0,u)}return t}getFlattenDetails(){const i=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!i&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:i,isGroupMultiAutoColumn:this.gos.isGroupMultiAutoColumn(),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:this.gos.getGrandTotalRow(),groupTotalRow:this.gos.getGroupTotalRowCallback()}}recursivelyAddToRowsToDisplay(i,e,t,s,r){if(!ye.missingOrEmpty(e))for(let o=0;o<e.length;o++){const n=e[o],a=n.hasChildren(),l=s&&!a,u=i.groupRemoveSingleChildren&&a&&n.childrenAfterGroup.length===1,h=i.groupRemoveLowestSingleChildren&&a&&n.leafGroup&&n.childrenAfterGroup.length===1,d=s&&n.leafGroup,c=i.hideOpenParents&&n.expanded&&!n.master&&!d;if(!l&&!c&&!u&&!h&&this.addRowNodeToRowsToDisplay(i,n,t,r),!(s&&n.leafGroup)){if(a){const y=u||h;if(n.expanded||y){const f=i.groupTotalRow({node:n});f||n.destroyFooter();const w=y?r:r+1;f==="top"&&(n.createFooter(),this.addRowNodeToRowsToDisplay(i,n.sibling,t,w)),this.recursivelyAddToRowsToDisplay(i,n.childrenAfterSort,t,s,w),f==="bottom"&&(n.createFooter(),this.addRowNodeToRowsToDisplay(i,n.sibling,t,w))}}else if(n.master&&n.expanded){const y=this.createDetailNode(n);this.addRowNodeToRowsToDisplay(i,y,t,r)}}}}addRowNodeToRowsToDisplay(i,e,t,s,r){r?t.unshift(e):t.push(e),e.setUiLevel(i.isGroupMultiAutoColumn?0:s)}createDetailNode(i){if(ye.exists(i.detailNode))return i.detailNode;const e=new Me(this.beans);return e.detail=!0,e.selectable=!1,e.parent=i,ye.exists(i.id)&&(e.id="detail_"+i.id),e.data=i.data,e.level=i.level+1,i.detailNode=e,e}};g([R("beans")],ph.prototype,"beans",2);ph=g([le("flattenStage")],ph);var rl=class extends Z{sort(i,e,t,s,r,o){const n=this.gos.get("groupMaintainOrder"),a=this.columnModel.getAllGridColumns().some(c=>c.isRowGroupActive());let l={};t&&s&&(l=this.calculateDirtyNodes(s));const u=this.columnModel.isPivotMode(),h=this.gos.getCallback("postSortRows"),d=c=>{var p;this.pullDownGroupDataForHideOpenParents(c.childrenAfterAggFilter,!0);const y=u&&c.leafGroup;if(n&&a&&!c.leafGroup&&!o){const w=(p=this.columnModel.getRowGroupColumns())==null?void 0:p[c.level+1],_=w?.getSort()===null,P=c.childrenAfterAggFilter.slice(0);if(c.childrenAfterSort&&!_){const T={};c.childrenAfterSort.forEach((D,M)=>{T[D.id]=M}),P.sort((D,M)=>{var O,N;return((O=T[D.id])!=null?O:0)-((N=T[M.id])!=null?N:0)})}c.childrenAfterSort=P}else!e||y?c.childrenAfterSort=c.childrenAfterAggFilter.slice(0):t?c.childrenAfterSort=this.doDeltaSort(c,l,r,i):c.childrenAfterSort=this.rowNodeSorter.doFullSort(c.childrenAfterAggFilter,i);if(c.sibling&&(c.sibling.childrenAfterSort=c.childrenAfterSort),this.updateChildIndexes(c),h){const w={nodes:c.childrenAfterSort};h(w)}};r&&r.forEachChangedNodeDepthFirst(d),this.updateGroupDataForHideOpenParents(r)}calculateDirtyNodes(i){const e={},t=s=>{s&&s.forEach(r=>e[r.id]=!0)};return i&&i.forEach(s=>{t(s.add),t(s.update),t(s.remove)}),e}doDeltaSort(i,e,t,s){const r=i.childrenAfterAggFilter,o=i.childrenAfterSort;if(!o)return this.rowNodeSorter.doFullSort(r,s);const n={},a=[];r.forEach(d=>{e[d.id]||!t.canSkip(d)?a.push(d):n[d.id]=!0});const l=o.filter(d=>n[d.id]),u=(d,c)=>({currentPos:c,rowNode:d}),h=a.map(u).sort((d,c)=>this.rowNodeSorter.compareRowNodes(s,d,c));return this.mergeSortedArrays(s,h,l.map(u)).map(({rowNode:d})=>d)}mergeSortedArrays(i,e,t){const s=[];let r=0,o=0;for(;r<e.length&&o<t.length;)this.rowNodeSorter.compareRowNodes(i,e[r],t[o])<0?s.push(e[r++]):s.push(t[o++]);for(;r<e.length;)s.push(e[r++]);for(;o<t.length;)s.push(t[o++]);return s}updateChildIndexes(i){if(ye.missing(i.childrenAfterSort))return;const e=i.childrenAfterSort;for(let t=0;t<e.length;t++){const s=e[t],r=t===0,o=t===i.childrenAfterSort.length-1;s.setFirstChild(r),s.setLastChild(o),s.setChildIndex(t)}}updateGroupDataForHideOpenParents(i){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return ye.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 e=t=>{this.pullDownGroupDataForHideOpenParents(t.childrenAfterSort,!1),t.childrenAfterSort.forEach(s=>{s.hasChildren()&&e(s)})};i&&i.executeFromRootNode(t=>e(t))}pullDownGroupDataForHideOpenParents(i,e){!this.gos.get("groupHideOpenParents")||ye.missing(i)||i.forEach(t=>{this.columnModel.getGroupDisplayColumns().forEach(r=>{const o=r.getColDef().showRowGroup;if(typeof o!="string"){console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");return}const n=o,a=this.columnModel.getPrimaryColumn(n);if(a!==t.rowGroupColumn)if(e)t.setGroupValue(r.getId(),void 0);else{const u=t.getFirstChildOfFirstChild(a);u&&t.setGroupValue(r.getId(),u.key)}})})}};g([R("columnModel")],rl.prototype,"columnModel",2);g([R("rowNodeSorter")],rl.prototype,"rowNodeSorter",2);rl=g([le("sortService")],rl);var gh=class extends Z{filter(i){const e=this.filterManager.isChildFilterPresent();this.filterNodes(e,i)}filterNodes(i,e){const t=(s,r)=>{s.hasChildren()&&i&&!r?s.childrenAfterFilter=s.childrenAfterGroup.filter(o=>{const n=o.childrenAfterFilter&&o.childrenAfterFilter.length>0,a=o.data&&this.filterManager.doesRowPassFilter({rowNode:o});return n||a}):s.childrenAfterFilter=s.childrenAfterGroup,s.sibling&&(s.sibling.childrenAfterFilter=s.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const s=(o,n)=>{if(o.childrenAfterGroup)for(let a=0;a<o.childrenAfterGroup.length;a++){const l=o.childrenAfterGroup[a],u=n||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?s(o.childrenAfterGroup[a],u):t(l,u)}t(o,n)},r=o=>s(o,!1);e.executeFromRootNode(r)}else{const s=r=>t(r,!1);e.forEachChangedNodeDepthFirst(s,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}};g([R("filterManager")],gh.prototype,"filterManager",2);gh=g([le("filterService")],gh);var wo=class extends Z{postConstruct(){this.rowModel.getType()==="clientSide"&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",()=>this.onRowDataUpdated()))}isActive(){const i=this.gos.exists("getRowId");return this.gos.get("resetRowDataOnUpdate")?!1:i}setRowData(i){const e=this.createTransactionForRowData(i);if(!e)return;const[t,s]=e;this.clientSideRowModel.updateRowData(t,s)}createTransactionForRowData(i){if(ye.missing(this.clientSideRowModel)){console.error("AG Grid: ImmutableService only works with ClientSideRowModel");return}const e=this.gos.getCallback("getRowId");if(e==null){console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");return}const t={remove:[],update:[],add:[]},s=this.clientSideRowModel.getCopyOfNodesMap(),o=this.gos.get("suppressMaintainUnsortedOrder")?void 0:{};return ye.exists(i)&&i.forEach((n,a)=>{const l=e({data:n,level:0}),u=s[l];o&&(o[l]=a),u?(u.data!==n&&t.update.push(n),s[l]=void 0):t.add.push(n)}),ye.iterateObject(s,(n,a)=>{a&&t.remove.push(a.data)}),[t,o]}onRowDataUpdated(){const i=this.gos.get("rowData");i&&(this.isActive()?this.setRowData(i):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(i)))}};g([R("rowModel")],wo.prototype,"rowModel",2);g([R("rowRenderer")],wo.prototype,"rowRenderer",2);g([R("selectionService")],wo.prototype,"selectionService",2);g([J],wo.prototype,"postConstruct",1);wo=g([le("immutableService")],wo);var $_="31.3.4",K_={version:$_,moduleName:"@ag-grid-community/client-side-row-model",rowModel:"clientSide",beans:[fi,ch,sl,ph,rl,gh,wo]},X_=Object.defineProperty,q_=Object.getOwnPropertyDescriptor,yi=(i,e,t,s)=>{for(var r=s>1?void 0:s?q_(e,t):e,o=i.length-1,n;o>=0;o--)(n=i[o])&&(r=(s?n(e,t,r):n(r))||r);return s&&r&&X_(e,t,r),r},Q_=(i,e)=>(t,s)=>e(t,s,i),ol=class extends Yc{constructor(i,e,t){super(i),this.parentCache=e,this.params=t,this.startRow=i*t.blockSize,this.endRow=this.startRow+t.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(i,e,t){ye.exists(e)?i.setDataAndId(e,t.toString()):i.setDataAndId(void 0,void 0)}loadFromDatasource(){const i=this.createLoadParams();if(ye.missing(this.params.datasource.getRows)){console.warn("AG Grid: datasource is missing getRows method");return}window.setTimeout(()=>{this.params.datasource.getRows(i)},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.gos.getGridCommonParams().context}}forEachNode(i,e,t){this.rowNodes.forEach((s,r)=>{this.startRow+r<t&&i(s,e.next())})}getLastAccessed(){return this.lastAccessed}getRow(i,e=!1){e||(this.lastAccessed=this.params.lastAccessedSequence.next());const t=i-this.startRow;return this.rowNodes[t]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let i=0;i<this.params.blockSize;i++){const e=this.startRow+i,t=new Me(this.beans);t.setRowHeight(this.params.rowHeight),t.uiLevel=0,t.setRowIndex(e),t.setRowTop(this.params.rowHeight*e),this.rowNodes.push(t)}}processServerResult(i){this.rowNodes.forEach((t,s)=>{const r=i.rowData?i.rowData[s]:void 0;!t.id&&t.alreadyRendered&&r&&(this.rowNodes[s]=new Me(this.beans),this.rowNodes[s].setRowIndex(t.rowIndex),this.rowNodes[s].setRowTop(t.rowTop),this.rowNodes[s].setRowHeight(t.rowHeight),t.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[s],r,this.startRow+s)});const e=i.rowCount!=null&&i.rowCount>=0?i.rowCount:void 0;this.parentCache.pageLoaded(this,e)}destroyRowNodes(){this.rowNodes.forEach(i=>{i.clearRowTopAndRowIndex()})}};yi([R("beans")],ol.prototype,"beans",2);yi([J],ol.prototype,"postConstruct",1);yi([vi],ol.prototype,"destroyRowNodes",1);var Kn=class BC extends Z{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}setBeans(e){this.logger=e.create("InfiniteCache")}getRow(e,t=!1){const s=Math.floor(e/this.params.blockSize);let r=this.blocks[s];if(!r){if(t)return;r=this.createBlock(s)}return r.getRow(e)}createBlock(e){const t=this.createBean(new ol(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){if(this.blockCount==0){this.purgeCache();return}this.getBlocksInOrder().forEach(t=>t.setStateWaitingToLoad()),this.params.rowNodeBlockLoader.checkBlockToLoad()}destroyAllBlocks(){this.getBlocksInOrder().forEach(e=>this.destroyBlock(e))}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(this.logger.log(`onPageLoaded: page = ${e.getId()}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(a=>a!=e),s=(a,l)=>l.getLastAccessed()-a.getLastAccessed();t.sort(s);const r=this.params.maxBlocksInCache>0,o=r?this.params.maxBlocksInCache-1:null,n=BC.MAX_EMPTY_BLOCKS_TO_KEEP-1;t.forEach((a,l)=>{const u=a.getState()===ol.STATE_WAITING_TO_LOAD&&l>=n,h=r?l>=o:!1;if(u||h){if(this.isBlockCurrentlyDisplayed(a)||this.isBlockFocused(a))return;this.removeBlockFromCache(a)}})}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const s=e.getStartRow(),r=e.getEndRow();return t.rowIndex>=s&&t.rowIndex<r}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),s=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,s)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const r=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,ye.exists(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new vn;this.getBlocksInOrder().forEach(s=>s.forEachNode(e,t,this.rowCount))}getBlocksInOrder(){const e=(s,r)=>s.getId()-r.getId();return ye.getAllValuesInObject(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){if(this.isAlive()){this.destroyAllBlocksPastVirtualRowCount();const e={type:b.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(e)}}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach(t=>{t.getId()*this.params.blockSize>=this.rowCount&&e.push(t)}),e.length>0&&e.forEach(t=>this.destroyBlock(t))}purgeCache(){this.getBlocksInOrder().forEach(e=>this.removeBlockFromCache(e)),this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const s=[];let r=-1,o=!1;const n=new vn;ye.missing(e)&&(o=!0);let a=!1;return this.getBlocksInOrder().forEach(u=>{if(!a){if(o&&r+1!==u.getId()){a=!0;return}r=u.getId(),u.forEachNode(h=>{const d=h===e||h===t;(o||d)&&s.push(h),d&&(o=!o)},n,this.rowCount)}}),a||o?[]:s}};Kn.MAX_EMPTY_BLOCKS_TO_KEEP=2;yi([R("rowRenderer")],Kn.prototype,"rowRenderer",2);yi([R("focusService")],Kn.prototype,"focusService",2);yi([Q_(0,Ki("loggerFactory"))],Kn.prototype,"setBeans",1);yi([vi],Kn.prototype,"destroyAllBlocks",1);var Z_=Kn,Gs=class extends Z{getRowBounds(i){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*i}}ensureRowHeightsValid(i,e,t,s){return!1}init(){this.gos.isRowModelType("infinite")&&(this.rowHeight=this.gos.getRowHeightAsNumber(),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache()),this.verifyProps())}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&ye.warnOnce("initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side")}start(){this.setDatasource(this.gos.get("datasource"))}destroyDatasource(){this.datasource&&(this.getContext().destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedListener(this.eventService,b.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,b.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,b.EVENT_STORE_UPDATED,this.onCacheUpdated.bind(this)),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=this.gos.getRowHeightAsNumber(),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let i;this.cacheParams?i=this.isSortModelDifferent():i=!0,i&&this.reset()}isSortModelDifferent(){return!ye.jsonEquals(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(i){this.destroyDatasource(),this.datasource=i,i&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(i,e){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(i,e):[]}reset(){if(!this.datasource)return;this.gos.getCallback("getRowId")!=null||this.selectionService.reset("rowDataChanged"),this.resetCache()}createModelUpdatedEvent(){return{type:b.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.gos.get("infiniteInitialRowCount"),maxBlocksInCache:this.gos.get("maxBlocksInCache"),rowHeight:this.gos.getRowHeightAsNumber(),overflowSize:this.gos.get("cacheOverflowSize"),blockSize:this.gos.get("cacheBlockSize"),lastAccessedSequence:new vn},this.infiniteCache=this.createBean(new Z_(this.cacheParams)),this.eventService.dispatchEventOnce({type:b.EVENT_ROW_COUNT_READY});const i=this.createModelUpdatedEvent();this.eventService.dispatchEvent(i)}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)});const i=this.createModelUpdatedEvent();this.eventService.dispatchEvent(i)}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const i=this.createModelUpdatedEvent();this.eventService.dispatchEvent(i)}getRow(i){if(this.infiniteCache&&!(i>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(i)}getRowNode(i){let e;return this.forEachNode(t=>{t.id===i&&(e=t)}),e}forEachNode(i){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(i)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(i){return i}getRowIndexAtPixel(i){if(this.rowHeight!==0){const e=Math.floor(i/this.rowHeight),t=this.getRowCount()-1;return e>t?t:e}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(i){return!!this.getRowNode(i.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?this.infiniteCache.isLastRowIndexKnown():!1}setRowCount(i,e){this.infiniteCache&&this.infiniteCache.setRowCount(i,e)}};yi([R("filterManager")],Gs.prototype,"filterManager",2);yi([R("sortController")],Gs.prototype,"sortController",2);yi([R("selectionService")],Gs.prototype,"selectionService",2);yi([R("rowRenderer")],Gs.prototype,"rowRenderer",2);yi([R("rowNodeBlockLoader")],Gs.prototype,"rowNodeBlockLoader",2);yi([J],Gs.prototype,"init",1);yi([vi],Gs.prototype,"destroyDatasource",1);Gs=yi([le("rowModel")],Gs);var J_="31.3.4",eE={version:J_,moduleName:"@ag-grid-community/infinite-row-model",rowModel:"infinite",beans:[Gs]},tE=Object.defineProperty,iE=Object.getOwnPropertyDescriptor,Fi=(i,e,t,s)=>{for(var r=s>1?void 0:s?iE(e,t):e,o=i.length-1,n;o>=0;o--)(n=i[o])&&(r=(s?n(e,t,r):n(r))||r);return s&&r&&tE(e,t,r),r},sE=class{setBeans(i){this.beans=i}getFileName(i){const e=this.getDefaultFileExtension();return(i==null||!i.length)&&(i=this.getDefaultFileName()),i.indexOf(".")===-1?`${i}.${e}`:i}getData(i){const e=this.createSerializingSession(i);return this.beans.gridSerializer.serialize(e,i)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},rE=class{constructor(i){this.groupColumns=[];const{columnModel:e,valueService:t,gos:s,processCellCallback:r,processHeaderCallback:o,processGroupHeaderCallback:n,processRowGroupCallback:a}=i;this.columnModel=e,this.valueService=t,this.gos=s,this.processCellCallback=r,this.processHeaderCallback=o,this.processGroupHeaderCallback=n,this.processRowGroupCallback=a}prepare(i){this.groupColumns=i.filter(e=>!!e.getColDef().showRowGroup)}extractHeaderValue(i){const e=this.getHeaderName(this.processHeaderCallback,i);return e??""}extractRowCellValue(i,e,t,s,r){const n=(!this.gos.get("groupHideOpenParents")||r.footer)&&this.shouldRenderGroupSummaryCell(r,i,e)?this.createValueForGroupNode(i,r):this.valueService.getValue(i,r);return this.processCell({accumulatedRowIndex:t,rowNode:r,column:i,value:n,processCellCallback:this.processCellCallback,type:s})}shouldRenderGroupSummaryCell(i,e,t){var s;if(!(i&&i.group))return!1;if(this.groupColumns.indexOf(e)!==-1){if(((s=i.groupData)==null?void 0:s[e.getId()])!=null||this.gos.isRowModelType("serverSide")&&i.group)return!0;if(i.footer&&i.level===-1){const a=e.getColDef();return a==null||a.showRowGroup===!0||a.showRowGroup===this.columnModel.getRowGroupColumns()[0].getId()}}const n=this.gos.isGroupUseEntireRow(this.columnModel.isPivotMode());return t===0&&n}getHeaderName(i,e){return i?i(this.gos.addGridCommonParams({column:e})):this.columnModel.getDisplayNameForColumn(e,"csv",!0)}createValueForGroupNode(i,e){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:i,node:e}));const t=this.gos.get("treeData"),s=this.gos.get("suppressGroupMaintainValueType"),r=l=>{var u,h;if(t||s)return l.key;const d=(u=l.groupData)==null?void 0:u[i.getId()];return!d||!l.rowGroupColumn||l.rowGroupColumn.getColDef().useValueFormatterForExport===!1?d:(h=this.valueService.formatValue(l.rowGroupColumn,l,d))!=null?h:d},o=e.footer,n=[r(e)];if(!this.gos.isGroupMultiAutoColumn())for(;e.parent;)e=e.parent,n.push(r(e));const a=n.reverse().join(" -> ");return o?`Total ${a}`:a}processCell(i){var e;const{accumulatedRowIndex:t,rowNode:s,column:r,value:o,processCellCallback:n,type:a}=i;return n?{value:(e=n(this.gos.addGridCommonParams({accumulatedRowIndex:t,column:r,node:s,value:o,type:a,parseValue:l=>this.valueService.parseValue(r,s,l,this.valueService.getValue(r,s)),formatValue:l=>{var u;return(u=this.valueService.formatValue(r,s,l))!=null?u:l}})))!=null?e:""}:r.getColDef().useValueFormatterForExport!==!1?{value:o??"",valueFormatted:this.valueService.formatValue(r,s,o)}:{value:o??""}}},oE=class{static download(i,e){const t=document.defaultView||window;if(!t){console.warn("AG Grid: There is no `window` associated with the current `document`");return}const s=document.createElement("a"),r=t.URL.createObjectURL(e);s.setAttribute("href",r),s.setAttribute("download",i),s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:t})),document.body.removeChild(s),t.setTimeout(()=>{t.URL.revokeObjectURL(r)},0)}},rf=`\r
`,nE=class extends rE{constructor(i){super(i),this.isFirstLine=!0,this.result="";const{suppressQuotes:e,columnSeparator:t}=i;this.suppressQuotes=e,this.columnSeparator=t}addCustomContent(i){i&&(typeof i=="string"?(/^\s*\n/.test(i)||this.beginNewLine(),i=i.replace(/\r?\n/g,rf),this.result+=i):i.forEach(e=>{this.beginNewLine(),e.forEach((t,s)=>{s!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t.data.value||""),t.mergeAcross&&this.appendEmptyCells(t.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(i,e,t,s){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(e),this.appendEmptyCells(s)}appendEmptyCells(i){for(let e=1;e<=i;e++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(i,e){e!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(i))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(i,e,t){var s;e!=0&&(this.result+=this.columnSeparator);const r=this.extractRowCellValue(i,e,e,"csv",t);this.result+=this.putInQuotes((s=r.valueFormatted)!=null?s:r.value)}putInQuotes(i){if(this.suppressQuotes)return i;if(i==null)return'""';let e;return typeof i=="string"?e=i:typeof i.toString=="function"?e=i.toString():(console.warn("AG Grid: unknown value type during csv conversion"),e=""),'"'+e.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=rf),this.isFirstLine=!1}},_r=class extends sE{postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(i){const e=this.gos.get("defaultCsvExportParams");return Object.assign({},e,i)}export(i){if(this.isExportSuppressed()){console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration.");return}const e=this.getMergedParams(i),t=this.getData(e),s=new Blob(["\uFEFF",t],{type:"text/plain"}),r=typeof e.fileName=="function"?e.fileName(this.gos.getGridCommonParams()):e.fileName;oE.download(this.getFileName(r),s)}exportDataAsCsv(i){this.export(i)}getDataAsCsv(i,e=!1){const t=e?Object.assign({},i):this.getMergedParams(i);return this.getData(t)}getDefaultFileExtension(){return"csv"}createSerializingSession(i){const{columnModel:e,valueService:t,gos:s}=this,{processCellCallback:r,processHeaderCallback:o,processGroupHeaderCallback:n,processRowGroupCallback:a,suppressQuotes:l,columnSeparator:u}=i;return new nE({columnModel:e,valueService:t,gos:s,processCellCallback:r||void 0,processHeaderCallback:o||void 0,processGroupHeaderCallback:n||void 0,processRowGroupCallback:a||void 0,suppressQuotes:l||!1,columnSeparator:u||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};Fi([R("columnModel")],_r.prototype,"columnModel",2);Fi([R("valueService")],_r.prototype,"valueService",2);Fi([R("gridSerializer")],_r.prototype,"gridSerializer",2);Fi([R("gridOptionsService")],_r.prototype,"gos",2);Fi([J],_r.prototype,"postConstruct",1);_r=Fi([le("csvCreator")],_r);var Vs=class extends Z{serialize(i,e={}){const{allColumns:t,columnKeys:s,skipRowGroups:r}=e,o=this.getColumnsToExport(t,r,s);return ye.compose(this.prepareSession(o),this.prependContent(e),this.exportColumnGroups(e,o),this.exportHeaders(e,o),this.processPinnedTopRows(e,o),this.processRows(e,o),this.processPinnedBottomRows(e,o),this.appendContent(e))(i).parse()}processRow(i,e,t,s){const r=e.shouldRowBeSkipped||(()=>!1),o=this.gos.get("groupRemoveSingleChildren"),n=this.gos.get("groupRemoveLowestSingleChildren"),l=e.rowPositions!=null||!!e.onlySelected,u=this.gos.get("groupHideOpenParents")&&!l,h=this.columnModel.isPivotMode()?s.leafGroup:!s.group,d=!!s.footer;e.skipRowGroups;const c=n&&s.leafGroup,p=s.allChildrenCount===1&&(o||c);if(!h&&!d&&(e.skipRowGroups||p||u)||e.onlySelected&&!s.isSelected()||e.skipPinnedTop&&s.rowPinned==="top"||e.skipPinnedBottom&&s.rowPinned==="bottom"||s.level===-1&&!h&&!d||r(this.gos.addGridCommonParams({node:s})))return;const w=i.onNewBodyRow(s);if(t.forEach((_,P)=>{w.onColumn(_,P,s)}),e.getCustomContentBelowRow){const _=e.getCustomContentBelowRow(this.gos.addGridCommonParams({node:s}));_&&i.addCustomContent(_)}}appendContent(i){return e=>{const t=i.appendContent;return t&&e.addCustomContent(t),e}}prependContent(i){return e=>{const t=i.prependContent;return t&&e.addCustomContent(t),e}}prepareSession(i){return e=>(e.prepare(i),e)}exportColumnGroups(i,e){return t=>{if(!i.skipColumnGroupHeaders){const s=new Fm,r=this.displayedGroupCreator.createDisplayedGroups(e,s,null);this.recursivelyAddHeaderGroups(r,t,i.processGroupHeaderCallback)}return t}}exportHeaders(i,e){return t=>{if(!i.skipColumnHeaders){const s=t.onNewHeaderRow();e.forEach((r,o)=>{s.onColumn(r,o,void 0)})}return t}}processPinnedTopRows(i,e){return t=>{const s=this.processRow.bind(this,t,i,e);return i.rowPositions?i.rowPositions.filter(r=>r.rowPinned==="top").sort((r,o)=>r.rowIndex-o.rowIndex).map(r=>this.pinnedRowModel.getPinnedTopRow(r.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedTopRow(s),t}}processRows(i,e){return t=>{const s=this.rowModel,r=s.getType(),o=r==="clientSide",n=r==="serverSide",a=!o&&i.onlySelected,l=this.processRow.bind(this,t,i,e),{exportedRows:u="filteredAndSorted"}=i;if(i.rowPositions)i.rowPositions.filter(h=>h.rowPinned==null).sort((h,d)=>h.rowIndex-d.rowIndex).map(h=>s.getRow(h.rowIndex)).forEach(l);else if(this.columnModel.isPivotMode())o?s.forEachPivotNode(l,!0):n?s.forEachNodeAfterFilterAndSort(l,!0):s.forEachNode(l);else if(i.onlySelectedAllPages||a){const h=this.selectionService.getSelectedNodes();this.replicateSortedOrder(h),h.forEach(l)}else u==="all"?s.forEachNode(l):o||n?s.forEachNodeAfterFilterAndSort(l,!0):s.forEachNode(l);return t}}replicateSortedOrder(i){const e=this.sortController.getSortOptions(),t=(s,r)=>{var o,n,a,l;return s.rowIndex!=null&&r.rowIndex!=null?s.rowIndex-r.rowIndex:s.level===r.level?((o=s.parent)==null?void 0:o.id)===((n=r.parent)==null?void 0:n.id)?this.rowNodeSorter.compareRowNodes(e,{rowNode:s,currentPos:(a=s.rowIndex)!=null?a:-1},{rowNode:r,currentPos:(l=r.rowIndex)!=null?l:-1}):t(s.parent,r.parent):s.level>r.level?t(s.parent,r):t(s,r.parent)};i.sort(t)}processPinnedBottomRows(i,e){return t=>{const s=this.processRow.bind(this,t,i,e);return i.rowPositions?i.rowPositions.filter(r=>r.rowPinned==="bottom").sort((r,o)=>r.rowIndex-o.rowIndex).map(r=>this.pinnedRowModel.getPinnedBottomRow(r.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedBottomRow(s),t}}getColumnsToExport(i=!1,e=!1,t){const s=this.columnModel.isPivotMode();if(t&&t.length)return this.columnModel.getGridColumns(t);const r=this.gos.get("treeData");let o=[];return i&&!s?o=this.columnModel.getAllGridColumns():o=this.columnModel.getAllDisplayedColumns(),e&&!r&&(o=o.filter(n=>n.getColId()!==pn)),o}recursivelyAddHeaderGroups(i,e,t){const s=[];i.forEach(r=>{const o=r;o.getChildren&&o.getChildren().forEach(n=>s.push(n))}),i.length>0&&i[0]instanceof jt&&this.doAddHeaderHeader(e,i,t),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,e,t)}doAddHeaderHeader(i,e,t){const s=i.onNewHeaderGroupingRow();let r=0;e.forEach(o=>{const n=o;let a;t?a=t(this.gos.addGridCommonParams({columnGroup:n})):a=this.columnModel.getDisplayNameForColumnGroup(n,"header");const l=n.getLeafColumns().reduce((u,h,d,c)=>{let p=ye.last(u);return h.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[d],u.push(p)):p&&p[1]==null&&(p[1]=d-1),d===c.length-1&&p&&p[1]==null&&(p[1]=d),u},[]);s.onColumn(n,a||"",r++,n.getLeafColumns().length-1,l)})}};Fi([R("displayedGroupCreator")],Vs.prototype,"displayedGroupCreator",2);Fi([R("columnModel")],Vs.prototype,"columnModel",2);Fi([R("rowModel")],Vs.prototype,"rowModel",2);Fi([R("pinnedRowModel")],Vs.prototype,"pinnedRowModel",2);Fi([R("selectionService")],Vs.prototype,"selectionService",2);Fi([R("rowNodeSorter")],Vs.prototype,"rowNodeSorter",2);Fi([R("sortController")],Vs.prototype,"sortController",2);Vs=Fi([le("gridSerializer")],Vs);var aE="31.3.4",lE={version:aE,moduleName:"@ag-grid-community/csv-export",beans:[_r,Vs]},{utf8_encode:oT}=ye;ze.__registerModules([K_,eE,lE],!1,void 0);var dr={},zr={};/**
* @license React
* react-dom-server-legacy.browser.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var of;function uE(){if(of)return zr;of=1;var i=Qf();function e(m){for(var x="https://reactjs.org/docs/error-decoder.html?invariant="+m,F=1;F<arguments.length;F++)x+="&args[]="+encodeURIComponent(arguments[F]);return"Minified React error #"+m+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var t=Object.prototype.hasOwnProperty,s=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,r={},o={};function n(m){return t.call(o,m)?!0:t.call(r,m)?!1:s.test(m)?o[m]=!0:(r[m]=!0,!1)}function a(m,x,F,I,U,V,X){this.acceptsBooleans=x===2||x===3||x===4,this.attributeName=I,this.attributeNamespace=U,this.mustUseProperty=F,this.propertyName=m,this.type=x,this.sanitizeURL=V,this.removeEmptyString=X}var l={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(m){l[m]=new a(m,0,!1,m,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(m){var x=m[0];l[x]=new a(x,1,!1,m[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(m){l[m]=new a(m,2,!1,m.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(m){l[m]=new a(m,2,!1,m,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(m){l[m]=new a(m,3,!1,m.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(m){l[m]=new a(m,3,!0,m,null,!1,!1)}),["capture","download"].forEach(function(m){l[m]=new a(m,4,!1,m,null,!1,!1)}),["cols","rows","size","span"].forEach(function(m){l[m]=new a(m,6,!1,m,null,!1,!1)}),["rowSpan","start"].forEach(function(m){l[m]=new a(m,5,!1,m.toLowerCase(),null,!1,!1)});var u=/[\-:]([a-z])/g;function h(m){return m[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(m){var x=m.replace(u,h);l[x]=new a(x,1,!1,m,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(m){var x=m.replace(u,h);l[x]=new a(x,1,!1,m,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(m){var x=m.replace(u,h);l[x]=new a(x,1,!1,m,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(m){l[m]=new a(m,1,!1,m.toLowerCase(),null,!1,!1)}),l.xlinkHref=new a("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(m){l[m]=new a(m,1,!1,m.toLowerCase(),null,!0,!0)});var d={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},c=["Webkit","ms","Moz","O"];Object.keys(d).forEach(function(m){c.forEach(function(x){x=x+m.charAt(0).toUpperCase()+m.substring(1),d[x]=d[m]})});var p=/["'&<>]/;function y(m){if(typeof m=="boolean"||typeof m=="number")return""+m;m=""+m;var x=p.exec(m);if(x){var F="",I,U=0;for(I=x.index;I<m.length;I++){switch(m.charCodeAt(I)){case 34:x=""";break;case 38:x="&";break;case 39:x="'";break;case 60:x="<";break;case 62:x=">";break;default:continue}U!==I&&(F+=m.substring(U,I)),U=I+1,F+=x}m=U!==I?F+m.substring(U,I):F}return m}var f=/([A-Z])/g,w=/^ms-/,_=Array.isArray;function P(m,x){return{insertionMode:m,selectedValue:x}}function T(m,x,F){switch(x){case"select":return P(1,F.value!=null?F.value:F.defaultValue);case"svg":return P(2,null);case"math":return P(3,null);case"foreignObject":return P(1,null);case"table":return P(4,null);case"thead":case"tbody":case"tfoot":return P(5,null);case"colgroup":return P(7,null);case"tr":return P(6,null)}return 4<=m.insertionMode||m.insertionMode===0?P(1,null):m}var D=new Map;function M(m,x,F){if(typeof F!="object")throw Error(e(62));x=!0;for(var I in F)if(t.call(F,I)){var U=F[I];if(U!=null&&typeof U!="boolean"&&U!==""){if(I.indexOf("--")===0){var V=y(I);U=y((""+U).trim())}else{V=I;var X=D.get(V);X!==void 0||(X=y(V.replace(f,"-$1").toLowerCase().replace(w,"-ms-")),D.set(V,X)),V=X,U=typeof U=="number"?U===0||t.call(d,I)?""+U:U+"px":y((""+U).trim())}x?(x=!1,m.push(' style="',V,":",U)):m.push(";",V,":",U)}}x||m.push('"')}function O(m,x,F,I){switch(F){case"style":M(m,x,I);return;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(2<F.length)||F[0]!=="o"&&F[0]!=="O"||F[1]!=="n"&&F[1]!=="N"){if(x=l.hasOwnProperty(F)?l[F]:null,x!==null){switch(typeof I){case"function":case"symbol":return;case"boolean":if(!x.acceptsBooleans)return}switch(F=x.attributeName,x.type){case 3:I&&m.push(" ",F,'=""');break;case 4:I===!0?m.push(" ",F,'=""'):I!==!1&&m.push(" ",F,'="',y(I),'"');break;case 5:isNaN(I)||m.push(" ",F,'="',y(I),'"');break;case 6:!isNaN(I)&&1<=I&&m.push(" ",F,'="',y(I),'"');break;default:x.sanitizeURL&&(I=""+I),m.push(" ",F,'="',y(I),'"')}}else if(n(F)){switch(typeof I){case"function":case"symbol":return;case"boolean":if(x=F.toLowerCase().slice(0,5),x!=="data-"&&x!=="aria-")return}m.push(" ",F,'="',y(I),'"')}}}function N(m,x,F){if(x!=null){if(F!=null)throw Error(e(60));if(typeof x!="object"||!("__html"in x))throw Error(e(61));x=x.__html,x!=null&&m.push(""+x)}}function z(m){var x="";return i.Children.forEach(m,function(F){F!=null&&(x+=F)}),x}function Y(m,x,F,I){m.push(ee(F));var U=F=null,V;for(V in x)if(t.call(x,V)){var X=x[V];if(X!=null)switch(V){case"children":F=X;break;case"dangerouslySetInnerHTML":U=X;break;default:O(m,I,V,X)}}return m.push(">"),N(m,U,F),typeof F=="string"?(m.push(y(F)),null):F}var W=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,$=new Map;function ee(m){var x=$.get(m);if(x===void 0){if(!W.test(m))throw Error(e(65,m));x="<"+m,$.set(m,x)}return x}function re(m,x,F,I,U){switch(x){case"select":m.push(ee("select"));var V=null,X=null;for(Le in F)if(t.call(F,Le)){var ae=F[Le];if(ae!=null)switch(Le){case"children":V=ae;break;case"dangerouslySetInnerHTML":X=ae;break;case"defaultValue":case"value":break;default:O(m,I,Le,ae)}}return m.push(">"),N(m,X,V),V;case"option":X=U.selectedValue,m.push(ee("option"));var Ee=ae=null,Pe=null,Le=null;for(V in F)if(t.call(F,V)){var ft=F[V];if(ft!=null)switch(V){case"children":ae=ft;break;case"selected":Pe=ft;break;case"dangerouslySetInnerHTML":Le=ft;break;case"value":Ee=ft;default:O(m,I,V,ft)}}if(X!=null)if(F=Ee!==null?""+Ee:z(ae),_(X)){for(I=0;I<X.length;I++)if(""+X[I]===F){m.push(' selected=""');break}}else""+X===F&&m.push(' selected=""');else Pe&&m.push(' selected=""');return m.push(">"),N(m,Le,ae),ae;case"textarea":m.push(ee("textarea")),Le=X=V=null;for(ae in F)if(t.call(F,ae)&&(Ee=F[ae],Ee!=null))switch(ae){case"children":Le=Ee;break;case"value":V=Ee;break;case"defaultValue":X=Ee;break;case"dangerouslySetInnerHTML":throw Error(e(91));default:O(m,I,ae,Ee)}if(V===null&&X!==null&&(V=X),m.push(">"),Le!=null){if(V!=null)throw Error(e(92));if(_(Le)&&1<Le.length)throw Error(e(93));V=""+Le}return typeof V=="string"&&V[0]===`
`&&m.push(`
`),V!==null&&m.push(y(""+V)),null;case"input":m.push(ee("input")),Ee=Le=ae=V=null;for(X in F)if(t.call(F,X)&&(Pe=F[X],Pe!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(e(399,"input"));case"defaultChecked":Ee=Pe;break;case"defaultValue":ae=Pe;break;case"checked":Le=Pe;break;case"value":V=Pe;break;default:O(m,I,X,Pe)}return Le!==null?O(m,I,"checked",Le):Ee!==null&&O(m,I,"checked",Ee),V!==null?O(m,I,"value",V):ae!==null&&O(m,I,"value",ae),m.push("/>"),null;case"menuitem":m.push(ee("menuitem"));for(var os in F)if(t.call(F,os)&&(V=F[os],V!=null))switch(os){case"children":case"dangerouslySetInnerHTML":throw Error(e(400));default:O(m,I,os,V)}return m.push(">"),null;case"title":m.push(ee("title")),V=null;for(ft in F)if(t.call(F,ft)&&(X=F[ft],X!=null))switch(ft){case"children":V=X;break;case"dangerouslySetInnerHTML":throw Error(e(434));default:O(m,I,ft,X)}return m.push(">"),V;case"listing":case"pre":m.push(ee(x)),X=V=null;for(Ee in F)if(t.call(F,Ee)&&(ae=F[Ee],ae!=null))switch(Ee){case"children":V=ae;break;case"dangerouslySetInnerHTML":X=ae;break;default:O(m,I,Ee,ae)}if(m.push(">"),X!=null){if(V!=null)throw Error(e(60));if(typeof X!="object"||!("__html"in X))throw Error(e(61));F=X.__html,F!=null&&(typeof F=="string"&&0<F.length&&F[0]===`
`?m.push(`
`,F):m.push(""+F))}return typeof V=="string"&&V[0]===`
`&&m.push(`
`),V;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":m.push(ee(x));for(var ns in F)if(t.call(F,ns)&&(V=F[ns],V!=null))switch(ns){case"children":case"dangerouslySetInnerHTML":throw Error(e(399,x));default:O(m,I,ns,V)}return m.push("/>"),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return Y(m,F,x,I);case"html":return U.insertionMode===0&&m.push("<!DOCTYPE html>"),Y(m,F,x,I);default:if(x.indexOf("-")===-1&&typeof F.is!="string")return Y(m,F,x,I);m.push(ee(x)),X=V=null;for(Pe in F)if(t.call(F,Pe)&&(ae=F[Pe],ae!=null))switch(Pe){case"children":V=ae;break;case"dangerouslySetInnerHTML":X=ae;break;case"style":M(m,I,ae);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:n(Pe)&&typeof ae!="function"&&typeof ae!="symbol"&&m.push(" ",Pe,'="',y(ae),'"')}return m.push(">"),N(m,X,V),V}}function me(m,x,F){if(m.push('<!--$?--><template id="'),F===null)throw Error(e(395));return m.push(F),m.push('"></template>')}function he(m,x,F,I){switch(F.insertionMode){case 0:case 1:return m.push('<div hidden id="'),m.push(x.segmentPrefix),x=I.toString(16),m.push(x),m.push('">');case 2:return m.push('<svg aria-hidden="true" style="display:none" id="'),m.push(x.segmentPrefix),x=I.toString(16),m.push(x),m.push('">');case 3:return m.push('<math aria-hidden="true" style="display:none" id="'),m.push(x.segmentPrefix),x=I.toString(16),m.push(x),m.push('">');case 4:return m.push('<table hidden id="'),m.push(x.segmentPrefix),x=I.toString(16),m.push(x),m.push('">');case 5:return m.push('<table hidden><tbody id="'),m.push(x.segmentPrefix),x=I.toString(16),m.push(x),m.push('">');case 6:return m.push('<table hidden><tr id="'),m.push(x.segmentPrefix),x=I.toString(16),m.push(x),m.push('">');case 7:return m.push('<table hidden><colgroup id="'),m.push(x.segmentPrefix),x=I.toString(16),m.push(x),m.push('">');default:throw Error(e(397))}}function ce(m,x){switch(x.insertionMode){case 0:case 1:return m.push("</div>");case 2:return m.push("</svg>");case 3:return m.push("</math>");case 4:return m.push("</table>");case 5:return m.push("</tbody></table>");case 6:return m.push("</tr></table>");case 7:return m.push("</colgroup></table>");default:throw Error(e(397))}}var ne=/[<\u2028\u2029]/g;function oe(m){return JSON.stringify(m).replace(ne,function(x){switch(x){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}function Q(m,x){return x=x===void 0?"":x,{bootstrapChunks:[],startInlineScript:"<script>",placeholderPrefix:x+"P:",segmentPrefix:x+"S:",boundaryPrefix:x+"B:",idPrefix:x,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1,generateStaticMarkup:m}}function pe(m,x,F,I){return F.generateStaticMarkup?(m.push(y(x)),!1):(x===""?m=I:(I&&m.push("<!-- -->"),m.push(y(x)),m=!0),m)}var _e=Object.assign,ve=Symbol.for("react.element"),we=Symbol.for("react.portal"),Ze=Symbol.for("react.fragment"),Ie=Symbol.for("react.strict_mode"),De=Symbol.for("react.profiler"),rt=Symbol.for("react.provider"),bt=Symbol.for("react.context"),Et=Symbol.for("react.forward_ref"),bi=Symbol.for("react.suspense"),Ue=Symbol.for("react.suspense_list"),ot=Symbol.for("react.memo"),Ve=Symbol.for("react.lazy"),Fe=Symbol.for("react.scope"),pt=Symbol.for("react.debug_trace_mode"),Yt=Symbol.for("react.legacy_hidden"),ai=Symbol.for("react.default_value"),Si=Symbol.iterator;function ss(m){if(m==null)return null;if(typeof m=="function")return m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case Ze:return"Fragment";case we:return"Portal";case De:return"Profiler";case Ie:return"StrictMode";case bi:return"Suspense";case Ue:return"SuspenseList"}if(typeof m=="object")switch(m.$$typeof){case bt:return(m.displayName||"Context")+".Consumer";case rt:return(m._context.displayName||"Context")+".Provider";case Et:var x=m.render;return m=m.displayName,m||(m=x.displayName||x.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case ot:return x=m.displayName||null,x!==null?x:ss(m.type)||"Memo";case Ve:x=m._payload,m=m._init;try{return ss(m(x))}catch{}}return null}var Wi={};function rs(m,x){if(m=m.contextTypes,!m)return Wi;var F={},I;for(I in m)F[I]=x[I];return F}var ei=null;function gt(m,x){if(m!==x){m.context._currentValue2=m.parentValue,m=m.parent;var F=x.parent;if(m===null){if(F!==null)throw Error(e(401))}else{if(F===null)throw Error(e(401));gt(m,F)}x.context._currentValue2=x.value}}function or(m){m.context._currentValue2=m.parentValue,m=m.parent,m!==null&&or(m)}function Or(m){var x=m.parent;x!==null&&Or(x),m.context._currentValue2=m.value}function St(m,x){if(m.context._currentValue2=m.parentValue,m=m.parent,m===null)throw Error(e(402));m.depth===x.depth?gt(m,x):St(m,x)}function li(m,x){var F=x.parent;if(F===null)throw Error(e(402));m.depth===F.depth?gt(m,F):li(m,F),x.context._currentValue2=x.value}function Hs(m){var x=ei;x!==m&&(x===null?Or(m):m===null?or(x):x.depth===m.depth?gt(x,m):x.depth>m.depth?St(x,m):li(x,m),ei=m)}var Wl={isMounted:function(){return!1},enqueueSetState:function(m,x){m=m._reactInternals,m.queue!==null&&m.queue.push(x)},enqueueReplaceState:function(m,x){m=m._reactInternals,m.replace=!0,m.queue=[x]},enqueueForceUpdate:function(){}};function jl(m,x,F,I){var U=m.state!==void 0?m.state:null;m.updater=Wl,m.props=F,m.state=U;var V={queue:[],replace:!1};m._reactInternals=V;var X=x.contextType;if(m.context=typeof X=="object"&&X!==null?X._currentValue2:I,X=x.getDerivedStateFromProps,typeof X=="function"&&(X=X(F,U),U=X==null?U:_e({},U,X),m.state=U),typeof x.getDerivedStateFromProps!="function"&&typeof m.getSnapshotBeforeUpdate!="function"&&(typeof m.UNSAFE_componentWillMount=="function"||typeof m.componentWillMount=="function"))if(x=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),x!==m.state&&Wl.enqueueReplaceState(m,m.state,null),V.queue!==null&&0<V.queue.length)if(x=V.queue,X=V.replace,V.queue=null,V.replace=!1,X&&x.length===1)m.state=x[0];else{for(V=X?x[0]:m.state,U=!0,X=X?1:0;X<x.length;X++){var ae=x[X];ae=typeof ae=="function"?ae.call(m,V,F,I):ae,ae!=null&&(U?(U=!1,V=_e({},V,ae)):_e(V,ae))}m.state=V}else V.queue=null}var Sd={id:1,overflow:""};function Zn(m,x,F){var I=m.id;m=m.overflow;var U=32-Bo(I)-1;I&=~(1<<U),F+=1;var V=32-Bo(x)+U;if(30<V){var X=U-U%5;return V=(I&(1<<X)-1).toString(32),I>>=X,U-=X,{id:1<<32-Bo(x)+U|F<<U|I,overflow:V+m}}return{id:1<<V|F<<U|I,overflow:m}}var Bo=Math.clz32?Math.clz32:xd,_d=Math.log,Ed=Math.LN2;function xd(m){return m>>>=0,m===0?32:31-(_d(m)/Ed|0)|0}function Rd(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}var Dd=typeof Object.is=="function"?Object.is:Rd,ji=null,Jn=null,Wo=null,Je=null,Nr=!1,jo=!1,kr=0,Rs=null,Uo=0;function Bs(){if(ji===null)throw Error(e(321));return ji}function Ul(){if(0<Uo)throw Error(e(312));return{memoizedState:null,queue:null,next:null}}function ea(){return Je===null?Wo===null?(Nr=!1,Wo=Je=Ul()):(Nr=!0,Je=Wo):Je.next===null?(Nr=!1,Je=Je.next=Ul()):(Nr=!0,Je=Je.next),Je}function ta(){Jn=ji=null,jo=!1,Wo=null,Uo=0,Je=Rs=null}function zl(m,x){return typeof x=="function"?x(m):x}function Yl(m,x,F){if(ji=Bs(),Je=ea(),Nr){var I=Je.queue;if(x=I.dispatch,Rs!==null&&(F=Rs.get(I),F!==void 0)){Rs.delete(I),I=Je.memoizedState;do I=m(I,F.action),F=F.next;while(F!==null);return Je.memoizedState=I,[I,x]}return[Je.memoizedState,x]}return m=m===zl?typeof x=="function"?x():x:F!==void 0?F(x):x,Je.memoizedState=m,m=Je.queue={last:null,dispatch:null},m=m.dispatch=Pd.bind(null,ji,m),[Je.memoizedState,m]}function $l(m,x){if(ji=Bs(),Je=ea(),x=x===void 0?null:x,Je!==null){var F=Je.memoizedState;if(F!==null&&x!==null){var I=F[1];e:if(I===null)I=!1;else{for(var U=0;U<I.length&&U<x.length;U++)if(!Dd(x[U],I[U])){I=!1;break e}I=!0}if(I)return F[0]}}return m=m(),Je.memoizedState=[m,x],m}function Pd(m,x,F){if(25<=Uo)throw Error(e(301));if(m===ji)if(jo=!0,m={action:F,next:null},Rs===null&&(Rs=new Map),F=Rs.get(x),F===void 0)Rs.set(x,m);else{for(x=F;x.next!==null;)x=x.next;x.next=m}}function Td(){throw Error(e(394))}function zo(){}var Kl={readContext:function(m){return m._currentValue2},useContext:function(m){return Bs(),m._currentValue2},useMemo:$l,useReducer:Yl,useRef:function(m){ji=Bs(),Je=ea();var x=Je.memoizedState;return x===null?(m={current:m},Je.memoizedState=m):x},useState:function(m){return Yl(zl,m)},useInsertionEffect:zo,useLayoutEffect:function(){},useCallback:function(m,x){return $l(function(){return m},x)},useImperativeHandle:zo,useEffect:zo,useDebugValue:zo,useDeferredValue:function(m){return Bs(),m},useTransition:function(){return Bs(),[!1,Td]},useId:function(){var m=Jn.treeContext,x=m.overflow;m=m.id,m=(m&~(1<<32-Bo(m)-1)).toString(32)+x;var F=Yo;if(F===null)throw Error(e(404));return x=kr++,m=":"+F.idPrefix+"R"+m,0<x&&(m+="H"+x.toString(32)),m+":"},useMutableSource:function(m,x){return Bs(),x(m._source)},useSyncExternalStore:function(m,x,F){if(F===void 0)throw Error(e(407));return F()}},Yo=null,ia=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function Ad(m){return console.error(m),null}function Gr(){}function Fd(m,x,F,I,U,V,X,ae,Ee){var Pe=[],Le=new Set;return x={destination:null,responseState:x,progressiveChunkSize:I===void 0?12800:I,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:Le,pingedTasks:Pe,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:U===void 0?Ad:U,onAllReady:Gr,onShellReady:X===void 0?Gr:X,onShellError:Gr,onFatalError:Gr},F=$o(x,0,null,F,!1,!1),F.parentFlushed=!0,m=sa(x,m,null,F,Le,Wi,null,Sd),Pe.push(m),x}function sa(m,x,F,I,U,V,X,ae){m.allPendingTasks++,F===null?m.pendingRootTasks++:F.pendingTasks++;var Ee={node:x,ping:function(){var Pe=m.pingedTasks;Pe.push(Ee),Pe.length===1&&eu(m)},blockedBoundary:F,blockedSegment:I,abortSet:U,legacyContext:V,context:X,treeContext:ae};return U.add(Ee),Ee}function $o(m,x,F,I,U,V){return{status:0,id:-1,index:x,parentFlushed:!1,chunks:[],children:[],formatContext:I,boundary:F,lastPushedText:U,textEmbedded:V}}function Vr(m,x){if(m=m.onError(x),m!=null&&typeof m!="string")throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof m+'" instead');return m}function Ko(m,x){var F=m.onShellError;F(x),F=m.onFatalError,F(x),m.destination!==null?(m.status=2,m.destination.destroy(x)):(m.status=1,m.fatalError=x)}function Xl(m,x,F,I,U){for(ji={},Jn=x,kr=0,m=F(I,U);jo;)jo=!1,kr=0,Uo+=1,Je=null,m=F(I,U);return ta(),m}function ql(m,x,F,I){var U=F.render(),V=I.childContextTypes;if(V!=null){var X=x.legacyContext;if(typeof F.getChildContext!="function")I=X;else{F=F.getChildContext();for(var ae in F)if(!(ae in V))throw Error(e(108,ss(I)||"Unknown",ae));I=_e({},X,F)}x.legacyContext=I,ui(m,x,U),x.legacyContext=X}else ui(m,x,U)}function Ql(m,x){if(m&&m.defaultProps){x=_e({},x),m=m.defaultProps;for(var F in m)x[F]===void 0&&(x[F]=m[F]);return x}return x}function ra(m,x,F,I,U){if(typeof F=="function")if(F.prototype&&F.prototype.isReactComponent){U=rs(F,x.legacyContext);var V=F.contextType;V=new F(I,typeof V=="object"&&V!==null?V._currentValue2:U),jl(V,F,I,U),ql(m,x,V,F)}else{V=rs(F,x.legacyContext),U=Xl(m,x,F,I,V);var X=kr!==0;if(typeof U=="object"&&U!==null&&typeof U.render=="function"&&U.$$typeof===void 0)jl(U,F,I,V),ql(m,x,U,F);else if(X){I=x.treeContext,x.treeContext=Zn(I,1,0);try{ui(m,x,U)}finally{x.treeContext=I}}else ui(m,x,U)}else if(typeof F=="string"){switch(U=x.blockedSegment,V=re(U.chunks,F,I,m.responseState,U.formatContext),U.lastPushedText=!1,X=U.formatContext,U.formatContext=T(X,F,I),oa(m,x,V),U.formatContext=X,F){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:U.chunks.push("</",F,">")}U.lastPushedText=!1}else{switch(F){case Yt:case pt:case Ie:case De:case Ze:ui(m,x,I.children);return;case Ue:ui(m,x,I.children);return;case Fe:throw Error(e(343));case bi:e:{F=x.blockedBoundary,U=x.blockedSegment,V=I.fallback,I=I.children,X=new Set;var ae={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:X,errorDigest:null},Ee=$o(m,U.chunks.length,ae,U.formatContext,!1,!1);U.children.push(Ee),U.lastPushedText=!1;var Pe=$o(m,0,null,U.formatContext,!1,!1);Pe.parentFlushed=!0,x.blockedBoundary=ae,x.blockedSegment=Pe;try{if(oa(m,x,I),m.responseState.generateStaticMarkup||Pe.lastPushedText&&Pe.textEmbedded&&Pe.chunks.push("<!-- -->"),Pe.status=1,nr(ae,Pe),ae.pendingTasks===0)break e}catch(Le){Pe.status=4,ae.forceClientRender=!0,ae.errorDigest=Vr(m,Le)}finally{x.blockedBoundary=F,x.blockedSegment=U}x=sa(m,V,F,Ee,X,x.legacyContext,x.context,x.treeContext),m.pingedTasks.push(x)}return}if(typeof F=="object"&&F!==null)switch(F.$$typeof){case Et:if(I=Xl(m,x,F.render,I,U),kr!==0){F=x.treeContext,x.treeContext=Zn(F,1,0);try{ui(m,x,I)}finally{x.treeContext=F}}else ui(m,x,I);return;case ot:F=F.type,I=Ql(F,I),ra(m,x,F,I,U);return;case rt:if(U=I.children,F=F._context,I=I.value,V=F._currentValue2,F._currentValue2=I,X=ei,ei=I={parent:X,depth:X===null?0:X.depth+1,context:F,parentValue:V,value:I},x.context=I,ui(m,x,U),m=ei,m===null)throw Error(e(403));I=m.parentValue,m.context._currentValue2=I===ai?m.context._defaultValue:I,m=ei=m.parent,x.context=m;return;case bt:I=I.children,I=I(F._currentValue2),ui(m,x,I);return;case Ve:U=F._init,F=U(F._payload),I=Ql(F,I),ra(m,x,F,I,void 0);return}throw Error(e(130,F==null?F:typeof F,""))}}function ui(m,x,F){if(x.node=F,typeof F=="object"&&F!==null){switch(F.$$typeof){case ve:ra(m,x,F.type,F.props,F.ref);return;case we:throw Error(e(257));case Ve:var I=F._init;F=I(F._payload),ui(m,x,F);return}if(_(F)){Zl(m,x,F);return}if(F===null||typeof F!="object"?I=null:(I=Si&&F[Si]||F["@@iterator"],I=typeof I=="function"?I:null),I&&(I=I.call(F))){if(F=I.next(),!F.done){var U=[];do U.push(F.value),F=I.next();while(!F.done);Zl(m,x,U)}return}throw m=Object.prototype.toString.call(F),Error(e(31,m==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":m))}typeof F=="string"?(I=x.blockedSegment,I.lastPushedText=pe(x.blockedSegment.chunks,F,m.responseState,I.lastPushedText)):typeof F=="number"&&(I=x.blockedSegment,I.lastPushedText=pe(x.blockedSegment.chunks,""+F,m.responseState,I.lastPushedText))}function Zl(m,x,F){for(var I=F.length,U=0;U<I;U++){var V=x.treeContext;x.treeContext=Zn(V,I,U);try{oa(m,x,F[U])}finally{x.treeContext=V}}}function oa(m,x,F){var I=x.blockedSegment.formatContext,U=x.legacyContext,V=x.context;try{return ui(m,x,F)}catch(Ee){if(ta(),typeof Ee=="object"&&Ee!==null&&typeof Ee.then=="function"){F=Ee;var X=x.blockedSegment,ae=$o(m,X.chunks.length,null,X.formatContext,X.lastPushedText,!0);X.children.push(ae),X.lastPushedText=!1,m=sa(m,x.node,x.blockedBoundary,ae,x.abortSet,x.legacyContext,x.context,x.treeContext).ping,F.then(m,m),x.blockedSegment.formatContext=I,x.legacyContext=U,x.context=V,Hs(V)}else throw x.blockedSegment.formatContext=I,x.legacyContext=U,x.context=V,Hs(V),Ee}}function na(m){var x=m.blockedBoundary;m=m.blockedSegment,m.status=3,ar(this,x,m)}function Jl(m,x,F){var I=m.blockedBoundary;m.blockedSegment.status=3,I===null?(x.allPendingTasks--,x.status!==2&&(x.status=2,x.destination!==null&&x.destination.push(null))):(I.pendingTasks--,I.forceClientRender||(I.forceClientRender=!0,m=F===void 0?Error(e(432)):F,I.errorDigest=x.onError(m),I.parentFlushed&&x.clientRenderedBoundaries.push(I)),I.fallbackAbortableTasks.forEach(function(U){return Jl(U,x,F)}),I.fallbackAbortableTasks.clear(),x.allPendingTasks--,x.allPendingTasks===0&&(I=x.onAllReady,I()))}function nr(m,x){if(x.chunks.length===0&&x.children.length===1&&x.children[0].boundary===null){var F=x.children[0];F.id=x.id,F.parentFlushed=!0,F.status===1&&nr(m,F)}else m.completedSegments.push(x)}function ar(m,x,F){if(x===null){if(F.parentFlushed){if(m.completedRootSegment!==null)throw Error(e(389));m.completedRootSegment=F}m.pendingRootTasks--,m.pendingRootTasks===0&&(m.onShellError=Gr,x=m.onShellReady,x())}else x.pendingTasks--,x.forceClientRender||(x.pendingTasks===0?(F.parentFlushed&&F.status===1&&nr(x,F),x.parentFlushed&&m.completedBoundaries.push(x),x.fallbackAbortableTasks.forEach(na,m),x.fallbackAbortableTasks.clear()):F.parentFlushed&&F.status===1&&(nr(x,F),x.completedSegments.length===1&&x.parentFlushed&&m.partialBoundaries.push(x)));m.allPendingTasks--,m.allPendingTasks===0&&(m=m.onAllReady,m())}function eu(m){if(m.status!==2){var x=ei,F=ia.current;ia.current=Kl;var I=Yo;Yo=m.responseState;try{var U=m.pingedTasks,V;for(V=0;V<U.length;V++){var X=U[V],ae=m,Ee=X.blockedSegment;if(Ee.status===0){Hs(X.context);try{ui(ae,X,X.node),ae.responseState.generateStaticMarkup||Ee.lastPushedText&&Ee.textEmbedded&&Ee.chunks.push("<!-- -->"),X.abortSet.delete(X),Ee.status=1,ar(ae,X.blockedBoundary,Ee)}catch(Mi){if(ta(),typeof Mi=="object"&&Mi!==null&&typeof Mi.then=="function"){var Pe=X.ping;Mi.then(Pe,Pe)}else{X.abortSet.delete(X),Ee.status=4;var Le=X.blockedBoundary,ft=Mi,os=Vr(ae,ft);if(Le===null?Ko(ae,ft):(Le.pendingTasks--,Le.forceClientRender||(Le.forceClientRender=!0,Le.errorDigest=os,Le.parentFlushed&&ae.clientRenderedBoundaries.push(Le))),ae.allPendingTasks--,ae.allPendingTasks===0){var ns=ae.onAllReady;ns()}}}finally{}}}U.splice(0,V),m.destination!==null&&Xo(m,m.destination)}catch(Mi){Vr(m,Mi),Ko(m,Mi)}finally{Yo=I,ia.current=F,F===Kl&&Hs(x)}}}function Hr(m,x,F){switch(F.parentFlushed=!0,F.status){case 0:var I=F.id=m.nextSegmentId++;return F.lastPushedText=!1,F.textEmbedded=!1,m=m.responseState,x.push('<template id="'),x.push(m.placeholderPrefix),m=I.toString(16),x.push(m),x.push('"></template>');case 1:F.status=2;var U=!0;I=F.chunks;var V=0;F=F.children;for(var X=0;X<F.length;X++){for(U=F[X];V<U.index;V++)x.push(I[V]);U=Br(m,x,U)}for(;V<I.length-1;V++)x.push(I[V]);return V<I.length&&(U=x.push(I[V])),U;default:throw Error(e(390))}}function Br(m,x,F){var I=F.boundary;if(I===null)return Hr(m,x,F);if(I.parentFlushed=!0,I.forceClientRender)return m.responseState.generateStaticMarkup||(I=I.errorDigest,x.push("<!--$!-->"),x.push("<template"),I&&(x.push(' data-dgst="'),I=y(I),x.push(I),x.push('"')),x.push("></template>")),Hr(m,x,F),m=m.responseState.generateStaticMarkup?!0:x.push("<!--/$-->"),m;if(0<I.pendingTasks){I.rootSegmentID=m.nextSegmentId++,0<I.completedSegments.length&&m.partialBoundaries.push(I);var U=m.responseState,V=U.nextSuspenseID++;return U=U.boundaryPrefix+V.toString(16),I=I.id=U,me(x,m.responseState,I),Hr(m,x,F),x.push("<!--/$-->")}if(I.byteSize>m.progressiveChunkSize)return I.rootSegmentID=m.nextSegmentId++,m.completedBoundaries.push(I),me(x,m.responseState,I.id),Hr(m,x,F),x.push("<!--/$-->");if(m.responseState.generateStaticMarkup||x.push("<!--$-->"),F=I.completedSegments,F.length!==1)throw Error(e(391));return Br(m,x,F[0]),m=m.responseState.generateStaticMarkup?!0:x.push("<!--/$-->"),m}function aa(m,x,F){return he(x,m.responseState,F.formatContext,F.id),Br(m,x,F),ce(x,F.formatContext)}function la(m,x,F){for(var I=F.completedSegments,U=0;U<I.length;U++)ua(m,x,F,I[U]);if(I.length=0,m=m.responseState,I=F.id,F=F.rootSegmentID,x.push(m.startInlineScript),m.sentCompleteBoundaryFunction?x.push('$RC("'):(m.sentCompleteBoundaryFunction=!0,x.push('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("')),I===null)throw Error(e(395));return F=F.toString(16),x.push(I),x.push('","'),x.push(m.segmentPrefix),x.push(F),x.push('")<\/script>')}function ua(m,x,F,I){if(I.status===2)return!0;var U=I.id;if(U===-1){if((I.id=F.rootSegmentID)===-1)throw Error(e(392));return aa(m,x,I)}return aa(m,x,I),m=m.responseState,x.push(m.startInlineScript),m.sentCompleteSegmentFunction?x.push('$RS("'):(m.sentCompleteSegmentFunction=!0,x.push('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("')),x.push(m.segmentPrefix),U=U.toString(16),x.push(U),x.push('","'),x.push(m.placeholderPrefix),x.push(U),x.push('")<\/script>')}function Xo(m,x){try{var F=m.completedRootSegment;if(F!==null&&m.pendingRootTasks===0){Br(m,x,F),m.completedRootSegment=null;var I=m.responseState.bootstrapChunks;for(F=0;F<I.length-1;F++)x.push(I[F]);F<I.length&&x.push(I[F])}var U=m.clientRenderedBoundaries,V;for(V=0;V<U.length;V++){var X=U[V];I=x;var ae=m.responseState,Ee=X.id,Pe=X.errorDigest,Le=X.errorMessage,ft=X.errorComponentStack;if(I.push(ae.startInlineScript),ae.sentClientRenderFunction?I.push('$RX("'):(ae.sentClientRenderFunction=!0,I.push('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("')),Ee===null)throw Error(e(395));if(I.push(Ee),I.push('"'),Pe||Le||ft){I.push(",");var os=oe(Pe||"");I.push(os)}if(Le||ft){I.push(",");var ns=oe(Le||"");I.push(ns)}if(ft){I.push(",");var Mi=oe(ft);I.push(Mi)}if(!I.push(")<\/script>")){m.destination=null,V++,U.splice(0,V);return}}U.splice(0,V);var Wr=m.completedBoundaries;for(V=0;V<Wr.length;V++)if(!la(m,x,Wr[V])){m.destination=null,V++,Wr.splice(0,V);return}Wr.splice(0,V);var Ws=m.partialBoundaries;for(V=0;V<Ws.length;V++){var da=Ws[V];e:{U=m,X=x;var jr=da.completedSegments;for(ae=0;ae<jr.length;ae++)if(!ua(U,X,da,jr[ae])){ae++,jr.splice(0,ae);var su=!1;break e}jr.splice(0,ae),su=!0}if(!su){m.destination=null,V++,Ws.splice(0,V);return}}Ws.splice(0,V);var lr=m.completedBoundaries;for(V=0;V<lr.length;V++)if(!la(m,x,lr[V])){m.destination=null,V++,lr.splice(0,V);return}lr.splice(0,V)}finally{m.allPendingTasks===0&&m.pingedTasks.length===0&&m.clientRenderedBoundaries.length===0&&m.completedBoundaries.length===0&&x.push(null)}}function tu(m,x){try{var F=m.abortableTasks;F.forEach(function(I){return Jl(I,m,x)}),F.clear(),m.destination!==null&&Xo(m,m.destination)}catch(I){Vr(m,I),Ko(m,I)}}function iu(){}function ha(m,x,F,I){var U=!1,V=null,X="",ae={push:function(Pe){return Pe!==null&&(X+=Pe),!0},destroy:function(Pe){U=!0,V=Pe}},Ee=!1;if(m=Fd(m,Q(F,x?x.identifierPrefix:void 0),{insertionMode:1,selectedValue:null},1/0,iu,void 0,function(){Ee=!0}),eu(m),tu(m,I),m.status===1)m.status=2,ae.destroy(m.fatalError);else if(m.status!==2&&m.destination===null){m.destination=ae;try{Xo(m,ae)}catch(Pe){Vr(m,Pe),Ko(m,Pe)}}if(U)throw V;if(!Ee)throw Error(e(426));return X}return zr.renderToNodeStream=function(){throw Error(e(207))},zr.renderToStaticMarkup=function(m,x){return ha(m,x,!0,'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')},zr.renderToStaticNodeStream=function(){throw Error(e(208))},zr.renderToString=function(m,x){return ha(m,x,!1,'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')},zr.version="18.2.0",zr}var yu={};/**
* @license React
* react-dom-server.browser.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var nf;function hE(){if(nf)return yu;nf=1;var i=Qf();function e(v){for(var E="https://reactjs.org/docs/error-decoder.html?invariant="+v,A=1;A<arguments.length;A++)E+="&args[]="+encodeURIComponent(arguments[A]);return"Minified React error #"+v+"; visit "+E+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var t=null,s=0;function r(v,E){if(E.length!==0)if(512<E.length)0<s&&(v.enqueue(new Uint8Array(t.buffer,0,s)),t=new Uint8Array(512),s=0),v.enqueue(E);else{var A=t.length-s;A<E.length&&(A===0?v.enqueue(t):(t.set(E.subarray(0,A),s),v.enqueue(t),E=E.subarray(A)),t=new Uint8Array(512),s=0),t.set(E,s),s+=E.length}}function o(v,E){return r(v,E),!0}function n(v){t&&0<s&&(v.enqueue(new Uint8Array(t.buffer,0,s)),t=null,s=0)}var a=new TextEncoder;function l(v){return a.encode(v)}function u(v){return a.encode(v)}function h(v,E){typeof v.error=="function"?v.error(E):v.close()}var d=Object.prototype.hasOwnProperty,c=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},y={};function f(v){return d.call(y,v)?!0:d.call(p,v)?!1:c.test(v)?y[v]=!0:(p[v]=!0,!1)}function w(v,E,A,L,j,H,q){this.acceptsBooleans=E===2||E===3||E===4,this.attributeName=L,this.attributeNamespace=j,this.mustUseProperty=A,this.propertyName=v,this.type=E,this.sanitizeURL=H,this.removeEmptyString=q}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(v){_[v]=new w(v,0,!1,v,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(v){var E=v[0];_[E]=new w(E,1,!1,v[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(v){_[v]=new w(v,2,!1,v.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(v){_[v]=new w(v,2,!1,v,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(v){_[v]=new w(v,3,!1,v.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(v){_[v]=new w(v,3,!0,v,null,!1,!1)}),["capture","download"].forEach(function(v){_[v]=new w(v,4,!1,v,null,!1,!1)}),["cols","rows","size","span"].forEach(function(v){_[v]=new w(v,6,!1,v,null,!1,!1)}),["rowSpan","start"].forEach(function(v){_[v]=new w(v,5,!1,v.toLowerCase(),null,!1,!1)});var P=/[\-:]([a-z])/g;function T(v){return v[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(v){var E=v.replace(P,T);_[E]=new w(E,1,!1,v,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(v){var E=v.replace(P,T);_[E]=new w(E,1,!1,v,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(v){var E=v.replace(P,T);_[E]=new w(E,1,!1,v,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(v){_[v]=new w(v,1,!1,v.toLowerCase(),null,!1,!1)}),_.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(v){_[v]=new w(v,1,!1,v.toLowerCase(),null,!0,!0)});var D={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},M=["Webkit","ms","Moz","O"];Object.keys(D).forEach(function(v){M.forEach(function(E){E=E+v.charAt(0).toUpperCase()+v.substring(1),D[E]=D[v]})});var O=/["'&<>]/;function N(v){if(typeof v=="boolean"||typeof v=="number")return""+v;v=""+v;var E=O.exec(v);if(E){var A="",L,j=0;for(L=E.index;L<v.length;L++){switch(v.charCodeAt(L)){case 34:E=""";break;case 38:E="&";break;case 39:E="'";break;case 60:E="<";break;case 62:E=">";break;default:continue}j!==L&&(A+=v.substring(j,L)),j=L+1,A+=E}v=j!==L?A+v.substring(j,L):A}return v}var z=/([A-Z])/g,Y=/^ms-/,W=Array.isArray,$=u("<script>"),ee=u("<\/script>"),re=u('<script src="'),me=u('<script type="module" src="'),he=u('" async=""><\/script>'),ce=/(<\/|<)(s)(cript)/gi;function ne(v,E,A,L){return""+E+(A==="s"?"\\u0073":"\\u0053")+L}function oe(v,E,A,L,j){v=v===void 0?"":v,E=E===void 0?$:u('<script nonce="'+N(E)+'">');var H=[];if(A!==void 0&&H.push(E,l((""+A).replace(ce,ne)),ee),L!==void 0)for(A=0;A<L.length;A++)H.push(re,l(N(L[A])),he);if(j!==void 0)for(L=0;L<j.length;L++)H.push(me,l(N(j[L])),he);return{bootstrapChunks:H,startInlineScript:E,placeholderPrefix:u(v+"P:"),segmentPrefix:u(v+"S:"),boundaryPrefix:v+"B:",idPrefix:v,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1}}function Q(v,E){return{insertionMode:v,selectedValue:E}}function pe(v){return Q(v==="http://www.w3.org/2000/svg"?2:v==="http://www.w3.org/1998/Math/MathML"?3:0,null)}function _e(v,E,A){switch(E){case"select":return Q(1,A.value!=null?A.value:A.defaultValue);case"svg":return Q(2,null);case"math":return Q(3,null);case"foreignObject":return Q(1,null);case"table":return Q(4,null);case"thead":case"tbody":case"tfoot":return Q(5,null);case"colgroup":return Q(7,null);case"tr":return Q(6,null)}return 4<=v.insertionMode||v.insertionMode===0?Q(1,null):v}var ve=u("<!-- -->");function we(v,E,A,L){return E===""?L:(L&&v.push(ve),v.push(l(N(E))),!0)}var Ze=new Map,Ie=u(' style="'),De=u(":"),rt=u(";");function bt(v,E,A){if(typeof A!="object")throw Error(e(62));E=!0;for(var L in A)if(d.call(A,L)){var j=A[L];if(j!=null&&typeof j!="boolean"&&j!==""){if(L.indexOf("--")===0){var H=l(N(L));j=l(N((""+j).trim()))}else{H=L;var q=Ze.get(H);q!==void 0||(q=u(N(H.replace(z,"-$1").toLowerCase().replace(Y,"-ms-"))),Ze.set(H,q)),H=q,j=typeof j=="number"?j===0||d.call(D,L)?l(""+j):l(j+"px"):l(N((""+j).trim()))}E?(E=!1,v.push(Ie,H,De,j)):v.push(rt,H,De,j)}}E||v.push(Ue)}var Et=u(" "),bi=u('="'),Ue=u('"'),ot=u('=""');function Ve(v,E,A,L){switch(A){case"style":bt(v,E,L);return;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(2<A.length)||A[0]!=="o"&&A[0]!=="O"||A[1]!=="n"&&A[1]!=="N"){if(E=_.hasOwnProperty(A)?_[A]:null,E!==null){switch(typeof L){case"function":case"symbol":return;case"boolean":if(!E.acceptsBooleans)return}switch(A=l(E.attributeName),E.type){case 3:L&&v.push(Et,A,ot);break;case 4:L===!0?v.push(Et,A,ot):L!==!1&&v.push(Et,A,bi,l(N(L)),Ue);break;case 5:isNaN(L)||v.push(Et,A,bi,l(N(L)),Ue);break;case 6:!isNaN(L)&&1<=L&&v.push(Et,A,bi,l(N(L)),Ue);break;default:E.sanitizeURL&&(L=""+L),v.push(Et,A,bi,l(N(L)),Ue)}}else if(f(A)){switch(typeof L){case"function":case"symbol":return;case"boolean":if(E=A.toLowerCase().slice(0,5),E!=="data-"&&E!=="aria-")return}v.push(Et,l(A),bi,l(N(L)),Ue)}}}var Fe=u(">"),pt=u("/>");function Yt(v,E,A){if(E!=null){if(A!=null)throw Error(e(60));if(typeof E!="object"||!("__html"in E))throw Error(e(61));E=E.__html,E!=null&&v.push(l(""+E))}}function ai(v){var E="";return i.Children.forEach(v,function(A){A!=null&&(E+=A)}),E}var Si=u(' selected=""');function ss(v,E,A,L){v.push(gt(A));var j=A=null,H;for(H in E)if(d.call(E,H)){var q=E[H];if(q!=null)switch(H){case"children":A=q;break;case"dangerouslySetInnerHTML":j=q;break;default:Ve(v,L,H,q)}}return v.push(Fe),Yt(v,j,A),typeof A=="string"?(v.push(l(N(A))),null):A}var Wi=u(`
`),rs=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,ei=new Map;function gt(v){var E=ei.get(v);if(E===void 0){if(!rs.test(v))throw Error(e(65,v));E=u("<"+v),ei.set(v,E)}return E}var or=u("<!DOCTYPE html>");function Or(v,E,A,L,j){switch(E){case"select":v.push(gt("select"));var H=null,q=null;for(Oe in A)if(d.call(A,Oe)){var se=A[Oe];if(se!=null)switch(Oe){case"children":H=se;break;case"dangerouslySetInnerHTML":q=se;break;case"defaultValue":case"value":break;default:Ve(v,L,Oe,se)}}return v.push(Fe),Yt(v,q,H),H;case"option":q=j.selectedValue,v.push(gt("option"));var xe=se=null,ke=null,Oe=null;for(H in A)if(d.call(A,H)){var ht=A[H];if(ht!=null)switch(H){case"children":se=ht;break;case"selected":ke=ht;break;case"dangerouslySetInnerHTML":Oe=ht;break;case"value":xe=ht;default:Ve(v,L,H,ht)}}if(q!=null)if(A=xe!==null?""+xe:ai(se),W(q)){for(L=0;L<q.length;L++)if(""+q[L]===A){v.push(Si);break}}else""+q===A&&v.push(Si);else ke&&v.push(Si);return v.push(Fe),Yt(v,Oe,se),se;case"textarea":v.push(gt("textarea")),Oe=q=H=null;for(se in A)if(d.call(A,se)&&(xe=A[se],xe!=null))switch(se){case"children":Oe=xe;break;case"value":H=xe;break;case"defaultValue":q=xe;break;case"dangerouslySetInnerHTML":throw Error(e(91));default:Ve(v,L,se,xe)}if(H===null&&q!==null&&(H=q),v.push(Fe),Oe!=null){if(H!=null)throw Error(e(92));if(W(Oe)&&1<Oe.length)throw Error(e(93));H=""+Oe}return typeof H=="string"&&H[0]===`
`&&v.push(Wi),H!==null&&v.push(l(N(""+H))),null;case"input":v.push(gt("input")),xe=Oe=se=H=null;for(q in A)if(d.call(A,q)&&(ke=A[q],ke!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(e(399,"input"));case"defaultChecked":xe=ke;break;case"defaultValue":se=ke;break;case"checked":Oe=ke;break;case"value":H=ke;break;default:Ve(v,L,q,ke)}return Oe!==null?Ve(v,L,"checked",Oe):xe!==null&&Ve(v,L,"checked",xe),H!==null?Ve(v,L,"value",H):se!==null&&Ve(v,L,"value",se),v.push(pt),null;case"menuitem":v.push(gt("menuitem"));for(var Ii in A)if(d.call(A,Ii)&&(H=A[Ii],H!=null))switch(Ii){case"children":case"dangerouslySetInnerHTML":throw Error(e(400));default:Ve(v,L,Ii,H)}return v.push(Fe),null;case"title":v.push(gt("title")),H=null;for(ht in A)if(d.call(A,ht)&&(q=A[ht],q!=null))switch(ht){case"children":H=q;break;case"dangerouslySetInnerHTML":throw Error(e(434));default:Ve(v,L,ht,q)}return v.push(Fe),H;case"listing":case"pre":v.push(gt(E)),q=H=null;for(xe in A)if(d.call(A,xe)&&(se=A[xe],se!=null))switch(xe){case"children":H=se;break;case"dangerouslySetInnerHTML":q=se;break;default:Ve(v,L,xe,se)}if(v.push(Fe),q!=null){if(H!=null)throw Error(e(60));if(typeof q!="object"||!("__html"in q))throw Error(e(61));A=q.__html,A!=null&&(typeof A=="string"&&0<A.length&&A[0]===`
`?v.push(Wi,l(A)):v.push(l(""+A)))}return typeof H=="string"&&H[0]===`
`&&v.push(Wi),H;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":v.push(gt(E));for(var as in A)if(d.call(A,as)&&(H=A[as],H!=null))switch(as){case"children":case"dangerouslySetInnerHTML":throw Error(e(399,E));default:Ve(v,L,as,H)}return v.push(pt),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return ss(v,A,E,L);case"html":return j.insertionMode===0&&v.push(or),ss(v,A,E,L);default:if(E.indexOf("-")===-1&&typeof A.is!="string")return ss(v,A,E,L);v.push(gt(E)),q=H=null;for(ke in A)if(d.call(A,ke)&&(se=A[ke],se!=null))switch(ke){case"children":H=se;break;case"dangerouslySetInnerHTML":q=se;break;case"style":bt(v,L,se);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:f(ke)&&typeof se!="function"&&typeof se!="symbol"&&v.push(Et,l(ke),bi,l(N(se)),Ue)}return v.push(Fe),Yt(v,q,H),H}}var St=u("</"),li=u(">"),Hs=u('<template id="'),Wl=u('"></template>'),jl=u("<!--$-->"),Sd=u('<!--$?--><template id="'),Zn=u('"></template>'),Bo=u("<!--$!-->"),_d=u("<!--/$-->"),Ed=u("<template"),xd=u('"'),Rd=u(' data-dgst="');u(' data-msg="'),u(' data-stck="');var Dd=u("></template>");function ji(v,E,A){if(r(v,Sd),A===null)throw Error(e(395));return r(v,A),o(v,Zn)}var Jn=u('<div hidden id="'),Wo=u('">'),Je=u("</div>"),Nr=u('<svg aria-hidden="true" style="display:none" id="'),jo=u('">'),kr=u("</svg>"),Rs=u('<math aria-hidden="true" style="display:none" id="'),Uo=u('">'),Bs=u("</math>"),Ul=u('<table hidden id="'),ea=u('">'),ta=u("</table>"),zl=u('<table hidden><tbody id="'),Yl=u('">'),$l=u("</tbody></table>"),Pd=u('<table hidden><tr id="'),Td=u('">'),zo=u("</tr></table>"),Kl=u('<table hidden><colgroup id="'),Yo=u('">'),ia=u("</colgroup></table>");function Ad(v,E,A,L){switch(A.insertionMode){case 0:case 1:return r(v,Jn),r(v,E.segmentPrefix),r(v,l(L.toString(16))),o(v,Wo);case 2:return r(v,Nr),r(v,E.segmentPrefix),r(v,l(L.toString(16))),o(v,jo);case 3:return r(v,Rs),r(v,E.segmentPrefix),r(v,l(L.toString(16))),o(v,Uo);case 4:return r(v,Ul),r(v,E.segmentPrefix),r(v,l(L.toString(16))),o(v,ea);case 5:return r(v,zl),r(v,E.segmentPrefix),r(v,l(L.toString(16))),o(v,Yl);case 6:return r(v,Pd),r(v,E.segmentPrefix),r(v,l(L.toString(16))),o(v,Td);case 7:return r(v,Kl),r(v,E.segmentPrefix),r(v,l(L.toString(16))),o(v,Yo);default:throw Error(e(397))}}function Gr(v,E){switch(E.insertionMode){case 0:case 1:return o(v,Je);case 2:return o(v,kr);case 3:return o(v,Bs);case 4:return o(v,ta);case 5:return o(v,$l);case 6:return o(v,zo);case 7:return o(v,ia);default:throw Error(e(397))}}var Fd=u('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),sa=u('$RS("'),$o=u('","'),Vr=u('")<\/script>'),Ko=u('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'),Xl=u('$RC("'),ql=u('","'),Ql=u('")<\/script>'),ra=u('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'),ui=u('$RX("'),Zl=u('"'),oa=u(")<\/script>"),na=u(","),Jl=/[<\u2028\u2029]/g;function nr(v){return JSON.stringify(v).replace(Jl,function(E){switch(E){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var ar=Object.assign,eu=Symbol.for("react.element"),Hr=Symbol.for("react.portal"),Br=Symbol.for("react.fragment"),aa=Symbol.for("react.strict_mode"),la=Symbol.for("react.profiler"),ua=Symbol.for("react.provider"),Xo=Symbol.for("react.context"),tu=Symbol.for("react.forward_ref"),iu=Symbol.for("react.suspense"),ha=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),F=Symbol.for("react.scope"),I=Symbol.for("react.debug_trace_mode"),U=Symbol.for("react.legacy_hidden"),V=Symbol.for("react.default_value"),X=Symbol.iterator;function ae(v){if(v==null)return null;if(typeof v=="function")return v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case Br:return"Fragment";case Hr:return"Portal";case la:return"Profiler";case aa:return"StrictMode";case iu:return"Suspense";case ha:return"SuspenseList"}if(typeof v=="object")switch(v.$$typeof){case Xo:return(v.displayName||"Context")+".Consumer";case ua:return(v._context.displayName||"Context")+".Provider";case tu:var E=v.render;return v=v.displayName,v||(v=E.displayName||E.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case m:return E=v.displayName||null,E!==null?E:ae(v.type)||"Memo";case x:E=v._payload,v=v._init;try{return ae(v(E))}catch{}}return null}var Ee={};function Pe(v,E){if(v=v.contextTypes,!v)return Ee;var A={},L;for(L in v)A[L]=E[L];return A}var Le=null;function ft(v,E){if(v!==E){v.context._currentValue=v.parentValue,v=v.parent;var A=E.parent;if(v===null){if(A!==null)throw Error(e(401))}else{if(A===null)throw Error(e(401));ft(v,A)}E.context._currentValue=E.value}}function os(v){v.context._currentValue=v.parentValue,v=v.parent,v!==null&&os(v)}function ns(v){var E=v.parent;E!==null&&ns(E),v.context._currentValue=v.value}function Mi(v,E){if(v.context._currentValue=v.parentValue,v=v.parent,v===null)throw Error(e(402));v.depth===E.depth?ft(v,E):Mi(v,E)}function Wr(v,E){var A=E.parent;if(A===null)throw Error(e(402));v.depth===A.depth?ft(v,A):Wr(v,A),E.context._currentValue=E.value}function Ws(v){var E=Le;E!==v&&(E===null?ns(v):v===null?os(E):E.depth===v.depth?ft(E,v):E.depth>v.depth?Mi(E,v):Wr(E,v),Le=v)}var da={isMounted:function(){return!1},enqueueSetState:function(v,E){v=v._reactInternals,v.queue!==null&&v.queue.push(E)},enqueueReplaceState:function(v,E){v=v._reactInternals,v.replace=!0,v.queue=[E]},enqueueForceUpdate:function(){}};function jr(v,E,A,L){var j=v.state!==void 0?v.state:null;v.updater=da,v.props=A,v.state=j;var H={queue:[],replace:!1};v._reactInternals=H;var q=E.contextType;if(v.context=typeof q=="object"&&q!==null?q._currentValue:L,q=E.getDerivedStateFromProps,typeof q=="function"&&(q=q(A,j),j=q==null?j:ar({},j,q),v.state=j),typeof E.getDerivedStateFromProps!="function"&&typeof v.getSnapshotBeforeUpdate!="function"&&(typeof v.UNSAFE_componentWillMount=="function"||typeof v.componentWillMount=="function"))if(E=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),E!==v.state&&da.enqueueReplaceState(v,v.state,null),H.queue!==null&&0<H.queue.length)if(E=H.queue,q=H.replace,H.queue=null,H.replace=!1,q&&E.length===1)v.state=E[0];else{for(H=q?E[0]:v.state,j=!0,q=q?1:0;q<E.length;q++){var se=E[q];se=typeof se=="function"?se.call(v,H,A,L):se,se!=null&&(j?(j=!1,H=ar({},H,se)):ar(H,se))}v.state=H}else H.queue=null}var su={id:1,overflow:""};function lr(v,E,A){var L=v.id;v=v.overflow;var j=32-ru(L)-1;L&=~(1<<j),A+=1;var H=32-ru(E)+j;if(30<H){var q=j-j%5;return H=(L&(1<<q)-1).toString(32),L>>=q,j-=q,{id:1<<32-ru(E)+j|A<<j|L,overflow:H+v}}return{id:1<<H|A<<j|L,overflow:v}}var ru=Math.clz32?Math.clz32:Vy,ky=Math.log,Gy=Math.LN2;function Vy(v){return v>>>=0,v===0?32:31-(ky(v)/Gy|0)|0}function Hy(v,E){return v===E&&(v!==0||1/v===1/E)||v!==v&&E!==E}var By=typeof Object.is=="function"?Object.is:Hy,js=null,Md=null,ou=null,nt=null,ca=!1,nu=!1,pa=0,ur=null,au=0;function Ur(){if(js===null)throw Error(e(321));return js}function wg(){if(0<au)throw Error(e(312));return{memoizedState:null,queue:null,next:null}}function Ld(){return nt===null?ou===null?(ca=!1,ou=nt=wg()):(ca=!0,nt=ou):nt.next===null?(ca=!1,nt=nt.next=wg()):(ca=!0,nt=nt.next),nt}function Id(){Md=js=null,nu=!1,ou=null,au=0,nt=ur=null}function bg(v,E){return typeof E=="function"?E(v):E}function Sg(v,E,A){if(js=Ur(),nt=Ld(),ca){var L=nt.queue;if(E=L.dispatch,ur!==null&&(A=ur.get(L),A!==void 0)){ur.delete(L),L=nt.memoizedState;do L=v(L,A.action),A=A.next;while(A!==null);return nt.memoizedState=L,[L,E]}return[nt.memoizedState,E]}return v=v===bg?typeof E=="function"?E():E:A!==void 0?A(E):E,nt.memoizedState=v,v=nt.queue={last:null,dispatch:null},v=v.dispatch=Wy.bind(null,js,v),[nt.memoizedState,v]}function _g(v,E){if(js=Ur(),nt=Ld(),E=E===void 0?null:E,nt!==null){var A=nt.memoizedState;if(A!==null&&E!==null){var L=A[1];e:if(L===null)L=!1;else{for(var j=0;j<L.length&&j<E.length;j++)if(!By(E[j],L[j])){L=!1;break e}L=!0}if(L)return A[0]}}return v=v(),nt.memoizedState=[v,E],v}function Wy(v,E,A){if(25<=au)throw Error(e(301));if(v===js)if(nu=!0,v={action:A,next:null},ur===null&&(ur=new Map),A=ur.get(E),A===void 0)ur.set(E,v);else{for(E=A;E.next!==null;)E=E.next;E.next=v}}function jy(){throw Error(e(394))}function lu(){}var Eg={readContext:function(v){return v._currentValue},useContext:function(v){return Ur(),v._currentValue},useMemo:_g,useReducer:Sg,useRef:function(v){js=Ur(),nt=Ld();var E=nt.memoizedState;return E===null?(v={current:v},nt.memoizedState=v):E},useState:function(v){return Sg(bg,v)},useInsertionEffect:lu,useLayoutEffect:function(){},useCallback:function(v,E){return _g(function(){return v},E)},useImperativeHandle:lu,useEffect:lu,useDebugValue:lu,useDeferredValue:function(v){return Ur(),v},useTransition:function(){return Ur(),[!1,jy]},useId:function(){var v=Md.treeContext,E=v.overflow;v=v.id,v=(v&~(1<<32-ru(v)-1)).toString(32)+E;var A=uu;if(A===null)throw Error(e(404));return E=pa++,v=":"+A.idPrefix+"R"+v,0<E&&(v+="H"+E.toString(32)),v+":"},useMutableSource:function(v,E){return Ur(),E(v._source)},useSyncExternalStore:function(v,E,A){if(A===void 0)throw Error(e(407));return A()}},uu=null,Od=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function Uy(v){return console.error(v),null}function ga(){}function zy(v,E,A,L,j,H,q,se,xe){var ke=[],Oe=new Set;return E={destination:null,responseState:E,progressiveChunkSize:L===void 0?12800:L,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:Oe,pingedTasks:ke,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:j===void 0?Uy:j,onAllReady:H===void 0?ga:H,onShellReady:q===void 0?ga:q,onShellError:se===void 0?ga:se,onFatalError:xe===void 0?ga:xe},A=hu(E,0,null,A,!1,!1),A.parentFlushed=!0,v=Nd(E,v,null,A,Oe,Ee,null,su),ke.push(v),E}function Nd(v,E,A,L,j,H,q,se){v.allPendingTasks++,A===null?v.pendingRootTasks++:A.pendingTasks++;var xe={node:E,ping:function(){var ke=v.pingedTasks;ke.push(xe),ke.length===1&&Fg(v)},blockedBoundary:A,blockedSegment:L,abortSet:j,legacyContext:H,context:q,treeContext:se};return j.add(xe),xe}function hu(v,E,A,L,j,H){return{status:0,id:-1,index:E,parentFlushed:!1,chunks:[],children:[],formatContext:L,boundary:A,lastPushedText:j,textEmbedded:H}}function fa(v,E){if(v=v.onError(E),v!=null&&typeof v!="string")throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof v+'" instead');return v}function du(v,E){var A=v.onShellError;A(E),A=v.onFatalError,A(E),v.destination!==null?(v.status=2,h(v.destination,E)):(v.status=1,v.fatalError=E)}function xg(v,E,A,L,j){for(js={},Md=E,pa=0,v=A(L,j);nu;)nu=!1,pa=0,au+=1,nt=null,v=A(L,j);return Id(),v}function Rg(v,E,A,L){var j=A.render(),H=L.childContextTypes;if(H!=null){var q=E.legacyContext;if(typeof A.getChildContext!="function")L=q;else{A=A.getChildContext();for(var se in A)if(!(se in H))throw Error(e(108,ae(L)||"Unknown",se));L=ar({},q,A)}E.legacyContext=L,Li(v,E,j),E.legacyContext=q}else Li(v,E,j)}function Dg(v,E){if(v&&v.defaultProps){E=ar({},E),v=v.defaultProps;for(var A in v)E[A]===void 0&&(E[A]=v[A]);return E}return E}function kd(v,E,A,L,j){if(typeof A=="function")if(A.prototype&&A.prototype.isReactComponent){j=Pe(A,E.legacyContext);var H=A.contextType;H=new A(L,typeof H=="object"&&H!==null?H._currentValue:j),jr(H,A,L,j),Rg(v,E,H,A)}else{H=Pe(A,E.legacyContext),j=xg(v,E,A,L,H);var q=pa!==0;if(typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0)jr(j,A,L,H),Rg(v,E,j,A);else if(q){L=E.treeContext,E.treeContext=lr(L,1,0);try{Li(v,E,j)}finally{E.treeContext=L}}else Li(v,E,j)}else if(typeof A=="string"){switch(j=E.blockedSegment,H=Or(j.chunks,A,L,v.responseState,j.formatContext),j.lastPushedText=!1,q=j.formatContext,j.formatContext=_e(q,A,L),Gd(v,E,H),j.formatContext=q,A){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:j.chunks.push(St,l(A),li)}j.lastPushedText=!1}else{switch(A){case U:case I:case aa:case la:case Br:Li(v,E,L.children);return;case ha:Li(v,E,L.children);return;case F:throw Error(e(343));case iu:e:{A=E.blockedBoundary,j=E.blockedSegment,H=L.fallback,L=L.children,q=new Set;var se={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:q,errorDigest:null},xe=hu(v,j.chunks.length,se,j.formatContext,!1,!1);j.children.push(xe),j.lastPushedText=!1;var ke=hu(v,0,null,j.formatContext,!1,!1);ke.parentFlushed=!0,E.blockedBoundary=se,E.blockedSegment=ke;try{if(Gd(v,E,L),ke.lastPushedText&&ke.textEmbedded&&ke.chunks.push(ve),ke.status=1,cu(se,ke),se.pendingTasks===0)break e}catch(Oe){ke.status=4,se.forceClientRender=!0,se.errorDigest=fa(v,Oe)}finally{E.blockedBoundary=A,E.blockedSegment=j}E=Nd(v,H,A,xe,q,E.legacyContext,E.context,E.treeContext),v.pingedTasks.push(E)}return}if(typeof A=="object"&&A!==null)switch(A.$$typeof){case tu:if(L=xg(v,E,A.render,L,j),pa!==0){A=E.treeContext,E.treeContext=lr(A,1,0);try{Li(v,E,L)}finally{E.treeContext=A}}else Li(v,E,L);return;case m:A=A.type,L=Dg(A,L),kd(v,E,A,L,j);return;case ua:if(j=L.children,A=A._context,L=L.value,H=A._currentValue,A._currentValue=L,q=Le,Le=L={parent:q,depth:q===null?0:q.depth+1,context:A,parentValue:H,value:L},E.context=L,Li(v,E,j),v=Le,v===null)throw Error(e(403));L=v.parentValue,v.context._currentValue=L===V?v.context._defaultValue:L,v=Le=v.parent,E.context=v;return;case Xo:L=L.children,L=L(A._currentValue),Li(v,E,L);return;case x:j=A._init,A=j(A._payload),L=Dg(A,L),kd(v,E,A,L,void 0);return}throw Error(e(130,A==null?A:typeof A,""))}}function Li(v,E,A){if(E.node=A,typeof A=="object"&&A!==null){switch(A.$$typeof){case eu:kd(v,E,A.type,A.props,A.ref);return;case Hr:throw Error(e(257));case x:var L=A._init;A=L(A._payload),Li(v,E,A);return}if(W(A)){Pg(v,E,A);return}if(A===null||typeof A!="object"?L=null:(L=X&&A[X]||A["@@iterator"],L=typeof L=="function"?L:null),L&&(L=L.call(A))){if(A=L.next(),!A.done){var j=[];do j.push(A.value),A=L.next();while(!A.done);Pg(v,E,j)}return}throw v=Object.prototype.toString.call(A),Error(e(31,v==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":v))}typeof A=="string"?(L=E.blockedSegment,L.lastPushedText=we(E.blockedSegment.chunks,A,v.responseState,L.lastPushedText)):typeof A=="number"&&(L=E.blockedSegment,L.lastPushedText=we(E.blockedSegment.chunks,""+A,v.responseState,L.lastPushedText))}function Pg(v,E,A){for(var L=A.length,j=0;j<L;j++){var H=E.treeContext;E.treeContext=lr(H,L,j);try{Gd(v,E,A[j])}finally{E.treeContext=H}}}function Gd(v,E,A){var L=E.blockedSegment.formatContext,j=E.legacyContext,H=E.context;try{return Li(v,E,A)}catch(xe){if(Id(),typeof xe=="object"&&xe!==null&&typeof xe.then=="function"){A=xe;var q=E.blockedSegment,se=hu(v,q.chunks.length,null,q.formatContext,q.lastPushedText,!0);q.children.push(se),q.lastPushedText=!1,v=Nd(v,E.node,E.blockedBoundary,se,E.abortSet,E.legacyContext,E.context,E.treeContext).ping,A.then(v,v),E.blockedSegment.formatContext=L,E.legacyContext=j,E.context=H,Ws(H)}else throw E.blockedSegment.formatContext=L,E.legacyContext=j,E.context=H,Ws(H),xe}}function Yy(v){var E=v.blockedBoundary;v=v.blockedSegment,v.status=3,Ag(this,E,v)}function Tg(v,E,A){var L=v.blockedBoundary;v.blockedSegment.status=3,L===null?(E.allPendingTasks--,E.status!==2&&(E.status=2,E.destination!==null&&E.destination.close())):(L.pendingTasks--,L.forceClientRender||(L.forceClientRender=!0,v=A===void 0?Error(e(432)):A,L.errorDigest=E.onError(v),L.parentFlushed&&E.clientRenderedBoundaries.push(L)),L.fallbackAbortableTasks.forEach(function(j){return Tg(j,E,A)}),L.fallbackAbortableTasks.clear(),E.allPendingTasks--,E.allPendingTasks===0&&(L=E.onAllReady,L()))}function cu(v,E){if(E.chunks.length===0&&E.children.length===1&&E.children[0].boundary===null){var A=E.children[0];A.id=E.id,A.parentFlushed=!0,A.status===1&&cu(v,A)}else v.completedSegments.push(E)}function Ag(v,E,A){if(E===null){if(A.parentFlushed){if(v.completedRootSegment!==null)throw Error(e(389));v.completedRootSegment=A}v.pendingRootTasks--,v.pendingRootTasks===0&&(v.onShellError=ga,E=v.onShellReady,E())}else E.pendingTasks--,E.forceClientRender||(E.pendingTasks===0?(A.parentFlushed&&A.status===1&&cu(E,A),E.parentFlushed&&v.completedBoundaries.push(E),E.fallbackAbortableTasks.forEach(Yy,v),E.fallbackAbortableTasks.clear()):A.parentFlushed&&A.status===1&&(cu(E,A),E.completedSegments.length===1&&E.parentFlushed&&v.partialBoundaries.push(E)));v.allPendingTasks--,v.allPendingTasks===0&&(v=v.onAllReady,v())}function Fg(v){if(v.status!==2){var E=Le,A=Od.current;Od.current=Eg;var L=uu;uu=v.responseState;try{var j=v.pingedTasks,H;for(H=0;H<j.length;H++){var q=j[H],se=v,xe=q.blockedSegment;if(xe.status===0){Ws(q.context);try{Li(se,q,q.node),xe.lastPushedText&&xe.textEmbedded&&xe.chunks.push(ve),q.abortSet.delete(q),xe.status=1,Ag(se,q.blockedBoundary,xe)}catch(ls){if(Id(),typeof ls=="object"&&ls!==null&&typeof ls.then=="function"){var ke=q.ping;ls.then(ke,ke)}else{q.abortSet.delete(q),xe.status=4;var Oe=q.blockedBoundary,ht=ls,Ii=fa(se,ht);if(Oe===null?du(se,ht):(Oe.pendingTasks--,Oe.forceClientRender||(Oe.forceClientRender=!0,Oe.errorDigest=Ii,Oe.parentFlushed&&se.clientRenderedBoundaries.push(Oe))),se.allPendingTasks--,se.allPendingTasks===0){var as=se.onAllReady;as()}}}finally{}}}j.splice(0,H),v.destination!==null&&Vd(v,v.destination)}catch(ls){fa(v,ls),du(v,ls)}finally{uu=L,Od.current=A,A===Eg&&Ws(E)}}}function pu(v,E,A){switch(A.parentFlushed=!0,A.status){case 0:var L=A.id=v.nextSegmentId++;return A.lastPushedText=!1,A.textEmbedded=!1,v=v.responseState,r(E,Hs),r(E,v.placeholderPrefix),v=l(L.toString(16)),r(E,v),o(E,Wl);case 1:A.status=2;var j=!0;L=A.chunks;var H=0;A=A.children;for(var q=0;q<A.length;q++){for(j=A[q];H<j.index;H++)r(E,L[H]);j=gu(v,E,j)}for(;H<L.length-1;H++)r(E,L[H]);return H<L.length&&(j=o(E,L[H])),j;default:throw Error(e(390))}}function gu(v,E,A){var L=A.boundary;if(L===null)return pu(v,E,A);if(L.parentFlushed=!0,L.forceClientRender)L=L.errorDigest,o(E,Bo),r(E,Ed),L&&(r(E,Rd),r(E,l(N(L))),r(E,xd)),o(E,Dd),pu(v,E,A);else if(0<L.pendingTasks){L.rootSegmentID=v.nextSegmentId++,0<L.completedSegments.length&&v.partialBoundaries.push(L);var j=v.responseState,H=j.nextSuspenseID++;j=u(j.boundaryPrefix+H.toString(16)),L=L.id=j,ji(E,v.responseState,L),pu(v,E,A)}else if(L.byteSize>v.progressiveChunkSize)L.rootSegmentID=v.nextSegmentId++,v.completedBoundaries.push(L),ji(E,v.responseState,L.id),pu(v,E,A);else{if(o(E,jl),A=L.completedSegments,A.length!==1)throw Error(e(391));gu(v,E,A[0])}return o(E,_d)}function Mg(v,E,A){return Ad(E,v.responseState,A.formatContext,A.id),gu(v,E,A),Gr(E,A.formatContext)}function Lg(v,E,A){for(var L=A.completedSegments,j=0;j<L.length;j++)Ig(v,E,A,L[j]);if(L.length=0,v=v.responseState,L=A.id,A=A.rootSegmentID,r(E,v.startInlineScript),v.sentCompleteBoundaryFunction?r(E,Xl):(v.sentCompleteBoundaryFunction=!0,r(E,Ko)),L===null)throw Error(e(395));return A=l(A.toString(16)),r(E,L),r(E,ql),r(E,v.segmentPrefix),r(E,A),o(E,Ql)}function Ig(v,E,A,L){if(L.status===2)return!0;var j=L.id;if(j===-1){if((L.id=A.rootSegmentID)===-1)throw Error(e(392));return Mg(v,E,L)}return Mg(v,E,L),v=v.responseState,r(E,v.startInlineScript),v.sentCompleteSegmentFunction?r(E,sa):(v.sentCompleteSegmentFunction=!0,r(E,Fd)),r(E,v.segmentPrefix),j=l(j.toString(16)),r(E,j),r(E,$o),r(E,v.placeholderPrefix),r(E,j),o(E,Vr)}function Vd(v,E){t=new Uint8Array(512),s=0;try{var A=v.completedRootSegment;if(A!==null&&v.pendingRootTasks===0){gu(v,E,A),v.completedRootSegment=null;var L=v.responseState.bootstrapChunks;for(A=0;A<L.length-1;A++)r(E,L[A]);A<L.length&&o(E,L[A])}var j=v.clientRenderedBoundaries,H;for(H=0;H<j.length;H++){var q=j[H];L=E;var se=v.responseState,xe=q.id,ke=q.errorDigest,Oe=q.errorMessage,ht=q.errorComponentStack;if(r(L,se.startInlineScript),se.sentClientRenderFunction?r(L,ui):(se.sentClientRenderFunction=!0,r(L,ra)),xe===null)throw Error(e(395));r(L,xe),r(L,Zl),(ke||Oe||ht)&&(r(L,na),r(L,l(nr(ke||"")))),(Oe||ht)&&(r(L,na),r(L,l(nr(Oe||"")))),ht&&(r(L,na),r(L,l(nr(ht)))),o(L,oa)}j.splice(0,H);var Ii=v.completedBoundaries;for(H=0;H<Ii.length;H++)Lg(v,E,Ii[H]);Ii.splice(0,H),n(E),t=new Uint8Array(512),s=0;var as=v.partialBoundaries;for(H=0;H<as.length;H++){var ls=as[H];e:{j=v,q=E;var fu=ls.completedSegments;for(se=0;se<fu.length;se++)if(!Ig(j,q,ls,fu[se])){se++,fu.splice(0,se);var Ng=!1;break e}fu.splice(0,se),Ng=!0}if(!Ng){v.destination=null,H++,as.splice(0,H);return}}as.splice(0,H);var Hd=v.completedBoundaries;for(H=0;H<Hd.length;H++)Lg(v,E,Hd[H]);Hd.splice(0,H)}finally{n(E),v.allPendingTasks===0&&v.pingedTasks.length===0&&v.clientRenderedBoundaries.length===0&&v.completedBoundaries.length===0&&E.close()}}function Og(v,E){try{var A=v.abortableTasks;A.forEach(function(L){return Tg(L,v,E)}),A.clear(),v.destination!==null&&Vd(v,v.destination)}catch(L){fa(v,L),du(v,L)}}return yu.renderToReadableStream=function(v,E){return new Promise(function(A,L){var j,H,q=new Promise(function(Oe,ht){H=Oe,j=ht}),se=zy(v,oe(E?E.identifierPrefix:void 0,E?E.nonce:void 0,E?E.bootstrapScriptContent:void 0,E?E.bootstrapScripts:void 0,E?E.bootstrapModules:void 0),pe(E?E.namespaceURI:void 0),E?E.progressiveChunkSize:void 0,E?E.onError:void 0,H,function(){var Oe=new ReadableStream({type:"bytes",pull:function(ht){if(se.status===1)se.status=2,h(ht,se.fatalError);else if(se.status!==2&&se.destination===null){se.destination=ht;try{Vd(se,ht)}catch(Ii){fa(se,Ii),du(se,Ii)}}},cancel:function(){Og(se)}},{highWaterMark:0});Oe.allReady=q,A(Oe)},function(Oe){q.catch(function(){}),L(Oe)},j);if(E&&E.signal){var xe=E.signal,ke=function(){Og(se,xe.reason),xe.removeEventListener("abort",ke)};xe.addEventListener("abort",ke)}Fg(se)})},yu.version="18.2.0",yu}var af;function dE(){if(af)return dr;af=1;var i,e;return i=uE(),e=hE(),dr.version=i.version,dr.renderToString=i.renderToString,dr.renderToStaticMarkup=i.renderToStaticMarkup,dr.renderToNodeStream=i.renderToNodeStream,dr.renderToStaticNodeStream=i.renderToStaticNodeStream,dr.renderToReadableStream=e.renderToReadableStream,dr}var cE=dE(),pE=Object.defineProperty,gE=Object.defineProperties,fE=Object.getOwnPropertyDescriptors,lf=Object.getOwnPropertySymbols,mE=Object.prototype.hasOwnProperty,vE=Object.prototype.propertyIsEnumerable,uf=(i,e,t)=>e in i?pE(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,ct=(i,e)=>{for(var t in e||(e={}))mE.call(e,t)&&uf(i,t,e[t]);if(lf)for(var t of lf(e))vE.call(e,t)&&uf(i,t,e[t]);return i},mi=(i,e)=>gE(i,fE(e)),dg=S.createContext({setMethods:()=>{}}),CE=i=>{const{initialProps:e,addUpdateCallback:t,CustomComponentClass:s,setMethods:r}=i,[o,n]=S.useState(e);return S.useEffect(()=>{t(a=>n(a))},[]),ie.createElement(dg.Provider,{value:{setMethods:r}},ie.createElement(s,ct({},o)))},yE=S.memo(CE),wE=0;function hf(){return`agPortalKey_${++wE}`}var WC=class{constructor(i,e,t,s){this.portal=null,this.oldPortal=null,this.reactComponent=i,this.portalManager=e,this.componentType=t,this.suppressFallbackMethods=!!s,this.statelessComponent=this.isStateless(this.reactComponent),this.key=hf(),this.portalKey=hf(),this.instanceCreated=this.isStatelessComponent()?Lt.resolve(!1):new Lt(r=>{this.resolveInstanceCreated=r})}getGui(){return this.eParentElement}getRootElement(){return this.eParentElement.firstChild}destroy(){return this.componentInstance&&typeof this.componentInstance.destroy=="function"&&this.componentInstance.destroy(),this.portalManager.destroyPortal(this.portal)}createParentElement(i){const e=this.portalManager.getComponentWrappingElement(),t=document.createElement(e||"div");return t.classList.add("ag-react-container"),i.reactContainer=t,t}addParentContainerStyleAndClasses(){this.componentInstance&&(this.componentInstance.getReactContainerStyle&&this.componentInstance.getReactContainerStyle()&&(ye.warnOnce('Since v31.1 "getReactContainerStyle" is deprecated. Apply styling directly to ".ag-react-container" if needed.'),Object.assign(this.eParentElement.style,this.componentInstance.getReactContainerStyle())),this.componentInstance.getReactContainerClasses&&this.componentInstance.getReactContainerClasses()&&(ye.warnOnce('Since v31.1 "getReactContainerClasses" is deprecated. Apply styling directly to ".ag-react-container" if needed.'),this.componentInstance.getReactContainerClasses().forEach(e=>this.eParentElement.classList.add(e))))}statelessComponentRendered(){return this.eParentElement.childElementCount>0||this.eParentElement.childNodes.length>0}getFrameworkComponentInstance(){return this.componentInstance}isStatelessComponent(){return this.statelessComponent}getReactComponentName(){return this.reactComponent.name}getMemoType(){return this.hasSymbol()?Symbol.for("react.memo"):60115}hasSymbol(){return typeof Symbol=="function"&&Symbol.for}isStateless(i){return typeof i=="function"&&!(i.prototype&&i.prototype.isReactComponent)||typeof i=="object"&&i.$$typeof===this.getMemoType()}hasMethod(i){const e=this.getFrameworkComponentInstance();return!!e&&e[i]!=null||this.fallbackMethodAvailable(i)}callMethod(i,e){const t=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(i,e&&e[0]?e[0]:{});if(!t){setTimeout(()=>this.callMethod(i,e));return}const s=t[i];if(s)return s.apply(t,e);if(this.fallbackMethodAvailable(i))return this.fallbackMethod(i,e&&e[0]?e[0]:{})}addMethod(i,e){this[i]=e}init(i){return this.eParentElement=this.createParentElement(i),this.params=i,this.createOrUpdatePortal(i),new Lt(e=>this.createReactComponent(e))}createOrUpdatePortal(i){this.isStatelessComponent()||(this.ref=e=>{var t;this.componentInstance=e,this.addParentContainerStyleAndClasses(),(t=this.resolveInstanceCreated)==null||t.call(this,!0),this.resolveInstanceCreated=void 0},i.ref=this.ref),this.reactElement=this.createElement(this.reactComponent,mi(ct({},i),{key:this.key})),this.portal=Zf.createPortal(this.reactElement,this.eParentElement,this.portalKey)}createElement(i,e){return S.createElement(i,e)}createReactComponent(i){this.portalManager.mountReactPortal(this.portal,this,e=>{i(e)})}isNullValue(){return this.valueRenderedIsNull(this.params)}rendered(){return this.isStatelessComponent()&&this.statelessComponentRendered()||!!(!this.isStatelessComponent()&&this.getFrameworkComponentInstance())}valueRenderedIsNull(i){if(!this.componentType.cellRenderer)return!1;const e=console.error;try{return console.error=()=>{},cE.renderToStaticMarkup(S.createElement(this.reactComponent,i))===""}catch{}finally{console.error=e}return!1}refreshComponent(i){this.oldPortal=this.portal,this.createOrUpdatePortal(i),this.portalManager.updateReactPortal(this.oldPortal,this.portal)}fallbackMethod(i,e){const t=this[`${i}Component`];if(!this.suppressFallbackMethods&&t)return t.bind(this)(e)}fallbackMethodAvailable(i){return this.suppressFallbackMethods?!1:!!this[`${i}Component`]}};function cg(i,e,t){i.forEach(s=>{const r=e[s];r&&(t[s]=r)})}var Ir=class extends WC{constructor(){super(...arguments),this.awaitUpdateCallback=new Lt(i=>{this.resolveUpdateCallback=i}),this.wrapperComponent=yE}init(i){return this.sourceParams=i,super.init(this.getProps())}addMethod(){}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}getFrameworkComponentInstance(){return this}createElement(i,e){return super.createElement(this.wrapperComponent,{initialProps:e,CustomComponentClass:i,setMethods:t=>this.setMethods(t),addUpdateCallback:t=>{this.updateCallback=()=>(t(this.getProps()),new Lt(s=>{setTimeout(()=>{s()})})),this.resolveUpdateCallback()}})}setMethods(i){this.providedMethods=i,cg(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return mi(ct({},this.sourceParams),{key:this.key,ref:this.ref})}refreshProps(){return this.updateCallback?this.updateCallback():new Lt(i=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>i())}))}},bE=class extends Ir{constructor(){super(...arguments),this.date=null,this.onDateChange=i=>this.updateDate(i)}getDate(){return this.date}setDate(i){this.date=i,this.refreshProps()}refresh(i){this.sourceParams=i,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled"]}updateDate(i){this.setDate(i),this.sourceParams.onDateChanged()}getProps(){const i=super.getProps();return i.date=this.date,i.onDateChange=this.onDateChange,delete i.onDateChanged,i}},SE=class extends Ir{constructor(){super(...arguments),this.model=null,this.onModelChange=i=>this.updateModel(i),this.onUiChange=()=>this.sourceParams.filterChangedCallback()}isFilterActive(){return this.model!=null}doesFilterPass(i){return this.providedMethods.doesFilterPass(i)}getModel(){return this.model}setModel(i){return this.model=i,this.refreshProps()}refresh(i){return this.sourceParams=i,this.refreshProps(),!0}getOptionalMethods(){return["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onAnyFilterChanged"]}updateModel(i){this.setModel(i).then(()=>this.sourceParams.filterChangedCallback())}getProps(){const i=super.getProps();return i.model=this.model,i.onModelChange=this.onModelChange,i.onUiChange=this.onUiChange,delete i.filterChangedCallback,delete i.filterModifiedCallback,delete i.valueGetter,i}};function jC(i,e){i.parentFilterInstance(t=>{(t.setModel(e)||Lt.resolve()).then(()=>{i.filterParams.filterChangedCallback()})})}var _E=class{constructor(i,e){this.floatingFilterParams=i,this.refreshProps=e,this.model=null,this.onModelChange=t=>this.updateModel(t)}getProps(){return mi(ct({},this.floatingFilterParams),{model:this.model,onModelChange:this.onModelChange})}onParentModelChanged(i){this.model=i,this.refreshProps()}refresh(i){this.floatingFilterParams=i,this.refreshProps()}setMethods(i){cg(this.getOptionalMethods(),i,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(i){this.model=i,this.refreshProps(),jC(this.floatingFilterParams,i)}},EE=class extends Ir{constructor(){super(...arguments),this.model=null,this.onModelChange=i=>this.updateModel(i)}onParentModelChanged(i){this.model=i,this.refreshProps()}refresh(i){this.sourceParams=i,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}updateModel(i){this.model=i,this.refreshProps(),jC(this.sourceParams,i)}getProps(){const i=super.getProps();return i.model=this.model,i.onModelChange=this.onModelChange,i}},xE=class extends Ir{refresh(i){this.sourceParams=i,this.refreshProps()}},RE=class extends Ir{constructor(){super(...arguments),this.active=!1,this.expanded=!1,this.onActiveChange=i=>this.updateActive(i)}setActive(i){this.awaitSetActive(i)}setExpanded(i){this.expanded=i,this.refreshProps()}getOptionalMethods(){return["select","configureDefaults"]}awaitSetActive(i){return this.active=i,this.refreshProps()}updateActive(i){const e=this.awaitSetActive(i);i&&e.then(()=>this.sourceParams.onItemActivated())}getProps(){const i=super.getProps();return i.active=this.active,i.expanded=this.expanded,i.onActiveChange=this.onActiveChange,delete i.onItemActivated,i}},DE=class extends Ir{refresh(i){this.sourceParams=i,this.refreshProps()}},PE=class extends Ir{refresh(i){return this.sourceParams=i,this.refreshProps(),!0}},TE=class extends Ir{constructor(){super(...arguments),this.onStateChange=i=>this.updateState(i)}refresh(i){return this.sourceParams=i,this.refreshProps(),!0}getState(){return this.state}updateState(i){this.state=i,this.refreshProps(),this.sourceParams.onStateUpdated()}getProps(){const i=super.getProps();return i.state=this.state,i.onStateChange=this.onStateChange,i}},UC=class zC{constructor(e,t,s){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=t||"div",this.refresher=e,this.maxComponentCreationTimeMs=s||zC.MAX_COMPONENT_CREATION_TIME_IN_MS}getPortals(){return this.portals}destroy(){this.destroyed=!0}destroyPortal(e){this.portals=this.portals.filter(t=>t!==e),this.batchUpdate()}getComponentWrappingElement(){return this.wrappingElement}mountReactPortal(e,t,s){this.portals=[...this.portals,e],this.waitForInstance(t,s),this.batchUpdate()}updateReactPortal(e,t){this.portals[this.portals.indexOf(e)]=t,this.batchUpdate()}batchUpdate(){this.hasPendingPortalUpdate||(setTimeout(()=>{this.destroyed||(this.refresher(),this.hasPendingPortalUpdate=!1)}),this.hasPendingPortalUpdate=!0)}waitForInstance(e,t,s=Date.now()){if(this.destroyed){t(null);return}if(e.rendered())t(e);else{if(Date.now()-s>=this.maxComponentCreationTimeMs&&!this.hasPendingPortalUpdate){if(e.isNullValue()){t(e);return}console.error(`AG Grid: React Component '${e.getReactComponentName()}' not created within ${this.maxComponentCreationTimeMs}ms.`),console.error(" If the component is using `forwardRef` but not `useImperativeHandle`, add the following: `useImperativeHandle(ref, () => ({}));`");return}window.setTimeout(()=>{this.waitForInstance(e,t,s)})}}};UC.MAX_COMPONENT_CREATION_TIME_IN_MS=1e3;var AE=UC,wi=ie.createContext({}),hs=(...i)=>i.filter(t=>t!=null&&t!=="").join(" "),Xi=class YC{constructor(...e){this.classesMap={},e.forEach(t=>{this.classesMap[t]=!0})}setClass(e,t){if(!!this.classesMap[e]==t)return this;const r=new YC;return r.classesMap=ct({},this.classesMap),r.classesMap[e]=t,r}toString(){return Object.keys(this.classesMap).filter(t=>this.classesMap[t]).join(" ")}},Xn=i=>{const e=()=>typeof Symbol=="function"&&Symbol.for,t=()=>e()?Symbol.for("react.memo"):60115;return typeof i=="function"&&!(i.prototype&&i.prototype.isReactComponent)||typeof i=="object"&&i.$$typeof===t()},FE=bc.createRoot!=null&&bc.flushSync!=null,Bu=!1;function ME(i){return Bu||setTimeout(()=>Bu=!1,0),Bu=!0,i()}var pg=(i,e)=>{FE&&i&&!Bu?bc.flushSync(e):e()};function gg(i,e,t){if(e==null||i==null)return e;if(i===e||e.length===0&&i.length===0)return i;if(t||i.length===0&&e.length>0||i.length>0&&e.length===0)return e;const s=[],r=[],o=new Map,n=new Map;for(let a=0;a<e.length;a++){const l=e[a];n.set(l.getInstanceId(),l)}for(let a=0;a<i.length;a++){const l=i[a];o.set(l.getInstanceId(),l),n.has(l.getInstanceId())&&s.push(l)}for(let a=0;a<e.length;a++){const l=e[a],u=l.getInstanceId();o.has(u)||r.push(l)}return s.length===i.length&&r.length===0?i:s.length===0&&r.length===e.length?e:s.length===0?r:r.length===0?s:[...s,...r]}var Bl=(i,e,t,s)=>{if(!i||i.componentFromFramework||e.isDestroyed())return;const o=i.newAgStackInstance();if(!o)return;let n,a,l=!1;return o.then(u=>{if(l){e.destroyBean(u);return}n=u,a=n.getGui(),t.appendChild(a),df(s,n)}),()=>{l=!0,n&&(a&&a.parentElement&&a.parentElement.removeChild(a),e.destroyBean(n),s&&df(s,void 0))}},df=(i,e)=>{if(i)if(i instanceof Function)i(e);else{const t=i;t.current=e}},LE=i=>{const e=i.newAgStackInstance();if(e)return e.resolveNow(null,t=>t)},$C=S.forwardRef((i,e)=>{var t;const s=S.useContext(wi).context,r=S.useRef(null),o=S.useRef(null),n=S.useRef(null),a=S.useRef(null),l=S.useRef(null),u=S.useRef(),[h,d]=S.useState(),[c,p]=S.useState(),[y,f]=S.useState(),[w,_]=S.useState(()=>new Xi),[P,T]=S.useState(()=>new Xi("ag-hidden")),[D,M]=S.useState(()=>new Xi("ag-hidden")),[O,N]=S.useState(()=>new Xi("ag-invisible"));S.useImperativeHandle(e,()=>({refresh(){return!1}})),S.useLayoutEffect(()=>Bl(h,s,o.current),[h]);const z=S.useCallback(ne=>{if(r.current=ne,!r.current){s.destroyBean(u.current),u.current=null;return}const oe={setInnerRenderer:(Q,pe)=>{d(Q),f(pe)},setChildCount:Q=>p(Q),addOrRemoveCssClass:(Q,pe)=>_(_e=>_e.setClass(Q,pe)),setContractedDisplayed:Q=>M(pe=>pe.setClass("ag-hidden",!Q)),setExpandedDisplayed:Q=>T(pe=>pe.setClass("ag-hidden",!Q)),setCheckboxVisible:Q=>N(pe=>pe.setClass("ag-invisible",!Q))};u.current=s.createBean(new Lo),u.current.init(oe,r.current,n.current,a.current,l.current,$C,i)},[]),Y=S.useMemo(()=>`ag-cell-wrapper ${w.toString()}`,[w]),W=S.useMemo(()=>`ag-group-expanded ${P.toString()}`,[P]),$=S.useMemo(()=>`ag-group-contracted ${D.toString()}`,[D]),ee=S.useMemo(()=>`ag-group-checkbox ${O.toString()}`,[O]),re=h&&h.componentFromFramework,me=re?h.componentClass:void 0,he=h==null&&y!=null,ce=ye.escapeString(y,!0);return ie.createElement("span",ct({className:Y,ref:z},i.colDef?{}:{role:(t=u.current)==null?void 0:t.getCellAriaRole()}),ie.createElement("span",{className:W,ref:a}),ie.createElement("span",{className:$,ref:l}),ie.createElement("span",{className:ee,ref:n}),ie.createElement("span",{className:"ag-group-value",ref:o},he&&ie.createElement(ie.Fragment,null,ce),re&&ie.createElement(me,ct({},h.params))),ie.createElement("span",{className:"ag-group-child-count"},c))}),cf=$C,IE=i=>{const{ctrl:e}=i,t=e.isAlive(),{context:s}=S.useContext(wi),r=t?e.getColId():void 0,[o,n]=S.useState(),a=S.useRef(null),l=S.useRef(null),u=S.useRef(null),h=S.useRef();let d=S.useRef();t&&!d.current&&(d.current=new Dl(()=>a.current));const c=S.useCallback(w=>{var _;if(a.current=w,!a.current||!t)return;const P={setWidth:D=>{a.current&&(a.current.style.width=D)},addOrRemoveCssClass:(D,M)=>d.current.addOrRemoveCssClass(D,M),setAriaSort:D=>{a.current&&(D?ye.setAriaSort(a.current,D):ye.removeAriaSort(a.current))},setUserCompDetails:D=>n(D),getUserCompInstance:()=>h.current||void 0};e.setComp(P,a.current,l.current,u.current);const T=e.getSelectAllGui();(_=l.current)==null||_.insertAdjacentElement("afterend",T)},[]);S.useLayoutEffect(()=>Bl(o,s,u.current,h),[o]),S.useEffect(()=>{e.setDragSource(a.current)},[o]);const p=S.useMemo(()=>!!(o?.componentFromFramework&&Xn(o.componentClass)),[o]),y=o&&o.componentFromFramework,f=o&&o.componentClass;return ie.createElement("div",{ref:c,className:"ag-header-cell","col-id":r,role:"columnheader"},ie.createElement("div",{ref:l,className:"ag-header-cell-resize",role:"presentation"}),ie.createElement("div",{ref:u,className:"ag-header-cell-comp-wrapper",role:"presentation"},y&&p&&ie.createElement(f,ct({},o.params)),y&&!p&&ie.createElement(f,mi(ct({},o.params),{ref:h}))))},OE=S.memo(IE),NE=i=>{const{context:e}=S.useContext(wi),{ctrl:t}=i,[s,r]=S.useState(()=>new Xi),[o,n]=S.useState(()=>new Xi),[a,l]=S.useState("false"),[u,h]=S.useState(),[d,c]=S.useState(),p=S.useMemo(()=>t.getColId(),[]),y=S.useRef(null),f=S.useRef(null),w=S.useRef(),_=S.useCallback(N=>{if(y.current=N,!y.current)return;const z={setWidth:Y=>{y.current&&(y.current.style.width=Y)},addOrRemoveCssClass:(Y,W)=>r($=>$.setClass(Y,W)),setUserCompDetails:Y=>c(Y),setResizableDisplayed:Y=>{n(W=>W.setClass("ag-hidden",!Y)),l(Y?"false":"true")},setAriaExpanded:Y=>h(Y),getUserCompInstance:()=>w.current||void 0};t.setComp(z,y.current,f.current)},[]);S.useLayoutEffect(()=>Bl(d,e,y.current),[d]),S.useEffect(()=>{y.current&&t.setDragSource(y.current)},[d]);const P=S.useMemo(()=>!!(d?.componentFromFramework&&Xn(d.componentClass)),[d]),T=S.useMemo(()=>"ag-header-group-cell "+s.toString(),[s]),D=S.useMemo(()=>"ag-header-cell-resize "+o.toString(),[o]),M=d&&d.componentFromFramework,O=d&&d.componentClass;return ie.createElement("div",{ref:_,className:T,"col-id":p,role:"columnheader","aria-expanded":u},M&&P&&ie.createElement(O,ct({},d.params)),M&&!P&&ie.createElement(O,mi(ct({},d.params),{ref:w})),ie.createElement("div",{ref:f,"aria-hidden":a,className:D}))},kE=S.memo(NE);function fg(){ye.warnOnce("Using custom components without `reactiveCustomComponents = true` is deprecated.")}var GE=i=>{const{context:e,gos:t}=S.useContext(wi),[s,r]=S.useState(()=>new Xi("ag-header-cell","ag-floating-filter")),[o,n]=S.useState(()=>new Xi),[a,l]=S.useState(()=>new Xi("ag-floating-filter-button","ag-hidden")),[u,h]=S.useState("false"),[d,c]=S.useState(),[p,y]=S.useState(1),f=S.useRef(null),w=S.useRef(null),_=S.useRef(null),P=S.useRef(null),T=S.useRef(),D=S.useRef(),M=ne=>{ne!=null&&T.current&&T.current(ne)},{ctrl:O}=i,N=S.useCallback(ne=>{if(f.current=ne,!f.current)return;D.current=new Lt(Q=>{T.current=Q});const oe={addOrRemoveCssClass:(Q,pe)=>r(_e=>_e.setClass(Q,pe)),addOrRemoveBodyCssClass:(Q,pe)=>n(_e=>_e.setClass(Q,pe)),setButtonWrapperDisplayed:Q=>{l(pe=>pe.setClass("ag-hidden",!Q)),h(Q?"false":"true")},setWidth:Q=>{f.current&&(f.current.style.width=Q)},setCompDetails:Q=>c(Q),getFloatingFilterComp:()=>D.current?D.current:null,setMenuIcon:Q=>{var pe;return(pe=P.current)==null?void 0:pe.appendChild(Q)}};O.setComp(oe,f.current,P.current,w.current)},[]);S.useLayoutEffect(()=>Bl(d,e,w.current,M),[d]);const z=S.useMemo(()=>s.toString(),[s]),Y=S.useMemo(()=>o.toString(),[o]),W=S.useMemo(()=>a.toString(),[a]),$=S.useMemo(()=>!!(d&&d.componentFromFramework&&Xn(d.componentClass)),[d]),ee=S.useMemo(()=>t.get("reactiveCustomComponents"),[]),re=S.useMemo(()=>{if(d)if(ee){const ne=new _E(d.params,()=>y(oe=>oe+1));return M(ne),ne}else d.componentFromFramework&&fg()},[d]),me=re?.getProps(),he=d&&d.componentFromFramework,ce=d&&d.componentClass;return ie.createElement("div",{ref:N,className:z,role:"gridcell"},ie.createElement("div",{ref:w,className:Y,role:"presentation"},he&&!ee&&ie.createElement(ce,mi(ct({},d.params),{ref:$?()=>{}:M})),he&&ee&&ie.createElement(dg.Provider,{value:{setMethods:ne=>re.setMethods(ne)}},ie.createElement(ce,ct({},me)))),ie.createElement("div",{ref:_,"aria-hidden":u,className:W,role:"presentation"},ie.createElement("button",{ref:P,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))},VE=S.memo(GE),HE=i=>{const{ctrl:e}=i,{topOffset:t,rowHeight:s}=S.useMemo(()=>e.getTopAndHeight(),[]),r=e.getAriaRowIndex(),o=e.getHeaderRowClass(),[n,a]=S.useState(()=>s+"px"),[l,u]=S.useState(()=>t+"px"),h=S.useRef(null),d=S.useRef(null),[c,p]=S.useState(()=>e.getHeaderCtrls()),y=S.useRef(null),f=S.useCallback(P=>{if(y.current=P,!P)return;const T={setHeight:D=>a(D),setTop:D=>u(D),setHeaderCtrls:(D,M,O)=>{d.current=h.current,h.current=D;const N=gg(d.current,D,M);N!==d.current&&pg(O,()=>p(N))},setWidth:D=>{y.current&&(y.current.style.width=D)}};e.setComp(T,!1)},[]),w=S.useMemo(()=>({height:n,top:l}),[n,l]),_=S.useCallback(P=>{switch(e.getType()){case Uc.COLUMN_GROUP:return ie.createElement(kE,{ctrl:P,key:P.getInstanceId()});case Uc.FLOATING_FILTER:return ie.createElement(VE,{ctrl:P,key:P.getInstanceId()});default:return ie.createElement(OE,{ctrl:P,key:P.getInstanceId()})}},[]);return ie.createElement("div",{ref:f,className:o,role:"row",style:w,"aria-rowindex":r},c.map(_))},BE=S.memo(HE),WE=i=>{const[e,t]=S.useState(!0),[s,r]=S.useState([]),{context:o}=S.useContext(wi),n=S.useRef(null),a=S.useRef(null),l=S.useRef(null),u=i.pinned==="left",h=i.pinned==="right",d=!u&&!h,c=S.useCallback(f=>{if(n.current=f,!n.current){o.destroyBean(l.current),l.current=null;return}const w={setDisplayed:t,setCtrls:_=>r(_),setCenterWidth:_=>{a.current&&(a.current.style.width=_)},setViewportScrollLeft:_=>{n.current&&(n.current.scrollLeft=_)},setPinnedContainerWidth:_=>{n.current&&(n.current.style.width=_,n.current.style.minWidth=_,n.current.style.maxWidth=_)}};l.current=o.createBean(new Pr(i.pinned)),l.current.setComp(w,n.current)},[]),p=e?"":"ag-hidden",y=()=>s.map(f=>ie.createElement(BE,{ctrl:f,key:f.getInstanceId()}));return ie.createElement(ie.Fragment,null,u&&ie.createElement("div",{ref:c,className:"ag-pinned-left-header "+p,"aria-hidden":!e,role:"rowgroup"},y()),h&&ie.createElement("div",{ref:c,className:"ag-pinned-right-header "+p,"aria-hidden":!e,role:"rowgroup"},y()),d&&ie.createElement("div",{ref:c,className:"ag-header-viewport "+p,role:"presentation"},ie.createElement("div",{ref:a,className:"ag-header-container",role:"rowgroup"},y())))},oc=S.memo(WE),jE=()=>{const[i,e]=S.useState(()=>new Xi),[t,s]=S.useState(),{context:r}=S.useContext(wi),o=S.useRef(null),n=S.useRef(null),a=S.useCallback(h=>{if(o.current=h,!h){r.destroyBean(n.current),n.current=null;return}const d={addOrRemoveCssClass:(c,p)=>e(y=>y.setClass(c,p)),setHeightAndMinHeight:c=>s(c)};n.current=r.createBean(new Tr),n.current.setComp(d,o.current,o.current)},[]),l=S.useMemo(()=>"ag-header "+i.toString(),[i]),u=S.useMemo(()=>({height:t,minHeight:t}),[t]);return ie.createElement("div",{ref:a,className:l,style:u,role:"presentation"},ie.createElement(oc,{pinned:"left"}),ie.createElement(oc,{pinned:null}),ie.createElement(oc,{pinned:"right"}))},UE=S.memo(jE),zE=(i,e)=>{S.useEffect(()=>{const t=e.current;if(t){const s=t.parentElement;if(s){const r=document.createComment(i);return s.insertBefore(r,t),()=>{s.removeChild(r)}}}},[i])},Qr=zE,YE=i=>{const e=S.useRef(i),t=S.useRef(),s=S.useRef(!1),r=S.useRef(!1),[,o]=S.useState(0);s.current&&(r.current=!0),S.useEffect(()=>(s.current||(t.current=e.current(),s.current=!0),o(n=>n+1),()=>{r.current&&t.current&&t.current()}),[])},$E=i=>{const[e,t]=S.useState(),{context:s,popupService:r,localeService:o,gos:n}=S.useContext(wi);return YE(()=>{const{editDetails:a,cellCtrl:l,eParentCell:u}=i,{compDetails:h}=a,d=n.get("stopEditingWhenCellsLoseFocus"),c=s.createBean(new SC(h.params)),p=c.getGui();if(i.jsChildComp){const T=i.jsChildComp.getGui();T&&p.appendChild(T)}const y={column:l.getColumn(),rowNode:l.getRowNode(),type:"popupCellEditor",eventSource:u,ePopup:p,position:a.popupPosition,keepWithinBounds:!0},f=r.positionPopupByComponent.bind(r,y),w=o.getLocaleTextFunc(),_=r.addPopup({modal:d,eChild:p,closeOnEsc:!0,closedCallback:()=>{l.onPopupEditorClosed()},anchorToElement:u,positionCallback:f,ariaLabel:w("ariaLabelCellEditor","Cell Editor")}),P=_?_.hideFunc:void 0;return t(c),i.jsChildComp&&i.jsChildComp.afterGuiAttached&&i.jsChildComp.afterGuiAttached(),()=>{P?.(),s.destroyBean(c)}}),ie.createElement(ie.Fragment,null,e&&i.wrappedContent&&Zf.createPortal(i.wrappedContent,e.getGui()))},pf=S.memo($E),KE=(i,e,t,s,r,o)=>{const{context:n}=S.useContext(wi),a=S.useCallback(()=>{const l=r.current;if(!l)return;const u=l.getGui();u&&u.parentElement&&u.parentElement.removeChild(u),n.destroyBean(l),r.current=void 0},[]);S.useEffect(()=>{const l=i!=null,u=i&&i.compDetails&&!i.compDetails.componentFromFramework,h=e&&t==null;if(!(l&&u&&!h)){a();return}const c=i.compDetails;if(r.current){const _=r.current,T=_.refresh!=null&&i.force==!1?_.refresh(c.params):!1;if(T===!0||T===void 0)return;a()}const p=c.newAgStackInstance();if(!p)return;const y=p.resolveNow(null,_=>_);if(!y)return;const f=y.getGui();if(!f)return;(e?t:o.current).appendChild(f),r.current=y},[i,e,s]),S.useEffect(()=>a,[])},XE=KE,qE=class{constructor(i,e){this.cellEditorParams=i,this.refreshProps=e,this.instanceCreated=new Lt(t=>{this.resolveInstanceCreated=t}),this.onValueChange=t=>this.updateValue(t),this.value=i.value}getProps(){return mi(ct({},this.cellEditorParams),{initialValue:this.cellEditorParams.value,value:this.value,onValueChange:this.onValueChange})}getValue(){return this.value}refresh(i){this.cellEditorParams=i,this.refreshProps()}setMethods(i){cg(this.getOptionalMethods(),i,this)}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}setRef(i){var e;this.componentInstance=i,(e=this.resolveInstanceCreated)==null||e.call(this),this.resolveInstanceCreated=void 0}getOptionalMethods(){return["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached"]}updateValue(i){this.value=i,this.refreshProps()}},QE=(i,e,t)=>{const s=t.getColumn();if(!i&&e.isPopup&&e.isPopup()){const r=`AG Grid: Found an issue in column ${s.getColId()}. If using React, specify an editor is a popup using colDef.cellEditorPopup=true. AG Grid React cannot depend on the editor component specifying if it's in a popup (via the isPopup() method on the editor), as React needs to know this information BEFORE the component is created.`;ye.doOnce(()=>console.warn(r),"jsEditorComp-isPopup-"+t.getColumn().getColId())}if(i&&e.getPopupPosition&&e.getPopupPosition()!=null){const r=`AG Grid: Found an issue in column ${s.getColId()}. If using React, specify an editor popup position using colDef.cellEditorPopupPosition=true. AG Grid React cannot depend on the editor component specifying it's position (via the getPopupPosition() method on the editor), as React needs to know this information BEFORE the component is created.`;ye.doOnce(()=>console.warn(r),"jsEditorComp-getPopupPosition-"+t.getColumn().getColId())}},ZE=(i,e,t)=>{const{compProxy:s}=i;t(s);const r=s.getProps(),o=Xn(e);return ie.createElement(dg.Provider,{value:{setMethods:n=>s.setMethods(n)}},o&&ie.createElement(e,ct({},r)),!o&&ie.createElement(e,mi(ct({},r),{ref:n=>s.setRef(n)})))},gf=(i,e,t)=>{const s=i.compProxy;return ie.createElement(ie.Fragment,null,!s&&ie.createElement(e,mi(ct({},i.compDetails.params),{ref:t})),s&&ZE(i,e,t))},JE=(i,e,t,s,r,o)=>{const n=i.compDetails,a=n.componentClass,l=n.componentFromFramework&&!i.popup,u=n.componentFromFramework&&i.popup,h=!n.componentFromFramework&&i.popup;return ie.createElement(ie.Fragment,null,l&&gf(i,a,e),u&&ie.createElement(pf,{editDetails:i,cellCtrl:r,eParentCell:s,wrappedContent:gf(i,a,t)}),h&&o&&ie.createElement(pf,{editDetails:i,cellCtrl:r,eParentCell:s,jsChildComp:o}))},ex=(i,e,t,s,r,o,n)=>{const{compDetails:a,value:l}=i,u=!a,h=a&&a.componentFromFramework,d=a&&a.componentClass,c=l?.toString?l.toString():l,p=()=>ie.createElement(ie.Fragment,null,u&&ie.createElement(ie.Fragment,null,c),h&&!o&&ie.createElement(d,mi(ct({},a.params),{key:e,ref:s})),h&&o&&ie.createElement(d,mi(ct({},a.params),{key:e})));return ie.createElement(ie.Fragment,null,r?ie.createElement("span",{role:"presentation",id:`cell-${t}`,className:"ag-cell-value",ref:n},p()):p())},tx=i=>{const{context:e}=S.useContext(wi),{cellCtrl:t,printLayout:s,editingRow:r}=i,o=t.getTabIndex(),n=t.getColumnIdSanitised(),a=t.getInstanceId(),[l,u]=S.useState(()=>t.isCellRenderer()?void 0:{compDetails:void 0,value:t.getValueToDisplay(),force:!1}),[h,d]=S.useState(),[c,p]=S.useState(1),[y,f]=S.useState(),[w,_]=S.useState(!1),[P,T]=S.useState(!1),[D,M]=S.useState(!1),[O,N]=S.useState(),z=S.useMemo(()=>t.isForceWrapper(),[t]),Y=S.useMemo(()=>t.getCellAriaRole(),[t]),W=S.useRef(null),$=S.useRef(null),ee=S.useRef(),re=S.useRef(),me=S.useRef(),he=S.useRef([]),ce=S.useRef(),[ne,oe]=S.useState(0),Q=S.useCallback(Ue=>{ce.current=Ue,oe(ot=>ot+1)},[]),pe=l!=null&&(w||D||P),_e=z||pe,ve=S.useCallback((Ue,ot)=>{re.current=ot,ot&&(QE(Ue,ot,t),ot.isCancelBeforeStart&&ot.isCancelBeforeStart()&&setTimeout(()=>{t.stopEditing(!0),t.focusCell(!0)}))},[t]),we=S.useCallback(Ue=>ve(!0,Ue),[ve]),Ze=S.useCallback(Ue=>ve(!1,Ue),[ve]);let Ie=S.useRef();Ie.current||(Ie.current=new Dl(()=>W.current)),XE(l,_e,ce.current,ne,ee,W);const De=S.useRef();S.useLayoutEffect(()=>{const Ue=De.current,ot=l;if(De.current=l,Ue==null||Ue.compDetails==null||ot==null||ot.compDetails==null)return;const Ve=Ue.compDetails,Fe=ot.compDetails;if(Ve.componentClass!=Fe.componentClass||$.current==null||$.current.refresh==null)return;$.current.refresh(Fe.params)!=!0&&p(Yt=>Yt+1)},[l]),S.useLayoutEffect(()=>{if(!(h&&!h.compDetails.componentFromFramework))return;const ot=h.compDetails,Ve=h.popup===!0,Fe=LE(ot);if(!Fe)return;const pt=Fe.getGui();if(ve(Ve,Fe),!Ve){const Yt=(z?me:W).current;Yt?.appendChild(pt),Fe.afterGuiAttached&&Fe.afterGuiAttached()}return N(Fe),()=>{e.destroyBean(Fe),ve(Ve,void 0),N(void 0),pt&&pt.parentElement&&pt.parentElement.removeChild(pt)}},[h]);const rt=S.useCallback(Ue=>{if(me.current=Ue,!me.current){he.current.forEach(Ve=>Ve()),he.current=[];return}const ot=Ve=>{var Fe;if(Ve){const pt=Ve.getGui();(Fe=me.current)==null||Fe.insertAdjacentElement("afterbegin",pt),he.current.push(()=>{e.destroyBean(Ve),ye.removeFromParent(pt)})}return Ve};if(w){const Ve=t.createSelectionCheckbox();ot(Ve)}D&&ot(t.createDndSource()),P&&ot(t.createRowDragComp())},[t,e,D,P,w]),bt=S.useCallback(Ue=>{if(W.current=Ue,!W.current||!t)return;const ot={addOrRemoveCssClass:(Fe,pt)=>Ie.current.addOrRemoveCssClass(Fe,pt),setUserStyles:Fe=>f(Fe),getFocusableElement:()=>W.current,setIncludeSelection:Fe=>_(Fe),setIncludeRowDrag:Fe=>T(Fe),setIncludeDndSource:Fe=>M(Fe),getCellEditor:()=>re.current||null,getCellRenderer:()=>$.current?$.current:ee.current,getParentOfValue:()=>ce.current?ce.current:me.current?me.current:W.current,setRenderDetails:(Fe,pt,Yt)=>{u(ai=>ai?.compDetails!==Fe||ai?.value!==pt||ai?.force!==Yt?{value:pt,compDetails:Fe,force:Yt}:ai)},setEditDetails:(Fe,pt,Yt,ai)=>{if(Fe){let Si;ai?Si=new qE(Fe.params,()=>p(ss=>ss+1)):Fe.componentFromFramework&&fg(),d({compDetails:Fe,popup:pt,popupPosition:Yt,compProxy:Si}),pt||u(void 0)}else d(Si=>{Si?.compProxy&&(re.current=void 0)})}},Ve=me.current||void 0;t.setComp(ot,W.current,Ve,s,r)},[]),Et=S.useMemo(()=>!!(l&&l.compDetails&&l.compDetails.componentFromFramework&&Xn(l.compDetails.componentClass)),[l]);S.useLayoutEffect(()=>{var Ue;W.current&&(Ie.current.addOrRemoveCssClass("ag-cell-value",!_e),Ie.current.addOrRemoveCssClass("ag-cell-inline-editing",!!h&&!h.popup),Ie.current.addOrRemoveCssClass("ag-cell-popup-editing",!!h&&!!h.popup),Ie.current.addOrRemoveCssClass("ag-cell-not-inline-editing",!h||!!h.popup),(Ue=t.getRowCtrl())==null||Ue.setInlineEditingCss(!!h),t.shouldRestoreFocus()&&!t.isEditing()&&W.current.focus({preventScroll:!0}))});const bi=()=>ie.createElement(ie.Fragment,null,l!=null&&ex(l,c,a,$,_e,Et,Q),h!=null&&JE(h,Ze,we,W.current,t,O));return ie.createElement("div",{ref:bt,style:y,tabIndex:o,role:Y,"col-id":n},_e?ie.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:rt},bi()):bi())},ix=S.memo(tx),sx=i=>{const{context:e,gos:t}=S.useContext(wi),{rowCtrl:s,containerType:r}=i,o=s.getTabIndex(),n=S.useRef(s.getDomOrder()),a=s.isFullWidth(),l=s.getRowNode().displayed,[u,h]=S.useState(()=>l?s.getRowIndex():null),[d,c]=S.useState(()=>s.getRowId()),[p,y]=S.useState(()=>s.getBusinessKey()),[f,w]=S.useState(()=>s.getRowStyles()),_=S.useRef(null),P=S.useRef(null),[T,D]=S.useState(()=>null),[M,O]=S.useState(),[N,z]=S.useState(()=>l?s.getInitialRowTop(r):void 0),[Y,W]=S.useState(()=>l?s.getInitialTransform(r):void 0),$=S.useRef(null),ee=S.useRef(),re=S.useRef(!1),[me,he]=S.useState(0);S.useEffect(()=>{var Ie;if(re.current||!M||me>10)return;const De=(Ie=$.current)==null?void 0:Ie.firstChild;De?(s.setupDetailRowAutoHeight(De),re.current=!0):he(rt=>rt+1)},[M,me]);let ce=S.useRef();ce.current||(ce.current=new Dl(()=>$.current));const ne=S.useCallback(Ie=>{if($.current=Ie,!$.current){s.unsetComp(r);return}if(!s.isAlive())return;const De={setTop:z,setTransform:W,addOrRemoveCssClass:(rt,bt)=>ce.current.addOrRemoveCssClass(rt,bt),setDomOrder:rt=>n.current=rt,setRowIndex:h,setRowId:c,setRowBusinessKey:y,setUserStyles:w,setCellCtrls:(rt,bt)=>{P.current=_.current,_.current=rt;const Et=gg(P.current,rt,n.current);Et!==P.current&&pg(bt,()=>D(Et))},showFullWidth:rt=>O(rt),getFullWidthCellRenderer:()=>ee.current,refreshFullWidth:rt=>ve.current?(O(bt=>mi(ct({},bt),{params:rt()})),!0):!ee.current||!ee.current.refresh?!1:ee.current.refresh(rt())};s.setComp(De,$.current,r)},[]);S.useLayoutEffect(()=>Bl(M,e,$.current,ee),[M]);const oe=S.useMemo(()=>{const Ie={top:N,transform:Y};return Object.assign(Ie,f),Ie},[N,Y,f]),Q=a&&M&&M.componentFromFramework,pe=!a&&T!=null,_e=S.useMemo(()=>!!(M?.componentFromFramework&&Xn(M.componentClass)),[M]),ve=S.useRef(!1);S.useEffect(()=>{ve.current=_e&&!!M&&!!t.get("reactiveCustomComponents")},[_e,M]);const we=()=>T?.map(Ie=>ie.createElement(ix,{cellCtrl:Ie,editingRow:s.isEditing(),printLayout:s.isPrintLayout(),key:Ie.getInstanceId()})),Ze=()=>{const Ie=M.componentClass;return ie.createElement(ie.Fragment,null,_e&&ie.createElement(Ie,ct({},M.params)),!_e&&ie.createElement(Ie,mi(ct({},M.params),{ref:ee})))};return ie.createElement("div",{ref:ne,role:"row",style:oe,"row-index":u,"row-id":d,"row-business-key":p,tabIndex:o},pe&&we(),Q&&Ze())},rx=S.memo(sx),ox=i=>{const{context:e}=S.useContext(wi),{name:t}=i,s=S.useMemo(()=>yC(t),[t]),r=S.useRef(null),o=S.useRef(null),n=S.useRef([]),a=S.useRef([]),[l,u]=S.useState(()=>[]),h=S.useRef(!1),d=S.useRef(),c=S.useMemo(()=>oh.getRowContainerCssClasses(t),[t]),p=S.useMemo(()=>hs(c.viewport),[c]),y=S.useMemo(()=>hs(c.container),[c]),f=t===at.CENTER||t===at.TOP_CENTER||t===at.BOTTOM_CENTER||t===at.STICKY_TOP_CENTER||t===at.STICKY_BOTTOM_CENTER,w=f?r:o;Qr(" AG Row Container "+t+" ",w);const _=S.useCallback(()=>f?r.current!=null&&o.current!=null:o.current!=null,[]),P=S.useCallback(()=>f?r.current==null&&o.current==null:o.current==null,[]),T=S.useCallback(()=>{if(P()&&(e.destroyBean(d.current),d.current=null),_()){const N=Y=>{const W=gg(a.current,n.current,h.current);W!==a.current&&(a.current=W,pg(Y,()=>u(W)))},z={setViewportHeight:Y=>{r.current&&(r.current.style.height=Y)},setRowCtrls:({rowCtrls:Y,useFlushSync:W})=>{const $=!!W&&n.current.length>0&&Y.length>0;n.current=Y,N($)},setDomOrder:Y=>{h.current!=Y&&(h.current=Y,N(!1))},setContainerWidth:Y=>{o.current&&(o.current.style.width=Y)}};d.current=e.createBean(new oh(t)),d.current.setComp(z,o.current,r.current)}},[_,P]),D=S.useCallback(N=>{o.current=N,T()},[T]),M=S.useCallback(N=>{r.current=N,T()},[T]),O=()=>ie.createElement("div",{className:y,ref:D,role:"rowgroup"},l.map(N=>ie.createElement(rx,{rowCtrl:N,containerType:s,key:N.getInstanceId()})));return ie.createElement(ie.Fragment,null,f?ie.createElement("div",{className:p,ref:M,role:"presentation"},O()):O())},nx=S.memo(ox),ax=()=>{const{context:i,agStackComponentsRegistry:e,resizeObserverService:t}=S.useContext(wi),[s,r]=S.useState(""),[o,n]=S.useState(0),[a,l]=S.useState(0),[u,h]=S.useState("0px"),[d,c]=S.useState("0px"),[p,y]=S.useState("100%"),[f,w]=S.useState("0px"),[_,P]=S.useState("0px"),[T,D]=S.useState("100%"),[M,O]=S.useState(""),[N,z]=S.useState(""),[Y,W]=S.useState(null),[$,ee]=S.useState(""),[re,me]=S.useState(null),[he,ce]=S.useState("ag-layout-normal");let ne=S.useRef();ne.current||(ne.current=new Dl(()=>oe.current));const oe=S.useRef(null),Q=S.useRef(null),pe=S.useRef(null),_e=S.useRef(null),ve=S.useRef(null),we=S.useRef(null),Ze=S.useRef(null),Ie=S.useRef([]),De=S.useRef([]);Qr(" AG Grid Body ",oe),Qr(" AG Pinned Top ",Q),Qr(" AG Sticky Top ",pe),Qr(" AG Middle ",we),Qr(" AG Pinned Bottom ",Ze);const rt=S.useCallback(rs=>{if(oe.current=rs,!oe.current){i.destroyBeans(Ie.current),De.current.forEach(St=>St()),Ie.current=[],De.current=[];return}if(!i)return;const ei=St=>{const li=e.getComponentClass(St),Hs=i.createBean(new li);return Ie.current.push(Hs),Hs},gt=(St,li)=>{St.appendChild(li),De.current.push(()=>St.removeChild(li))};gt(oe.current,document.createComment(" AG Fake Horizontal Scroll ")),gt(oe.current,ei("AG-FAKE-HORIZONTAL-SCROLL").getGui()),gt(oe.current,document.createComment(" AG Overlay Wrapper ")),gt(oe.current,ei("AG-OVERLAY-WRAPPER").getGui()),ve.current&&(gt(ve.current,document.createComment(" AG Fake Vertical Scroll ")),gt(ve.current,ei("AG-FAKE-VERTICAL-SCROLL").getGui()));const or={setRowAnimationCssOnBodyViewport:r,setColumnCount:St=>{oe.current&&ye.setAriaColCount(oe.current,St)},setRowCount:St=>{oe.current&&ye.setAriaRowCount(oe.current,St)},setTopHeight:n,setBottomHeight:l,setStickyTopHeight:h,setStickyTopTop:c,setStickyTopWidth:y,setTopDisplay:O,setBottomDisplay:z,setColumnMovingCss:(St,li)=>ne.current.addOrRemoveCssClass(St,li),updateLayoutClasses:ce,setAlwaysVerticalScrollClass:W,setPinnedTopBottomOverflowY:ee,setCellSelectableCss:(St,li)=>me(li?St:null),setBodyViewportWidth:St=>{we.current&&(we.current.style.width=St)},registerBodyViewportResizeListener:St=>{if(we.current){const li=t.observeResize(we.current,St);De.current.push(()=>li())}},setStickyBottomHeight:w,setStickyBottomBottom:P,setStickyBottomWidth:D},Or=i.createBean(new ni);Ie.current.push(Or),Or.setComp(or,oe.current,we.current,Q.current,Ze.current,pe.current,_e.current)},[]),bt=S.useMemo(()=>hs("ag-root","ag-unselectable",he),[he]),Et=S.useMemo(()=>hs("ag-body-viewport",s,he,Y,re),[s,he,Y,re]),bi=S.useMemo(()=>hs("ag-body",he),[he]),Ue=S.useMemo(()=>hs("ag-floating-top",re),[re]),ot=S.useMemo(()=>hs("ag-sticky-top",re),[re]),Ve=S.useMemo(()=>hs("ag-sticky-bottom",re),[re]),Fe=S.useMemo(()=>hs("ag-floating-bottom",re),[re]),pt=S.useMemo(()=>({height:o,minHeight:o,display:M,overflowY:$}),[o,M,$]),Yt=S.useMemo(()=>({height:u,top:d,width:p}),[u,d,p]),ai=S.useMemo(()=>({height:f,bottom:_,width:T}),[f,_,T]),Si=S.useMemo(()=>({height:a,minHeight:a,display:N,overflowY:$}),[a,N,$]),ss=rs=>ie.createElement(nx,{name:rs,key:`${rs}-container`}),Wi=({section:rs,children:ei,className:gt,style:or})=>ie.createElement("div",{ref:rs,className:gt,role:"presentation",style:or},ei.map(ss));return ie.createElement("div",{ref:rt,className:bt,role:"treegrid"},ie.createElement(UE,null),Wi({section:Q,className:Ue,style:pt,children:[at.TOP_LEFT,at.TOP_CENTER,at.TOP_RIGHT,at.TOP_FULL_WIDTH]}),ie.createElement("div",{className:bi,ref:ve,role:"presentation"},Wi({section:we,className:Et,children:[at.LEFT,at.CENTER,at.RIGHT,at.FULL_WIDTH]})),Wi({section:pe,className:ot,style:Yt,children:[at.STICKY_TOP_LEFT,at.STICKY_TOP_CENTER,at.STICKY_TOP_RIGHT,at.STICKY_TOP_FULL_WIDTH]}),Wi({section:_e,className:Ve,style:ai,children:[at.STICKY_BOTTOM_LEFT,at.STICKY_BOTTOM_CENTER,at.STICKY_BOTTOM_RIGHT,at.STICKY_BOTTOM_FULL_WIDTH]}),Wi({section:Ze,className:Fe,style:Si,children:[at.BOTTOM_LEFT,at.BOTTOM_CENTER,at.BOTTOM_RIGHT,at.BOTTOM_FULL_WIDTH]}))},lx=S.memo(ax),ux=(i,e)=>{const{children:t,eFocusableElement:s,onTabKeyDown:r,gridCtrl:o,forceFocusOutWhenTabGuardsAreEmpty:n}=i,{context:a}=S.useContext(wi),l=S.useRef(null),u=S.useRef(null),h=S.useRef(),d=w=>{const _=w==null?void 0:parseInt(w,10).toString();[l,u].forEach(P=>{var T,D;_===void 0?(T=P.current)==null||T.removeAttribute("tabindex"):(D=P.current)==null||D.setAttribute("tabindex",_)})};S.useImperativeHandle(e,()=>({forceFocusOutOfContainer(w){var _;(_=h.current)==null||_.forceFocusOutOfContainer(w)}}));const c=S.useCallback(()=>{if(!l.current&&!u.current){a.destroyBean(h.current),h.current=null;return}if(l.current&&u.current){const w={setTabIndex:d};h.current=a.createBean(new ud({comp:w,eTopGuard:l.current,eBottomGuard:u.current,eFocusableElement:s,onTabKeyDown:r,forceFocusOutWhenTabGuardsAreEmpty:n,focusInnerElement:_=>o.focusInnerElement(_)}))}},[]),p=S.useCallback(w=>{l.current=w,c()},[c]),y=S.useCallback(w=>{u.current=w,c()},[c]),f=w=>{const _=w==="top"?Vu.TAB_GUARD_TOP:Vu.TAB_GUARD_BOTTOM;return ie.createElement("div",{className:`${Vu.TAB_GUARD} ${_}`,role:"presentation",ref:w==="top"?p:y})};return ie.createElement(ie.Fragment,null,f("top"),t,f("bottom"))},hx=S.forwardRef(ux),dx=S.memo(hx),cx=({context:i})=>{const[e,t]=S.useState(""),[s,r]=S.useState(""),[o,n]=S.useState(""),[a,l]=S.useState(null),[u,h]=S.useState(null),[d,c]=S.useState(!1),[p,y]=S.useState(),f=S.useRef(null),w=S.useRef(null),_=S.useRef(),[P,T]=S.useState(null),D=S.useRef(()=>{}),M=S.useCallback(()=>{},[]),O=S.useMemo(()=>i.isDestroyed()?null:i.getBean("beans"),[i]);Qr(" AG Grid ",w);const N=S.useCallback(ee=>{if(w.current=ee,!w.current){i.destroyBean(f.current),f.current=null;return}if(i.isDestroyed())return;f.current=i.createBean(new Lr);const re=f.current;D.current=re.focusInnerElement.bind(re);const me={destroyGridUi:()=>{},setRtlClass:t,forceFocusOutOfContainer:he=>{var ce;(ce=_.current)==null||ce.forceFocusOutOfContainer(he)},updateLayoutClasses:n,getFocusableContainers:()=>{var he,ce;const ne=[],oe=(he=w.current)==null?void 0:he.querySelector(".ag-root"),Q=(ce=w.current)==null?void 0:ce.querySelector(".ag-side-bar:not(.ag-hidden)");return oe&&ne.push(oe),Q&&ne.push(Q),ne},setCursor:l,setUserSelect:h};re.setComp(me,w.current,w.current),c(!0)},[]);S.useEffect(()=>{if(!p||!O||!f.current||!P||!w.current)return;const ee=f.current,re=[],{agStackComponentsRegistry:me}=O,he=me.getComponentClass("AG-GRID-HEADER-DROP-ZONES"),ce=me.getComponentClass("AG-SIDE-BAR"),ne=me.getComponentClass("AG-STATUS-BAR"),oe=me.getComponentClass("AG-WATERMARK"),Q=me.getComponentClass("AG-PAGINATION"),pe=[],_e=w.current;if(ee.showDropZones()&&he){const ve=i.createBean(new he),we=ve.getGui();_e.insertAdjacentElement("afterbegin",we),pe.push(we),re.push(ve)}if(ee.showSideBar()&&ce){const ve=i.createBean(new ce),we=ve.getGui(),Ze=P.querySelector(".ag-tab-guard-bottom");Ze&&(Ze.insertAdjacentElement("beforebegin",we),pe.push(we)),re.push(ve)}if(ee.showStatusBar()&&ne){const ve=i.createBean(new ne),we=ve.getGui();_e.insertAdjacentElement("beforeend",we),pe.push(we),re.push(ve)}if(Q){const ve=i.createBean(new Q),we=ve.getGui();_e.insertAdjacentElement("beforeend",we),pe.push(we),re.push(ve)}if(ee.showWatermark()&&oe){const ve=i.createBean(new oe),we=ve.getGui();_e.insertAdjacentElement("beforeend",we),pe.push(we),re.push(ve)}return()=>{i.destroyBeans(re),pe.forEach(ve=>{ve.parentElement&&ve.parentElement.removeChild(ve)})}},[p,P,O]);const z=S.useMemo(()=>hs("ag-root-wrapper",e,s,o),[e,s,o]),Y=S.useMemo(()=>hs("ag-root-wrapper-body","ag-focus-managed",o),[o]),W=S.useMemo(()=>({userSelect:u??"",WebkitUserSelect:u??"",cursor:a??""}),[u,a]),$=S.useCallback(ee=>{_.current=ee,y(ee!==null)},[]);return ie.createElement("div",{ref:N,className:z,style:W,role:"presentation"},ie.createElement("div",{className:Y,ref:T,role:"presentation"},d&&P&&O&&ie.createElement(wi.Provider,{value:O},ie.createElement(dx,{ref:$,eFocusableElement:P,onTabKeyDown:M,gridCtrl:f.current,forceFocusOutWhenTabGuardsAreEmpty:!0},ie.createElement(lx,null)))))},px=S.memo(cx),KC=i=>{var e,t;const s=S.useRef(),r=S.useRef(null),o=S.useRef(null),n=S.useRef([]),a=S.useRef([]),l=S.useRef(i),u=S.useRef(!1),[h,d]=S.useState(void 0),[,c]=S.useState(0),p=S.useCallback(w=>{if(r.current=w,!r.current){n.current.forEach(N=>N()),n.current.length=0;return}const _=i.modules||[];o.current||(o.current=new AE(()=>c(N=>N+1),i.componentWrappingElement,i.maxComponentCreationTimeMs),n.current.push(()=>{var N;(N=o.current)==null||N.destroy(),o.current=null}));const P=eh.combineAttributesAndGridOptions(i.gridOptions,i),T={providedBeanInstances:{frameworkComponentWrapper:new fx(o.current,!!P.reactiveCustomComponents)},modules:_,frameworkOverrides:new vx},D=N=>{d(N),n.current.push(()=>{N.destroy()}),N.getBean(lo.NAME).whenReady(()=>{if(N.isDestroyed())return;const Y=s.current;Y&&i.setGridApi&&i.setGridApi(Y,new wn(Y))})},M=N=>{N.getBean(lo.NAME).whenReady(()=>{a.current.forEach(Y=>Y()),a.current.length=0,u.current=!0})},O=new U_;s.current=O.create(r.current,P,D,M,T)},[]),y=S.useMemo(()=>ct({height:"100%"},i.containerStyle||{}),[i.containerStyle]),f=S.useCallback(w=>{u.current?w():a.current.push(w)},[]);return S.useEffect(()=>{const w=gx(l.current,i);l.current=i,f(()=>{s.current&&eh.processOnChange(w,s.current)})},[i]),ie.createElement("div",{style:y,className:i.className,ref:p},h&&!h.isDestroyed()?ie.createElement(px,{context:h}):null,(t=(e=o.current)==null?void 0:e.getPortals())!=null?t:null)};function gx(i,e){const t={};return Object.keys(e).forEach(s=>{const r=e[s];i[s]!==r&&(t[s]=r)}),t}var fx=class extends z_{constructor(i,e){super(),this.parent=i,this.reactiveCustomComponents=e}createWrapper(i,e){if(this.reactiveCustomComponents){const r=(o=>{switch(o){case"filter":return SE;case"floatingFilterComponent":return EE;case"dateComponent":return bE;case"loadingOverlayComponent":return xE;case"noRowsOverlayComponent":return DE;case"statusPanel":return PE;case"toolPanel":return TE;case"menuItem":return RE}})(e.propertyName);if(r)return new r(i,this.parent,e)}else switch(e.propertyName){case"filter":case"floatingFilterComponent":case"dateComponent":case"loadingOverlayComponent":case"noRowsOverlayComponent":case"statusPanel":case"toolPanel":case"menuItem":fg();break}const t=!e.cellRenderer&&e.propertyName!=="toolPanel";return new WC(i,this.parent,e,t)}},mx=S.forwardRef((i,e)=>{const{ctrlsFactory:t,context:s,gos:r,resizeObserverService:o,clientSideRowModel:n,serverSideRowModel:a}=S.useContext(wi),[l,u]=S.useState(()=>new Xi),[h,d]=S.useState(()=>new Xi),[c,p]=S.useState(),[y,f]=S.useState(),w=S.useRef(),_=S.useRef(null),P=S.useRef(),T=S.useMemo(()=>ze.__getGridRegisteredModules(i.api.getGridId()),[i]),D=S.useMemo(()=>l.toString()+" ag-details-row",[l]),M=S.useMemo(()=>h.toString()+" ag-details-grid",[h]);e&&S.useImperativeHandle(e,()=>({refresh(){var z,Y;return(Y=(z=w.current)==null?void 0:z.refresh())!=null?Y:!1}})),i.template&&ye.warnOnce("detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://ag-grid.com/react-data-grid/master-detail-custom-detail/");const O=S.useCallback(z=>{if(_.current=z,!_.current){s.destroyBean(w.current),P.current&&P.current();return}const Y={addOrRemoveCssClass:($,ee)=>u(re=>re.setClass($,ee)),addOrRemoveDetailGridCssClass:($,ee)=>d(re=>re.setClass($,ee)),setDetailGrid:$=>p($),setRowData:$=>f($),getGui:()=>_.current},W=t.getInstance("detailCellRenderer");if(W&&(s.createBean(W),W.init(Y,i),w.current=W,r.get("detailRowAutoHeight"))){const $=()=>{if(_.current==null)return;const ee=_.current.clientHeight;ee!=null&&ee>0&&setTimeout(()=>{i.node.setRowHeight(ee),n?n.onRowHeightChanged():a&&a.onRowHeightChanged()},0)};P.current=o.observeResize(_.current,$),$()}},[]),N=S.useCallback((z,Y)=>{var W;(W=w.current)==null||W.registerDetailWithMaster(z,Y)},[]);return ie.createElement("div",{className:D,ref:O},c&&ie.createElement(KC,mi(ct({className:M},c),{modules:T,rowData:y,setGridApi:N})))}),vx=class extends OC{constructor(){super("react"),this.frameworkComponents={agGroupCellRenderer:cf,agGroupRowRenderer:cf,agDetailCellRenderer:mx},this.wrapIncoming=(i,e)=>e==="ensureVisible"?ME(i):i(),this.renderingEngine="react"}frameworkComponent(i){return this.frameworkComponents[i]}isFrameworkComponent(i){if(!i)return!1;const e=i.prototype;return!(e&&"getGui"in e)}},Cx=class extends S.Component{constructor(){super(...arguments),this.apiListeners=[],this.setGridApi=(i,e)=>{this.api=i,this.columnApi=e,this.apiListeners.forEach(t=>t(i))}}registerApiListener(i){this.apiListeners.push(i)}componentWillUnmount(){this.apiListeners.length=0}render(){return ie.createElement(KC,mi(ct({},this.props),{setGridApi:this.setGridApi}))}};const yx=["Thank You Note","Message","Products","Original Pre-Swap Products"];function wx({column:i,value:e}){return C.jsxs("div",{children:[C.jsx("div",{className:"font-medium text-sm text-gray-500 pb-[2px]",children:i}),C.jsx("div",{className:Ut((i==="Card Image URL"||i.endsWith("ID"))&&"break-all"),children:i==="Individual Gift URL"&&e?C.jsx("a",{href:e,rel:"nofollow noopener noreferrer",target:"_blank",children:e}):C.jsx(C.Fragment,{children:yx.includes(i)?em(e):bx(i,e)})})]})}function bx(i,e){if(e==null)return"—";if(typeof e=="boolean")return e.toString();const t=La[i]?.type;return t&&t==="currency"?"$"+e.toFixed(2):e}function Sx({open:i,onClose:e,data:t}){return C.jsx(Lh,{anchor:"right",open:i,onClose:e,children:C.jsx("div",{className:"w-[560px] max-w-full h-full",children:t&&C.jsxs("div",{className:"px-8 pt-8 pr-6 pb-48",children:[C.jsx(Sl,{name:t["Recipient Full Name"],onClose:e}),C.jsx("div",{className:"-mx-3",children:Object.keys($u).map(s=>{const r=$u[s];return C.jsxs("div",{children:[C.jsx("div",{className:"mt-8 px-4 py-1 bg-gray-150 font-medium text-gray-600 rounded mb-[2px]",children:s}),C.jsx(_x,{children:r.map(o=>C.jsx(wx,{column:o,value:t[o]}))})]},s)})})]})})})}const _x=Dt.section`grid grid-cols-2 gap-4 py-4 pb-4 mx-4`;function Ex({data:i,gridRef:e,columnVisibility:t}){const[s,r]=S.useState(!1),[o,n]=S.useState(null),a=S.useMemo(()=>Ky.parse(i.trim(),{header:!0,dynamicTyping:!0}).data,[i]),l=()=>{e?.current&&e.current?.columnApi?.applyColumnState({state:Object.keys(t).map(h=>({colId:h,hide:!t[h]}))})},u=h=>{n(h),r(!0)};return C.jsx(om.Provider,{value:{onExpandGift:u},children:C.jsxs(xx,{children:[C.jsx("div",{className:"ag-theme-alpine",style:{width:"100%",height:"80vh"},children:C.jsx(Cx,{ref:e,rowData:a,columnDefs:kw,defaultColDef:Gw,columnTypes:Vw,animateRows:!0,pagination:!0,paginationPageSize:20,paginationAutoPageSize:!0,enableCellTextSelection:!0,suppressRowVirtualisation:!0,onGridReady:l})}),C.jsx(Sx,{open:s,onClose:()=>r(!1),data:o})]})})}const xx=st.div`
font-variant-numeric: tabular-nums;
.ag-root-wrapper {
border-radius: 0.5rem;
}
.ag-theme-alpine {
--ag-font-size: 15px;
--ag-font-family: "Goody Sans Web", "Graphik Web", -apple-system,
BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;
.ag-header-row {
font-weight: 500;
}
.ag-theme-alpine .ag-paging-number,
.ag-theme-alpine .ag-paging-row-summary-panel-number,
.ag-theme-alpine-dark .ag-paging-number,
.ag-theme-alpine-dark .ag-paging-row-summary-panel-number {
font-weight: 500;
}
// Shows the hover button.
.ag-row-hover {
button.grid-expand-button {
opacity: 1;
}
}
// Corrects the height to allow the Status renderer to look decent.
.ag-cell[col-id="Gift Status"] .ag-cell-wrapper {
height: 100%;
}
}
`,Rx=i=>S.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("path",{d:"M12.6667 2H3.33333C2.59695 2 2 2.59695 2 3.33333V12.6667C2 13.403 2.59695 14 3.33333 14H12.6667C13.403 14 14 13.403 14 12.6667V3.33333C14 2.59695 13.403 2 12.6667 2Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M8 2V14",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),ff=i=>S.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("path",{d:"M14 10V12.6667C14 13.0203 13.8595 13.3594 13.6095 13.6095C13.3594 13.8595 13.0203 14 12.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V10",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M4.66602 6.66699L7.99935 10.0003L11.3327 6.66699",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M8 10V2",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Dx=["=","+","-","@"," ","\r",`
`,"|","%"];function Px(){const{getGraphqlVariables:i,useRequestChartData:e}=S.useContext(je),t=S.useRef(null),[s,r]=S.useState(ma.sent_in_range),[o,{data:n,loading:a}]=Jt(Ax);e(()=>{o({variables:{params:i(),segment:s}})},[s]);const l=n?.reportChart?.giftData,u=It(l),h=S.useRef(null),[d,c]=S.useState(!1),[p,y]=S.useState(Iw),f=()=>{if(!h?.current){alert("Please wait until the table has loaded.");return}h.current?.api.exportDataAsCsv({fileName:"goody_export.csv",processCellCallback:Tx})},w=()=>{if(!u?.csvData){alert("Please wait until data has loaded.");return}const P=new Blob([u.csvData],{type:"text/csv;charset=utf-8"});Xy.saveAs(P,"goody_export.csv")},_=(P,T)=>{h?.current&&h.current?.columnApi?.applyColumnState({state:[{colId:P,hide:!T}]}),y({...p,[P]:T})};return S.useEffect(()=>{t.current?.scrollIntoView({block:"start",behavior:"smooth"})},[]),C.jsxs("div",{className:"min-h-[80vh] pb-48 pt-4",style:{scrollMarginTop:"80px"},ref:t,children:[C.jsxs("div",{className:"pb-6 flex flex-row items-center justify-between",children:[C.jsxs("div",{className:"flex flex-row items-center justify-start gap-4",children:[C.jsx("button",{className:Ut("px-4 py-2 text-gray-400 text-2xl rounded-xl font-medium hover:bg-gray-050 hover:text-gray-500 active:bg-gray-075 transition-colors",s===ma.sent_in_range&&"bg-gray-100 text-gray-700 hover:text-gray-700 hover:bg-gray-100 active:bg-gray-100"),onClick:()=>r(ma.sent_in_range),children:"Gifts sent in date range"}),C.jsx("button",{className:Ut("px-4 py-2 text-gray-400 text-2xl rounded-xl font-medium hover:bg-gray-050 hover:text-gray-500 active:bg-gray-075 transition-colors",s===ma.accepted_in_range&&"bg-gray-100 text-gray-700 hover:text-gray-700 hover:bg-gray-100 active:bg-gray-100"),onClick:()=>r(ma.accepted_in_range),children:"Gifts accepted in date range"})]}),C.jsxs("div",{className:"flex flex-row items-center justify-end gap-3",children:[C.jsxs(Bd,{onClick:f,children:[C.jsx(ff,{})," Download table view"]}),C.jsxs(Bd,{onClick:w,children:[C.jsx(ff,{})," Download all data"]}),C.jsxs(Bd,{onClick:()=>c(!0),variant:"updated",children:[C.jsx(Rx,{})," Columns"]})]})]}),C.jsx(wt,{loading:a,dataPresent:!a,children:u?.csvData&&C.jsx(Ex,{data:u?.csvData,gridRef:h,columnVisibility:p})}),C.jsx(Ww,{open:d,onClose:()=>c(!1),columnVisibility:p,onChangeColumnVisibility:_})]})}const Tx=i=>{const e=i.value;return qi(e)||typeof e=="number"||typeof e=="boolean"?e:Dx.some(t=>e.startsWith(t))?"'"+e:e},Ax=zt`
query ReportCharts_GiftData(
$params: ReportParamsInput!
$segment: ReportChartsGiftDataSegment!
) {
reportChart(params: $params) {
giftData(segment: $segment) {
csvData
totalCount
}
}
}
`;function bs(i){return Number(i)!==i}function Fx(i){return{}.toString.call(i)}function Ni(i){if(i!=null&&!B(i)){let e=Number(i);return bs(e)&&Pn(i)&&i!=""?Ni(i.replace(/[^0-9.\-]+/g,"")):e}return i}function Mx(i){if(tp(i))return new Date(i);if(B(i))return new Date(i);{let e=Number(i);return B(e)?new Date(e):new Date(i)}}function Lx(i){if(bs(i))return"NaN";if(i===1/0)return"Infinity";if(i===-1/0)return"-Infinity";if(i===0&&1/i===-1/0)return"-0";let e=i<0;i=Math.abs(i);let t=/^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec(""+i),s=t[1],r=t[2]||"",o;if(t[3]===void 0)o=r===""?s:s+"."+r;else{let n=+t[3];if(i<1){let a=n-1;o="0."+mf("0",a)+s+r}else{let a=n-r.length;a===0?o=s+r:a<0?o=s+r.slice(0,a)+"."+r.slice(a):o=s+r+mf("0",a)}}return e?"-"+o:o}function mf(i,e){return new Array(e+1).join(i)}function tp(i){return Fx(i)==="[object Date]"}function Pn(i){return typeof i=="string"}function B(i){return typeof i=="number"&&Number(i)==i}function Tn(i){return typeof i=="object"&&i!==null}function nc(i){return Array.isArray(i)}const Er="__§§§__",on="__§§§§__";function nl(i,e){const t=i.length;for(let s=0;s<t;++s)if(i[s]===e)return s;return-1}function Ix(i,e){const t=i.length;for(let s=0;s<t;++s)if(e(i[s]))return!0;return!1}function ip(i,e){const t=i.length,s=new Array(t);for(let r=0;r<t;++r)s[r]=e(i[r],r);return s}function G(i,e){const t=i.length;for(let s=0;s<t;++s)e(i[s],s)}function Aa(i,e){let t=i.length;for(;t>0;)--t,e(i[t],t)}function XC(i,e){const t=i.length;for(let s=0;s<t&&e(i[s],s);++s);}function Yi(i,e){let t=!1,s=0;for(;;){if(s=i.indexOf(e,s),s===-1)return t;t=!0,i.splice(s,1)}}function pi(i,e){let t=i.indexOf(e);return t!==-1?(i.splice(t,1),!0):!1}function al(i,e){i.indexOf(e)===-1&&i.push(e)}function sp(i){const e=i.length,t=new Array(e);for(let s=0;s<e;++s)t[s]=i[s];return t}function ac(i,e,t){i.splice(e,0,t)}function vf(i,e){i.splice(e,1)}function qC(i,e){const t=i.length;for(let s=0;s<t;++s)if(e(i[s],s))return s;return-1}function Ox(i,e){let t=i.length;for(;t>0;)if(--t,e(i[t],t))return t;return-1}function QC(i,e){const t=qC(i,e);if(t!==-1)return i[t]}function Nx(i,e){const t=Ox(i,e);if(t!==-1)return i[t]}function Wu(i,e){let t=0,s=i.length,r=!1;for(;t<s;){const o=t+s>>1,n=e(i[o]);n<0?t=o+1:n===0?(r=!0,t=o+1):s=o}return{found:r,index:r?t-1:t}}function kx(i,e){let t=0,s=i.length,r=!1;for(;t<s;){const o=t+s>>1,n=e(i[o]);n<0?t=o+1:(n===0&&(r=!0),s=o)}return{found:r,index:t}}function gd(i,e){let t=i.length;for(;t>0;)--t,e(i[t])||i.splice(t,1)}class fd{constructor(){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Vt{constructor(e){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dispose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1,this._dispose=e}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Gx extends fd{constructor(){super(...arguments),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_dispose(){G(this._disposers,e=>{e.dispose()})}}class di extends fd{constructor(e){super(),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposers=e}_dispose(){G(this._disposers,e=>{e.dispose()})}}class mg extends Vt{constructor(){super(...arguments),Object.defineProperty(this,"_counter",{enumerable:!0,configurable:!0,writable:!0,value:0})}increment(){return++this._counter,new Vt(()=>{--this._counter,this._counter===0&&this.dispose()})}}class qn{constructor(){Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_killed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_iterating",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._listeners=[],this._killed=[],this._disabled={},this._iterating=0,this._enabled=!0,this._disposed=!1}isDisposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;const e=this._listeners;this._iterating=1,this._listeners=null,this._disabled=null;try{G(e,t=>{t.disposer.dispose()})}finally{this._killed=null,this._iterating=null}}}hasListeners(){return this._listeners.length!==0}hasListenersByType(e){return Ix(this._listeners,t=>(t.type===null||t.type===e)&&!t.killed)}enable(){this._enabled=!0}disable(){this._enabled=!1}enableType(e){delete this._disabled[e]}disableType(e,t=1/0){this._disabled[e]=t}_removeListener(e){if(this._iterating===0){const t=this._listeners.indexOf(e);if(t===-1)throw new Error("Invalid state: could not remove listener");this._listeners.splice(t,1)}else this._killed.push(e)}_removeExistingListener(e,t,s,r){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(o=>{o.once===e&&o.type===t&&(s===void 0||o.callback===s)&&o.context===r&&o.disposer.dispose()})}isEnabled(e){if(this._disposed)throw new Error("EventDispatcher is disposed");return this._enabled&&this._listeners.length>0&&this.hasListenersByType(e)&&this._disabled[e]===void 0}removeType(e){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(t=>{t.type===e&&t.disposer.dispose()})}has(e,t,s){return qC(this._listeners,o=>o.once!==!0&&o.type===e&&(t===void 0||o.callback===t)&&o.context===s)!==-1}_shouldDispatch(e){if(this._disposed)throw new Error("EventDispatcher is disposed");const t=this._disabled[e];return B(t)?(t<=1?delete this._disabled[e]:--this._disabled[e],!1):this._enabled}_eachListener(e){++this._iterating;try{G(this._listeners,e)}finally{--this._iterating,this._iterating===0&&this._killed.length!==0&&(G(this._killed,t=>{this._removeListener(t)}),this._killed.length=0)}}dispatch(e,t){this._shouldDispatch(e)&&this._eachListener(s=>{!s.killed&&(s.type===null||s.type===e)&&s.dispatch(e,t)})}_on(e,t,s,r,o,n){if(this._disposed)throw new Error("EventDispatcher is disposed");this._removeExistingListener(e,t,s,r);const a={type:t,callback:s,context:r,shouldClone:o,dispatch:n,killed:!1,once:e,disposer:new Vt(()=>{a.killed=!0,this._removeListener(a)})};return this._listeners.push(a),a}onAll(e,t,s=!0){return this._on(!1,null,e,t,s,(r,o)=>e.call(t,o)).disposer}on(e,t,s,r=!0){return this._on(!1,e,t,s,r,(o,n)=>t.call(s,n)).disposer}once(e,t,s,r=!0){const o=this._on(!0,e,t,s,r,(n,a)=>{o.disposer.dispose(),t.call(s,a)});return o.disposer}off(e,t,s){this._removeExistingListener(!1,e,t,s)}copyFrom(e){if(this._disposed)throw new Error("EventDispatcher is disposed");if(e===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");const t=[];return G(e._listeners,s=>{!s.killed&&s.shouldClone&&(s.type===null?t.push(this.onAll(s.callback,s.context)):s.once?t.push(this.once(s.type,s.callback,s.context)):t.push(this.on(s.type,s.callback,s.context)))}),new di(t)}}function Ca(i,e){if(!(i>=0&&i<e))throw new Error("Index out of bounds: "+i)}let Qn=class{constructor(e=[]){Object.defineProperty(this,"_values",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new qn}),this._values=e}get values(){return this._values}contains(e){return this._values.indexOf(e)!==-1}removeValue(e){let t=0,s=this._values.length;for(;t<s;)this._values[t]===e?(this.removeIndex(t),--s):++t}indexOf(e){return nl(this._values,e)}get length(){return this._values.length}hasIndex(e){return e>=0&&e<this._values.length}getIndex(e){return this._values[e]}_onPush(e){this.events.isEnabled("push")&&this.events.dispatch("push",{type:"push",target:this,newValue:e})}_onInsertIndex(e,t){this.events.isEnabled("insertIndex")&&this.events.dispatch("insertIndex",{type:"insertIndex",target:this,index:e,newValue:t})}_onSetIndex(e,t,s){this.events.isEnabled("setIndex")&&this.events.dispatch("setIndex",{type:"setIndex",target:this,index:e,oldValue:t,newValue:s})}_onRemoveIndex(e,t){this.events.isEnabled("removeIndex")&&this.events.dispatch("removeIndex",{type:"removeIndex",target:this,index:e,oldValue:t})}_onMoveIndex(e,t,s){this.events.isEnabled("moveIndex")&&this.events.dispatch("moveIndex",{type:"moveIndex",target:this,oldIndex:e,newIndex:t,value:s})}_onClear(e){this.events.isEnabled("clear")&&this.events.dispatch("clear",{type:"clear",target:this,oldValues:e})}setIndex(e,t){Ca(e,this._values.length);const s=this._values[e];return s!==t&&(this._values[e]=t,this._onSetIndex(e,s,t)),s}insertIndex(e,t){return Ca(e,this._values.length+1),ac(this._values,e,t),this._onInsertIndex(e,t),t}swap(e,t){const s=this._values.length;if(Ca(e,s),Ca(t,s),e!==t){const r=this._values[e],o=this._values[t];this._values[e]=o,this._onSetIndex(e,r,o),this._values[t]=r,this._onSetIndex(t,o,r)}}removeIndex(e){Ca(e,this._values.length);const t=this._values[e];return vf(this._values,e),this._onRemoveIndex(e,t),t}moveValue(e,t){let s=this.indexOf(e);if(s!==-1)if(vf(this._values,s),t==null){const r=this._values.length;this._values.push(e),this._onMoveIndex(s,r,e)}else ac(this._values,t,e),this._onMoveIndex(s,t,e);else t==null?(this._values.push(e),this._onPush(e)):(ac(this._values,t,e),this._onInsertIndex(t,e));return e}push(e){return this._values.push(e),this._onPush(e),e}unshift(e){return this.insertIndex(0,e),e}pushAll(e){G(e,t=>{this.push(t)})}copyFrom(e){this.pushAll(e._values)}pop(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)}shift(){return this._values.length?this.removeIndex(0):void 0}setAll(e){const t=this._values;this._values=[],this._onClear(t),G(e,s=>{this._values.push(s),this._onPush(s)})}clear(){this.setAll([])}*[Symbol.iterator](){const e=this._values.length;for(let t=0;t<e;++t)yield this._values[t]}each(e){G(this._values,e)}eachReverse(e){Aa(this._values,e)}};class fh extends Qn{constructor(){super(...arguments),Object.defineProperty(this,"autoDispose",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_onSetIndex(e,t,s){this.autoDispose&&t.dispose(),super._onSetIndex(e,t,s)}_onRemoveIndex(e,t){this.autoDispose&&t.dispose(),super._onRemoveIndex(e,t)}_onClear(e){this.autoDispose&&G(e,t=>{t.dispose()}),super._onClear(e)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this.autoDispose&&G(this._values,e=>{e.dispose()}))}}class As extends fh{constructor(e,t){super(),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"make",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=e,this.make=t}}class Vx extends Qn{constructor(e){super(),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._container=e,this._events=this.events.onAll(t=>{if(t.type==="clear")G(t.oldValues,s=>{this._onRemoved(s)});else if(t.type==="push")this._onInserted(t.newValue);else if(t.type==="setIndex")this._onRemoved(t.oldValue),this._onInserted(t.newValue,t.index);else if(t.type==="insertIndex")this._onInserted(t.newValue,t.index);else if(t.type==="removeIndex")this._onRemoved(t.oldValue);else if(t.type==="moveIndex")this._onRemoved(t.value),this._onInserted(t.value,t.newIndex);else throw new Error("Unknown IListEvent type")})}_onInserted(e,t){e._setParent(this._container,!0);const s=this._container._childrenDisplay;t===void 0?s.addChild(e._display):s.addChildAt(e._display,t)}_onRemoved(e){this._container._childrenDisplay.removeChild(e._display),this._container.markDirtyBounds(),this._container.markDirty()}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._events.dispose(),G(this.values,e=>{e.dispose()}))}}class He{constructor(e){Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._value=e}get value(){return this._value/100}get percent(){return this._value}toString(){return""+this._value+"%"}interpolate(e,t){return e+this.value*(t-e)}static normalize(e,t,s){return e instanceof He?e:t===s?new He(0):new He(Math.min(Math.max((e-t)*(1/(s-t)),0),1)*100)}}function ds(i){return new He(i)}ds(0);const ue=ds(100),xt=ds(50);function Be(i,e,t,s){function r(o){return o instanceof t?o:new t(function(n){n(o)})}return new(t||(t=Promise))(function(o,n){function a(h){try{u(s.next(h))}catch(d){n(d)}}function l(h){try{u(s.throw(h))}catch(d){n(d)}}function u(h){h.done?o(h.value):r(h.value).then(a,l)}u((s=s.apply(i,[])).next())})}function Ht(i){return Object.keys(i)}function ZC(i,e){return Ht(i).sort(e)}function mr(i){return Object.assign({},i)}function $e(i,e){Ht(i).forEach(t=>{e(t,i[t])})}function Hx(i,e){for(let t in i)if(Bx(i,t)&&!e(t,i[t]))break}function cr(i,e,t){G(ZC(i,t),s=>{e(s,i[s])})}function Bx(i,e){return{}.hasOwnProperty.call(i,e)}function Wx(i){i.parentNode&&i.parentNode.removeChild(i)}function tt(i,e,t,s){return i.addEventListener(e,t,s||!1),new Vt(()=>{i.removeEventListener(e,t,s||!1)})}function JC(i){return tt(window,"resize",e=>{i()})}function Ls(i){switch(i){case"touchevents":return window.hasOwnProperty("TouchEvent");case"pointerevents":return window.hasOwnProperty("PointerEvent");case"mouseevents":return window.hasOwnProperty("MouseEvent");case"wheelevents":return window.hasOwnProperty("WheelEvent");case"keyboardevents":return window.hasOwnProperty("KeyboardEvent")}return!1}function lc(i){return i.pointerId||0}function ey(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{let i=document.createElement("button");i.style.position="fixed",i.style.top="0px",i.style.left="-10000px",document.body.appendChild(i),i.focus(),i.blur(),document.body.removeChild(i)}}function jx(i){i&&i.focus()}function ll(i){if(Ls("pointerevents"))return i;if(Ls("touchevents"))switch(i){case"pointerover":return"touchstart";case"pointerout":return"touchend";case"pointerdown":return"touchstart";case"pointermove":return"touchmove";case"pointerup":return"touchend";case"click":return"click";case"dblclick":return"dblclick"}else if(Ls("mouseevents"))switch(i){case"pointerover":return"mouseover";case"pointerout":return"mouseout";case"pointerdown":return"mousedown";case"pointermove":return"mousemove";case"pointerup":return"mouseup";case"click":return"click";case"dblclick":return"dblclick"}return i}function rp(i){if(typeof Touch<"u"&&i instanceof Touch)return!0;if(typeof PointerEvent<"u"&&i instanceof PointerEvent&&i.pointerType!=null)switch(i.pointerType){case"touch":case"pen":case 2:return!0;case"mouse":case 4:return!1;default:return!(i instanceof MouseEvent)}else if(i.type!=null&&i.type.match(/^mouse/))return!1;return!0}function uc(i,e,t){i.style[e]=t}function Ux(i,e){return i.style[e]}function ty(i,e){let t=e;for(;;){if(i===t)return!0;if(t.parentNode===null){if(t.host==null)return!1;t=t.host}else t=t.parentNode}}function iy(i,e){return i.target&&ty(e.root.dom,i.target)}function xa(i,e){e?i.style.pointerEvents="auto":i.style.pointerEvents="none"}function sy(i){let e=i;for(;;){if(e.parentNode===null)return e.host!=null?e:null;e=e.parentNode}}let hc;function zx(i,e=""){if(i===null){if(hc==null){const t=document.createElement("style");t.type="text/css",e!=""&&t.setAttribute("nonce",e),document.head.appendChild(t),hc=t.sheet}return hc}else{const t=document.createElement("style");return t.type="text/css",e!=""&&t.setAttribute("nonce",e),i.appendChild(t),t.sheet}}function Yx(i,e){const t=i.cssRules.length;return i.insertRule(e+"{}",t),i.cssRules[t]}class _t extends fd{constructor(e,t,s,r=""){super(),Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rule",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._root=zx(e,r);try{this._rule=Yx(this._root,t),$e(s,(o,n)=>{this.setStyle(o,n)})}catch{this._rule=new CSSStyleRule}}set selector(e){this._rule.selectorText=e}get selector(){return this._rule.selectorText}_dispose(){const e=nl(this._root.cssRules,this._rule);if(e===-1)throw new Error("Could not dispose StyleRule");this._root.deleteRule(e)}_setVendorPrefixName(e,t){const s=this._rule.style;s.setProperty("-webkit-"+e,t,""),s.setProperty("-moz-"+e,t,""),s.setProperty("-ms-"+e,t,""),s.setProperty("-o-"+e,t,""),s.setProperty(e,t,"")}setStyle(e,t){e==="transition"?this._setVendorPrefixName(e,t):this._rule.style.setProperty(e,t,"")}}function $x(){return/apple/i.test(navigator.vendor)&&"ontouchend"in document}function Kx(){return $x()?1:void 0}function ii(i,e){return B(i)?i:i!=null&&B(i.value)&&B(e)?e*i.value:0}function Xx(i){let e=(""+i).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0}function Tt(i,e=0,t="0"){return typeof i!="string"&&(i=i.toString()),e>i.length?Array(e-i.length+1).join(t)+i:i}function qx(i){return i.replace(/^[\s]*/,"")}function Qx(i){return i.replace(/[\s]*$/,"")}function ju(i){return qx(Qx(i))}function vg(i){return i.replace(/\/(date|number|duration)$/i,"")}function Cf(i){return i&&i.replace(/<[^>]*>/g,"")}function yf(i){return i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function wf(i,e=!1){const t=new Date(i.getFullYear(),0,0),s=i.getTime()-t.getTime()+(t.getTimezoneOffset()-i.getTimezoneOffset())*60*1e3,r=1e3*60*60*24;return Math.floor(s/r)}function mh(i,e=!1){const t=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),s=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-s);const r=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-r.getTime())/864e5+1)/7)}function Zx(i,e=!1){const t=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),s=t.getUTCDay()||7;return t.setUTCDate(t.getUTCDate()+4-s),new Date(Date.UTC(t.getUTCFullYear(),0,1)).getFullYear()}function Jx(i,e=!1){const t=mh(new Date(i.getFullYear(),i.getMonth(),1),e);let s=mh(i,e);return s==1&&(s=53),s-t+1}function eR(i,e,t=1,s=!1){let r=new Date(e,0,4,0,0,0,0);return s&&r.setUTCFullYear(e),i*7+t-((r.getDay()||7)+3)}function wu(i,e){return i>12?i-=12:i===0&&(i=12),e!=null?i+(e-1):i}function bu(i,e=!1,t=!1,s=!1){if(s)return e?"Coordinated Universal Time":"UTC";let r=i.toLocaleString("UTC"),o=i.toLocaleString("UTC",{timeZoneName:e?"long":"short"}).substr(r.length);return t===!1&&(o=o.replace(/ (standard|daylight|summer|winter) /i," ")),o}function tR(i){const e=new Date(Date.UTC(2012,0,1,0,0,0,0)),t=new Date(e.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(e.toLocaleString("en-US",{timeZone:i})).getTime()-t.getTime())/6e4*-1}function bf(i){return i.charAt(0).toUpperCase()+i.slice(1)}function ry(i){let e,t,s,r=i.h,o=i.s,n=i.l;if(o==0)e=t=s=n;else{let a=function(d,c,p){return p<0&&(p+=1),p>1&&(p-=1),p<.16666666666666666?d+(c-d)*6*p:p<.5?c:p<.6666666666666666?d+(c-d)*(.6666666666666666-p)*6:d},l=n<.5?n*(1+o):n+o-n*o,u=2*n-l;e=a(u,l,r+1/3),t=a(u,l,r),s=a(u,l,r-1/3)}return{r:Math.round(e*255),g:Math.round(t*255),b:Math.round(s*255)}}function oy(i){let e=i.r/255,t=i.g/255,s=i.b/255,r=Math.max(e,t,s),o=Math.min(e,t,s),n=0,a=0,l=(r+o)/2;if(r===o)n=a=0;else{let u=r-o;switch(a=l>.5?u/(2-r-o):u/(r+o),r){case e:n=(t-s)/u+(t<s?6:0);break;case t:n=(s-e)/u+2;break;case s:n=(e-t)/u+4;break}n/=6}return{h:n,s:a,l}}function iR(i,e){return i&&{r:Math.max(0,Math.min(255,i.r+Uu(i.r,e))),g:Math.max(0,Math.min(255,i.g+Uu(i.g,e))),b:Math.max(0,Math.min(255,i.b+Uu(i.b,e))),a:i.a}}function Uu(i,e){let t=e>0?255-i:i;return Math.round(t*e)}function sR(i,e){if(i){let t=Math.min(Math.max(i.r,i.g,i.b),230),s=Uu(t,e);return{r:Math.max(0,Math.min(255,Math.round(i.r+s))),g:Math.max(0,Math.min(255,Math.round(i.g+s))),b:Math.max(0,Math.min(255,Math.round(i.b+s))),a:i.a}}else return i}function Sf(i){return(i.r*299+i.g*587+i.b*114)/1e3>=128}function rR(i,e){if(i===void 0||e==1)return i;let t=oy(i);return t.s=e,ry(t)}function oR(i,e={r:255,g:255,b:255},t={r:255,g:255,b:255}){let s=e,r=t;return Sf(t)&&(s=t,r=e),Sf(i)?r:s}function Ct(i,e){return i||(i=[]),[...i,...e].filter((t,s,r)=>r.indexOf(t)===s)}function ny(i,e){return!(!e||i.left!=e.left||i.right!=e.right||i.top!=e.top||i.bottom!=e.bottom)}function ay(i){return i[0]==="#"&&(i=i.substr(1)),i.length==3&&(i=i[0].repeat(2)+i[1].repeat(2)+i[2].repeat(2)),parseInt(i,16)}function nR(i){i=i.replace(/[ ]/g,"");let e=i.match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);if(e)e.push("1");else if(e=i.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i),!e)return 0;let t="";for(let s=1;s<=3;s++){let r=parseInt(e[s]).toString(16);r.length==1&&(r="0"+r),t+=r}return ay(t)}function mt(i){return ge.fromAny(i)}class ge{constructor(e){Object.defineProperty(this,"_hex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hex=e|0}get hex(){return this._hex}get r(){return this._hex>>>16}get g(){return this._hex>>8&255}get b(){return this._hex&255}toCSS(e=1){return"rgba("+this.r+", "+this.g+", "+this.b+", "+e+")"}toCSSHex(){return"#"+Tt(this.r.toString(16),2)+Tt(this.g.toString(16),2)+Tt(this.b.toString(16),2)}toHSL(e=1){return oy({r:this.r,g:this.g,b:this.b})}static fromHSL(e,t,s){const r=ry({h:e,s:t,l:s});return this.fromRGB(r.r,r.g,r.b)}toString(){return this.toCSSHex()}static fromHex(e){return new ge(e)}static fromRGB(e,t,s){return new ge((s|0)+(t<<8)+(e<<16))}static fromString(e){return new ge(ay(e))}static fromCSS(e){return new ge(nR(e))}static fromAny(e){if(Pn(e)){if(e[0]=="#")return ge.fromString(e);if(e.substr(0,3)=="rgb")return ge.fromCSS(e)}else{if(B(e))return ge.fromHex(e);if(e instanceof ge)return ge.fromHex(e.hex)}throw new Error("Unknown color syntax: "+e)}static alternative(e,t,s){const r=oR({r:e.r,g:e.g,b:e.b},t?{r:t.r,g:t.g,b:t.b}:void 0,s?{r:s.r,g:s.g,b:s.b}:void 0);return this.fromRGB(r.r,r.g,r.b)}static interpolate(e,t,s,r="rgb"){if(r=="hsl"){const o=t.toHSL(),n=s.toHSL();return ge.fromHSL(gr(e,o.h,n.h),gr(e,o.s,n.s),gr(e,o.l,n.l))}else return ge.fromRGB(gr(e,t.r,s.r),gr(e,t.g,s.g),gr(e,t.b,s.b))}static lighten(e,t){const s=iR({r:e.r,g:e.g,b:e.b},t);return ge.fromRGB(s.r,s.g,s.b)}static brighten(e,t){const s=sR({r:e.r,g:e.g,b:e.b},t);return ge.fromRGB(s.r,s.g,s.b)}static saturate(e,t){const s=rR({r:e.r,g:e.g,b:e.b},t);return ge.fromRGB(s.r,s.g,s.b)}}function _f(i){return Be(this,void 0,void 0,function*(){if(i!==void 0){const e=[];$e(i,(t,s)=>{e.push(s.waitForStop())}),yield Promise.all(e)}})}function gr(i,e,t){return e+i*(t-e)}function aR(i,e,t){return i>=1?t:e}function ly(i,e,t){return new He(gr(i,e.percent,t.percent))}function lR(i,e,t){return ge.interpolate(i,e,t)}function uR(i,e){return typeof i=="number"&&typeof e=="number"?gr:i instanceof He&&e instanceof He?ly:i instanceof ge&&e instanceof ge?lR:aR}const uy=Math.PI,hy=uy/180,Fa=180/uy;function hi(i,e,t){if(!B(e)||e<=0)return Math.round(i);{let s=Math.pow(10,e);return Math.round(i*s)/s}}function hR(i,e){if(!B(e)||e<=0)return Math.ceil(i);{let t=Math.pow(10,e);return Math.ceil(i*t)/t}}function kt(i,e,t){return Math.min(Math.max(i,e),t)}function vh(i){return Math.sin(hy*i)}function Ch(i){return Math.cos(hy*i)}function dR(i){return i=i%360,i<0&&(i+=360),i}function cR(i,e,t,s,r){let o=Number.MAX_VALUE,n=Number.MAX_VALUE,a=-Number.MAX_VALUE,l=-Number.MAX_VALUE,u=[];u.push(dc(r,t)),u.push(dc(r,s));let h=Math.min(Math.floor(t/90)*90,Math.floor(s/90)*90),d=Math.max(Math.ceil(t/90)*90,Math.ceil(s/90)*90);for(let c=h;c<=d;c+=90)c>=t&&c<=s&&u.push(dc(r,c));for(let c=0;c<u.length;c++){let p=u[c];p.x<o&&(o=p.x),p.y<n&&(n=p.y),p.x>a&&(a=p.x),p.y>l&&(l=p.y)}return{left:i+o,top:e+n,right:i+a,bottom:e+l}}function dc(i,e){return{x:i*Ch(e),y:i*vh(e)}}function Ef(i){return i}function Ra(i){return i*i*i}function Su(i){return function(e){return 1-i(1-e)}}class pR{constructor(e,t){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._entity=e,this._settings=t}get(e,t){const s=this._settings[e];return s!==void 0?s:t}setRaw(e,t){this._settings[e]=t}set(e,t){this._userSettings[e]=!0,this.setRaw(e,t)}remove(e){delete this._userSettings[e],delete this._settings[e]}setAll(e){Ht(e).forEach(t=>{this.set(t,e[t])})}_eachSetting(e){$e(this._settings,e)}apply(){const e={};e.stateAnimationEasing=!0,e.stateAnimationDuration=!0;const t=this._entity.states.lookup("default");this._eachSetting((s,r)=>{e[s]||(e[s]=!0,this!==t&&(s in t._settings||(t._settings[s]=this._entity.get(s))),this._entity.set(s,r))})}applyAnimate(e){e==null&&(e=this._settings.stateAnimationDuration),e==null&&(e=this.get("stateAnimationDuration",this._entity.get("stateAnimationDuration",0)));let t=this._settings.stateAnimationEasing;t==null&&(t=this.get("stateAnimationEasing",this._entity.get("stateAnimationEasing",Ra)));const s=this._entity.states.lookup("default"),r={};r.stateAnimationEasing=!0,r.stateAnimationDuration=!0;const o={};return this._eachSetting((n,a)=>{if(!r[n]){r[n]=!0,this!=s&&(n in s._settings||(s._settings[n]=this._entity.get(n)));const l=this._entity.animate({key:n,to:a,duration:e,easing:t});l&&(o[n]=l)}}),o}}class gR{constructor(e){Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._entity=e}lookup(e){return this._states[e]}create(e,t){const s=this._states[e];if(s)return s.setAll(t),s;{const r=new pR(this._entity,t);return this._states[e]=r,r}}remove(e){delete this._states[e]}apply(e){const t=this._states[e];t&&t.apply(),this._entity._applyState(e)}applyAnimate(e,t){let s;const r=this._states[e];return r&&(s=r.applyAnimate(t)),this._entity._applyStateAnimated(e,t),s}}class fR{constructor(){Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.3.3"}),Object.defineProperty(this,"licenses",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"entitiesById",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rootElements",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}const ps=new fR;function mR(i){ps.licenses.push(i)}function Is(i,e){return i===e?0:i<e?-1:1}function dy(i,e,t){const s=i.length,r=e.length,o=Math.min(s,r);for(let n=0;n<o;++n){const a=t(i[n],e[n]);if(a!==0)return a}return Is(s,r)}function xf(i,e){return i===e?0:i<e?-1:1}class vR{constructor(e){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._entity=e}add(e,t){let s=this._callbacks[e];return s===void 0&&(s=this._callbacks[e]=[]),s.push(t),this._entity._markDirtyKey(e),new Vt(()=>{pi(s,t)&&this._entity._markDirtyKey(e)})}remove(e){const t=this._callbacks[e];t!==void 0&&(delete this._callbacks[e],t.length!==0&&this._entity._markDirtyKey(e))}enable(e){this._disabled[e]&&(delete this._disabled[e],this._entity._markDirtyKey(e))}disable(e){this._disabled[e]||(this._disabled[e]=!0,this._entity._markDirtyKey(e))}fold(e,t){if(!this._disabled[e]){const s=this._callbacks[e];if(s!==void 0)for(let r=0,o=s.length;r<o;++r)t=s[r](t,this._entity,e)}return t}}class _u{constructor(e,t,s,r,o,n,a){Object.defineProperty(this,"_animation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_from",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_to",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_duration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_easing",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_loops",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_interpolate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_oldTime",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_time",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_stopped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_playing",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new qn}),this._animation=e,this._from=t,this._to=s,this._duration=r,this._easing=o,this._loops=n,this._interpolate=uR(t,s),this._oldTime=a}get to(){return this._to}get from(){return this._from}get playing(){return this._playing}get stopped(){return this._stopped}stop(){this._stopped||(this._stopped=!0,this._playing=!1,this.events.isEnabled("stopped")&&this.events.dispatch("stopped",{type:"stopped",target:this}))}pause(){this._playing=!1,this._oldTime=null}play(){!this._stopped&&!this._playing&&(this._playing=!0,this._animation._startAnimation())}get percentage(){return this._time/this._duration}waitForStop(){return new Promise((e,t)=>{if(this._stopped)e();else{const s=()=>{r.dispose(),e()},r=this.events.on("stopped",s)}})}_checkEnded(){return this._loops>1?(--this._loops,!1):!0}_run(e){this._oldTime!==null&&(this._time+=e-this._oldTime,this._time>this._duration&&(this._time=this._duration)),this._oldTime=e}_reset(e){this._oldTime=e,this._time=0}_value(e){return this._interpolate(this._easing(e),this._from,this._to)}}let CR=0;class cy{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:++CR}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._settings=e}_checkDirty(){Ht(this._settings).forEach(e=>{this._userProperties[e]=!0,this._markDirtyKey(e)})}resetUserSettings(){this._userProperties={}}_runAnimation(e){if(this.isDisposed())return!1;{let t=!1;return $e(this._animatingSettings,(s,r)=>{if(r._stopped)this._stopAnimation(s);else if(r._playing){r._run(e);const o=r.percentage;o>=1?r._checkEnded()?this.set(s,r._value(1)):(t=!0,r._reset(e),this._set(s,r._value(1))):(t=!0,this._set(s,r._value(o)))}}),$e(this._animatingPrivateSettings,(s,r)=>{if(r._stopped)this._stopAnimationPrivate(s);else if(r._playing){r._run(e);const o=r.percentage;o>=1?r._checkEnded()?this.setPrivate(s,r._value(1)):(t=!0,r._reset(e),this._setPrivate(s,r._value(1))):(t=!0,this._setPrivate(s,r._value(o)))}}),t}}_markDirtyKey(e){this.markDirty()}_markDirtyPrivateKey(e){this.markDirty()}on(e,t){let s=this._settingEvents[e];return s===void 0&&(s=this._settingEvents[e]=[]),s.push(t),new Vt(()=>{pi(s,t),s.length===0&&delete this._settingEvents[e]})}onPrivate(e,t){let s=this._privateSettingEvents[e];return s===void 0&&(s=this._privateSettingEvents[e]=[]),s.push(t),new Vt(()=>{pi(s,t),s.length===0&&delete this._privateSettingEvents[e]})}getRaw(e,t){const s=this._settings[e];return s!==void 0?s:t}get(e,t){return this.getRaw(e,t)}_sendKeyEvent(e,t){const s=this._settingEvents[e];s!==void 0&&G(s,r=>{r(t,this,e)})}_sendPrivateKeyEvent(e,t){const s=this._privateSettingEvents[e];s!==void 0&&G(s,r=>{r(t,this,e)})}_setRaw(e,t,s){this._prevSettings[e]=t,this._sendKeyEvent(e,s)}setRaw(e,t){const s=this._settings[e];this._settings[e]=t,s!==t&&this._setRaw(e,s,t)}_set(e,t){const s=this._settings[e];this._settings[e]=t,s!==t&&(this._setRaw(e,s,t),this._markDirtyKey(e))}_stopAnimation(e){const t=this._animatingSettings[e];t&&(delete this._animatingSettings[e],t.stop())}set(e,t){return this._set(e,t),this._stopAnimation(e),t}remove(e){e in this._settings&&(this._prevSettings[e]=this._settings[e],delete this._settings[e],this._sendKeyEvent(e,void 0),this._markDirtyKey(e)),this._stopAnimation(e)}removeAll(){G(Ht(this._settings),e=>{this.remove(e)})}getPrivate(e,t){const s=this._privateSettings[e];return s!==void 0?s:t}_setPrivateRaw(e,t,s){this._prevPrivateSettings[e]=t,this._sendPrivateKeyEvent(e,s)}setPrivateRaw(e,t){const s=this._privateSettings[e];this._privateSettings[e]=t,s!==t&&this._setPrivateRaw(e,s,t)}_setPrivate(e,t){const s=this._privateSettings[e];this._privateSettings[e]=t,s!==t&&(this._setPrivateRaw(e,s,t),this._markDirtyPrivateKey(e))}_stopAnimationPrivate(e){const t=this._animatingPrivateSettings[e];t&&(t.stop(),delete this._animatingPrivateSettings[e])}setPrivate(e,t){return this._setPrivate(e,t),this._stopAnimationPrivate(e),t}removePrivate(e){e in this._privateSettings&&(this._prevPrivateSettings[e]=this._privateSettings[e],delete this._privateSettings[e],this._markDirtyPrivateKey(e)),this._stopAnimationPrivate(e)}setAll(e){$e(e,(t,s)=>{this.set(t,s)})}animate(e){const t=e.key,s=e.to,r=e.duration||0,o=e.loops||1,n=e.from===void 0?this.get(t):e.from,a=e.easing===void 0?Ef:e.easing;if(r===0)this.set(t,s);else if(n===void 0||n===s)this.set(t,s);else{this.set(t,n);const u=this._animatingSettings[t]=new _u(this,n,s,r,a,o,this._animationTime());return this._startAnimation(),u}const l=new _u(this,n,s,r,a,o,null);return l.stop(),l}animatePrivate(e){const t=e.key,s=e.to,r=e.duration||0,o=e.loops||1,n=e.from===void 0?this.getPrivate(t):e.from,a=e.easing===void 0?Ef:e.easing;if(r===0)this.setPrivate(t,s);else if(n===void 0||n===s)this.setPrivate(t,s);else{this.setPrivate(t,n);const u=this._animatingPrivateSettings[t]=new _u(this,n,s,r,a,o,this._animationTime());return this._startAnimation(),u}const l=new _u(this,n,s,r,a,o,null);return l.stop(),l}_dispose(){}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Pt extends cy{constructor(e,t,s,r=[]){if(super(t),Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_user_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new gR(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new vR(this)}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:this._createEvents()}),Object.defineProperty(this,"_userPrivateProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPrivate",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templates",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_internalTemplates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultThemes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_templateDisposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_runSetup",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposerProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),!s)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._root=e,this._internalTemplates=r,t.id&&this._registerId(t.id)}static new(e,t,s){const r=new this(e,t,!0);return r._template=s,r._afterNew(),r}static _new(e,t,s=[]){const r=new this(e,t,!0,s);return r._afterNew(),r}_afterNew(){this._checkDirty();let e=!1;const t=this._template;t&&(e=!0,t._setObjectTemplate(this)),G(this._internalTemplates,s=>{e=!0,s._setObjectTemplate(this)}),e&&this._applyTemplates(!1),this.states.create("default",{}),this._setDefaults()}_afterNewApplyThemes(){this._checkDirty();const e=this._template;e&&e._setObjectTemplate(this),G(this._internalTemplates,t=>{t._setObjectTemplate(this)}),this.states.create("default",{}),this._setDefaults(),this._applyThemes()}_createEvents(){return new qn}get classNames(){return this.constructor.classNames}get className(){return this.constructor.className}_setDefaults(){}_setDefault(e,t){e in this._settings||super.set(e,t)}_setRawDefault(e,t){e in this._settings||super.setRaw(e,t)}_clearDirty(){Ht(this._dirty).forEach(e=>{this._dirty[e]=!1}),Ht(this._dirtyPrivate).forEach(e=>{this._dirtyPrivate[e]=!1})}isDirty(e){return!!this._dirty[e]}isPrivateDirty(e){return!!this._dirtyPrivate[e]}_markDirtyKey(e){this._dirty[e]=!0,super._markDirtyKey(e)}_markDirtyPrivateKey(e){this._dirtyPrivate[e]=!0,super._markDirtyKey(e)}isType(e){return this.classNames.indexOf(e)!==-1}_pushPropertyDisposer(e,t){let s=this._disposerProperties[e];return s===void 0&&(s=this._disposerProperties[e]=[]),s.push(t),t}_disposeProperty(e){const t=this._disposerProperties[e];t!==void 0&&(G(t,s=>{s.dispose()}),delete this._disposerProperties[e])}set template(e){const t=this._template;t!==e&&(this._template=e,t&&t._removeObjectTemplate(this),e&&e._setObjectTemplate(this),this._applyTemplates())}get template(){return this._template}markDirty(){this._root._addDirtyEntity(this)}_startAnimation(){this._root._addAnimation(this)}_animationTime(){return this._root.animationTime}_applyState(e){}_applyStateAnimated(e,t){}get(e,t){const s=this.adapters.fold(e,this._settings[e]);return s!==void 0?s:t}isUserSetting(e){return this._userProperties[e]||!1}set(e,t){return this._userProperties[e]=!0,super.set(e,t)}setRaw(e,t){this._userProperties[e]=!0,super.setRaw(e,t)}_setSoft(e,t){return this._userProperties[e]?t:super.set(e,t)}remove(e){delete this._userProperties[e],this._removeTemplateProperty(e)}setPrivate(e,t){return this._userPrivateProperties[e]=!0,super.setPrivate(e,t)}setPrivateRaw(e,t){this._userPrivateProperties[e]=!0,super.setPrivateRaw(e,t)}removePrivate(e){delete this._userPrivateProperties[e],this._removeTemplatePrivateProperty(e)}_setTemplateProperty(e,t,s){if(!this._userProperties[t]){const r=this._findTemplateByKey(t);e===r&&super.set(t,s)}}_setTemplatePrivateProperty(e,t,s){if(!this._userPrivateProperties[t]){const r=this._findTemplateByPrivateKey(t);e===r&&super.setPrivate(t,s)}}_removeTemplateProperty(e){if(!this._userProperties[e]){const t=this._findTemplateByKey(e);t?super.set(e,t._settings[e]):super.remove(e)}}_removeTemplatePrivateProperty(e){if(!this._userPrivateProperties[e]){const t=this._findTemplateByPrivateKey(e);t?super.setPrivate(e,t._privateSettings[e]):super.removePrivate(e)}}_walkParents(e){e(this._root._rootContainer),e(this)}_applyStateByKey(e){const t=this.states.create(e,{}),s={};this._eachTemplate(r=>{const o=r.states.lookup(e);o&&o._apply(t,s)}),$e(t._settings,r=>{!s[r]&&!t._userSettings[r]&&t.remove(r)})}_applyTemplate(e,t){this._templateDisposers.push(e._apply(this,t)),$e(e._settings,(s,r)=>{!t.settings[s]&&!this._userProperties[s]&&(t.settings[s]=!0,super.set(s,r))}),$e(e._privateSettings,(s,r)=>{!t.privateSettings[s]&&!this._userPrivateProperties[s]&&(t.privateSettings[s]=!0,super.setPrivate(s,r))}),this._runSetup&&e.setup&&(this._runSetup=!1,e.setup(this))}_findStaticTemplate(e){if(this._template&&e(this._template))return this._template}_eachTemplate(e){this._findStaticTemplate(t=>(e(t),!1)),Aa(this._internalTemplates,e),G(this._templates,e)}_applyTemplates(e=!0){e&&this._disposeTemplates();const t={settings:{},privateSettings:{},states:{}};this._eachTemplate(s=>{this._applyTemplate(s,t)}),e&&($e(this._settings,s=>{!this._userProperties[s]&&!t.settings[s]&&super.remove(s)}),$e(this._privateSettings,s=>{!this._userPrivateProperties[s]&&!t.privateSettings[s]&&super.removePrivate(s)}))}_findTemplate(e){const t=this._findStaticTemplate(e);if(t===void 0){const s=Nx(this._internalTemplates,e);return s===void 0?QC(this._templates,e):s}else return t}_findTemplateByKey(e){return this._findTemplate(t=>e in t._settings)}_findTemplateByPrivateKey(e){return this._findTemplate(t=>e in t._privateSettings)}_disposeTemplates(){G(this._templateDisposers,e=>{e.dispose()}),this._templateDisposers.length=0}_removeTemplates(){G(this._templates,e=>{e._removeObjectTemplate(this)}),this._templates.length=0}_applyThemes(){let e=!1;const t=[];let s=[];const r=new Set,o=this.get("themeTagsSelf");return o&&G(o,n=>{r.add(n)}),this._walkParents(n=>{n===this._root._rootContainer&&(e=!0),n._defaultThemes.length>0&&t.push(n._defaultThemes);const a=n.get("themes");a&&s.push(a);const l=n.get("themeTags");l&&G(l,u=>{r.add(u)})}),s=t.concat(s),this._removeTemplates(),e&&Aa(this.classNames,n=>{const a=[];G(s,l=>{G(l,u=>{const h=u._lookupRules(n);h&&Aa(h,d=>{if(d.tags.every(p=>r.has(p))){const p=kx(a,y=>{const f=Is(d.tags.length,y.tags.length);return f===0?dy(d.tags,y.tags,Is):f});a.splice(p.index,0,d)}})})}),G(a,l=>{this._templates.push(l.template),l.template._setObjectTemplate(this)})}),this._applyTemplates(),e&&(this._runSetup=!1),e}_changed(){}_beforeChanged(){if(this.isDirty("id")){const e=this.get("id");e&&this._registerId(e);const t=this._prevSettings.id;t&&delete ps.entitiesById[t]}}_registerId(e){if(ps.entitiesById[e]&&ps.entitiesById[e]!==this)throw new Error('An entity with id "'+e+'" already exists.');ps.entitiesById[e]=this}_afterChanged(){}addDisposer(e){return this._disposers.push(e),e}_dispose(){super._dispose();const e=this._template;e&&e._removeObjectTemplate(this),G(this._internalTemplates,s=>{s._removeObjectTemplate(this)}),this._removeTemplates(),this._disposeTemplates(),this.events.dispose(),this._disposers.forEach(s=>{s.dispose()}),$e(this._disposerProperties,(s,r)=>{G(r,o=>{o.dispose()})});const t=this.get("id");t&&delete ps.entitiesById[t]}setTimeout(e,t){const s=setTimeout(()=>{this.removeDispose(r),e()},t),r=new Vt(()=>{clearTimeout(s)});return this._disposers.push(r),r}removeDispose(e){if(!this.isDisposed()){let t=nl(this._disposers,e);t>-1&&this._disposers.splice(t,1)}e.dispose()}hasTag(e){return nl(this.get("themeTags",[]),e)!==-1}addTag(e){if(!this.hasTag(e)){const t=this.get("themeTags",[]);t.push(e),this.set("themeTags",t)}}removeTag(e){if(this.hasTag(e)){const t=this.get("themeTags",[]);Yi(t,e),this.set("themeTags",t)}}_t(e,t,...s){return this._root.language.translate(e,t,...s)}get root(){return this._root}}Object.defineProperty(Pt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Entity"});Object.defineProperty(Pt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:["Entity"]});class yR{constructor(e,t,s){Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._name=e,this._template=t,this._settings=s}get(e,t){const s=this._settings[e];return s!==void 0?s:t}set(e,t){this._settings[e]=t,this._template._stateChanged(this._name)}remove(e){delete this._settings[e],this._template._stateChanged(this._name)}setAll(e){Ht(e).forEach(t=>{this._settings[t]=e[t]}),this._template._stateChanged(this._name)}_apply(e,t){$e(this._settings,(s,r)=>{!t[s]&&!e._userSettings[s]&&(t[s]=!0,e.setRaw(s,r))})}}class wR{constructor(e){Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._template=e}lookup(e){return this._states[e]}create(e,t){const s=this._states[e];if(s)return s.setAll(t),s;{const r=new yR(e,this._template,t);return this._states[e]=r,this._template._stateChanged(e),r}}remove(e){delete this._states[e],this._template._stateChanged(e)}_apply(e,t){$e(this._states,(s,r)=>{let o=t.states[s];o==null&&(o=t.states[s]={});const n=e.states.create(s,{});r._apply(n,o)})}}class bR{constructor(){Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}})}add(e,t){let s=this._callbacks[e];return s===void 0&&(s=this._callbacks[e]=[]),s.push(t),new Vt(()=>{pi(s,t),s.length===0&&delete this._callbacks[e]})}remove(e){this._callbacks[e]!==void 0&&delete this._callbacks[e]}_apply(e){const t=[];return $e(this._callbacks,(s,r)=>{G(r,o=>{t.push(e.adapters.add(s,o))})}),new di(t)}}class Wt{constructor(e,t){if(Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entities",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new wR(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new bR}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new qn}),Object.defineProperty(this,"setup",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._settings=e}static new(e){return new Wt(e,!0)}get(e,t){const s=this._settings[e];return s!==void 0?s:t}setRaw(e,t){this._settings[e]=t}set(e,t){this._settings[e]!==t&&(this.setRaw(e,t),this._entities.forEach(s=>{s._setTemplateProperty(this,e,t)}))}remove(e){e in this._settings&&(delete this._settings[e],this._entities.forEach(t=>{t._removeTemplateProperty(e)}))}removeAll(){$e(this._settings,(e,t)=>{this.remove(e)})}getPrivate(e,t){const s=this._privateSettings[e];return s!==void 0?s:t}setPrivateRaw(e,t){return this._privateSettings[e]=t,t}setPrivate(e,t){return this._privateSettings[e]!==t&&(this.setPrivateRaw(e,t),this._entities.forEach(s=>{s._setTemplatePrivateProperty(this,e,t)})),t}removePrivate(e){e in this._privateSettings&&(delete this._privateSettings[e],this._entities.forEach(t=>{t._removeTemplatePrivateProperty(e)}))}setAll(e){$e(e,(t,s)=>{this.set(t,s)})}on(e,t){let s=this._settingEvents[e];return s===void 0&&(s=this._settingEvents[e]=[]),s.push(t),new Vt(()=>{pi(s,t),s.length===0&&delete this._settingEvents[e]})}onPrivate(e,t){let s=this._privateSettingEvents[e];return s===void 0&&(s=this._privateSettingEvents[e]=[]),s.push(t),new Vt(()=>{pi(s,t),s.length===0&&delete this._privateSettingEvents[e]})}_apply(e,t){const s=[];return $e(this._settingEvents,(r,o)=>{G(o,n=>{s.push(e.on(r,n))})}),$e(this._privateSettingEvents,(r,o)=>{G(o,n=>{s.push(e.onPrivate(r,n))})}),this.states._apply(e,t),s.push(this.adapters._apply(e)),s.push(e.events.copyFrom(this.events)),new di(s)}_setObjectTemplate(e){this._entities.push(e)}_removeObjectTemplate(e){Yi(this._entities,e)}_stateChanged(e){this._entities.forEach(t=>{t._applyStateByKey(e)})}}class md extends qn{constructor(e){super(),Object.defineProperty(this,"_sprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rendererDisposers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dispatchParents",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._sprite=e}_makePointerEvent(e,t){return{type:e,originalEvent:t.event,point:t.point,simulated:t.simulated,native:t.native,target:this._sprite}}_onRenderer(e,t){this._sprite.set("interactive",!0),this._sprite._display.interactive=!0;let s=this._rendererDisposers[e];if(s===void 0){const r=this._sprite._display.on(e,o=>{t.call(this,o)});s=this._rendererDisposers[e]=new mg(()=>{delete this._rendererDisposers[e],r.dispose()})}return s.increment()}_on(e,t,s,r,o,n){const a=super._on(e,t,s,r,o,n),l=md.RENDERER_EVENTS[t];return l!==void 0&&(a.disposer=new di([a.disposer,this._onRenderer(t,l)])),a}stopParentDispatch(){this._dispatchParents=!1}dispatchParents(e,t){const s=this._dispatchParents;this._dispatchParents=!0;try{this.dispatch(e,t),this._dispatchParents&&this._sprite.parent&&this._sprite.parent.events.dispatchParents(e,t)}finally{this._dispatchParents=s}}}Object.defineProperty(md,"RENDERER_EVENTS",{enumerable:!0,configurable:!0,writable:!0,value:{click:function(i){this.isEnabled("click")&&!this._sprite.isDragging()&&this._sprite._hasDown()&&!this._sprite._hasMoved(this._makePointerEvent("click",i))&&this.dispatch("click",this._makePointerEvent("click",i))},rightclick:function(i){this.isEnabled("rightclick")&&this.dispatch("rightclick",this._makePointerEvent("rightclick",i))},middleclick:function(i){this.isEnabled("middleclick")&&this.dispatch("middleclick",this._makePointerEvent("middleclick",i))},dblclick:function(i){this.dispatchParents("dblclick",this._makePointerEvent("dblclick",i))},pointerover:function(i){this.isEnabled("pointerover")&&this.dispatch("pointerover",this._makePointerEvent("pointerover",i))},pointerout:function(i){this.isEnabled("pointerout")&&this.dispatch("pointerout",this._makePointerEvent("pointerout",i))},pointerdown:function(i){this.dispatchParents("pointerdown",this._makePointerEvent("pointerdown",i))},pointerup:function(i){this.isEnabled("pointerup")&&this.dispatch("pointerup",this._makePointerEvent("pointerup",i))},globalpointerup:function(i){this.isEnabled("globalpointerup")&&this.dispatch("globalpointerup",this._makePointerEvent("globalpointerup",i))},globalpointermove:function(i){this.isEnabled("globalpointermove")&&this.dispatch("globalpointermove",this._makePointerEvent("globalpointermove",i))},wheel:function(i){this.dispatchParents("wheel",{type:"wheel",target:this._sprite,originalEvent:i.event,point:i.point})}}});class Ss extends Pt{constructor(){super(...arguments),Object.defineProperty(this,"_adjustedLocalBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templateField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_sizeDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dragEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isShowing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isHiding",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_downPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downPoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_toggleDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_hoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipMoveDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipPointerDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_statesHandled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this.setPrivateRaw("visible",!0),super._afterNew()}_markDirtyKey(e){super._markDirtyKey(e),(e=="x"||e=="y"||e=="dx"||e=="dy")&&(this.markDirtyBounds(),this._addPercentagePositionChildren(),this.markDirtyPosition())}_markDirtyPrivateKey(e){super._markDirtyPrivateKey(e),(e=="x"||e=="y")&&this.markDirtyPosition()}_removeTemplateField(){this._templateField&&this._templateField._removeObjectTemplate(this)}_createEvents(){return new md(this)}_processTemplateField(){let e;const t=this.get("templateField");if(t){const s=this.dataItem;if(s){const r=s.dataContext;r&&(e=r[t],!(e instanceof Wt)&&e&&(e=Wt.new(e)))}}this._templateField!==e&&(this._removeTemplateField(),this._templateField=e,e&&e._setObjectTemplate(this),this._applyTemplates())}_setDataItem(e){const t=this._dataItem;this._dataItem=e,this._processTemplateField();const s="dataitemchanged";e!=t&&this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this,oldDataItem:t,newDataItem:e})}set dataItem(e){this._setDataItem(e)}get dataItem(){if(this._dataItem)return this._dataItem;{let e=this._parent;for(;e;){if(e._dataItem)return e._dataItem;e=e._parent}}}_addPercentageSizeChildren(){let e=this.parent;e&&(this.get("width")instanceof He||this.get("height")instanceof He?al(e._percentageSizeChildren,this):pi(e._percentageSizeChildren,this))}_addPercentagePositionChildren(){let e=this.parent;e&&(this.get("x")instanceof He||this.get("y")instanceof He?al(e._percentagePositionChildren,this):pi(e._percentagePositionChildren,this))}markDirtyPosition(){this._root._addDirtyPosition(this)}updatePivotPoint(){const e=this._localBounds;if(e){const t=this.get("centerX");t!=null&&(this._display.pivot.x=e.left+ii(t,e.right-e.left));const s=this.get("centerY");s!=null&&(this._display.pivot.y=e.top+ii(s,e.bottom-e.top))}}_beforeChanged(){if(super._beforeChanged(),this._handleStates(),this.isDirty("tooltip")){const e=this._prevSettings.tooltip;e&&e.dispose()}if((this.isDirty("layer")||this.isDirty("layerMargin"))&&(this._display.setLayer(this.get("layer"),this.get("layerMargin")),this.markDirtyLayer()),this.isDirty("tooltipPosition")){const e=this._tooltipMoveDp;e&&(e.dispose(),this._tooltipMoveDp=void 0);const t=this._tooltipPointerDp;t&&(t.dispose(),this._tooltipPointerDp=void 0),this.get("tooltipPosition")=="pointer"&&(this._tooltipPointerDp=new di([this.events.on("pointerover",()=>{this._tooltipMoveDp=this.events.on("globalpointermove",s=>{this.showTooltip(s.point)})}),this.events.on("pointerout",()=>{const s=this._tooltipMoveDp;s&&(s.dispose(),this._tooltipMoveDp=void 0)})]))}}_handleStates(){this._statesHandled||(this.isDirty("active")&&(this.get("active")?(this.states.applyAnimate("active"),this.set("ariaChecked",!0)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!1)),this.markDirtyAccessibility()),this.isDirty("disabled")&&(this.get("disabled")?(this.states.applyAnimate("disabled"),this.set("ariaChecked",!1)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!0)),this.markDirtyAccessibility()),this._statesHandled=!0)}_changed(){super._changed();const e=this._display,t=this.events;if(this.isDirty("draggable")){const s=this.get("draggable");s?(this.set("interactive",!0),this._dragDp=new di([t.on("pointerdown",r=>{this.dragStart(r)}),t.on("globalpointermove",r=>{this.dragMove(r)}),t.on("globalpointerup",r=>{this.dragStop(r)})])):this._dragDp&&(this._dragDp.dispose(),this._dragDp=void 0),e.cancelTouch=!!s}if(this.isDirty("tooltipText")||this.isDirty("tooltipHTML")||this.isDirty("showTooltipOn")){const s=this.get("tooltipText"),r=this.get("tooltipHTML"),o=this.get("showTooltipOn","hover");this._tooltipDp&&(this._tooltipDp.dispose(),this._tooltipDp=void 0),(s||r)&&(o=="click"?this._tooltipDp=new di([t.on("click",()=>{this.setTimeout(()=>this.showTooltip(),10)}),tt(document,"click",n=>{this.hideTooltip()})]):o=="always"||(this._tooltipDp=new di([t.on("pointerover",()=>{this.showTooltip()}),t.on("pointerout",()=>{this.hideTooltip()})])))}if(this.isDirty("toggleKey")){let s=this.get("toggleKey");s&&s!="none"?this._toggleDp=t.on("click",()=>{this._isDragging||this.set(s,!this.get(s))}):this._toggleDp&&(this._toggleDp.dispose(),this._toggleDp=void 0)}if(this.isDirty("opacity")&&(e.alpha=Math.max(0,this.get("opacity",1))),this.isDirty("rotation")&&(this.markDirtyBounds(),e.angle=this.get("rotation",0)),this.isDirty("scale")&&(this.markDirtyBounds(),e.scale=this.get("scale",0)),(this.isDirty("centerX")||this.isDirty("centerY"))&&(this.markDirtyBounds(),this.updatePivotPoint()),(this.isDirty("visible")||this.isPrivateDirty("visible")||this.isDirty("forceHidden"))&&(!this.get("visible")||!this.getPrivate("visible")||this.get("forceHidden")?(e.visible=!1,this.hideTooltip()):e.visible=!0,this.markDirtyBounds(),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("width")||this.isDirty("height")){this.markDirtyBounds(),this._addPercentageSizeChildren();const s=this.parent;s&&(this.isDirty("width")&&this.get("width")instanceof He||this.isDirty("height")&&this.get("height")instanceof He)&&(s.markDirty(),s._prevWidth=0),this._sizeDirty=!0}if((this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("minWidth")||this.isDirty("minHeight")||this.isPrivateDirty("maxWidth")||this.isPrivateDirty("maxHeight")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&(this.markDirtyBounds(),this._sizeDirty=!0),this._sizeDirty&&this._updateSize(),this.isDirty("wheelable")){const s=this.get("wheelable");s&&this.set("interactive",!0),e.wheelable=!!s}if((this.isDirty("tabindexOrder")||this.isDirty("focusableGroup"))&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this)),this.isDirty("filter")&&(e.filter=this.get("filter")),this.isDirty("cursorOverStyle")&&(e.cursorOverStyle=this.get("cursorOverStyle")),this.isDirty("hoverOnFocus")&&(this.get("hoverOnFocus")?this._focusDp=new di([t.on("focus",()=>{this.showTooltip()}),t.on("blur",()=>{this.hideTooltip()})]):this._focusDp&&(this._focusDp.dispose(),this._focusDp=void 0)),this.isDirty("focusable")&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this),this.markDirtyAccessibility()),(this.isDirty("role")||this.isDirty("ariaLive")||this.isDirty("ariaChecked")||this.isDirty("ariaHidden")||this.isDirty("ariaOrientation")||this.isDirty("ariaValueNow")||this.isDirty("ariaValueMin")||this.isDirty("ariaValueMax")||this.isDirty("ariaValueText")||this.isDirty("ariaLabel")||this.isDirty("ariaControls"))&&this.markDirtyAccessibility(),this.isDirty("exportable")&&(e.exportable=this.get("exportable")),this.isDirty("interactive")){const s=this.events;this.get("interactive")?this._hoverDp=new di([s.on("click",r=>{rp(r.originalEvent)&&(this.getPrivate("touchHovering")||this.setTimeout(()=>{this._handleOver(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.showTooltip(),this.setPrivateRaw("touchHovering",!0),this.events.dispatch("pointerover",{type:"pointerover",target:r.target,originalEvent:r.originalEvent,point:r.point,simulated:r.simulated})},10))}),s.on("globalpointerup",r=>{rp(r.originalEvent)&&(this.getPrivate("touchHovering")&&(this._handleOut(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.hideTooltip()),this.setPrivateRaw("touchHovering",!1),this.events.dispatch("pointerout",{type:"pointerout",target:r.target,originalEvent:r.originalEvent,point:r.point,simulated:r.simulated})),this._isDown&&this._handleUp(r)}),s.on("pointerover",()=>{this._handleOver()}),s.on("pointerout",()=>{this._handleOut()}),s.on("pointerdown",r=>{this._handleDown(r)})]):(this._display.interactive=!1,this._hoverDp&&(this._hoverDp.dispose(),this._hoverDp=void 0))}this.isDirty("forceInactive")&&(this._display.inactive=this.get("forceInactive",!1)),this.get("showTooltipOn")=="always"&&this._display.visible&&this.showTooltip()}dragStart(e){this._dragEvent=e,this.events.stopParentDispatch()}dragStop(e){if(this._dragEvent=void 0,this._dragPoint=void 0,this.events.stopParentDispatch(),this._isDragging){this._isDragging=!1;const t="dragstop";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}}_handleOver(){this.isHidden()||(this.get("active")&&this.states.lookup("hoverActive")?this.states.applyAnimate("hoverActive"):this.get("disabled")&&this.states.lookup("hoverDisabled")?this.states.applyAnimate("hoverDisabled"):this.states.applyAnimate("hover"))}_handleOut(){this.isHidden()||(this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):(this.states.lookup("hover")||this.states.lookup("hoverActive"))&&this.states.applyAnimate("default"))}_handleUp(e){if(!this.isHidden()){this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):this.states.lookup("down")&&(this.isHover()?this.states.applyAnimate("hover"):this.states.applyAnimate("default")),this._downPoint=void 0;const t=lc(e.originalEvent);delete this._downPoints[t],Ht(this._downPoints).length==0&&(this._isDown=!1)}}_hasMoved(e){const t=lc(e.originalEvent),s=this._downPoints[t];if(s){const r=Math.abs(s.x-e.point.x),o=Math.abs(s.y-e.point.y);return r>5||o>5}return!1}_hasDown(){return Ht(this._downPoints).length>0}_handleDown(e){const t=this.parent;if(t&&!this.get("draggable")&&t._handleDown(e),this.get("interactive")&&!this.isHidden()){this.states.lookup("down")&&this.states.applyAnimate("down"),this._downPoint={x:e.point.x,y:e.point.y},this._isDown=!0;const s=lc(e.originalEvent);this._downPoints[s]={x:e.point.x,y:e.point.y}}}dragMove(e){let t=this._dragEvent;if(t){if(t.simulated&&!e.simulated)return!0;let s=0,r=this.parent;for(;r!=null;)s+=r.get("rotation",0),r=r.parent;let o=e.point.x-t.point.x,n=e.point.y-t.point.y;const a=this.events;if(t.simulated&&!this._isDragging){this._isDragging=!0,this._dragEvent=e,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";a.isEnabled(l)&&a.dispatch(l,{type:l,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}if(this._isDragging){let l=this._dragPoint;this.set("x",l.x+o*Ch(s)+n*vh(s)),this.set("y",l.y+n*Ch(s)-o*vh(s));const u="dragged";a.isEnabled(u)&&a.dispatch(u,{type:u,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}else if(Math.hypot(o,n)>5){this._isDragging=!0,this._dragEvent=e,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";a.isEnabled(l)&&a.dispatch(l,{type:l,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}}}_updateSize(){}_getBounds(){this._localBounds=this._display.getLocalBounds()}depth(){let e=this.parent,t=0;for(;;)if(e)++t,e=e.parent;else return t}markDirtySize(){this._sizeDirty=!0,this.markDirty()}markDirtyBounds(){const e=this._display;if(this.get("isMeasured")){this._root._addDirtyBounds(this),e.isMeasured=!0,e.invalidateBounds();const t=this.parent;t&&this.get("position")!="absolute"&&(t.get("width")==null||t.get("height")==null||t.get("layout"))&&t.markDirtyBounds(),this.get("focusable")&&this.isFocus()&&this.markDirtyAccessibility()}}markDirtyAccessibility(){this._root._invalidateAccessibility(this)}markDirtyLayer(){this._display.markDirtyLayer(!0)}markDirty(){super.markDirty(),this.markDirtyLayer()}_updateBounds(){const e=this._adjustedLocalBounds;let t;if(!this.get("visible")||!this.getPrivate("visible")||this.get("forceHidden")?(t={left:0,right:0,top:0,bottom:0},this._localBounds=t,this._adjustedLocalBounds=t):(this._getBounds(),this._fixMinBounds(this._localBounds),this.updatePivotPoint(),this._adjustedLocalBounds=this._display.getAdjustedBounds(this._localBounds),t=this._adjustedLocalBounds),!e||e.left!==t.left||e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom){const s="boundschanged";this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this}),this.parent&&(this.parent.markDirty(),this.parent.markDirtyBounds())}}_fixMinBounds(e){let t=this.get("minWidth",this.getPrivate("minWidth")),s=this.get("minHeight",this.getPrivate("minHeight"));B(t)&&e.right-e.left<t&&(e.right=e.left+t),B(s)&&e.bottom-e.top<s&&(e.bottom=e.top+s);let r=this.getPrivate("width"),o=this.getPrivate("height");B(r)&&(e.right=e.left+r),B(o)&&(e.bottom=e.top+o)}_removeParent(e){e&&(e.children.removeValue(this),pi(e._percentageSizeChildren,this),pi(e._percentagePositionChildren,this))}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._statesHandled=!1}hover(){this.showTooltip(),this._handleOver()}unhover(){this.hideTooltip(),this._handleOut()}showTooltip(e){const t=this.getTooltip(),s=this.get("tooltipText"),r=this.get("tooltipHTML");if((s||r)&&t){const o=this.get("tooltipPosition"),n=this.getPrivate("tooltipTarget",this);(o=="fixed"||!e)&&(this._display._setMatrix(),e=this.toGlobal(n._getTooltipPoint())),t.set("pointTo",e),t.set("tooltipTarget",n),t.get("x")||t.set("x",e.x),t.get("y")||t.set("y",e.y),s&&t.label.set("text",s),r&&t.label.set("html",r);const a=this.dataItem;if(a&&t.label._setDataItem(a),this.get("showTooltipOn")=="always"&&(e.x<0||e.x>this._root.width()||e.y<0||e.y>this._root.height())){this.hideTooltip();return}t.label.text.markDirtyText();const l=t.show();return this.setPrivateRaw("showingTooltip",!0),l}}hideTooltip(){const e=this.getTooltip();if(e&&e.get("tooltipTarget")==this.getPrivate("tooltipTarget",this)){let t=e.get("keepTargetHover")&&e.get("stateAnimationDuration",0)==0?400:void 0;const s=e.hide(t);return this.setPrivateRaw("showingTooltip",!1),s}}_getTooltipPoint(){const e=this._localBounds;if(e){let t=0,s=0;return this.get("isMeasured")?(t=e.left+ii(this.get("tooltipX",0),e.right-e.left),s=e.top+ii(this.get("tooltipY",0),e.bottom-e.top)):(t=ii(this.get("tooltipX",0),this.width()),s=ii(this.get("tooltipY",0),this.height())),{x:t,y:s}}return{x:0,y:0}}getTooltip(){let e=this.get("tooltip");if(e)return e;{let t=this.parent;if(t)return t.getTooltip()}}_updatePosition(){const e=this.parent;let t=this.get("dx",0),s=this.get("dy",0),r=this.get("x"),o=this.getPrivate("x"),n=0,a=0;const l=this.get("position");r instanceof He&&(e?r=e.innerWidth()*r.value+e.get("paddingLeft",0):r=0),B(r)?n=r+t:o!=null?n=o:e&&l=="relative"&&(n=e.get("paddingLeft",0)+t);let u=this.get("y"),h=this.getPrivate("y");u instanceof He&&(e?u=e.innerHeight()*u.value+e.get("paddingTop",0):u=0),B(u)?a=u+s:h!=null?a=h:e&&l=="relative"&&(a=e.get("paddingTop",0)+s);const d=this._display;if(d.x!=n||d.y!=a){d.invalidateBounds(),d.x=n,d.y=a;const c="positionchanged";this.events.isEnabled(c)&&this.events.dispatch(c,{type:c,target:this})}this.getPrivate("showingTooltip")&&this.showTooltip()}x(){let e=this.get("x"),t=this.getPrivate("x");const s=this.parent;return s?e instanceof He?ii(e,s.innerWidth())+s.get("paddingLeft",0):B(e)?e:t??s.get("paddingLeft",this._display.x):this._display.x}y(){let e=this.getPrivate("y");if(e!=null)return e;let t=this.get("y");const s=this.parent;return s?t instanceof He?ii(t,s.innerHeight())+s.get("paddingTop",0):B(t)?t:e??s.get("paddingTop",this._display.y):this._display.y}_dispose(){super._dispose(),this._display.dispose(),this._removeTemplateField(),this._removeParent(this.parent),this._root._removeFocusElement(this);const e=this.get("tooltip");e&&e.dispose(),this.markDirty()}adjustedLocalBounds(){return this._fixMinBounds(this._adjustedLocalBounds),this._adjustedLocalBounds}localBounds(){return this._localBounds}bounds(){const e=this._adjustedLocalBounds,t=this.x(),s=this.y();return{left:e.left+t,right:e.right+t,top:e.top+s,bottom:e.bottom+s}}globalBounds(){const e=this.localBounds(),t=this.toGlobal({x:e.left,y:e.top}),s=this.toGlobal({x:e.right,y:e.top}),r=this.toGlobal({x:e.right,y:e.bottom}),o=this.toGlobal({x:e.left,y:e.bottom});return{left:Math.min(t.x,s.x,r.x,o.x),top:Math.min(t.y,s.y,r.y,o.y),right:Math.max(t.x,s.x,r.x,o.x),bottom:Math.max(t.y,s.y,r.y,o.y)}}_onShow(e){}_onHide(e){}appear(e,t){return Be(this,void 0,void 0,function*(){return yield this.hide(0),t?new Promise((s,r)=>{this.setTimeout(()=>{s(this.show(e))},t)}):this.show(e)})}show(e){return Be(this,void 0,void 0,function*(){if(!this._isShowing){this._isHidden=!1,this._isShowing=!0,this._isHiding=!1,this.states.lookup("default").get("visible")&&this.set("visible",!0),this._onShow(e);const t=this.states.applyAnimate("default",e);yield _f(t),this._isShowing=!1}})}hide(e){return Be(this,void 0,void 0,function*(){if(!this._isHiding&&!this._isHidden){this._isHiding=!0,this._isShowing=!1;let t=this.states.lookup("hidden");t||(t=this.states.create("hidden",{opacity:0,visible:!1})),this._isHidden=!0,this._onHide(e);const s=this.states.applyAnimate("hidden",e);yield _f(s),this._isHiding=!1}})}isHidden(){return this._isHidden}isShowing(){return this._isShowing}isHiding(){return this._isHiding}isHover(){return this._display.hovering()}isFocus(){return this._root.focused(this)}isDragging(){return this._isDragging}isVisible(){return!!(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden"))}isVisibleDeep(){return this._parent?this._parent.isVisibleDeep()&&this.isVisible():this.isVisible()}compositeOpacity(){const e=this.get("opacity",1);return this._parent?this._parent.compositeOpacity()*e:e}width(){let e=this.get("width"),t=this.get("maxWidth",this.getPrivate("maxWidth")),s=this.get("minWidth",this.getPrivate("minWidth")),r=this.getPrivate("width"),o=0;if(B(r))o=r;else if(e==null)this._adjustedLocalBounds&&(o=this._adjustedLocalBounds.right-this._adjustedLocalBounds.left);else if(e instanceof He){const n=this.parent;n?o=n.innerWidth()*e.value:o=this._root.width()*e.value}else B(e)&&(o=e);return B(s)&&(o=Math.max(s,o)),B(t)&&(o=Math.min(t,o)),o}maxWidth(){let e=this.get("maxWidth",this.getPrivate("maxWidth"));if(B(e))return e;{let s=this.get("width");if(B(s))return s}const t=this.parent;return t?t.innerWidth():this._root.width()}maxHeight(){let e=this.get("maxHeight",this.getPrivate("maxHeight"));if(B(e))return e;{let s=this.get("height");if(B(s))return s}const t=this.parent;return t?t.innerHeight():this._root.height()}height(){let e=this.get("height"),t=this.get("maxHeight",this.getPrivate("maxHeight")),s=this.get("minHeight",this.getPrivate("minHeight")),r=this.getPrivate("height"),o=0;if(B(r))o=r;else if(e==null)this._adjustedLocalBounds&&(o=this._adjustedLocalBounds.bottom-this._adjustedLocalBounds.top);else if(e instanceof He){const n=this.parent;n?o=n.innerHeight()*e.value:o=this._root.height()*e.value}else B(e)&&(o=e);return B(s)&&(o=Math.max(s,o)),B(t)&&(o=Math.min(t,o)),o}_findStaticTemplate(e){return this._templateField&&e(this._templateField)?this._templateField:super._findStaticTemplate(e)}_walkParents(e){this._parent&&this._walkParent(e)}_walkParent(e){this._parent&&this._parent._walkParent(e),e(this)}get parent(){return this._parent}_setParent(e,t=!1){const s=this._parent;e!==s&&(this.markDirtyBounds(),e.markDirty(),this._parent=e,t&&(this._removeParent(s),e&&(this._addPercentageSizeChildren(),this._addPercentagePositionChildren())),this.markDirtyPosition(),this._applyThemes())}getNumberFormatter(){return this.get("numberFormatter",this._root.numberFormatter)}getDateFormatter(){return this.get("dateFormatter",this._root.dateFormatter)}getDurationFormatter(){return this.get("durationFormatter",this._root.durationFormatter)}toGlobal(e){return this._display.toGlobal(e)}toLocal(e){return this._display.toLocal(e)}_getDownPoint(){const e=this._getDownPointId();if(e)return this._downPoints[e]}_getDownPointId(){if(this._downPoints)return ZC(this._downPoints,(e,t)=>e>t?1:e<t?-1:0)[0]}toFront(){const e=this.parent;e&&e.children.moveValue(this,e.children.length-1)}toBack(){const e=this.parent;e&&e.children.moveValue(this,0)}}Object.defineProperty(Ss,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Sprite"});Object.defineProperty(Ss,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Pt.classNames.concat([Ss.className])});class ul extends Pt{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_backgroundDisplay",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pattern",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){super._afterNewApplyThemes()}get pattern(){return this._pattern}_draw(){}_beforeChanged(){super._beforeChanged(),(this.isDirty("repetition")||this.isDirty("width")||this.isDirty("height")||this.isDirty("rotation")||this.isDirty("color")||this.isDirty("strokeWidth")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("colorOpacity")||this.isDirty("fill")||this.isDirty("fillOpacity"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){const e=this.get("repetition",""),t=this.get("width",100),s=this.get("height",100),r=this.get("fill"),o=this.get("fillOpacity",1);this._display.clear(),this._backgroundDisplay.clear(),r&&o>0&&(this._backgroundDisplay.beginFill(r,o),this._backgroundDisplay.drawRect(0,0,t,s),this._backgroundDisplay.endFill()),this._display.angle=this.get("rotation",0),this._draw(),this._pattern=this._root._renderer.createPattern(this._display,this._backgroundDisplay,e,t,s)}}}Object.defineProperty(ul,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Pattern"});Object.defineProperty(ul,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Pt.classNames.concat([ul.className])});class hl extends ul{constructor(){super(...arguments),Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_beforeChanged(){super._beforeChanged(),this._clear=!0,this.isDirty("src")&&this._load()}_draw(){super._draw();const e=this._image;if(e){const t=this.get("width",100),s=this.get("height",100),r=this.get("fit","image");let o=0,n=0;r=="pattern"?(o=t,n=s):(o=e.width,n=e.height,r=="image"&&(this.set("width",o),this.set("height",n)));const a=this.get("centered",!0);let l=0,u=0;a&&(l=t/2-o/2,u=s/2-n/2),this._display.image(e,o,n,l,u)}}_load(){const e=this.get("src");if(e){const t=new Image;t.src=e,t.decode().then(()=>{this._image=t,this._draw(),this.events.isEnabled("loaded")&&this.events.dispatch("loaded",{type:"loaded",target:this})}).catch(s=>{})}}}Object.defineProperty(hl,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PicturePattern"});Object.defineProperty(hl,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:ul.classNames.concat([hl.className])});var yh;(function(i){i.ADD="lighter",i.COLOR="color",i.COLOR_BURN="color-burn",i.COLOR_DODGE="color-dodge",i.DARKEN="darken",i.DIFFERENCE="difference",i.DST_OVER="destination-over",i.EXCLUSION="exclusion",i.HARD_LIGHT="hard-light",i.HUE="hue",i.LIGHTEN="lighten",i.LUMINOSITY="luminosity",i.MULTIPLY="multiply",i.NORMAL="source-over",i.OVERLAY="overlay",i.SATURATION="saturation",i.SCREEN="screen",i.SOFT_LIGHT="soft-light",i.SRC_ATOP="source-atop",i.XOR="xor"})(yh||(yh={}));const SR=["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","fillPattern","strokePattern","fillGradient","strokeGradient","strokeDasharray","strokeDashoffset"];class it extends Ss{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_beforeChanged(){if(super._beforeChanged(),(this.isDirty("draw")||this.isDirty("svgPath"))&&this.markDirtyBounds(),(this.isDirty("fill")||this.isDirty("stroke")||this.isDirty("visible")||this.isDirty("forceHidden")||this.isDirty("scale")||this.isDirty("fillGradient")||this.isDirty("strokeGradient")||this.isDirty("fillPattern")||this.isDirty("strokePattern")||this.isDirty("fillOpacity")||this.isDirty("strokeOpacity")||this.isDirty("strokeWidth")||this.isDirty("draw")||this.isDirty("blendMode")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("svgPath")||this.isDirty("lineJoin")||this.isDirty("shadowColor")||this.isDirty("shadowBlur")||this.isDirty("shadowOffsetX")||this.isDirty("shadowOffsetY"))&&(this._clear=!0),this._display.crisp=this.get("crisp",!1),this.isDirty("fillGradient")){const e=this.get("fillGradient");if(e){this._display.isMeasured=!0;const t=e.get("target");t&&(this._disposers.push(t.events.on("boundschanged",()=>{this._markDirtyKey("fill")})),this._disposers.push(t.events.on("positionchanged",()=>{this._markDirtyKey("fill")})))}}if(this.isDirty("strokeGradient")){const e=this.get("strokeGradient");if(e){this._display.isMeasured=!0;const t=e.get("target");t&&(this._disposers.push(t.events.on("boundschanged",()=>{this._markDirtyKey("stroke")})),this._disposers.push(t.events.on("positionchanged",()=>{this._markDirtyKey("stroke")})))}}}_changed(){if(super._changed(),this._clear){this.markDirtyBounds(),this.markDirtyLayer(),this._display.clear();let e=this.get("strokeDasharray");B(e)&&(e<.5?e=[0]:e=[e]),this._display.setLineDash(e);const t=this.get("strokeDashoffset");t&&this._display.setLineDashOffset(t);const s=this.get("blendMode",yh.NORMAL);this._display.blendMode=s;const r=this.get("draw");r&&r(this._display,this);const o=this.get("svgPath");o!=null&&this._display.svgPath(o)}}_afterChanged(){if(super._afterChanged(),this._clear){const e=this.get("fill"),t=this.get("fillGradient"),s=this.get("fillPattern"),r=this.get("fillOpacity"),o=this.get("stroke"),n=this.get("strokeGradient"),a=this.get("strokePattern"),l=this.get("shadowColor"),u=this.get("shadowBlur"),h=this.get("shadowOffsetX"),d=this.get("shadowOffsetY"),c=this.get("shadowOpacity");if(l&&(u||h||d)&&this._display.shadow(l,u,h,d,c),s){let p=!1;e&&(!s.get("fill")||s.get("fillInherited"))&&(s.set("fill",e),s.set("fillInherited",!0),p=!0),o&&(!s.get("color")||s.get("colorInherited"))&&(s.set("color",o),s.set("colorInherited",!0),p=!0),p&&s._changed();const y=s.pattern;y&&(this._display.beginFill(y,r),this._display.endFill(),s instanceof hl&&s.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}else if(t){if(e){const y=t.get("stops",[]);y.length&&G(y,f=>{(!f.color||f.colorInherited)&&e&&(f.color=e,f.colorInherited=!0),(f.opacity==null||f.opacityInherited)&&(f.opacity=r,f.opacityInherited=!0)})}const p=t.getFill(this);p&&(this._display.beginFill(p,r),this._display.endFill())}else e&&(this._display.beginFill(e,r),this._display.endFill());if(o||n||a){const p=this.get("strokeOpacity");let y=this.get("strokeWidth",1);this.get("nonScalingStroke")&&(y=y/this.get("scale",1)),this.get("crisp")&&(y/=this._root._renderer.resolution);const f=this.get("lineJoin");if(a){let w=!1;o&&(!a.get("color")||a.get("colorInherited"))&&(a.set("color",o),a.set("colorInherited",!0),w=!0),w&&a._changed();const _=a.pattern;_&&(this._display.lineStyle(y,_,p,f),this._display.endStroke(),a instanceof hl&&a.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}else if(n){const w=n.get("stops",[]);w.length&&G(w,P=>{(!P.color||P.colorInherited)&&o&&(P.color=o,P.colorInherited=!0),(P.opacity==null||P.opacityInherited)&&(P.opacity=p,P.opacityInherited=!0)});const _=n.getFill(this);_&&(this._display.lineStyle(y,_,p,f),this._display.endStroke())}else o&&(this._display.lineStyle(y,o,p,f),this._display.endStroke())}}this._clear=!1}}Object.defineProperty(it,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Graphics"});Object.defineProperty(it,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ss.classNames.concat([it.className])});class Hi extends it{_beforeChanged(){super._beforeChanged(),(this.isDirty("width")||this.isDirty("height")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&!this.get("draw")&&this._draw()}_draw(){this._display.drawRect(0,0,this.width(),this.height())}_updateSize(){this.markDirty(),this._clear=!0}}Object.defineProperty(Hi,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Rectangle"});Object.defineProperty(Hi,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:it.classNames.concat([Hi.className])});function $s(i,e){i.get("reverseChildren",!1)?i.children.eachReverse(e):i.children.each(e)}class Qs extends Pt{}Object.defineProperty(Qs,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Layout"});Object.defineProperty(Qs,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Pt.classNames.concat([Qs.className])});class An extends Qs{updateContainer(e){let t=e.get("paddingLeft",0),s=e.innerWidth(),r=0;$s(e,n=>{if(n.isVisible()&&n.get("position")=="relative"){let a=n.get("width");if(a instanceof He){r+=a.value;let l=s*a.value,u=n.get("minWidth",n.getPrivate("minWidth",-1/0));u>l&&(s-=u,r-=a.value);let h=n.get("maxWidth",n.getPrivate("maxWidth",1/0));l>h&&(s-=h,r-=a.value)}else B(a)||(a=n.width()),s-=a+n.get("marginLeft",0)+n.get("marginRight",0)}}),(s<=0||s==1/0)&&(s=.1),$s(e,n=>{if(n.isVisible()&&n.get("position")=="relative"){let a=n.get("width");if(a instanceof He){let l=s*a.value/r-n.get("marginLeft",0)-n.get("marginRight",0),u=n.get("minWidth",n.getPrivate("minWidth",-1/0)),h=n.get("maxWidth",n.getPrivate("maxWidth",1/0));l=Math.min(Math.max(u,l),h),n.setPrivate("width",l)}}});let o=t;$s(e,n=>{if(n.get("position")=="relative")if(n.isVisible()){let a=n.adjustedLocalBounds(),l=n.get("marginLeft",0),u=n.get("marginRight",0),h=n.get("maxWidth"),d=a.left,c=a.right;h&&c-d>h&&(c=d+h);let p=o+l-d;n.setPrivate("x",p),o=p+c+u}else n.setPrivate("x",void 0)})}}Object.defineProperty(An,"className",{enumerable:!0,configurable:!0,writable:!0,value:"HorizontalLayout"});Object.defineProperty(An,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Qs.classNames.concat([An.className])});class Fn extends Qs{updateContainer(e){let t=e.get("paddingTop",0),s=e.innerHeight(),r=0;$s(e,n=>{if(n.isVisible()&&n.get("position")=="relative"){let a=n.get("height");if(a instanceof He){r+=a.value;let l=s*a.value,u=n.get("minHeight",n.getPrivate("minHeight",-1/0));u>l&&(s-=u,r-=a.value);let h=n.get("maxHeight",n.getPrivate("maxHeight",1/0));l>h&&(s-=h,r-=a.value)}else B(a)||(a=n.height()),s-=a+n.get("marginTop",0)+n.get("marginBottom",0)}}),(s<=0||s==1/0)&&(s=.1),$s(e,n=>{if(n.isVisible()&&n.get("position")=="relative"){let a=n.get("height");if(a instanceof He){let l=s*a.value/r-n.get("marginTop",0)-n.get("marginBottom",0),u=n.get("minHeight",n.getPrivate("minHeight",-1/0)),h=n.get("maxHeight",n.getPrivate("maxHeight",1/0));l=Math.min(Math.max(u,l),h),n.setPrivate("height",l)}}});let o=t;$s(e,n=>{if(n.get("position")=="relative")if(n.isVisible()){let a=n.adjustedLocalBounds(),l=n.get("marginTop",0),u=a.top,h=a.bottom,d=n.get("maxHeight");d&&h-u>d&&(h=u+d);let c=n.get("marginBottom",0),p=o+l-u;n.setPrivate("y",p),o=p+h+c}else n.setPrivate("y",void 0)})}}Object.defineProperty(Fn,"className",{enumerable:!0,configurable:!0,writable:!0,value:"VerticalLayout"});Object.defineProperty(Fn,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Qs.classNames.concat([Fn.className])});class bo extends Qs{_afterNew(){this._setRawDefault("maxColumns",Number.MAX_VALUE),super._afterNew()}updateContainer(e){let t=e.get("paddingLeft",0),s=e.get("paddingRight",0),r=e.get("paddingTop",0),o=e.maxWidth()-t-s,n=o,a=1;$s(e,y=>{if(y.get("visible")&&y.getPrivate("visible")&&!y.get("forceHidden")&&y.get("position")!="absolute"){let f=y.width();f<n&&(n=f),f>a&&(a=f)}}),n=kt(n,1,o),a=kt(a,1,o);let l=1;this.get("fixedWidthGrid")?l=o/a:l=o/n,l=Math.max(1,Math.floor(l)),l=Math.min(this.get("maxColumns",Number.MAX_VALUE),l);let u=this.getColumnWidths(e,l,a,o),h=r,d=0,c=0;l=u.length;let p=t;$s(e,y=>{if(y.get("position")=="relative"&&y.isVisible()){const f=y.get("marginTop",0),w=y.get("marginBottom",0);let _=y.adjustedLocalBounds(),P=y.get("marginLeft",0),T=y.get("marginRight",0),D=p+P-_.left,M=h+f-_.top;y.setPrivate("x",D),y.setPrivate("y",M),p+=u[d]+T,c=Math.max(c,y.height()+f+w),d++,d>=l&&(d=0,p=t,h+=c)}})}getColumnWidths(e,t,s,r){let o=0,n=[],a=0;return $s(e,l=>{let u=l.adjustedLocalBounds();l.get("position")!="absolute"&&l.isVisible()&&(this.get("fixedWidthGrid")?n[a]=s:n[a]=Math.max(n[a]|0,u.right-u.left+l.get("marginLeft",0)+l.get("marginRight",0)),a<e.children.length-1&&(a++,a==t&&(a=0)))}),G(n,l=>{o+=l}),o>r?t>2?(t-=1,this.getColumnWidths(e,t,s,r)):[r]:n}}Object.defineProperty(bo,"className",{enumerable:!0,configurable:!0,writable:!0,value:"GridLayout"});Object.defineProperty(bo,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Qs.classNames.concat([bo.className])});class Cs{static escape(e){return e.replace(/\[\[/g,this.prefix+"1").replace(/([^\/\]]{1})\]\]/g,"$1"+this.prefix+"2").replace(/\]\]/g,this.prefix+"2").replace(/\{\{/g,this.prefix+"3").replace(/\}\}/g,this.prefix+"4").replace(/\'\'/g,this.prefix+"5")}static unescape(e){return e.replace(new RegExp(this.prefix+"1","g"),"[[").replace(new RegExp(this.prefix+"2","g"),"]]").replace(new RegExp(this.prefix+"3","g"),"{{").replace(new RegExp(this.prefix+"4","g"),"}}").replace(new RegExp(this.prefix+"5","g"),"''")}static cleanUp(e){return e.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/\'\'/g,"'")}static chunk(e,t=!1,s=!1){let r=[];e=this.escape(e);let o=t?e.split("'"):[e];for(let n=0;n<o.length;n++){let a=o[n];if(a!=="")if(n%2===0){a=a.replace(/\]\[/g,"]"+Er+"["),a=a.replace(/\[\]/g,"[ ]");let l=a.split(/[\[\]]+/);for(let u=0;u<l.length;u++){let h=this.cleanUp(this.unescape(l[u]));h!==Er&&h!==""&&(u%2===0?r.push({type:"value",text:h}):r.push({type:s?"value":"format",text:"["+h+"]"}))}}else{let l=a.split(/[\[\]]+/);for(let u=0;u<l.length;u++){let h=this.cleanUp(this.unescape(l[u]));h!==""&&(u%2===0?r.push({type:"text",text:h}):this.isImage(h)?r.push({type:"image",text:"["+h+"]"}):r.push({type:"format",text:"["+h+"]"}))}}}return r}static isImage(e){return!!e.match(/img[ ]?:/)}static getTextStyle(e){let t={};if(e==""||e=="[ ]")return{};const s=e.match(/('[^']*')|("[^"]*")/gi);if(s)for(let o=0;o<s.length;o++)e=e.replace(s[o],s[o].replace(/['"]*/g,"").replace(/[ ]+/g,"+"));let r=e.match(/([\w\-]*:[\s]?[^;\s\]]*)|(\#[\w]{1,6})|([\w\-]+)|(\/)/gi);if(!r)return{};for(let o=0;o<r.length;o++)if(r[o].match(/^(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)$/i))t.fontWeight=r[o];else if(r[o].match(/^(underline|line-through)$/i))t.textDecoration=r[o];else if(r[o]!="/")if(!r[o].match(/:/))t.fill=ge.fromString(r[o]);else{const n=r[o].replace("+"," ").split(/:[ ]*/);t[n[0]]=n[1]}return t}}Object.defineProperty(Cs,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:"__amcharts__"});function dl(i,e){if(e!=null){e=""+e,e=Cs.escape(e);let t=e.match(/\{([^}]+)\}/g),s;if(t)for(s=0;s<t.length;s++){let r=t[s].replace(/\{([^}]+)\}/,"$1"),o=op(i,r);o==null&&(o=""),e=e.split(t[s]).join(o)}e=Cs.unescape(e)}else e="";return e}function op(i,e,t){let s;const r=i.dataItem;let o=[],n=/([^.]+)\(([^)]*)\)|([^.]+)/g,a;for(;a=n.exec(e),a!==null;)if(a[3]){o.push({prop:a[3]});const l=i.getDateFormatter().get("dateFields",[]),u=i.getNumberFormatter().get("numericFields",[]),h=i.getDurationFormatter().get("durationFields",[]);l.indexOf(a[3])!==-1?o.push({method:"formatDate",params:[]}):u.indexOf(a[3])!==-1?o.push({method:"formatNumber",params:[]}):h.indexOf(a[3])!==-1&&o.push({method:"formatDuration",params:[]})}else{let l=[];if(ju(a[2])!=""){let u=/'([^']*)'|"([^"]*)"|([0-9\-]+)/g,h;for(;h=u.exec(a[2]),h!==null;)l.push(h[1]||h[2]||h[3])}o.push({method:a[1],params:l})}if(r){s=Xr(i,o,r._settings),(s==null||Tn(s))&&(s=Xr(i,o,r));let l=r.dataContext;s==null&&l&&(s=Xr(i,o,l),s==null&&(s=Xr(i,[{prop:e}],l)),s==null&&l.dataContext&&(s=Xr(i,o,l.dataContext))),s==null&&r.component&&r.component.dataItem!==r&&(s=op(r.component,e))}return s==null&&(s=Xr(i,o,i)),s==null&&i.parent&&(s=op(i.parent,e)),s}function _R(i,e){const t=i.getPrivate("customData");if(Tn(t))return t[e]}function Xr(i,e,t,s){let r=t,o=!1;for(let n=0,a=e.length;n<a;n++){let l=e[n];if(l.prop){if(r instanceof Ss){let u=r.get(l.prop);u==null&&(u=r.getPrivate(l.prop)),u==null&&(u=_R(r,l.prop)),u==null&&(u=r[l.prop]),r=u}else if(r.get){let u=r.get(l.prop);u==null&&(u=r[l.prop]),r=u}else r=r[l.prop];if(r==null)return}else switch(l.method){case"formatNumber":let u=Ni(r);u!=null&&(r=i.getNumberFormatter().format(u,l.params[0]||void 0),o=!0);break;case"formatDate":let h=Mx(r);if(!tp(h)||bs(h.getTime()))return;h!=null&&(r=i.getDateFormatter().format(h,l.params[0]||void 0),o=!0);break;case"formatDuration":let d=Ni(r);d!=null&&(r=i.getDurationFormatter().format(d,l.params[0]||void 0,l.params[1]||void 0),o=!0);break;case"urlEncode":case"encodeURIComponent":r=encodeURIComponent(r);break;default:r[l.method]&&r[l.method].apply(t,l.params);break}}if(!o){let n=[{method:"",params:s}];B(r)?(n[0].method="formatNumber",n[0].params=""):tp(r)&&(n[0].method="formatDate",n[0].params=""),n[0].method&&(r=Xr(i,n,r))}return r}class Te extends Ss{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeContainer()}),Object.defineProperty(this,"_childrenDisplay",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeContainer()}),Object.defineProperty(this,"children",{enumerable:!0,configurable:!0,writable:!0,value:new Vx(this)}),Object.defineProperty(this,"_percentageSizeChildren",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_percentagePositionChildren",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_prevWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_prevHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_contentWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_contentHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_contentMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_vsbd0",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_vsbd1",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){super._afterNew(),this._display.addChild(this._childrenDisplay)}_dispose(){Aa(this.allChildren(),e=>{e.dispose()}),this.getPrivate("htmlElement")&&this._root._removeHTMLContent(this),super._dispose()}_changed(){if(super._changed(),this.isDirty("interactiveChildren")&&(this._display.interactiveChildren=this.get("interactiveChildren",!1)),this.isDirty("layout")&&(this._prevWidth=0,this._prevHeight=0,this.markDirtyBounds(),this._prevSettings.layout&&this.children.each(e=>{e.removePrivate("x"),e.removePrivate("y")})),(this.isDirty("paddingTop")||this.isDirty("paddingBottom")||this.isDirty("paddingLeft")||this.isDirty("paddingRight"))&&this.children.each(e=>{e.markDirtyPosition()}),this.isDirty("maskContent")){const e=this._childrenDisplay;let t=this._contentMask;this.get("maskContent")?t||(t=Hi.new(this._root,{x:-.5,y:-.5,width:this.width()+1,height:this.height()+1}),this._contentMask=t,e.addChildAt(t._display,0),e.mask=t._display):t&&(e.removeChild(t._display),e.mask=null,t.dispose(),this._contentMask=void 0)}}_updateSize(){super._updateSize(),G(this._percentageSizeChildren,e=>{e._updateSize()}),G(this._percentagePositionChildren,e=>{e.markDirtyPosition(),e._updateSize()}),this.updateBackground()}updateBackground(){const e=this.get("background");let t=this._localBounds;if(t&&!this.isHidden()){let s=t.left,r=t.top,o=t.right-s,n=t.bottom-r,a=this.get("maxWidth"),l=this.get("maxHeight");l&&n>l&&(n=l),a&&o>a&&(o=a);let u=this.width(),h=this.height();e&&(e.setAll({width:o,height:n,x:s,y:r}),this._display.interactive&&(e._display.interactive=!0));const d=this._contentMask;d&&d.setAll({width:u+1,height:h+1});const c=this.get("verticalScrollbar");if(c){c.set("height",h),c.set("x",u-c.width()-c.get("marginRight",0)),c.set("end",c.get("start",0)+h/this._contentHeight);const p=c.get("background");p&&p.setAll({width:c.width(),height:h});let y=!0;this._contentHeight<=h&&(y=!1),c.setPrivate("visible",y)}}}_applyThemes(){return super._applyThemes()?(this.eachChildren(e=>{e._applyThemes()}),!0):!1}_applyState(e){super._applyState(e),this.get("setStateOnChildren")&&this.eachChildren(t=>{t.states.apply(e)})}_applyStateAnimated(e,t){super._applyStateAnimated(e,t),this.get("setStateOnChildren")&&this.eachChildren(s=>{s.states.applyAnimate(e,t)})}innerWidth(){return this.width()-this.get("paddingRight",0)-this.get("paddingLeft",0)}innerHeight(){return this.height()-this.get("paddingTop",0)-this.get("paddingBottom",0)}_getBounds(){let e=this.get("width"),t=this.get("height"),s=this.getPrivate("width"),r=this.getPrivate("height"),o={left:0,top:0,right:this.width(),bottom:this.height()},n=this.get("layout"),a=!1,l=!1;if((n instanceof An||n instanceof bo)&&(a=!0),n instanceof Fn&&(l=!0),!((e!=null||s!=null)&&(t!=null||r!=null)&&!this.get("verticalScrollbar"))){let u=Number.MAX_VALUE,h=u,d=-u,c=u,p=-u;const y=this.get("paddingLeft",0),f=this.get("paddingTop",0),w=this.get("paddingRight",0),_=this.get("paddingBottom",0);this.children.each(P=>{if(P.get("position")!="absolute"&&P.get("isMeasured")){let T=P.adjustedLocalBounds(),D=P.x(),M=P.y(),O=D+T.left,N=D+T.right,z=M+T.top,Y=M+T.bottom;a&&(O-=P.get("marginLeft",0),N+=P.get("marginRight",0)),l&&(z-=P.get("marginTop",0),Y+=P.get("marginBottom",0)),O<h&&(h=O),N>d&&(d=N),z<c&&(c=z),Y>p&&(p=Y)}}),h==u&&(h=0),d==-u&&(d=0),c==u&&(c=0),p==-u&&(p=0),o.left=h-y,o.top=c-f,o.right=d+w,o.bottom=p+_}this._contentWidth=o.right-o.left,this._contentHeight=o.bottom-o.top,B(e)&&(o.left=0,o.right=e),B(s)&&(o.left=0,o.right=s),B(t)&&(o.top=0,o.bottom=t),B(r)&&(o.top=0,o.bottom=r),this._localBounds=o}_updateBounds(){const e=this.get("layout");e&&e.updateContainer(this),super._updateBounds(),this.updateBackground()}markDirty(){super.markDirty(),this._root._addDirtyParent(this)}_prepareChildren(){const e=this.innerWidth(),t=this.innerHeight();if(e!=this._prevWidth||t!=this._prevHeight){let s=this.get("layout"),r=!1,o=!1;s&&((s instanceof An||s instanceof bo)&&(r=!0),s instanceof Fn&&(o=!0)),G(this._percentageSizeChildren,n=>{if(!r){let a=n.get("width");a instanceof He&&n.setPrivate("width",a.value*e)}if(!o){let a=n.get("height");a instanceof He&&n.setPrivate("height",a.value*t)}}),G(this._percentagePositionChildren,n=>{n.markDirtyPosition(),n.markDirtyBounds()}),this._prevWidth=e,this._prevHeight=t,this._sizeDirty=!0,this.updateBackground()}this._handleStates()}_updateChildren(){if(this.isDirty("html")){const t=this.get("html");t&&t!==""?this._root._setHTMLContent(this,dl(this,this.get("html",""))):this._root._removeHTMLContent(this),this._root._positionHTMLElement(this)}if(this.isDirty("verticalScrollbar")){const t=this.get("verticalScrollbar");if(t){t._setParent(this),t.children.removeValue(t.startGrip),t.children.removeValue(t.endGrip),this.set("maskContent",!0),this.set("paddingRight",t.width()+t.get("marginRight",0)+t.get("marginLeft",0));let s=this.get("background");s||(s=this.set("background",Hi.new(this._root,{themeTags:["background"],fillOpacity:0,fill:this._root.interfaceColors.get("alternativeBackground")}))),this._vsbd0=this.events.on("wheel",r=>{const o=r.originalEvent;if(iy(o,this))o.preventDefault();else return;const n=o.deltaY/5e3,a=t.get("start",0),l=t.get("end",1);a+n>0&&l+n<1&&(t.set("start",a+n),t.set("end",l+n))}),this._disposers.push(this._vsbd0),this._vsbd1=t.events.on("rangechanged",()=>{let r=this._contentHeight;const o=this._childrenDisplay,n=this._contentMask;o.y=-t.get("start")*r,o.markDirtyLayer(),n&&(n._display.y=-o.y,o.mask=n._display)}),this._disposers.push(this._vsbd1),this._display.addChild(t._display)}else{const s=this._prevSettings.verticalScrollbar;if(s){this._display.removeChild(s._display),this._vsbd0&&this._vsbd0.dispose(),this._vsbd1&&this._vsbd1.dispose();const r=this._childrenDisplay;r.y=0,this.setPrivate("height",void 0),this.set("maskContent",!1),this.set("paddingRight",void 0)}}}if(this.isDirty("background")){const t=this._prevSettings.background;t&&this._display.removeChild(t._display);const s=this.get("background");s instanceof Ss&&(s.set("isMeasured",!1),s._setParent(this),this._display.addChildAt(s._display,0))}if(this.isDirty("mask")){const t=this.get("mask"),s=this._prevSettings.mask;if(s&&(this._display.removeChild(s._display),s!=t&&s.dispose()),t){var e=t.parent;e&&e.children.removeValue(t),t._setParent(this),this._display.addChildAt(t._display,0),this._childrenDisplay.mask=t._display}}}_processTemplateField(){super._processTemplateField(),this.children.each(e=>{e._processTemplateField()})}walkChildren(e){this.children.each(t=>{t instanceof Te&&t.walkChildren(e),e(t)})}eachChildren(e){const t=this.get("background");t&&e(t);const s=this.get("verticalScrollbar");s&&e(s);const r=this.get("mask");r&&e(r),this.children.values.forEach(o=>{e(o)})}allChildren(){const e=[];return this.eachChildren(t=>{e.push(t)}),e}_setDataItem(e){const t=e!==this._dataItem;super._setDataItem(e);const s=this.get("html","");s&&s!==""&&t&&this._root._setHTMLContent(this,dl(this,s))}}Object.defineProperty(Te,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Container"});Object.defineProperty(Te,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ss.classNames.concat([Te.className])});class cl extends Ss{constructor(){super(...arguments),Object.defineProperty(this,"textStyle",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeTextStyle()}),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeText("",this.textStyle)}),Object.defineProperty(this,"_textStyles",{enumerable:!0,configurable:!0,writable:!0,value:["textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale"]}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_updateBounds(){if(this.get("text"))super._updateBounds();else{let e={left:0,right:0,top:0,bottom:0};this._adjustedLocalBounds=e}}_changed(){super._changed(),this._display.clear();let e=this.textStyle;if(this.isDirty("opacity")){let t=this.get("opacity",1);this._display.alpha=t}if((this.isDirty("text")||this.isDirty("populateText"))&&(this._display.text=this._getText(),this.markDirtyBounds(),this.get("role")=="tooltip"&&this._root.updateTooltip(this)),this.isPrivateDirty("tooltipElement")&&this.getPrivate("tooltipElement")&&this._disposers.push(new Vt(()=>{this._root._removeTooltipElement(this)})),this.isDirty("width")&&(e.wordWrapWidth=this.width(),this.markDirtyBounds()),this.isDirty("oversizedBehavior")&&(e.oversizedBehavior=this.get("oversizedBehavior","none"),this.markDirtyBounds()),this.isDirty("breakWords")&&(e.breakWords=this.get("breakWords",!1),this.markDirtyBounds()),this.isDirty("ellipsis")&&(e.ellipsis=this.get("ellipsis"),this.markDirtyBounds()),this.isDirty("ignoreFormatting")&&(e.ignoreFormatting=this.get("ignoreFormatting",!1),this.markDirtyBounds()),this.isDirty("minScale")&&(e.minScale=this.get("minScale",0),this.markDirtyBounds()),this.isDirty("fill")){let t=this.get("fill");t&&(e.fill=t)}if(this.isDirty("fillOpacity")){let t=this.get("fillOpacity",1);t&&(e.fillOpacity=t)}(this.isDirty("maxWidth")||this.isPrivateDirty("maxWidth"))&&(e.maxWidth=this.get("maxWidth",this.getPrivate("maxWidth")),this.markDirtyBounds()),(this.isDirty("maxHeight")||this.isPrivateDirty("maxHeight"))&&(e.maxHeight=this.get("maxHeight",this.getPrivate("maxHeight")),this.markDirtyBounds()),G(this._textStyles,t=>{this._dirty[t]&&(e[t]=this.get(t),this.markDirtyBounds())}),e.fontSize=this.get("fontSize"),e.fontFamily=this.get("fontFamily"),this._display.style=e,this.isDirty("role")&&this.get("role")=="tooltip"&&this._root.updateTooltip(this)}_getText(){const e=this.get("text","");return this.get("populateText")?dl(this,e):e}markDirtyText(){this._display.text=this._getText(),this.get("role")=="tooltip"&&this._root.updateTooltip(this),this.markDirtyBounds(),this.markDirty()}_setDataItem(e){super._setDataItem(e),this.get("populateText")&&this.markDirtyText()}getNumberFormatter(){return this.parent?this.parent.getNumberFormatter():super.getNumberFormatter()}getDateFormatter(){return this.parent?this.parent.getDateFormatter():super.getDateFormatter()}getDurationFormatter(){return this.parent?this.parent.getDurationFormatter():super.getDurationFormatter()}}Object.defineProperty(cl,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Text"});Object.defineProperty(cl,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ss.classNames.concat([cl.className])});class ER{constructor(){Object.defineProperty(this,"_observer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._observer=new ResizeObserver(e=>{G(e,t=>{G(this._targets,s=>{s.target===t.target&&s.callback()})})})}addTarget(e,t){this._observer.observe(e,{box:"border-box"}),this._targets.push({target:e,callback:t})}removeTarget(e){this._observer.unobserve(e),gd(this._targets,t=>t.target!==e)}}class vd{constructor(){Object.defineProperty(this,"_timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]})}addTarget(e,t){if(this._timer===null){let r=null;const o=()=>{const n=Date.now();(r===null||n>r+vd.delay)&&(r=n,G(this._targets,a=>{let l=a.target.getBoundingClientRect();(l.width!==a.size.width||l.height!==a.size.height)&&(a.size=l,a.callback())})),this._targets.length===0?this._timer=null:this._timer=requestAnimationFrame(o)};this._timer=requestAnimationFrame(o)}let s={width:0,height:0,left:0,right:0,top:0,bottom:0,x:0,y:0};this._targets.push({target:e,callback:t,size:s})}removeTarget(e){gd(this._targets,t=>t.target!==e),this._targets.length===0&&this._timer!==null&&(cancelAnimationFrame(this._timer),this._timer=null)}}Object.defineProperty(vd,"delay",{enumerable:!0,configurable:!0,writable:!0,value:200});let Eu=null;function xR(){return Eu===null&&(typeof ResizeObserver<"u"?Eu=new ER:Eu=new vd),Eu}class RR{constructor(e,t){Object.defineProperty(this,"_sensor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this._sensor=xR(),this._element=e,this._listener=JC(t),this._sensor.addTarget(e,t)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element),this._listener.dispose())}get sensor(){return this._sensor}}class wh extends Pt{}Object.defineProperty(wh,"className",{enumerable:!0,configurable:!0,writable:!0,value:"InterfaceColors"});Object.defineProperty(wh,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Pt.classNames.concat([wh.className])});class xr extends Te{constructor(){super(...arguments),Object.defineProperty(this,"_text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_textKeys",{enumerable:!0,configurable:!0,writable:!0,value:["text","fill","fillOpacity","textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","populateText","role","ignoreFormatting"]})}get text(){return this._text}_afterNew(){super._afterNew(),this._makeText(),G(this._textKeys,e=>{const t=this.get(e);t!=null&&this._text.set(e,t)}),this.get("html","")!==""&&this._text.set("text",""),this.onPrivate("maxWidth",()=>{this._setMaxDimentions()}),this.onPrivate("maxHeight",()=>{this._setMaxDimentions()})}_makeText(){this._text=this.children.push(cl.new(this._root,{}))}_updateChildren(){if(super._updateChildren(),G(this._textKeys,e=>{this._text.set(e,this.get(e))}),this.isDirty("maxWidth")&&this._setMaxDimentions(),this.isDirty("maxHeight")&&this._setMaxDimentions(),this.isDirty("rotation")&&this._setMaxDimentions(),this.get("html","")!==""?this._text.set("text",""):this._text.set("text",this.get("text")),this.isDirty("textAlign")||this.isDirty("width")){const e=this.get("textAlign");let t;this.get("width")!=null?e=="right"?t=ue:e=="center"?t=xt:t=0:e=="left"||e=="start"?t=this.get("paddingLeft"):(e=="right"||e=="end")&&(t=-this.get("paddingRight")),this.text.set("x",t)}}_setMaxDimentions(){const e=this.get("rotation"),t=e==90||e==270||e==-90,s=this.get("maxWidth",this.getPrivate("maxWidth",1/0));B(s)?this.text.set(t?"maxHeight":"maxWidth",s-this.get("paddingLeft",0)-this.get("paddingRight",0)):this.text.set(t?"maxHeight":"maxWidth",void 0);const r=this.get("maxHeight",this.getPrivate("maxHeight",1/0));B(r)?this.text.set(t?"maxWidth":"maxHeight",r-this.get("paddingTop",0)-this.get("paddingBottom",0)):this.text.set(t?"maxWidth":"maxHeight",void 0)}_setDataItem(e){super._setDataItem(e),this._markDirtyKey("text"),this.text.get("populateText")&&this.text.markDirtyText()}getText(){return this._text._getText()}}Object.defineProperty(xr,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Label"});Object.defineProperty(xr,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Te.classNames.concat([xr.className])});class hn extends it{_beforeChanged(){super._beforeChanged(),(this.isDirty("pointerBaseWidth")||this.isDirty("cornerRadius")||this.isDirty("pointerLength")||this.isDirty("pointerX")||this.isDirty("pointerY")||this.isDirty("width")||this.isDirty("height"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){this.markDirtyBounds();let e=this.width(),t=this.height();if(e>0&&t>0){let s=this.get("cornerRadius",8);s=kt(s,0,Math.min(e/2,t/2));let r=this.get("pointerX",0),o=this.get("pointerY",0),n=this.get("pointerBaseWidth",15)/2,a=0,l=0,u=e,h=0,d=e,c=t,p=0,y=t,f=(r-a)*(c-l)-(o-l)*(d-a),w=(r-p)*(h-y)-(o-y)*(u-p);const _=this._display;if(_.moveTo(s,0),f>0&&w>0){let P=Math.round(kt(r,s+n,e-n-s));o=kt(o,-1/0,0),_.lineTo(P-n,0),_.lineTo(r,o),_.lineTo(P+n,0)}if(_.lineTo(e-s,0),_.arcTo(e,0,e,s,s),f>0&&w<0){let P=Math.round(kt(o,s+n,t-n-s));r=kt(r,e,1/0),_.lineTo(e,s),_.lineTo(e,Math.max(P-n,s)),_.lineTo(r,o),_.lineTo(e,P+n)}if(_.lineTo(e,t-s),_.arcTo(e,t,e-s,t,s),f<0&&w<0){let P=Math.round(kt(r,s+n,e-n-s));o=kt(o,t,1/0),_.lineTo(e-s,t),_.lineTo(P+n,t),_.lineTo(r,o),_.lineTo(P-n,t)}if(_.lineTo(s,t),_.arcTo(0,t,0,t-s,s),f<0&&w>0){let P=Math.round(kt(o,s+n,t-s-n));r=kt(r,-1/0,0),_.lineTo(0,t-s),_.lineTo(0,P+n),_.lineTo(r,o),_.lineTo(0,Math.max(P-n,s))}_.lineTo(0,s),_.arcTo(0,0,s,0,s),_.closePath()}}}}Object.defineProperty(hn,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PointedRectangle"});Object.defineProperty(hn,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:it.classNames.concat([hn.className])});class zs extends Te{constructor(e,t,s,r=[]){super(e,t,s,r),Object.defineProperty(this,"_fx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_fy",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_label",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fillDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_labelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_w",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_h",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_keepHoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this._settings.themeTags=Ct(this._settings.themeTags,["tooltip"]),super._afterNew(),this.set("background",hn.new(this._root,{themeTags:["tooltip","background"]})),this._label=this.children.push(xr.new(this._root,{})),this._disposers.push(this._label.events.on("boundschanged",()=>{this._updateBackground()})),this._disposers.push(this.on("bounds",()=>{this._updateBackground()})),this._updateTextColor(),this._root.tooltipContainer.children.push(this),this.hide(0),this._root._tooltips.push(this)}get label(){return this._label}dispose(){super.dispose(),Yi(this._root._tooltips,this)}_updateChildren(){super._updateChildren(),this.get("labelText")!=null&&this.label.set("text",this.get("labelText")),this.get("labelHTML")!=null&&this.label.set("html",this.get("labelHTML"))}_changed(){if(super._changed(),this.isDirty("pointTo")&&this._updateBackground(),this.isDirty("tooltipTarget")&&this.updateBackgroundColor(),this.isDirty("keepTargetHover"))if(this.get("keepTargetHover")){const t=this.get("background");this._keepHoverDp=new di([t.events.on("pointerover",s=>{let r=this.get("tooltipTarget");r&&(r.parent&&r.parent.getPrivate("tooltipTarget")==r&&(r=r.parent),r.hover())}),t.events.on("pointerout",s=>{let r=this.get("tooltipTarget");r&&(r.parent&&r.parent.getPrivate("tooltipTarget")==r&&(r=r.parent),r.unhover())})])}else this._keepHoverDp&&(this._keepHoverDp.dispose(),this._keepHoverDp=void 0)}_onShow(){super._onShow(),this.updateBackgroundColor()}updateBackgroundColor(){let e=this.get("tooltipTarget");const t=this.get("background");let s,r;e&&t&&(s=e.get("fill"),r=e.get("stroke"),s==null&&(s=r),this.get("getFillFromSprite")&&(this._fillDp&&this._fillDp.dispose(),s!=null&&t.set("fill",s),this._fillDp=e.on("fill",o=>{o!=null&&(t.set("fill",o),this._updateTextColor(o))}),this._disposers.push(this._fillDp)),this.get("getStrokeFromSprite")&&(this._strokeDp&&this._strokeDp.dispose(),s!=null&&t.set("stroke",s),this._strokeDp=e.on("fill",o=>{o!=null&&t.set("stroke",o)}),this._disposers.push(this._strokeDp)),this.get("getLabelFillFromSprite")&&(this._labelDp&&this._labelDp.dispose(),s!=null&&this.label.set("fill",s),this._labelDp=e.on("fill",o=>{o!=null&&this.label.set("fill",o)}),this._disposers.push(this._labelDp))),this._updateTextColor(s)}_updateTextColor(e){this.get("autoTextColor")&&(e==null&&(e=this.get("background").get("fill")),e==null&&(e=this._root.interfaceColors.get("background")),e instanceof ge&&this.label.set("fill",ge.alternative(e,this._root.interfaceColors.get("alternativeText"),this._root.interfaceColors.get("text"))))}_setDataItem(e){super._setDataItem(e),this.label._setDataItem(e)}_updateBackground(){super.updateBackground();const e=this._root.container;if(e){let t=.5,s=.5,r=this.get("centerX");r instanceof He&&(t=r.value);let o=this.get("centerY");o instanceof He&&(s=o.value);let n=e.width(),a=e.height(),l=this.parent,u=0,h=0;if(l){u=l.x(),h=l.y();const $=l.get("layerMargin");$&&(u+=$.left||0,h+=$.top||0,n+=($.left||0)+($.right||0),a+=($.top||0)+($.bottom||0))}const d=this.get("bounds",{left:-u,top:-h,right:n-u,bottom:a-h});this._updateBounds();let c=this.width(),p=this.height();c===0&&(c=this._w),p===0&&(p=this._h);let y=this.get("pointTo",{x:n/2,y:a/2}),f=y.x,w=y.y,_=this.get("pointerOrientation"),P=this.get("background"),T=0,D=0,M=0;P instanceof hn&&(T=P.get("pointerLength",0),D=P.get("strokeWidth",0)/2,M=D);let O=0,N=0,z=d.right-d.left,Y=d.bottom-d.top;_=="horizontal"||_=="left"||_=="right"?(D=0,_=="horizontal"?f>d.left+z/2?(f-=c*(1-t)+T,M*=-1):f+=c*t+T:_=="left"?f+=c*(1-t)+T:(f-=c*t+T,M*=-1)):(M=0,_=="vertical"?w>d.top+p/2+T?w-=p*(1-s)+T:(w+=p*s+T,D*=-1):_=="down"?w-=p*(1-s)+T:(w+=p*s+T,D*=-1)),f=kt(f,d.left+c*t,d.left+z-c*(1-t))+M,w=kt(w,d.top+p*s,d.top+Y-p*(1-s))-D,O=y.x-f+c*t+M,N=y.y-w+p*s-D,this._fx=f,this._fy=w;const W=this.get("animationDuration",0);if(W>0&&this.get("visible")&&this.get("opacity")>.1){const $=this.get("animationEasing");this.animate({key:"x",to:f,duration:W,easing:$}),this.animate({key:"y",to:w,duration:W,easing:$})}else this.set("x",f),this.set("y",w);P instanceof hn&&(P.set("pointerX",O),P.set("pointerY",N)),c>0&&(this._w=c),p>0&&(this._h=p)}}}Object.defineProperty(zs,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tooltip"});Object.defineProperty(zs,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Te.classNames.concat([zs.className])});class DR extends Pt{_setDefaults(){this._setDefault("negativeBase",0),this._setDefault("numberFormat","#,###.#####"),this._setDefault("smallNumberThreshold",1);const e="_big_number_suffix_",t="_small_number_suffix_",s="_byte_suffix_";this._setDefault("bigNumberPrefixes",[{number:1e3,suffix:this._t(e+"3")},{number:1e6,suffix:this._t(e+"6")},{number:1e9,suffix:this._t(e+"9")},{number:1e12,suffix:this._t(e+"12")},{number:1e15,suffix:this._t(e+"15")},{number:1e18,suffix:this._t(e+"18")},{number:1e21,suffix:this._t(e+"21")},{number:1e24,suffix:this._t(e+"24")}]),this._setDefault("smallNumberPrefixes",[{number:1e-24,suffix:this._t(t+"24")},{number:1e-21,suffix:this._t(t+"21")},{number:1e-18,suffix:this._t(t+"18")},{number:1e-15,suffix:this._t(t+"15")},{number:1e-12,suffix:this._t(t+"12")},{number:1e-9,suffix:this._t(t+"9")},{number:1e-6,suffix:this._t(t+"6")},{number:.001,suffix:this._t(t+"3")}]),this._setDefault("bytePrefixes",[{number:1,suffix:this._t(s+"B")},{number:1024,suffix:this._t(s+"KB")},{number:1048576,suffix:this._t(s+"MB")},{number:1073741824,suffix:this._t(s+"GB")},{number:1099511627776,suffix:this._t(s+"TB")},{number:0x4000000000000,suffix:this._t(s+"PB")}]),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,s){(t==null||Pn(t)&&t.toLowerCase()==="number")&&(t=this.get("numberFormat",""));let r,o=Number(e);if(Tn(t))try{return this.get("intlLocales")?new Intl.NumberFormat(this.get("intlLocales"),t).format(o):new Intl.NumberFormat(void 0,t).format(o)}catch{return"Invalid"}else{t=vg(t);let n=this.parseFormat(t,this._root.language),a;o>this.get("negativeBase")?a=n.positive:o<this.get("negativeBase")?a=n.negative:a=n.zero,s!=null&&!a.mod&&(a=mr(a),a.decimals.active=o==0?0:s),r=a.template.split(Er).join(this.applyFormat(o,a))}return r}parseFormat(e,t){const s=t.translateEmpty("_thousandSeparator"),r=t.translateEmpty("_decimalSeparator");let o={positive:{thousands:{active:-1,passive:-1,interval:-1,separator:s},decimals:{active:-1,passive:-1,separator:r},template:"",source:"",parsed:!1},negative:{thousands:{active:-1,passive:-1,interval:-1,separator:s},decimals:{active:-1,passive:-1,separator:r},template:"",source:"",parsed:!1},zero:{thousands:{active:-1,passive:-1,interval:-1,separator:s},decimals:{active:-1,passive:-1,separator:r},template:"",source:"",parsed:!1}};e=e.replace("||",on);let n=e.split("|");return o.positive.source=n[0],typeof n[2]>"u"?o.zero=o.positive:o.zero.source=n[2],typeof n[1]>"u"?o.negative=o.positive:o.negative.source=n[1],$e(o,(a,l)=>{if(l.parsed)return;let u=l.source;u.toLowerCase()==="number"&&(u=this.get("numberFormat","#,###.#####"));let h=Cs.chunk(u,!0);for(let d=0;d<h.length;d++){let c=h[d];if(c.text=c.text.replace(on,"|"),c.type==="value"){let p=c.text.match(/[#0.,]+[ ]?[abespABESP%!]?[abespABESP‰!]?/);if(p)if(p===null||p[0]==="")l.template+=c.text;else{let y=p[0].match(/[abespABESP%‰!]{2}|[abespABESP%‰]{1}$/);y&&(l.mod=y[0].toLowerCase(),l.modSpacing=!!p[0].match(/[ ]{1}[abespABESP%‰!]{1}$/));let f=p[0].split(".");if(f[0]!==""){l.thousands.active=(f[0].match(/0/g)||[]).length,l.thousands.passive=(f[0].match(/\#/g)||[]).length+l.thousands.active;let w=f[0].split(",");w.length===1||(l.thousands.interval=(w.pop()||"").length,l.thousands.interval===0&&(l.thousands.interval=-1))}typeof f[1]>"u"||(l.decimals.active=(f[1].match(/0/g)||[]).length,l.decimals.passive=(f[1].match(/\#/g)||[]).length+l.decimals.active),l.template+=c.text.split(p[0]).join(Er)}}else l.template+=c.text}l.parsed=!0}),o}applyFormat(e,t){let s=e<0;e=Math.abs(e);let r="",o="",n=t.mod?t.mod.split(""):[];if(n.indexOf("b")!==-1){let d=this.applyPrefix(e,this.get("bytePrefixes"),n.indexOf("!")!==-1);e=d[0],r=d[1],o=d[2],t.modSpacing&&(o=" "+o)}else if(n.indexOf("a")!==-1){let d=this.applyPrefix(e,e<this.get("smallNumberThreshold")?this.get("smallNumberPrefixes"):this.get("bigNumberPrefixes"),n.indexOf("!")!==-1);e=d[0],r=d[1],o=d[2],t.modSpacing&&(o=" "+o)}else if(n.indexOf("p")!==-1){let d=Math.min(e.toString().length+2,21);e=parseFloat(e.toPrecision(d)),r=this._root.language.translate("_percentPrefix"),o=this._root.language.translate("_percentSuffix"),r==""&&o==""&&(o="%")}else if(n.indexOf("%")!==-1){let d=Math.min(e.toString().length+2,21);e*=100,e=parseFloat(e.toPrecision(d)),o="%"}else if(n.indexOf("‰")!==-1){let d=Math.min(e.toString().length+3,21);e*=1e3,e=parseFloat(e.toPrecision(d)),o="‰"}if(n.indexOf("e")!==-1){let d;t.decimals.passive>=0?d=e.toExponential(t.decimals.passive).split("e"):d=e.toExponential().split("e"),e=Number(d[0]),o="e"+d[1],t.modSpacing&&(o=" "+o)}else if(t.decimals.passive===0)e=Math.round(e);else if(t.decimals.passive>0){let d=Math.pow(10,t.decimals.passive);e=Math.round(e*d)/d}let a="",l=Lx(e).split("."),u=l[0];if(u.length<t.thousands.active&&(u=Array(t.thousands.active-u.length+1).join("0")+u),t.thousands.interval>0){let d=[],c=u.split("").reverse().join("");for(let p=0,y=u.length;p<=y;p+=t.thousands.interval){let f=c.substr(p,t.thousands.interval).split("").reverse().join("");f!==""&&d.unshift(f)}u=d.join(t.thousands.separator)}a+=u,l.length===1&&l.push("");let h=l[1];return h.length<t.decimals.active&&(h+=Array(t.decimals.active-h.length+1).join("0")),h!==""&&(a+=t.decimals.separator+h),a===""&&(a="0"),e!==0&&s&&n.indexOf("s")===-1&&(a="-"+a),r&&(a=r+a),o&&(a+=o),a}applyPrefix(e,t,s=!1){let r=e,o="",n="",a=!1,l=1;for(let u=0,h=t.length;u<h;u++)t[u].number<=e&&(t[u].number===0?r=0:(r=e/t[u].number,l=t[u].number),o=t[u].prefix,n=t[u].suffix,a=!0);return!a&&s&&t.length&&e!=0&&(r=e/t[0].number,o=t[0].prefix,n=t[0].suffix,a=!0),a&&(r=parseFloat(r.toPrecision(Math.min(l.toString().length+Math.floor(r).toString().replace(/[^0-9]*/g,"").length,21)))),[r,o,n]}escape(e){return e.replace("||",on)}unescape(e){return e.replace(on,"|")}}function py(i,e){let t=0,s=0,r=1,o=0,n=0,a=0,l=0,u=0;return i.formatToParts(e).forEach(h=>{switch(h.type){case"year":t=+h.value;break;case"month":s=+h.value-1;break;case"day":r=+h.value;break;case"hour":o=+h.value;break;case"minute":n=+h.value;break;case"second":a=+h.value;break;case"fractionalSecond":l=+h.value;break;case"weekday":switch(h.value){case"Sun":u=0;break;case"Mon":u=1;break;case"Tue":u=2;break;case"Wed":u=3;break;case"Thu":u=4;break;case"Fri":u=5;break;case"Sat":u=6;break}}}),o===24&&(o=0),{year:t,month:s,day:r,hour:o,minute:n,second:a,millisecond:l,weekday:u}}function Rf(i,e){const{year:t,month:s,day:r,hour:o,minute:n,second:a,millisecond:l}=py(i,e);return Date.UTC(t,s,r,o,n,a,l)}class PR{constructor(e,t){if(Object.defineProperty(this,"_utc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dtf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this.name=e,this._utc=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3}),this._dtf=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3})}static new(e){return new this(e,!0)}convertLocal(e){const t=this.offsetUTC(e),s=e.getTimezoneOffset(),r=new Date(e);r.setUTCMinutes(r.getUTCMinutes()-(t-s));const o=r.getTimezoneOffset();return s!=o&&r.setUTCMinutes(r.getUTCMinutes()+o-s),r}offsetUTC(e){const t=Rf(this._utc,e),s=Rf(this._dtf,e);return(t-s)/6e4}parseDate(e){return py(this._dtf,e)}}class TR extends Pt{_setDefaults(){this._setDefault("capitalize",!0),this._setDefault("dateFormat","yyyy-MM-dd"),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t){(typeof t>"u"||t==="")&&(t=this.get("dateFormat","yyyy-MM-dd"));let s,r=e;if(Tn(t))try{const a=this.get("intlLocales");return a?new Intl.DateTimeFormat(a,t).format(r):new Intl.DateTimeFormat(void 0,t).format(r)}catch{return"Invalid"}let o=this.parseFormat(t);const n=this._root.timezone;return n&&!this._root.utc&&(r=n.convertLocal(r)),B(r.getTime())?(s=this.applyFormat(r,o),this.get("capitalize")&&(s=s.replace(/^.{1}/,s.substr(0,1).toUpperCase())),s):"Invalid date"}applyFormat(e,t){let s=t.template,r,o,n,a,l,u,h,d,c=e.getTime();this._root.utc?(r=e.getUTCFullYear(),o=e.getUTCMonth(),n=e.getUTCDay(),a=e.getUTCDate(),l=e.getUTCHours(),u=e.getUTCMinutes(),h=e.getUTCSeconds(),d=e.getUTCMilliseconds()):(r=e.getFullYear(),o=e.getMonth(),n=e.getDay(),a=e.getDate(),l=e.getHours(),u=e.getMinutes(),h=e.getSeconds(),d=e.getMilliseconds());for(let p=0,y=t.parts.length;p<y;p++){let f="";switch(t.parts[p]){case"G":f=this._t(r<0?"_era_bc":"_era_ad");break;case"yyyy":f=Math.abs(r).toString(),r<0&&(f+=this._t("_era_bc"));break;case"yyy":case"yy":case"y":f=Math.abs(r).toString().substr(-t.parts[p].length),r<0&&(f+=this._t("_era_bc"));break;case"YYYY":case"YYY":case"YY":case"Y":let w=Zx(e,this._root.utc);t.parts[p]=="YYYY"?f=Math.abs(w).toString():f=Math.abs(w).toString().substr(-t.parts[p].length),w<0&&(f+=this._t("_era_bc"));break;case"u":break;case"q":f=""+Math.ceil((e.getMonth()+1)/3);break;case"MMMMM":f=this._t(this._getMonth(o)).substr(0,1);break;case"MMMM":f=this._t(this._getMonth(o));break;case"MMM":f=this._t(this._getShortMonth(o));break;case"MM":f=Tt(o+1,2,"0");break;case"M":f=(o+1).toString();break;case"ww":f=Tt(mh(e,this._root.utc),2,"0");break;case"w":f=mh(e,this._root.utc).toString();break;case"W":f=Jx(e,this._root.utc).toString();break;case"dd":f=Tt(a,2,"0");break;case"d":f=a.toString();break;case"DD":case"DDD":f=Tt(wf(e,this._root.utc).toString(),t.parts[p].length,"0");break;case"D":f=wf(e,this._root.utc).toString();break;case"F":break;case"g":break;case"t":f=this._root.language.translateFunc("_dateOrd").call(this,a);break;case"E":f=(n||7).toString();break;case"EE":f=Tt((n||7).toString(),2,"0");break;case"EEE":case"eee":f=this._t(this._getShortWeekday(n));break;case"EEEE":case"eeee":f=this._t(this._getWeekday(n));break;case"EEEEE":case"eeeee":f=this._t(this._getShortWeekday(n)).substr(0,1);break;case"e":case"ee":f=(n-(this._root.locale.firstDayOfWeek||1)+1).toString(),t.parts[p]=="ee"&&(f=Tt(f,2,"0"));break;case"a":l>=12?f=this._t("PM"):f=this._t("AM");break;case"aa":l>=12?f=this._t("P.M."):f=this._t("A.M.");break;case"aaa":l>=12?f=this._t("P"):f=this._t("A");break;case"h":f=wu(l).toString();break;case"hh":f=Tt(wu(l),2,"0");break;case"H":f=l.toString();break;case"HH":f=Tt(l,2,"0");break;case"K":f=wu(l,0).toString();break;case"KK":f=Tt(wu(l,0),2,"0");break;case"k":f=(l+1).toString();break;case"kk":f=Tt(l+1,2,"0");break;case"m":f=u.toString();break;case"mm":f=Tt(u,2,"0");break;case"s":f=h.toString();break;case"ss":f=Tt(h,2,"0");break;case"S":case"SS":case"SSS":f=Math.round(d/1e3*Math.pow(10,t.parts[p].length)).toString();break;case"x":f=c.toString();break;case"n":case"nn":case"nnn":f=Tt(d,t.parts[p].length,"0");break;case"z":f=bu(e,!1,!1,this._root.utc);break;case"zz":f=bu(e,!0,!1,this._root.utc);break;case"zzz":f=bu(e,!1,!0,this._root.utc);break;case"zzzz":f=bu(e,!0,!0,this._root.utc);break;case"Z":case"ZZ":let _=this._root.utc?"UTC":this._root.timezone;_ instanceof PR&&(_=_.name);const P=_?tR(_):e.getTimezoneOffset();let T=Math.abs(P)/60,D=Math.floor(T),M=T*60-D*60;this._root.utc&&(D=0,M=0),t.parts[p]=="Z"?(f="GMT",f+=P>0?"-":"+",f+=Tt(D,2)+":"+Tt(M,2)):(f=P>0?"-":"+",f+=Tt(D,2)+Tt(M,2));break;case"i":f=e.toISOString();break;case"I":f=e.toUTCString();break}s=s.replace(Er,f)}return s}parseFormat(e){let t={template:"",parts:[]},s=Cs.chunk(e,!0);for(let r=0;r<s.length;r++){let o=s[r];if(o.type==="value"){if(o.text.match(/^date$/i)){let a=this.get("dateFormat","yyyy-MM-dd");Pn(a)||(a="yyyy-MM-dd"),o.text=a}let n=o.text.match(/G|yyyy|yyy|yy|y|YYYY|YYY|YY|Y|u|q|MMMMM|MMMM|MMM|MM|M|ww|w|W|dd|d|DDD|DD|D|F|g|EEEEE|EEEE|EEE|EE|E|eeeee|eeee|eee|ee|e|aaa|aa|a|hh|h|HH|H|KK|K|kk|k|mm|m|ss|s|SSS|SS|S|A|zzzz|zzz|zz|z|ZZ|Z|t|x|nnn|nn|n|i|I/g);if(n)for(let a=0;a<n.length;a++)t.parts.push(n[a]),o.text=o.text.replace(n[a],Er)}t.template+=o.text}return t}_months(){return["January","February","March","April","May","June","July","August","September","October","November","December"]}_getMonth(e){return this._months()[e]}_shortMonths(){return["Jan","Feb","Mar","Apr","May(short)","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}_getShortMonth(e){return this._shortMonths()[e]}_weekdays(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]}_getWeekday(e){return this._weekdays()[e]}_shortWeekdays(){return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]}_getShortWeekday(e){return this._shortWeekdays()[e]}parse(e,t){if(e instanceof Date)return e;if(B(e))return new Date(e);Pn(e)||(e=e.toString());let s,r="";t=vg(t),t=t.substr(0,e.length);let o=this.parseFormat(t),n={year:-1,year3:-1,year2:-1,year1:-1,month:-1,monthShort:-1,monthLong:-1,weekdayShort:-1,weekdayLong:-1,day:-1,yearDay:-1,week:-1,hourBase0:-1,hour12Base0:-1,hourBase1:-1,hour12Base1:-1,minute:-1,second:-1,millisecond:-1,millisecondDigits:-1,am:-1,zone:-1,timestamp:-1,iso:-1},a={year:1970,month:0,day:1,hour:0,minute:0,second:0,millisecond:0,timestamp:null,offset:0,utc:this._root.utc},l=0,u=0;for(let c=0;c<o.parts.length;c++){switch(u=c+l+1,o.parts[c]){case"yyyy":case"YYYY":r+="([0-9]{4})",n.year=u;break;case"yyy":case"YYY":r+="([0-9]{3})",n.year3=u;break;case"yy":case"YY":r+="([0-9]{2})",n.year2=u;break;case"y":case"Y":r+="([0-9]{1})",n.year1=u;break;case"MMMM":r+="("+this.getStringList(this._months()).join("|")+")",n.monthLong=u;break;case"MMM":r+="("+this.getStringList(this._shortMonths()).join("|")+")",n.monthShort=u;break;case"MM":case"M":r+="([0-9]{2}|[0-9]{1})",n.month=u;break;case"ww":case"w":r+="([0-9]{2}|[0-9]{1})",n.week=u;break;case"dd":case"d":r+="([0-9]{2}|[0-9]{1})",n.day=u;break;case"DDD":case"DD":case"D":r+="([0-9]{3}|[0-9]{2}|[0-9]{1})",n.yearDay=u;break;case"dddd":r+="("+this.getStringList(this._weekdays()).join("|")+")",n.weekdayLong=u;break;case"ddd":r+="("+this.getStringList(this._shortWeekdays()).join("|")+")",n.weekdayShort=u;break;case"aaa":case"aa":case"a":r+="("+this.getStringList(["AM","PM","A.M.","P.M.","A","P"]).join("|")+")",n.am=u;break;case"hh":case"h":r+="([0-9]{2}|[0-9]{1})",n.hour12Base1=u;break;case"HH":case"H":r+="([0-9]{2}|[0-9]{1})",n.hourBase0=u;break;case"KK":case"K":r+="([0-9]{2}|[0-9]{1})",n.hour12Base0=u;break;case"kk":case"k":r+="([0-9]{2}|[0-9]{1})",n.hourBase1=u;break;case"mm":case"m":r+="([0-9]{2}|[0-9]{1})",n.minute=u;break;case"ss":case"s":r+="([0-9]{2}|[0-9]{1})",n.second=u;break;case"SSS":case"SS":case"S":r+="([0-9]{3}|[0-9]{2}|[0-9]{1})",n.millisecond=u,n.millisecondDigits=o.parts[c].length;break;case"nnn":case"nn":case"n":r+="([0-9]{3}|[0-9]{2}|[0-9]{1})",n.millisecond=u;break;case"x":r+="([0-9]{1,})",n.timestamp=u;break;case"Z":r+="GMT([-+]+[0-9]{2}:[0-9]{2})",n.zone=u;break;case"ZZ":r+="([\\-+]+[0-9]{2}[0-9]{2})",n.zone=u;break;case"i":r+="([0-9]{4})-?([0-9]{2})-?([0-9]{2})T?([0-9]{2}):?([0-9]{2}):?([0-9]{2})\\.?([0-9]{0,3})([zZ]|[+\\-][0-9]{2}:?[0-9]{2}|$)",n.iso=u,l+=7;break;case"G":case"YYYY":case"YYY":case"YY":case"Y":case"MMMMM":case"W":case"EEEEE":case"EEEE":case"EEE":case"EE":case"E":case"eeeee":case"eeee":case"eee":case"ee":case"e":case"zzzz":case"zzz":case"zz":case"z":case"t":l--;break}r+="[^0-9]*"}let h=new RegExp(r),d=e.match(h);if(d){if(n.year>-1&&(a.year=parseInt(d[n.year])),n.year3>-1){let c=parseInt(d[n.year3]);c+=1e3,a.year=c}if(n.year2>-1){let c=parseInt(d[n.year2]);c>50?c+=1e3:c+=2e3,a.year=c}if(n.year1>-1){let c=parseInt(d[n.year1]);c=Math.floor(new Date().getFullYear()/10)*10+c,a.year=c}if(n.monthLong>-1&&(a.month=this.resolveMonth(d[n.monthLong])),n.monthShort>-1&&(a.month=this.resolveShortMonth(d[n.monthShort])),n.month>-1&&(a.month=parseInt(d[n.month])-1),n.week>-1&&n.day===-1&&(a.month=0,a.day=eR(parseInt(d[n.week]),a.year,1,this._root.utc)),n.day>-1&&(a.day=parseInt(d[n.day])),n.yearDay>-1&&(a.month=0,a.day=parseInt(d[n.yearDay])),n.hourBase0>-1&&(a.hour=parseInt(d[n.hourBase0])),n.hourBase1>-1&&(a.hour=parseInt(d[n.hourBase1])-1),n.hour12Base0>-1){let c=parseInt(d[n.hour12Base0]);c==11&&(c=0),n.am>-1&&!this.isAm(d[n.am])&&(c+=12),a.hour=c}if(n.hour12Base1>-1){let c=parseInt(d[n.hour12Base1]);c==12&&(c=0),n.am>-1&&!this.isAm(d[n.am])&&(c+=12),a.hour=c}if(n.minute>-1&&(a.minute=parseInt(d[n.minute])),n.second>-1&&(a.second=parseInt(d[n.second])),n.millisecond>-1){let c=parseInt(d[n.millisecond]);n.millisecondDigits==2?c*=10:n.millisecondDigits==1&&(c*=100),a.millisecond=c}if(n.timestamp>-1){a.timestamp=parseInt(d[n.timestamp]);const c=new Date(a.timestamp);a.year=c.getUTCFullYear(),a.month=c.getUTCMonth(),a.day=c.getUTCDate(),a.hour=c.getUTCHours(),a.minute=c.getUTCMinutes(),a.second=c.getUTCSeconds(),a.millisecond=c.getUTCMilliseconds()}n.zone>-1&&(a.offset=this.resolveTimezoneOffset(new Date(a.year,a.month,a.day),d[n.zone])),n.iso>-1&&(a.year=Ni(d[n.iso+0]),a.month=Ni(d[n.iso+1])-1,a.day=Ni(d[n.iso+2]),a.hour=Ni(d[n.iso+3]),a.minute=Ni(d[n.iso+4]),a.second=Ni(d[n.iso+5]),a.millisecond=Ni(d[n.iso+6]),d[n.iso+7]=="Z"||d[n.iso+7]=="z"?a.utc=!0:d[n.iso+7]!=""&&(a.offset=this.resolveTimezoneOffset(new Date(a.year,a.month,a.day),d[n.iso+7]))),a.utc?s=new Date(Date.UTC(a.year,a.month,a.day,a.hour,a.minute,a.second,a.millisecond)):s=new Date(a.year,a.month,a.day,a.hour,a.minute+a.offset,a.second,a.millisecond)}else s=new Date(e);return s}resolveTimezoneOffset(e,t){if(t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)){let r=t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/),o=r[1],n=r[2],a=r[3],l=parseInt(n)*60+parseInt(a);o=="+"&&(l*=-1);let u=(e||new Date).getTimezoneOffset();return l-u}return 0}resolveMonth(e){let t=this._months().indexOf(e);return t>-1||!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._months()).indexOf(e),t>-1)?t:0}resolveShortMonth(e){let t=this._shortMonths().indexOf(e);return t>-1||(t=this._months().indexOf(e),t>-1)||this._root.language&&!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._shortMonths()).indexOf(e),t>-1)?t:0}isAm(e){return this.getStringList(["AM","A.M.","A"]).indexOf(e.toUpperCase())>-1}getStringList(e){let t=[];for(let s=0;s<e.length;s++)this._root.language?t.push(yf(this._t(e[s]))):t.push(yf(e[s]));return t}}class AR extends Pt{constructor(){super(...arguments),Object.defineProperty(this,"_unitAliases",{enumerable:!0,configurable:!0,writable:!0,value:{Y:"y",D:"d",H:"h",K:"h",k:"h",n:"S"}})}_setDefaults(){const e="_duration_millisecond",t="_duration_second",s="_duration_minute",r="_duration_hour",o="_duration_day",n="_duration_week",a="_duration_month",l="_duration_year",u="_second",h="_minute",d="_hour",c="_day",p="_week",y="_week",f="_year";this._setDefault("negativeBase",0),this._setDefault("baseUnit","second"),this._setDefault("durationFormats",{millisecond:{millisecond:this._t(e),second:this._t(e+u),minute:this._t(e+h),hour:this._t(e+d),day:this._t(e+c),week:this._t(e+p),month:this._t(e+y),year:this._t(e+f)},second:{second:this._t(t),minute:this._t(t+h),hour:this._t(t+d),day:this._t(t+c),week:this._t(t+p),month:this._t(t+y),year:this._t(t+f)},minute:{minute:this._t(s),hour:this._t(s+d),day:this._t(s+c),week:this._t(s+p),month:this._t(s+y),year:this._t(s+f)},hour:{hour:this._t(r),day:this._t(r+c),week:this._t(r+p),month:this._t(r+y),year:this._t(r+f)},day:{day:this._t(o),week:this._t(o+p),month:this._t(o+y),year:this._t(o+f)},week:{week:this._t(n),month:this._t(n+y),year:this._t(n+f)},month:{month:this._t(a),year:this._t(a+f)},year:{year:this._t(l)}}),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,s){let r=s||this.get("baseUnit");(typeof t>"u"||t==="")&&(this.get("durationFormat")!=null?t=this.get("durationFormat"):t=this.getFormat(Ni(e),void 0,r)),t=vg(t);let o=this.parseFormat(t,r),n=Number(e),a;n>this.get("negativeBase")?a=o.positive:n<this.get("negativeBase")?a=o.negative:a=o.zero;let l=this.applyFormat(n,a);return a.color!==""&&(l="["+a.color+"]"+l+"[/]"),l}parseFormat(e,t){let s=t||this.get("baseUnit"),r={positive:{color:"",template:"",parts:[],source:"",baseUnit:s,parsed:!1,absolute:!1},negative:{color:"",template:"",parts:[],source:"",baseUnit:s,parsed:!1,absolute:!1},zero:{color:"",template:"",parts:[],source:"",baseUnit:s,parsed:!1,absolute:!1}};e=e.replace("||",on);let o=e.split("|");return r.positive.source=o[0],typeof o[2]>"u"?r.zero=r.positive:r.zero.source=o[2],typeof o[1]>"u"?r.negative=r.positive:r.negative.source=o[1],$e(r,(n,a)=>{if(a.parsed)return;let l=a.source,u=[];u=a.source.match(/^\[([^\]]*)\]/),u&&u.length&&u[0]!==""&&(l=a.source.substr(u[0].length),a.color=u[1]);let h=Cs.chunk(l,!0);for(let d=0;d<h.length;d++){let c=h[d];if(c.text=c.text.replace(on,"|"),c.type==="value"){c.text.match(/[yYMdDwhHKkmsSn]+a/)&&(a.absolute=!0,c.text=c.text.replace(/([yYMdDwhHKkmsSn]+)a/,"$1"));let p=c.text.match(/y+|Y+|M+|d+|D+|w+|h+|H+|K+|k+|m+|s+|S+|n+/g);if(p)for(let y=0;y<p.length;y++)p[y]==null&&(p[y]=this._unitAliases[p[y]]),a.parts.push(p[y]),c.text=c.text.replace(p[y],Er)}a.template+=c.text}a.parsed=!0}),r}applyFormat(e,t){let s=!t.absolute&&e<this.get("negativeBase");e=Math.abs(e);let r=this.toTimeStamp(e,t.baseUnit),o=t.template;for(let n=0,a=t.parts.length;n<a;n++){let l=t.parts[n],u=this._toTimeUnit(l.substr(0,1)),h=l.length,d=Math.floor(r/this._getUnitValue(u));o=o.replace(Er,Tt(d,h,"0")),r-=d*this._getUnitValue(u)}return s&&(o="-"+o),o}toTimeStamp(e,t){return e*this._getUnitValue(t)}_toTimeUnit(e){switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year"}}getFormat(e,t,s){if(this.get("durationFormat")!=null)return this.get("durationFormat");if(s||(s=this.get("baseUnit")),t!=null&&e!=t){e=Math.abs(e),t=Math.abs(t);let r=this.getValueUnit(Math.max(e,t),s);return this.get("durationFormats")[s][r]}else{let r=this.getValueUnit(e,s);return this.get("durationFormats")[s][r]}}getValueUnit(e,t){t||(t=this.get("baseUnit"));let s,r=this.getMilliseconds(e,t);return Hx(this._getUnitValues(),(o,n)=>{if(o==t||s){if(r/n<=1)return s||(s=o),!1;s=o}return!0}),s}getMilliseconds(e,t){return t||(t=this.get("baseUnit")),e*this._getUnitValue(t)}_getUnitValue(e){return this._getUnitValues()[e]}_getUnitValues(){return{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}}}const gy={firstDayOfWeek:1,_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(i){let e="th";if(i<11||i>13)switch(i%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd";break}return e},"Zoom Out":"",Play:"",Stop:"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};class FR extends Pt{_setDefaults(){this.setPrivate("defaultLocale",gy),super._setDefaults()}translate(e,t,...s){t||(t=this._root.locale||this.getPrivate("defaultLocale"));let r=e,o=t[e];if(o===null)r="";else if(o!=null)o&&(r=o);else if(t!==this.getPrivate("defaultLocale"))return this.translate(e,this.getPrivate("defaultLocale"),...s);if(s.length)for(let n=s.length,a=0;a<n;++a)r=r.split("%"+(a+1)).join(s[a]);return r}translateAny(e,t,...s){return this.translate(e,t,...s)}setTranslationAny(e,t,s){const r=s||this._root.locale;r[e]=t}setTranslationsAny(e,t){$e(e,(s,r)=>{this.setTranslationAny(s,r,t)})}translateEmpty(e,t,...s){let r=this.translate(e,t,...s);return r==e?"":r}translateFunc(e,t){return this._root.locale[e]?this._root.locale[e]:t!==this.getPrivate("defaultLocale")?this.translateFunc(e,this.getPrivate("defaultLocale")):()=>""}translateAll(e,t){return this.isDefault()?e:ip(e,s=>this.translate(s,t))}isDefault(){return this.getPrivate("defaultLocale")===this._root.locale}}class Cd{constructor(e,t){if(Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rules",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._root=e,!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`")}static new(e){const t=new this(e,!0);return t.setupDefaultRules(),t}setupDefaultRules(){}_lookupRules(e){return this._rules[e]}ruleRaw(e,t=[]){let s=this._rules[e];s||(s=this._rules[e]=[]),t.sort(Is);const{index:r,found:o}=Wu(s,n=>{const a=Is(n.tags.length,t.length);return a===0?dy(n.tags,t,Is):a});if(o)return s[r].template;{const n=Wt.new({});return s.splice(r,0,{tags:t,template:n}),n}}rule(e,t=[]){return this.ruleRaw(e,t)}}function Ce(i,e,t,s){i.set(e,t.get(s)),t.on(s,r=>{i.set(e,r)})}class MR extends Cd{setupDefaultRules(){super.setupDefaultRules();const e=this._root.language,t=this._root.interfaceColors,s=this._root.horizontalLayout,r=this._root.verticalLayout,o=this.rule.bind(this);o("InterfaceColors").setAll({stroke:ge.fromHex(15066597),fill:ge.fromHex(15987699),primaryButton:ge.fromHex(6788316),primaryButtonHover:ge.fromHex(6779356),primaryButtonDown:ge.fromHex(6872182),primaryButtonActive:ge.fromHex(6872182),primaryButtonText:ge.fromHex(16777215),primaryButtonStroke:ge.fromHex(16777215),secondaryButton:ge.fromHex(14277081),secondaryButtonHover:ge.fromHex(10724259),secondaryButtonDown:ge.fromHex(9276813),secondaryButtonActive:ge.fromHex(15132390),secondaryButtonText:ge.fromHex(0),secondaryButtonStroke:ge.fromHex(16777215),grid:ge.fromHex(0),background:ge.fromHex(16777215),alternativeBackground:ge.fromHex(0),text:ge.fromHex(0),alternativeText:ge.fromHex(16777215),disabled:ge.fromHex(11382189),positive:ge.fromHex(5288704),negative:ge.fromHex(11730944)});{const n=o("ColorSet");n.setAll({passOptions:{hue:.05,saturation:0,lightness:0},colors:[ge.fromHex(6797276)],step:1,reuse:!1,startIndex:0}),n.setPrivate("currentStep",0),n.setPrivate("currentPass",0)}o("Entity").setAll({stateAnimationDuration:0,stateAnimationEasing:Su(Ra)}),o("Component").setAll({interpolationDuration:0,interpolationEasing:Su(Ra)}),o("Sprite").setAll({visible:!0,scale:1,opacity:1,rotation:0,position:"relative",tooltipX:xt,tooltipY:xt,tooltipPosition:"fixed",isMeasured:!0}),o("Sprite").states.create("default",{visible:!0,opacity:1}),o("Container").setAll({interactiveChildren:!0,setStateOnChildren:!1}),o("Graphics").setAll({strokeWidth:1}),o("Chart").setAll({width:ue,height:ue,interactiveChildren:!1}),o("Sprite",["horizontal","center"]).setAll({centerX:xt,x:xt}),o("Sprite",["vertical","center"]).setAll({centerY:xt,y:xt}),o("Container",["horizontal","layout"]).setAll({layout:s}),o("Container",["vertical","layout"]).setAll({layout:r}),o("Pattern").setAll({repetition:"repeat",width:50,height:50,rotation:0,fillOpacity:1}),o("LinePattern").setAll({gap:6,colorOpacity:1,width:49,height:49}),o("RectanglePattern").setAll({gap:6,checkered:!1,centered:!0,maxWidth:5,maxHeight:5,width:48,height:48,strokeWidth:0}),o("CirclePattern").setAll({gap:5,checkered:!1,centered:!1,radius:3,strokeWidth:0,width:45,height:45}),o("LinearGradient").setAll({rotation:90}),o("Legend").setAll({fillField:"fill",strokeField:"stroke",nameField:"name",layout:bo.new(this._root,{}),layer:30,clickTarget:"itemContainer"}),o("Container",["legend","item","itemcontainer"]).setAll({paddingLeft:5,paddingRight:5,paddingBottom:5,paddingTop:5,layout:s,setStateOnChildren:!0,interactiveChildren:!1,ariaChecked:!0,focusable:!0,ariaLabel:e.translate("Press ENTER to toggle"),role:"checkbox"});{const n=o("Rectangle",["legend","item","background"]);n.setAll({fillOpacity:0}),Ce(n,"fill",t,"background")}o("Container",["legend","marker"]).setAll({setStateOnChildren:!0,centerY:xt,paddingLeft:0,paddingRight:0,paddingBottom:0,paddingTop:0,width:18,height:18}),o("RoundedRectangle",["legend","marker","rectangle"]).setAll({width:ue,height:ue,cornerRadiusBL:3,cornerRadiusTL:3,cornerRadiusBR:3,cornerRadiusTR:3});{const n=o("RoundedRectangle",["legend","marker","rectangle"]).states.create("disabled",{});Ce(n,"fill",t,"disabled"),Ce(n,"stroke",t,"disabled")}o("Label",["legend","label"]).setAll({centerY:xt,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,populateText:!0});{const n=o("Label",["legend","label"]).states.create("disabled",{});Ce(n,"fill",t,"disabled")}o("Label",["legend","value","label"]).setAll({centerY:xt,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,width:50,centerX:ue,populateText:!0});{const n=o("Label",["legend","value","label"]).states.create("disabled",{});Ce(n,"fill",t,"disabled")}o("HeatLegend").setAll({stepCount:1}),o("RoundedRectangle",["heatlegend","marker"]).setAll({cornerRadiusTR:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusBL:0}),o("RoundedRectangle",["vertical","heatlegend","marker"]).setAll({height:ue,width:15}),o("RoundedRectangle",["horizontal","heatlegend","marker"]).setAll({width:ue,height:15}),o("HeatLegend",["vertical"]).setAll({height:ue}),o("HeatLegend",["horizontal"]).setAll({width:ue}),o("Label",["heatlegend","start"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5}),o("Label",["heatlegend","end"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5});{const n=o("Label");n.setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"1em",populateText:!1}),Ce(n,"fill",t,"text")}o("RadialLabel").setAll({textType:"regular",centerY:xt,centerX:xt,inside:!1,radius:0,baseRadius:ue,orientation:"auto",textAlign:"center"}),o("RoundedRectangle").setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8}),o("PointedRectangle").setAll({pointerBaseWidth:15,pointerLength:10,cornerRadius:8}),o("Slice").setAll({shiftRadius:0,dRadius:0,dInnerRadius:0});{const n=o("Tick");n.setAll({strokeOpacity:.15,isMeasured:!1,length:4.5,position:"absolute",crisp:!0}),Ce(n,"stroke",t,"grid")}o("Bullet").setAll({locationX:.5,locationY:.5}),o("Tooltip").setAll({position:"absolute",getFillFromSprite:!0,getStrokeFromSprite:!1,autoTextColor:!0,paddingTop:9,paddingBottom:8,paddingLeft:10,paddingRight:10,marginBottom:5,pointerOrientation:"vertical",centerX:xt,centerY:xt,animationEasing:Su(Ra),exportable:!1}),o("PointedRectangle",["tooltip","background"]).setAll({strokeOpacity:.9,cornerRadius:4,pointerLength:4,pointerBaseWidth:8,fillOpacity:.9,stroke:ge.fromHex(16777215)});{const n=o("Label",["tooltip"]);n.setAll({role:"tooltip",populateText:!0,paddingRight:0,paddingTop:0,paddingLeft:0,paddingBottom:0}),Ce(n,"fill",t,"alternativeText")}o("Button").setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,interactive:!0,layout:s,interactiveChildren:!1,setStateOnChildren:!0,focusable:!0}),o("Button").states.create("hover",{}),o("Button").states.create("down",{stateAnimationDuration:0}),o("Button").states.create("active",{});{const n=o("RoundedRectangle",["button","background"]);Ce(n,"fill",t,"primaryButton"),Ce(n,"stroke",t,"primaryButtonStroke")}{const n=o("RoundedRectangle",["button","background"]).states.create("hover",{});Ce(n,"fill",t,"primaryButtonHover")}{const n=o("RoundedRectangle",["button","background"]).states.create("down",{stateAnimationDuration:0});Ce(n,"fill",t,"primaryButtonDown")}{const n=o("RoundedRectangle",["button","background"]).states.create("active",{});Ce(n,"fill",t,"primaryButtonActive")}{const n=o("Graphics",["button","icon"]);Ce(n,"stroke",t,"primaryButtonText")}{const n=o("Label",["button"]);Ce(n,"fill",t,"primaryButtonText")}o("Button",["zoom"]).setAll({paddingTop:18,paddingBottom:18,paddingLeft:12,paddingRight:12,centerX:46,centerY:-10,y:0,x:ue,role:"button",ariaLabel:e.translate("Zoom Out"),layer:30});{const n=o("RoundedRectangle",["background","button","zoom"]);n.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),Ce(n,"fill",t,"primaryButton")}{const n=o("RoundedRectangle",["background","button","zoom"]).states.create("hover",{});Ce(n,"fill",t,"primaryButtonHover")}{const n=o("RoundedRectangle",["background","button","zoom"]).states.create("down",{stateAnimationDuration:0});Ce(n,"fill",t,"primaryButtonDown")}{const n=o("Graphics",["icon","button","zoom"]);n.setAll({crisp:!0,strokeOpacity:.7,draw:a=>{a.moveTo(0,0),a.lineTo(12,0)}}),Ce(n,"stroke",t,"primaryButtonText")}o("Button",["resize"]).setAll({paddingTop:9,paddingBottom:9,paddingLeft:13,paddingRight:13,draggable:!0,centerX:xt,centerY:xt,position:"absolute",role:"slider",ariaValueMin:"0",ariaValueMax:"100",ariaLabel:e.translate("Use up and down arrows to move selection")});{const n=o("RoundedRectangle",["background","resize","button"]);n.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),Ce(n,"fill",t,"secondaryButton"),Ce(n,"stroke",t,"secondaryButtonStroke")}{const n=o("RoundedRectangle",["background","resize","button"]).states.create("hover",{});Ce(n,"fill",t,"secondaryButtonHover")}{const n=o("RoundedRectangle",["background","resize","button"]).states.create("down",{stateAnimationDuration:0});Ce(n,"fill",t,"secondaryButtonDown")}{const n=o("Graphics",["resize","button","icon"]);n.setAll({crisp:!0,strokeOpacity:.5,draw:a=>{a.moveTo(0,.5),a.lineTo(0,12.5),a.moveTo(4,.5),a.lineTo(4,12.5)}}),Ce(n,"stroke",t,"secondaryButtonText")}o("Button",["resize","vertical"]).setAll({rotation:90,cursorOverStyle:"ns-resize"}),o("Button",["resize","horizontal"]).setAll({cursorOverStyle:"ew-resize"}),o("Button",["play"]).setAll({paddingTop:13,paddingBottom:13,paddingLeft:14,paddingRight:14,ariaLabel:e.translate("Play"),toggleKey:"active"});{const n=o("RoundedRectangle",["play","background"]);n.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),Ce(n,"fill",t,"primaryButton")}{const n=o("Graphics",["play","icon"]);n.setAll({stateAnimationDuration:0,dx:1,draw:a=>{a.moveTo(0,-5),a.lineTo(8,0),a.lineTo(0,5),a.lineTo(0,-5)}}),Ce(n,"fill",t,"primaryButtonText")}o("Graphics",["play","icon"]).states.create("default",{stateAnimationDuration:0}),o("Graphics",["play","icon"]).states.create("active",{stateAnimationDuration:0,draw:n=>{n.moveTo(-4,-5),n.lineTo(-1,-5),n.lineTo(-1,5),n.lineTo(-4,5),n.lineTo(-4,-5),n.moveTo(4,-5),n.lineTo(1,-5),n.lineTo(1,5),n.lineTo(4,5),n.lineTo(4,-5)}}),o("Button",["switch"]).setAll({paddingTop:4,paddingBottom:4,paddingLeft:4,paddingRight:4,ariaLabel:e.translate("Press ENTER to toggle"),toggleKey:"active",width:40,height:24,layout:null});{const n=o("RoundedRectangle",["switch","background"]);n.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),Ce(n,"fill",t,"primaryButton")}{const n=o("Circle",["switch","icon"]);n.setAll({radius:8,centerY:0,centerX:0,dx:0}),Ce(n,"fill",t,"primaryButtonText")}o("Graphics",["switch","icon"]).states.create("active",{dx:16}),o("Scrollbar").setAll({start:0,end:1,layer:30,animationEasing:Su(Ra)}),o("Scrollbar",["vertical"]).setAll({marginRight:13,marginLeft:13,minWidth:12,height:ue}),o("Scrollbar",["horizontal"]).setAll({marginTop:13,marginBottom:13,minHeight:12,width:ue}),this.rule("Button",["scrollbar"]).setAll({exportable:!1});{const n=o("RoundedRectangle",["scrollbar","main","background"]);n.setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8,fillOpacity:.8}),Ce(n,"fill",t,"fill")}{const n=o("RoundedRectangle",["scrollbar","thumb"]);n.setAll({role:"slider",ariaLive:"polite",position:"absolute",draggable:!0}),Ce(n,"fill",t,"secondaryButton")}{const n=o("RoundedRectangle",["scrollbar","thumb"]).states.create("hover",{});Ce(n,"fill",t,"secondaryButtonHover")}{const n=o("RoundedRectangle",["scrollbar","thumb"]).states.create("down",{stateAnimationDuration:0});Ce(n,"fill",t,"secondaryButtonDown")}o("RoundedRectangle",["scrollbar","thumb","vertical"]).setAll({x:xt,width:ue,centerX:xt,ariaLabel:e.translate("Use up and down arrows to move selection")}),o("RoundedRectangle",["scrollbar","thumb","horizontal"]).setAll({y:xt,centerY:xt,height:ue,ariaLabel:e.translate("Use left and right arrows to move selection")});{const n=o("PointedRectangle",["axis","tooltip","background"]);n.setAll({cornerRadius:0}),Ce(n,"fill",t,"alternativeBackground")}o("Label",["axis","tooltip"]).setAll({role:void 0}),o("Label",["axis","tooltip","y"]).setAll({textAlign:"right"}),o("Label",["axis","tooltip","y","opposite"]).setAll({textAlign:"left"}),o("Label",["axis","tooltip","x"]).setAll({textAlign:"center"}),o("Tooltip",["categoryaxis"]).setAll({labelText:"{category}"}),o("Star").setAll({spikes:5,innerRadius:5,radius:10}),o("Tooltip",["stock"]).setAll({paddingTop:6,paddingBottom:5,paddingLeft:7,paddingRight:7}),o("PointedRectangle",["tooltip","stock","axis"]).setAll({pointerLength:0,pointerBaseWidth:0,cornerRadius:3}),o("Label",["tooltip","stock"]).setAll({fontSize:"0.8em"}),o("SpriteResizer").setAll({rotationStep:10}),o("Container",["resizer","grip"]).states.create("hover",{});{const n=o("RoundedRectangle",["resizer","grip"]);n.setAll({strokeOpacity:.7,strokeWidth:1,fillOpacity:1,width:12,height:12}),Ce(n,"fill",t,"background"),Ce(n,"stroke",t,"alternativeBackground")}{const n=o("RoundedRectangle",["resizer","grip","outline"]);n.setAll({strokeOpacity:0,fillOpacity:0,width:20,height:20}),n.states.create("hover",{fillOpacity:.3}),Ce(n,"fill",t,"alternativeBackground")}o("RoundedRectangle",["resizer","grip","left"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0}),o("RoundedRectangle",["resizer","grip","right"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0});{const n=o("Rectangle",["resizer","rectangle"]);n.setAll({strokeDasharray:[2,2],strokeOpacity:.5,strokeWidth:1}),Ce(n,"stroke",t,"alternativeBackground")}}}class cc{constructor(e=1,t=0,s=0,r=1,o=0,n=0){Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.a=e,this.b=t,this.c=s,this.d=r,this.tx=o,this.ty=n}setTransform(e,t,s,r,o,n=1){this.a=Math.cos(o)*n,this.b=Math.sin(o)*n,this.c=-Math.sin(o)*n,this.d=Math.cos(o)*n,this.tx=e-(s*this.a+r*this.c),this.ty=t-(s*this.b+r*this.d)}apply(e){return{x:this.a*e.x+this.c*e.y+this.tx,y:this.b*e.x+this.d*e.y+this.ty}}applyInverse(e){const t=1/(this.a*this.d+this.c*-this.b);return{x:this.d*t*e.x+-this.c*t*e.y+(this.ty*this.c-this.tx*this.d)*t,y:this.a*t*e.y+-this.b*t*e.x+(-this.ty*this.a+this.tx*this.b)*t}}append(e){const t=this.a,s=this.b,r=this.c,o=this.d;this.a=e.a*t+e.b*r,this.b=e.a*s+e.b*o,this.c=e.c*t+e.d*r,this.d=e.c*s+e.d*o,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*s+e.ty*o+this.ty}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const s=this.a,r=this.c;this.a=s*e.a+this.b*e.c,this.b=s*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty}copyFrom(e){this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty}}var LR=function(){function i(e,t){var s=[],r=!0,o=!1,n=void 0;try{for(var a=e[Symbol.iterator](),l;!(r=(l=a.next()).done)&&(s.push(l.value),!(t&&s.length===t));r=!0);}catch(u){o=!0,n=u}finally{try{!r&&a.return&&a.return()}finally{if(o)throw n}}return s}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return i(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Ma=Math.PI*2,pc=function(e,t,s,r,o,n,a){var l=e.x,u=e.y;l*=t,u*=s;var h=r*l-o*u,d=o*l+r*u;return{x:h+n,y:d+a}},IR=function(e,t){var s=t===1.5707963267948966?.551915024494:t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),r=Math.cos(e),o=Math.sin(e),n=Math.cos(e+t),a=Math.sin(e+t);return[{x:r-o*s,y:o+r*s},{x:n+a*s,y:a-n*s},{x:n,y:a}]},Df=function(e,t,s,r){var o=e*r-t*s<0?-1:1,n=e*s+t*r;return n>1&&(n=1),n<-1&&(n=-1),o*Math.acos(n)},OR=function(e,t,s,r,o,n,a,l,u,h,d,c){var p=Math.pow(o,2),y=Math.pow(n,2),f=Math.pow(d,2),w=Math.pow(c,2),_=p*y-p*w-y*f;_<0&&(_=0),_/=p*w+y*f,_=Math.sqrt(_)*(a===l?-1:1);var P=_*o/n*c,T=_*-n/o*d,D=h*P-u*T+(e+s)/2,M=u*P+h*T+(t+r)/2,O=(d-P)/o,N=(c-T)/n,z=(-d-P)/o,Y=(-c-T)/n,W=Df(1,0,O,N),$=Df(O,N,z,Y);return l===0&&$>0&&($-=Ma),l===1&&$<0&&($+=Ma),[D,M,W,$]},NR=function(e){var t=e.px,s=e.py,r=e.cx,o=e.cy,n=e.rx,a=e.ry,l=e.xAxisRotation,u=l===void 0?0:l,h=e.largeArcFlag,d=h===void 0?0:h,c=e.sweepFlag,p=c===void 0?0:c,y=[];if(n===0||a===0)return[];var f=Math.sin(u*Ma/360),w=Math.cos(u*Ma/360),_=w*(t-r)/2+f*(s-o)/2,P=-f*(t-r)/2+w*(s-o)/2;if(_===0&&P===0)return[];n=Math.abs(n),a=Math.abs(a);var T=Math.pow(_,2)/Math.pow(n,2)+Math.pow(P,2)/Math.pow(a,2);T>1&&(n*=Math.sqrt(T),a*=Math.sqrt(T));var D=OR(t,s,r,o,n,a,d,p,f,w,_,P),M=LR(D,4),O=M[0],N=M[1],z=M[2],Y=M[3],W=Math.abs(Y)/(Ma/4);Math.abs(1-W)<1e-7&&(W=1);var $=Math.max(Math.ceil(W),1);Y/=$;for(var ee=0;ee<$;ee++)y.push(IR(z,Y)),z+=Y;return y.map(function(re){var me=pc(re[0],n,a,w,f,O,N),he=me.x,ce=me.y,ne=pc(re[1],n,a,w,f,O,N),oe=ne.x,Q=ne.y,pe=pc(re[2],n,a,w,f,O,N),_e=pe.x,ve=pe.y;return{x1:he,y1:ce,x2:oe,y2:Q,x:_e,y:ve}})};function kR(i,e,t){if(e!==t)throw new Error("Required "+t+" arguments for "+i+" but got "+e)}function Da(i,e,t){if(e<t)throw new Error("Required at least "+t+" arguments for "+i+" but got "+e)}function Oi(i,e,t){if(Da(i,e,t),e%t!==0)throw new Error("Arguments for "+i+" must be in pairs of "+t)}function GR(i){for(let e=0;e<i.length;e+=7){let t=e+3,s=i[t];if(s.length>1){const r=/^([01])([01])(.*)$/.exec(s);r!==null&&(i.splice(t,0,r[1]),++t,i.splice(t,0,r[2]),++t,r[3].length>0?i[t]=r[3]:i.splice(t,1))}if(++t,s=i[t],s.length>1){const r=/^([01])(.+)$/.exec(s);r!==null&&(i.splice(t,0,r[1]),++t,i[t]=r[2])}}}function Pf(i){if(i===0||i===1)return i;throw new Error("Flag must be 0 or 1")}function VR(i){const e=[0,0,0];for(let t=0;t<24;t++)e[t%3]<<=1,e[t%3]|=i&1,i>>=1;return(e[2]|0)+(e[1]<<8)+(e[0]<<16)}function xu(i,e){for(;!(i.interactive&&!e(i));)if(i._parent)i=i._parent;else break}function Tf(i,e,t){return tt(i,ll(e),s=>{let r=s.touches;r?(r.length==0&&(r=s.changedTouches),t(sp(r))):t([s])})}function Af(i){const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("2d",{willReadFrequently:!0});t.drawImage(i,0,0,1,1);try{return t.getImageData(0,0,1,1),!1}catch{return console.warn('Image "'+i.src+'" is loaded from different host and is not covered by CORS policy. For more information about the implications read here: https://www.amcharts.com/docs/v5/concepts/cors'),!0}}function Pa(i){i.width=0,i.height=0,i.style.width="0px",i.style.height="0px"}class HR{constructor(){Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0})}get x(){return this._x}get y(){return this._y}set x(e){this._x=e}set y(e){this._y=e}}class yd extends fd{constructor(e){super(),Object.defineProperty(this,"_layer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"interactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"wheelable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cancelTouch",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isMeasured",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"buttonMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"alpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"compoundAlpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"angle",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"crisp",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"pivot",{enumerable:!0,configurable:!0,writable:!0,value:new HR}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cursorOverStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_replacedCursorStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new cc}),Object.defineProperty(this,"_matrix",{enumerable:!0,configurable:!0,writable:!0,value:new cc}),Object.defineProperty(this,"_uMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new cc}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._renderer=e}_dispose(){this._renderer._removeObject(this),this.getLayer().dirty=!0}getCanvas(){return this.getLayer().view}getLayer(){let e=this;for(;;){if(e._layer)return e._layer;if(e._parent)e=e._parent;else return this._renderer.defaultLayer}}setLayer(e,t){e==null?this._layer=void 0:(this._layer=this._renderer.getLayer(e,!0),this._layer.visible=!0,this._layer.margin=t,t&&xa(this._layer.view,!1),this._renderer._ghostLayer.setMargin(this._renderer.layers),this._parent&&this._parent.registerChildLayer(this._layer),this._renderer.resizeLayer(this._layer),this._renderer.resizeGhost())}markDirtyLayer(){this.getLayer().dirty=!0}clear(){this.invalidateBounds()}invalidateBounds(){this._localBounds=void 0}_addBounds(e){}_getColorId(){return this._colorId===void 0&&(this._colorId=this._renderer.paintId(this)),this._colorId}_isInteractive(){return this.inactive==!1&&(this.interactive||this._renderer._forceInteractive>0)}_isInteractiveMask(){return this._isInteractive()}contains(e){for(;;){if(e===this)return!0;if(e._parent)e=e._parent;else return!1}}toGlobal(e){return this._matrix.apply(e)}toLocal(e){return this._matrix.applyInverse(e)}getLocalMatrix(){return this._uMatrix.setTransform(0,0,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._uMatrix}getLocalBounds(){return this._localBounds||(this._localBounds={left:1e7,top:1e7,right:-1e7,bottom:-1e7},this._addBounds(this._localBounds)),this._localBounds}getAdjustedBounds(e){this._setMatrix();const t=this.getLocalMatrix(),s=t.apply({x:e.left,y:e.top}),r=t.apply({x:e.right,y:e.top}),o=t.apply({x:e.right,y:e.bottom}),n=t.apply({x:e.left,y:e.bottom});return{left:Math.min(s.x,r.x,o.x,n.x),top:Math.min(s.y,r.y,o.y,n.y),right:Math.max(s.x,r.x,o.x,n.x),bottom:Math.max(s.y,r.y,o.y,n.y)}}on(e,t,s){return this.interactive?this._renderer._addEvent(this,e,t,s):new Vt(()=>{})}_setMatrix(){this._localMatrix.setTransform(this.x,this.y,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._matrix.copyFrom(this._localMatrix),this._parent&&this._matrix.prepend(this._parent._matrix)}_transform(e,t){const s=this._matrix;let r=s.tx*t,o=s.ty*t;this.crisp&&(r=Math.floor(r)+.5,o=Math.floor(o)+.5),e.setTransform(s.a*t,s.b*t,s.c*t,s.d*t,r,o)}_transformMargin(e,t,s){const r=this._matrix;e.setTransform(r.a*t,r.b*t,r.c*t,r.d*t,(r.tx+s.left)*t,(r.ty+s.top)*t)}_transformLayer(e,t,s){s.margin?this._transformMargin(e,s.scale||t,s.margin):this._transform(e,s.scale||t)}render(e){if(this.visible&&(this.exportable!==!1||!this._renderer._omitTainted)){this._setMatrix();const t=this._renderer.resolution,s=this._renderer.layers,r=this._renderer._ghostLayer,o=r.context,n=this.mask;n&&n._setMatrix(),G(s,a=>{if(a){const l=a.context;l.save(),n&&(n._transformLayer(l,t,a),n._runPath(l),l.clip()),l.globalAlpha=this.compoundAlpha*this.alpha,this._transformLayer(l,t,a),this.filter&&(l.filter=this.filter)}}),o.save(),n&&this._isInteractiveMask()&&(n._transformMargin(o,t,r.margin),n._runPath(o),o.clip()),this._transformMargin(o,t,r.margin),this._render(e),o.restore(),G(s,a=>{a&&a.context.restore()})}}_render(e){if(this.exportable===!1){const t=this._layer||e;t.tainted=!0}}hovering(){return this._renderer._hovering.has(this)}dragging(){return this._renderer._dragging.some(e=>e.value===this)}shouldCancelTouch(){const e=this._renderer;return e.tapToActivate&&!e._touchActive?!1:this.cancelTouch?!0:this._parent?this._parent.shouldCancelTouch():!1}}class BR extends yd{constructor(){super(...arguments),Object.defineProperty(this,"interactiveChildren",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_childLayers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_children",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_isInteractiveMask(){return this.interactiveChildren||super._isInteractiveMask()}addChild(e){e._parent=this,this._children.push(e),e._layer&&this.registerChildLayer(e._layer)}addChildAt(e,t){e._parent=this,this._children.splice(t,0,e),e._layer&&this.registerChildLayer(e._layer)}removeChild(e){e._parent=void 0,pi(this._children,e)}_render(e){super._render(e);const t=this._renderer;this.interactive&&this.interactiveChildren&&++t._forceInteractive;const s=this._layer||e;G(this._children,r=>{r.compoundAlpha=this.compoundAlpha*this.alpha,r.render(s)}),this.interactive&&this.interactiveChildren&&--t._forceInteractive}registerChildLayer(e){this._childLayers||(this._childLayers=[]),al(this._childLayers,e),this._parent&&this._parent.registerChildLayer(e)}markDirtyLayer(e=!1){super.markDirtyLayer(),e&&this._childLayers&&G(this._childLayers,t=>t.dirty=!0)}_dispose(){super._dispose(),this._childLayers&&G(this._childLayers,e=>{e.dirty=!0})}}function Mt(i,e){i.left=Math.min(i.left,e.x),i.top=Math.min(i.top,e.y),i.right=Math.max(i.right,e.x),i.bottom=Math.max(i.bottom,e.y)}class Qt{colorize(e,t){}path(e){}addBounds(e){}}class gc extends Qt{constructor(e){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){t!==void 0?e.fillStyle=t:e.fillStyle=this.color}}class WR extends Qt{constructor(e){super(),Object.defineProperty(this,"clearShadow",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fill(),this.clearShadow&&(e.shadowColor="",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}class jR extends Qt{colorize(e,t){e.stroke()}}class fc extends Qt{constructor(e,t,s){super(),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lineJoin",{enumerable:!0,configurable:!0,writable:!0,value:s})}colorize(e,t){t!==void 0?e.strokeStyle=t:e.strokeStyle=this.color,e.lineWidth=this.width,this.lineJoin&&(e.lineJoin=this.lineJoin)}}class UR extends Qt{constructor(e){super(),Object.defineProperty(this,"dash",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.setLineDash(this.dash)}}class zR extends Qt{constructor(e){super(),Object.defineProperty(this,"dashOffset",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.lineDashOffset=this.dashOffset}}class YR extends Qt{constructor(e,t,s,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.rect(this.x,this.y,this.width,this.height)}addBounds(e){const t=this.x,s=this.y,r=t+this.width,o=s+this.height;Mt(e,{x:t,y:s}),Mt(e,{x:r,y:s}),Mt(e,{x:t,y:o}),Mt(e,{x:r,y:o})}}class $R extends Qt{constructor(e,t,s){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.moveTo(this.x+this.radius,this.y),e.arc(this.x,this.y,this.radius,0,2*Math.PI)}addBounds(e){Mt(e,{x:this.x-this.radius,y:this.y-this.radius}),Mt(e,{x:this.x+this.radius,y:this.y+this.radius})}}class KR extends Qt{constructor(e,t,s,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radiusX",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"radiusY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.ellipse(0,0,this.radiusX,this.radiusY,0,0,Math.PI*2)}addBounds(e){Mt(e,{x:this.x-this.radiusX,y:this.y-this.radiusY}),Mt(e,{x:this.x+this.radiusX,y:this.y+this.radiusY})}}class XR extends Qt{constructor(e,t,s,r,o,n){super(),Object.defineProperty(this,"cx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cy",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"endAngle",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"anticlockwise",{enumerable:!0,configurable:!0,writable:!0,value:n})}path(e){this.radius>0&&e.arc(this.cx,this.cy,this.radius,this.startAngle,this.endAngle,this.anticlockwise)}addBounds(e){let t=cR(this.cx,this.cy,this.startAngle*Fa,this.endAngle*Fa,this.radius);Mt(e,{x:t.left,y:t.top}),Mt(e,{x:t.right,y:t.bottom})}}class qR extends Qt{constructor(e,t,s,r,o){super(),Object.defineProperty(this,"x1",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y1",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"x2",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"y2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:o})}path(e){this.radius>0&&e.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)}addBounds(e){}}class QR extends Qt{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.lineTo(this.x,this.y)}addBounds(e){Mt(e,{x:this.x,y:this.y})}}class ZR extends Qt{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.moveTo(this.x,this.y)}addBounds(e){Mt(e,{x:this.x,y:this.y})}}class JR extends Qt{path(e){e.closePath()}}class e0 extends Qt{constructor(e,t,s,r,o,n){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"cpX2",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"cpY2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:n})}path(e){e.bezierCurveTo(this.cpX,this.cpY,this.cpX2,this.cpY2,this.toX,this.toY)}addBounds(e){Mt(e,{x:this.cpX,y:this.cpY}),Mt(e,{x:this.cpX2,y:this.cpY2}),Mt(e,{x:this.toX,y:this.toY})}}class t0 extends Qt{constructor(e,t,s,r){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.quadraticCurveTo(this.cpX,this.cpY,this.toX,this.toY)}addBounds(e){Mt(e,{x:this.cpX,y:this.cpY}),Mt(e,{x:this.toX,y:this.toY})}}class i0 extends Qt{constructor(e,t,s,r,o){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"blur",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"offsetX",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"offsetY",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"opacity",{enumerable:!0,configurable:!0,writable:!0,value:o})}colorize(e,t){this.opacity&&(e.fillStyle=this.color),e.shadowColor=this.color,e.shadowBlur=this.blur,e.shadowOffsetX=this.offsetX,e.shadowOffsetY=this.offsetY}}class s0 extends Qt{constructor(e,t,s,r,o){super(),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:o})}path(e){e.drawImage(this.image,this.x,this.y,this.width,this.height)}addBounds(e){Mt(e,{x:this.x,y:this.y}),Mt(e,{x:this.width,y:this.height})}}class r0 extends yd{constructor(){super(...arguments),Object.defineProperty(this,"_operations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"blendMode",{enumerable:!0,configurable:!0,writable:!0,value:yh.NORMAL}),Object.defineProperty(this,"_hasShadows",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_fillAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}clear(){super.clear(),this._operations.length=0}_pushOp(e){this._operations.push(e)}beginFill(e,t=1){this._fillAlpha=t,e?e instanceof ge?this._pushOp(new gc(e.toCSS(t))):(this.isMeasured=!0,this._pushOp(new gc(e))):this._pushOp(new gc("rgba(0, 0, 0, "+t+")"))}endFill(){this._pushOp(new WR(this._hasShadows))}endStroke(){this._pushOp(new jR)}lineStyle(e=0,t,s=1,r){this._strokeAlpha=s,t?t instanceof ge?this._pushOp(new fc(e,t.toCSS(s),r)):this._pushOp(new fc(e,t,r)):this._pushOp(new fc(e,"rgba(0, 0, 0, "+s+")",r))}setLineDash(e){this._pushOp(new UR(e||[]))}setLineDashOffset(e=0){this._pushOp(new zR(e))}drawRect(e,t,s,r){this._pushOp(new YR(e,t,s,r))}drawCircle(e,t,s){this._pushOp(new $R(e,t,s))}drawEllipse(e,t,s,r){this._pushOp(new KR(e,t,s,r))}arc(e,t,s,r,o,n=!1){this._pushOp(new XR(e,t,s,r,o,n))}arcTo(e,t,s,r,o){this._pushOp(new qR(e,t,s,r,o))}lineTo(e,t){this._pushOp(new QR(e,t))}moveTo(e,t){this._pushOp(new ZR(e,t))}bezierCurveTo(e,t,s,r,o,n){this._pushOp(new e0(e,t,s,r,o,n))}quadraticCurveTo(e,t,s,r){this._pushOp(new t0(e,t,s,r))}closePath(){this._pushOp(new JR)}shadow(e,t=0,s=0,r=0,o){this._hasShadows=!0,this._pushOp(new i0(o?e.toCSS(o):e.toCSS(this._fillAlpha||this._strokeAlpha),t,s,r))}image(e,t,s,r,o){this._pushOp(new s0(e,t,s,r,o))}svgPath(e){let t=0,s=0,r=null,o=null,n=null,a=null;const l=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,u=/[\u0009\u0020\u000A\u000C\u000D]*([\+\-]?[0-9]*\.?[0-9]+(?:[eE][\+\-]?[0-9]+)?)[\u0009\u0020\u000A\u000C\u000D]*,?/g;let h;for(;(h=l.exec(e))!==null;){const d=h[1],c=h[2],p=[];for(;(h=u.exec(c))!==null;)p.push(h[1]);switch(d!=="S"&&d!=="s"&&d!=="C"&&d!=="c"&&(r=null,o=null),d!=="Q"&&d!=="q"&&d!=="T"&&d!=="t"&&(n=null,a=null),d){case"M":Oi(d,p.length,2),t=+p[0],s=+p[1],this.moveTo(t,s);for(let f=2;f<p.length;f+=2)t=+p[f],s=+p[f+1],this.lineTo(t,s);break;case"m":Oi(d,p.length,2),t+=+p[0],s+=+p[1],this.moveTo(t,s);for(let f=2;f<p.length;f+=2)t+=+p[f],s+=+p[f+1],this.lineTo(t,s);break;case"L":Oi(d,p.length,2);for(let f=0;f<p.length;f+=2)t=+p[f],s=+p[f+1],this.lineTo(t,s);break;case"l":Oi(d,p.length,2);for(let f=0;f<p.length;f+=2)t+=+p[f],s+=+p[f+1],this.lineTo(t,s);break;case"H":Da(d,p.length,1);for(let f=0;f<p.length;++f)t=+p[f],this.lineTo(t,s);break;case"h":Da(d,p.length,1);for(let f=0;f<p.length;++f)t+=+p[f],this.lineTo(t,s);break;case"V":Da(d,p.length,1);for(let f=0;f<p.length;++f)s=+p[f],this.lineTo(t,s);break;case"v":Da(d,p.length,1);for(let f=0;f<p.length;++f)s+=+p[f],this.lineTo(t,s);break;case"C":Oi(d,p.length,6);for(let f=0;f<p.length;f+=6){const w=+p[f],_=+p[f+1];r=+p[f+2],o=+p[f+3],t=+p[f+4],s=+p[f+5],this.bezierCurveTo(w,_,r,o,t,s)}break;case"c":Oi(d,p.length,6);for(let f=0;f<p.length;f+=6){const w=+p[f]+t,_=+p[f+1]+s;r=+p[f+2]+t,o=+p[f+3]+s,t+=+p[f+4],s+=+p[f+5],this.bezierCurveTo(w,_,r,o,t,s)}break;case"S":Oi(d,p.length,4),(r===null||o===null)&&(r=t,o=s);for(let f=0;f<p.length;f+=4){const w=2*t-r,_=2*s-o;r=+p[f],o=+p[f+1],t=+p[f+2],s=+p[f+3],this.bezierCurveTo(w,_,r,o,t,s)}break;case"s":Oi(d,p.length,4),(r===null||o===null)&&(r=t,o=s);for(let f=0;f<p.length;f+=4){const w=2*t-r,_=2*s-o;r=+p[f]+t,o=+p[f+1]+s,t+=+p[f+2],s+=+p[f+3],this.bezierCurveTo(w,_,r,o,t,s)}break;case"Q":Oi(d,p.length,4);for(let f=0;f<p.length;f+=4)n=+p[f],a=+p[f+1],t=+p[f+2],s=+p[f+3],this.quadraticCurveTo(n,a,t,s);break;case"q":Oi(d,p.length,4);for(let f=0;f<p.length;f+=4)n=+p[f]+t,a=+p[f+1]+s,t+=+p[f+2],s+=+p[f+3],this.quadraticCurveTo(n,a,t,s);break;case"T":Oi(d,p.length,2),(n===null||a===null)&&(n=t,a=s);for(let f=0;f<p.length;f+=2)n=2*t-n,a=2*s-a,t=+p[f],s=+p[f+1],this.quadraticCurveTo(n,a,t,s);break;case"t":Oi(d,p.length,2),(n===null||a===null)&&(n=t,a=s);for(let f=0;f<p.length;f+=2)n=2*t-n,a=2*s-a,t+=+p[f],s+=+p[f+1],this.quadraticCurveTo(n,a,t,s);break;case"A":case"a":const y=d==="a";GR(p),Oi(d,p.length,7);for(let f=0;f<p.length;f+=7){let w=+p[f+5],_=+p[f+6];y&&(w+=t,_+=s);const P=NR({px:t,py:s,rx:+p[f],ry:+p[f+1],xAxisRotation:+p[f+2],largeArcFlag:Pf(+p[f+3]),sweepFlag:Pf(+p[f+4]),cx:w,cy:_});G(P,T=>{this.bezierCurveTo(T.x1,T.y1,T.x2,T.y2,T.x,T.y),t=T.x,s=T.y})}break;case"Z":case"z":kR(d,p.length,0),this.closePath();break}}}_runPath(e){e.beginPath(),G(this._operations,t=>{t.path(e)})}_render(e){super._render(e);const t=this._layer||e,s=t.dirty,r=this._isInteractive();if(s||r){const o=t.context,n=this._renderer._ghostLayer.context;s&&(o.globalCompositeOperation=this.blendMode,o.beginPath());let a;r&&(n.beginPath(),a=this._getColorId()),G(this._operations,l=>{s&&(l.path(o),l.colorize(o,void 0)),r&&(l.path(n),l.colorize(n,a))})}}renderDetached(e){if(this.visible){this._setMatrix(),e.save();const t=this.mask;t&&(t._setMatrix(),t._transform(e,1),t._runPath(e),e.clip()),e.globalAlpha=this.compoundAlpha*this.alpha,this._transform(e,1),this.filter&&(e.filter=this.filter),e.globalCompositeOperation=this.blendMode,e.beginPath(),G(this._operations,s=>{s.path(e),s.colorize(e,void 0)}),e.restore()}}_addBounds(e){this.visible&&this.isMeasured&&G(this._operations,t=>{t.addBounds(e)})}}class fy extends yd{constructor(e,t,s){super(e),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_textInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_textVisible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:1}),this.text=t,this.style=s}invalidateBounds(){super.invalidateBounds(),this._textInfo=void 0}_shared(e){this.style.textAlign&&(e.textAlign=this.style.textAlign),this.style.direction&&(e.direction=this.style.direction),this.style.textBaseline&&(e.textBaseline=this.style.textBaseline)}_prerender(e,t=!1,s=!1){super._render(e);const r=e.context,o=this._renderer._ghostLayer.context,n=this.style;let a=this._getFontStyle(void 0,s);r.font=a,this._isInteractive()&&!t&&(o.font=a),n.fill&&(n.fill instanceof ge?r.fillStyle=n.fill.toCSS(n.fillOpacity!=null?n.fillOpacity:1):r.fillStyle=n.fill),n.shadowColor&&(e.context.shadowColor=n.shadowColor.toCSS(n.shadowOpacity||1)),n.shadowBlur&&(e.context.shadowBlur=n.shadowBlur),n.shadowOffsetX&&(e.context.shadowOffsetX=n.shadowOffsetX),n.shadowOffsetY&&(e.context.shadowOffsetY=n.shadowOffsetY),this._shared(r),this._isInteractive()&&!t&&(o.fillStyle=this._getColorId(),this._shared(o))}_getFontStyle(e,t=!1){const s=this.style;let r=[];return e&&e.fontVariant?r.push(e.fontVariant):s.fontVariant&&r.push(s.fontVariant),t||(e&&e.fontWeight?r.push(e.fontWeight):s.fontWeight&&r.push(s.fontWeight)),e&&e.fontStyle?r.push(e.fontStyle):s.fontStyle&&r.push(s.fontStyle),e&&e.fontSize?(B(e.fontSize)&&(e.fontSize=e.fontSize+"px"),r.push(e.fontSize)):s.fontSize&&(B(s.fontSize)&&(s.fontSize=s.fontSize+"px"),r.push(s.fontSize)),e&&e.fontFamily?r.push(e.fontFamily):s.fontFamily?r.push(s.fontFamily):r.length&&r.push("Arial"),r.join(" ")}_render(e){const t=this._layer||e;if(this._textInfo||this._measure(t),this._textVisible){const s=this._isInteractive(),r=t.context,o=t.dirty,n=this._renderer._ghostLayer.context;r.save(),n.save(),this._prerender(t),G(this._textInfo,(a,l)=>{G(a.textChunks,(u,h)=>{if(u.style&&(r.save(),n.save(),r.font=u.style,this._isInteractive()&&(n.font=u.style)),u.fill&&(r.save(),r.fillStyle=u.fill.toCSS()),o&&r.fillText(u.text,u.offsetX,a.offsetY+u.offsetY),u.textDecoration=="underline"||u.textDecoration=="line-through"){let d=1,c=1,p=u.height,y=u.offsetX;switch(this.style.textAlign){case"right":case"end":y-=u.width;break;case"center":y-=u.width/2;break}if(u.style)switch(Cs.getTextStyle(u.style).fontWeight){case"bolder":case"bold":case"700":case"800":case"900":d=2;break}p&&(c=p/20);let f;u.textDecoration=="line-through"?f=d+a.offsetY+u.offsetY-u.height/2:f=d+c*1.5+a.offsetY+u.offsetY,r.save(),r.beginPath(),u.fill?r.strokeStyle=u.fill.toCSS():this.style.fill&&this.style.fill instanceof ge&&(r.strokeStyle=this.style.fill.toCSS()),r.lineWidth=d*c,r.moveTo(y,f),r.lineTo(y+u.width,f),r.stroke(),r.restore()}s&&this.interactive&&n.fillText(u.text,u.offsetX,a.offsetY+u.offsetY),u.fill&&r.restore(),u.style&&(r.restore(),n.restore())})}),r.restore(),n.restore()}}_addBounds(e){if(this.visible&&this.isMeasured){const t=this._measure(this.getLayer());Mt(e,{x:t.left,y:t.top}),Mt(e,{x:t.right,y:t.bottom})}}_ignoreFontWeight(){return/apple/i.test(navigator.vendor)}_measure(e){const t=e.context,s=this._renderer._ghostLayer.context,r=this.style.direction=="rtl";this._textInfo=[];const o=this.style.oversizedBehavior,n=this.style.maxWidth,a=B(n)&&o=="truncate",l=B(n)&&(o=="wrap"||o=="wrap-no-break");t.save(),s.save(),this._prerender(e,!0,this._ignoreFontWeight());const u="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",h=this.text.toString().replace(/\r/g,"").split(/\n/);let d=!0,c=0,p=0,y=0,f;G(h,(_,P)=>{let T;for(_==""?T=[{type:"value",text:""}]:T=Cs.chunk(_,!1,this.style.ignoreFormatting);T.length>0;){let D={offsetY:y,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};const M=this._measureText(u,t),O=M.actualBoundingBoxAscent+M.actualBoundingBoxDescent;D.height=O,D.ascent=M.actualBoundingBoxAscent;let N,z=this.style.textDecoration,Y,W,$=!1,ee=!0,re=[],me;XC(T,(he,ce)=>{if(he.type=="format")if(he.text=="[/]")d||(t.restore(),s.restore(),d=!0),Y=void 0,f=void 0,W=void 0,z=this.style.textDecoration,me=void 0,N=he.text;else{d||(t.restore(),s.restore());let ne=Cs.getTextStyle(he.text);const oe=this._getFontStyle(ne);t.save(),s.save(),t.font=oe,f=oe,N=he.text,ne.textDecoration&&(z=ne.textDecoration),ne.fill&&(Y=ne.fill),ne.width&&(W=Ni(ne.width)),ne.verticalAlign&&(me=ne.verticalAlign),d=!1;const Q=this._measureText(u,t),pe=Q.actualBoundingBoxAscent+Q.actualBoundingBoxDescent;pe>D.height&&(D.height=pe),Q.actualBoundingBoxAscent>D.ascent&&(D.ascent=Q.actualBoundingBoxAscent)}else if(he.type=="value"&&!$){const ne=this._measureText(he.text,t);let oe=ne.actualBoundingBoxLeft+ne.actualBoundingBoxRight;if(a){let ve=ee||this.style.breakWords||!1;const we=this.style.ellipsis||"",Ze=this._measureText(we,t),Ie=Ze.actualBoundingBoxLeft+Ze.actualBoundingBoxRight;if(D.width+oe>n){const De=n-D.width-Ie;he.text=this._truncateText(t,he.text,De,ve),he.text+=we,$=!0}}else if(l&&D.width+oe>n){const ve=n-D.width,we=this._truncateText(t,he.text,ve,!1,ee&&this.style.oversizedBehavior!="wrap-no-break");if(we=="")return this._textVisible=!0,!1;re=T.slice(ce+1),ju(we)!=ju(he.text)&&(re.unshift({type:"value",text:he.text.substr(we.length)}),N&&re.unshift({type:"format",text:N})),he.text=ju(we),T=[],$=!0}let Q=1,pe=1;if(f&&W&&W>oe){const ve=oe/W;switch(this.style.textAlign){case"right":case"end":Q=ve;break;case"center":Q=ve,pe=ve;break;default:pe=ve}oe=W}const _e=ne.actualBoundingBoxAscent+ne.actualBoundingBoxDescent;_e>D.height&&(D.height=_e),ne.actualBoundingBoxAscent>D.ascent&&(D.ascent=ne.actualBoundingBoxAscent),D.width+=oe,D.left+=ne.actualBoundingBoxLeft/Q,D.right+=ne.actualBoundingBoxRight/pe,D.textChunks.push({style:f,fill:Y,text:he.text,width:oe,height:_e,left:ne.actualBoundingBoxLeft,right:ne.actualBoundingBoxRight,ascent:ne.actualBoundingBoxAscent,offsetX:0,offsetY:0,textDecoration:z,verticalAlign:me}),ee=!1}return!0}),this.style.lineHeight instanceof He?(D.height*=this.style.lineHeight.value,D.ascent*=this.style.lineHeight.value):(D.height*=this.style.lineHeight||1.2,D.ascent*=this.style.lineHeight||1.2),c<D.left&&(c=D.left),p<D.right&&(p=D.right),this._textInfo.push(D),y+=D.height,T=re||[]}}),d||(t.restore(),s.restore()),G(this._textInfo,(_,P)=>{let T=0;G(_.textChunks,D=>{if(D.offsetX=T+D.left-_.left,D.offsetY+=_.height-_.height*(this.style.baselineRatio||.19),T+=D.width,D.verticalAlign)switch(D.verticalAlign){case"super":D.offsetY-=_.height/2-D.height/2;break;case"sub":D.offsetY+=D.height/2;break}})});const w={left:r?-p:-c,top:0,right:r?c:p,bottom:y};if(o!=="none"){const _=this._fitRatio(w);if(_<1)if(o=="fit")B(this.style.minScale)&&_<this.style.minScale?this._textVisible=!1:((!this._originalScale||this._originalScale==1)&&(this._originalScale=this.scale),this.scale=_,this._textVisible=!0);else if(o=="hide")this._textVisible=!1;else{switch(this.style.textAlign){case"right":case"end":w.left=-n,w.right=0;break;case"center":w.left=-n/2,w.right=n/2;break;default:w.left=0,w.right=n}this.scale=this._originalScale||1,this._originalScale=void 0,this._textVisible=!0}else this.scale=this._originalScale||1,this._originalScale=void 0,this._textVisible=!0}return t.restore(),s.restore(),w}_fitRatio(e){const t=this.style.maxWidth,s=this.style.maxHeight;if(!B(t)&&!B(s))return 1;const r=e.right-e.left,o=e.bottom-e.top;return Math.min(t/r||1,s/o||1)}_truncateText(e,t,s,r=!1,o=!0){let n;do{if(r)t=t.slice(0,-1);else{let l=t.replace(/[^,;:!?\\\/\s]+[,;:!?\\\/\s]*$/g,"");if(l==""&&o)r=!0;else{if(l=="")return t;t=l}}const a=this._measureText(t,e);n=a.actualBoundingBoxLeft+a.actualBoundingBoxRight}while(n>s&&t!="");return t}_measureText(e,t){let s=t.measureText(e),r={};if(s.actualBoundingBoxAscent==null){const n=document.createElement("div");n.innerText=e,n.style.visibility="hidden",n.style.position="absolute",n.style.top="-1000000px;",n.style.fontFamily=this.style.fontFamily||"",n.style.fontSize=this.style.fontSize+"",document.body.appendChild(n);const a=n.getBoundingClientRect();document.body.removeChild(n);const l=a.height,u=s.width;r={actualBoundingBoxAscent:l,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:u,fontBoundingBoxAscent:l,fontBoundingBoxDescent:0,width:u}}else r={actualBoundingBoxAscent:s.actualBoundingBoxAscent,actualBoundingBoxDescent:s.actualBoundingBoxDescent,actualBoundingBoxLeft:s.actualBoundingBoxLeft,actualBoundingBoxRight:s.actualBoundingBoxRight,fontBoundingBoxAscent:s.actualBoundingBoxAscent,fontBoundingBoxDescent:s.actualBoundingBoxDescent,width:s.width};const o=s.width;switch(this.style.textAlign){case"right":case"end":r.actualBoundingBoxLeft=o,r.actualBoundingBoxRight=0;break;case"center":r.actualBoundingBoxLeft=o/2,r.actualBoundingBoxRight=o/2;break;default:r.actualBoundingBoxLeft=0,r.actualBoundingBoxRight=o}return r}}class o0{constructor(){Object.defineProperty(this,"fill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fillOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textAlign",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontFamily",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontWeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontVariant",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textDecoration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lineHeight",{enumerable:!0,configurable:!0,writable:!0,value:ds(120)}),Object.defineProperty(this,"baselineRatio",{enumerable:!0,configurable:!0,writable:!0,value:.19}),Object.defineProperty(this,"direction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textBaseline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oversizedBehavior",{enumerable:!0,configurable:!0,writable:!0,value:"none"}),Object.defineProperty(this,"breakWords",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ellipsis",{enumerable:!0,configurable:!0,writable:!0,value:"…"}),Object.defineProperty(this,"maxWidth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxHeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreFormatting",{enumerable:!0,configurable:!0,writable:!0,value:!1})}}class n0 extends fy{constructor(){super(...arguments),Object.defineProperty(this,"textType",{enumerable:!0,configurable:!0,writable:!0,value:"circular"}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inside",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"orientation",{enumerable:!0,configurable:!0,writable:!0,value:"auto"}),Object.defineProperty(this,"kerning",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_textReversed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_render(e){switch(this.textType){case"circular":this._renderCircular(e);break;default:super._render(e);break}}_renderCircular(e){if(this._textVisible){const t=this._layer||e;this._prerender(t);const s=this._isInteractive(),r=t.context,o=t.dirty,n=this._renderer._ghostLayer.context;r.save(),s&&n.save();let a=this.radius||0,l=this.startAngle||0,u=0,h=this.orientation,d=h=="auto"?"auto":h=="inward";const c=this.inside,p=this.style.textAlign||"left",y=this.kerning||0;let f=p=="left"?1:-1;const w=!this._textReversed;if(this._textInfo||this._measure(t),d=="auto"){let _=0,P=0;G(this._textInfo,(T,D)=>{const M=l+T.width/(a-T.height)/2*-f;M>_&&(_=M)}),p=="left"?P=(_+u/2)*Fa:p=="right"?P=(_-u/2)*Fa:P=l*Fa,P=dR(P),d=P>=270||P<=90}d==!0&&w&&(this._textInfo.reverse(),this._textReversed=!0),G(this._textInfo,(_,P)=>{const T=_.height;c||(a+=T),(f==-1&&d||f==1&&!d)&&w&&_.textChunks.reverse();let D=l;u=0,p=="center"&&(D+=_.width/(a-T)/2*-f,u=D-l),D+=Math.PI*(d?0:1),r.save(),s&&n.save(),r.rotate(D),s&&n.rotate(D);let M=0;G(_.textChunks,(O,N)=>{const z=O.text,Y=O.width;M=Y/2/(a-T)*f,r.rotate(M),s&&n.rotate(M),O.style&&(r.save(),n.save(),r.font=O.style,s&&(n.font=O.style)),O.fill&&(r.save(),r.fillStyle=O.fill.toCSS()),r.textBaseline="middle",r.textAlign="center",s&&(n.textBaseline="middle",n.textAlign="center"),o&&r.fillText(z,0,(d?1:-1)*(0-a+T/2)),s&&n.fillText(z,0,(d?1:-1)*(0-a+T/2)),O.fill&&r.restore(),O.style&&(r.restore(),n.restore()),M=(Y/2+y)/(a-T)*f,r.rotate(M),s&&n.rotate(M)}),r.restore(),s&&n.restore(),c&&(a-=T)}),r.restore(),s&&n.restore()}}_measure(e){switch(this.textType){case"circular":return this._measureCircular(e);default:return super._measure(e)}}_measureCircular(e){const t=e.context,s=this._renderer._ghostLayer.context,r=this.style.direction=="rtl",o=this.style.oversizedBehavior,n=this.style.maxWidth,a=B(n)&&o=="truncate",l=this.style.ellipsis||"";let u;this._textVisible=!0,this._textInfo=[],this._textReversed=!1,t.save(),s.save(),this._prerender(e,!0);const h=this.text.toString().replace(/\r/g,"").split(/\n/);let d=!0,c=0,p=0;return G(h,(y,f)=>{let w=Cs.chunk(y,!1,this.style.ignoreFormatting),_={offsetY:p,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]},P,T,D;G(w,(M,O)=>{if(M.type=="format"){if(M.text=="[/]")d||(t.restore(),s.restore(),d=!0),T=void 0,P=void 0,D=void 0;else{let N=Cs.getTextStyle(M.text);const z=this._getFontStyle(N);t.save(),s.save(),t.font=z,P=z,N.fill&&(T=N.fill),N.width&&(D=Ni(N.width)),d=!1}a&&(u=this._measureText(l,t))}else if(M.type=="value"){const N=M.text.match(/./ug)||[];r&&N.reverse();for(let z=0;z<N.length;z++){const Y=N[z],W=this._measureText(Y,t);let $=W.width;P&&D&&D>$&&($=D);const ee=W.actualBoundingBoxAscent+W.actualBoundingBoxDescent;if(ee>_.height&&(_.height=ee),W.actualBoundingBoxAscent>_.ascent&&(_.ascent=W.actualBoundingBoxAscent),_.width+=$,_.left+=W.actualBoundingBoxLeft,_.right+=W.actualBoundingBoxRight,_.textChunks.push({style:P,fill:T,text:Y,width:$,height:ee+W.actualBoundingBoxDescent,left:W.actualBoundingBoxLeft,right:W.actualBoundingBoxRight,ascent:W.actualBoundingBoxAscent,offsetX:0,offsetY:ee,textDecoration:void 0}),c+=$,a){u||(u=this._measureText(l,t));const re=u.actualBoundingBoxLeft+u.actualBoundingBoxRight;if(c+=re,c+re>n){_.textChunks.length==1?this._textVisible=!1:(_.width+=re,_.left+=u.actualBoundingBoxLeft,_.right+=u.actualBoundingBoxRight,_.textChunks.push({style:P,fill:T,text:l,width:re,height:ee+u.actualBoundingBoxDescent,left:u.actualBoundingBoxLeft,right:u.actualBoundingBoxRight,ascent:u.actualBoundingBoxAscent,offsetX:0,offsetY:ee,textDecoration:void 0}));break}}if(r)break}}}),this.style.lineHeight instanceof He?_.height*=this.style.lineHeight.value:_.height*=this.style.lineHeight||1.2,this._textInfo.push(_),p+=_.height}),d||(t.restore(),s.restore()),o=="hide"&&c>n&&(this._textVisible=!1),G(this._textInfo,y=>{G(y.textChunks,f=>{f.offsetY+=Math.round((y.height-f.height+(y.ascent-f.ascent))/2)})}),t.restore(),s.restore(),{left:0,top:0,right:0,bottom:0}}}class a0 extends yd{constructor(e,t){super(e),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_imageMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.image=t}_dispose(){super._dispose(),this._imageMask&&Pa(this._imageMask)}getLocalBounds(){if(!this._localBounds){let e=0,t=0;this.width&&(e=this.width),this.height&&(t=this.height),this._localBounds={left:0,top:0,right:e,bottom:t},this._addBounds(this._localBounds)}return this._localBounds}_render(e){if(super._render(e),this.image){const t=this._layer||e;if(this.tainted===void 0&&(this.tainted=Af(this.image),t.tainted=!0),this.tainted&&this._renderer._omitTainted)return;if(t.dirty){this.shadowColor&&(t.context.shadowColor=this.shadowColor.toCSS(this.shadowOpacity||1)),this.shadowBlur&&(t.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(t.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(t.context.shadowOffsetY=this.shadowOffsetY);const s=this.width||this.image.naturalWidth,r=this.height||this.image.naturalHeight;t.context.drawImage(this.image,0,0,s,r)}if(this.interactive&&this._isInteractive()){const s=this._getMask(this.image);this._renderer._ghostLayer.context.drawImage(s,0,0)}}}clear(){super.clear(),this.image=void 0,this._imageMask=void 0}_getMask(e){if(this._imageMask===void 0){const t=this.width||e.naturalWidth,s=this.height||e.naturalHeight,r=document.createElement("canvas");r.width=t,r.height=s;const o=r.getContext("2d");o.imageSmoothingEnabled=!1,o.fillStyle=this._getColorId(),o.fillRect(0,0,t,s),Af(e)||(o.globalCompositeOperation="destination-in",o.drawImage(e,0,0,t,s)),this._imageMask=r}return this._imageMask}}class l0{constructor(e,t,s,r){Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"originalPoint",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"point",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"bbox",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simulated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"native",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Ls("touchevents")&&e instanceof Touch?this.id=e.identifier:this.id=null}}class u0 extends Gx{constructor(e){if(super(),Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"_layerDom",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"layers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_dirtyLayers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"defaultLayer",{enumerable:!0,configurable:!0,writable:!0,value:this.getLayer(0)}),Object.defineProperty(this,"_ghostLayer",{enumerable:!0,configurable:!0,writable:!0,value:new h0}),Object.defineProperty(this,"_patternCanvas",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("canvas")}),Object.defineProperty(this,"_patternContext",{enumerable:!0,configurable:!0,writable:!0,value:this._patternCanvas.getContext("2d")}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_clientWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_clientHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interactionsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_colorMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_forceInteractive",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_omitTainted",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_hovering",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_dragging",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mousedown",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_lastPointerMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tapToActivate",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tapToActivateTimeout",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"_touchActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_touchActiveTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e==null?this.resolution=window.devicePixelRatio:this.resolution=e,this.view.style.position="absolute",this.view.appendChild(this._layerDom),this._disposers.push(new Vt(()=>{$e(this._events,(t,s)=>{s.disposer.dispose()}),G(this.layers,t=>{Pa(t.view),t.exportableView&&Pa(t.exportableView)}),Pa(this._ghostLayer.view),Pa(this._patternCanvas)})),this._disposers.push(JC(()=>{e==null&&(this.resolution=window.devicePixelRatio)})),Ls("touchevents")){const t=s=>{this._dragging.length!==0&&XC(this._dragging,r=>r.value.shouldCancelTouch()?(s.preventDefault(),!1):!0),this._touchActiveTimeout&&this._delayTouchDeactivate()};this._disposers.push(tt(window,"touchstart",t,{passive:!1})),this._disposers.push(tt(this.view,"touchstart",t,{passive:!1})),this._disposers.push(tt(this.view,"touchmove",()=>{this._touchActiveTimeout&&this._delayTouchDeactivate()},{passive:!0})),this._disposers.push(tt(window,"click",s=>{this._touchActive=!1},{passive:!0})),this._disposers.push(tt(this.view,"click",s=>{window.setTimeout(()=>{this._touchActive=!0,this._delayTouchDeactivate()},100)},{passive:!0}))}Ls("wheelevents")&&this._disposers.push(tt(this.view,"wheel",t=>{let s=!1;this._hovering.forEach(r=>{if(r.wheelable)return s=!0,!1}),s&&t.preventDefault()},{passive:!1}))}_delayTouchDeactivate(){this._touchActiveTimeout&&clearTimeout(this._touchActiveTimeout),this.tapToActivateTimeout>0&&(this._touchActiveTimeout=window.setTimeout(()=>{this._touchActive=!1},this.tapToActivateTimeout))}get debugGhostView(){return!!this._ghostLayer.view.parentNode}set debugGhostView(e){e?this._ghostLayer.view.parentNode||this.view.appendChild(this._ghostLayer.view):this._ghostLayer.view.parentNode&&this._ghostLayer.view.parentNode.removeChild(this._ghostLayer.view)}createLinearGradient(e,t,s,r){return this.defaultLayer.context.createLinearGradient(e,t,s,r)}createRadialGradient(e,t,s,r,o,n){return this.defaultLayer.context.createRadialGradient(e,t,s,r,o,n)}createPattern(e,t,s,r,o){return this._patternCanvas.width=r,this._patternCanvas.height=o,this._patternContext.clearRect(0,0,r,o),t.renderDetached(this._patternContext),e.renderDetached(this._patternContext),this._patternContext.createPattern(this._patternCanvas,s)}makeContainer(){return new BR(this)}makeGraphics(){return new r0(this)}makeText(e,t){return new fy(this,e,t)}makeTextStyle(){return new o0}makeRadialText(e,t){return new n0(this,e,t)}makePicture(e){return new a0(this,e)}resizeLayer(e){e.dirty=!0,e.resize(this._clientWidth,this._clientHeight,this.resolution)}resizeGhost(){this._ghostLayer.resize(this._clientWidth,this._clientHeight,this.resolution)}resize(e,t){this._clientWidth=e,this._clientHeight=t,this._width=Math.floor(e*this.resolution),this._height=Math.floor(t*this.resolution),G(this.layers,s=>{s&&this.resizeLayer(s)}),this.resizeGhost(),this.view.style.width=e+"px",this.view.style.height=t+"px"}createDetachedLayer(e=!1){const t=document.createElement("canvas"),s=t.getContext("2d",{willReadFrequently:e}),r=new d0(t,s);return t.style.position="absolute",t.style.top="0px",t.style.left="0px",r}getLayerByOrder(e){const t=this.layers,s=t.length;for(let r=0;r<s;r++){const o=t[r];if(o.order==e)return o}}getLayer(e,t=!0){let s=this.getLayerByOrder(e);if(s)return s;const r=this.createDetachedLayer(e==99);r.order=e,r.visible=t,r.visible&&this._width&&(r.view.width=this._width,r.view.style.width=this._clientWidth+"px",r.view.height=this._height,r.view.style.height=this._clientHeight+"px");const o=this.layers;o.push(r),o.sort((u,h)=>u.order>h.order?1:u.order<h.order?-1:0);const n=o.length,a=nl(o,r);let l;for(let u=a+1;u<n;u++)if(o[u].visible){l=o[u];break}return r.visible&&(l===void 0?this._layerDom.appendChild(r.view):this._layerDom.insertBefore(r.view,l.view)),r}render(e){if(this._dirtyLayers.length=0,G(this.layers,t=>{t&&t.dirty&&t.visible&&(this._dirtyLayers.push(t),t.clear())}),this._ghostLayer.clear(),e.render(this.defaultLayer),this._ghostLayer.context.restore(),G(this.layers,t=>{if(t){const s=t.context;s.beginPath(),s.moveTo(0,0),s.stroke()}}),G(this._dirtyLayers,t=>{t.context.restore(),t.dirty=!1}),this._hovering.size&&this._lastPointerMoveEvent){const t=this._lastPointerMoveEvent.native;G(this._lastPointerMoveEvent.events,s=>{this._dispatchGlobalMousemove(s,t)})}}paintId(e){const t=VR(++this._colorId),s=ge.fromHex(t).toCSS();return this._colorMap[s]=e,s}_removeObject(e){e._colorId!==void 0&&delete this._colorMap[e._colorId]}_adjustBoundingBox(e){const t=this._ghostLayer.margin;return new DOMRect(e.left-t.left,e.top-t.top,e.width+t.left+t.right,e.height+t.top+t.bottom)}getEvent(e,t=!0){const s=this.view.getBoundingClientRect(),r={x:e.clientX||0,y:e.clientY||0},o={x:r.x-(t?s.left:0),y:r.y-(t?s.top:0)};return new l0(e,r,o,this._adjustBoundingBox(s))}_getHitTarget(e,t){if(!(t.width===0||t.height===0||e.x<t.left||e.x>t.right||e.y<t.top||e.y>t.bottom)){const s=this._ghostLayer.getImageData(e,t);if(s.data[0]===0&&s.data[1]===0&&s.data[2]===0)return!1;const r=ge.fromRGB(s.data[0],s.data[1],s.data[2]).toCSS();return this._colorMap[r]}}_withEvents(e,t){const s=this._events[e];if(s!==void 0){s.dispatching=!0;try{t(s)}finally{s.dispatching=!1,s.cleanup&&(s.cleanup=!1,gd(s.callbacks,r=>!r.disposed),s.callbacks.length===0&&(s.disposer.dispose(),delete this._events[e]))}}}_dispatchEventAll(e,t){this.interactionsEnabled&&this._withEvents(e,s=>{G(s.callbacks,r=>{r.disposed||r.callback.call(r.context,t)})})}_dispatchEvent(e,t,s){if(!this.interactionsEnabled)return!1;let r=!1;return this._withEvents(e,o=>{G(o.callbacks,n=>{!n.disposed&&n.object===t&&(n.callback.call(n.context,s),r=!0)})}),r}_dispatchMousedown(e){const t=e.button;if(t!=0&&t!=2&&t!=1&&t!==void 0)return;const s=this.getEvent(e),r=this._getHitTarget(s.originalPoint,s.bbox);if(r){const o=s.id;let n=!1;xu(r,a=>{const l={id:o,value:a};return this._mousedown.push(l),!n&&this._dispatchEvent("pointerdown",a,s)&&(n=!0,this._dragging.some(h=>h.value===a&&h.id===o)||this._dragging.push(l)),!0})}}_dispatchGlobalMousemove(e,t){const s=this.getEvent(e),r=this._getHitTarget(s.originalPoint,s.bbox);s.native=t,r?(this._hovering.forEach(o=>{o.contains(r)||(this._hovering.delete(o),o.cursorOverStyle&&uc(document.body,"cursor",o._replacedCursorStyle),this._dispatchEvent("pointerout",o,s))}),s.native&&xu(r,o=>(this._hovering.has(o)||(this._hovering.add(o),o.cursorOverStyle&&(o._replacedCursorStyle=Ux(document.body,"cursor"),uc(document.body,"cursor",o.cursorOverStyle)),this._dispatchEvent("pointerover",o,s)),!0))):(this._hovering.forEach(o=>{o.cursorOverStyle&&uc(document.body,"cursor",o._replacedCursorStyle),this._dispatchEvent("pointerout",o,s)}),this._hovering.clear()),this._dispatchEventAll("globalpointermove",s)}_dispatchGlobalMouseup(e,t){const s=this.getEvent(e);s.native=t,this._dispatchEventAll("globalpointerup",s)}_dispatchDragMove(e){if(this._dragging.length!==0){const t=this.getEvent(e),s=t.id;this._dragging.forEach(r=>{r.id===s&&this._dispatchEvent("pointermove",r.value,t)})}}_dispatchDragEnd(e){const t=e.button;let s;if(t==0||t===void 0)s="click";else if(t==2)s="rightclick";else if(t==1)s="middleclick";else return;const r=this.getEvent(e),o=r.id;if(this._mousedown.length!==0){const n=this._getHitTarget(r.originalPoint,r.bbox);n&&this._mousedown.forEach(a=>{a.id===o&&a.value.contains(n)&&this._dispatchEvent(s,a.value,r)}),this._mousedown.length=0}this._dragging.length!==0&&(this._dragging.forEach(n=>{n.id===o&&this._dispatchEvent("pointerup",n.value,r)}),this._dragging.length=0)}_dispatchDoubleClick(e){const t=this.getEvent(e),s=this._getHitTarget(t.originalPoint,t.bbox);s&&xu(s,r=>!this._dispatchEvent("dblclick",r,t))}_dispatchWheel(e){const t=this.getEvent(e),s=this._getHitTarget(t.originalPoint,t.bbox);s&&xu(s,r=>!this._dispatchEvent("wheel",r,t))}_makeSharedEvent(e,t){if(this._listeners[e]===void 0){const s=t();this._listeners[e]=new mg(()=>{delete this._listeners[e],s.dispose()})}return this._listeners[e].increment()}_onPointerEvent(e,t){let s=!1,r=null;function o(){r=null,s=!1}return new di([new Vt(()=>{r!==null&&clearTimeout(r),o()}),tt(this.view,ll(e),n=>{s=!0,r!==null&&clearTimeout(r),r=window.setTimeout(o,0)}),Tf(window,e,n=>{r!==null&&(clearTimeout(r),r=null),t(n,s),s=!1})])}_initEvent(e){switch(e){case"globalpointermove":case"pointerover":case"pointerout":return this._makeSharedEvent("pointermove",()=>{const t=(s,r)=>{this._lastPointerMoveEvent={events:s,native:r},G(s,o=>{this._dispatchGlobalMousemove(o,r)})};return new di([this._onPointerEvent("pointerdown",t),this._onPointerEvent("pointermove",t)])});case"globalpointerup":return this._makeSharedEvent("pointerup",()=>{var t=this._onPointerEvent("pointerup",(r,o)=>{G(r,n=>{this._dispatchGlobalMouseup(n,o)}),this._lastPointerMoveEvent={events:r,native:o}}),s=this._onPointerEvent("pointercancel",(r,o)=>{G(r,n=>{this._dispatchGlobalMouseup(n,o)}),this._lastPointerMoveEvent={events:r,native:o}});return new Vt(()=>{t.dispose(),s.dispose()})});case"click":case"rightclick":case"middleclick":case"pointerdown":case"pointermove":case"pointerup":return this._makeSharedEvent("pointerdown",()=>{const t=Tf(this.view,"pointerdown",n=>{G(n,a=>{this._dispatchMousedown(a)})}),s=this._onPointerEvent("pointermove",n=>{G(n,a=>{this._dispatchDragMove(a)})}),r=this._onPointerEvent("pointerup",n=>{G(n,a=>{this._dispatchDragEnd(a)})}),o=this._onPointerEvent("pointercancel",n=>{G(n,a=>{this._dispatchDragEnd(a)})});return new Vt(()=>{t.dispose(),s.dispose(),r.dispose(),o.dispose()})});case"dblclick":return this._makeSharedEvent("dblclick",()=>this._onPointerEvent("dblclick",t=>{G(t,s=>{this._dispatchDoubleClick(s)})}));case"wheel":return this._makeSharedEvent("wheel",()=>tt(window,ll("wheel"),t=>{this._dispatchWheel(t)},{passive:!1}))}}_addEvent(e,t,s,r){let o=this._events[t];o===void 0&&(o=this._events[t]={disposer:this._initEvent(t),callbacks:[],dispatching:!1,cleanup:!1});const n={object:e,context:r,callback:s,disposed:!1};return o.callbacks.push(n),new Vt(()=>{n.disposed=!0,o.dispatching?o.cleanup=!0:(pi(o.callbacks,n),o.callbacks.length===0&&(o.disposer.dispose(),delete this._events[t]))})}getCanvas(e,t){this.render(e),t||(t={});let s=this.resolution;if(t.minWidth&&t.minWidth>this._width){let p=t.minWidth/this._width;p>s&&(s=p*this.resolution)}if(t.minHeight&&t.minHeight>this._height){let p=t.minHeight/this._height;p>s&&(s=p*this.resolution)}if(t.maxWidth&&t.maxWidth<this._width){let p=t.maxWidth/this._width;p<s&&(s=p*this.resolution)}if(t.maxHeight&&t.maxHeight>this._height){let p=t.maxHeight/this._height;p<s&&(s=p*this.resolution)}t.maintainPixelRatio&&(s/=this.resolution);const r=[];let o=!1,n=this._width,a=this._height;const l=document.createElement("canvas");s!=this.resolution&&(o=!0,n=this._width*s/this.resolution,a=this._height*s/this.resolution),l.width=n,l.height=a,l.style.position="fixed",l.style.top="-10000px",this.view.appendChild(l),r.push(l);const u=l.getContext("2d");let h=0,d=0,c=!1;return G(this.layers,p=>{p&&p.visible&&(p.tainted||o)&&(c=!0,p.exportableView=p.view,p.exportableContext=p.context,p.view=document.createElement("canvas"),p.view.style.position="fixed",p.view.style.top="-10000px",this.view.appendChild(p.view),r.push(p.view),p.view.width=n,p.view.height=a,p.context=p.view.getContext("2d"),p.dirty=!0,p.scale=s)}),c&&(this._omitTainted=!0,this.render(e),this._omitTainted=!1),G(this.layers,p=>{p&&p.visible&&(u.drawImage(p.view,0,0),p.exportableView&&(p.view=p.exportableView,p.exportableView=void 0),p.exportableContext&&(p.context=p.exportableContext,p.exportableContext=void 0),h<p.view.clientWidth&&(h=p.view.clientWidth),d<p.view.clientHeight&&(d=p.view.clientHeight),p.scale=void 0)}),l.style.width=h+"px",l.style.height=d+"px",G(r,p=>{p.style.position="",p.style.top="",this.view.removeChild(p)}),l}}class h0{constructor(){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=document.createElement("canvas"),this.context=this.view.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.view.style.position="absolute",this.view.style.top="0px",this.view.style.left="0px"}resize(e,t,s){e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px",this._width=Math.floor(e*s),this._height=Math.floor(t*s),this.view.width=this._width,this.view.style.width=e+"px",this.view.height=this._height,this.view.style.height=t+"px"}getImageData(e,t){return this.context.getImageData(Math.round((e.x-t.left)/t.width*this._width),Math.round((e.y-t.top)/t.height*this._height),1,1)}setMargin(e){this.margin.left=0,this.margin.right=0,this.margin.top=0,this.margin.bottom=0,G(e,t=>{t.margin&&(this.margin.left=Math.max(this.margin.left,t.margin.left),this.margin.right=Math.max(this.margin.right,t.margin.right),this.margin.top=Math.max(this.margin.top,t.margin.top),this.margin.bottom=Math.max(this.margin.bottom,t.margin.bottom))})}clear(){this.context.save(),this.context.fillStyle="#000",this.context.fillRect(0,0,this._width,this._height)}}class d0{constructor(e,t){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"order",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dirty",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportableView",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exportableContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=e,this.context=t}resize(e,t,s){this.width!=null&&(e=this.width),this.height!=null&&(t=this.height),this.margin?(e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px"):(this.view.style.left="0px",this.view.style.top="0px"),this._width=Math.floor(e*s),this._height=Math.floor(t*s),this.view.width=this._width,this.view.style.width=e+"px",this.view.height=this._height,this.view.style.height=t+"px"}clear(){this.context.save(),this.context.clearRect(0,0,this._width,this._height)}}function Ff(i,e){i==null?requestAnimationFrame(e):setTimeout(()=>{requestAnimationFrame(e)},1e3/i)}class wd{constructor(e,t={},s){if(Object.defineProperty(this,"dom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_inner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyBounds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPositions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_ticker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_tickers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_updateTick",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new qn}),Object.defineProperty(this,"animationTime",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_animations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tooltipContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipContainerSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltip",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"language",{enumerable:!0,configurable:!0,writable:!0,value:FR.new(this,{})}),Object.defineProperty(this,"locale",{enumerable:!0,configurable:!0,writable:!0,value:gy}),Object.defineProperty(this,"utc",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timezone",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fps",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numberFormatter",{enumerable:!0,configurable:!0,writable:!0,value:DR.new(this,{})}),Object.defineProperty(this,"dateFormatter",{enumerable:!0,configurable:!0,writable:!0,value:TR.new(this,{})}),Object.defineProperty(this,"durationFormatter",{enumerable:!0,configurable:!0,writable:!0,value:AR.new(this,{})}),Object.defineProperty(this,"tabindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_tabindexes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_a11yD",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusedSprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isShift",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_keyboardDragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_readerAlertElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_logo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDiv",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nonce",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interfaceColors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalLayout",{enumerable:!0,configurable:!0,writable:!0,value:Fn.new(this,{})}),Object.defineProperty(this,"horizontalLayout",{enumerable:!0,configurable:!0,writable:!0,value:An.new(this,{})}),Object.defineProperty(this,"gridLayout",{enumerable:!0,configurable:!0,writable:!0,value:bo.new(this,{})}),Object.defineProperty(this,"autoResize",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_fontHash",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_isDisposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_resizeSensorDisposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltips",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_htmlElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlEnabledContainers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),!s)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");t.accessible==!1&&(this._a11yD=!0),t.useSafeResolution==null&&(t.useSafeResolution=!0);let r;t.useSafeResolution&&(r=Kx()),this._renderer=new u0(r);let o;if(e instanceof HTMLElement?o=e:o=document.getElementById(e),G(ps.rootElements,l=>{if(l.dom===o)throw new Error("You cannot have multiple Roots on the same DOM node")}),this.interfaceColors=wh.new(this,{}),o===null)throw new Error("Could not find HTML element with id `"+e+"`");this.dom=o;let n=document.createElement("div");n.style.position="relative",n.style.height="100%",o.appendChild(n);const a=t.tooltipContainerBounds;a&&(this._tooltipContainerSettings=a),this._inner=n,this._updateComputedStyles(),ps.rootElements.push(this)}static new(e,t){const s=new wd(e,t,!0);return s._init(),s}moveDOM(e){let t;if(e instanceof HTMLElement?t=e:t=document.getElementById(e),t){for(;this.dom.childNodes.length>0;)t.appendChild(this.dom.childNodes[0]);this.dom=t,this._initResizeSensor(),this.resize()}}_handleLogo(){if(this._logo){const e=this.dom.offsetWidth,t=this.dom.offsetHeight;e<=150||t<=60?this._logo.hide():this._logo.show()}}_showBranding(){if(!this._logo){const e=this.tooltipContainer.children.push(Te.new(this,{interactive:!0,interactiveChildren:!1,position:"absolute",setStateOnChildren:!0,paddingTop:9,paddingRight:9,paddingBottom:9,paddingLeft:9,scale:.6,y:ds(100),centerY:ue,tooltipText:"Created using amCharts 5",tooltipX:ue,cursorOverStyle:"pointer",background:Hi.new(this,{fill:mt(4671320),fillOpacity:0,tooltipY:5})})),t=zs.new(this,{pointerOrientation:"horizontal",paddingTop:4,paddingRight:7,paddingBottom:4,paddingLeft:7});t.label.setAll({fontSize:12}),t.get("background").setAll({fill:this.interfaceColors.get("background"),stroke:this.interfaceColors.get("grid"),strokeOpacity:.3}),e.set("tooltip",t),e.events.on("click",()=>{window.open("https://www.amcharts.com/","_blank")}),e.states.create("hover",{}),e.children.push(it.new(this,{stroke:mt(13421772),strokeWidth:3,svgPath:"M5 25 L13 25h13.6c3.4 0 6 0 10.3-4.3s5.2-12 8.6-12c3.4 0 4.3 8.6 7.7 8.6M83.4 25H79.8c-3.4 0-6 0-10.3-4.3s-5.2-12-8.6-12-4.3 8.6-7.7 8.6"})).states.create("hover",{stroke:mt(3976191)}),e.children.push(it.new(this,{stroke:mt(8947848),strokeWidth:3,svgPath:"M83.4 25h-31C37 25 39.5 4.4 28.4 4.4S18.9 24.2 4.3 25H0"})).states.create("hover",{stroke:mt(4671320)}),this._logo=e,this._handleLogo()}}_init(){const e=this._renderer,t=this.dom.getBoundingClientRect(),s=Math.floor(t.width),r=Math.floor(t.height),o=Te.new(this,{visible:!0,width:s,height:r});this._rootContainer=o,this._rootContainer._defaultThemes.push(MR.new(this));const n=o.children.push(Te.new(this,{visible:!0,width:ue,height:ue}));this.container=n,e.resize(s,r),this._inner.appendChild(e.view),this._initResizeSensor();const a=document.createElement("div");if(this._htmlElementContainer=a,a.className="am5-html-container",a.style.position="absolute",a.style.pointerEvents="none",this._tooltipContainerSettings||(a.style.overflow="hidden"),this._inner.appendChild(a),this._a11yD!==!0){const l=document.createElement("div");l.className="am5-reader-container",l.setAttribute("role","alert"),l.style.zIndex="-100000",l.style.opacity="0",l.style.position="absolute",l.style.top="0",this._readerAlertElement=l,this._inner.appendChild(this._readerAlertElement);const u=document.createElement("div");u.className="am5-focus-container",u.style.position="absolute",u.style.pointerEvents="none",u.style.top="0px",u.style.left="0px",u.style.overflow="hidden",u.style.width=s+"px",u.style.height=r+"px",u.setAttribute("role","application"),xa(u,!1),this._focusElementContainer=u,this._inner.appendChild(this._focusElementContainer);const h=document.createElement("div");this._tooltipElementContainer=h,h.className="am5-tooltip-container",this._inner.appendChild(h),Ls("keyboardevents")&&(this._disposers.push(tt(window,"keydown",d=>{d.keyCode==16&&(this._isShift=!0)})),this._disposers.push(tt(window,"keyup",d=>{d.keyCode==16&&(this._isShift=!1)})),this._disposers.push(tt(u,"keydown",d=>{const c=this._focusedSprite;if(c){d.keyCode==27&&(ey(),this._focusedSprite=void 0);let p=0,y=0;switch(d.keyCode){case 13:d.preventDefault();const f=e.getEvent(new MouseEvent("click"));c.events.dispatch("click",{type:"click",originalEvent:f.event,point:f.point,simulated:!0,target:c});return;case 37:p=-6;break;case 39:p=6;break;case 38:y=-6;break;case 40:y=6;break;default:return}if(p!=0||y!=0){if(d.preventDefault(),!c.isDragging()){this._keyboardDragPoint={x:0,y:0};const _=e.getEvent(new MouseEvent("mousedown",{clientX:0,clientY:0}));c.events.isEnabled("pointerdown")&&c.events.dispatch("pointerdown",{type:"pointerdown",originalEvent:_.event,point:_.point,simulated:!0,target:c})}const f=this._keyboardDragPoint;f.x+=p,f.y+=y;const w=e.getEvent(new MouseEvent("mousemove",{clientX:f.x,clientY:f.y}),!1);c.events.isEnabled("globalpointermove")&&c.events.dispatch("globalpointermove",{type:"globalpointermove",originalEvent:w.event,point:w.point,simulated:!0,target:c})}}})),this._disposers.push(tt(u,"keyup",d=>{if(this._focusedSprite){const c=this._focusedSprite,p=d.keyCode;switch(p){case 37:case 39:case 38:case 40:if(c.isDragging()){const y=this._keyboardDragPoint,f=e.getEvent(new MouseEvent("mouseup",{clientX:y.x,clientY:y.y}));c.events.isEnabled("globalpointerup")&&c.events.dispatch("globalpointerup",{type:"globalpointerup",originalEvent:f.event,point:f.point,simulated:!0,target:c}),this._keyboardDragPoint=void 0;return}else if(c.get("focusableGroup")){const y=c.get("focusableGroup"),f=this._tabindexes.filter(P=>P.get("focusableGroup")==y);let w=f.indexOf(c);const _=f.length-1;w+=p==39||p==40?1:-1,w<0?w=_:w>_&&(w=0),jx(f[w].getPrivate("focusElement").dom)}break}}})))}this._startTicker(),this.setThemes([]),this._addTooltip(),this._hasLicense()||this._showBranding()}_initResizeSensor(){this._resizeSensorDisposer&&this._resizeSensorDisposer.dispose(),this._resizeSensorDisposer=new RR(this.dom,()=>{this.autoResize&&this.resize()}),this._disposers.push(this._resizeSensorDisposer)}resize(){const t=this.dom.getBoundingClientRect(),s=Math.floor(t.width),r=Math.floor(t.height);if(s>0&&r>0){const o=this._htmlElementContainer;if(o.style.width=s+"px",o.style.height=r+"px",this._a11yD!==!0){const a=this._focusElementContainer;a.style.width=s+"px",a.style.height=r+"px"}this._renderer.resize(s,r);const n=this._rootContainer;n.setPrivate("width",s),n.setPrivate("height",r),this._render(),this._handleLogo()}}_render(){this._renderer.render(this._rootContainer._display),this._focusElementDirty&&(this._updateCurrentFocus(),this._focusElementDirty=!1)}_runTickers(e){G(this._tickers,t=>{t(e)})}_runAnimations(e){gd(this._animations,t=>t._runAnimation(e))}_runDirties(){let e={};for(;this._isDirtyParents;)this._isDirtyParents=!1,Ht(this._dirtyParents).forEach(n=>{const a=this._dirtyParents[n];delete this._dirtyParents[n],a.isDisposed()||(e[a.uid]=a,a._prepareChildren())});Ht(e).forEach(n=>{e[n]._updateChildren()});const t=[];Ht(this._dirty).forEach(n=>{const a=this._dirty[n];a.isDisposed()?delete this._dirty[a.uid]:(t.push(a),a._beforeChanged())}),t.forEach(n=>{n._changed(),delete this._dirty[n.uid],n._clearDirty()}),this._isDirty=!1;const s={},r=[];Ht(this._dirtyBounds).forEach(n=>{const a=this._dirtyBounds[n];delete this._dirtyBounds[n],a.isDisposed()||(s[a.uid]=a.depth(),r.push(a))}),r.sort((n,a)=>Is(s[a.uid],s[n.uid])),r.forEach(n=>{n._updateBounds()});const o=this._dirtyPositions;Ht(o).forEach(n=>{const a=o[n];delete o[n],a.isDisposed()||a._updatePosition()}),t.forEach(n=>{n._afterChanged()})}_renderFrame(e){return this._updateTick?(this.events.isEnabled("framestarted")&&this.events.dispatch("framestarted",{type:"framestarted",target:this,timestamp:e}),this._checkComputedStyles(),this._runTickers(e),this._runAnimations(e),this._runDirties(),this._render(),this._positionHTMLElements(),this.events.isEnabled("frameended")&&this.events.dispatch("frameended",{type:"frameended",target:this,timestamp:e}),this._tickers.length===0&&this._animations.length===0&&!this._isDirty):!0}_runTicker(e){this.isDisposed()||(this.animationTime=e,this._renderFrame(e)?(this._ticker=null,this.animationTime=null):Ff(this.fps,this._ticker))}_runTickerNow(){if(!this.isDisposed())for(;;){const e=performance.now();if(this.animationTime=e,this._renderFrame(e)){this.animationTime=null;break}}}_startTicker(){this._ticker===null&&(this.animationTime=null,this._ticker=e=>{this._runTicker(e)},Ff(this.fps,this._ticker))}get updateTick(){return this._updateTick}set updateTick(e){this._updateTick=e,e&&this._startTicker()}_addDirtyEntity(e){this._dirty[e.uid]===void 0&&(this._isDirty=!0,this._dirty[e.uid]=e,this._startTicker())}_addDirtyParent(e){this._dirtyParents[e.uid]===void 0&&(this._isDirty=!0,this._isDirtyParents=!0,this._dirtyParents[e.uid]=e,this._startTicker())}_addDirtyBounds(e){this._dirtyBounds[e.uid]===void 0&&(this._isDirty=!0,this._dirtyBounds[e.uid]=e,this._startTicker())}_addDirtyPosition(e){this._dirtyPositions[e.uid]===void 0&&(this._isDirty=!0,this._dirtyPositions[e.uid]=e,this._startTicker())}_addAnimation(e){this._animations.indexOf(e)===-1&&(this._animations.push(e),this._startTicker())}_markDirty(){this._isDirty=!0}_markDirtyRedraw(){this.events.once("frameended",()=>{this._isDirty=!0,this._startTicker()})}eachFrame(e){return this._tickers.push(e),this._startTicker(),new Vt(()=>{pi(this._tickers,e)})}markDirtyGlobal(e){e||(e=this.container),e.walkChildren(t=>{t instanceof Te&&this.markDirtyGlobal(t),t.markDirty(),t.markDirtyBounds()})}width(){return Math.floor(this.dom.getBoundingClientRect().width)}height(){return Math.floor(this.dom.getBoundingClientRect().height)}dispose(){this._isDisposed||(this._isDisposed=!0,this._rootContainer.dispose(),this._renderer.dispose(),this.horizontalLayout.dispose(),this.verticalLayout.dispose(),this.interfaceColors.dispose(),G(this._disposers,e=>{e.dispose()}),this._inner&&Wx(this._inner),Yi(ps.rootElements,this))}isDisposed(){return this._isDisposed}readerAlert(e){this._a11yD!==!0&&(this._readerAlertElement.innerHTML=Cf(e))}setThemes(e){this._rootContainer.set("themes",e);const t=this.tooltipContainer;t&&t._applyThemes();const s=this.interfaceColors;s&&s._applyThemes()}_addTooltip(){if(!this.tooltipContainer){const e=this._tooltipContainerSettings,t=this._rootContainer.children.push(Te.new(this,{position:"absolute",isMeasured:!1,width:ue,height:ue,layer:e?35:30,layerMargin:e||void 0}));this.tooltipContainer=t;const s=zs.new(this,{});this.container.set("tooltip",s),s.hide(0),this._tooltip=s}}_registerTabindexOrder(e){this._a11yD!=!0&&(e.get("focusable")?al(this._tabindexes,e):Yi(this._tabindexes,e),this._invalidateTabindexes())}_unregisterTabindexOrder(e){this._a11yD!=!0&&(Yi(this._tabindexes,e),this._invalidateTabindexes())}_invalidateTabindexes(){if(this._a11yD==!0)return;this._tabindexes.sort((t,s)=>{const r=t.get("tabindexOrder",0),o=s.get("tabindexOrder",0);return r==o?0:r>o?1:-1});const e=[];G(this._tabindexes,(t,s)=>{t.getPrivate("focusElement")?this._moveFocusElement(s,t):this._makeFocusElement(s,t);const r=t.get("focusableGroup");r&&(e.indexOf(r)!==-1?t.getPrivate("focusElement").dom.setAttribute("tabindex","-1"):e.push(r))})}_updateCurrentFocus(){this._a11yD!=!0&&this._focusedSprite&&(this._decorateFocusElement(this._focusedSprite),this._positionFocusElement(this._focusedSprite))}_decorateFocusElement(e,t){if(this._a11yD==!0||(t||(t=e.getPrivate("focusElement").dom),!t))return;e.get("visible")&&e.get("role")!="tooltip"&&!e.isHidden()?t.getAttribute("tabindex")!="-1"&&t.setAttribute("tabindex",""+this.tabindex):t.removeAttribute("tabindex");const s=e.get("role");s?t.setAttribute("role",s):t.removeAttribute("role");const r=e.get("ariaLabel");if(r){const p=dl(e,r);t.setAttribute("aria-label",p)}else t.removeAttribute("aria-label");const o=e.get("ariaLive");o?t.setAttribute("aria-live",o):t.removeAttribute("aria-live");const n=e.get("ariaChecked");n!=null?t.setAttribute("aria-checked",n?"true":"false"):t.removeAttribute("aria-checked"),e.get("ariaHidden")?t.setAttribute("aria-hidden","hidden"):t.removeAttribute("aria-hidden");const a=e.get("ariaOrientation");a?t.setAttribute("aria-orientation",a):t.removeAttribute("aria-orientation");const l=e.get("ariaValueNow");l?t.setAttribute("aria-valuenow",l):t.removeAttribute("aria-valuenow");const u=e.get("ariaValueMin");u?t.setAttribute("aria-valuemin",u):t.removeAttribute("aria-valuemin");const h=e.get("ariaValueMax");h?t.setAttribute("aria-valuemax",h):t.removeAttribute("aria-valuemax");const d=e.get("ariaValueText");d?t.setAttribute("aria-valuetext",d):t.removeAttribute("aria-valuetext");const c=e.get("ariaControls");c?t.setAttribute("aria-controls",c):t.removeAttribute("aria-controls")}_makeFocusElement(e,t){if(t.getPrivate("focusElement")||this._a11yD==!0)return;const s=document.createElement("div");t.get("role")!="tooltip"&&(s.tabIndex=this.tabindex),s.style.position="absolute",xa(s,!1);const r=[];t.setPrivate("focusElement",{dom:s,disposers:r}),this._decorateFocusElement(t),r.push(tt(s,"focus",o=>{this._handleFocus(o,e)})),r.push(tt(s,"blur",o=>{this._handleBlur(o,e)})),this._moveFocusElement(e,t)}_removeFocusElement(e){if(this._a11yD==!0)return;Yi(this._tabindexes,e);const t=e.getPrivate("focusElement");t&&(this._focusElementContainer.removeChild(t.dom),G(t.disposers,r=>{r.dispose()}))}_hideFocusElement(e){if(this._a11yD==!0)return;const t=e.getPrivate("focusElement");t.dom.style.display="none"}_moveFocusElement(e,t){if(this._a11yD==!0)return;const s=this._focusElementContainer,r=t.getPrivate("focusElement").dom;if(r===this._focusElementContainer.children[e])return;const o=this._focusElementContainer.children[e+1];o?s.insertBefore(r,o):s.append(r)}_positionFocusElement(e){if(this._a11yD==!0)return;const t=e.globalBounds(),s=t.right==t.left?e.width():t.right-t.left,r=t.top==t.bottom?e.height():t.bottom-t.top,o=e.getPrivate("focusElement").dom;o.style.top=t.top-2+"px",o.style.left=t.left-2+"px",o.style.width=s+4+"px",o.style.height=r+4+"px"}_handleFocus(e,t){if(this._a11yD==!0)return;const s=this._tabindexes[t];if(!s.isVisibleDeep()){this._focusNext(e.target,this._isShift?-1:1);return}this._positionFocusElement(s),this._focusedSprite=s,s.events.isEnabled("focus")&&s.events.dispatch("focus",{type:"focus",originalEvent:e,target:s})}_focusNext(e,t){if(this._a11yD==!0)return;var s=Array.from(document.querySelectorAll(["a[href]","area[href]","button:not([disabled])","details","input:not([disabled])","iframe:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contentEditable=""]','[contentEditable="true"]','[contentEditable="TRUE"]','[tabindex]:not([tabindex^="-"])'].join(",")));let r=s.indexOf(e)+t;r<0?r=s.length-1:r>=s.length&&(r=0),s[r].focus()}_handleBlur(e,t){if(this._a11yD==!0)return;const s=this._focusedSprite;s&&s.events.isEnabled("blur")&&s.events.dispatch("blur",{type:"blur",originalEvent:e,target:s}),this._focusedSprite=void 0}updateTooltip(e){if(this._a11yD==!0)return;const t=Cf(e._getText());let s=e.getPrivate("tooltipElement");e.get("role")=="tooltip"&&t!=""?(s||(s=this._makeTooltipElement(e)),s.innerHTML!=t&&(s.innerHTML=t)):s&&(s.remove(),e.removePrivate("tooltipElement"))}_makeTooltipElement(e){const t=this._tooltipElementContainer,s=document.createElement("div");return s.style.position="absolute",s.style.top="-1000000px",s.style.opacity="0.0000001",xa(s,!1),this._decorateFocusElement(e,s),t.append(s),e.setPrivate("tooltipElement",s),s}_removeTooltipElement(e){if(this._a11yD==!0)return;const t=e.getPrivate("tooltipElement");if(t){const s=t.parentElement;s&&s.removeChild(t)}}_invalidateAccessibility(e){if(this._a11yD==!0)return;this._focusElementDirty=!0;const t=e.getPrivate("focusElement");e.get("focusable")?t&&(this._decorateFocusElement(e),this._positionFocusElement(e)):t&&this._removeFocusElement(e)}focused(e){return this._focusedSprite===e}documentPointToRoot(e){const t=this.dom.getBoundingClientRect();return{x:e.x-t.left,y:e.y-t.top}}rootPointToDocument(e){const t=this.dom.getBoundingClientRect();return{x:e.x+t.left,y:e.y+t.top}}addDisposer(e){return this._disposers.push(e),e}_updateComputedStyles(){const e=window.getComputedStyle(this.dom);let t="";$e(e,(r,o)=>{Pn(r)&&r.match(/^font/)&&(t+=o)});const s=t!=this._fontHash;return s&&(this._fontHash=t),s}_checkComputedStyles(){this._updateComputedStyles()&&this._invalidateLabelBounds(this.container)}_invalidateLabelBounds(e){e instanceof Te?e.children.each(t=>{this._invalidateLabelBounds(t)}):e instanceof cl&&e.markDirtyBounds()}_hasLicense(){for(let e=0;e<ps.licenses.length;e++)if(ps.licenses[e].match(/^AM5C.{5,}/i))return!0;return!1}_licenseApplied(){this._logo&&this._logo.set("forceHidden",!0)}get debugGhostView(){return this._renderer.debugGhostView}set debugGhostView(e){this._renderer.debugGhostView=e}set tapToActivate(e){this._renderer.tapToActivate=e}get tapToActivate(){return this._renderer.tapToActivate}set tapToActivateTimeout(e){this._renderer.tapToActivateTimeout=e}get tapToActivateTimeout(){return this._renderer.tapToActivateTimeout}_makeHTMLElement(e){const t=this._htmlElementContainer,s=document.createElement("div");return e.setPrivate("htmlElement",s),s.style.position="absolute",s.style.overflow="auto",s.style.boxSizing="border-box",xa(s,!0),e.events.isEnabled("click")&&this._disposers.push(tt(s,"click",r=>{const o=this._renderer.getEvent(r);e.events.dispatch("click",{type:"click",originalEvent:o.event,point:o.point,simulated:!1,target:e})})),this._positionHTMLElement(e),t.append(s),al(this._htmlEnabledContainers,e),s}_positionHTMLElements(){G(this._htmlEnabledContainers,e=>{this._positionHTMLElement(e)})}_positionHTMLElement(e){const t=e.getPrivate("htmlElement");if(t){G(["paddingTop","paddingRight","paddingBottom","paddingLeft","minWidth","minHeight","maxWidth","maxHeight"],d=>{const c=e.get(d);c?t.style[d]=c+"px":t.style[d]=""});const r=e.compositeOpacity();setTimeout(()=>{t.style.opacity=r+""},10);const o=e.isVisibleDeep();o&&(t.style.display="block");const n=e.globalBounds();t.style.top=n.top+"px",t.style.left=n.left+"px";const a=e.get("width"),l=e.get("height");let u=0,h=0;if(a&&(u=e.width()),l&&(h=e.height()),!a||!l){t.style.width="",t.style.height="";const d=t.getBoundingClientRect();u=d.width,h=d.height,e._adjustedLocalBounds={left:0,right:0,top:0,bottom:0},e.setPrivate("minWidth",u),e.setPrivate("minHeight",h)}else e.removePrivate("minWidth"),e.removePrivate("minHeight");u>0&&(t.style.minWidth=u+"px"),h>0&&(t.style.minHeight=h+"px"),(!o||r==0)&&(t.style.display="none")}}_setHTMLContent(e,t){let s=e.getPrivate("htmlElement");s||(s=this._makeHTMLElement(e)),s.innerHTML!=t&&(s.innerHTML=t)}_removeHTMLContent(e){let t=e.getPrivate("htmlElement");t&&this._htmlElementContainer.removeChild(t),Yi(this._htmlEnabledContainers,e)}}class Mn extends Hi{_beforeChanged(){super._beforeChanged(),(this.isDirty("cornerRadiusTL")||this.isDirty("cornerRadiusTR")||this.isDirty("cornerRadiusBR")||this.isDirty("cornerRadiusBL"))&&(this._clear=!0)}_draw(){let e=this.width(),t=this.height(),s=e,r=t,o=s/Math.abs(e),n=r/Math.abs(t);if(B(s)&&B(r)){let a=Math.min(s,r)/2,l=ii(this.get("cornerRadiusTL",8),a),u=ii(this.get("cornerRadiusTR",8),a),h=ii(this.get("cornerRadiusBR",8),a),d=ii(this.get("cornerRadiusBL",8),a),c=Math.min(Math.abs(s/2),Math.abs(r/2));l=kt(l,0,c),u=kt(u,0,c),h=kt(h,0,c),d=kt(d,0,c);const p=this._display;p.moveTo(l*o,0),p.lineTo(s-u*o,0),u>0&&p.arcTo(s,0,s,u*n,u),p.lineTo(s,r-h*n),h>0&&p.arcTo(s,r,s-h*o,r,h),p.lineTo(d*o,r),d>0&&p.arcTo(0,r,0,r-d*n,d),p.lineTo(0,l*n),l>0&&p.arcTo(0,0,l*o,0,l),p.closePath()}}}Object.defineProperty(Mn,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RoundedRectangle"});Object.defineProperty(Mn,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Hi.classNames.concat([Mn.className])});let bh=class extends Te{_afterNew(){this._settings.themeTags=Ct(this._settings.themeTags,["button"]),super._afterNew(),this._settings.background||this.set("background",Mn.new(this._root,{themeTags:Ct(this._settings.themeTags,["background"])}))}_prepareChildren(){if(super._prepareChildren(),this.isDirty("icon")){const e=this._prevSettings.icon,t=this.get("icon");t!==e&&(this._disposeProperty("icon"),e&&e.dispose(),t&&this.children.push(t),this._prevSettings.icon=t)}if(this.isDirty("label")){const e=this._prevSettings.label,t=this.get("label");t!==e&&(this._disposeProperty("label"),e&&e.dispose(),t&&this.children.push(t),this._prevSettings.label=t)}}};Object.defineProperty(bh,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Button"});Object.defineProperty(bh,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Te.classNames.concat([bh.className])});class Sh extends it{_beforeChanged(){super._beforeChanged(),this.isDirty("radius")&&(this._clear=!0)}_changed(){super._changed(),this._clear&&this._display.drawCircle(0,0,this.get("radius",10))}}Object.defineProperty(Sh,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Circle"});Object.defineProperty(Sh,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:it.classNames.concat([Sh.className])});class c0 extends Qn{constructor(){super(...arguments),Object.defineProperty(this,"processor",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}incrementRef(){}decrementRef(){}_onPush(e){this.processor&&this.processor.processRow(e),super._onPush(e)}_onInsertIndex(e,t){this.processor&&this.processor.processRow(t),super._onInsertIndex(e,t)}_onSetIndex(e,t,s){this.processor&&this.processor.processRow(s),super._onSetIndex(e,t,s)}}class Ks extends cy{constructor(e,t,s){super(s),Object.defineProperty(this,"component",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"open",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"close",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dataContext=t,this.component=e,this._settings.visible=!0,this._checkDirty()}markDirty(){this.component.markDirtyValues(this)}_startAnimation(){this.component._root._addAnimation(this)}_animationTime(){return this.component._root.animationTime}_dispose(){this.component&&this.component.disposeDataItem(this),super._dispose()}show(e){this.setRaw("visible",!0),this.component&&this.component.showDataItem(this,e)}hide(e){this.setRaw("visible",!1),this.component&&this.component.hideDataItem(this,e)}isHidden(){return!this.get("visible")}}class So extends Te{constructor(){super(...arguments),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new c0}),Object.defineProperty(this,"_dataItems",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mainDataItems",{enumerable:!0,configurable:!0,writable:!0,value:this._dataItems}),Object.defineProperty(this,"valueFields",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"fields",{enumerable:!0,configurable:!0,writable:!0,value:["id"]}),Object.defineProperty(this,"_valueFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueFieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valuesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataChanged",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataGrouped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inited",{enumerable:!0,configurable:!0,writable:!0,value:!1})}set data(e){e.incrementRef(),this._data.decrementRef(),this._data=e}get data(){return this._data}_dispose(){super._dispose(),this._data.decrementRef()}_onDataClear(){}_afterNew(){super._afterNew(),this._data.incrementRef(),this._updateFields(),this._disposers.push(this.data.events.onAll(e=>{const t=this._mainDataItems;if(this.markDirtyValues(),this._markDirtyGroup(),this._dataChanged=!0,e.type==="clear")G(t,s=>{s.dispose()}),t.length=0,this._onDataClear();else if(e.type==="push"){const s=new Ks(this,e.newValue,this._makeDataItem(e.newValue));t.push(s),this.processDataItem(s)}else if(e.type==="setIndex"){const s=t[e.index],r=this._makeDataItem(e.newValue);Ht(r).forEach(o=>{s.animate({key:o,to:r[o],duration:this.get("interpolationDuration",0),easing:this.get("interpolationEasing")})}),s.dataContext=e.newValue}else if(e.type==="insertIndex"){const s=new Ks(this,e.newValue,this._makeDataItem(e.newValue));t.splice(e.index,0,s),this.processDataItem(s)}else if(e.type==="removeIndex")t[e.index].dispose(),t.splice(e.index,1);else if(e.type==="moveIndex"){const s=t[e.oldIndex];t.splice(e.oldIndex,1),t.splice(e.newIndex,0,s)}else throw new Error("Unknown IStreamEvent type");this._afterDataChange()}))}_updateFields(){this.valueFields&&(this._valueFields=[],this._valueFieldsF={},G(this.valueFields,e=>{this.get(e+"Field")&&(this._valueFields.push(e),this._valueFieldsF[e]={fieldKey:e+"Field",workingKey:e+"Working"})})),this.fields&&(this._fields=[],this._fieldsF={},G(this.fields,e=>{this.get(e+"Field")&&(this._fields.push(e),this._fieldsF[e]=e+"Field")}))}get dataItems(){return this._dataItems}processDataItem(e){}_makeDataItem(e){const t={};return this._valueFields&&G(this._valueFields,s=>{const r=this.get(this._valueFieldsF[s].fieldKey);t[s]=e[r],t[this._valueFieldsF[s].workingKey]=t[s]}),this._fields&&G(this._fields,s=>{const r=this.get(this._fieldsF[s]);t[s]=e[r]}),t}makeDataItem(e){let t=new Ks(this,void 0,e);return this.processDataItem(t),t}pushDataItem(e){const t=this.makeDataItem(e);return this._mainDataItems.push(t),t}disposeDataItem(e){}showDataItem(e,t){return Be(this,void 0,void 0,function*(){e.set("visible",!0)})}hideDataItem(e,t){return Be(this,void 0,void 0,function*(){e.set("visible",!1)})}_clearDirty(){super._clearDirty(),this._valuesDirty=!1}_afterDataChange(){}_afterChanged(){if(super._afterChanged(),this._dataChanged){const e="datavalidated";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this}),this._dataChanged=!1}this.inited=!0}markDirtyValues(e){this.markDirty(),this._valuesDirty=!0}_markDirtyGroup(){this._dataGrouped=!1}markDirtySize(){this._sizeDirty=!0,this.markDirty()}}Object.defineProperty(So,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Component"});Object.defineProperty(So,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Te.classNames.concat([So.className])});class pl extends Pt{_afterNew(){super._afterNewApplyThemes()}getFill(e){return{addColorStop:(t,s)=>{}}}_changed(){super._changed()}getBounds(e){const t=this.get("target");if(t){let s=t.globalBounds();const r=e.toLocal({x:s.left,y:s.top}),o=e.toLocal({x:s.right,y:s.top}),n=e.toLocal({x:s.right,y:s.bottom}),a=e.toLocal({x:s.left,y:s.bottom});return{left:Math.min(r.x,o.x,n.x,a.x),top:Math.min(r.y,o.y,n.y,a.y),right:Math.max(r.x,o.x,n.x,a.x),bottom:Math.max(r.y,o.y,n.y,a.y)}}return e._display.getLocalBounds()}}Object.defineProperty(pl,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Gradient"});Object.defineProperty(pl,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Pt.classNames.concat([pl.className])});class gl extends pl{getFill(e){const t=this.get("rotation",0);let s=this.getBounds(e),r=s.left||0,o=s.right||0,n=s.top||0,a=s.bottom||0,l=Ch(t),u=vh(t),h=l*(o-r),d=u*(a-n),c=Math.max(h,d);const p=this._root._renderer.createLinearGradient(r,n,r+c*l,n+c*u),y=this.get("stops");if(y){let f=0;G(y,w=>{let _=w.offset;B(_)||(_=f/(y.length-1));let P=w.opacity;B(P)||(P=1);let T=w.color;if(T){const D=w.lighten;D&&(T=ge.lighten(T,D));const M=w.brighten;M&&(T=ge.brighten(T,M)),p.addColorStop(_,"rgba("+T.r+","+T.g+","+T.b+","+P+")")}f++})}return p}}Object.defineProperty(gl,"className",{enumerable:!0,configurable:!0,writable:!0,value:"LinearGradient"});Object.defineProperty(gl,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:pl.classNames.concat([gl.className])});function p0(i){return new Promise((e,t)=>{setTimeout(e,i)})}let Cg={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:365.242/12*864e5,year:31536e6};function my(i){switch(i){case"year":return;case"month":return"year";case"week":return"month";case"day":return"month";case"hour":return"day";case"minute":return"hour";case"second":return"minute";case"millisecond":return"second"}}function $i(i,e){return e==null&&(e=1),Cg[i]*e}function pr(i){return i?Cg[i.timeUnit]*i.count:0}function mc(i,e,t,s,r){const o=i.timeUnit,n=i.count;if(o=="hour"||o=="minute"||o=="second"||o=="millisecond")return Cg[i.timeUnit]*i.count;{const a=ti(new Date(e.getTime()),o,n,t,s,void 0,r).getTime();let l=a+n*$i(o)*1.05;return l=ti(new Date(l),o,1,t,s,void 0,r).getTime(),l-a}}function vy(i,e,t,s,r){if(e-i>$i(t,1.2))return!0;let o=new Date(i),n=new Date(e);r&&(o=r.convertLocal(o),n=r.convertLocal(n));let a=0,l=0;!s&&t!="millisecond"&&(a=o.getTimezoneOffset(),o.setUTCMinutes(o.getUTCMinutes()-a),l=n.getTimezoneOffset(),n.setUTCMinutes(n.getUTCMinutes()-l));let u=!1;switch(t){case"year":o.getUTCFullYear()!=n.getUTCFullYear()&&(u=!0);break;case"month":(o.getUTCFullYear()!=n.getUTCFullYear()||o.getUTCMonth()!=n.getUTCMonth())&&(u=!0);break;case"day":(o.getUTCMonth()!=n.getUTCMonth()||o.getUTCDate()!=n.getUTCDate())&&(u=!0);break;case"hour":o.getUTCHours()!=n.getUTCHours()&&(u=!0);break;case"minute":o.getUTCMinutes()!=n.getUTCMinutes()&&(u=!0);break;case"second":o.getUTCSeconds()!=n.getUTCSeconds()&&(u=!0);break;case"millisecond":o.getTime()!=n.getTime()&&(u=!0);break}if(u)return u;let h=my(t);return h?vy(i,e,h,s,r):!1}function ti(i,e,t,s,r,o,n){if(!n||r){let a=0;switch(!r&&e!="millisecond"&&(a=i.getTimezoneOffset(),i.setUTCMinutes(i.getUTCMinutes()-a)),e){case"day":let l=i.getUTCDate();if(t>1){if(o){o=ti(o,"day",1);let _=i.getTime()-o.getTime(),P=Math.floor(_/$i("day")/t),T=$i("day",P*t);i.setTime(o.getTime()+T-a*$i("minute"))}}else i.setUTCDate(l);i.setUTCHours(0,0,0,0);break;case"second":let u=i.getUTCSeconds();t>1&&(u=Math.floor(u/t)*t),i.setUTCSeconds(u,0);break;case"millisecond":if(t==1)return i;let h=i.getUTCMilliseconds();h=Math.floor(h/t)*t,i.setUTCMilliseconds(h);break;case"hour":let d=i.getUTCHours();t>1&&(d=Math.floor(d/t)*t),i.setUTCHours(d,0,0,0);break;case"minute":let c=i.getUTCMinutes();t>1&&(c=Math.floor(c/t)*t),i.setUTCMinutes(c,0,0);break;case"month":let p=i.getUTCMonth();t>1&&(p=Math.floor(p/t)*t),i.setUTCMonth(p,1),i.setUTCHours(0,0,0,0);break;case"year":let y=i.getUTCFullYear();t>1&&(y=Math.floor(y/t)*t),i.setUTCFullYear(y,0,1),i.setUTCHours(0,0,0,0);break;case"week":let f=i.getUTCDate(),w=i.getUTCDay();B(s)||(s=1),w>=s?f=f-w+s:f=f-(7+w)+s,i.setUTCDate(f),i.setUTCHours(0,0,0,0);break}if(!r&&e!="millisecond"&&(i.setUTCMinutes(i.getUTCMinutes()+a),e=="day"||e=="week"||e=="month"||e=="year")){let l=i.getTimezoneOffset();if(l!=a){let u=l-a;i.setUTCMinutes(i.getUTCMinutes()+u)}}return i}else{if(isNaN(i.getTime()))return i;let a=n.offsetUTC(i),l=i.getTimezoneOffset(),u=n.parseDate(i),h=u.year,d=u.month,c=u.day,p=u.hour,y=u.minute,f=u.second,w=u.millisecond,_=u.weekday;switch(e){case"day":if(t>1&&o){o=ti(o,"day",1,s,r,void 0,n);let T=i.getTime()-o.getTime(),D=Math.floor(T/$i("day")/t),M=$i("day",D*t);i.setTime(o.getTime()+M),u=n.parseDate(i),h=u.year,d=u.month,c=u.day}p=0,y=a-l,f=0,w=0;break;case"second":y+=a-l,t>1&&(f=Math.floor(f/t)*t),w=0;break;case"millisecond":y+=a-l,t>1&&(w=Math.floor(w/t)*t);break;case"hour":t>1&&(p=Math.floor(p/t)*t),y=a-l,f=0,w=0;break;case"minute":t>1&&(y=Math.floor(y/t)*t),y+=a-l,f=0,w=0;break;case"month":t>1&&(d=Math.floor(d/t)*t),c=1,p=0,y=a-l,f=0,w=0;break;case"year":t>1&&(h=Math.floor(h/t)*t),d=0,c=1,p=0,y=a-l,f=0,w=0;break;case"week":B(s)||(s=1),_>=s?c=c-_+s:c=c-(7+_)+s,p=0,y=a-l,f=0,w=0;break}i=new Date(h,d,c,p,y,f,w);let P=i.getTimezoneOffset();return P!=l&&i.setTime(i.getTime()+(l-P)*6e4),i}}function np(i,e,t,s){let r=s[i],o=pr(r),n=s.length-1;if(i>=n)return Object.assign({},s[n]);let a=Math.ceil(e/o);return e<o&&i>0?Object.assign({},s[i-1]):a<=t?Object.assign({},s[i]):i+1<s.length?np(i+1,e,t,s):Object.assign({},s[i])}class fl extends So{constructor(){super(...arguments),Object.defineProperty(this,"_aggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionAggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_psi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pei",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:new Qn}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:Te.new(this._root,{width:ue,height:ue,position:"absolute"})})}_afterNew(){this.valueFields.push("value"),super._afterNew(),this.setPrivate("customData",{}),this._disposers.push(this.bullets.events.onAll(e=>{if(e.type==="clear")this._handleBullets(this.dataItems);else if(e.type==="push")this._handleBullets(this.dataItems);else if(e.type==="setIndex")this._handleBullets(this.dataItems);else if(e.type==="insertIndex")this._handleBullets(this.dataItems);else if(e.type==="removeIndex")this._handleBullets(this.dataItems);else if(e.type==="moveIndex")this._handleBullets(this.dataItems);else throw new Error("Unknown IListEvent type")}))}_dispose(){this.bulletsContainer.dispose(),super._dispose()}startIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("startIndex",0),e)}endIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("endIndex",e),e)}_handleBullets(e){G(e,t=>{const s=t.bullets;s&&(G(s,r=>{r.dispose()}),t.bullets=void 0)}),this.markDirtyValues()}getDataItemById(e){return QC(this.dataItems,t=>t.get("id")==e)}_makeBullets(e){this._shouldMakeBullet(e)&&(e.bullets=[],this.bullets.each(t=>{this._makeBullet(e,t)}))}_shouldMakeBullet(e){return!0}_makeBullet(e,t,s){const r=t(this._root,this,e);if(r){let o=r.get("sprite");o&&(o._setDataItem(e),o.setRaw("position","absolute"),this.bulletsContainer.children.push(o)),r._index=s,r.series=this,e.bullets.push(r)}return r}_clearDirty(){super._clearDirty(),this._aggregatesCalculated=!1,this._selectionAggregatesCalculated=!1}_prepareChildren(){super._prepareChildren();let e=this.startIndex(),t=this.endIndex();if(this.isDirty("heatRules")&&(this._valuesDirty=!0),this.isPrivateDirty("baseValueSeries")){const r=this.getPrivate("baseValueSeries");r&&this._disposers.push(r.onPrivate("startIndex",()=>{this.markDirtyValues()}))}if(this.get("calculateAggregates")&&(this._valuesDirty&&!this._dataProcessed&&(this._aggregatesCalculated||(this._calculateAggregates(0,this.dataItems.length),this._aggregatesCalculated=!0)),(this._psi!=e||this._pei!=t)&&!this._selectionAggregatesCalculated&&(e===0&&t===this.dataItems.length&&this._aggregatesCalculated||this._calculateAggregates(e,t),this._selectionAggregatesCalculated=!0)),this.isDirty("tooltip")){let r=this.get("tooltip");r&&(r.hide(0),r.set("tooltipTarget",this))}if(this.isDirty("fill")||this.isDirty("stroke")){let r;const o=this.get("legendDataItem");if(o&&(r=o.get("markerRectangle"),r&&this.isVisible())){if(this.isDirty("stroke")){let n=this.get("stroke");r.set("stroke",n)}if(this.isDirty("fill")){let n=this.get("fill");r.set("fill",n)}}this.updateLegendMarker(void 0)}if(this.bullets.length>0){let r=this.startIndex(),o=this.endIndex();o<this.dataItems.length&&o++;for(let n=r;n<o;n++){let a=this.dataItems[n];a.bullets||this._makeBullets(a)}}}_calculateAggregates(e,t){let s=this._valueFields;if(!s)throw new Error("No value fields are set for the series.");const r={},o={},n={},a={},l={},u={},h={},d={},c={};G(s,p=>{r[p]=0,o[p]=0,n[p]=0}),G(s,p=>{let y=p+"Change",f=p+"ChangePercent",w=p+"ChangePrevious",_=p+"ChangePreviousPercent",P=p+"ChangeSelection",T=p+"ChangeSelectionPercent",D="valueY";(p=="valueX"||p=="openValueX"||p=="lowValueX"||p=="highValueX")&&(D="valueX");const M=this.getPrivate("baseValueSeries");for(let O=e;O<t;O++){const N=this.dataItems[O];let z=N.get(p);z!=null&&(n[p]++,r[p]+=z,o[p]+=Math.abs(z),d[p]=r[p]/n[p],(a[p]>z||a[p]==null)&&(a[p]=z),(l[p]<z||l[p]==null)&&(l[p]=z),h[p]=z,u[p]==null&&(u[p]=z,c[p]=z,M&&(u[D]=M._getBase(D))),e===0&&(N.setRaw(y,z-u[D]),N.setRaw(f,(z-u[D])/u[D]*100)),N.setRaw(w,z-c[D]),N.setRaw(_,(z-c[D])/c[D]*100),N.setRaw(P,z-u[D]),N.setRaw(T,(z-u[D])/u[D]*100),c[p]=z)}}),G(s,p=>{this.setPrivate(p+"AverageSelection",d[p]),this.setPrivate(p+"CountSelection",n[p]),this.setPrivate(p+"SumSelection",r[p]),this.setPrivate(p+"AbsoluteSumSelection",o[p]),this.setPrivate(p+"LowSelection",a[p]),this.setPrivate(p+"HighSelection",l[p]),this.setPrivate(p+"OpenSelection",u[p]),this.setPrivate(p+"CloseSelection",h[p])}),e===0&&t===this.dataItems.length&&G(s,p=>{this.setPrivate(p+"Average",d[p]),this.setPrivate(p+"Count",n[p]),this.setPrivate(p+"Sum",r[p]),this.setPrivate(p+"AbsoluteSum",o[p]),this.setPrivate(p+"Low",a[p]),this.setPrivate(p+"High",l[p]),this.setPrivate(p+"Open",u[p]),this.setPrivate(p+"Close",h[p])})}_updateChildren(){super._updateChildren(),this._psi=this.startIndex(),this._pei=this.endIndex(),this.isDirty("visible")&&this.bulletsContainer.set("visible",this.get("visible"));const e=this.get("heatRules");if(this._valuesDirty&&e&&e.length>0&&G(e,t=>{const s=t.minValue||this.getPrivate(t.dataField+"Low")||0,r=t.maxValue||this.getPrivate(t.dataField+"High")||0;G(t.target._entities,o=>{const n=o.dataItem.get(t.dataField);if(!B(n)){t.neutral&&o.set(t.key,t.neutral);return}let a;t.logarithmic?a=(Math.log(n)*Math.LOG10E-Math.log(s)*Math.LOG10E)/(Math.log(r)*Math.LOG10E-Math.log(s)*Math.LOG10E):a=(n-s)/(r-s),B(n)&&(!B(a)||Math.abs(a)==1/0)&&(a=.5);let l;B(t.min)?l=t.min+(t.max-t.min)*a:t.min instanceof ge?l=ge.interpolate(a,t.min,t.max):t.min instanceof He&&(l=ly(a,t.min,t.max)),t.customFunction?t.customFunction.call(this,o,s,r,n):o.set(t.key,l)})}),this.bullets.length>0){let t=this.dataItems.length,s=this.startIndex(),r=this.endIndex();r<t&&r++,s>0&&s--;for(let o=0;o<s;o++)this._hideBullets(this.dataItems[o]);for(let o=s;o<r;o++)this._positionBullets(this.dataItems[o]);for(let o=r;o<t;o++)this._hideBullets(this.dataItems[o])}}_positionBullets(e){e.bullets&&G(e.bullets,t=>{this._positionBullet(t);const s=t.get("sprite");t.get("dynamic")&&(s&&(s._markDirtyKey("fill"),s.markDirtySize()),s instanceof Te&&s.walkChildren(r=>{r._markDirtyKey("fill"),r.markDirtySize(),r instanceof xr&&r.text.markDirtyText()})),s instanceof xr&&s.get("populateText")&&s.text.markDirtyText()})}_hideBullets(e){e.bullets&&G(e.bullets,t=>{let s=t.get("sprite");s&&s.setPrivate("visible",!1)})}_positionBullet(e){}_placeBulletsContainer(e){e.bulletsContainer.children.moveValue(this.bulletsContainer)}_removeBulletsContainer(){const e=this.bulletsContainer;e.parent&&e.parent.children.removeValue(e)}disposeDataItem(e){const t=e.bullets;t&&G(t,s=>{s.dispose()})}_getItemReaderLabel(){return""}showDataItem(e,t){const s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return Be(this,void 0,void 0,function*(){const r=[s.showDataItem.call(this,e,t)],o=e.bullets;o&&G(o,n=>{r.push(n.get("sprite").show(t))}),yield Promise.all(r)})}hideDataItem(e,t){const s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return Be(this,void 0,void 0,function*(){const r=[s.hideDataItem.call(this,e,t)],o=e.bullets;o&&G(o,n=>{r.push(n.get("sprite").hide(t))}),yield Promise.all(r)})}_sequencedShowHide(e,t){return Be(this,void 0,void 0,function*(){if(this.get("sequencedInterpolation"))if(B(t)||(t=this.get("interpolationDuration",0)),t>0){const s=this.startIndex(),r=this.endIndex();yield Promise.all(ip(this.dataItems,(o,n)=>Be(this,void 0,void 0,function*(){let a=t||0;(n<s-10||n>r+10)&&(a=0);let l=this.get("sequencedDelay",0)+a/(r-s);yield p0(l*(n-s)),e?yield this.showDataItem(o,a):yield this.hideDataItem(o,a)})))}else yield Promise.all(ip(this.dataItems,s=>e?this.showDataItem(s,0):this.hideDataItem(s,0)))})}updateLegendValue(e){if(e){const t=e.get("legendDataItem");if(t){const s=t.get("valueLabel");if(s){const o=s.text;let n="";s._setDataItem(e),n=this.get("legendValueText",o.get("text","")),s.set("text",n),o.markDirtyText()}const r=t.get("label");if(r){const o=r.text;let n="";r._setDataItem(e),n=this.get("legendLabelText",o.get("text","")),r.set("text",n),o.markDirtyText()}}}}updateLegendMarker(e){}_onHide(){super._onHide();const e=this.getTooltip();e&&e.hide()}hoverDataItem(e){}unhoverDataItem(e){}_getBase(e){const t=this.dataItems[this.startIndex()];return t?t.get(e):0}}Object.defineProperty(fl,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Series"});Object.defineProperty(fl,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:So.classNames.concat([fl.className])});function Mf(i,e){for(let t=0,s=e.length;t<s;t++){const r=e[t];if(r.length>0){let o=r[0];if(o.length>0){let n=o[0];i.moveTo(n.x,n.y);for(let a=0,l=r.length;a<l;a++)g0(i,r[a])}}}}function g0(i,e){for(let t=0,s=e.length;t<s;t++){const r=e[t];i.lineTo(r.x,r.y)}}class ml extends it{_beforeChanged(){super._beforeChanged(),(this.isDirty("points")||this.isDirty("segments")||this._sizeDirty||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){const e=this.get("points"),t=this.get("segments");if(e&&e.length>0){let s=e[0];this._display.moveTo(s.x,s.y),Mf(this._display,[[e]])}else if(t)Mf(this._display,t);else if(!this.get("draw")){let s=this.width(),r=this.height();this._display.moveTo(0,0),this._display.lineTo(s,r)}}}}Object.defineProperty(ml,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Line"});Object.defineProperty(ml,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:it.classNames.concat([ml.className])});function $t(i){return function(){return i}}const ap=Math.PI,lp=2*ap,qr=1e-6,f0=lp-qr;function Cy(i){this._+=i[0];for(let e=1,t=i.length;e<t;++e)this._+=arguments[e]+i[e]}function m0(i){let e=Math.floor(i);if(!(e>=0))throw new Error(`invalid digits: ${i}`);if(e>15)return Cy;const t=10**e;return function(s){this._+=s[0];for(let r=1,o=s.length;r<o;++r)this._+=Math.round(arguments[r]*t)/t+s[r]}}class v0{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?Cy:m0(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,s,r){this._append`Q${+e},${+t},${this._x1=+s},${this._y1=+r}`}bezierCurveTo(e,t,s,r,o,n){this._append`C${+e},${+t},${+s},${+r},${this._x1=+o},${this._y1=+n}`}arcTo(e,t,s,r,o){if(e=+e,t=+t,s=+s,r=+r,o=+o,o<0)throw new Error(`negative radius: ${o}`);let n=this._x1,a=this._y1,l=s-e,u=r-t,h=n-e,d=a-t,c=h*h+d*d;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(c>qr)if(!(Math.abs(d*l-u*h)>qr)||!o)this._append`L${this._x1=e},${this._y1=t}`;else{let p=s-n,y=r-a,f=l*l+u*u,w=p*p+y*y,_=Math.sqrt(f),P=Math.sqrt(c),T=o*Math.tan((ap-Math.acos((f+c-w)/(2*_*P)))/2),D=T/P,M=T/_;Math.abs(D-1)>qr&&this._append`L${e+D*h},${t+D*d}`,this._append`A${o},${o},0,0,${+(d*p>h*y)},${this._x1=e+M*l},${this._y1=t+M*u}`}}arc(e,t,s,r,o,n){if(e=+e,t=+t,s=+s,n=!!n,s<0)throw new Error(`negative radius: ${s}`);let a=s*Math.cos(r),l=s*Math.sin(r),u=e+a,h=t+l,d=1^n,c=n?r-o:o-r;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>qr||Math.abs(this._y1-h)>qr)&&this._append`L${u},${h}`,s&&(c<0&&(c=c%lp+lp),c>f0?this._append`A${s},${s},0,1,${d},${e-a},${t-l}A${s},${s},0,1,${d},${this._x1=u},${this._y1=h}`:c>qr&&this._append`A${s},${s},0,${+(c>=ap)},${d},${this._x1=e+s*Math.cos(o)},${this._y1=t+s*Math.sin(o)}`)}rect(e,t,s,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${s=+s}v${+r}h${-s}Z`}toString(){return this._}}function yy(i){let e=3;return i.digits=function(t){if(!arguments.length)return e;if(t==null)e=null;else{const s=Math.floor(t);if(!(s>=0))throw new RangeError(`invalid digits: ${t}`);e=s}return i},()=>new v0(e)}function wy(i){return typeof i=="object"&&"length"in i?i:Array.from(i)}function by(i){this._context=i}by.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(i,e){switch(i=+i,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(i,e):this._context.moveTo(i,e);break;case 1:this._point=2;default:this._context.lineTo(i,e);break}}};function Sy(i){return new by(i)}function _y(i){return i[0]}function Ey(i){return i[1]}function xy(i,e){var t=$t(!0),s=null,r=Sy,o=null,n=yy(a);i=typeof i=="function"?i:i===void 0?_y:$t(i),e=typeof e=="function"?e:e===void 0?Ey:$t(e);function a(l){var u,h=(l=wy(l)).length,d,c=!1,p;for(s==null&&(o=r(p=n())),u=0;u<=h;++u)!(u<h&&t(d=l[u],u,l))===c&&((c=!c)?o.lineStart():o.lineEnd()),c&&o.point(+i(d,u,l),+e(d,u,l));if(p)return o=null,p+""||null}return a.x=function(l){return arguments.length?(i=typeof l=="function"?l:$t(+l),a):i},a.y=function(l){return arguments.length?(e=typeof l=="function"?l:$t(+l),a):e},a.defined=function(l){return arguments.length?(t=typeof l=="function"?l:$t(!!l),a):t},a.curve=function(l){return arguments.length?(r=l,s!=null&&(o=r(s)),a):r},a.context=function(l){return arguments.length?(l==null?s=o=null:o=r(s=l),a):s},a}function C0(i,e,t){var s=null,r=$t(!0),o=null,n=Sy,a=null,l=yy(u);i=typeof i=="function"?i:i===void 0?_y:$t(+i),e=typeof e=="function"?e:$t(e===void 0?0:+e),t=typeof t=="function"?t:t===void 0?Ey:$t(+t);function u(d){var c,p,y,f=(d=wy(d)).length,w,_=!1,P,T=new Array(f),D=new Array(f);for(o==null&&(a=n(P=l())),c=0;c<=f;++c){if(!(c<f&&r(w=d[c],c,d))===_)if(_=!_)p=c,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),y=c-1;y>=p;--y)a.point(T[y],D[y]);a.lineEnd(),a.areaEnd()}_&&(T[c]=+i(w,c,d),D[c]=+e(w,c,d),a.point(s?+s(w,c,d):T[c],t?+t(w,c,d):D[c]))}if(P)return a=null,P+""||null}function h(){return xy().defined(r).curve(n).context(o)}return u.x=function(d){return arguments.length?(i=typeof d=="function"?d:$t(+d),s=null,u):i},u.x0=function(d){return arguments.length?(i=typeof d=="function"?d:$t(+d),u):i},u.x1=function(d){return arguments.length?(s=d==null?null:typeof d=="function"?d:$t(+d),u):s},u.y=function(d){return arguments.length?(e=typeof d=="function"?d:$t(+d),t=null,u):e},u.y0=function(d){return arguments.length?(e=typeof d=="function"?d:$t(+d),u):e},u.y1=function(d){return arguments.length?(t=d==null?null:typeof d=="function"?d:$t(+d),u):t},u.lineX0=u.lineY0=function(){return h().x(i).y(e)},u.lineY1=function(){return h().x(i).y(t)},u.lineX1=function(){return h().x(s).y(e)},u.defined=function(d){return arguments.length?(r=typeof d=="function"?d:$t(!!d),u):r},u.curve=function(d){return arguments.length?(n=d,o!=null&&(a=n(o)),u):n},u.context=function(d){return arguments.length?(d==null?o=a=null:a=n(o=d),u):o},u}let vl=class extends Te{constructor(){super(...arguments),Object.defineProperty(this,"chartContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(Te.new(this._root,{width:ue,height:ue,interactiveChildren:!1}))}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:Te.new(this._root,{interactiveChildren:!1,isMeasured:!1,position:"absolute",width:ue,height:ue})})}};Object.defineProperty(vl,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Chart"});Object.defineProperty(vl,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Te.classNames.concat([vl.className])});class Cl extends vl{constructor(){super(...arguments),Object.defineProperty(this,"seriesContainer",{enumerable:!0,configurable:!0,writable:!0,value:Te.new(this._root,{width:ue,height:ue,isMeasured:!1})}),Object.defineProperty(this,"series",{enumerable:!0,configurable:!0,writable:!0,value:new fh})}_afterNew(){super._afterNew(),this._disposers.push(this.series);const e=this.seriesContainer.children;this._disposers.push(this.series.events.onAll(t=>{if(t.type==="clear"){G(t.oldValues,r=>{this._removeSeries(r)});const s=this.get("colors");s&&s.reset()}else if(t.type==="push")e.moveValue(t.newValue),this._processSeries(t.newValue);else if(t.type==="setIndex")e.setIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="insertIndex")e.insertIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="removeIndex")this._removeSeries(t.oldValue);else if(t.type==="moveIndex")e.moveValue(t.value,t.newIndex),this._processSeries(t.value);else throw new Error("Unknown IListEvent type")}))}_processSeries(e){e.chart=this,e._placeBulletsContainer(this)}_removeSeries(e){e.isDisposed()||(this.seriesContainer.children.removeValue(e),e._removeBulletsContainer())}}Object.defineProperty(Cl,"className",{enumerable:!0,configurable:!0,writable:!0,value:"SerialChart"});Object.defineProperty(Cl,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:vl.classNames.concat([Cl.className])});class yl extends ml{}Object.defineProperty(yl,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tick"});Object.defineProperty(yl,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:ml.classNames.concat([yl.className])});class wl extends Pt{_afterNew(){super._afterNewApplyThemes(),this._dirty.colors=!1}_beforeChanged(){this.isDirty("colors")&&this.reset()}generateColors(){this.setPrivate("currentPass",this.getPrivate("currentPass",0)+1);const e=this.getPrivate("currentPass"),t=this.get("colors",[this.get("baseColor",ge.fromHex(16711680))]);this.getPrivate("numColors")||this.setPrivate("numColors",t.length);const s=this.getPrivate("numColors"),r=0,o=this.get("passOptions"),n=this.get("reuse");for(let a=r;a<s;a++)if(n)t.push(t[a]);else{const l=t[a].toHSL();let u=l.h+(o.hue||0)*e;for(;u>1;)u-=1;let h=l.s+(o.saturation||0)*e;h>1&&(h=1),h<0&&(h=0);let d=l.l+(o.lightness||0)*e;for(;d>1;)d-=1;t.push(ge.fromHSL(u,h,d))}}getIndex(e){const t=this.get("colors",[]),s=this.get("saturation");return e>=t.length?(this.generateColors(),this.getIndex(e)):s!=null?ge.saturate(t[e],s):t[e]}next(){let e=this.getPrivate("currentStep",this.get("startIndex",0));return this.setPrivate("currentStep",e+this.get("step",1)),this.getIndex(e)}reset(){this.setPrivate("currentStep",this.get("startIndex",0)),this.setPrivate("currentPass",0)}}Object.defineProperty(wl,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColorSet"});Object.defineProperty(wl,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Pt.classNames.concat([wl.className])});let vc;function y0(){return Be(this,void 0,void 0,function*(){let i=yield Promise.all([_c(()=>import("./pdfmake-ew3m0mVj.js").then(r=>r.p),__vite__mapDeps([0,1])),_c(()=>import("./vfs_fonts-BbT5ejxm.js"),[])]),e=i[0],t=i[1];const s=window;return s.pdfMake=s.pdfMake||{},s.pdfMake.vfs=t.default,e.vfs=t.default,e})}class _h extends Pt{_afterNew(){super._afterNew(),this._setRawDefault("filePrefix","chart"),this._setRawDefault("charset","utf-8"),this._setRawDefault("numericFields",[]),this._setRawDefault("dateFields",[]),this._setRawDefault("durationFields",[]),this._setRawDefault("extraImages",[]),this._setRawDefault("pngOptions",{quality:1,maintainPixelRatio:!1}),this._setRawDefault("jpgOptions",{quality:.8,maintainPixelRatio:!1}),this._setRawDefault("printOptions",{quality:1,maintainPixelRatio:!1,delay:500,printMethod:"iframe",imageFormat:"png"}),this._setRawDefault("jsonOptions",{indent:2,renameFields:!0}),this._setRawDefault("csvOptions",{separator:",",addColumnNames:!0,emptyAs:"",addBOM:!0}),this._setRawDefault("htmlOptions",{emptyAs:"-",addColumnNames:!0}),this._setRawDefault("xlsxOptions",{emptyAs:"",addColumnNames:!0}),this._setRawDefault("pdfOptions",{fontSize:14,imageFormat:"png",align:"left",addURL:!0}),this._setRawDefault("pdfdataOptions",{emptyAs:"",addColumnNames:!0}),this._root.addDisposer(this)}_beforeChanged(){if(super._beforeChanged(),this.isDirty("menu")){const e=this.get("menu");e&&(e.set("exporting",this),this._disposers.push(e))}}_getFormatOptions(e,t){const s=mr(this.get(e+"Options",{}));return t&&$e(t,(r,o)=>{s[r]=o}),s}download(e,t){return Be(this,void 0,void 0,function*(){const s=e=="pdfdata"?"pdf":e,r=this.get("filePrefix","chart")+"."+s,o=this._getFormatOptions(e,t);this.events.dispatch("downloadstarted",{type:"downloadstarted",format:e,options:o,fileName:r,target:this});const n=yield this.export(e,o);this.streamFile(n,r,o&&o.addBOM)})}print(e){return Be(this,void 0,void 0,function*(){const t=this._getFormatOptions("print",e);this.events.dispatch("printstarted",{type:"printstarted",format:"print",options:t,target:this});const s=yield this.export(t.imageFormat||"png",t);this.initiatePrint(s,t,this.get("title"))})}export(e,t){return Be(this,void 0,void 0,function*(){const s=this._getFormatOptions(e,t);this.events.dispatch("exportstarted",{type:"exportstarted",format:e,options:s,target:this}),this._root._runTickerNow();let r="";switch(e){case"png":case"jpg":r=this.exportImage(e,s);break;case"json":r=this.exportJSON(s);break;case"csv":r=this.exportCSV(s);break;case"html":r=this.exportHTML(s);break;case"xlsx":r=this.exportXLSX(s);break;case"pdf":r=this.exportPDF(s);break;case"pdfdata":r=this.exportPDFData(s);break}return this.events.dispatch("exportfinished",{type:"exportfinished",format:e,options:s,target:this}),r})}exportImage(e,t){return Be(this,void 0,void 0,function*(){const s=this._getFormatOptions(e,t),r=yield this.getCanvas(s),o=r.toDataURL(this.getContentType(e),s.quality||1);return this.disposeCanvas(r),o})}exportCanvas(e){return Be(this,void 0,void 0,function*(){const t=this._getFormatOptions("canvas",e),s=yield this.getCanvas(t),r=s.toDataURL(this.getContentType("canvas"),t.quality||1);return this.disposeCanvas(s),r})}getCanvas(e){return Be(this,void 0,void 0,function*(){const t=this._root._renderer.getCanvas(this._root._rootContainer._display,e),s=this.get("extraImages",[]);let r=0,o=0,n=t.width,a=t.height,l=0,u=0;const h=[];G(s,T=>{let D;T instanceof wd?D={source:T,position:"bottom"}:D=T,D.position=D.position||"bottom",D.marginTop=D.marginTop||0,D.marginRight=D.marginRight||0,D.marginBottom=D.marginBottom||0,D.marginLeft=D.marginLeft||0;const M=D.source._renderer.getCanvas(D.source._rootContainer._display,e),O=M.width+D.marginLeft+D.marginRight,N=M.height+D.marginTop+D.marginBottom;D.position=="top"?(n=D.crop?a:Math.max(n,O),o+=N):D.position=="right"?(a=D.crop?a:Math.max(a,N),l+=O):D.position=="left"?(a=D.crop?a:Math.max(a,N),r+=O):D.position==="bottom"&&(n=D.crop?a:Math.max(n,O),u+=N),h.push({canvas:M,position:D.position,left:D.marginLeft,top:D.marginTop,width:O,height:N})});const d=this.getDisposableCanvas();d.width=r+n+l,d.height=o+a+u;const c=d.getContext("2d"),p=this.get("backgroundColor",this.findBackgroundColor(this._root.dom)),y=this.get("backgroundOpacity",1);p&&(c.fillStyle=p.toCSS(y),c.fillRect(0,0,d.width,d.height));let f=r,w=o,_=f+n,P=w+a;return G(h,T=>{T.position=="top"?(w-=T.height,c.drawImage(T.canvas,r+T.left,w+T.top)):T.position=="right"?(c.drawImage(T.canvas,_+T.left,o+T.top),_+=T.width):T.position=="left"?(f-=T.width,c.drawImage(T.canvas,f+T.left,o+T.top)):T.position==="bottom"&&(c.drawImage(T.canvas,r+T.left,P+T.top),P+=T.height)}),c.drawImage(t,r,o),d})}exportJSON(e){return Be(this,void 0,void 0,function*(){return"data:"+this.getContentType("json")+";"+this.get("charset","utf-8")+","+encodeURIComponent(yield this.getJSON(e))})}getJSON(e){return Be(this,void 0,void 0,function*(){const t=this._getFormatOptions("json",e);return JSON.stringify(this.getData("json",e,t.renameFields),(s,r)=>(Tn(r)&&$e(r,(o,n)=>{r[o]=this.convertToSpecialFormat(o,n,t)}),r),t.indent)})}exportCSV(e){return Be(this,void 0,void 0,function*(){return"data:"+this.getContentType("csv")+";"+this.get("charset","utf-8")+","+encodeURIComponent(yield this.getCSV(e))})}getCSV(e){return Be(this,void 0,void 0,function*(){const t=this._getFormatOptions("csv",e);let s="",r="";const o=this.getData("csv",t),n=this.getDataFields(o);if(t.pivot){const a=this.get("dataFieldsOrder",[]);cr(n,(l,u)=>{let h=[];t.addColumnNames&&h.push(u);for(let d=o.length,c=0;c<d;c++){let p=o[c][l];h.push(this.convertToSpecialFormat(l,p,t,!0))}s+=r+this.getCSVRow(h,t,void 0,!0),r=`
`},(l,u)=>{let h=a.indexOf(l),d=a.indexOf(u);return h>d?-1:h<d?1:0})}else{for(let a=o.length,l=0;l<a;l++){let u=this.getCSVRow(o[l],t,n);t.reverse?s=u+r+s:s+=r+u,r=`
`}t.addColumnNames&&(s=this.getCSVRow(n,t,void 0,!0)+r+s)}return s})}getCSVRow(e,t,s,r=!1){let o=t.separator||",",n=[];s||(s={},$e(e,(l,u)=>{s[l]=u}));const a=this.get("dataFieldsOrder",[]);return cr(s,(l,u)=>{let h=this.convertEmptyValue(l,e[l],t),d=r?h:this.convertToSpecialFormat(l,h,t);d=""+d,d=d.replace(/"/g,'""'),(t.forceQuotes||d.search(new RegExp(`"|
|`+o,"g"))>=0)&&(d='"'+d+'"'),n.push(d)},(l,u)=>{let h=a.indexOf(l),d=a.indexOf(u);return h>d?1:h<d?-1:0}),n.join(o)}exportHTML(e){return Be(this,void 0,void 0,function*(){return"data:"+this.getContentType("html")+";"+this.get("charset","utf-8")+","+encodeURIComponent(yield this.getHTML(e))})}getHTML(e){return Be(this,void 0,void 0,function*(){const t=this._getFormatOptions("html",e);let s="<table>";t.tableClass&&(s='<table class="'+t.tableClass+'">');const r=this.getData("html",t),o=this.getDataFields(r);if(t.pivot){const n=this.get("dataFieldsOrder",[]);s+=`
<tbody>`,cr(o,(a,l)=>{let u=[];t.addColumnNames&&u.push(l);for(let h=r.length,d=0;d<h;d++){let c=r[d][a];u.push(this.convertToSpecialFormat(a,c,t,!0))}s+=`
`+this.getHTMLRow(u,t,void 0,!0)},(a,l)=>{let u=n.indexOf(a),h=n.indexOf(l);return u>h?-1:u<h?1:0}),s+=`
</tbody>`}else{t.addColumnNames&&(s+=`
<thead>
`+this.getHTMLRow(o,t,void 0,!0,!0)+`
</thead>`),s+=`
<tbody>`;for(let n=r.length,a=0;a<n;a++)s+=`
`+this.getHTMLRow(r[a],t,o);s+=`
</tbody>`}return s+=`
</table>`,s})}getHTMLRow(e,t,s,r=!1,o=!1){let n=" <tr>";t.rowClass&&(n=' <tr class="'+t.rowClass+'">'),s||(s=e);const a=this.get("dataFieldsOrder",[]),l=o?"th":"td";let u=!0;return cr(s,(h,d)=>{let c=this.convertEmptyValue(h,e[h],t),p=r?c:this.convertToSpecialFormat(h,c,t);p=""+p,p=p.replace(/[\u00A0-\u9999<>\&]/gim,function(f){return"&#"+f.charCodeAt(0)+";"});let y=l;t.pivot&&u&&(y="th"),t.cellClass?n+=`
<`+y+' class="'+t.cellClass+'">'+p+"</"+y+">":n+=`
<`+y+">"+p+"</"+y+">",u=!1},(h,d)=>{let c=a.indexOf(h),p=a.indexOf(d);return c>p?1:c<p?-1:0}),n+=`
</tr>`,n}exportXLSX(e){return Be(this,void 0,void 0,function*(){return"data:"+this.getContentType("xlsx")+";"+this.get("charset","utf-8")+","+encodeURIComponent(yield this.getXLSX(e))})}getXLSX(e){return Be(this,void 0,void 0,function*(){const t=this._getFormatOptions("xlsx",e);let s=yield this.getXLSXLib(),r={bookType:"xlsx",bookSST:!1,type:"base64"},o=this._normalizeExcelSheetName(this.get("title",this._t("Data"))),n={SheetNames:[o],Sheets:{}},a=[];const l=this.getData("html",t),u=this.getDataFields(l);if(t.pivot){const h=this.get("dataFieldsOrder",[]);cr(u,(d,c)=>{let p=[];t.addColumnNames&&p.push(c);for(let y=l.length,f=0;f<y;f++){let w=l[f][d];p.push(this.convertToSpecialFormat(d,w,t,!0))}a.push(this.getXLSXRow(p,t,void 0,!0))},(d,c)=>{let p=h.indexOf(d),y=h.indexOf(c);return p>y?1:p<y?-1:0})}else{t.addColumnNames&&a.push(this.getXLSXRow(u,t,void 0,!0));for(let h=l.length,d=0;d<h;d++)a.push(this.getXLSXRow(l[d],t,u))}return n.Sheets[o]=s.utils.aoa_to_sheet(a),this.events.dispatch("workbookready",{type:"workbookready",format:"xlsx",options:t,workbook:n,workbookOptions:r,xlsx:s,target:this}),s.write(n,r)})}_normalizeExcelSheetName(e){return e=e.replace(/([:\\\/?*\[\]]+)/g," "),e.length>30?e.substr(0,30)+"...":e}getXLSXRow(e,t,s,r=!1){let o=[];s||(s=e);const n=this.get("dataFieldsOrder",[]);return cr(s,(a,l)=>{let u=this.convertEmptyValue(a,e[a],t),h=r?u:this.convertToSpecialFormat(a,u,t,!0);o.push(h)},(a,l)=>{let u=n.indexOf(a),h=n.indexOf(l);return u>h?1:u<h?-1:0}),o}_xlsx(){return Be(this,void 0,void 0,function*(){return yield _c(()=>import("./xlsx.core.min-DQ8amVV5.js").then(e=>e.x),__vite__mapDeps([2,1,3,4]))})}getXLSXLib(){return this._xlsx()}exportPDF(e){return Be(this,void 0,void 0,function*(){return"data:"+this.getContentType("pdf")+";"+this.get("charset","utf-8")+","+encodeURIComponent(yield this.getPDF(e,!0))})}exportPDFData(e){return Be(this,void 0,void 0,function*(){return"data:"+this.getContentType("pdf")+";"+this.get("charset","utf-8")+","+encodeURIComponent(yield this.getPDF(e,!1,!0))})}getPDF(e,t=!0,s=!1){return Be(this,void 0,void 0,function*(){const r=this._getFormatOptions("pdf",e),o=this._getFormatOptions("pdfdata",e),n=r.pageOrientation||"portrait";let a;t&&(a=yield this.exportImage(r.imageFormat||"png",r));const l=yield this.getPdfmake(),u=[30,30,30,30];let h={pageSize:r.pageSize||"A4",pageOrientation:n,pageMargins:r.pageMargins||u,defaultStyle:{font:r.font?r.font.name:void 0},content:[]};const d=this.get("title");let c=0;d&&(h.content.push({text:d,fontSize:r.fontSize||14,bold:!0,margin:[0,0,0,15]}),c+=50),r.addURL&&(h.content.push({text:this._t("Saved from")+": "+document.location.href,fontSize:r.fontSize,margin:[0,0,0,15]}),c+=50),t&&a&&h.content.push({image:a,alignment:r.align||"left",fit:this.getPageSizeFit(h.pageSize,h.pageMargins,c,n)}),(s||r.includeData)&&this.hasData()&&h.content.push({table:yield this.getPDFData(o),fontSize:r.fontSize||14});let p=null,y=null;function f(w){const _={};_.normal=w.normal.path,y[w.normal.path]=w.normal.bytes,w.bold?(_.bold=w.bold.path,y[w.bold.path]=w.bold.bytes):_.bold=w.normal.path,w.italics?(_.italics=w.italics.path,y[w.italics.path]=w.italics.bytes):_.italics=w.normal.path,w.bolditalics?(_.bolditalics=w.bolditalics.path,y[w.bolditalics.path]=w.bolditalics.bytes):_.bolditalics=w.normal.path,p[w.name]=_}return r.font&&(p={},y={},f(r.font),r.extraFonts&&G(r.extraFonts,f)),this.events.dispatch("pdfdocready",{type:"pdfdocready",format:"pdf",options:r,doc:h,target:this}),new Promise((w,_)=>{l.createPdf(h,null,p,y).getBase64(P=>{w(P)})})})}getPDFData(e){return Be(this,void 0,void 0,function*(){const t=this._getFormatOptions("pdfdata",e);let s={body:[]};const r=this.getData("html",t),o=this.getDataFields(r);if(t.pivot){const n=this.get("dataFieldsOrder",[]);cr(o,(a,l)=>{let u=[];t.addColumnNames&&u.push(l);for(let h=r.length,d=0;d<h;d++){let c=r[d][a];u.push(this.convertToSpecialFormat(a,c,t,!0))}s.body.push(this.getPDFDataRow(u,t,void 0,!0))},(a,l)=>{let u=n.indexOf(a),h=n.indexOf(l);return u>h?1:u<h?-1:0})}else{t.addColumnNames&&(s.body.push(this.getPDFDataRow(o,t,void 0,!0)),s.headerRows=1);for(let n=r.length,a=0;a<n;a++)s.body.push(this.getPDFDataRow(r[a],t,o))}return s})}getPDFDataRow(e,t,s,r=!1){let o=[];s||(s=e);const n=this.get("dataFieldsOrder",[]);return cr(s,(a,l)=>{let u=this.convertEmptyValue(a,e[a],t),h=r?u:this.convertToSpecialFormat(a,u,t);h=""+h,o.push(h)},(a,l)=>{let u=n.indexOf(a),h=n.indexOf(l);return u>h?1:u<h?-1:0}),o}getPdfmake(){return vc===void 0&&(vc=y0()),vc}getPageSizeFit(e,t,s=0,r="portrait"){let o=[0,0,0,0];B(t)?o=[t,t,t,t]:t.length==2?o=[t[0],t[1],t[0],t[1]]:t.length==4&&(o=t);let a={"4A0":[4767.87,6740.79],"2A0":[3370.39,4767.87],A0:[2383.94,3370.39],A1:[1683.78,2383.94],A2:[1190.55,1683.78],A3:[841.89,1190.55],A4:[595.28,841.89],A5:[419.53,595.28],A6:[297.64,419.53],A7:[209.76,297.64],A8:[147.4,209.76],A9:[104.88,147.4],A10:[73.7,104.88],B0:[2834.65,4008.19],B1:[2004.09,2834.65],B2:[1417.32,2004.09],B3:[1000.63,1417.32],B4:[708.66,1000.63],B5:[498.9,708.66],B6:[354.33,498.9],B7:[249.45,354.33],B8:[175.75,249.45],B9:[124.72,175.75],B10:[87.87,124.72],C0:[2599.37,3676.54],C1:[1836.85,2599.37],C2:[1298.27,1836.85],C3:[918.43,1298.27],C4:[649.13,918.43],C5:[459.21,649.13],C6:[323.15,459.21],C7:[229.61,323.15],C8:[161.57,229.61],C9:[113.39,161.57],C10:[79.37,113.39],RA0:[2437.8,3458.27],RA1:[1729.13,2437.8],RA2:[1218.9,1729.13],RA3:[864.57,1218.9],RA4:[609.45,864.57],SRA0:[2551.18,3628.35],SRA1:[1814.17,2551.18],SRA2:[1275.59,1814.17],SRA3:[907.09,1275.59],SRA4:[637.8,907.09],EXECUTIVE:[521.86,756],FOLIO:[612,936],LEGAL:[612,1008],LETTER:[612,792],TABLOID:[792,1224]}[e];return r=="landscape"&&a.reverse(),a[0]-=o[0]+o[2],a[1]-=o[1]+o[3]+s,a}hasData(){const e=this.get("dataSource");return!!(nc(e)&&e.length)}getData(e,t,s=!1){const r=this._getFormatOptions(e,t),o=this.get("dataSource",[]);let n=o;const a=this.get("dataFields");a&&nc(o)&&(n=[],G(o,u=>{if(Tn(u)){const h={};$e(a,(d,c)=>{a[d]!=null&&(h[s?c:d]=this.convertToSpecialFormat(d,u[d],r))}),n.push(h)}}));const l={type:"dataprocessed",format:e,options:r,data:n,target:this};return this.events.dispatch("dataprocessed",l),l.data}getDataFields(e){let t=this.get("dataFields");return t||(t={},nc(e)&&e.length&&G(e,s=>{$e(s,(r,o)=>{t[r]==null&&(t[r]=r)})})),t}convertEmptyValue(e,t,s){return t??s.emptyAs}convertToSpecialFormat(e,t,s,r){if(typeof t=="number")if(this.isDateField(e))t=new Date(t);else{if(this.isNumericField(e)&&this.get("numberFormat"))return this._root.numberFormatter.format(t,this.get("numberFormat"));if(this.isDurationField(e))return this._root.durationFormatter.format(t,this.get("durationFormat"),this.get("durationUnit"))}return t instanceof Date&&(s.useTimestamps?t=t.getTime():s.useLocale?r||(t=t.toLocaleString()):t=this._root.dateFormatter.format(t,this.get("dateFormat"))),t}isDateField(e){return this.get("dateFields").indexOf(e)!==-1}isNumericField(e){return this.get("numericFields").indexOf(e)!==-1}isDurationField(e){return this.get("durationFields").indexOf(e)!==-1}getContentType(e){let t="";switch(e){case"png":t="image/"+e;break;case"jpg":t="image/jpeg";break;case"csv":t="text/csv";break;case"json":t="application/json";break;case"html":t="text/html";break;case"pdf":case"pdfdata":t="application/pdf";break;case"xlsx":t="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";break;default:t="application/octet-stream"}return t}getDisposableCanvas(){let e=document.createElement("canvas");return e.style.position="fixed",e.style.top="-10000px",this._root.dom.appendChild(e),e}disposeCanvas(e){this._root.dom.removeChild(e)}findBackgroundColor(e){let t=1,s=getComputedStyle(e,"background-color").getPropertyValue("background-color");if((s.match(/[^,]*,[^,]*,[^,]*,[ ]?0/)||s=="transparent")&&(t=0),t==0){let r=e.parentElement;return r?this.findBackgroundColor(r):ge.fromHex(16777215)}else return ge.fromCSS(s)}streamFile(e,t,s=!1){if(this.blobDownloadSupport()){let r=document.createElement("a");r.download=t,document.body.appendChild(r);let o=e.split(";"),n=o.shift().replace(/data:/,"");if(e=decodeURIComponent(o.join(";").replace(/^[^,]*,/,"")),["image/svg+xml","application/json","text/csv","text/html"].indexOf(n)==-1)try{e=atob(e)}catch{return!1}else{s&&(e="\uFEFF"+e);let h=new Blob([e],{type:n}),d=window.URL.createObjectURL(h);return r.href=d,r.download=t,r.click(),setTimeout(()=>{document.body.removeChild(r),window.URL.revokeObjectURL(d)},100),!0}let a=new Array(e.length);for(let h=0;h<e.length;++h){let d=e.charCodeAt(h);a[h]=d}s&&(a=[239,187,191].concat(a));let l=new Blob([new Uint8Array(a)],{type:n}),u=window.URL.createObjectURL(l);r.href=u,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),setTimeout(()=>{window.URL.revokeObjectURL(u)},100)}else if(this.linkDownloadSupport()){let r=document.createElement("a");r.download=t,r.href=e,document.body.appendChild(r),r.click(),document.body.removeChild(r)}else window.location.href=e;return!0}downloadSupport(){return this.linkDownloadSupport()}linkDownloadSupport(){return typeof document.createElement("a").download<"u"}blobDownloadSupport(){return window.Blob!=null}initiatePrint(e,t,s){const r=this._getFormatOptions("print",t);r.printMethod=="css"?this._printViaCSS(e,r,s):this._printViaIframe(e,r,s)}_printViaCSS(e,t,s){let o=this._getFormatOptions("print",t).delay||500,n=document.documentElement.scrollTop||document.body.scrollTop,a=new _t(sy(this._root.dom),"body > *",{display:"none",position:"fixed",visibility:"hidden",opacity:"0",clipPath:"polygon(0px 0px,0px 0px,0px 0px,0px 0px);"},this._root.nonce),l;s&&document&&document.title&&(l=document.title,document.title=s);let u=new Image;u.src=e,u.style.maxWidth="100%",u.style.display="block",u.style.position="relative",u.style.visibility="visible",u.style.opacity="1",u.style.clipPath="none",document.body.appendChild(u),this.setTimeout(()=>{window.print()},50),/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&o<1e3?o=1e3:o<100&&(o=100),this.setTimeout(()=>{document.body.removeChild(u),a.dispose(),l&&(document.title=document.title),document.documentElement.scrollTop=document.body.scrollTop=n},o||500)}_printViaIframe(e,t,s){let o=this._getFormatOptions("print",t).delay||500;const n=document.createElement("iframe");n.style.visibility="hidden",document.body.appendChild(n),n.contentWindow.document.open(),n.contentWindow.document.close();let a=new Image;a.src=e,a.style.maxWidth="100%",a.style.height="auto",s&&(n.contentWindow.document.title=s),n.contentWindow.document.body.appendChild(a),n.load=function(){n.contentWindow.document.body.appendChild(a)},this.setTimeout(()=>{try{n.contentWindow.document.execCommand("print",!1,null)||n.contentWindow.print()}catch{n.contentWindow.print()}},o||50),/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&o<1e3?o=1e3:o<100&&(o=100),this.setTimeout(()=>{document.body.removeChild(n)},o+50||100)}supportedFormats(){const e=[],t=this.hasData(),s=this.downloadSupport();return G(["png","jpg","canvas","pdf","xlsx","csv","json","html","pdfdata","print"],r=>{this._getFormatOptions(r).disabled!==!0&&(["xlsx","csv","json","html","pdfdata"].indexOf(r)==-1||t&&s)&&e.push(r)}),e}supportedExportTypes(){const e=["image","print"];return this.downloadSupport()&&this.hasData()&&e.push("data"),e}}Object.defineProperty(_h,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Exporting"});Object.defineProperty(_h,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Pt.classNames.concat([_h.className])});let Ru;function w0(i,e,t){const s=e.interfaceColors;if(!Ru){const r=new di([new _t(i,".am5exporting-menu",{color:s.get("secondaryButtonText").toCSS(),"font-size":"0.8em"}),new _t(i,".am5exporting-menu *",{"box-sizing":"border-box",transition:"all 100ms ease-in-out"}),new _t(i,".am5exporting-menu a",{display:"block",cursor:"pointer"}),new _t(i,".am5exporting-type-separator",{color:s.get("disabled").toCSS(),"border-bottom":"1px solid "+s.get("secondaryButtonDown").toCSS()}),new _t(i,".am5exporting-label-alt",{color:s.get("disabled").toCSS(),"font-size":"0.8em"}),new _t(i,".am5exporting-menu .am5exporting-type-separator a",{cursor:"default"}),new _t(i,".am5exporting-menu .am5exporting-type-separator a:hover",{background:"initial"}),new _t(i,".am5exporting-menu",{position:"absolute","z-index":"10"}),new _t(i,".am5exporting-icon",{width:"30px",height:"26px",position:"absolute",margin:"5px",padding:"3px 5px","border-radius":"3px",opacity:"0.5",background:"rgba(255, 255, 255, 0.001)","background-opacity":"0"}),new _t(i,".am5exporting-icon:focus, .am5exporting-icon:hover, .am5exporting-menu-open .am5exporting-icon",{background:s.get("secondaryButtonHover").toCSS(),opacity:"1"}),new _t(i,".am5exporting-menu path",{fill:s.get("secondaryButtonText").toCSS()}),new _t(i,".am5exporting-list",{display:"none","list-style":"none","list-style-type":"none",margin:"5px",background:s.get("secondaryButton").toCSS(),padding:"5px 0",border:"1px solid "+s.get("secondaryButtonStroke").toCSS(),"border-radius":"3px"}),new _t(i,".am5exporting-menu-open .am5exporting-list",{display:"block"}),new _t(i,".am5exporting-item",{}),new _t(i,".am5exporting-item a",{padding:"3px 15px"}),new _t(i,".am5exporting-item a:hover, .am5exporting-item a.am5exporting-item-active",{background:s.get("secondaryButtonHover").toCSS()}),new _t(i,".am5exporting-menu.am5exporting-align-left, .am5exporting-icon.am5exporting-align-left, .am5exporting-list.am5exporting-align-left",{left:"0"}),new _t(i,".am5exporting-menu.am5exporting-align-right, .am5exporting-icon.am5exporting-align-right, .am5exporting-list.am5exporting-align-right",{right:"0"}),new _t(i,".am5exporting-menu.am5exporting-valign-top, .am5exporting-icon.am5exporting-valign-top, .am5exporting-list.am5exporting-align-top",{top:"0"}),new _t(i,".am5exporting-menu.am5exporting-valign-bottom, .am5exporting-icon.am5exporting-valign-bottom, .am5exporting-list.am5exporting-align-bottom",{bottom:"0"}),new _t(i,".am5exporting-list.am5exporting-align-left",{"margin-left":"40px"}),new _t(i,".am5exporting-list.am5exporting-align-right",{"margin-right":"40px"})]);Ru=new mg(()=>{Ru=void 0,r.dispose()})}return Ru.increment()}class Eh extends Pt{constructor(){super(...arguments),Object.defineProperty(this,"_menuElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_iconElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_listElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_itemElements",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_itemDisposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_cssDisposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_activeItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isOpen",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isOver",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){super._afterNew(),this._setRawDefault("container",this._root._inner),this._setRawDefault("align","right"),this._setRawDefault("valign","top"),this._setRawDefault("useDefaultCSS",!0),this._setRawDefault("autoClose",!0),this._setRawDefault("deactivateRoot",!0),this._setRawDefault("items",[{type:"separator",label:this._t("Export")},{type:"format",format:"png",exportType:"image",label:this._t("PNG"),sublabel:this._t("Image")},{type:"format",format:"jpg",exportType:"image",label:this._t("JPG"),sublabel:this._t("Image")},{type:"format",format:"pdf",exportType:"image",label:this._t("PDF"),sublabel:this._t("Image")},{type:"separator",exportType:"data"},{type:"format",format:"json",exportType:"data",label:this._t("JSON"),sublabel:this._t("Data")},{type:"format",format:"csv",exportType:"data",label:this._t("CSV"),sublabel:this._t("Data")},{type:"format",format:"xlsx",exportType:"data",label:this._t("XLSX"),sublabel:this._t("Data")},{type:"format",format:"pdfdata",exportType:"data",label:this._t("PDF"),sublabel:this._t("Data")},{type:"format",format:"html",exportType:"data",label:this._t("HTML"),sublabel:this._t("Data")},{type:"separator"},{type:"format",format:"print",exportType:"print",label:this._t("Print")}]);const e=document.createElement("div");this._menuElement=e,this.setPrivate("menuElement",this._menuElement);const t=document.createElement("a");this._iconElement=t,this._listElement=document.createElement("ul"),this._listElement.setAttribute("role","menu"),this.setPrivate("listElement",this._listElement),this._applyClassNames(),t.innerHTML='<svg fill="none" height="20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M6 10a2 2 0 11-4 0 2 2 0 014 0zM12 10a2 2 0 11-4 0 2 2 0 014 0zM16 12a2 2 0 100-4 2 2 0 000 4z"/></svg>',t.setAttribute("tabindex",this._root.tabindex.toString()),t.setAttribute("aria-label",this._t("Export")+"; "+this._t("Press ENTER to open")),t.setAttribute("role","button"),Ls("keyboardevents")&&this._disposers.push(tt(document,"keydown",r=>{if(document.activeElement==this._iconElement||this.isOpen){if(r.keyCode==27)this.close();else if(r.keyCode==13)this._activeItem?this._handleClick(this._activeItem):this.toggle();else if(r.keyCode==38||r.keyCode==40){const o=this.get("items",[]);let n=o.indexOf(this._activeItem);this.get("valign")=="top"&&n==-1&&(n=o.length);const a=r.keyCode==38?-1:1;let l=n+a,u;do l<0?l=o.length-1:l>o.length-1&&(l=0),o[l].type=="separator"?l+=a:u=o[l];while(!u);u&&this._handleItemFocus(u)}}})),this._disposers.push(tt(t,"click",r=>{r.stopImmediatePropagation(),this.toggle()})),e.appendChild(this._iconElement),e.appendChild(this._listElement);const s=this.get("container",this._root._inner);s.appendChild(this._menuElement),this._disposers.push(tt(e,ll("pointerover"),r=>{this._isOver=!0,this.get("deactivateRoot")&&(this._root._renderer.interactionsEnabled=!1)})),this._disposers.push(tt(e,ll("pointerout"),r=>{this.get("deactivateRoot")&&(this.isOpen||this._isOver)&&(this._root._renderer.interactionsEnabled=!0),this._isOver=!1})),this._disposers.push(new Vt(()=>{this._menuElement&&s.removeChild(this._menuElement)})),this._disposers.push(tt(document,"click",r=>{this.isOpen&&!this._isOver&&this.close()})),this.loadDefaultCSS(),this._root.addDisposer(this),this.events.dispatch("menucreated",{type:"menucreated",target:this})}_afterChanged(){if(super._afterChanged(),this._itemElements.length==0&&this.createItems(),this.isDirty("useDefaultCSS")&&(this.get("useDefaultCSS")?this.loadDefaultCSS():this._cssDisposer&&this._cssDisposer.dispose()),this.isDirty("exporting")&&this.get("exporting")&&this.createItems(),(this.isDirty("align")||this.isDirty("valign"))&&this._applyClassNames(),this.isDirty("container")){const e=this.get("container");e&&e.appendChild(this._menuElement)}}_dispose(){super._dispose(),G(this._itemDisposers,e=>{e.dispose()})}_applyClassNames(){const e=this.get("align","right"),t=this.get("valign","top"),s=this.isOpen?"am5exporting-menu-open":"am5exporting-menu-closed";this._menuElement.className="am5exporting am5exporting-menu am5exporting-align-"+e+" am5exporting-valign-"+t+" "+s,this._iconElement.className="am5exporting am5exporting-icon am5exporting-align-"+e+" am5exporting-valign-"+t,this._listElement.className="am5exporting am5exporting-list am5exporting-align-"+e+" am5exporting-valign-"+t}createItems(){const e=this.get("exporting");if(!e)return;this._listElement.innerHTML="",this._itemElements=[];const t=this.get("items",[]),s=e.supportedFormats(),r=e.supportedExportTypes();G(this._itemDisposers,o=>{o.dispose()}),this._itemDisposers.length=0,G(t,o=>{if(o.format&&s.indexOf(o.format)==-1||o.exportType&&r.indexOf(o.exportType)==-1)return;const n=document.createElement("li");n.setAttribute("role","menuitem"),n.className="am5exporting am5exporting-item am5exporting-type-"+o.type,o.format&&(n.className+=" am5exporting-format-"+o.format);const a=document.createElement("a");let l=this._t("Export");o.label&&(a.innerHTML=o.label,l+=" "+o.label),o.sublabel&&(a.innerHTML+=' <span class="am5exporting-label-alt">'+o.sublabel+"</span>",l+=" ("+o.sublabel+")"),o.callback?(this._itemDisposers.push(tt(a,"click",u=>{o.callback.call(o.callbackTarget||this)})),a.setAttribute("tabindex",this._root.tabindex.toString())):o.format&&e&&(this._itemDisposers.push(tt(a,"click",u=>{this._handleClick(o)})),this._itemDisposers.push(tt(a,"focus",u=>{this._handleItemFocus(o)})),this._itemDisposers.push(tt(a,"blur",u=>{this._handleItemBlur(o)})),a.setAttribute("tabindex",this._root.tabindex.toString()),a.setAttribute("aria-label",l)),o.element=a,n.appendChild(a),this._listElement.appendChild(n),this._itemElements.push(n)})}_handleClick(e){const t=this.get("exporting");this.get("autoClose")&&this.close(),e.format=="print"?t.print():t.download(e.format)}_handleItemFocus(e){e!=this._activeItem&&(this._activeItem&&(this._activeItem.element.className=""),this._activeItem=e,e.element.className="am5exporting-item-active",e.element.focus())}_handleItemBlur(e){e.element.className="",e==this._activeItem&&(this._activeItem=void 0),this.setTimeout(()=>{(!document.activeElement||!ty(this.get("container"),document.activeElement))&&this.close()},10)}loadDefaultCSS(){const e=w0(sy(this._root.dom),this._root);this._disposers.push(e),this._cssDisposer=e}open(){this.isOpen=!0,this._applyClassNames(),this.events.dispatch("menuopened",{type:"menuopened",target:this})}close(){this.isOpen=!1,this.get("deactivateRoot")&&(this._root._renderer.interactionsEnabled=!0),ey(),this._applyClassNames(),this.events.dispatch("menuclosed",{type:"menuclosed",target:this})}toggle(){this.isOpen?this.close():this.open()}}Object.defineProperty(Eh,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ExportingMenu"});Object.defineProperty(Eh,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Pt.classNames.concat([Eh.className])});class b0 extends Cd{setupDefaultRules(){super.setupDefaultRules(),this.rule("Component").setAll({interpolationDuration:600}),this.rule("Hierarchy").set("animationDuration",600),this.rule("Scrollbar").set("animationDuration",600),this.rule("Tooltip").set("animationDuration",300),this.rule("MapChart").set("animationDuration",1e3),this.rule("MapChart").set("wheelDuration",300),this.rule("Entity").setAll({stateAnimationDuration:600}),this.rule("Sprite").states.create("default",{stateAnimationDuration:600}),this.rule("Tooltip",["axis"]).setAll({animationDuration:200}),this.rule("WordCloud").set("animationDuration",500)}}class S0 extends Cd{setupDefaultRules(){super.setupDefaultRules();const e=this._root.interfaceColors,t=this._root.language,s=this.rule.bind(this);s("XYChart").setAll({colors:wl.new(this._root,{}),paddingLeft:20,paddingRight:20,paddingTop:16,paddingBottom:16,panX:!1,panY:!1,wheelStep:.25,arrangeTooltips:!0,pinchZoomX:!1,pinchZoomY:!1}),s("XYSeries").setAll({legendLabelText:"{name}"}),s("XYChart",["scrollbar","chart"]).setAll({paddingBottom:0,paddingLeft:0,paddingTop:0,paddingRight:0,colors:wl.new(this._root,{saturation:0})});{const l=s("Graphics",["scrollbar","overlay"]);l.setAll({fillOpacity:.5}),Ce(l,"fill",e,"background")}s("RoundedRectangle",["xy","scrollbar","thumb"]).setAll({cornerRadiusTR:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusBL:0,fillOpacity:0,focusable:!0}),s("RoundedRectangle",["xy","scrollbar","thumb"]).states.create("hover",{fillOpacity:.4}),s("RoundedRectangle",["xy","scrollbar","chart","background"]).setAll({cornerRadiusTL:0,cornerRadiusBL:0,cornerRadiusTR:0,cornerRadiusBR:0}),s("RoundedRectangle",["xy","scrollbar","chart","background","resize","button"]).setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),s("AxisRendererX",["xy","chart","scrollbar"]).setAll({strokeOpacity:0,inside:!0}),s("AxisRendererY",["xy","chart","scrollbar"]).setAll({strokeOpacity:0,inside:!0,minGridDistance:5}),s("AxisLabel",["xy","scrollbar","x"]).setAll({opacity:.5,centerY:ue,minPosition:.01,maxPosition:.99,fontSize:"0.8em"}),s("AxisLabel",["category"]).setAll({text:"{category}",populateText:!0}),s("AxisLabel",["x"]).setAll({centerY:0}),s("AxisLabel",["x","inside"]).setAll({centerY:ue}),s("AxisLabel",["x","inside","opposite"]).setAll({centerY:0}),s("AxisLabel",["x","opposite"]).setAll({centerY:ue}),s("AxisLabel",["y"]).setAll({centerX:ue}),s("AxisLabel",["y","inside"]).setAll({centerX:0}),s("AxisLabel",["y","inside","opposite"]).setAll({centerX:ue}),s("AxisLabel",["y","opposite"]).setAll({centerX:0}),s("AxisLabel",["xy","scrollbar","y"]).setAll({visible:!1}),s("Grid",["xy","scrollbar","y"]).setAll({visible:!1}),s("Grid",["xy","scrollbar","x"]).setAll({opacity:.5}),s("XYCursor").setAll({behavior:"none",layer:30,exportable:!1,snapToSeriesBy:"xy",moveThreshold:1});{const l=s("Grid",["cursor","x"]);l.setAll({strokeOpacity:.8,strokeDasharray:[2,2],ariaLabel:t.translate("Use left and right arrows to move selection")}),Ce(l,"stroke",e,"alternativeBackground")}{const l=s("Grid",["cursor","y"]);l.setAll({strokeOpacity:.8,strokeDasharray:[2,2],ariaLabel:t.translate("Use up and down arrows to move selection")}),Ce(l,"stroke",e,"alternativeBackground")}{const l=s("Graphics",["cursor","selection"]);l.setAll({fillOpacity:.15}),Ce(l,"fill",e,"alternativeBackground")}s("Axis").setAll({start:0,end:1,minZoomCount:1,maxZoomCount:1/0,maxZoomFactor:1e3,maxDeviation:.1,snapTooltip:!0,tooltipLocation:.5,panX:!0,panY:!0,zoomX:!0,zoomY:!0,fixAxisSize:!0}),s("AxisLabel").setAll({location:.5,multiLocation:0,centerX:xt,centerY:xt,paddingTop:3,paddingBottom:3,paddingLeft:5,paddingRight:5}),s("Container",["axis","header"]).setAll({layer:30}),s("Rectangle",["axis","header","background"]).setAll({crisp:!0});{const l=s("AxisRenderer");l.setAll({crisp:!0,strokeOpacity:0}),Ce(l,"stroke",e,"grid")}s("AxisRendererX").setAll({minGridDistance:120,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,width:ue}),s("AxisRendererY").setAll({minGridDistance:40,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,height:ue});{const l=s("Rectangle",["axis","thumb"]);l.setAll({fillOpacity:0}),Ce(l,"fill",e,"alternativeBackground"),l.states.create("hover",{fillOpacity:.1})}s("Rectangle",["axis","thumb","x"]).setAll({cursorOverStyle:"ew-resize"}),s("Rectangle",["axis","thumb","y"]).setAll({cursorOverStyle:"ns-resize"});{const l=s("Grid");l.setAll({location:0,strokeOpacity:.15,crisp:!0}),Ce(l,"stroke",e,"grid")}s("Grid",["base"]).setAll({strokeOpacity:.3});{const l=s("Graphics",["axis","fill"]);l.setAll({visible:!1,isMeasured:!1,position:"absolute",fillOpacity:.05}),Ce(l,"fill",e,"alternativeBackground")}s("Graphics",["axis","fill","range"]).setAll({isMeasured:!0}),s("Graphics",["series","fill","range"]).setAll({visible:!1,isMeasured:!0}),s("Grid",["series","range"]).setAll({visible:!1}),s("AxisTick",["series","range"]).setAll({visible:!1}),s("AxisLabel",["series","range"]).setAll({visible:!1});{const l=s("AxisTick");l.setAll({location:.5,multiLocation:0,strokeOpacity:1,isMeasured:!1,position:"absolute",visible:!1}),Ce(l,"stroke",e,"grid")}s("CategoryAxis").setAll({startLocation:0,endLocation:1,fillRule:(l,u)=>{const h=l.get("axisFill");h&&(!B(u)||u%2==0?h.setPrivate("visible",!0):h.setPrivate("visible",!1))}});const r=[{timeUnit:"millisecond",count:1},{timeUnit:"millisecond",count:5},{timeUnit:"millisecond",count:10},{timeUnit:"millisecond",count:50},{timeUnit:"millisecond",count:100},{timeUnit:"millisecond",count:500},{timeUnit:"second",count:1},{timeUnit:"second",count:5},{timeUnit:"second",count:10},{timeUnit:"second",count:30},{timeUnit:"minute",count:1},{timeUnit:"minute",count:5},{timeUnit:"minute",count:10},{timeUnit:"minute",count:15},{timeUnit:"minute",count:30},{timeUnit:"hour",count:1},{timeUnit:"hour",count:3},{timeUnit:"hour",count:6},{timeUnit:"hour",count:12},{timeUnit:"day",count:1},{timeUnit:"day",count:2},{timeUnit:"day",count:3},{timeUnit:"day",count:4},{timeUnit:"day",count:5},{timeUnit:"week",count:1},{timeUnit:"month",count:1},{timeUnit:"month",count:2},{timeUnit:"month",count:3},{timeUnit:"month",count:6},{timeUnit:"year",count:1},{timeUnit:"year",count:2},{timeUnit:"year",count:5},{timeUnit:"year",count:10},{timeUnit:"year",count:50},{timeUnit:"year",count:100},{timeUnit:"year",count:200},{timeUnit:"year",count:500},{timeUnit:"year",count:1e3},{timeUnit:"year",count:2e3},{timeUnit:"year",count:5e3},{timeUnit:"year",count:1e4},{timeUnit:"year",count:1e5}],o={millisecond:t.translate("_date_millisecond"),second:t.translate("_date_second"),minute:t.translate("_date_minute"),hour:t.translate("_date_hour"),day:t.translate("_date_day"),week:t.translate("_date_day"),month:t.translate("_date_month"),year:t.translate("_date_year")},n={millisecond:t.translate("_date_millisecond"),second:t.translate("_date_second"),minute:t.translate("_date_minute"),hour:t.translate("_date_day"),day:t.translate("_date_day"),week:t.translate("_date_day"),month:t.translate("_date_month")+" "+t.translate("_date_year"),year:t.translate("_date_year")},a={millisecond:t.translate("_date_millisecond_full"),second:t.translate("_date_second_full"),minute:t.translate("_date_minute_full"),hour:t.translate("_date_hour_full"),day:t.translate("_date_day_full"),week:t.translate("_date_week_full"),month:t.translate("_date_month_full"),year:t.translate("_date_year")};s("CategoryDateAxis").setAll({markUnitChange:!0,gridIntervals:sp(r),dateFormats:mr(o),periodChangeDateFormats:mr(n)}),s("DateAxis").setAll({maxZoomFactor:null,strictMinMax:!0,startLocation:0,endLocation:1,markUnitChange:!0,groupData:!1,groupCount:500,gridIntervals:sp(r),dateFormats:mr(o),periodChangeDateFormats:mr(n),tooltipDateFormats:a,groupIntervals:[{timeUnit:"millisecond",count:1},{timeUnit:"millisecond",count:10},{timeUnit:"millisecond",count:100},{timeUnit:"second",count:1},{timeUnit:"second",count:10},{timeUnit:"minute",count:1},{timeUnit:"minute",count:10},{timeUnit:"hour",count:1},{timeUnit:"day",count:1},{timeUnit:"week",count:1},{timeUnit:"month",count:1},{timeUnit:"year",count:1}],fillRule:l=>{const u=l.get("axisFill");if(u){const h=l.component,d=l.get("value"),c=l.get("endValue"),p=h.intervalDuration(),y=h.getPrivate("baseInterval"),f=h.getPrivate("gridInterval",y);let w=h.getPrivate("min",0);if(w=ti(new Date(w),f.timeUnit,f.count,this._root.locale.firstDayOfWeek,this._root.utc,void 0,this._root.timezone).getTime(),d!=null&&c!=null){const _=Math.round(Math.round((d-w)/p))/2;_==Math.round(_)?u.setPrivate("visible",!0):u.setPrivate("visible",!1)}}}}),s("GaplessDateAxis").setAll({fillRule:l=>{const u=l.get("axisFill");if(u){const h=l.get("index");let d=!1;(!B(h)||h%2==0)&&(d=!0),u.setPrivate("visible",d)}}}),s("ValueAxis").setAll({baseValue:0,logarithmic:!1,strictMinMax:!1,autoZoom:!0,fillRule:l=>{const u=l.get("axisFill");if(u){const h=l.component,d=l.get("value"),c=h.getPrivate("step");B(d)&&B(c)&&(hi(d/c/2,5)==Math.round(d/c/2)?u.setPrivate("visible",!1):u.setPrivate("visible",!0))}}}),s("DurationAxis").setAll({baseUnit:"second"}),s("XYSeries").setAll({maskBullets:!0,stackToNegative:!0,locationX:.5,locationY:.5,snapTooltip:!1,openValueXGrouped:"open",openValueYGrouped:"open",valueXGrouped:"close",valueYGrouped:"close",seriesTooltipTarget:"series"}),s("BaseColumnSeries").setAll({adjustBulletPosition:!0}),s("ColumnSeries").setAll({clustered:!0}),s("RoundedRectangle",["series","column"]).setAll({position:"absolute",isMeasured:!1,width:ds(70),height:ds(70),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:"figure"}),s("LineSeries").setAll({connect:!0,autoGapCount:1.1,stackToNegative:!1}),s("Graphics",["series","stroke"]).setAll({position:"absolute",strokeWidth:1,strokeOpacity:1,isMeasured:!1}),s("Graphics",["series","fill"]).setAll({visible:!1,fillOpacity:0,position:"absolute",strokeWidth:0,strokeOpacity:0,isMeasured:!1}),s("Graphics",["line","series","legend","marker","stroke"]).setAll({draw:(l,u)=>{const h=u.parent;if(h){const d=h.height(),c=h.width();l.moveTo(0,d/2),l.lineTo(c,d/2)}}});{const l=s("Graphics",["line","series","legend","marker","stroke"]).states.create("disabled",{});Ce(l,"stroke",e,"disabled")}s("Graphics",["line","series","legend","marker","fill"]).setAll({draw:(l,u)=>{const h=u.parent;if(h){const d=h.height(),c=h.width();l.moveTo(0,0),l.lineTo(c,0),l.lineTo(c,d),l.lineTo(0,d),l.lineTo(0,0)}}});{const l=s("Graphics",["line","series","legend","marker","fill"]).states.create("disabled",{});Ce(l,"stroke",e,"disabled")}s("SmoothedXYLineSeries").setAll({tension:.5}),s("SmoothedXLineSeries").setAll({tension:.5}),s("SmoothedYLineSeries").setAll({tension:.5}),s("Candlestick").setAll({position:"absolute",isMeasured:!1,width:ds(50),height:ds(50),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:"figure"}),s("OHLC").setAll({width:ds(80),height:ds(80)}),s("CandlestickSeries").setAll({lowValueXGrouped:"low",lowValueYGrouped:"low",highValueXGrouped:"high",highValueYGrouped:"high",openValueXGrouped:"open",openValueYGrouped:"open",valueXGrouped:"close",valueYGrouped:"close"});{const l=s("Rectangle",["column","autocolor"]).states.create("riseFromOpen",{});Ce(l,"fill",e,"positive"),Ce(l,"stroke",e,"positive")}{const l=s("Rectangle",["column","autocolor"]).states.create("dropFromOpen",{});Ce(l,"fill",e,"negative"),Ce(l,"stroke",e,"negative")}s("Rectangle",["column","autocolor","pro"]).states.create("riseFromOpen",{fillOpacity:0}),s("Rectangle",["column","autocolor","pro"]).states.create("dropFromOpen",{fillOpacity:1});{const l=s("Rectangle",["column","autocolor","pro"]).states.create("riseFromPrevious",{});Ce(l,"fill",e,"positive"),Ce(l,"stroke",e,"positive")}{const l=s("Rectangle",["column","autocolor","pro"]).states.create("dropFromPrevious",{});Ce(l,"fill",e,"negative"),Ce(l,"stroke",e,"negative")}}}class xh extends Cl{constructor(){super(...arguments),Object.defineProperty(this,"xAxes",{enumerable:!0,configurable:!0,writable:!0,value:new fh}),Object.defineProperty(this,"yAxes",{enumerable:!0,configurable:!0,writable:!0,value:new fh}),Object.defineProperty(this,"topAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(Te.new(this._root,{width:ue,layout:this._root.verticalLayout}))}),Object.defineProperty(this,"yAxesAndPlotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(Te.new(this._root,{width:ue,height:ue,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"bottomAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(Te.new(this._root,{width:ue,layout:this._root.verticalLayout}))}),Object.defineProperty(this,"leftAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(Te.new(this._root,{height:ue,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"plotsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(Te.new(this._root,{width:ue,height:ue,maskContent:!1}))}),Object.defineProperty(this,"plotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotsContainer.children.push(Te.new(this._root,{width:ue,height:ue}))}),Object.defineProperty(this,"topPlotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotsContainer.children.push(Te.new(this._root,{width:ue,height:ue}))}),Object.defineProperty(this,"gridContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotContainer.children.push(Te.new(this._root,{width:ue,height:ue,isMeasured:!1}))}),Object.defineProperty(this,"topGridContainer",{enumerable:!0,configurable:!0,writable:!0,value:Te.new(this._root,{width:ue,height:ue,isMeasured:!1})}),Object.defineProperty(this,"rightAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(Te.new(this._root,{height:ue,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"axisHeadersContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotContainer.children.push(Te.new(this._root,{}))}),Object.defineProperty(this,"zoomOutButton",{enumerable:!0,configurable:!0,writable:!0,value:this.topPlotContainer.children.push(bh.new(this._root,{themeTags:["zoom"],icon:it.new(this._root,{themeTags:["button","icon"]})}))}),Object.defineProperty(this,"_movePoint",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"_wheelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_otherCharts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_movePoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_downStartX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downEndX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downStartY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downEndY",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this._defaultThemes.push(S0.new(this._root)),super._afterNew(),this._disposers.push(this.xAxes),this._disposers.push(this.yAxes);const e=this._root;let t=this._root.verticalLayout;const s=this.zoomOutButton;s.events.on("click",()=>{this.zoomOut()}),s.set("opacity",0),s.states.lookup("default").set("opacity",1),this.chartContainer.set("layout",t);const r=this.plotContainer;r.children.push(this.seriesContainer),this._disposers.push(this._processAxis(this.xAxes,this.bottomAxesContainer)),this._disposers.push(this._processAxis(this.yAxes,this.leftAxesContainer)),r.children.push(this.topGridContainer),r.children.push(this.bulletsContainer),r.set("interactive",!0),r.set("interactiveChildren",!1),r.set("background",Hi.new(e,{themeTags:["xy","background"],fill:ge.fromHex(0),fillOpacity:0})),this._disposers.push(r.events.on("pointerdown",o=>{this._handlePlotDown(o.originalEvent)})),this._disposers.push(r.events.on("globalpointerup",o=>{this._handlePlotUp(o.originalEvent)})),this._disposers.push(r.events.on("globalpointermove",o=>{this._handlePlotMove(o.originalEvent)})),this._maskGrid(),this._setUpTouch()}_beforeChanged(){super._beforeChanged(),(this.isDirty("pinchZoomX")||this.isDirty("pinchZoomY")||this.get("panX")||this.get("panY"))&&this._setUpTouch()}_setUpTouch(){this.plotContainer._display.cancelTouch||(this.plotContainer._display.cancelTouch=!!(this.get("pinchZoomX")||this.get("pinchZoomY")||this.get("panX")||this.get("panY")))}_maskGrid(){this.gridContainer.set("maskContent",!0),this.topGridContainer.set("maskContent",!0)}_removeSeries(e){const t=e.get("xAxis");t&&(Yi(t.series,e),t.markDirtyExtremes());const s=e.get("yAxis");s&&(Yi(s.series,e),s.markDirtyExtremes());const r=this.get("cursor");if(r){const o=r.get("snapToSeries");o&&Yi(o,e)}super._removeSeries(e)}handleWheel(e){const t=this.get("wheelX"),s=this.get("wheelY"),r=this.plotContainer,o=e.originalEvent;if(iy(o,this))o.preventDefault();else return;const n=r.toLocal(this._root.documentPointToRoot({x:o.clientX,y:o.clientY})),a=this.get("wheelStep",.2),l=o.deltaY/100,u=o.deltaX/100,h=this.get("wheelZoomPositionX"),d=this.get("wheelZoomPositionY");(t==="zoomX"||t==="zoomXY")&&u!=0&&this.xAxes.each(c=>{if(c.get("zoomX")){let p=c.get("start"),y=c.get("end"),f=c.fixPosition(n.x/r.width());h!=null&&(f=h);let w=p-a*(y-p)*u*f,_=y+a*(y-p)*u*(1-f);1/(_-w)<c.getPrivate("maxZoomFactor",1/0)/c.get("minZoomCount",1)&&this._handleWheelAnimation(c.zoom(w,_))}}),(s==="zoomX"||s==="zoomXY")&&l!=0&&this.xAxes.each(c=>{if(c.get("zoomX")){let p=c.get("start"),y=c.get("end"),f=c.fixPosition(n.x/r.width());h!=null&&(f=h);let w=p-a*(y-p)*l*f,_=y+a*(y-p)*l*(1-f);1/(_-w)<c.getPrivate("maxZoomFactor",1/0)/c.get("minZoomCount",1)&&this._handleWheelAnimation(c.zoom(w,_))}}),(t==="zoomY"||t==="zoomXY")&&u!=0&&this.yAxes.each(c=>{if(c.get("zoomY")){let p=c.get("start"),y=c.get("end"),f=c.fixPosition(n.y/r.height());d!=null&&(f=d);let w=p-a*(y-p)*u*f,_=y+a*(y-p)*u*(1-f);1/(_-w)<c.getPrivate("maxZoomFactor",1/0)/c.get("minZoomCount",1)&&this._handleWheelAnimation(c.zoom(w,_))}}),(s==="zoomY"||s==="zoomXY")&&l!=0&&this.yAxes.each(c=>{if(c.get("zoomY")){let p=c.get("start"),y=c.get("end"),f=c.fixPosition(n.y/r.height());d!=null&&(f=d);let w=p-a*(y-p)*l*f,_=y+a*(y-p)*l*(1-f);1/(_-w)<c.getPrivate("maxZoomFactor",1/0)/c.get("minZoomCount",1)&&this._handleWheelAnimation(c.zoom(w,_))}}),(t==="panX"||t==="panXY")&&u!=0&&this.xAxes.each(c=>{if(c.get("panX")){let p=c.get("start"),y=c.get("end"),f=this._getWheelSign(c)*a*(y-p)*u,w=p+f,_=y+f,P=this._fixWheel(w,_);w=P[0],_=P[1],this._handleWheelAnimation(c.zoom(w,_))}}),(s==="panX"||s==="panXY")&&l!=0&&this.xAxes.each(c=>{if(c.get("panX")){let p=c.get("start"),y=c.get("end"),f=this._getWheelSign(c)*a*(y-p)*l,w=p+f,_=y+f,P=this._fixWheel(w,_);w=P[0],_=P[1],this._handleWheelAnimation(c.zoom(w,_))}}),(t==="panY"||t==="panXY")&&u!=0&&this.yAxes.each(c=>{if(c.get("panY")){let p=c.get("start"),y=c.get("end"),f=this._getWheelSign(c)*a*(y-p)*u,w=p+f,_=y+f,P=this._fixWheel(w,_);w=P[0],_=P[1],this._handleWheelAnimation(c.zoom(w,_))}}),(s==="panY"||s==="panXY")&&l!=0&&this.yAxes.each(c=>{if(c.get("panY")){let p=c.get("start"),y=c.get("end"),f=this._getWheelSign(c)*a*(y-p)*l,w=p-f,_=y-f,P=this._fixWheel(w,_);w=P[0],_=P[1],this._handleWheelAnimation(c.zoom(w,_))}})}_handleSetWheel(){const e=this.get("wheelX"),t=this.get("wheelY"),s=this.plotContainer;e!=="none"||t!=="none"?(this._wheelDp=s.events.on("wheel",r=>{this.handleWheel(r)}),this._disposers.push(this._wheelDp)):this._wheelDp&&this._wheelDp.dispose()}_getWheelSign(e){let t=1;return e.get("renderer").get("inversed")&&(t=-1),t}_fixWheel(e,t){const s=t-e;return e<0&&(e=0,t=e+s),t>1&&(t=1,e=t-s),[e,t]}_handlePlotDown(e){if(e.button==2)return;const t=this.plotContainer;let s=t.toLocal(this._root.documentPointToRoot({x:e.clientX,y:e.clientY}));if((this.get("pinchZoomX")||this.get("pinchZoomY"))&&e.pointerId&&Ht(t._downPoints).length>0){const n=this.xAxes.getIndex(0),a=this.yAxes.getIndex(0);n&&(this._downStartX=n.get("start",0),this._downEndX=n.get("end",1)),a&&(this._downStartY=a.get("start",0),this._downEndY=a.get("end",1))}if((this.get("panX")||this.get("panY"))&&s.x>=0&&s.y>=0&&s.x<=t.width()&&s.y<=this.height()){this._downPoint={x:e.clientX,y:e.clientY};const r=this.get("panX"),o=this.get("panY");r&&this.xAxes.each(a=>{a._panStart=a.get("start"),a._panEnd=a.get("end")}),o&&this.yAxes.each(a=>{a._panStart=a.get("start"),a._panEnd=a.get("end")});const n="panstarted";this.events.isEnabled(n)&&this.events.dispatch(n,{type:n,target:this,originalEvent:e})}}_handleWheelAnimation(e){e?e.events.on("stopped",()=>{this._dispatchWheelAnimation()}):this._dispatchWheelAnimation()}_dispatchWheelAnimation(){const e="wheelended";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this})}_handlePlotUp(e){const t=this._downPoint;if(t&&(this.get("panX")||this.get("panY"))){let s=this.plotContainer.toLocal(this._root.documentPointToRoot({x:e.clientX,y:e.clientY}));if(s.x==t.x&&s.y==t.y){const o="pancancelled";this.events.isEnabled(o)&&this.events.dispatch(o,{type:o,target:this,originalEvent:e})}const r="panended";this.events.isEnabled(r)&&this.events.dispatch(r,{type:r,target:this,originalEvent:e})}this._downPoint=void 0,this.xAxes.each(s=>{s._isPanning=!1}),this.yAxes.each(s=>{s._isPanning=!1})}_handlePlotMove(e){const t=this.plotContainer;if(this.get("pinchZoomX")||this.get("pinchZoomY")){const o=e.pointerId;if(o&&(this._movePoints[o]=this._root.documentPointToRoot({x:e.clientX,y:e.clientY}),Ht(t._downPoints).length>1)){this._handlePinch();return}}let s=this._downPoint;if(s){s=t.toLocal(this._root.documentPointToRoot(s));let r=t.toLocal(this._root.documentPointToRoot({x:e.clientX,y:e.clientY}));const o=this.get("panX"),n=this.get("panY");if(o){let a=this.get("scrollbarX");a&&a.events.disableType("rangechanged"),this.xAxes.each(l=>{if(l.get("panX")){l._isPanning=!0;let u=l._panStart,h=l._panEnd,c=(h-u)*(s.x-r.x)/t.width();l.get("renderer").get("inversed")&&(c*=-1);let p=u+c,y=h+c;y-p<1+l.get("maxDeviation",1)*2&&(l.set("start",p),l.set("end",y))}}),a&&a.events.enableType("rangechanged")}if(n){let a=this.get("scrollbarY");a&&a.events.disableType("rangechanged"),this.yAxes.each(l=>{if(l.get("panY")){l._isPanning=!0;let u=l._panStart,h=l._panEnd,c=(h-u)*(s.y-r.y)/t.height();l.get("renderer").get("inversed")&&(c*=-1);let p=u-c,y=h-c;y-p<1+l.get("maxDeviation",1)*2&&(l.set("start",p),l.set("end",y))}}),a&&a.events.enableType("rangechanged")}}}_handlePinch(){const e=this.plotContainer;let t=0,s=[],r=[];if($e(e._downPoints,(o,n)=>{s[t]=n;let a=this._movePoints[o];a&&(r[t]=a),t++}),s.length>1&&r.length>1){const o=e.width(),n=e.height();let a=s[0],l=s[1],u=r[0],h=r[1];if(a&&l&&u&&h){if(u=e.toLocal(u),h=e.toLocal(h),a=e.toLocal(a),l=e.toLocal(l),this.get("pinchZoomX")){const d=this._downStartX,c=this._downEndX;if(d!=null&&c!=null){a.x>l.x&&([a,l]=[l,a],[u,h]=[h,u]);let p=d+a.x/o*(c-d),y=d+l.x/o*(c-d),f=d+u.x/o*(c-d),w=d+h.x/o*(c-d),_=Math.max(.001,y-p),P=Math.max(.001,w-f),T=_/P,D=d*T+p-f*T,M=c*T+y-w*T;this.xAxes.each(O=>{let N=O.fixPosition(D),z=O.fixPosition(M);O.zoom(N,z,0)})}}if(this.get("pinchZoomY")){const d=this._downStartY,c=this._downEndY;if(d!=null&&c!=null){a.y<l.y&&([a,l]=[l,a],[u,h]=[h,u]);let p=d+(1-a.y/n)*(c-d),y=d+(1-l.y/n)*(c-d),f=d+(1-u.y/n)*(c-d),w=d+(1-h.y/n)*(c-d),_=Math.max(.001,y-p),P=Math.max(.001,w-f),T=_/P,D=d*T+p-f*T,M=c*T+y-w*T;this.yAxes.each(O=>{let N=O.fixPosition(D),z=O.fixPosition(M);O.zoom(N,z,0)})}}}}}_handleCursorPosition(){const e=this.get("cursor");if(e){const t=e.getPrivate("point");let s=e.get("snapToSeries");if(e._downPoint&&(s=void 0),s&&t){const r=e.get("snapToSeriesBy"),o=[];G(s,l=>{if(!l.isHidden()&&!l.isHiding())if(r!="x!"&&r!="y!"){const u=l.startIndex(),h=l.endIndex();for(let d=u;d<h;d++){const c=l.dataItems[d];c&&!c.isHidden()&&o.push(c)}}else{const u=l.get("tooltipDataItem");u&&o.push(u)}});let n=1/0,a;if(G(o,l=>{const u=l.get("point");if(u){let h=0;r=="x"||r=="x!"?h=Math.abs(t.x-u.x):r=="y"||r=="y!"?h=Math.abs(t.y-u.y):h=Math.hypot(t.x-u.x,t.y-u.y),h<n&&(n=h,a=l)}}),G(s,l=>{const u=l.get("tooltip");u&&u._setDataItem(void 0)}),a){let l=a.component;l.showDataItemTooltip(a);const u=a.get("point");u&&e.handleMove(l.toGlobal({x:u.x-l.x(),y:u.y-l.y()}),!0)}}}}_updateCursor(){let e=this.get("cursor");e&&e.handleMove()}_addCursor(e){this.plotContainer.children.push(e)}_prepareChildren(){if(super._prepareChildren(),this.series.each(e=>{this._colorize(e)}),(this.isDirty("wheelX")||this.isDirty("wheelY"))&&this._handleSetWheel(),this.isDirty("cursor")){const e=this._prevSettings.cursor,t=this.get("cursor");t!==e&&(this._disposeProperty("cursor"),e&&e.dispose(),t&&(t._setChart(this),this._addCursor(t),this._pushPropertyDisposer("cursor",t.events.on("selectended",()=>{this._handleCursorSelectEnd()}))),this._prevSettings.cursor=t)}if(this.isDirty("scrollbarX")){const e=this._prevSettings.scrollbarX,t=this.get("scrollbarX");t!==e&&(this._disposeProperty("scrollbarX"),e&&e.dispose(),t&&(t.parent||this.topAxesContainer.children.push(t),this._pushPropertyDisposer("scrollbarX",t.events.on("rangechanged",s=>{this._handleScrollbar(this.xAxes,s.start,s.end,s.grip)})),t.setPrivate("positionTextFunction",s=>{const r=this.xAxes.getIndex(0);return r&&r.getTooltipText(s)||""})),this._prevSettings.scrollbarX=t)}if(this.isDirty("scrollbarY")){const e=this._prevSettings.scrollbarY,t=this.get("scrollbarY");t!==e&&(this._disposeProperty("scrollbarY"),e&&e.dispose(),t&&(t.parent||this.rightAxesContainer.children.push(t),this._pushPropertyDisposer("scrollbarY",t.events.on("rangechanged",s=>{this._handleScrollbar(this.yAxes,s.start,s.end,s.grip)})),t.setPrivate("positionTextFunction",s=>{const r=this.yAxes.getIndex(0);return r&&r.getTooltipText(s)||""})),this._prevSettings.scrollbarY=t)}this._handleZoomOut()}_processSeries(e){super._processSeries(e),this._colorize(e)}_colorize(e){const t=this.get("colors");if(t&&e.get("fill")==null){const s=t.next();e._setSoft("stroke",s),e._setSoft("fill",s)}}_handleCursorSelectEnd(){const e=this.get("cursor"),t=e.get("behavior"),s=e.getPrivate("downPositionX",0),r=e.getPrivate("downPositionY",0),o=e.getPrivate("positionX",.5),n=e.getPrivate("positionY",.5);this.xAxes.each(a=>{if(t==="zoomX"||t==="zoomXY"){let l=a.toAxisPosition(s),u=a.toAxisPosition(o);a.zoom(l,u)}a.setPrivate("updateScrollbar",!0)}),this.yAxes.each(a=>{if(t==="zoomY"||t==="zoomXY"){let l=a.toAxisPosition(r),u=a.toAxisPosition(n);a.zoom(l,u)}a.setPrivate("updateScrollbar",!0)})}_handleScrollbar(e,t,s,r){e.each(o=>{let n=o.fixPosition(t),a=o.fixPosition(s),l=o.zoom(n,a,void 0,r);const u="updateScrollbar";o.setPrivateRaw(u,!1),l?l.events.on("stopped",()=>{o.setPrivateRaw(u,!0)}):o.setPrivateRaw(u,!0)})}_processAxis(e,t){return e.events.onAll(s=>{if(s.type==="clear")G(s.oldValues,r=>{this._removeAxis(r)});else if(s.type==="push")t.children.push(s.newValue),s.newValue.processChart(this);else if(s.type==="setIndex")t.children.setIndex(s.index,s.newValue),s.newValue.processChart(this);else if(s.type==="insertIndex")t.children.insertIndex(s.index,s.newValue),s.newValue.processChart(this);else if(s.type==="removeIndex")this._removeAxis(s.oldValue);else if(s.type==="moveIndex")t.children.moveValue(s.value,s.newIndex),s.value.processChart(this);else throw new Error("Unknown IListEvent type")})}_removeAxis(e){if(!e.isDisposed()){const t=e.parent;t&&t.children.removeValue(e);const s=e.gridContainer,r=s.parent;r&&r.children.removeValue(s);const o=e.topGridContainer,n=o.parent;n&&n.children.removeValue(o)}}_updateChartLayout(){const e=this.leftAxesContainer.width(),t=this.rightAxesContainer.width(),s=this.bottomAxesContainer;s.set("paddingLeft",e),s.set("paddingRight",t);const r=this.topAxesContainer;r.set("paddingLeft",e),r.set("paddingRight",t)}processAxis(e){}_handleAxisSelection(e,t){let s=e.fixPosition(e.get("start",0)),r=e.fixPosition(e.get("end",1));if(s>r&&([s,r]=[r,s]),this.xAxes.indexOf(e)!=-1){if(t||e.getPrivate("updateScrollbar")){let o=this.get("scrollbarX");o&&(!o.getPrivate("isBusy")||t)&&(o.setRaw("start",s),o.setRaw("end",r),o.updateGrips())}}else if(this.yAxes.indexOf(e)!=-1&&(t||e.getPrivate("updateScrollbar"))){let o=this.get("scrollbarY");o&&(!o.getPrivate("isBusy")||t)&&(o.setRaw("start",s),o.setRaw("end",r),o.updateGrips())}this._handleZoomOut()}_handleZoomOut(){let e=this.zoomOutButton;if(e&&e.parent){let t=!1;this.xAxes.each(s=>{(s.get("start")!=0||s.get("end")!=1)&&(t=!0)}),this.yAxes.each(s=>{(s.get("start")!=0||s.get("end")!=1)&&(t=!0)}),t?e.isHidden()&&e.show():e.hide()}}inPlot(e){const t=this.plotContainer,s=this.getPrivate("otherCharts",this._otherCharts),r=t.toGlobal(e);if(e.x>=-.5&&e.y>=-.5&&e.x<=t.width()+.5&&e.y<=t.height()+.5)return!0;if(s)for(let o=s.length-1;o>=0;o--){const n=s[o];if(n!=this){const a=n.plotContainer,l=this._root.rootPointToDocument(r),u=n._root.documentPointToRoot(l),h=a.toLocal(u);if(h.x>=-.1&&h.y>=-.1&&h.x<=a.width()+.1&&h.y<=a.height()+.1)return!0}}return!1}arrangeTooltips(){const e=this.plotContainer,t=e.width(),s=e.height(),r=this.height();let o=e._display.toGlobal({x:0,y:0}),n=e._display.toGlobal({x:t,y:s});const a=[];let l=0,u=1/0,h=this._movePoint,d=this.get("maxTooltipDistance"),c=this.get("maxTooltipDistanceBy","xy"),p,y;B(d)&&this.series.each(w=>{if(!w.isHidden()){const _=w.get("tooltip");if(_){let P=_.get("pointTo");if(P){let T=Math.hypot(h.x-P.x,h.y-P.y);c=="x"?T=Math.abs(h.x-P.x):c=="y"&&(T=Math.abs(h.y-P.y)),T<u&&(u=T,p=w,y=P)}}}});const f=[];if(this.series.each(w=>{const _=w.get("tooltip");if(_){let P=!1,T=_.get("pointTo");if(T){if(d>=0){let D=_.get("pointTo");if(D&&w!=p){let M=Math.hypot(y.x-D.x,y.y-D.y);c=="x"?M=Math.abs(y.x-D.x):c=="y"&&(M=Math.abs(y.y-D.y)),M>d&&(P=!0)}}else d==-1&&w!=p&&(P=!0);!this.inPlot(this._tooltipToLocal(T))||!_.dataItem?P=!0:P||(l+=T.y),P||w.isHidden()||w.isHiding()?_.hide(0):(_.show(),a.push(_),f.push(w))}}}),this.setPrivate("tooltipSeries",f),this.get("arrangeTooltips")){const w=this._root.tooltipContainer,_=a.length;if(l/_>s/2+o.y){a.sort((D,M)=>xf(M.get("pointTo").y,D.get("pointTo").y));let T=n.y;if(G(a,D=>{let M=D.height(),O=D.get("centerY");O instanceof He&&(M*=O.value),M+=D.get("marginBottom",0),D.set("bounds",{left:o.x,top:o.y,right:n.x,bottom:T}),D.setPrivate("customData",{left:o.x,top:o.y,right:n.x,bottom:T}),T=Math.min(T-M,D._fy-M),D.parent==w&&w.children.moveValue(D,0)}),T<0){a.reverse();let D=T;G(a,M=>{let O=M.get("bounds");if(O){let N=O.top-T,z=O.bottom-T;N<D&&(N=D,z=N+M.height()),M.set("bounds",{left:O.left,top:N,right:O.right,bottom:z}),D=O.bottom-T+M.get("marginBottom",0)}})}}else{a.reverse(),a.sort((D,M)=>xf(D.get("pointTo").y,M.get("pointTo").y));let T=0;if(G(a,D=>{let M=D.height(),O=D.get("centerY");O instanceof He&&(M*=O.value),M+=D.get("marginBottom",0),D.set("bounds",{left:o.x,top:T,right:n.x,bottom:Math.max(o.y+r,T+M)}),D.parent==w&&w.children.moveValue(D,0),T=Math.max(T+M,D._fy+M)}),T>r){a.reverse();let D=r;G(a,M=>{let O=M.get("bounds");if(O){let N=O.top-(r-T),z=O.bottom-(r-T);z>D&&(z=D,N=z-M.height()),M.set("bounds",{left:O.left,top:N,right:O.right,bottom:z}),D=z-M.height()-M.get("marginBottom",0)}})}}}}_tooltipToLocal(e){return this.plotContainer.toLocal(e)}zoomOut(){this.xAxes.each(e=>{e.setPrivate("updateScrollbar",!0),e.zoom(0,1)}),this.yAxes.each(e=>{e.setPrivate("updateScrollbar",!0),e.zoom(0,1)})}}Object.defineProperty(xh,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYChart"});Object.defineProperty(xh,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Cl.classNames.concat([xh.className])});class Ln extends it{_beforeChanged(){super._beforeChanged(),(this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}}Object.defineProperty(Ln,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Grid"});Object.defineProperty(Ln,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:it.classNames.concat([Ln.className])});class Rh extends Te{constructor(){super(...arguments),Object.defineProperty(this,"lineX",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(Ln.new(this._root,{themeTags:["x"]}))}),Object.defineProperty(this,"lineY",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(Ln.new(this._root,{themeTags:["y"]}))}),Object.defineProperty(this,"selection",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(it.new(this._root,{themeTags:["selection","cursor"],layer:30}))}),Object.defineProperty(this,"_movePoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_lastPoint",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"_tooltipX",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_tooltipY",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_toX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_toY",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this._settings.themeTags=Ct(this._settings.themeTags,["xy","cursor"]),super._afterNew(),this.setAll({width:ue,height:ue,isMeasured:!0,position:"absolute"}),this.states.create("hidden",{visible:!0,opacity:0}),this._drawLines(),this.setPrivateRaw("visible",!1),this._disposers.push(this.setTimeout(()=>{this.setPrivate("visible",!0)},500)),this._disposers.push(this.lineX.events.on("positionchanged",()=>{this._handleXLine()})),this._disposers.push(this.lineY.events.on("positionchanged",()=>{this._handleYLine()})),this._disposers.push(this.lineX.events.on("focus",e=>this._handleLineFocus(e.target))),this._disposers.push(this.lineX.events.on("blur",e=>this._handleLineBlur(e.target))),this._disposers.push(this.lineY.events.on("focus",e=>this._handleLineFocus(e.target))),this._disposers.push(this.lineY.events.on("blur",e=>this._handleLineBlur(e.target))),Ls("keyboardevents")&&this._disposers.push(tt(document,"keydown",e=>{this._handleLineMove(e.keyCode)}))}_setUpTouch(){const e=this.chart;e&&(e.plotContainer._display.cancelTouch=this.get("behavior")!="none")}_handleXLine(){let e=this.lineX.x(),t=!0;(e<0||e>this.width())&&(t=!1),this.lineX.setPrivate("visible",t)}_handleYLine(){let e=this.lineY.y(),t=!0;(e<0||e>this.height())&&(t=!1),this.lineY.setPrivate("visible",t)}_handleLineMove(e){let t="",s=0,r=.1;const o=this.chart;this._root.focused(this.lineX)?(o&&o.xAxes.length&&(r=o.xAxes.getIndex(0).getCellWidthPosition()),s=this.getPrivate("positionX",0),t="positionX",e==37?s-=r:e==39&&(s+=r)):this._root.focused(this.lineY)&&(o&&o.yAxes.length&&(r=o.yAxes.getIndex(0).getCellWidthPosition()),s=this.getPrivate("positionY",0),t="positionY",e==38?s-=r:e==40&&(s+=r)),s<0?s=0:s>1&&(s=1),t!=""&&this.set(t,s)}_handleLineFocus(e){this.setAll({positionX:this.getPrivate("positionX"),positionY:this.getPrivate("positionY"),alwaysShow:!0})}_handleLineBlur(e){this.setAll({positionX:void 0,positionY:void 0,alwaysShow:!1})}_prepareChildren(){if(super._prepareChildren(),this.isDirty("xAxis")){this._tooltipX=!1;const e=this.get("xAxis");if(e){const t=e.get("tooltip");t&&(this._tooltipX=!0,this._disposers.push(t.on("pointTo",()=>{this._updateXLine(t)})))}}if(this.isDirty("yAxis")){this._tooltipY=!1;const e=this.get("yAxis");if(e){const t=e.get("tooltip");t&&(this._tooltipY=!0,this._disposers.push(t.on("pointTo",()=>{this._updateYLine(t)})))}}}_handleSyncWith(){const e=this.chart;if(e){const t=this.get("syncWith"),s=[];t&&G(t,r=>{const o=r.chart;o&&s.push(o)}),e._otherCharts=s}}_updateChildren(){if(super._updateChildren(),this._handleSyncWith(),this.isDirty("positionX")||this.isDirty("positionY")){const e=this.get("positionX"),t=this.get("positionY");e==null&&t==null?this.hide(0):(this._movePoint=this.toGlobal(this._getPoint(this.get("positionX",0),this.get("positionY",0))),this.handleMove())}}_updateXLine(e){let t=hi(this._display.toLocal(e.get("pointTo",{x:0,y:0})).x,2);this._toX!=t&&(this.lineX.animate({key:"x",to:t,duration:e.get("animationDuration",0),easing:e.get("animationEasing")}),this._toX=t)}_updateYLine(e){let t=hi(this._display.toLocal(e.get("pointTo",{x:0,y:0})).y,2);this._toY!=t&&(this.lineY.animate({key:"y",to:t,duration:e.get("animationDuration",0),easing:e.get("animationEasing")}),this._toY=t)}_drawLines(){this.lineX.set("draw",e=>{e.moveTo(0,0),e.lineTo(0,this.height())}),this.lineY.set("draw",e=>{e.moveTo(0,0),e.lineTo(this.width(),0)})}_setChart(e){this.chart=e,this._handleSyncWith();const t=e.plotContainer;this.events.on("boundschanged",()=>{this._disposers.push(this.setTimeout(()=>{this.get("alwaysShow")&&(this._movePoint=this.toGlobal(this._getPoint(this.get("positionX",0),this.get("positionY",0))),this.handleMove())},50))}),Ls("touchevents")&&(this._disposers.push(t.events.on("click",r=>{rp(r.originalEvent)&&this._handleMove(r.originalEvent)})),this._setUpTouch()),this._disposers.push(t.events.on("pointerdown",r=>{this._handleCursorDown(r.originalEvent)})),this._disposers.push(t.events.on("globalpointerup",r=>{this._handleCursorUp(r.originalEvent),!r.native&&!this.isHidden()&&this._handleMove(r.originalEvent)})),this._disposers.push(t.events.on("globalpointermove",r=>{!this.get("syncWith")&&Ht(t._downPoints).length==0&&!r.native&&this.isHidden()||this._handleMove(r.originalEvent)}));const s=this.parent;s&&s.children.moveValue(this.selection)}_inPlot(e){const t=this.chart;return t?t.inPlot(e):!1}_handleCursorDown(e){if(e.button==2)return;const t=this._root.documentPointToRoot({x:e.clientX,y:e.clientY});let s=this._display.toLocal(t);const r=this.chart;if(this.selection.set("draw",()=>{}),r&&this._inPlot(s)){if(this._downPoint=s,this.get("behavior")!="none"){this.selection.show();const a="selectstarted";this.events.isEnabled(a)&&this.events.dispatch(a,{type:a,target:this})}let o=this._getPosition(s).x,n=this._getPosition(s).y;this.setPrivate("downPositionX",o),this.setPrivate("downPositionY",n)}}_handleCursorUp(e){if(this._downPoint){const t=this.get("behavior","none");if(t!="none"){t.charAt(0)==="z"&&this.selection.hide();const s=this._root.documentPointToRoot({x:e.clientX,y:e.clientY});let r=this._display.toLocal(s);const o=this._downPoint,n=this.get("moveThreshold",1);if(r&&o){let a=!1;if((t==="zoomX"||t==="zoomXY"||t==="selectX"||t==="selectXY")&&Math.abs(r.x-o.x)>n&&(a=!0),(t==="zoomY"||t==="zoomXY"||t==="selectY"||t==="selectXY")&&Math.abs(r.y-o.y)>n&&(a=!0),a){const l="selectended";this.events.isEnabled(l)&&this.events.dispatch(l,{type:l,target:this})}}}}this._downPoint=void 0}_handleMove(e){if(this.getPrivate("visible")){const t=this.chart;if(t&&Ht(t.plotContainer._downPoints).length>1){this.set("forceHidden",!0);return}else this.set("forceHidden",!1);const s=this._root.documentPointToRoot({x:e.clientX,y:e.clientY}),r=this._lastPoint;if(Math.round(r.x)===Math.round(s.x)&&Math.round(r.y)===Math.round(s.y))return;this._lastPoint=s,this.setPrivate("lastPoint",s),this.handleMove({x:s.x,y:s.y})}}_getPosition(e){return{x:e.x/this.width(),y:e.y/this.height()}}handleMove(e,t){e||(e=this._movePoint);const s=this.get("alwaysShow");if(!e){this.hide(0);return}this._movePoint=e;let r=this._display.toLocal(e),o=this.chart;if(o&&this._inPlot(r)){o._movePoint=e,this.isHidden()&&(this.show(),this.get("behavior","").charAt(0)=="z"&&this.selection.set("draw",()=>{}));let n=r.x,a=r.y,l=this._getPosition(r);this.setPrivate("point",r);let u=this.get("snapToSeries");this._downPoint&&(u=void 0);let h=this.get("positionX"),d=l.x;B(h)&&(d=h);let c=this.get("positionY"),p=l.y;B(c)&&(p=c),this.setPrivate("positionX",d),this.setPrivate("positionY",p);const y=this._getPoint(d,p);if(n=y.x,a=y.y,o.xAxes.each(f=>{f._handleCursorPosition(d,u),s&&f.handleCursorShow()}),o.yAxes.each(f=>{f._handleCursorPosition(p,u),s&&f.handleCursorShow()}),!t){o._handleCursorPosition();const f="cursormoved";this.events.isEnabled(f)&&this.events.dispatch(f,{type:f,target:this})}this._updateLines(n,a),o.arrangeTooltips()}else if(!this._downPoint&&!s){this.hide(0);const n="cursorhidden";this.events.isEnabled(n)&&this.events.dispatch(n,{type:n,target:this})}this._downPoint&&this.get("behavior")!="none"&&this._updateSelection(r)}_getPoint(e,t){return{x:this.width()*e,y:this.height()*t}}_updateLines(e,t){this._tooltipX||this.lineX.set("x",e),this._tooltipY||this.lineY.set("y",t),this._drawLines()}_updateSelection(e){const t=this.selection,s=this.get("behavior"),r=this.width(),o=this.height();e.x<0&&(e.x=0),e.x>r&&(e.x=r),e.y<0&&(e.y=0),e.y>o&&(e.y=o),t.set("draw",n=>{const a=this._downPoint;a&&(s==="zoomXY"||s==="selectXY"?(n.moveTo(a.x,a.y),n.lineTo(a.x,e.y),n.lineTo(e.x,e.y),n.lineTo(e.x,a.y),n.lineTo(a.x,a.y)):s==="zoomX"||s==="selectX"?(n.moveTo(a.x,0),n.lineTo(a.x,o),n.lineTo(e.x,o),n.lineTo(e.x,0),n.lineTo(a.x,0)):(s==="zoomY"||s==="selectY")&&(n.moveTo(0,a.y),n.lineTo(r,a.y),n.lineTo(r,e.y),n.lineTo(0,e.y),n.lineTo(0,a.y)))})}_onHide(){if(this.isHidden()){let e=this.chart;e&&(e.xAxes.each(t=>{t.handleCursorHide()}),e.yAxes.each(t=>{t.handleCursorHide()}),e.series.each(t=>{t.handleCursorHide()}))}super._onHide()}_onShow(){if(!this.isHidden()){let e=this.chart;e&&(e.xAxes.each(t=>{t.handleCursorShow()}),e.yAxes.each(t=>{t.handleCursorShow()}))}super._onShow()}_dispose(){super._dispose(),this.selection.dispose()}}Object.defineProperty(Rh,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYCursor"});Object.defineProperty(Rh,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Te.classNames.concat([Rh.className])});function _0(i,e){return i==null?e:e==null?i:e<i?e:i}function E0(i,e){return i==null?e:e==null?i:e>i?e:i}class _o extends fl{constructor(){super(...arguments),Object.defineProperty(this,"_xField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xOpenField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yOpenField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xLowField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xHighField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yLowField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yHighField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_axesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_stackDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataSets",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_mainContainerMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"mainContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(Te.new(this._root,{}))}),Object.defineProperty(this,"axisRanges",{enumerable:!0,configurable:!0,writable:!0,value:new Qn}),Object.defineProperty(this,"_skipped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_couldStackTo",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_reallyStackedTo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_stackedSeries",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_aLocationX0",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_aLocationX1",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_aLocationY0",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_aLocationY1",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_showBullets",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"valueXFields",{enumerable:!0,configurable:!0,writable:!0,value:["valueX","openValueX","lowValueX","highValueX"]}),Object.defineProperty(this,"valueYFields",{enumerable:!0,configurable:!0,writable:!0,value:["valueY","openValueY","lowValueY","highValueY"]}),Object.defineProperty(this,"_valueXFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueYFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueXShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueYShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"__valueXShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"__valueYShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_emptyDataItem",{enumerable:!0,configurable:!0,writable:!0,value:new Ks(this,void 0,{})}),Object.defineProperty(this,"_dataSetId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipFieldX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipFieldY",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){if(this.fields.push("categoryX","categoryY","openCategoryX","openCategoryY"),this.valueFields.push("valueX","valueY","openValueX","openValueY","lowValueX","lowValueY","highValueX","highValueY"),this._setRawDefault("vcx",1),this._setRawDefault("vcy",1),this._setRawDefault("valueXShow","valueXWorking"),this._setRawDefault("valueYShow","valueYWorking"),this._setRawDefault("openValueXShow","openValueXWorking"),this._setRawDefault("openValueYShow","openValueYWorking"),this._setRawDefault("lowValueXShow","lowValueXWorking"),this._setRawDefault("lowValueYShow","lowValueYWorking"),this._setRawDefault("highValueXShow","highValueXWorking"),this._setRawDefault("highValueYShow","highValueYWorking"),this._setRawDefault("lowValueXGrouped","low"),this._setRawDefault("lowValueYGrouped","low"),this._setRawDefault("highValueXGrouped","high"),this._setRawDefault("highValueYGrouped","high"),super._afterNew(),this._settings.xAxis.series.push(this),this._settings.yAxis.series.push(this),this.set("maskContent",!0),this._disposers.push(this.axisRanges.events.onAll(e=>{if(e.type==="clear")G(e.oldValues,t=>{this._removeAxisRange(t)});else if(e.type==="push")this._processAxisRange(e.newValue);else if(e.type==="setIndex")this._processAxisRange(e.newValue);else if(e.type==="insertIndex")this._processAxisRange(e.newValue);else if(e.type==="removeIndex")this._removeAxisRange(e.oldValue);else if(e.type==="moveIndex")this._processAxisRange(e.value);else throw new Error("Unknown IStreamEvent type")})),!this.get("baseAxis")){const e=this.get("xAxis"),t=this.get("yAxis");t.isType("CategoryAxis")||t.isType("DateAxis")?this.set("baseAxis",t):this.set("baseAxis",e)}this.states.create("hidden",{opacity:1,visible:!1}),this._makeFieldNames()}_processAxisRange(e){const t=Te.new(this._root,{});e.container=t,this.children.push(t),e.series=this;const s=e.axisDataItem;s.setRaw("isRange",!0);const r=s.component;if(r){r._processAxisRange(s,["range","series"]);const o=s.get("bullet");if(o){const a=o.get("sprite");a&&a.setPrivate("visible",!1)}const n=s.get("axisFill");n&&t.set("mask",n),r._seriesAxisRanges.push(s)}}_removeAxisRange(e){const t=e.axisDataItem,s=t.component;s.disposeDataItem(t),Yi(s._seriesAxisRanges,t);const r=e.container;r&&r.dispose()}_updateFields(){super._updateFields(),this._valueXFields=[],this._valueYFields=[],this._valueXShowFields=[],this._valueYShowFields=[],this.__valueXShowFields=[],this.__valueYShowFields=[],this.valueXFields&&G(this.valueXFields,e=>{if(this.get(e+"Field")){this._valueXFields.push(e);let s=this.get(e+"Show");this.__valueXShowFields.push(s),s.indexOf("Working")!=-1?this._valueXShowFields.push(s.split("Working")[0]):this._valueXShowFields.push(s)}}),this.valueYFields&&G(this.valueYFields,e=>{if(this.get(e+"Field")){this._valueYFields.push(e);let s=this.get(e+"Show");this.__valueYShowFields.push(s),s.indexOf("Working")!=-1?this._valueYShowFields.push(s.split("Working")[0]):this._valueYShowFields.push(s)}})}_dispose(){super._dispose();const e=this.chart;e&&e.series.removeValue(this),pi(this.get("xAxis").series,this),pi(this.get("yAxis").series,this)}_min(e,t){let s=_0(this.getPrivate(e),t);this.setPrivate(e,s)}_max(e,t){let s=E0(this.getPrivate(e),t);this.setPrivate(e,s)}_shouldMakeBullet(e){return!this.get("xAxis").inited||!this.get("yAxis").inited?!1:e.get(this._xField)!=null&&e.get(this._yField)!=null}_makeFieldNames(){const e=this.get("xAxis"),t=this.get("yAxis"),s=e.getPrivate("name"),r=bf(s),o=t.getPrivate("name"),n=bf(o),a=e.get("renderer").getPrivate("letter"),l=t.get("renderer").getPrivate("letter"),u="open",h="low",d="high",c="Show";e.className==="ValueAxis"?(this._xField=this.get(s+a+c),this._xOpenField=this.get(u+r+a+c),this._xLowField=this.get(h+r+a+c),this._xHighField=this.get(d+r+a+c)):(this._xField=s+a,this._xOpenField=u+r+a,this._xLowField=h+r+a,this._xHighField=d+r+a),t.className==="ValueAxis"?(this._yField=this.get(o+l+c),this._yOpenField=this.get(u+n+l+c),this._yLowField=this.get(h+n+l+c),this._yHighField=this.get(d+n+l+c)):(this._yField=o+l,this._yOpenField=u+n+l,this._yLowField=h+n+l,this._yHighField=d+n+l)}_fixVC(){const e=this.get("xAxis"),t=this.get("yAxis"),s=this.get("baseAxis"),r=this.states.lookup("hidden"),o=this.get("sequencedInterpolation");if(r){let n=0;o&&(n=.999999999999),e===s?r.set("vcy",n):(t===s||r.set("vcy",n),r.set("vcx",n))}}_handleMaskBullets(){this.isDirty("maskBullets")&&this.bulletsContainer.set("maskContent",this.get("maskBullets"))}_prepareChildren(){super._prepareChildren(),(this.isDirty("valueYShow")||this.isDirty("valueXShow"))&&(this._updateFields(),this._makeFieldNames(),this._valuesDirty=!0),this.set("width",this.get("xAxis").width()),this.set("height",this.get("yAxis").height()),this._handleMaskBullets();const e=this.get("xAxis"),t=this.get("yAxis"),s=this.get("baseAxis"),r=this.get("tooltipPositionX");let o;switch(r){case"open":o=this._xOpenField;break;case"low":o=this._xLowField;break;case"high":o=this._xHighField;break;default:o=this._xField}this._tooltipFieldX=o;const n=this.get("tooltipPositionY");let a;switch(n){case"open":a=this._yOpenField;break;case"low":a=this._yLowField;break;case"high":a=this._yHighField;break;default:a=this._yField}this._tooltipFieldY=a,this.isDirty("baseAxis")&&this._fixVC(),this.set("x",e.x()-ii(e.get("centerX",0),e.width())-e.parent.get("paddingLeft",0)),this.set("y",t.y()-ii(t.get("centerY",0),t.height())-t.parent.get("paddingTop",0)),this.bulletsContainer.set("y",this.y()),this.bulletsContainer.set("x",this.x());const l=this.get("stacked");if(this.isDirty("stacked")&&(l?this._valuesDirty&&!this._dataProcessed||this._stack():this._unstack()),this._valuesDirty&&!this._dataProcessed&&(this._dataProcessed=!0,l&&this._stack(),G(this.dataItems,u=>{G(this._valueXShowFields,h=>{let d=u.get(h);d!=null&&(l&&(d+=this.getStackedXValue(u,h)),this._min("minX",d),this._max("maxX",d))}),G(this._valueYShowFields,h=>{let d=u.get(h);d!=null&&(l&&(d+=this.getStackedYValue(u,h)),this._min("minY",d),this._max("maxY",d))}),e.processSeriesDataItem(u,this._valueXFields),t.processSeriesDataItem(u,this._valueYFields)}),e._seriesValuesDirty=!0,t._seriesValuesDirty=!0,this.get("ignoreMinMax")||((this.isPrivateDirty("minX")||this.isPrivateDirty("maxX"))&&e.markDirtyExtremes(),(this.isPrivateDirty("minY")||this.isPrivateDirty("maxY"))&&t.markDirtyExtremes()),this._markStakedDirtyStack(),this.get("tooltipDataItem")||this.updateLegendValue(void 0)),(this.isDirty("vcx")||this.isDirty("vcy"))&&this._markStakedDirtyStack(),this._dataGrouped||(e._groupSeriesData(this),t._groupSeriesData(this),this._dataGrouped=!0),this._valuesDirty||this.isPrivateDirty("startIndex")||this.isPrivateDirty("endIndex")||this.isDirty("vcx")||this.isDirty("vcy")||this._stackDirty){let u=this.startIndex(),h=this.endIndex(),d=this.get("minBulletDistance",0);if(d>0&&s&&(s.get("renderer").axisLength()/(h-u)>d?this._showBullets=!0:this._showBullets=!1),(this._psi!=u||this._pei!=h||this.isDirty("vcx")||this.isDirty("vcy")||this._stackDirty||this._valuesDirty)&&!this._selectionProcessed){this._selectionProcessed=!0;const c=this.get("vcx",1),p=this.get("vcy",1),y=this.get("stacked",!1),f=this.getPrivate("outOfSelection");if(s===e)if(t._calculateTotals(),this.setPrivateRaw("selectionMinY",void 0),this.setPrivateRaw("selectionMaxY",void 0),f)t.markDirtySelectionExtremes();else for(let w=u;w<h;w++)this.processYSelectionDataItem(this.dataItems[w],p,y);else if(s===t)if(e._calculateTotals(),this.setPrivateRaw("selectionMinX",void 0),this.setPrivateRaw("selectionMaxX",void 0),f)t.markDirtySelectionExtremes();else for(let w=u;w<h;w++)this.processXSelectionDataItem(this.dataItems[w],c,y);if(s===e){if(this.get("valueYShow")!=="valueYWorking"){const w=this.getPrivate("selectionMinY");w!=null&&(this.setPrivateRaw("minY",w),t.markDirtyExtremes());const _=this.getPrivate("selectionMaxY");_!=null&&(this.setPrivateRaw("maxY",_),t.markDirtyExtremes())}}else if(s===t&&this.get("valueXShow")!=="valueXWorking"){const w=this.getPrivate("selectionMinX");w!=null&&(this.setPrivateRaw("minX",w),t.markDirtyExtremes());const _=this.getPrivate("selectionMaxX");_!=null&&(this.setPrivateRaw("maxX",_),e.markDirtyExtremes())}(this.isPrivateDirty("selectionMinX")||this.isPrivateDirty("selectionMaxX"))&&e.markDirtySelectionExtremes(),(this.isPrivateDirty("selectionMinY")||this.isPrivateDirty("selectionMaxY"))&&t.markDirtySelectionExtremes()}}}_makeRangeMask(){if(this.axisRanges.length>0){let e=this._mainContainerMask;e==null&&(e=this.children.push(it.new(this._root,{})),this._mainContainerMask=e,e.set("draw",(t,s)=>{const r=this.parent;if(r){const o=this._root.container.width(),n=this._root.container.height();t.moveTo(-o,-n),t.lineTo(-o,n*2),t.lineTo(o*2,n*2),t.lineTo(o*2,-n),t.lineTo(-o,-n),this.axisRanges.each(a=>{const l=a.axisDataItem.get("axisFill");if(r&&l){let u=l.get("draw");u&&u(t,s)}})}this.mainContainer._display.mask=e._display})),e.markDirty(),e._markDirtyKey("fill")}else this.mainContainer._display.mask=null}_updateChildren(){super._updateChildren(),this._x=this.x(),this._y=this.y(),this._makeRangeMask()}_stack(){const e=this.chart;if(e){const t=e.series.indexOf(this);if(this._couldStackTo=[],t>0){let s;for(let r=t-1;r>=0&&(s=e.series.getIndex(r),!(s.get("xAxis")===this.get("xAxis")&&s.get("yAxis")===this.get("yAxis")&&s.className===this.className&&(this._couldStackTo.push(s),!s.get("stacked"))));r--);}this._stackDataItems()}}_unstack(){$e(this._reallyStackedTo,(e,t)=>{delete t._stackedSeries[this.uid]}),this._reallyStackedTo={},G(this.dataItems,e=>{e.setRaw("stackToItemY",void 0),e.setRaw("stackToItemX",void 0)})}_stackDataItems(){const e=this.get("baseAxis"),t=this.get("xAxis"),s=this.get("yAxis");let r,o;e===t?(r="valueY",o="stackToItemY"):e===s&&(r="valueX",o="stackToItemX");let n=this._couldStackTo.length,a=0;const l=this.get("stackToNegative");this._reallyStackedTo={},G(this.dataItems,u=>{for(let h=0;h<n;h++){let d=this._couldStackTo[h],c=d.dataItems[a],p=u.get(r);if(c){let y=c.get(r);if(l)if(B(p)){if(B(y)){if(p>=0&&y>=0){u.setRaw(o,c),this._reallyStackedTo[d.uid]=d,d._stackedSeries[this.uid]=this;break}if(p<0&&y<0){u.setRaw(o,c),this._reallyStackedTo[d.uid]=d,d._stackedSeries[this.uid]=this;break}}}else break;else if(B(p)&&B(y)){u.setRaw(o,c),this._reallyStackedTo[d.uid]=d,d._stackedSeries[this.uid]=this;break}}}a++})}processXSelectionDataItem(e,t,s){G(this.__valueXShowFields,r=>{let o=e.get(r);o!=null&&(s&&(o+=this.getStackedXValueWorking(e,r)),this._min("selectionMinX",o),this._max("selectionMaxX",o*t))})}processYSelectionDataItem(e,t,s){G(this.__valueYShowFields,r=>{let o=e.get(r);o!=null&&(s&&(o+=this.getStackedYValueWorking(e,r)),this._min("selectionMinY",o),this._max("selectionMaxY",o*t))})}getStackedYValueWorking(e,t){const s=e.get("stackToItemY");if(s){const r=s.component;return s.get(t,0)*r.get("vcy",1)+this.getStackedYValueWorking(s,t)}return 0}getStackedXValueWorking(e,t){const s=e.get("stackToItemX");if(s){const r=s.component;return s.get(t,0)*r.get("vcx",1)+this.getStackedXValueWorking(s,t)}return 0}getStackedYValue(e,t){const s=e.get("stackToItemY");return s?s.get(t,0)+this.getStackedYValue(s,t):0}getStackedXValue(e,t){const s=e.get("stackToItemX");return s?s.get(t,0)+this.getStackedXValue(s,t):0}createLegendMarker(e){this.updateLegendMarker()}_markDirtyAxes(){this._axesDirty=!0,this.markDirty()}_markDataSetDirty(){this._afterDataChange(),this._valuesDirty=!0,this._dataProcessed=!1,this._aggregatesCalculated=!1,this.markDirty()}_clearDirty(){super._clearDirty(),this._axesDirty=!1,this._selectionProcessed=!1,this._stackDirty=!1,this._dataProcessed=!1}_positionBullet(e){let t=e.get("sprite");if(t){let s=t.dataItem,r=e.get("locationX",s.get("locationX",.5)),o=e.get("locationY",s.get("locationY",.5)),n=this.get("xAxis"),a=this.get("yAxis");const l=n.getDataItemPositionX(s,this._xField,r,this.get("vcx",1)),u=a.getDataItemPositionY(s,this._yField,o,this.get("vcy",1));let h=this.getPoint(l,u),d=s.get("left",h.x),c=s.get("right",h.x),p=s.get("top",h.y),y=s.get("bottom",h.y);if(this._shouldShowBullet(l,u)){e.getPrivate("hidden")?t.setPrivate("visible",!1):t.setPrivate("visible",!0);let f=c-d,w=y-p;t.isType("Label")&&(t.setPrivate("maxWidth",Math.abs(f)),t.setPrivate("maxHeight",Math.abs(w)));let _=d+f*r,P=y-w*o;t.set("x",_),t.set("y",P)}else t.setPrivate("visible",!1)}}_shouldShowBullet(e,t){return this._showBullets}setDataSet(e){if(this._dataSets[e]){this._handleDataSetChange(),this._dataItems=this._dataSets[e],this._markDataSetDirty(),this._dataSetId=e;const t="datasetchanged";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,id:e})}}_handleDataSetChange(){this.bullets.length>0&&G(this._dataItems,e=>{let t=e.bullets;t&&G(t,s=>{if(s){let r=s.get("sprite");r&&r.setPrivate("visible",!1)}})}),this._selectionProcessed=!1}show(e){const t=Object.create(null,{show:{get:()=>super.show}});return Be(this,void 0,void 0,function*(){this._fixVC();let s=[];s.push(t.show.call(this,e).then(()=>{this._isShowing=!1;let r=this.get("xAxis"),o=this.get("yAxis"),n=this.get("baseAxis");o!==n&&o.markDirtySelectionExtremes(),r!==n&&r.markDirtySelectionExtremes()})),s.push(this.bulletsContainer.show(e)),s.push(this._sequencedShowHide(!0,e)),yield Promise.all(s)})}hide(e){const t=Object.create(null,{hide:{get:()=>super.hide}});return Be(this,void 0,void 0,function*(){this._fixVC();let s=[];s.push(t.hide.call(this,e).then(()=>{this._isHiding=!1})),s.push(this.bulletsContainer.hide(e)),s.push(this._sequencedShowHide(!1,e)),yield Promise.all(s)})}showDataItem(e,t){const s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return Be(this,void 0,void 0,function*(){const r=[s.showDataItem.call(this,e,t)];B(t)||(t=this.get("stateAnimationDuration",0));const o=this.get("stateAnimationEasing");G(this._valueFields,n=>{r.push(e.animate({key:n+"Working",to:e.get(n),duration:t,easing:o}).waitForStop())}),yield Promise.all(r)})}hideDataItem(e,t){const s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return Be(this,void 0,void 0,function*(){const r=[s.hideDataItem.call(this,e,t)],o=this.states.create("hidden",{});B(t)||(t=o.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const n=o.get("stateAnimationEasing",this.get("stateAnimationEasing")),a=this.get("xAxis"),l=this.get("yAxis"),u=this.get("baseAxis"),h=this.get("stacked");if((u===a||!u)&&G(this._valueYFields,d=>{let c=l.getPrivate("min"),p=l.baseValue();B(c)&&c>p&&(p=c),h&&(p=0),e.get(d)!=null&&r.push(e.animate({key:d+"Working",to:p,duration:t,easing:n}).waitForStop())}),u===l||!u){let d=a.getPrivate("min"),c=a.baseValue();B(d)&&d>c&&(c=d),h&&(c=0),G(this._valueXFields,p=>{e.get(p)!=null&&r.push(e.animate({key:p+"Working",to:c,duration:t,easing:n}).waitForStop())})}yield Promise.all(r)})}_markDirtyStack(){this._stackDirty=!0,this.markDirty(),this._markStakedDirtyStack()}_markStakedDirtyStack(){const e=this._stackedSeries;e&&$e(e,(t,s)=>{s._stackDirty||s._markDirtyStack()})}_afterChanged(){super._afterChanged(),this._skipped&&(this._markDirtyAxes(),this._skipped=!1)}showDataItemTooltip(e){this.updateLegendMarker(e),this.updateLegendValue(e);const t=this.get("tooltip");if(t){if(this.isHidden())this.hideTooltip();else if(t._setDataItem(e),e){let s=this.get("locationX",0),r=this.get("locationY",1),o=e.get("locationX",s),n=e.get("locationY",r);const a=this.get("xAxis"),l=this.get("yAxis"),u=this.get("vcx",1),h=this.get("vcy",1),d=a.getDataItemPositionX(e,this._tooltipFieldX,this._aLocationX0+(this._aLocationX1-this._aLocationX0)*o,u),c=l.getDataItemPositionY(e,this._tooltipFieldY,this._aLocationY0+(this._aLocationY1-this._aLocationY0)*n,h),p=this.getPoint(d,c);let y=!0;if(G(this._valueFields,f=>{e.get(f)==null&&(y=!1)}),y){const f=this.chart;f&&f.inPlot(p)?(t.label.text.markDirtyText(),t.set("tooltipTarget",this._getTooltipTarget(e)),t.set("pointTo",this._display.toGlobal({x:p.x,y:p.y}))):t._setDataItem(void 0)}else t._setDataItem(void 0)}}}hideTooltip(){const e=this.get("tooltip");return e&&e.set("tooltipTarget",this),super.hideTooltip()}_getTooltipTarget(e){if(this.get("seriesTooltipTarget")=="bullet"){const t=e.bullets;if(t&&t.length>0){const r=t[0].get("sprite");if(r)return r}}return this}updateLegendValue(e){const t=this.get("legendDataItem");if(t){const s=t.get("label");if(s){let o="";e?(s._setDataItem(e),o=this.get("legendLabelText",s.get("text",this.get("name","")))):(s._setDataItem(this._emptyDataItem),o=this.get("legendRangeLabelText",this.get("legendLabelText",s.get("text",this.get("name",""))))),s.set("text",o)}const r=t.get("valueLabel");if(r){let o="";e?(r._setDataItem(e),o=this.get("legendValueText",r.get("text",""))):(r._setDataItem(this._emptyDataItem),o=this.get("legendRangeValueText",r.get("text",""))),r.set("text",o)}}}_getItemReaderLabel(){let e="X: {"+this._xField;return this.get("xAxis").isType("DateAxis")&&(e+=".formatDate()"),e+="}; Y: {"+this._yField,this.get("yAxis").isType("DateAxis")&&(e+=".formatDate()"),e+="}",e}getPoint(e,t){let s=this.get("xAxis").get("renderer").positionToCoordinate(e),r=this.get("yAxis").get("renderer").positionToCoordinate(t),o=999999999;return r<-o&&(r=-o),r>o&&(r=o),s<-o&&(s=-o),s>o&&(s=o),{x:s,y:r}}_shouldInclude(e){return!0}handleCursorHide(){this.hideTooltip(),this.updateLegendValue(void 0),this.updateLegendMarker(void 0)}_afterDataChange(){super._afterDataChange(),this.get("xAxis")._markDirtyKey("start"),this.get("yAxis")._markDirtyKey("start"),this.resetExtremes()}resetExtremes(){this.setPrivate("selectionMinX",void 0),this.setPrivate("selectionMaxX",void 0),this.setPrivate("selectionMinY",void 0),this.setPrivate("selectionMaxY",void 0),this.setPrivate("minX",void 0),this.setPrivate("minY",void 0),this.setPrivate("maxX",void 0),this.setPrivate("maxY",void 0)}createAxisRange(e){return this.axisRanges.push({axisDataItem:e})}get mainDataItems(){return this._mainDataItems}}Object.defineProperty(_o,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYSeries"});Object.defineProperty(_o,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:fl.classNames.concat([_o.className])});class Eo extends _o{constructor(){super(...arguments),Object.defineProperty(this,"_ph",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_pw",{enumerable:!0,configurable:!0,writable:!0,value:0})}_makeGraphics(e,t){return this.makeColumn(t,e)}_makeFieldNames(){super._makeFieldNames();const e=this.get("xAxis"),t=this.get("yAxis"),s="CategoryAxis",r="ValueAxis";e.isType(s)&&(this.get("openCategoryXField")||(this._xOpenField=this._xField)),e.isType(r)&&(this.get("openValueXField")||(this._xOpenField=this._xField)),t.isType(s)&&(this.get("openCategoryYField")||(this._yOpenField=this._yField)),t.isType(r)&&(this.get("openValueYField")||(this._yOpenField=this._yField))}_prepareChildren(){super._prepareChildren();const e=this.get("xAxis"),t=this.get("yAxis"),s=this.dataItems.length,r=Math.max(0,this.startIndex()-2),o=Math.min(this.endIndex()+2,s-1);if(e.inited&&t.inited)for(let n=r;n<=o;n++){let a=this.dataItems[n];this._createGraphics(a)}}_updateChildren(){const e=this.chart;e&&(this._ph=e.plotContainer.height(),this._pw=e.plotContainer.width());const t=this.get("xAxis"),s=this.get("yAxis"),r=this.get("baseAxis"),o=this.columns.template;this.isDirty("fill")&&o.get("fill")==null&&o.set("fill",this.get("fill")),this.isDirty("stroke")&&o.get("stroke")==null&&o.set("stroke",this.get("stroke"));let n=0,a=0,l=0;G(r.series,_=>{if(_ instanceof Eo){const P=_.get("stacked");P&&l==0&&a++,!P&&_.get("clustered")&&a++}_===this&&(n=a-1),l++}),this.get("clustered")||(n=0,a=1),a===0&&(a=1,n=0);const u=t.get("renderer"),h=s.get("renderer"),d="cellStartLocation",c="cellEndLocation",p=u.get(d,0),y=u.get(c,1),f=h.get(d,0),w=h.get(c,1);if(this._aLocationX0=p+n/a*(y-p),this._aLocationX1=p+(n+1)/a*(y-p),this._aLocationY0=f+n/a*(w-f),this._aLocationY1=f+(n+1)/a*(w-f),t.inited&&s.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty("vcx")||this.isDirty("vcy")||this._sizeDirty){const _=this.dataItems.length;let P=Math.max(0,this.startIndex()-2),T=Math.min(this.endIndex()+2,_-1);for(let M=0;M<P;M++)this._toggleColumn(this.dataItems[M],!1);let D=this.dataItems[P];for(let M=P;M<=T;M++){let O=this.dataItems[M];if(O.get("valueX")!=null&&O.get("valueY")!=null){if(D=O,M>0&&P>0)for(let N=M-1;N>=0;N--){let z=this.dataItems[N];if(z.get("valueX")!=null&&z.get("valueY")!=null){D=z;break}}break}else this._toggleColumn(O,!1)}for(let M=P;M<=T;M++){let O=this.dataItems[M];this._updateGraphics(O,D),O.get("valueX")!=null&&O.get("valueY")!=null&&(D=O)}for(let M=T+1;M<_;M++)this._toggleColumn(this.dataItems[M],!1)}}else this._skipped=!0;this.updateLegendMarker(this.get("tooltipDataItem")),super._updateChildren()}_createGraphics(e){let t=e.get("graphics");if(!t){t=this._makeGraphics(this.columns,e),e.set("graphics",t),t._setDataItem(e);const s=e.get("legendDataItem");if(s){const r=s.get("markerRectangle");r&&r.setAll({fill:t.get("fill"),stroke:t.get("stroke")})}this.axisRanges.each(r=>{const o=r.container,n=e.get("rangeGraphics",[]);e.set("rangeGraphics",n);const a=this._makeGraphics(r.columns,e);n.push(a),a.setPrivate("list",r.columns),o.children.push(a)})}}_updateGraphics(e,t){let s=e.get("graphics");const r=this._xField,o=this._yField,n=e.get(r),a=e.get(o);if(n!=null&&a!=null){const l=this._xOpenField,u=this._yOpenField,h=this.get("locationX",e.get("locationX",.5)),d=this.get("locationY",e.get("locationY",.5)),c=this.get("openLocationX",e.get("openLocationX",h)),p=this.get("openLocationY",e.get("openLocationY",d)),y=s.get("width"),f=s.get("height"),w=this.get("stacked"),_=this.get("xAxis"),P=this.get("yAxis"),T=this.get("baseAxis"),D=_.get("start"),M=_.get("end"),O=P.get("start"),N=P.get("end");let z,Y,W,$,ee=this.get("vcy",1),re=this.get("vcx",1),me=!1,he=!1;if(P.isType("CategoryAxis")&&_.isType("CategoryAxis")){let ne=this._aLocationX0+c-.5,oe=this._aLocationX1+h-.5;if(y instanceof He){let Q=(oe-ne)*(1-y.value)/2;ne+=Q,oe-=Q}if(z=_.getDataItemPositionX(e,l,ne,re),Y=_.getDataItemPositionX(e,r,oe,re),ne=this._aLocationY0+p-.5,oe=this._aLocationY1+d-.5,f instanceof He){let Q=(oe-ne)*(1-f.value)/2;ne+=Q,oe-=Q}W=P.getDataItemPositionY(e,u,ne,ee),$=P.getDataItemPositionY(e,o,oe,ee),e.setRaw("point",{x:z+(Y-z)/2,y:W+($-W)/2})}else if(_===T){let ne=this._aLocationX0+c-.5,oe=this._aLocationX1+h-.5;if(y instanceof He){let Q=(oe-ne)*(1-y.value)/2;ne+=Q,oe-=Q}if(z=_.getDataItemPositionX(e,l,ne,re),Y=_.getDataItemPositionX(e,r,oe,re),W=P.getDataItemPositionY(e,o,d,ee),this._yOpenField!==this._yField)$=P.getDataItemPositionY(e,u,p,ee);else if(w){let Q=e.get("stackToItemY");Q?$=P.getDataItemPositionY(Q,o,p,Q.component.get("vcy")):$=P.basePosition()}else $=P.basePosition();e.setRaw("point",{x:z+(Y-z)/2,y:W}),he=!0}else if(P===T){let ne=this._aLocationY0+p-.5,oe=this._aLocationY1+d-.5;if(f instanceof He){let Q=(oe-ne)*(1-f.value)/2;ne+=Q,oe-=Q}if(W=P.getDataItemPositionY(e,u,ne,ee),$=P.getDataItemPositionY(e,o,oe,ee),Y=_.getDataItemPositionX(e,r,h,re),this._xOpenField!==this._xField)z=_.getDataItemPositionX(e,l,c,re);else if(w){let Q=e.get("stackToItemX");Q?z=_.getDataItemPositionX(Q,r,c,Q.component.get("vcx")):z=_.basePosition()}else z=_.basePosition();me=!0,e.setRaw("point",{x:Y,y:W+($-W)/2})}this._updateSeriesGraphics(e,s,z,Y,W,$,me,he),z<D&&Y<D||z>M&&Y>M||W<O&&$<O||W>N&&$>N||bs(z)||bs(W)?this._toggleColumn(e,!1):this._toggleColumn(e,!0);let ce=e.get("rangeGraphics");ce&&G(ce,ne=>{this._updateSeriesGraphics(e,ne,z,Y,W,$,me,he)}),this._applyGraphicsStates(e,t)}}_updateSeriesGraphics(e,t,s,r,o,n,a,l){const u=t.get("width"),h=t.get("height"),d=t.get("maxWidth"),c=t.get("maxHeight"),p=this.getPoint(s,o),y=this.getPoint(r,n),f=e.get("point");if(f){const w=this.getPoint(f.x,f.y);f.x=w.x+this._x,f.y=w.y+this._y}if(s=p.x,r=y.x,o=p.y,n=y.y,B(u)){const w=(r-s-u)/2;s+=w,r-=w}if(B(d)&&d<Math.abs(r-s)){const w=(r-s-d)/2;s+=w,r-=w}if(B(h)){const w=(n-o-h)/2;o+=w,n-=w}if(B(c)&&c<Math.abs(n-o)){const w=(n-o-c)/2;o+=w,n-=w}this.get("adjustBulletPosition")&&(a&&(r=Math.min(Math.max(0,r),this._pw),s=Math.min(Math.max(0,s),this._pw)),l&&(o=Math.min(Math.max(0,o),this._ph),n=Math.min(Math.max(0,n),this._ph))),e.setRaw("left",s),e.setRaw("right",r),e.setRaw("top",o),e.setRaw("bottom",n),t.setPrivate("width",r-s),t.setPrivate("height",n-o),t.set("x",s),t.set("y",n-(n-o))}_handleDataSetChange(){super._handleDataSetChange(),G(this._dataItems,e=>{this._toggleColumn(e,!1)})}_applyGraphicsStates(e,t){const s=e.get("graphics"),r=s.states.lookup("dropFromOpen"),o=s.states.lookup("riseFromOpen"),n=s.states.lookup("dropFromPrevious"),a=s.states.lookup("riseFromPrevious");if(r||n||o||a){const l=this.get("xAxis"),u=this.get("yAxis"),h=this.get("baseAxis");let d,c,p;h===l&&u.isType("ValueAxis")?(d=e.get(this._yOpenField),c=e.get(this._yField),p=t.get(this._yField)):h===u&&l.isType("ValueAxis")&&(d=e.get(this._xOpenField),c=e.get(this._xField),p=t.get(this._xField)),B(d)&&B(c)&&(c<d?r&&r.apply():o&&o.apply(),B(p)&&(c<p?n&&n.apply():a&&a.apply()))}}disposeDataItem(e){super.disposeDataItem(e);const t=e.get("graphics");t&&(this.columns.removeValue(t),t.dispose());const s=e.get("rangeGraphics");s&&G(s,r=>{const o=r.getPrivate("list");o&&o.removeValue(r),r.dispose()})}hideDataItem(e,t){const s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return Be(this,void 0,void 0,function*(){const r=[s.hideDataItem.call(this,e,t)],o=e.get("graphics");o&&r.push(o.hide(t));const n=e.get("rangeGraphics");n&&G(n,a=>{r.push(a.hide(t))}),yield Promise.all(r)})}_toggleColumn(e,t){const s=e.get("graphics");s&&s.setPrivate("visible",t);const r=e.get("rangeGraphics");r&&G(r,n=>{n.setPrivate("visible",t)});const o=e.bullets;o&&G(o,n=>{n.setPrivate("hidden",!t)})}showDataItem(e,t){const s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return Be(this,void 0,void 0,function*(){const r=[s.showDataItem.call(this,e,t)],o=e.get("graphics");o&&r.push(o.show(t));const n=e.get("rangeGraphics");n&&G(n,a=>{r.push(a.show(t))}),yield Promise.all(r)})}updateLegendMarker(e){let t=this.get("legendDataItem");if(this.get("useLastColorForLegendMarker")&&!e){const s=this.dataItems[this.endIndex()-1];s&&(e=s)}if(t){let s=this.columns.template;if(e){let o=e.get("graphics");o&&(s=o)}const r=t.get("markerRectangle");r&&(t.get("itemContainer").get("disabled")||G(SR,o=>{r.set(o,s.get(o,this.get(o)))}))}}_getTooltipTarget(e){if(this.get("seriesTooltipTarget")=="bullet")return super._getTooltipTarget(e);let t=e.get("graphics");return t||this}}Object.defineProperty(Eo,"className",{enumerable:!0,configurable:!0,writable:!0,value:"BaseColumnSeries"});Object.defineProperty(Eo,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:_o.classNames.concat([Eo.className])});class xo extends So{constructor(){super(...arguments),Object.defineProperty(this,"_series",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isPanning",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"labelsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(Te.new(this._root,{}))}),Object.defineProperty(this,"gridContainer",{enumerable:!0,configurable:!0,writable:!0,value:Te.new(this._root,{width:ue,height:ue})}),Object.defineProperty(this,"topGridContainer",{enumerable:!0,configurable:!0,writable:!0,value:Te.new(this._root,{width:ue,height:ue})}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(Te.new(this._root,{isMeasured:!1,width:ue,height:ue,position:"absolute"}))}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rangesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_panStart",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_panEnd",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_sAnimation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_eAnimation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_skipSync",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"axisRanges",{enumerable:!0,configurable:!0,writable:!0,value:new Qn}),Object.defineProperty(this,"_seriesAxisRanges",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"ghostLabel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cursorPosition",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"_snapToSeries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_seriesValuesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"axisHeader",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(Te.new(this._root,{themeTags:["axis","header"],position:"absolute",background:Hi.new(this._root,{themeTags:["header","background"],fill:this._root.interfaceColors.get("background")})}))}),Object.defineProperty(this,"_bullets",{enumerable:!0,configurable:!0,writable:!0,value:{}})}_dispose(){this.gridContainer.dispose(),this.topGridContainer.dispose(),this.bulletsContainer.dispose(),this.labelsContainer.dispose(),this.axisHeader.dispose(),super._dispose()}_afterNew(){super._afterNew(),this.setPrivate("updateScrollbar",!0),this._disposers.push(this.axisRanges.events.onAll(t=>{if(t.type==="clear")G(t.oldValues,s=>{this.disposeDataItem(s)});else if(t.type==="push")this._processAxisRange(t.newValue,["range"]);else if(t.type==="setIndex")this._processAxisRange(t.newValue,["range"]);else if(t.type==="insertIndex")this._processAxisRange(t.newValue,["range"]);else if(t.type==="removeIndex")this.disposeDataItem(t.oldValue);else if(t.type==="moveIndex")this._processAxisRange(t.value,["range"]);else throw new Error("Unknown IStreamEvent type")}));const e=this.get("renderer");e&&(e.axis=this,e.processAxis()),this.children.push(e),this.ghostLabel=e.makeLabel(new Ks(this,void 0,{}),[]),this.ghostLabel.adapters.disable("text"),this.ghostLabel.set("opacity",0)}_updateFinals(e,t){}zoom(e,t,s,r){if(this._updateFinals(e,t),this.get("start")!==e||this.get("end")!=t){let o=this._sAnimation,n=this._eAnimation,a=this.get("maxDeviation",.5)*Math.min(1,t-e);e<-a&&(e=-a),t>1+a&&(t=1+a),e>t&&([e,t]=[t,e]),B(s)||(s=this.get("interpolationDuration",0)),r||(r="end");let l=this.getPrivate("maxZoomFactor",this.get("maxZoomFactor",100)),u=l;t===1&&e!==0&&(e<this.get("start")?r="start":r="end"),e===0&&t!==1&&(t>this.get("end")?r="end":r="start");let h=this.get("minZoomCount"),d=this.get("maxZoomCount");B(h)&&(l=u/h);let c=1;if(B(d)&&(c=u/d),r==="start"?(d>0&&1/(t-e)<c&&(t=e+1/c),1/(t-e)>l&&(t=e+1/l),t>1&&t-e<1/l&&(e=t-1/l)):(d>0&&1/(t-e)<c&&(e=t-1/c),1/(t-e)>l&&(e=t-1/l),e<0&&t-e<1/l&&(t=e+1/l)),1/(t-e)>l&&(t=e+1/l),1/(t-e)>l&&(e=t-1/l),d!=null&&h!=null&&e==this.get("start")&&t==this.get("end")){const p=this.chart;p&&p._handleAxisSelection(this,!0)}if((o&&o.playing&&o.to==e||this.get("start")==e)&&(n&&n.playing&&n.to==t||this.get("end")==t))return;if(s>0){let p=this.get("interpolationEasing"),y,f;if(this.get("start")!=e&&(y=this.animate({key:"start",to:e,duration:s,easing:p})),this.get("end")!=t&&(f=this.animate({key:"end",to:t,duration:s,easing:p})),this._sAnimation=y,this._eAnimation=f,y)return y;if(f)return f}else this.set("start",e),this.set("end",t),this._root.events.once("frameended",()=>{this._markDirtyKey("start"),this._root._markDirty()})}else this._sAnimation&&this._sAnimation.stop(),this._eAnimation&&this._eAnimation.stop()}get series(){return this._series}_processAxisRange(e,t){e.setRaw("isRange",!0),this._createAssets(e,t),this._rangesDirty=!0,this._prepareDataItem(e);const s=e.get("above"),r=this.topGridContainer,o=e.get("grid");s&&o&&r.children.moveValue(o);const n=e.get("axisFill");s&&n&&r.children.moveValue(n)}_prepareDataItem(e,t){}markDirtyExtremes(){}markDirtySelectionExtremes(){}_calculateTotals(){}_updateAxisRanges(){this._bullets={},this.axisRanges.each(e=>{this._prepareDataItem(e)}),G(this._seriesAxisRanges,e=>{this._prepareDataItem(e)})}_prepareChildren(){if(super._prepareChildren(),this.get("fixAxisSize")?this.ghostLabel.set("visible",!0):this.ghostLabel.set("visible",!1),this.isDirty("start")||this.isDirty("end")){this.chart._updateCursor();let t=this.get("start",0),s=this.get("end",1),r=this.get("maxDeviation",.5)*Math.min(1,s-t);if(t<-r){let o=t+r;t=-r,this.setRaw("start",t),this.isDirty("end")&&this.setRaw("end",s-o)}if(s>1+r){let o=s-1-r;s=1+r,this.setRaw("end",s),this.isDirty("start")&&this.setRaw("start",t-o)}}const e=this.get("renderer");if(e._start=this.get("start"),e._end=this.get("end"),e._inversed=e.get("inversed",!1),e._axisLength=e.axisLength()/(e._end-e._start),e._updateLC(),this.isDirty("tooltip")){const t=this.get("tooltip");if(t){const s=e.get("themeTags");t.addTag("axis"),t.addTag(this.className.toLowerCase()),t._applyThemes(),s&&(t.set("themeTags",Ct(t.get("themeTags"),s)),t.label._applyThemes())}}}_updateTooltipBounds(){const e=this.get("tooltip");e&&this.get("renderer").updateTooltipBounds(e)}_updateBounds(){super._updateBounds(),this._updateTooltipBounds()}processChart(e){this.chart=e;const t=this.get("renderer");t.chart=e,e.gridContainer.children.push(this.gridContainer),e.topGridContainer.children.push(this.topGridContainer),e.axisHeadersContainer.children.push(this.axisHeader),this.on("start",()=>{e._handleAxisSelection(this)}),this.on("end",()=>{e._handleAxisSelection(this)}),e.plotContainer.onPrivate("width",()=>{this.markDirtySize()}),e.plotContainer.onPrivate("height",()=>{this.markDirtySize()}),e.processAxis(this)}hideDataItem(e){return this._toggleDataItem(e,!1),super.hideDataItem(e)}showDataItem(e){return this._toggleDataItem(e,!0),super.showDataItem(e)}_toggleDataItem(e,t){const s=e.get("label");s&&s.setPrivate("visible",t);const r=e.get("grid");r&&r.setPrivate("visible",t);const o=e.get("tick");o&&o.setPrivate("visible",t);const n=e.get("axisFill");n&&n.setPrivate("visible",t);const a=e.get("bullet");if(a){const l=a.get("sprite");l&&l.setPrivate("visible",t)}}_createAssets(e,t){const s=this.get("renderer");e.get("label")||s.makeLabel(e,t),e.get("grid")||s.makeGrid(e,t),e.get("tick")||s.makeTick(e,t),e.get("axisFill")||s.makeAxisFill(e,t),this._processBullet(e)}_processBullet(e){let t=e.get("bullet"),s=this.get("bullet");if(!t&&s&&!e.get("isRange")&&(t=s(this._root,this,e)),t){t.axis=this;const r=t.get("sprite");r&&(r._setDataItem(e),e.setRaw("bullet",t),r.parent||this.bulletsContainer.children.push(r))}}_afterChanged(){super._afterChanged();const e=this.chart;e&&(e._updateChartLayout(),e.axisHeadersContainer.markDirtySize()),this.get("renderer")._updatePositions()}disposeDataItem(e){super.disposeDataItem(e);const t=this.get("renderer"),s=e.get("label");s&&(t.labels.removeValue(s),s.dispose());const r=e.get("tick");r&&(t.ticks.removeValue(r),r.dispose());const o=e.get("grid");o&&(t.grid.removeValue(o),o.dispose());const n=e.get("axisFill");n&&(t.axisFills.removeValue(n),n.dispose());const a=e.get("bullet");a&&a.dispose()}_updateGhost(){const e=this.ghostLabel;if(!e.isHidden()){const r=e.localBounds(),o=r.right-r.left;let n=e.get("text");G(this.dataItems,a=>{const l=a.get("label");if(l&&!l.isHidden()){const u=l.localBounds();u.right-u.left>o&&(n=l.text._getText())}}),e.set("text",n)}let t=this.get("start",0),s=this.get("end",1);this.get("renderer").updateLabel(e,t+(s-t)*.5)}_handleCursorPosition(e,t){e=this.get("renderer").toAxisPosition(e),this._cursorPosition=e,this._snapToSeries=t,this.updateTooltip()}updateTooltip(){const e=this._snapToSeries;let t=this._cursorPosition;const s=this.get("tooltip"),r=this.get("renderer");B(t)&&(G(this.series,o=>{if(o.get("baseAxis")===this){const n=this.getSeriesItem(o,t,this.get("tooltipLocation"));o.setRaw("tooltipDataItem",n),e&&e.indexOf(o)!=-1?(o.updateLegendMarker(n),o.updateLegendValue(n)):o.showDataItemTooltip(n)}}),s&&(r.updateTooltipBounds(s),this.get("snapTooltip")&&(t=this.roundAxisPosition(t,this.get("tooltipLocation",.5))),bs(t)?s.hide(0):(this.setPrivateRaw("tooltipPosition",t),this._updateTooltipText(s,t),r.positionTooltip(s,t),t<this.get("start")||t>this.get("end")?s.hide(0):s.show(0))))}_updateTooltipText(e,t){e.label.set("text",this.getTooltipText(t))}roundAxisPosition(e,t){return e}handleCursorShow(){let e=this.get("tooltip");e&&e.show()}handleCursorHide(){let e=this.get("tooltip");e&&e.hide()}processSeriesDataItem(e,t){}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._rangesDirty=!1}coordinateToPosition(e){const t=this.get("renderer");return t.toAxisPosition(e/t.axisLength())}toAxisPosition(e){return this.get("renderer").toAxisPosition(e)}fixPosition(e){return this.get("renderer").fixPosition(e)}shouldGap(e,t,s,r){return!1}createAxisRange(e){return this.axisRanges.push(e)}_groupSeriesData(e){}getCellWidthPosition(){return .05}}Object.defineProperty(xo,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Axis"});Object.defineProperty(xo,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:So.classNames.concat([xo.className])});class Ro extends xo{constructor(){super(...arguments),Object.defineProperty(this,"_frequency",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_itemMap",{enumerable:!0,configurable:!0,writable:!0,value:{}})}_afterNew(){this._settings.themeTags=Ct(this._settings.themeTags,["axis"]),this.fields.push("category"),this.setPrivateRaw("name","category"),this.addTag("category"),super._afterNew()}_prepareChildren(){super._prepareChildren();const e=this.dataItems.length;let t=0;this._valuesDirty&&(this._itemMap={},G(this.dataItems,s=>{s.setRaw("index",t),this._itemMap[s.get("category")]=s,t++}),this.setPrivateRaw("maxZoomFactor",e)),this.setPrivateRaw("startIndex",Math.max(Math.round(this.get("start",0)*e),0)),this.setPrivateRaw("endIndex",Math.min(Math.round(this.get("end",1)*e),e)),(this._sizeDirty||this._valuesDirty||this.isDirty("start")||this.isDirty("end")||this.isPrivateDirty("endIndex")||this.isPrivateDirty("startIndex")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&this.dataItems.length>0&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges())}_handleRangeChange(){G(this.series,e=>{let t=this.dataItems[this.startIndex()].get("category"),s=this.dataItems[this.endIndex()-1].get("category"),r=e.get("baseAxis"),o=e.get("xAxis"),n=e.get("yAxis");if(o instanceof Ro&&n instanceof Ro)e._markDirtyAxes();else if(r===this){let a,l,u=n;if(o===r?(e.get("categoryXField")&&(a="categoryX"),e.get("openCategoryXField")&&(l="openCategoryX")):n===r&&(e.get("categoryYField")&&(a="categoryY"),e.get("openCategoryYField")&&(l="openCategoryY"),u=o),u.className=="ValueAxis"&&(a||l)){let h,d;for(let f=0,w=e.dataItems.length;f<w;f++){let _=e.dataItems[f];if(a&&_.get(a)===t){h=_;break}if(l&&_.get(l)===t){h=_;break}}for(let f=e.dataItems.length-1;f>=0;f--){let w=e.dataItems[f];if(a&&w.get(a)===s){d=w;break}if(l&&w.get(l)===s){d=w;break}}let c=0,p=e.dataItems.length;h&&(c=e.dataItems.indexOf(h)),d&&(p=e.dataItems.indexOf(d)+1),e.setPrivate("startIndex",c),e.setPrivate("endIndex",p);let y=!1;for(let f=c;f<p;f++){const w=e.dataItems[f];if(G(e.__valueXShowFields,_=>{w.get(_)!=null&&(y=!0)}),G(e.__valueYShowFields,_=>{w.get(_)!=null&&(y=!0)}),y)break}e.setPrivate("outOfSelection",!y)}e._markDirtyAxes()}})}_prepareAxisItems(){const e=this.get("renderer"),t=this.dataItems.length;let s=this.startIndex();s>0&&s--;let r=this.endIndex();r<t&&r++;let o=e.axisLength()/Math.max(e.get("minGridDistance"),1/Number.MAX_SAFE_INTEGER),n=Math.max(1,Math.min(t,Math.ceil((r-s)/o)));s=Math.floor(s/n)*n,this._frequency=n;for(let l=0;l<t;l++)this.dataItems[l].hide();let a=this.dataItems[s].get("index",0);for(let l=s;l<r;l=l+n){let u=this.dataItems[l];this._createAssets(u,[]),u.isHidden()&&u.show(),this._prepareDataItem(u,a,n),a++}this._updateGhost()}_prepareDataItem(e,t,s){let r=this.get("renderer"),o=e.get("categoryLocation",0),n=e.get("endCategoryLocation",1),a=e.get("index");B(a)||(a=this.categoryToIndex(e.get("category")));let l=this.indexToPosition(a,o),u=e.get("endCategory"),h;u?(h=this.categoryToIndex(u),B(h)||(h=a)):h=a;let d=this.indexToPosition(h,n),c,p;e.get("isRange")?c=h:c=a+this._frequency-1,p=this.indexToPosition(c,n),r.updateLabel(e.get("label"),l,d,s),r.updateGrid(e.get("grid"),l,d),r.updateTick(e.get("tick"),l,d,s),r.updateFill(e.get("axisFill"),l,p),this._processBullet(e),r.updateBullet(e.get("bullet"),l,d);const y=this.get("fillRule");y&&y(e,t)}startIndex(){let e=this.dataItems.length;return Math.min(Math.max(this.getPrivate("startIndex",0),0),e-1)}endIndex(){let e=this.dataItems.length;return Math.max(1,Math.min(this.getPrivate("endIndex",e),e))}baseValue(){}basePosition(){return 0}getX(e){let t=this._itemMap[e];return t?this._settings.renderer.positionToCoordinate(this.indexToPosition(t.get("index",0))):NaN}getY(e){let t=this._itemMap[e];return t?this._settings.renderer.positionToCoordinate(this.indexToPosition(t.get("index",0))):NaN}getDataItemPositionX(e,t,s,r){const o=e.get(t),n=this._itemMap[o];return n?this.indexToPosition(n.get("index",0),s):NaN}getDataItemCoordinateX(e,t,s,r){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(e,t,s,r))}getDataItemPositionY(e,t,s,r){const o=e.get(t),n=this._itemMap[o];return n?this.indexToPosition(n.get("index",0),s):NaN}getDataItemCoordinateY(e,t,s,r){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(e,t,s,r))}indexToPosition(e,t){B(t)||(t=.5);let s=this.dataItems.length,r=this.get("startLocation",0),o=this.get("endLocation",1);s-=r,s-=1-o;let n=(e+t-r)/s,a=this.dataItems[e];return a&&(n+=a.get("deltaPosition",0)),n}categoryToIndex(e){let t=this._itemMap[e];return t?t.get("index"):NaN}dataItemToPosition(e){return this.indexToPosition(e.get("index"))}roundAxisPosition(e,t){return e+=(.5-t)/this.dataItems.length,this.indexToPosition(this.axisPositionToIndex(e),t)}axisPositionToIndex(e){let t=this.dataItems.length;return kt(Math.floor(e*t),0,t-1)}getTooltipText(e){const t=this.dataItems[this.axisPositionToIndex(e)];if(t){const s=t.get("label");if(s)return dl(s,this.get("tooltipText",""))}}_updateTooltipText(e,t){e._setDataItem(this.dataItems[this.axisPositionToIndex(t)]),e.label.text.markDirtyText()}getSeriesItem(e,t){if(this.dataItems.length>0){let s=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),r=this.axisPositionToIndex(t),o=e.dataItems[r],n=this.dataItems[r],a=n.get("category");if(o&&n&&o.get(s)===a)return o;for(let l=0,u=e.dataItems.length;l<u;l++){let h=e.dataItems[l];if(h.get(s)===a)return h}}}zoomToIndexes(e,t,s){let r=this.dataItems.length;this.zoom(e/r,t/r,s)}zoomToCategories(e,t,s){this.zoomToIndexes(this.categoryToIndex(e),this.categoryToIndex(t)+1,s)}getCellWidthPosition(){return 1/this.dataItems.length/(this.get("end",1)-this.get("start",0))}}Object.defineProperty(Ro,"className",{enumerable:!0,configurable:!0,writable:!0,value:"CategoryAxis"});Object.defineProperty(Ro,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:xo.classNames.concat([Ro.className])});class In extends xo{constructor(){super(...arguments),Object.defineProperty(this,"_dirtyExtremes",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirtySelectionExtremes",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_deltaMinMax",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_minReal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_maxReal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_baseValue",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_syncDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_minLogAdjusted",{enumerable:!0,configurable:!0,writable:!0,value:1})}markDirtyExtremes(){this._dirtyExtremes=!0,this.markDirty()}markDirtySelectionExtremes(){this._dirtySelectionExtremes=!0,this.markDirty()}_afterNew(){this._settings.themeTags=Ct(this._settings.themeTags,["axis"]),this.setPrivateRaw("name","value"),this.addTag("value"),super._afterNew()}_prepareChildren(){if(super._prepareChildren(),this.isDirty("syncWithAxis")){this._prevSettings.syncWithAxis&&this._syncDp&&this._syncDp.dispose();let t=this.get("syncWithAxis");t&&(this._syncDp=new di([t.onPrivate("selectionMinFinal",()=>{this._dirtySelectionExtremes=!0}),t.onPrivate("selectionMaxFinal",()=>{this._dirtySelectionExtremes=!0})]))}(this._sizeDirty||this._dirtyExtremes||this._valuesDirty||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("min")||this.isDirty("max")||this.isDirty("extraMin")||this.isDirty("extraMax")||this.isDirty("logarithmic")||this.isDirty("treatZeroAs")||this.isDirty("baseValue")||this.isDirty("strictMinMax")||this.isDirty("strictMinMaxSelection")||this.isDirty("maxPrecision")||this.isDirty("numberFormat"))&&(this._getMinMax(),this.ghostLabel.set("text",""),this._dirtyExtremes=!1),this._dirtySelectionExtremes&&!this._isPanning&&this.get("autoZoom",!0)&&(this._getSelectionMinMax(),this._dirtySelectionExtremes=!1),this._groupData(),(this._sizeDirty||this._valuesDirty||this.isDirty("start")||this.isDirty("end")||this.isPrivateDirty("min")||this.isPrivateDirty("selectionMax")||this.isPrivateDirty("selectionMin")||this.isPrivateDirty("max")||this.isPrivateDirty("step")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("logarithmic"))&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges()),this._baseValue=this.baseValue()}_groupData(){}_formatText(e){const t=this.get("numberFormat"),s=this.getNumberFormatter();let r="";return t?r=s.format(e,t):r=s.format(e,void 0,this.getPrivate("stepDecimalPlaces")),r}_prepareAxisItems(){const e=this.getPrivate("min"),t=this.getPrivate("max");if(B(e)&&B(t)){const s=this.get("logarithmic"),r=this.getPrivate("step"),o=this.getPrivate("selectionMin"),n=this.getPrivate("selectionMax")+r;let a=o-r,l=0,u=1,h=e;if(s){if(a=this._minLogAdjusted,a<o)for(;a<o;)a+=r;h=a,h<=0&&(h=1,r<1&&(h=r)),u=Math.log(n-r)*Math.LOG10E-Math.log(h)*Math.LOG10E,u>2&&(a=Math.pow(10,Math.log(h)*Math.LOG10E-5))}let d=-1/0;for(;a<n;){let c;this.dataItems.length<l+1?(c=new Ks(this,void 0,{}),this._dataItems.push(c),this.processDataItem(c)):c=this.dataItems[l],this._createAssets(c,[]),c.isHidden()&&c.show(),c.setRaw("value",a);const p=c.get("label");if(p&&p.set("text",this._formatText(a)),this._prepareDataItem(c),s&&u>2?a=Math.pow(10,Math.log(h)*Math.LOG10E+l-5):a+=r,d==a)break;let y=Math.pow(10,Math.floor(Math.log(Math.abs(r))*Math.LOG10E));if(y<1){let f=Math.round(Math.abs(Math.log(Math.abs(y))*Math.LOG10E))+2;a=hi(a,f)}l++,d=a}for(let c=l;c<this.dataItems.length;c++)this.dataItems[c].hide();G(this.series,c=>{c.inited&&c._markDirtyAxes()}),this._updateGhost()}}_prepareDataItem(e,t){let s=this.get("renderer"),r=e.get("value"),o=e.get("endValue"),n=this.valueToPosition(r),a=n,l=this.valueToPosition(r+this.getPrivate("step"));B(o)&&(a=this.valueToPosition(o),l=a),e.get("isRange")&&o==null&&(l=n),s.updateLabel(e.get("label"),n,a,t);const u=e.get("grid");if(s.updateGrid(u,n,a),u&&(r==this.get("baseValue",0)?(u.addTag("base"),u._applyThemes()):u.hasTag("base")&&(u.removeTag("base"),u._applyThemes())),s.updateTick(e.get("tick"),n,a,t),s.updateFill(e.get("axisFill"),n,l),this._processBullet(e),s.updateBullet(e.get("bullet"),n,a),!e.get("isRange")){const h=this.get("fillRule");h&&h(e)}}_handleRangeChange(){let e=this.positionToValue(this.get("start",0)),t=this.positionToValue(this.get("end",1));const s=this.get("renderer").gridCount();let r=this._adjustMinMax(e,t,s,!0),o=Xx(r.step);this.setPrivateRaw("stepDecimalPlaces",o),e=hi(e,o),t=hi(t,o),r=this._adjustMinMax(e,t,s,!0);let n=r.step;e=r.min,t=r.max,(this.getPrivate("selectionMin")!==e||this.getPrivate("selectionMax")!==t||this.getPrivate("step")!==n)&&(this.setPrivateRaw("selectionMin",e),this.setPrivateRaw("selectionMax",t),this.setPrivateRaw("step",n))}positionToValue(e){const t=this.getPrivate("min"),s=this.getPrivate("max");return this.get("logarithmic")?Math.pow(Math.E,(e*(Math.log(s)*Math.LOG10E-Math.log(t)*Math.LOG10E)+Math.log(t)*Math.LOG10E)/Math.LOG10E):e*(s-t)+t}valueToPosition(e){const t=this.getPrivate("min"),s=this.getPrivate("max");if(this.get("logarithmic")){if(e<=0){let r=this.get("treatZeroAs");B(r)&&(e=r)}return(Math.log(e)*Math.LOG10E-Math.log(t)*Math.LOG10E)/(Math.log(s)*Math.LOG10E-Math.log(t)*Math.LOG10E)}else return(e-t)/(s-t)}valueToFinalPosition(e){const t=this.getPrivate("minFinal"),s=this.getPrivate("maxFinal");if(this.get("logarithmic")){if(e<=0){let r=this.get("treatZeroAs");B(r)&&(e=r)}return(Math.log(e)*Math.LOG10E-Math.log(t)*Math.LOG10E)/(Math.log(s)*Math.LOG10E-Math.log(t)*Math.LOG10E)}else return(e-t)/(s-t)}getX(e,t,s){e=s+(e-s)*t;const r=this.valueToPosition(e);return this._settings.renderer.positionToCoordinate(r)}getY(e,t,s){e=s+(e-s)*t;const r=this.valueToPosition(e);return this._settings.renderer.positionToCoordinate(r)}getDataItemCoordinateX(e,t,s,r){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(e,t,s,r))}getDataItemPositionX(e,t,s,r){let o=e.get(t);if(e.get("stackToItemX")){const a=e.component;o=o*r+a.getStackedXValueWorking(e,t)}else o=this._baseValue+(o-this._baseValue)*r;return this.valueToPosition(o)}getDataItemCoordinateY(e,t,s,r){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(e,t,s,r))}getDataItemPositionY(e,t,s,r){let o=e.get(t);if(e.get("stackToItemY")){const a=e.component;o=o*r+a.getStackedYValueWorking(e,t)}else o=this._baseValue+(o-this._baseValue)*r;return this.valueToPosition(o)}basePosition(){return this.valueToPosition(this.baseValue())}baseValue(){const e=Math.min(this.getPrivate("minFinal",-1/0),this.getPrivate("selectionMin",-1/0)),t=Math.max(this.getPrivate("maxFinal",1/0),this.getPrivate("selectionMax",1/0));let s=this.get("baseValue",0);return s<e&&(s=e),s>t&&(s=t),s}cellEndValue(e){return e}fixSmallStep(e){return 1+e===1?(e*=2,this.fixSmallStep(e)):e}_fixMin(e){return e}_fixMax(e){return e}_calculateTotals(){if(this.get("calculateTotals")){let e=this.series[0];if(e){let t=e.startIndex();if(e.dataItems.length>0){t>0&&t--;let s=e.endIndex();s<e.dataItems.length&&s++;let r,o;e.get("yAxis")==this?(r="valueY",o="vcy"):e.get("xAxis")==this&&(r="valueX",o="vcx");let n=r+"Working";if(r)for(let a=t;a<s;a++){let l=0,u=0;G(this.series,h=>{if(!h.get("excludeFromTotal")){let d=h.dataItems[a];if(d){let c=d.get(n)*h.get(o);bs(c)||(l+=c,u+=Math.abs(c))}}}),G(this.series,h=>{if(!h.get("excludeFromTotal")){let d=h.dataItems[a];if(d){let c=d.get(n)*h.get(o);bs(c)||(d.set(r+"Total",u),d.set(r+"Sum",l),d.set(r+"TotalPercent",c/u*100))}}})}}}}}_getSelectionMinMax(){const e=this.getPrivate("minFinal"),t=this.getPrivate("maxFinal"),s=this.get("min"),r=this.get("max");let o=this.get("extraMin",0),n=this.get("extraMax",0);this.get("logarithmic")&&(this.get("extraMin")==null&&(o=.1),this.get("extraMax")==null&&(n=.2));const a=this.get("renderer").gridCount(),l=this.get("strictMinMaxSelection"),u=this.get("strictMinMax");if(B(e)&&B(t)){let h=t,d=e;if(G(this.series,T=>{if(!T.get("ignoreMinMax")){let D,M;const O=T.getPrivate("outOfSelection");T.get("xAxis")===this?O||(D=T.getPrivate("selectionMinX",T.getPrivate("minX")),M=T.getPrivate("selectionMaxX",T.getPrivate("maxX"))):T.get("yAxis")===this&&(O||(D=T.getPrivate("selectionMinY",T.getPrivate("minY")),M=T.getPrivate("selectionMaxY",T.getPrivate("maxY")))),!T.isHidden()&&!T.isShowing()&&(B(D)&&(h=Math.min(h,D)),B(M)&&(d=Math.max(d,M)))}}),this.axisRanges.each(T=>{if(T.get("affectsMinMax")){let D=T.get("value");D!=null&&(h=Math.min(h,D),d=Math.max(d,D)),D=T.get("endValue"),D!=null&&(h=Math.min(h,D),d=Math.max(d,D))}}),h>d&&([h,d]=[d,h]),B(s)?u?h=s:h=e:u&&B(this._minReal)&&(h=this._minReal),B(r)?u?d=r:d=t:u&&B(this._maxReal)&&(d=this._maxReal),h===d){h-=this._deltaMinMax,d+=this._deltaMinMax;let T=this._adjustMinMax(h,d,a,u);h=T.min,d=T.max}let c=h,p=d;h-=(d-h)*o,d+=(d-h)*n;let y=this._adjustMinMax(h,d,a);h=y.min,d=y.max,h=kt(h,e,t),d=kt(d,e,t),y=this._adjustMinMax(h,d,a,!0),u||(h=y.min,d=y.max);const f=this.get("syncWithAxis");f&&(y=this._syncAxes(h,d,y.step,f.getPrivate("selectionMinFinal",f.getPrivate("minFinal",0)),f.getPrivate("selectionMaxFinal",f.getPrivate("maxFinal",1)),f.getPrivate("selectionStepFinal",f.getPrivate("step",1))),h=y.min,d=y.max),u&&(B(s)&&(h=Math.max(h,s)),B(r)&&(d=Math.min(d,r))),l&&(h=c-(d-h)*o,d=p+(d-h)*n),this.get("logarithmic")&&(h<=0&&(h=c*(1-Math.min(o,.99))),h<e&&(h=e),d>t&&(d=t));let w=Math.min(20,Math.ceil(Math.log(this.getPrivate("maxZoomFactor",100)+1)/Math.LN10)+2),_=hi(this.valueToFinalPosition(h),w),P=hi(this.valueToFinalPosition(d),w);this.setPrivateRaw("selectionMinFinal",h),this.setPrivateRaw("selectionMaxFinal",d),this.setPrivateRaw("selectionStepFinal",y.step),this.zoom(_,P)}}_getMinMax(){let e=this.get("min"),t=this.get("max"),s=1/0,r=-1/0,o=this.get("extraMin",0),n=this.get("extraMax",0);this.get("logarithmic")&&(this.get("extraMin")==null&&(o=.1),this.get("extraMax")==null&&(n=.2));let a=1/0;if(G(this.series,T=>{if(!T.get("ignoreMinMax")){let D,M;if(T.get("xAxis")===this?(D=T.getPrivate("minX"),M=T.getPrivate("maxX")):T.get("yAxis")===this&&(D=T.getPrivate("minY"),M=T.getPrivate("maxY")),B(D)&&B(M)){s=Math.min(s,D),r=Math.max(r,M);let O=M-D;O<=0&&(O=Math.abs(M/100)),O<a&&(a=O)}}}),this.axisRanges.each(T=>{if(T.get("affectsMinMax")){let D=T.get("value");D!=null&&(s=Math.min(s,D),r=Math.max(r,D)),D=T.get("endValue"),D!=null&&(s=Math.min(s,D),r=Math.max(r,D))}}),this.get("logarithmic")){let T=this.get("treatZeroAs");B(T)&&s<=0&&(s=T)}if(s===0&&r===0&&(r=.9,s=-.9),B(e)&&(s=e),B(t)&&(r=t),s===1/0||r===-1/0)return;const l=s,u=r;let h=this.adapters.fold("min",s),d=this.adapters.fold("max",r);B(h)&&(s=h),B(d)&&(r=d),s=this._fixMin(s),r=this._fixMax(r),r-s<=1/Math.pow(10,15)&&(r-s!==0?this._deltaMinMax=(r-s)/2:this._getDelta(r),s-=this._deltaMinMax,r+=this._deltaMinMax),s-=(r-s)*o,r+=(r-s)*n,this.get("logarithmic")&&(s<0&&l>=0&&(s=0),r>0&&u<=0&&(r=0)),this._minReal=s,this._maxReal=r;let c=this.get("strictMinMax"),p=this.get("strictMinMaxSelection",!1);p&&(c=p);let y=c;B(t)&&(y=!0);let f=this.get("renderer").gridCount(),w=this._adjustMinMax(s,r,f,y);s=w.min,r=w.max,w=this._adjustMinMax(s,r,f,!0),s=w.min,r=w.max,c&&(B(e)?s=e:s=this._minReal,B(t)?r=t:r=this._maxReal,r-s<=1e-8&&(s-=this._deltaMinMax,r+=this._deltaMinMax),s-=(r-s)*o,r+=(r-s)*n),h=this.adapters.fold("min",s),d=this.adapters.fold("max",r),B(h)&&(s=h),B(d)&&(r=d),a==1/0&&(a=r-s);let _=Math.round(Math.abs(Math.log(Math.abs(r-s))*Math.LOG10E))+5;s=hi(s,_),r=hi(r,_);const P=this.get("syncWithAxis");if(P&&(w=this._syncAxes(s,r,w.step,P.getPrivate("minFinal",P.getPrivate("min",0)),P.getPrivate("maxFinal",P.getPrivate("max",1)),P.getPrivate("step",1)),s=w.min,r=w.max),this.setPrivateRaw("maxZoomFactor",Math.max(1,Math.ceil((r-s)/a*this.get("maxZoomFactor",100)))),this._fixZoomFactor(),this.get("logarithmic")&&(this._minLogAdjusted=s,s=this._minReal,r=this._maxReal,s<=0&&(s=l*(1-Math.min(o,.99)))),B(s)&&B(r)&&(this.getPrivate("minFinal")!==s||this.getPrivate("maxFinal")!==r)){this.setPrivate("minFinal",s),this.setPrivate("maxFinal",r),this._saveMinMax(s,r);const T=this.get("interpolationDuration",0),D=this.get("interpolationEasing");this.animatePrivate({key:"min",to:s,duration:T,easing:D}),this.animatePrivate({key:"max",to:r,duration:T,easing:D})}}_fixZoomFactor(){}_getDelta(e){let t=Math.log(Math.abs(e))*Math.LOG10E,s=Math.pow(10,Math.floor(t));s=s/10,this._deltaMinMax=s}_saveMinMax(e,t){}_adjustMinMax(e,t,s,r){s<=1&&(s=1),s=Math.round(s);let o=e,n=t,a=t-e;a===0&&(a=Math.abs(t));let l=Math.log(Math.abs(a))*Math.LOG10E,u=Math.pow(10,Math.floor(l));u=u/10;let h=u;r&&(h=0),r?(e=Math.floor(e/u)*u,t=Math.ceil(t/u)*u):(e=Math.ceil(e/u)*u-h,t=Math.floor(t/u)*u+h),e<0&&o>=0&&(e=0),t>0&&n<=0&&(t=0),l=Math.log(Math.abs(a))*Math.LOG10E,u=Math.pow(10,Math.floor(l)),u=u/100;let d=Math.ceil(a/s/u)*u,c=Math.pow(10,Math.floor(Math.log(Math.abs(d))*Math.LOG10E)),p=Math.ceil(d/c);p>5?p=10:p<=5&&p>2&&(p=5),d=Math.ceil(d/(c*p))*c*p;let y=this.get("maxPrecision");if(B(y)){let P=hR(d,y);y<Number.MAX_VALUE&&d!==P&&(d=P)}let f=0;c<1&&(f=Math.round(Math.abs(Math.log(Math.abs(c))*Math.LOG10E))+1,d=hi(d,f));let w=Math.floor(e/d);e=hi(d*w,f);let _;return r?_=Math.floor(t/d):_=Math.ceil(t/d),_===w&&_++,t=hi(d*_,f),t<n&&(t=t+d),e>o&&(e=e-d),d=this.fixSmallStep(d),{min:e,max:t,step:d}}getTooltipText(e){const t=this.get("tooltipNumberFormat",this.get("numberFormat")),s=this.getNumberFormatter(),r=this.get("extraTooltipPrecision",0),o=this.getPrivate("stepDecimalPlaces",0)+r,n=hi(this.positionToValue(e),o);return t?s.format(n,t):s.format(n,void 0,o)}getSeriesItem(e,t){let s=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),r=this.positionToValue(t),o,n;if(G(e.dataItems,(a,l)=>{const u=Math.abs(a.get(s)-r);(o===void 0||u<n)&&(o=l,n=u)}),o!=null)return e.dataItems[o]}zoomToValues(e,t,s){const r=this.getPrivate("minFinal",0),o=this.getPrivate("maxFinal",0);this.getPrivate("min")!=null&&this.getPrivate("max")!=null&&this.zoom((e-r)/(o-r),(t-r)/(o-r),s)}_syncAxes(e,t,s,r,o,n){if(this.get("syncWithAxis")){let l=Math.round(o-r)/n,u=Math.round((t-e)/s),h=this.get("renderer").gridCount();if(B(l)&&B(u)){let d=!1,c=0,p=(t-e)*.01,y=e,f=t,w=s;for(;d!=!0;)if(d=this._checkSync(y,f,w,l),c++,c>500&&(d=!0),d)e=y,t=f,s=w;else{c/3==Math.round(c/3)?(y=e-p*c,e>=0&&y<0&&(y=0)):(f=t+p*c,f<=0&&f>0&&(f=0));let _=this._adjustMinMax(y,f,h,!0);y=_.min,f=_.max,w=_.step}}}return{min:e,max:t,step:s}}_checkSync(e,t,s,r){let o=(t-e)/s;for(let n=1;n<r;n++)if(hi(o/n,1)==r||o*n==r)return!0;return!1}}Object.defineProperty(In,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ValueAxis"});Object.defineProperty(In,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:xo.classNames.concat([In.className])});class Dh extends In{constructor(){super(...arguments),Object.defineProperty(this,"_dataGrouped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_seriesDataGrouped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_groupingCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_intervalDuration",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_baseDuration",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_intervalMax",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_intervalMin",{enumerable:!0,configurable:!0,writable:!0,value:{}})}_afterNew(){this._settings.themeTags=Ct(this._settings.themeTags,["axis"]),super._afterNew(),this._setBaseInterval(this.get("baseInterval")),this.on("baseInterval",()=>{this._setBaseInterval(this.get("baseInterval"))})}_setBaseInterval(e){this.setPrivateRaw("baseInterval",e),this._baseDuration=pr(e)}_fixZoomFactor(){var e=this.get("maxZoomFactor");e!=null&&e!=1/0?this.setPrivateRaw("maxZoomFactor",e):this.setPrivateRaw("maxZoomFactor",Math.round((this.getPrivate("max",0)-this.getPrivate("min",0))/this.baseMainDuration()))}_groupData(){const e=this.getPrivate("min"),t=this.getPrivate("max");if(B(e)&&B(t)){this._fixZoomFactor();const s=this.getPrivate("groupInterval");if(s?this._setBaseInterval(s):this._setBaseInterval(this.get("baseInterval")),this.isDirty("groupInterval")){let r=this.get("groupInterval");r&&this.setRaw("groupIntervals",[r])}if(this.isDirty("groupData")&&!this._dataGrouped){if(this.get("groupData"))G(this.series,r=>{this._groupSeriesData(r)}),this._handleRangeChange();else{let r=this.get("baseInterval"),o=r.timeUnit+r.count;G(this.series,n=>{n.setDataSet(o)}),this._setBaseInterval(r),this.setPrivateRaw("groupInterval",void 0),this.markDirtyExtremes()}this._dataGrouped=!0}}}_groupSeriesData(e){if(this.get("groupData")&&!e.get("groupDataDisabled")){this._dataGrouped=!0,this._seriesDataGrouped=!0;let t=[],s=this.baseMainDuration(),r=this.get("groupIntervals");G(r,w=>{pr(w)>s&&t.push(w)}),e._dataSets={};const o=this.getPrivate("name")+this.get("renderer").getPrivate("letter");let n;const a=e.get("baseAxis");e.get("xAxis")===a?n=e._valueYFields:e.get("yAxis")===a&&(n=e._valueXFields);let l=e._mainDataItems,u=this.get("baseInterval"),h=u.timeUnit+u.count;e._dataSets[h]=l;const d=e.get("groupDataCallback");let c=e.get("groupDataWithOriginals",!1);d&&(c=!0);const p=this._root.locale.firstDayOfWeek,y=this._root.utc,f=this._root.timezone;G(t,w=>{let _=-1/0,P=w.timeUnit+w.count;e._dataSets[P]=[];let T,D={},M={},O={},N={};G(n,ee=>{D[ee]=0,M[ee]=0,O[ee]=e.get(ee+"Grouped"),N[ee]=ee+"Working"});let z=$i(w.timeUnit),Y=l[0],W;Y&&(W=new Date(l[0].get(o)));let $;G(l,ee=>{let re=ee.get(o),me=ti(new Date(re),w.timeUnit,w.count,p,y,W,f).getTime(),he;_<me-z/24?(he=mr(ee.dataContext),T=new Ks(e,he,e._makeDataItem(he)),T.setRaw(o,me),e._dataSets[P].push(T),G(n,ce=>{let ne=ee.get(ce);B(ne)?(T.setRaw(ce,ne),T.setRaw(N[ce],ne),M[ce]=1,D[ce]=ne):(D[ce]=0,M[ce]=0)}),c&&T.set("originals",[ee]),d&&$&&d($,w),$=T):(G(n,ce=>{let ne=O[ce],oe=ee.get(ce);if(oe!==void 0){let Q=T.get(ce);switch(ne){case"close":T.setRaw(ce,oe);break;case"sum":oe!=null&&T.setRaw(ce,Q+oe);break;case"open":break;case"low":oe<Q&&T.setRaw(ce,oe);break;case"high":oe>Q&&T.setRaw(ce,oe);break;case"average":M[ce]++,D[ce]+=oe;let _e=D[ce]/M[ce];T.setRaw(ce,_e);break;case"extreme":Math.abs(oe)>Math.abs(Q)&&T.setRaw(ce,oe);break}T.setRaw(N[ce],T.get(ce));let pe=mr(ee.dataContext);pe[o]=me,T.dataContext=pe}}),c&&T.get("originals").push(ee)),_=me}),d&&$&&d($,w)}),e._dataSetId&&e.setDataSet(e._dataSetId),this.markDirtySize()}}_clearDirty(){super._clearDirty(),this._groupingCalculated=!1,this._dataGrouped=!1}getGroupInterval(e){let t=this.get("baseInterval"),s=np(0,e,this.get("groupCount",1/0),this.get("groupIntervals"));return pr(s)<pr(t)&&(s=Object.assign({},t)),s}getIntervalMax(e){return this._intervalMax[e.timeUnit+e.count]}getIntervalMin(e){return this._intervalMin[e.timeUnit+e.count]}_handleRangeChange(){super._handleRangeChange();let e=Math.round(this.getPrivate("selectionMin")),t=Math.round(this.getPrivate("selectionMax"));if(B(e)&&B(t)){if(this.get("endLocation")==0&&(t+=1),this.get("groupData")&&!this._groupingCalculated){this._groupingCalculated=!0;let s=t-e+(this.get("startLocation",0)+(1-this.get("endLocation",1))*this.baseDuration()),r=this.get("groupInterval");r||(r=this.getGroupInterval(s));let o=this.getPrivate("groupInterval");if(r&&(!o||o.timeUnit!==r.timeUnit||o.count!==r.count||this._seriesDataGrouped)){this._seriesDataGrouped=!1,this.setPrivateRaw("groupInterval",r),this._setBaseInterval(r);let n=r.timeUnit+r.count;G(this.series,a=>{a.get("baseAxis")===this&&a.setDataSet(n)}),this.markDirtyExtremes(),this._root.events.once("frameended",()=>{this._root.events.once("frameended",()=>{const a="groupintervalchanged";this.events.isEnabled(a)&&this.events.dispatch(a,{type:a,target:this})})})}}G(this.series,s=>{if(s.get("baseAxis")===this){let r=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),n=Wu(s.dataItems,f=>Is(f.get(r),e)).index;n>0&&(n-=1),t+=this.baseDuration()*(1-this.get("endLocation",1));let l=Wu(s.dataItems,f=>Is(f.get(r),t)).index,u=l;u>0&&u--;const h=s.dataItems[n],d=s.dataItems[u];let c,p;h&&(p=h.get(r)),d&&(c=d.get(r));let y=!1;c!=null&&p!=null&&(c<e||p>t)&&(y=!0),s.setPrivate("outOfSelection",y),s.setPrivate("startIndex",n),s.setPrivate("endIndex",l)}})}}_adjustMinMax(e,t,s,r){return{min:e,max:t,step:(t-e)/s}}intervalDuration(){return this._intervalDuration}_saveMinMax(e,t){let s=this.getPrivate("groupInterval");s||(s=this.get("baseInterval"));let r=s.timeUnit+s.count;this._intervalMin[r]=e,this._intervalMax[r]=t}_getM(e){return e=="month"||e=="year"||e=="day"?1.05:1.01}_prepareAxisItems(){const e=this.getPrivate("min"),t=this.getPrivate("max");if(B(e)&&B(t)){const s=Math.round(this.getPrivate("selectionMin")),r=Math.round(this.getPrivate("selectionMax")),o=this.get("renderer"),n=this.getPrivate("baseInterval");let a=s,l=0;const u=this.get("gridIntervals");let h=np(0,r-s,o.gridCount(),u);pr(h)<this.baseDuration()&&(h=Object.assign({},n));const d=pr(h);this._intervalDuration=d;const c=my(h.timeUnit),p=this._root.locale.firstDayOfWeek,y=this._root.utc,f=this._root.timezone;a=ti(new Date(s-d),h.timeUnit,h.count,p,y,new Date(e),f).getTime();let w=a-d,_;const P=this.get("dateFormats");for(this.setPrivateRaw("gridInterval",h);a<r+d;){let T;this.dataItems.length<l+1?(T=new Ks(this,void 0,{}),this._dataItems.push(T),this.processDataItem(T)):T=this.dataItems[l],this._createAssets(T,[]),T.isHidden()&&T.show(),T.setRaw("value",a);let D=a+$i(h.timeUnit,h.count*this._getM(h.timeUnit));D=ti(new Date(D),h.timeUnit,1,p,y,void 0,f).getTime(),T.setRaw("endValue",D);let M=new Date(a);_=P[h.timeUnit],c&&this.get("markUnitChange")&&B(w)&&h.timeUnit!="year"&&vy(a,w,c,y,f)&&(_=this.get("periodChangeDateFormats")[h.timeUnit]);const O=T.get("label");if(O&&O.set("text",this._root.dateFormatter.format(M,_)),this._prepareDataItem(T,h.count),w=a,a=D,a==w)break;l++}for(let T=l;T<this.dataItems.length;T++)this.dataItems[T].hide();G(this.series,T=>{T.inited&&T._markDirtyAxes()})}this._updateGhost()}_updateFinals(e,t){this.setPrivateRaw("selectionMinFinal",this.positionToValue(e)),this.setPrivateRaw("selectionMaxFinal",this.positionToValue(t))}_getDelta(){this._deltaMinMax=this.baseDuration()/2}_fixMin(e){const t=this.getPrivate("baseInterval"),s=this._root.locale.firstDayOfWeek,r=this._root.timezone,o=this._root.utc,n=t.timeUnit;let a=ti(new Date(e),n,t.count,s,o,void 0,r).getTime(),l=a+$i(n,t.count*this._getM(n));return l=ti(new Date(l),n,1,s,o,void 0,r).getTime(),a+(l-a)*this.get("startLocation",0)}_fixMax(e){const t=this.getPrivate("baseInterval"),s=this._root.locale.firstDayOfWeek,r=this._root.timezone,o=this._root.utc,n=t.timeUnit;let a=ti(new Date(e),n,t.count,s,o,void 0,r).getTime(),l=a+$i(n,t.count*this._getM(n));return l=ti(new Date(l),n,1,s,o,void 0,r).getTime(),a+(l-a)*this.get("endLocation",1)}_updateDates(e){}baseDuration(){return this._baseDuration}baseMainDuration(){return pr(this.get("baseInterval"))}processSeriesDataItem(e,t){const s=this.getPrivate("baseInterval");e.open||(e.open={}),e.close||(e.close={}),G(t,r=>{let o=e.get(r);if(B(o)){let n=e.open[r],a=e.close[r];if(!(o>=n&&o<=a)){const l=this._root.locale.firstDayOfWeek,u=this._root.utc,h=this._root.timezone,d=s.timeUnit,c=s.count;n=ti(new Date(o),d,c,l,u,void 0,h).getTime(),a=n+$i(d,c*this._getM(d)),a=ti(new Date(a),d,1,l,u,void 0,h).getTime(),e.open[r]=n,e.close[r]=a}this._updateDates(n)}})}getDataItemPositionX(e,t,s,r){let o,n;e.open&&e.close?(o=e.open[t],n=e.close[t]):(o=e.get(t),n=o);let a=o+(n-o)*s;return a=this._baseValue+(a-this._baseValue)*r,this.valueToPosition(a)}getDataItemCoordinateX(e,t,s,r){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(e,t,s,r))}getDataItemPositionY(e,t,s,r){let o,n;e.open&&e.close?(o=e.open[t],n=e.close[t]):(o=e.get(t),n=o);let a=o+(n-o)*s;return a=this._baseValue+(a-this._baseValue)*r,this.valueToPosition(a)}getDataItemCoordinateY(e,t,s,r){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(e,t,s,r))}roundAxisPosition(e,t){let s=this.positionToValue(e);s=s-(t-.5)*this.baseDuration();let r=this.getPrivate("baseInterval");if(!bs(s)){const o=this._root.locale.firstDayOfWeek,n=r.timeUnit,a=this._root.utc,l=this._root.timezone,u=r.count;s=ti(new Date(s),n,u,o,a,new Date(this.getPrivate("min",0)),l).getTime();let h=mc(r,new Date(s),o,a,l);return l&&(s=ti(new Date(s+this.baseDuration()*.05),n,u,o,a,new Date(this.getPrivate("min",0)),l).getTime(),h=mc(r,new Date(s+h*t),o,a,l)),this.valueToPosition(s+h*t)}return NaN}getTooltipText(e){if(this.getPrivate("min")!=null){let t=this.get("tooltipDateFormats")[this.getPrivate("baseInterval").timeUnit],s=this.positionToValue(e),r=new Date(s),o=this.getPrivate("baseInterval"),n=mc(o,r,this._root.locale.firstDayOfWeek,this._root.utc,this._root.timezone);return this._root.dateFormatter.format(new Date(s+this.get("tooltipIntervalOffset",-this.get("tooltipLocation",.5))*n),this.get("tooltipDateFormat",t))}return""}getSeriesItem(e,t,s){let r=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),o=this.positionToValue(t);s==null&&(s=.5),o=o-(s-.5)*this.baseDuration();const n=Wu(e.dataItems,a=>{var l=0;return a.open&&(l=a.open[r]),Is(l,o)});if(e.get("snapTooltip")){let a=e.dataItems[n.index-1],l=e.dataItems[n.index];if(a&&l&&a.open&&l.close){let u=a.open[r],h=l.close[r];if(Math.abs(o-u)>Math.abs(o-h))return l}if(a)return a;if(l)return l}else{const a=e.dataItems[n.index-1];if(a&&a.open&&a.close){let l=a.open[r],u=a.close[r];if(o>=l&&o<=u)return a}}}shouldGap(e,t,s,r){const o=e.get(r);return t.get(r)-o>this.baseDuration()*s}zoomToDates(e,t,s){this.zoomToValues(e.getTime(),t.getTime(),s)}positionToDate(e){return new Date(this.positionToValue(e))}dateToPosition(e){return this.valueToPosition(e.getTime())}getCellWidthPosition(){let e=this.getPrivate("selectionMax",this.getPrivate("max")),t=this.getPrivate("selectionMin",this.getPrivate("min"));return B(e)&&B(t)?this.baseDuration()/(e-t):.05}}Object.defineProperty(Dh,"className",{enumerable:!0,configurable:!0,writable:!0,value:"DateAxis"});Object.defineProperty(Dh,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:In.classNames.concat([Dh.className])});class Ph extends xr{constructor(){super(...arguments),Object.defineProperty(this,"_tickPoints",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}Object.defineProperty(Ph,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisLabel"});Object.defineProperty(Ph,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:xr.classNames.concat([Ph.className])});class Th extends yl{constructor(){super(...arguments),Object.defineProperty(this,"_tickPoints",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}Object.defineProperty(Th,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisTick"});Object.defineProperty(Th,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:yl.classNames.concat([Th.className])});class Do extends it{constructor(){super(...arguments),Object.defineProperty(this,"_axisLength",{enumerable:!0,configurable:!0,writable:!0,value:100}),Object.defineProperty(this,"_start",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_end",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_inversed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_minSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_lc",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_ls",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_thumbDownPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downStart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downEnd",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ticks",{enumerable:!0,configurable:!0,writable:!0,value:new As(Wt.new({}),()=>Th._new(this._root,{themeTags:Ct(this.ticks.template.get("themeTags",[]),this.get("themeTags",[]))},[this.ticks.template]))}),Object.defineProperty(this,"grid",{enumerable:!0,configurable:!0,writable:!0,value:new As(Wt.new({}),()=>Ln._new(this._root,{themeTags:Ct(this.grid.template.get("themeTags",[]),this.get("themeTags",[]))},[this.grid.template]))}),Object.defineProperty(this,"axisFills",{enumerable:!0,configurable:!0,writable:!0,value:new As(Wt.new({}),()=>it._new(this._root,{themeTags:Ct(this.axisFills.template.get("themeTags",["axis","fill"]),this.get("themeTags",[]))},[this.axisFills.template]))}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:new As(Wt.new({}),()=>Ph._new(this._root,{themeTags:Ct(this.labels.template.get("themeTags",[]),this.get("themeTags",[]))},[this.labels.template]))}),Object.defineProperty(this,"axis",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}makeTick(e,t){const s=this.ticks.make();return s._setDataItem(e),e.setRaw("tick",s),s.set("themeTags",Ct(s.get("themeTags"),t)),this.axis.labelsContainer.children.push(s),this.ticks.push(s),s}makeGrid(e,t){const s=this.grid.make();return s._setDataItem(e),e.setRaw("grid",s),s.set("themeTags",Ct(s.get("themeTags"),t)),this.axis.gridContainer.children.push(s),this.grid.push(s),s}makeAxisFill(e,t){const s=this.axisFills.make();return s._setDataItem(e),s.set("themeTags",Ct(s.get("themeTags"),t)),this.axis.gridContainer.children.push(s),e.setRaw("axisFill",s),this.axisFills.push(s),s}makeLabel(e,t){const s=this.labels.make();return s.set("themeTags",Ct(s.get("themeTags"),t)),this.axis.labelsContainer.children.moveValue(s,0),s._setDataItem(e),e.setRaw("label",s),this.labels.push(s),s}axisLength(){return 0}gridCount(){return this.axisLength()/this.get("minGridDistance",50)}_updatePositions(){}_afterNew(){super._afterNew(),this.set("isMeasured",!1);const e=this.thumb;e&&(this._disposers.push(e.events.on("pointerdown",t=>{this._handleThumbDown(t.originalEvent)})),this._disposers.push(e.events.on("globalpointerup",t=>{this._handleThumbUp(t.originalEvent)})),this._disposers.push(e.events.on("globalpointermove",t=>{this._handleThumbMove(t.originalEvent)})))}_changed(){if(super._changed(),this.isDirty("pan")){const e=this.thumb;if(e){const t=this.axis.labelsContainer,s=this.get("pan");s=="zoom"?t.children.push(e):s=="none"&&t.children.removeValue(e)}}}_handleThumbDown(e){this._thumbDownPoint=this.toLocal(this._root.documentPointToRoot({x:e.clientX,y:e.clientY}));const t=this.axis;this._downStart=t.get("start"),this._downEnd=t.get("end")}_handleThumbUp(e){this._thumbDownPoint=void 0}_handleThumbMove(e){const t=this._thumbDownPoint;if(t){const s=this.toLocal(this._root.documentPointToRoot({x:e.clientX,y:e.clientY})),r=this._downStart,o=this._downEnd,n=this._getPan(s,t)*Math.min(1,o-r)/2;this.axis.setAll({start:r-n,end:o+n})}}_getPan(e,t){return 0}positionToCoordinate(e){return this._inversed?(this._end-e)*this._axisLength:(e-this._start)*this._axisLength}updateTooltipBounds(e){}_updateSize(){this.markDirty(),this._clear=!0}toAxisPosition(e){const t=this._start||0,s=this._end||1;return e=e*(s-t),this.get("inversed")?e=s-e:e=t+e,e}fixPosition(e){return this.get("inversed")?1-e:e}_updateLC(){}toggleVisibility(e,t,s,r){let o=this.axis;const n=o.get("start",0),a=o.get("end",1);let l=n+(a-n)*(s-1e-4),u=n+(a-n)*(r+1e-4);t<l||t>u?e.setPrivate("visible",!1):e.setPrivate("visible",!0)}_positionTooltip(e,t){const s=this.chart;s&&(s.inPlot(t)?e.set("pointTo",this._display.toGlobal(t)):e.hide())}processAxis(){}}Object.defineProperty(Do,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRenderer"});Object.defineProperty(Do,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:it.classNames.concat([Do.className])});class bl extends Do{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:Hi.new(this._root,{width:ue,isMeasured:!1,themeTags:["axis","x","thumb"]})})}_afterNew(){this._settings.themeTags=Ct(this._settings.themeTags,["renderer","x"]),super._afterNew(),this.setPrivateRaw("letter","X");const e=this.grid.template;e.set("height",ue),e.set("width",0),e.set("draw",(t,s)=>{t.moveTo(0,0),t.lineTo(0,s.height())}),this.set("draw",(t,s)=>{t.moveTo(0,0),t.lineTo(s.width(),0)})}_changed(){super._changed();const e=this.axis;e.ghostLabel.setPrivate("visible",!this.get("inside"));const t="opposite",s="inside";if(this.isDirty(t)||this.isDirty(s)){const r=this.chart,o=e.children;if(this.get(s)?e.addTag(s):e.removeTag(s),r){if(this.get(t)){const n=r.topAxesContainer.children;n.indexOf(e)==-1&&n.insertIndex(0,e),e.addTag(t),o.moveValue(this)}else{const n=r.bottomAxesContainer.children;n.indexOf(e)==-1&&n.moveValue(e),e.removeTag(t),o.moveValue(this,0)}e.ghostLabel._applyThemes(),this.labels.each(n=>{n._applyThemes()}),this.root._markDirtyRedraw()}e.markDirtySize()}this.thumb.setPrivate("height",e.labelsContainer.height())}_getPan(e,t){return(t.x-e.x)/this.width()}toAxisPosition(e){const t=this._start||0,s=this._end||1;return e-=this._ls,e=e*(s-t)/this._lc,this.get("inversed")?e=s-e:e=t+e,e}_updateLC(){const e=this.axis,t=e.parent;if(t){const s=t.innerWidth();this._lc=this.axisLength()/s,this._ls=(e.x()-t.get("paddingLeft",0))/s}}_updatePositions(){const e=this.axis;e.gridContainer.set("x",e.x()-ii(e.get("centerX",0),e.width())-e.parent.get("paddingLeft",0)),e.bulletsContainer.set("y",this.y());const t=e.chart;if(t){const s=t.plotContainer,r=e.axisHeader;let o=e.get("marginLeft",0),n=e.x()-o;const a=e.parent;a&&(n-=a.get("paddingLeft",0)),r.children.length>0?(o=e.axisHeader.width(),e.set("marginLeft",o+1)):r.set("width",o),r.setAll({x:n,y:-1,height:s.height()+2})}}processAxis(){super.processAxis();const e=this.axis;e.set("width",ue);const t=this._root.verticalLayout;e.set("layout",t),e.labelsContainer.set("width",ue),e.axisHeader.setAll({layout:t})}axisLength(){return this.axis.width()}positionToPoint(e){return{x:this.positionToCoordinate(e),y:0}}updateTick(e,t,s,r){if(e){B(t)||(t=0);let o=.5;B(r)&&r>1?o=e.get("multiLocation",o):o=e.get("location",o),B(s)&&s!=t&&(t=t+(s-t)*o),e.set("x",this.positionToCoordinate(t));let n=e.get("length",0);const a=e.get("inside",this.get("inside",!1));this.get("opposite")?(e.set("y",ue),a||(n*=-1)):(e.set("y",0),a&&(n*=-1)),e.set("draw",l=>{l.moveTo(0,0),l.lineTo(0,n)}),this.toggleVisibility(e,t,e.get("minPosition",0),e.get("maxPosition",1))}}updateLabel(e,t,s,r){if(e){let o=.5;B(r)&&r>1?o=e.get("multiLocation",o):o=e.get("location",o),B(t)||(t=0);const n=e.get("inside",this.get("inside",!1));this.get("opposite")?n?(e.set("position","absolute"),e.set("y",0)):(e.set("position","relative"),e.set("y",ue)):n?(e.set("y",0),e.set("position","absolute")):(e.set("y",void 0),e.set("position","relative")),B(s)&&s!=t&&(t=t+(s-t)*o),e.set("x",this.positionToCoordinate(t)),this.toggleVisibility(e,t,e.get("minPosition",0),e.get("maxPosition",1))}}updateGrid(e,t,s){if(e){B(t)||(t=0);let r=e.get("location",.5);B(s)&&s!=t&&(t=t+(s-t)*r),e.set("x",this.positionToCoordinate(t)),this.toggleVisibility(e,t,0,1)}}updateBullet(e,t,s){if(e){const r=e.get("sprite");if(r){B(t)||(t=0);let o=e.get("location",.5);B(s)&&s!=t&&(t=t+(s-t)*o);let n=this.axis.roundAxisPosition(t,o),a=this.axis._bullets[n],l=-1;if(this.get("opposite")&&(l=1),e.get("stacked"))if(a){let u=a.get("sprite");u&&r.set("y",u.y()+u.height()*l)}else r.set("y",0);this.axis._bullets[n]=e,r.set("x",this.positionToCoordinate(t)),this.toggleVisibility(r,t,0,1)}}}updateFill(e,t,s){if(e){B(t)||(t=0),B(s)||(s=1);let r=this.positionToCoordinate(t),o=this.positionToCoordinate(s);this.fillDrawMethod(e,r,o)}}fillDrawMethod(e,t,s){e.set("draw",r=>{const o=this.axis.gridContainer.height(),n=this.width();s<t&&([s,t]=[t,s]),!(t>n||s<0)&&(r.moveTo(t,0),r.lineTo(s,0),r.lineTo(s,o),r.lineTo(t,o),r.lineTo(t,0))})}positionTooltip(e,t){this._positionTooltip(e,{x:this.positionToCoordinate(t),y:0})}updateTooltipBounds(e){const t=this.get("inside"),s=1e5;let r=this._display.toGlobal({x:0,y:0}),o=r.x,n=0,a=this.axisLength(),l=s,u="up";this.get("opposite")?t?(u="up",n=r.y,l=s):(u="down",n=r.y-s,l=s):t?(u="down",n=r.y-s,l=s):(u="up",n=r.y,l=s);const h={left:o,right:o+a,top:n,bottom:n+l},d=e.get("bounds");ny(h,d)||(e.set("bounds",h),e.set("pointerOrientation",u))}}Object.defineProperty(bl,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRendererX"});Object.defineProperty(bl,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Do.classNames.concat([bl.className])});class Ah extends Do{constructor(){super(...arguments),Object.defineProperty(this,"_downY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:Hi.new(this._root,{height:ue,isMeasured:!1,themeTags:["axis","y","thumb"]})})}_afterNew(){this._settings.themeTags=Ct(this._settings.themeTags,["renderer","y"]),this._settings.opposite&&this._settings.themeTags.push("opposite"),super._afterNew(),this.setPrivateRaw("letter","Y");const e=this.grid.template;e.set("width",ue),e.set("height",0),e.set("draw",(t,s)=>{t.moveTo(0,0),t.lineTo(s.width(),0)}),this.set("draw",(t,s)=>{t.moveTo(0,0),t.lineTo(0,s.height())})}_getPan(e,t){return(e.y-t.y)/this.height()}_changed(){super._changed();const e=this.axis;e.ghostLabel.setPrivate("visible",!this.get("inside"));const t=this.thumb,s="opposite",r="inside",o=this.chart;if(this.isDirty(s)||this.isDirty(r)){const a=e.children;if(this.get(r)?e.addTag(r):e.removeTag(r),o){if(this.get(s)){const l=o.rightAxesContainer.children;l.indexOf(e)==-1&&l.moveValue(e,0),e.addTag(s),a.moveValue(this,0)}else{const l=o.leftAxesContainer.children;l.indexOf(e)==-1&&l.moveValue(e),e.removeTag(s),a.moveValue(this)}e.ghostLabel._applyThemes(),this.labels.each(l=>{l._applyThemes()}),this.root._markDirtyRedraw()}e.markDirtySize()}var n=e.labelsContainer.width();o&&(this.get(s)?t.set("centerX",0):t.set("centerX",n)),t.setPrivate("width",n)}processAxis(){super.processAxis();const e=this.axis;e.get("height")==null&&e.set("height",ue);const t=this._root.horizontalLayout;e.set("layout",t),e.labelsContainer.set("height",ue),e.axisHeader.set("layout",t)}_updatePositions(){const e=this.axis;e.gridContainer.set("y",e.y()-ii(e.get("centerY",0),e.height())),e.bulletsContainer.set("x",this.x());const t=e.chart;if(t){const s=t.plotContainer,r=e.axisHeader;let o=e.get("marginTop",0);r.children.length>0?(o=e.axisHeader.height(),e.set("marginTop",o+1)):r.set("height",o),r.setAll({y:e.y()-o,x:-1,width:s.width()+2})}}axisLength(){return this.axis.innerHeight()}positionToPoint(e){return{x:0,y:this.positionToCoordinate(e)}}updateLabel(e,t,s,r){if(e){B(t)||(t=0);let o=.5;B(r)&&r>1?o=e.get("multiLocation",o):o=e.get("location",o);const n=this.get("opposite"),a=e.get("inside",this.get("inside",!1));n?(e.set("x",0),a?e.set("position","absolute"):e.set("position","relative")):a?(e.set("x",0),e.set("position","absolute")):(e.set("x",void 0),e.set("position","relative")),B(s)&&s!=t&&(t=t+(s-t)*o),e.set("y",this.positionToCoordinate(t)),this.toggleVisibility(e,t,e.get("minPosition",0),e.get("maxPosition",1))}}updateGrid(e,t,s){if(e){B(t)||(t=0);let r=e.get("location",.5);B(s)&&s!=t&&(t=t+(s-t)*r),e.set("y",this.positionToCoordinate(t)),this.toggleVisibility(e,t,0,1)}}updateTick(e,t,s,r){if(e){B(t)||(t=0);let o=.5;B(r)&&r>1?o=e.get("multiLocation",o):o=e.get("location",o),B(s)&&s!=t&&(t=t+(s-t)*o),e.set("y",this.positionToCoordinate(t));let n=e.get("length",0);const a=e.get("inside",this.get("inside",!1));this.get("opposite")?(e.set("x",0),a&&(n*=-1)):a||(n*=-1),e.set("draw",l=>{l.moveTo(0,0),l.lineTo(n,0)}),this.toggleVisibility(e,t,e.get("minPosition",0),e.get("maxPosition",1))}}updateBullet(e,t,s){if(e){const r=e.get("sprite");if(r){B(t)||(t=0);let o=e.get("location",.5);B(s)&&s!=t&&(t=t+(s-t)*o);let n=this.axis.roundAxisPosition(t,o),a=this.axis._bullets[n],l=1;if(this.get("opposite")&&(l=-1),e.get("stacked"))if(a){let u=a.get("sprite");u&&r.set("x",u.x()+u.width()*l)}else r.set("x",0);this.axis._bullets[n]=e,r.set("y",this.positionToCoordinate(t)),this.toggleVisibility(r,t,0,1)}}}updateFill(e,t,s){if(e){B(t)||(t=0),B(s)||(s=1);let r=this.positionToCoordinate(t),o=this.positionToCoordinate(s);this.fillDrawMethod(e,r,o)}}fillDrawMethod(e,t,s){e.set("draw",r=>{const o=this.axis.gridContainer.width(),n=this.height();s<t&&([s,t]=[t,s]),!(t>n||s<0)&&(r.moveTo(0,t),r.lineTo(o,t),r.lineTo(o,s),r.lineTo(0,s),r.lineTo(0,t))})}positionToCoordinate(e){return this._inversed?(e-this._start)*this._axisLength:(this._end-e)*this._axisLength}positionTooltip(e,t){this._positionTooltip(e,{x:0,y:this.positionToCoordinate(t)})}updateTooltipBounds(e){const t=this.get("inside"),s=1e5;let r=this._display.toGlobal({x:0,y:0}),o=r.y,n=0,a=this.axisLength(),l=s,u="right";this.get("opposite")?t?(u="right",n=r.x-s,l=s):(u="left",n=r.x,l=s):t?(u="left",n=r.x,l=s):(u="right",n=r.x-s,l=s);const h={left:n,right:n+l,top:o,bottom:o+a},d=e.get("bounds");ny(h,d)||(e.set("bounds",h),e.set("pointerOrientation",u))}_updateLC(){const e=this.axis,t=e.parent;if(t){const s=t.innerHeight();this._lc=this.axisLength()/s,this._ls=e.y()/s}}toAxisPosition(e){const t=this._start||0,s=this._end||1;return e-=this._ls,e=e*(s-t)/this._lc,this.get("inversed")?e=t+e:e=s-e,e}fixPosition(e){return this.get("inversed")?e:1-e}}Object.defineProperty(Ah,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRendererY"});Object.defineProperty(Ah,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Do.classNames.concat([Ah.className])});class Fh extends Eo{constructor(){super(...arguments),Object.defineProperty(this,"columns",{enumerable:!0,configurable:!0,writable:!0,value:new As(Wt.new({}),()=>Mn._new(this._root,{position:"absolute",themeTags:Ct(this.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template]))})}makeColumn(e,t){const s=this.mainContainer.children.push(t.make());return s._setDataItem(e),t.push(s),s}_processAxisRange(e){super._processAxisRange(e),e.columns=new As(Wt.new({}),()=>Mn._new(this._root,{position:"absolute",themeTags:Ct(e.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template,e.columns.template]))}}Object.defineProperty(Fh,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColumnSeries"});Object.defineProperty(Fh,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Eo.classNames.concat([Fh.className])});class Mh extends _o{constructor(){super(...arguments),Object.defineProperty(this,"_endIndex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeGenerator",{enumerable:!0,configurable:!0,writable:!0,value:xy()}),Object.defineProperty(this,"_fillGenerator",{enumerable:!0,configurable:!0,writable:!0,value:C0()}),Object.defineProperty(this,"_legendStroke",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_legendFill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"strokes",{enumerable:!0,configurable:!0,writable:!0,value:new As(Wt.new({}),()=>it._new(this._root,{themeTags:Ct(this.strokes.template.get("themeTags",[]),["line","series","stroke"])},[this.strokes.template]))}),Object.defineProperty(this,"fills",{enumerable:!0,configurable:!0,writable:!0,value:new As(Wt.new({}),()=>it._new(this._root,{themeTags:Ct(this.strokes.template.get("themeTags",[]),["line","series","fill"])},[this.fills.template]))}),Object.defineProperty(this,"_fillTemplate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeTemplate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_previousPoint",{enumerable:!0,configurable:!0,writable:!0,value:[0,0,0,0]}),Object.defineProperty(this,"_dindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_sindex",{enumerable:!0,configurable:!0,writable:!0,value:0})}_afterNew(){this._fillGenerator.y0(function(e){return e[3]}),this._fillGenerator.x0(function(e){return e[2]}),this._fillGenerator.y1(function(e){return e[1]}),this._fillGenerator.x1(function(e){return e[0]}),super._afterNew()}makeStroke(e){const t=this.mainContainer.children.push(e.make());return e.push(t),t}makeFill(e){const t=this.mainContainer.children.push(e.make());return e.push(t),t}_updateChildren(){this._strokeTemplate=void 0,this._fillTemplate=void 0;let e=this.get("xAxis"),t=this.get("yAxis");if(this.isDirty("stroke")){const s=this.get("stroke");this.strokes.template.set("stroke",s);const r=this._legendStroke;r&&r.states.lookup("default").set("stroke",s)}if(this.isDirty("fill")){const s=this.get("fill");this.fills.template.set("fill",s);const r=this._legendFill;r&&r.states.lookup("default").set("fill",s)}if(this.isDirty("curveFactory")){const s=this.get("curveFactory");s&&(this._strokeGenerator.curve(s),this._fillGenerator.curve(s))}if(e.inited&&t.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty("vcx")||this.isDirty("vcy")||this._sizeDirty||this.isDirty("connect")||this.isDirty("curveFactory")){this.fills.each(h=>{h.setPrivate("visible",!1)}),this.strokes.each(h=>{h.setPrivate("visible",!1)}),this.axisRanges.each(h=>{let d=h.fills;d&&d.each(p=>{p.setPrivate("visible",!1)});let c=h.strokes;c&&c.each(p=>{p.setPrivate("visible",!1)})});let s=this.startIndex(),r=this.strokes.template.get("templateField"),o=this.fills.template.get("templateField"),n=!0,a=!0;r&&(n=!1),o&&(a=!1);for(let h=s-1;h>=0;h--){let d=this.dataItems[h],c=!0,p=d.dataContext;if(r&&p[r]&&(n=!0),o&&p[o]&&(a=!0),G(this._valueFields,y=>{B(d.get(y))||(c=!1)}),c&&n&&a){s=h;break}}let l=this.dataItems.length,u=this.endIndex();if(u<l){u++;for(let h=u;h<l;h++){let d=this.dataItems[h],c=!0;if(G(this._valueFields,p=>{B(d.get(p))||(c=!1)}),c){u=h+1;break}}}if(s>0&&s--,this._endIndex=u,this._clearGraphics(),this._sindex=0,this._dindex=s,this.dataItems.length==1)this._startSegment(0);else for(;this._dindex<u-1;)this._startSegment(this._dindex),this._sindex++}}else this._skipped=!0;super._updateChildren()}_clearGraphics(){this.strokes.clear(),this.fills.clear()}_startSegment(e){let t=this._endIndex,s=t;const r=this.get("autoGapCount"),o=this.get("connect"),n=this.makeFill(this.fills),a=this._fillTemplate,l=this.fills.template;a&&a!=l&&(n.template=a),n.setPrivate("visible",!0);const u=this.makeStroke(this.strokes),h=this._strokeTemplate;h&&h!=this.strokes.template&&(u.template=h),u.setPrivate("visible",!0);let d=this.get("xAxis"),c=this.get("yAxis"),p=this.get("baseAxis"),y=this.get("vcx",1),f=this.get("vcy",1),w=this._xField,_=this._yField,P=this._xOpenField,T=this._yOpenField;const D=this.get("openValueXField"),M=this.get("openValueYField");D||(P=this._xField),M||(T=this._yField);const O=this.get("stacked"),N=d.basePosition(),z=c.basePosition();let Y;p===c?Y=this._yField:Y=this._xField;const W=[];let $=[];W.push($);const ee=this.strokes.template.get("templateField"),re=this.fills.template.get("templateField");let me=this.get("locationX",.5),he=this.get("locationY",.5),ce=this.get("openLocationX",me),ne=this.get("openLocationY",he);const oe=this.get("minDistance",0);let Q,pe=this.fills.template.get("visible");this.axisRanges.length>0&&(pe=!0);let _e=!1;(O||D||M)&&(_e=!0);const ve={points:$,segments:W,stacked:O,getOpen:_e,basePosX:N,basePosY:z,fillVisible:pe,xField:w,yField:_,xOpenField:P,yOpenField:T,vcx:y,vcy:f,baseAxis:p,xAxis:d,yAxis:c,locationX:me,locationY:he,openLocationX:ce,openLocationY:ne,minDistance:oe};for(Q=e;Q<s;Q++){this._dindex=Q;const we=this._dataItems[Q];let Ze=we.get(w),Ie=we.get(_);if(Ze==null||Ie==null?o||($=[],W.push($),ve.points=$):this._getPoints(we,ve),ee){let De=we.dataContext[ee];if(De)if(De instanceof Wt||(De=Wt.new(De)),this._strokeTemplate=De,Q>e){s=Q;break}else u.template=De}if(re){let De=we.dataContext[re];if(De)if(De instanceof Wt||(De=Wt.new(De)),this._fillTemplate=De,Q>e){s=Q;break}else n.template=De}if(!o){let De=this.dataItems[Q+1];De&&p.shouldGap(we,De,r,Y)&&($=[],W.push($),ve.points=$)}}n.setRaw("userData",[e,Q]),u.setRaw("userData",[e,Q]),Q===t&&this._endLine($,W[0][0]),u&&this._drawStroke(u,W),n&&this._drawFill(n,W),this.axisRanges.each(we=>{const Ze=we.container,Ie=we.fills,De=this.makeFill(Ie);Ze&&Ze.children.push(De),De.setPrivate("visible",!0),this._drawFill(De,W);const rt=we.strokes,bt=this.makeStroke(rt);Ze&&Ze.children.push(bt),bt.setPrivate("visible",!0),this._drawStroke(bt,W),De.setRaw("userData",[e,Q]),bt.setRaw("userData",[e,Q])})}_getPoints(e,t){let s=t.points,r=e.get("locationX",t.locationX),o=e.get("locationY",t.locationY),n=t.xAxis.getDataItemPositionX(e,t.xField,r,t.vcx),a=t.yAxis.getDataItemPositionY(e,t.yField,o,t.vcy);if(this._shouldInclude(n)){const l=this.getPoint(n,a),u=[l.x,l.y];if(l.x+=this._x,l.y+=this._y,e.set("point",l),t.fillVisible){let h=n,d=a;if(t.baseAxis===t.xAxis?d=t.basePosY:t.baseAxis===t.yAxis&&(h=t.basePosX),t.getOpen){let p=e.get(t.xOpenField),y=e.get(t.yOpenField);if(p!=null&&y!=null){let f=e.get("openLocationX",t.openLocationX),w=e.get("openLocationY",t.openLocationY);if(t.stacked){let _=e.get("stackToItemX"),P=e.get("stackToItemY");_?(h=t.xAxis.getDataItemPositionX(_,t.xField,f,_.component.get("vcx")),bs(h)&&(h=t.basePosX)):t.yAxis===t.baseAxis?h=t.basePosX:h=t.xAxis.getDataItemPositionX(e,t.xOpenField,f,t.vcx),P?(d=t.yAxis.getDataItemPositionY(P,t.yField,w,P.component.get("vcy")),bs(d)&&(d=t.basePosY)):t.xAxis===t.baseAxis?d=t.basePosY:d=t.yAxis.getDataItemPositionY(e,t.yOpenField,w,t.vcy)}else h=t.xAxis.getDataItemPositionX(e,t.xOpenField,f,t.vcx),d=t.yAxis.getDataItemPositionY(e,t.yOpenField,w,t.vcy)}}let c=this.getPoint(h,d);u[2]=c.x,u[3]=c.y}if(t.minDistance>0){const h=u[0],d=u[1],c=u[2],p=u[3],y=this._previousPoint,f=y[0],w=y[1],_=y[2],P=y[3];(Math.hypot(h-f,d-w)>t.minDistance||c&&p&&Math.hypot(c-_,p-P)>t.minDistance)&&(s.push(u),this._previousPoint=u)}else s.push(u)}}_endLine(e,t){}_drawStroke(e,t){e.get("visible")&&e.set("draw",s=>{G(t,r=>{this._strokeGenerator.context(s),this._strokeGenerator(r)})})}_drawFill(e,t){e.get("visible")&&e.set("draw",s=>{G(t,r=>{this._fillGenerator.context(s),this._fillGenerator(r)})})}_processAxisRange(e){super._processAxisRange(e),e.fills=new As(Wt.new({}),()=>it._new(this._root,{themeTags:Ct(e.fills.template.get("themeTags",[]),["line","series","fill"])},[this.fills.template,e.fills.template])),e.strokes=new As(Wt.new({}),()=>it._new(this._root,{themeTags:Ct(e.strokes.template.get("themeTags",[]),["line","series","stroke"])},[this.strokes.template,e.strokes.template]))}createLegendMarker(e){const t=this.get("legendDataItem");if(t){const s=t.get("marker"),r=t.get("markerRectangle");r&&r.setPrivate("visible",!1),s.set("background",Hi.new(s._root,{fillOpacity:0,fill:mt(0)}));const o=s.children.push(it._new(s._root,{themeTags:["line","series","legend","marker","stroke"],interactive:!1},[this.strokes.template]));this._legendStroke=o;const n=s.children.push(it._new(s._root,{themeTags:["line","series","legend","marker","fill"]},[this.fills.template]));this._legendFill=n;const a=this._root.interfaceColors.get("disabled");if(o.states.create("disabled",{fill:a,stroke:a}),n.states.create("disabled",{fill:a,stroke:a}),this.bullets.length>0){const l=this.bullets.getIndex(0);if(l){const u=l(s._root,this,new Ks(this,{},{}));if(u){const h=u.get("sprite");h instanceof it&&h.states.create("disabled",{fill:a,stroke:a}),h&&(h.set("tooltipText",void 0),h.set("tooltipHTML",void 0),s.children.push(h),h.setAll({x:s.width()/2,y:s.height()/2}))}}}}}}Object.defineProperty(Mh,"className",{enumerable:!0,configurable:!0,writable:!0,value:"LineSeries"});Object.defineProperty(Mh,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:_o.classNames.concat([Mh.className])});const x0={primary:{gradientStart:"#8b56f5",gradientEnd:"#4930f3",stroke:"#8c6aff",tooltipShadow:"#4e0acc",tooltipStroke:"#d8d0ff"},green:{gradientStart:"#10b981",gradientEnd:"#059669",stroke:"#10b981",tooltipShadow:"#02523a",tooltipStroke:"#bee8d7"},blue:{gradientStart:"#3b82f6",gradientEnd:"#2563eb",stroke:"#3b82f6",tooltipShadow:"#1e40af",tooltipStroke:"#dbeafe"}},R0=.99,D0=.59;class P0{config;_context;_shift;_line;_x;_y;_point;constructor(e,t){this._context=e,this.config=t,this._shift=.5}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=NaN,this._y=NaN,this._point=0}lineEnd(){this._shift>0&&this._shift<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._shift=1-this._shift,this._line=1-this._line)}point(e,t){const s=Number(e),r=Number(t);switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(s,r):this._context.moveTo(s,r);break;default:{if(this._point===1&&(this._point=2),this._shift<=0)this._context.lineTo(this._x,r),this._context.lineTo(s,r);else{const o=this._x*(1-this._shift)+s*this._shift,n=(s-this._x)*(this.config.distance/2),a=this.config.roundness,l=[[o-n,this._y],[o+n,r]],u=l[1][0]-l[0][0],h=[[l[0][0]+u*a,l[0][1]],[l[1][0]-u*a,l[1][1]]];this._context.lineTo(l[0][0],l[0][1]),this._context.bezierCurveTo(h[0][0],h[0][1],h[1][0],h[1][1],l[1][0],l[1][1])}break}}this._x=s,this._y=r}}function T0(i){return new P0(i,{distance:R0,roundness:D0})}function xs({data:i,chartType:e,seriesKey:t,tooltipSeriesName:s,isCurrency:r,colorSetKey:o,rootPaddingTop:n,xType:a,xKey:l,xName:u,xHistogram:h}){const d=x0[o||"primary"],c=S.useMemo(()=>Du(!0,s),[s]),p=S.useMemo(()=>Du(!1,s),[s]),y=S.useMemo(()=>Du(!0,s,!0),[s]),f=S.useMemo(()=>Du(!1,s,!0),[s]),w=S.useMemo(()=>A0(s,u),[s]),_=S.useRef(`chart-${Math.round(Math.random()*1e8)}`).current,P=S.useRef(null),T=S.useRef(null),D=S.useRef(null),M=S.useRef(null),O=S.useRef(null),N=S.useRef(null),z=S.useMemo(()=>{const W=kg(i);for(const $ in W)delete W[$].__typename,r&&(W[$][t||"gifts"]/=100);return W},[i]),Y=S.useMemo(()=>{const W=kg(z);for(const $ in W)W[$].date&&(W[$].date=to(W[$].date).getTime());return W},[z]);return S.useLayoutEffect(()=>{mR("AM5C376425987");const W=wd.new(_,{tooltipContainerBounds:{top:32,bottom:32,left:0,right:0}}),$=Cd.new(W);$.rule("Label").setAll({fontSize:"13px",fontFamily:"Goody Sans Web",fill:mt(5592405)}),W.setThemes([b0.new(W),$]),r&&W.numberFormatter.setAll({numberFormat:"$#,###.00"});const ee=W.container.children.push(xh.new(W,{panX:!1,panY:!1,paddingTop:qi(n)?64:n,paddingBottom:32}));P.current=ee;let re=null;a==="category"?re=Ro.new(W,{categoryField:l||"bucket",renderer:bl.new(W,{}),tooltip:zs.new(W,{})}):re=Dh.new(W,{baseInterval:{timeUnit:"day",count:1},renderer:bl.new(W,{}),tooltip:zs.new(W,{}),groupData:!0,groupCount:60,tooltipLocation:.5}),N.current=re;const me=ee.xAxes.push(re);a==="category"&&me.data.setAll(Y),M.current=me;const he=me.get("renderer");he.grid.template.set("visible",!1),he.grid.template.setAll({location:.5}),he.labels.template.setAll({location:.5,multiLocation:a==="category"?.5:.15}),a==="category"&&h&&(he.set("minGridDistance",10),he.labels.template.setAll({fontSize:"16px"}));const ce=ee.yAxes.push(In.new(W,{renderer:Ah.new(W,{}),min:0,maxPrecision:0}));ce.get("renderer").grid.template.set("stroke",mt("#aaaaaa"));const oe=zs.new(W,{labelHTML:p,getFillFromSprite:!1,pointerOrientation:e==="bar"?"down":"horizontal",autoTextColor:!1,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0});oe.label.setAll({fill:mt(8026746)}),oe.get("background")?.setAll({cornerRadius:8,fill:mt("#ffffff"),fillOpacity:1,shadowColor:mt(d.tooltipShadow),shadowBlur:16,shadowOffsetY:4,shadowOpacity:.1,stroke:mt(d.tooltipStroke),strokeWidth:1}),O.current=oe;let Q=null,pe=null;e==="bar"?Q=ee.series.push(Fh.new(W,{name:"Gifts",xAxis:me,yAxis:ce,valueYField:t||"gifts",valueXField:a==="category"?void 0:"date",categoryXField:a==="category"?l||"bucket":void 0,valueYGrouped:"sum",tooltip:oe})):e==="line"&&(pe=ee.series.push(Mh.new(W,{name:"Gifts",xAxis:me,yAxis:ce,valueYField:t||"gifts",valueXField:a==="category"?void 0:"date",categoryXField:a==="category"?l||"bucket":void 0,valueYGrouped:"sum",tooltip:oe,curveFactory:T0})));const _e=Q||pe;if(!_e)return;_e.events.on("datavalidated",()=>{ee.zoomOut()}),T.current=_e,Q&&(Q.columns.template.setAll({cornerRadiusTL:4,cornerRadiusTR:4}),Q.columns.template.set("fillGradient",gl.new(W,{stops:[{color:mt(d.gradientStart)},{color:mt(d.gradientEnd)}],rotation:90,target:ee.plotContainer})),Q.columns.template.set("opacity",.7),Q.columns.template.set("interactive",!0),Q.columns.template.states.create("default",{opacity:.7}),Q.columns.template.states.create("hover",{opacity:1}),Q.set("stroke",mt(d.stroke)),Q.set("fill",mt("#ffffff"))),pe&&(pe.set("stroke",mt(d.stroke)),pe.set("fill",mt(d.stroke)),pe.strokes.template.setAll({strokeWidth:2}),pe.fills.template.setAll({fillOpacity:1,visible:!0}),pe.fills.template.set("fillGradient",gl.new(W,{stops:[{opacity:.15},{opacity:.05},{opacity:0}]}))),_e.data.setAll(Y);const ve=ee.set("cursor",Rh.new(W,{behavior:"zoomX"}));ve.lineY.set("visible",!1),e==="bar"?ve.lineX.set("visible",!1):e==="line"&&ve.lineX.setAll({stroke:mt("#aaa"),strokeDasharray:void 0});const we=zs.new(W,{autoTextColor:!1});we?.label.setAll({fill:mt(7829367),paddingLeft:6,paddingRight:6,paddingBottom:1,fontWeight:"500",fontSize:"16px"}),we?.get("background")?.setAll({cornerRadius:100,fill:mt("#ffffff"),fillOpacity:1,shadowColor:mt(0),shadowBlur:16,shadowOffsetY:4,shadowOpacity:.075,stroke:mt(15329769),strokeWidth:1}),me.set("tooltip",void 0);const Ze=_h.new(W,{menu:Eh.new(W,{}),dataSource:z,pdfOptions:{addURL:!1,pageOrientation:"landscape"}});if(D.current=Ze,Ze.get("menu")?.set("items",F0),e==="line"){const Ie=ee.plotContainer.children.push(Sh.new(W,{radius:6,fill:_e.get("fill"),x:-1e3,stroke:mt("#ffffff"),strokeWidth:2}));_e.on("tooltipDataItem",function(De){let rt=-1e3,bt=-1e3;if(De){const Et=De.get("point");Et&&(rt=Et.x,bt=Et.y)}Ie.setAll({x:rt,y:bt})}),oe.on("opacity",function(De){Ie.set("opacity",De)})}return _e.appear(1e3),ee.appear(1e3,100),()=>{W.dispose()}},[]),S.useEffect(()=>{if(Y&&T.current){if(T.current.data.setAll(Y),a==="category")M.current?.data?.setAll(Y),O.current&&O.current.set("labelHTML",w);else if(Y.at(0)&&Y.at(0).date&&Y.at(-1)&&Y.at(-1).date){const W=new Date().getFullYear();new Date(Y.at(0).date).getFullYear()!==W||new Date(Y.at(-1).date).getFullYear()!==W?(M.current&&(M.current.get("tooltipDateFormats").day="EEE, MMM d, yyyy",M.current.get("tooltipDateFormats").week="'Week of 'MMM d, yyyy"),setTimeout(()=>{if(O.current){let $=!1;N.current&&($=N.current.getPrivate("groupInterval").timeUnit==="week"),O.current.set("labelHTML",$?y:c)}},1e3)):M.current&&(M.current.get("tooltipDateFormats").day="EEE, MMM d",M.current.get("tooltipDateFormats").week="'Week of 'MMM d",setTimeout(()=>{if(O.current){let $=!1;N.current&&($=N.current.getPrivate("groupInterval").timeUnit==="week"),O.current.set("labelHTML",$?f:p)}},1e3))}}},[Y]),S.useEffect(()=>{z&&D.current?.set("dataSource",z)},[z]),C.jsx(M0,{id:_,className:`colorset-${o}`})}function Du(i,e,t){return`<div class="tooltip-container"><div class="tooltip-x">${t?"Week of ":""}{valueX.formatDate("${i?"EEE, MMM dd, yyyy":"EEE, MMM dd"}")}</div><div class="tooltip-series"><span class="tooltip-font-md">{valueY}</span> ${e}</span></div></div>`}function A0(i,e){return`<div class="tooltip-container"><div class="tooltip-x">{categoryX} ${e}</div><div class="tooltip-series"><span class="tooltip-font-md">{valueY}</span> ${i}</span></div></div>`}const F0=[{type:"separator",label:"Export image"},{type:"format",format:"png",label:"PNG"},{type:"format",format:"jpg",label:"JPEG"},{type:"format",format:"pdf",label:"PDF"},{type:"separator",label:"Export data"},{type:"format",format:"csv",label:"CSV"},{type:"format",format:"xlsx",label:"XLSX"}],M0=st.div`
height: 400px;
font-variant-numeric: tabular-nums;
.am5exporting-menu path {
fill: var(--color-gray-500);
}
.am5exporting-icon:focus,
.am5exporting-icon:hover,
.am5exporting-menu-open .am5exporting-icon {
background-color: var(--color-gray-200);
}
.am5exporting.am5exporting-item.am5exporting-type-separator {
font-weight: 500;
border-top-width: 1px;
border-bottom-width: 0px;
a {
background-color: white;
&:hover {
background-color: white;
}
}
}
.am5exporting.am5exporting-item.am5exporting-type-separator:first-child {
font-weight: 500;
border-width: 0px;
}
.am5exporting.am5exporting-item.am5exporting-type-separator:last-child {
font-weight: 500;
border-width: 0px;
padding-top: 0.5rem;
}
.am5exporting.am5exporting-list {
background-color: white;
border-width: 1px;
border-color: var(--color-gray-100);
box-shadow:
0 1px 3px 0 rgb(0 0 0 / 0.1),
0 1px 2px -1px rgb(0 0 0 / 0.1);
border-radius: 0.5rem;
font-size: 0.875rem;
line-height: 1.25rem;
}
.am5exporting.am5exporting-item {
a {
padding-top: 0.375rem;
padding-bottom: 0.375rem;
&:hover {
background-color: var(--color-gray-150);
}
&:active {
background-color: var(--color-gray-200);
}
&:focus {
background-color: var(--color-gray-200);
}
}
}
.tooltip-container {
text-align: center;
padding-left: 0.5px;
padding-right: 0.5px;
padding-top: 0.5px;
padding-bottom: 0.5px;
.tooltip-x {
padding-left: 0.75rem;
padding-right: 0.75rem;
padding-top: 0.5rem;
padding-bottom: 0.5rem;
font-size: 0.875rem;
line-height: 1.25rem;
font-weight: 500;
color: var(--color-primary-new-500);
background-color: var(--color-primary-new-000);
border-top-left-radius: 9px;
border-top-right-radius: 9px;
}
.tooltip-series {
color: var(--color-primary-new-300);
font-size: 18px;
padding-left: 0.75rem;
padding-right: 0.75rem;
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}
.tooltip-font-md {
color: var(--color-primary-new-700);
font-weight: 500;
}
}
&.colorset-green {
.tooltip-container {
.tooltip-x {
color: rgb(5 150 105);
background-color: rgb(236 253 245);
}
.tooltip-series {
color: #54cba3;
}
.tooltip-font-md {
color: rgb(5 150 105);
}
}
}
&.colorset-blue {
.tooltip-container {
.tooltip-x {
color: rgb(37 99 235);
background-color: rgb(239 246 255);
}
.tooltip-series {
color: rgb(96 165 250);
}
.tooltip-font-md {
color: rgb(37 99 235);
}
}
}
.am5-html-container {
& > div {
pointer-events: none !important;
}
}
`;function L0({data:i,loading:e}){const t=It(i);return C.jsx(wt,{loading:e,dataPresent:!!t,children:C.jsx(xs,{data:t||[],chartType:"line",seriesKey:"cost",tooltipSeriesName:"total",isCurrency:!0,colorSetKey:"green"})})}function Pu({name:i,count:e,isActive:t,onClick:s,loading:r,isCurrency:o,colorSet:n}){const a=It(e),l=qi(a);return C.jsxs(I0,{$isActive:t,onClick:s,$colorSet:n,children:[C.jsx("div",{className:Ut("pb-2 text-gray-500 font-medium text-lg transition-colors",t&&"text-primary-new-550",t&&n==="green"&&"text-emerald-600",t&&n==="blue"&&"text-blue-500"),children:i}),C.jsx("div",{className:Ut("text-3xl font-medium transition-all",l&&"text-gray-500",t&&"text-primary-new-550",t&&n==="green"&&"text-emerald-600",t&&n==="blue"&&"text-blue-500",r&&"opacity-50"),children:l?"—":o?zu(a,!0):a})]})}const I0=Dt.button`
p-8 text-left flex-1 border border-gray-150 -ml-px hover:bg-gray-050 active:bg-gray-075 transition-colors
first:rounded-tl-xl
last:rounded-tr-xl
${i=>i.$isActive&&"bg-primary-new-000 hover:bg-primary-new-000 active:bg-primary-new-000 border-primary-new-150 z-[8]"}
${i=>i.$isActive&&i.$colorSet==="green"&&"bg-emerald-050 hover:bg-emerald-050 active:bg-emerald-050 border-emerald-200"}
${i=>i.$isActive&&i.$colorSet==="blue"&&"bg-blue-050 hover:bg-blue-050 active:bg-blue-050 border-blue-200"}
`;function O0({data:i,loading:e}){const t=It(i);return C.jsx(wt,{loading:e,dataPresent:!!t,children:C.jsx(xs,{data:t||[],chartType:"bar",tooltipSeriesName:"gifts accepted",colorSetKey:"green"})})}function N0({data:i,loading:e}){const t=It(i);return C.jsx(wt,{loading:e,dataPresent:!!t,children:C.jsx(xs,{data:t||[],chartType:"bar",tooltipSeriesName:"gifts sent"})})}function k0({data:i,loading:e}){const t=It(i);return C.jsx(wt,{loading:e,dataPresent:!!t,children:C.jsx(xs,{data:t||[],chartType:"bar",seriesKey:"meetingsScheduled",tooltipSeriesName:"meetings",colorSetKey:"blue"})})}const Lf=["gifts_sent","gifts_accepted","meetings_scheduled","accepted_gifts_cost"];function G0(){const[i,e]=S.useState("gifts_sent"),{getGraphqlVariables:t,useRequestChartData:s}=S.useContext(je),[r,{data:o,loading:n}]=Jt(V0,{variables:{params:t()}});return s(()=>{r({variables:{params:t()}})}),C.jsx("div",{children:C.jsxs(_s,{children:[C.jsxs("div",{className:"flex flex-row items-stretch -mt-px -mr-px",children:[C.jsx(Pu,{name:"Gifts sent",count:o?.reportChart?.giftsSent?.totalCount,isActive:i==="gifts_sent",onClick:()=>e("gifts_sent"),loading:n}),C.jsx(Pu,{name:"Gifts accepted",count:o?.reportChart?.giftsAccepted?.totalCount,isActive:i==="gifts_accepted",onClick:()=>e("gifts_accepted"),loading:n,colorSet:"green"}),C.jsx(Pu,{name:"Meetings",count:o?.reportChart?.meetingsScheduled?.totalCount,isActive:i==="meetings_scheduled",onClick:()=>e("meetings_scheduled"),loading:n,colorSet:"blue"}),C.jsx(Pu,{name:"Accepted gifts",count:o?.reportChart?.acceptedGiftsCost?.totalCost,isActive:i==="accepted_gifts_cost",onClick:()=>e("accepted_gifts_cost"),loading:n,isCurrency:!0,colorSet:"green"})]}),C.jsxs("div",{className:"h-[400px] relative overflow-hidden",children:[C.jsx(Au,{$positionRelativeToCurrent:Tu("gifts_sent",i),children:C.jsx(N0,{data:o?.reportChart?.giftsSent?.data,loading:n})}),C.jsx(Au,{$positionRelativeToCurrent:Tu("gifts_accepted",i),children:C.jsx(O0,{data:o?.reportChart?.giftsAccepted?.data,loading:n})}),C.jsx(Au,{$positionRelativeToCurrent:Tu("meetings_scheduled",i),children:C.jsx(k0,{data:o?.reportChart?.meetingsScheduled?.data,loading:n})}),C.jsx(Au,{$positionRelativeToCurrent:Tu("accepted_gifts_cost",i),children:C.jsx(L0,{data:o?.reportChart?.acceptedGiftsCost?.data,loading:n})})]})]})})}function Tu(i,e){const t=Lf.indexOf(i),s=Lf.indexOf(e);return t===s?"isCurrent":t<s?"left":"right"}const Au=Dt.div`
absolute h-[400px] w-full top-0 left-0 transition-all duration-300
${({$positionRelativeToCurrent:i})=>i==="left"?"-translate-x-16":i==="right"?"translate-x-16":"translate-x-0"}
${({$positionRelativeToCurrent:i})=>i!=="isCurrent"&&"opacity-0 pointer-events-none"}
`,V0=zt`
query ReportCharts_Omnichart($params: ReportParamsInput!) {
reportChart(params: $params) {
giftsSent {
totalCount
data {
date
gifts
}
}
giftsAccepted {
totalCount
data {
date
gifts
}
}
meetingsScheduled {
totalCount
data {
date
meetingsScheduled
}
}
acceptedGiftsCost {
totalCost
totalGifts
data {
date
gifts
cost
}
}
}
}
`,If=["note-blue","note-yellow","note-red","note-green"];function H0({note:i,index:e}){return C.jsxs("div",{className:"relative swiper-no-swiping",children:[C.jsxs(Nf,{className:If[e%4],children:[C.jsx(Of,{children:C.jsx(eo,{children:em(i.message)})}),C.jsxs(nn,{children:[C.jsxs("div",{children:[C.jsx("span",{className:"font-medium",children:i.recipientName})," ·"," ",i.recipientEmail]}),C.jsxs("div",{children:["Sent by ",i.senderName," in ",i.workspaceName]})]})]}),C.jsxs(Nf,{className:Ut(If[e%4],"hover-clone"),children:[C.jsx(Of,{className:"no-clamp",children:C.jsx(eo,{children:i.message})}),C.jsxs(nn,{children:[C.jsxs("div",{children:[C.jsx("span",{className:"font-medium",children:i.recipientName})," ·"," ",i.recipientEmail]}),C.jsxs("div",{children:["Sent by ",i.senderName," in ",i.workspaceName]})]})]})]})}const eo=st.div.attrs({className:"text-2xl"})`
display: -webkit-box;
-webkit-line-clamp: 6;
-webkit-box-orient: vertical;
line-clamp: 6;
text-overflow: ellipsis;
word-break: break-word;
overflow: hidden;
`,Of=st.div`
&.no-clamp {
${eo} {
-webkit-line-clamp: initial;
line-clamp: initial;
text-overflow: initial;
}
}
`,nn=st.div.attrs(Po("pt-9 text-sm"))``,Nf=st.div.attrs(Po("text-left rounded-lg bg-gray-100 p-8 transition-colors w-full cursor-default"))`
&.note-blue {
background-color: #f2f8fc;
&:hover {
background-color: #ebf5fb;
}
${eo} {
color: #0284c7;
}
${nn} {
color: #329bd2;
}
}
&.note-yellow {
background-color: #fefbf2;
&:hover,
&:hover + &.hover-clone {
background-color: #fdf9ec;
}
${eo} {
color: #ca8a04;
}
${nn} {
color: #d4a134;
}
}
&.note-red {
background-color: #fef9f7;
&:hover,
&:hover + &.hover-clone {
background-color: #fef5f2;
}
${eo} {
color: #f07a4a;
}
${nn} {
color: #f3936c;
}
}
&.note-green {
background-color: #f4fcf8;
&:hover,
&:hover + &.hover-clone {
background-color: #effbf5;
}
${eo} {
color: #4ca579;
}
${nn} {
color: #6eb692;
}
}
&:hover + &.hover-clone {
opacity: 1;
pointer-events: auto;
}
&.hover-clone:hover {
opacity: 1;
pointer-events: auto;
}
&.hover-clone {
position: absolute;
top: 0;
right: 0;
left: 0;
width: 100%;
z-index: 1000;
opacity: 0;
transition-property: all;
pointer-events: none;
}
`,Ry="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAABXFBMVEUAAAD////////x8fHy8vLy8vLn8/Pp6fTq6vTr6/Xr6/Xs7Pbt7e3p8PDq8fHr6/Lr6/Lr7/Ls7/Lt7fDt7fDt7fDr7vHu7vPu7vPs7vDs7vHs7vHs7vHs7/Hs7/Hs7vLs7vLs7vLs7vLs7vLs7/Hu7/Hs7/Hu7/Hs7/Hs7vHs7vHu7/Lu7/Lt7/Lt8PLt8PLt7/Lt7/Lt8PLt7vLt8PLt7/Lt7/Ls7/Lt7/Lt7vLt8PLt7/Lt7/Lx8vTx8vTs7vHt7vHx8vXs7vHt7vHt7/Ht7/Lu7/Lw8vXx8vXy9Pbs7vHt7/Ht7/Pu7/Pw8/Xz9Pbs7vLt7/Ls7vLs7/L09ff09vf19vf09vf19vft7vHs7vH3+Pn3+Pn29/mco6+hp7Ossbyts72wtb+xtsCzucL19vf29vf29/j39/j5+vv6+vv7+/z7/Pz8/P38/f39/f39/f7+/v7+///////Ydf3TAAAAXnRSTlMABQYSExQVFxgZGhscIyUmJ05RVFVXWGZnaWprbG1udnd4eXp8kpOTlJaXw8TFxsfU1dfY2Nna2+bn5+jp8fLz8/P09PT09PT09PX19fX19fb29/j4+Pj5+fv8/P3+7xiPHgAAAAFiS0dEc0EJPc4AAAHxSURBVEjHlVZrV9NAFJxSCkXk1WK1FhB5VFLR8rCAaDAQoW2qUlpQDE0VFTWhTVvv/z/HDyiQZJPszsfdmZN7N7szF3AjnpLy25qua9vPpXuDCEFs5kVtx7DaPaJe2zTk+tp0fwB9OFctW+SAdViVhn3ofQvaaZc86J5q8xEWf3yz1CEm7NLGqJefVBvki4aScPMz+y0KQKvy0MmfOuhQIOz3aUc9+zaFwD66VdW42qJQtJTrzvs2G8SBRuH/6S7sEheKj6/4d7UOn8BWhwAAuY/EiU9PACBW7fIKuloUwEyZuFHOAChYjJ1f336wBNYqEK+x+OfN78xP1AaQkr3Lv8+bX38yBfIkcoYAn4wl5C0BPpnLeG0L8Kn9ElpPgE+9N9BdS1+aDrhO989ncQGrpIugkl6xmr4IaDpvkoDCfAqJ/eN8FEYWqR0SUMhJDApdvnoMWBO53isApg8FH1C/6BOFxG0Cx4sAgDuqzWsz8StjmivxCT7M/nO+yAaXVZ6tXwfRmMJhxpfKyI19Jyocdj9xOyDSByEK+919ZwSl3wZWdVl54A65hBLQ+Zky4Y3R0ULRpyy7uD7CCurIrHrCCvZj9VHEZxYYWvKODuXqYjxg2ohOrdZlw7wZTlYy0bCBZmAy+2xrT9f3tpazyZhn+y+Fjgr1s6qgSAAAAABJRU5ErkJggg==",Dy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAABX1BMVEUAAAD////////x8fHy8vLy8vLn8/Pp6fTq6vTr6/Xr6/Xs7Pbt7e3p8PDq8fHr6/Lr6/Lr7/Ls7/Lt7fDt7fDt7fDr7vHu7vPu7vPs7vDs7vHs7vHs7vHs7/Hs7/Hs7vLs7vLs7vLs7vLs7vLs7/Hu7/Hs7/Hu7/Hs7/Hs7vHs7vHt7vLu7/Lu7/Lt7/Lt8PLt8PLt7/Lt7/Lt8PLt7vLt8PLt7/Lt7/Ls7/Lt7/Lt7vLt8PLt7/Lt7/Lx8vTx8vTs7vHt7vHx8vXs7vHt7vHt7/Ht7/Lu7/Lw8vXx8vXy9Pbs7vHt7/Ht7/Pu7/Pw8/Xz9Pbs7vLt7/Ls7vLs7/L09ff09vf19vf09vf19vft7vHs7vH3+Pn3+Pn29/mco6+gqLOssbyts72wtb+xtsCzucL19vf29vf29/j39/j5+vv6+vv7+/z7/Pz8/P38/f39/f39/f7+/v7+//////9voVPuAAAAX3RSTlMABQYSExQVFxgZGhscIyUmJ05RVFVXWGZnaWprbG1udnd4eXp8kpOTlJaXmMPExcbH1NXX2NjZ2tvm5+fo6fHy8/Pz9PT09PT09PT19fX19fX29vf4+Pj4+fn7/Pz9/qXehwMAAAABYktHRHTfbahtAAAB6UlEQVRIx5VWZ1fCQBA8RAQbKiiK2AsaKzbs0WhEIFgQrJFgL4kQwP3/TxRbyCW5m4+5mby9e7szi1A1XD4mtC6IorA+y3Q4kQUcfUupLUnJlwBKeVli0wu9tSb0pslkXAENlOMk02BArxkRLougQ/FSGLbh+K0rsQJgUYgtt+j5Xj4Dhshwnmp+IJIDE+QS3Vp+z34BTKEe+jX1RFSwgHryr6pWPgeWyHHu3/dcyQABMuGf1x3ZASJEByv8Rr5AJlD5+i/BxDkQ4mLsq9+SRVJBUbCXBX1xIEY8UBaEFdzR4/0L5qsyX56XFPZfD9k7nCJVh3wsVvB6l7190n9m29GEBBQKaRyFFKBQyNNo07DtcIr8GhJKQKEobSOx+j2zGtxoT9+v6AUWJT3rStpQKfiflw7JFHyQpxAjUfBBCiLfFgUfWC9yUjVf2oHQAk17z5XnofeYcoBqaUcUMcQmcDpasRlBJbUZV8WYhmJkgqOBb+ezLRNZ5fXibxC5OQIzfuOa/+zbkyCw+7b/AeHft1CoB53aCPLvmVb1luiqDjkPZ3Lza65NH6PucNSgLDW62IwLatsAf4YL9lO+32awC9SP61eHeHLUZbJt2Hvm06wk/y0ncwG71UJT1x6cWd0Vxd3V6aDXoTv+AKMBEfN40Hb1AAAAAElFTkSuQmCC";function B0({results:i,loadedItems:e,loadNextPage:t}){const[s,r]=S.useState(1),o=S.useRef(null),{selectedFilters:n,selectedDateRange:a}=S.useContext(je);S.useEffect(()=>{o.current?.slideTo(0)},[n,a]);const l=Math.min(s+2,i.totalCount);return C.jsxs(C.Fragment,{children:[C.jsx(W0,{children:C.jsxs(tm,{onInit:u=>{o.current=u},slidesPerView:3.7,slidesPerGroup:3,allowTouchMove:!1,simulateTouch:!1,spaceBetween:24,className:"thank-you-notes-swiper",navigation:!0,modules:[Kf,Xf,qf],mousewheel:{forceToAxis:!0},centeredSlides:!0,centeredSlidesBounds:!0,onActiveIndexChange:u=>{const h=u.activeIndex===1?1:u.activeIndex;r(h),e-h<=6&&t()},children:[i.data.map((u,h)=>C.jsx(Yu,{children:C.jsx(H0,{note:u,index:h})},u.id)),i.data.length%3===0?C.jsx(Yu,{}):null]})}),C.jsx("div",{className:"flex flex-row justify-center py-4",children:C.jsxs("div",{className:"border border-gray-100 py-1 px-4 rounded-full text-center text-gray-400",children:[l," of ",i?.totalCount]})})]})}const W0=st.div.attrs({className:"relative"})`
// Next 2 directives are required to allow the hovered notes to overflow the
// space reserved for the slider on the y axis, but not on the x axis.
overflow-x: clip;
.swiper {
overflow: visible;
}
.thank-you-notes-swiper {
width: 100%;
}
.swiper-button-prev,
.swiper-button-next {
transition: all 300ms;
top: 0;
margin-top: 0;
width: 140px;
height: 100%;
align-items: start;
&:after {
transition: all 150ms;
position: relative;
content: "";
width: 48px;
height: 48px;
top: 112px;
}
&:hover:after {
filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.07));
}
&:active:after {
opacity: 0.5;
}
&.swiper-button-disabled {
opacity: 0;
}
}
.swiper-button-prev {
left: 0;
background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, #ffffff 70%);
&:hover {
background: linear-gradient(
270deg,
rgba(255, 255, 255, 0) 0%,
#ffffff 90%
);
}
&:after {
background-image: url(${Ry});
}
}
.swiper-button-next {
right: 0;
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #ffffff 70%);
&:hover {
background: linear-gradient(
90deg,
rgba(255, 255, 255, 0) 0%,
#ffffff 90%
);
}
&:after {
background-image: url(${Dy});
}
}
#swiper-pagination-el {
margin: 1rem auto;
}
`;function j0(){const{getGraphqlVariables:i,useRequestChartData:e}=S.useContext(je),[t,{data:s,loading:r,fetchMore:o}]=Jt(U0,{fetchPolicy:"network-only"}),n=S.useRef(0);e(()=>{n.current=0,t({variables:{params:i(),offset:0}})});const a=async()=>{o({variables:{params:i(),offset:(n.current+1)*30}}),n.current+=1},l=s?.reportChart?.thankYouNotes,u=It(l),h=u?.data?.length||0;return C.jsxs("div",{className:"pt-10",children:[C.jsxs("div",{className:"pl-8 pb-4 text-xl font-medium",children:[C.jsx(wt,{loading:r,dataPresent:!!u,inline:!0,children:u?.totalCount})," ","thank you notes"]}),C.jsx(wt,{loading:r,dataPresent:!!u,children:u&&C.jsx(B0,{results:u,loadedItems:h,loadNextPage:a})})]})}const U0=zt`
query ReportCharts_ThankYouNotes($params: ReportParamsInput!, $offset: Int!) {
reportChart(params: $params) {
thankYouNotes {
totalCount
data(offset: $offset) {
id
message
recipientName
recipientEmail
senderName
workspaceName
giftBatchId
}
}
}
}
`;function z0({page:i,name:e,active:t,onClick:s}){return C.jsxs(Y0,{$active:t,onClick:s,children:[C.jsx("div",{children:e}),C.jsx("div",{className:"h-0 invisible font-medium",children:e})]})}const Y0=Dt.button`
flex flex-col items-center justify-center px-5 py-2.5 text-xl text-gray-450 transition-colors rounded-lg
hover:bg-gray-075 hover:text-gray-500
active:bg-gray-150
${i=>i.$active&&"font-medium text-primary-new-550 bg-primary-new-050 hover:bg-primary-new-050 hover:text-primary-new-550 active:bg-primary-new-050"};
`,kf={senders_gifts:"Senders + Gifts",products_brands:"Products + Brands",recipients:"Recipients",gift_data:"Gift Data"};function $0({page:i,setPage:e}){return C.jsx("div",{className:"mt-14 mb-12 relative flex flex-row items-center justify-center after:absolute after:top-1/2 after:h-px after:w-full after:left-0 after:right-0 after:bg-gray-200 after:z-[-10]",children:C.jsx("div",{className:"flex flex-row items-center justify-center px-5 bg-white gap-1",children:Object.keys(kf).map(t=>C.jsx(z0,{page:t,name:kf[t],active:i===t,onClick:()=>e(t)},t))})})}const K0=i=>S.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("rect",{opacity:.25,x:2,y:3,width:12,height:12,fill:"currentColor"}),S.createElement("path",{d:"M12 3H4C2.89543 3 2 3.89543 2 5V19C2 20.1046 2.89543 21 4 21H12C13.1046 21 14 20.1046 14 19V5C14 3.89543 13.1046 3 12 3Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("mask",{id:"mask0_266_8194",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:16,y:2,width:8,height:21},S.createElement("rect",{x:16,y:2,width:8,height:21,fill:"url(#paint0_linear_266_8194)"})),S.createElement("g",{mask:"url(#mask0_266_8194)"},S.createElement("rect",{opacity:.25,x:17,y:3,width:12,height:12,fill:"currentColor"}),S.createElement("path",{d:"M27 3H19C17.8954 3 17 3.89543 17 5V19C17 20.1046 17.8954 21 19 21H27C28.1046 21 29 20.1046 29 19V5C29 3.89543 28.1046 3 27 3Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),S.createElement("defs",null,S.createElement("linearGradient",{id:"paint0_linear_266_8194",x1:16,y1:12.5,x2:24,y2:12.5,gradientUnits:"userSpaceOnUse"},S.createElement("stop",null),S.createElement("stop",{offset:1,stopOpacity:0})))),X0=i=>S.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("path",{d:"M19 3H5C3.89543 3 3 3.89543 3 5V19C3 20.1046 3.89543 21 5 21H19C20.1046 21 21 20.1046 21 19V5C21 3.89543 20.1046 3 19 3Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M3 9H21",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M3 15H21",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M9 9V21",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M15 9V21",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}));function Gf({view:i,setView:e}){return C.jsxs("div",{className:"flex flex-row items-stretch gap-2 pt-1",children:[C.jsxs(Vf,{$active:i!=="table",onClick:()=>{i==="table"&&e("products")},children:[C.jsx(K0,{}),C.jsx("div",{children:"Photos"})]}),C.jsxs(Vf,{$active:i==="table",onClick:()=>e("table"),children:[C.jsx(X0,{}),C.jsx("div",{children:"Table"})]})]})}const Vf=Dt.button`
flex flex-row items-center gap-3 text-gray-450 font-medium pl-2.5 pr-3.5 py-2.5 transition-colors rounded-lg
[&_svg]:text-gray-350
hover:text-gray-500 hover:bg-gray-075
active:bg-gray-100
${i=>i.$active&&"[&_svg]:text-primary-new-400 hover:text-primary-new-500 active:bg-primary-new-000 text-primary-new-500 bg-primary-new-000"}
`;function q0({view:i,setView:e,segment:t}){const s=`${t}${t===Lu.swapped?" for":""}`;return i==="table"?C.jsxs("div",{className:"flex flex-row items-center justify-between gap-6",children:[C.jsx("div",{className:"flex-1",children:C.jsxs("div",{className:"text-[2rem] font-medium",children:["Top products ",s]})}),C.jsxs("div",{className:"flex-1 flex flex-row items-start justify-between",children:[C.jsxs("div",{className:"text-[2rem] font-medium",children:["Top brands ",s]}),C.jsx(Gf,{view:i,setView:e})]})]}):C.jsxs("div",{className:"flex flex-row items-start justify-between pb-10",children:[C.jsxs("div",{className:"text-[2rem] flex flex-row items-center justify-start gap-4",children:[C.jsxs(Hf,{active:i==="products",onClick:()=>e("products"),children:["Top products ",s]}),C.jsx("span",{className:"text-gray-500",children:"·"}),C.jsxs(Hf,{active:i==="brands",onClick:()=>e("brands"),children:["Top brands ",s]})]}),C.jsx(Gf,{view:i,setView:e})]})}const Hf=st.button.attrs(i=>({className:Ut("font-medium transition-colors hover:cursor-pointer",i.active?"text-gray-900 border-b-2 border-gray-200":"text-gray-400 hover:text-gray-500 active:text-gray-600")}))``;function Q0(i){return i?i.map(e=>({id:e.itemId,isProduct:!0,name:e.productName,brandName:e.brandName,url:tn("plus",`/browse/brands/${e.brandSlug}/${e.productSlug}`),giftCount:e.giftCount,giftPercent:e.giftPercent,imageUrl:e.imageUrl})):null}function Z0(i){return i?i.map(e=>({id:e.itemId,isProduct:!1,name:e.brandName,brandName:e.brandName,url:e.giftOptionSlug?tn("plus",`/browse/gift-option/${e.giftOptionSlug}`):"#",giftCount:e.giftCount,giftPercent:e.giftPercent,imageUrl:e.imageUrl})):null}const J0=i=>S.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("path",{d:"M10.9091 7.09091V11.4545C10.9091 11.7818 10.6909 12 10.3636 12H1.63636C1.30909 12 1.09091 11.7818 1.09091 11.4545V7.09091H5.45455V12H6.54545V7.09091H10.9091ZM5.45455 3.27273H0.545455C0.218182 3.27273 0 3.49091 0 3.81818V5.45455C0 5.78182 0.218182 6 0.545455 6H5.45455V3.27273ZM11.4545 3.27273H6.54545V6H11.4545C11.7818 6 12 5.78182 12 5.45455V3.81818C12 3.49091 11.7818 3.27273 11.4545 3.27273ZM9.87273 2.67273L9.92727 2.45455C10.1455 1.90909 10.0909 1.25455 9.76364 0.763636C9.43636 0.272727 8.83636 0 8.23636 0C7.47273 0 6.81818 0.436364 6.54545 1.14545L5.45455 3.81818H8.18182C8.89091 3.81818 9.6 3.38182 9.87273 2.67273ZM7.58182 1.52727C7.69091 1.25455 7.96364 1.09091 8.23636 1.09091C8.45455 1.09091 8.67273 1.2 8.83636 1.41818C8.94546 1.63636 9 1.85455 8.89091 2.07273L8.83636 2.29091C8.72727 2.56364 8.45455 2.72727 8.18182 2.72727H7.09091L7.58182 1.52727ZM5.45455 1.14545C5.18182 0.436364 4.47273 0 3.76364 0C3.16364 0 2.56364 0.272727 2.23636 0.818182C1.90909 1.30909 1.85455 1.90909 2.07273 2.50909L2.12727 2.72727C2.4 3.38182 3.10909 3.81818 3.81818 3.81818H6.49091L5.45455 1.14545ZM4.41818 1.52727L4.90909 2.72727H3.81818C3.54545 2.72727 3.27273 2.56364 3.16364 2.29091L3.05455 2.07273C3 1.85455 3 1.58182 3.16364 1.41818C3.27273 1.2 3.49091 1.09091 3.76364 1.09091C4.03636 1.09091 4.30909 1.25455 4.41818 1.52727Z",fill:"#D1D5DB"}));function eD({data:i,rank:e}){return C.jsxs(tD,{href:i.url,target:"_blank",rel:"nofollow noopener noreferrer",children:[C.jsxs("div",{children:[i.imageUrl?C.jsx(iD,{src:i.imageUrl}):C.jsx(sD,{}),C.jsx(rD,{children:C.jsx(oD,{children:e})}),C.jsxs("div",{className:"px-6",children:[C.jsx("div",{className:"pt-3 font-medium text-lg text-center leading-snug",children:i.name}),i.isProduct&&C.jsx("div",{className:"pt-1 text-gray-500 text-center leading-snug",children:i.brandName})]})]}),C.jsx("div",{children:C.jsxs("div",{className:"pt-4 pb-5 flex flex-row items-center justify-center gap-4 text-gray-450",children:[C.jsxs("div",{children:[i.giftPercent,"%"]}),C.jsx("div",{className:"text-gray-350",children:"·"}),C.jsxs("div",{className:"flex flex-row items-center justify-start gap-2",children:[i.giftCount," ",C.jsx(J0,{})]})]})})]})}const tD=st.a.attrs({className:"border border-gray-150 rounded-xl h-full flex flex-col items-stretch justify-between transition-all hover:-translate-y-1 active:-translate-y-0.5 [&[href='#']]:pointer-events-none"})`
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.03);
&:hover {
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}
`,iD=st.img.attrs({className:"w-full object-cover rounded-t-[11px]"})`
aspect-ratio: 1 / 1;
`,sD=st.div.attrs({className:"w-full object-cover"})`
aspect-ratio: 1 / 1;
`,rD=Dt.div`flex flex-row justify-center -mt-5`,oD=st.div.attrs({className:"h-10 w-10 rounded-lg flex flex-row items-center justify-center font-medium text-xl text-white"})`
background: radial-gradient(
85% 85% at 80% 15%,
rgba(255, 255, 255, 0.3) 0%,
rgba(255, 255, 255, 0) 100%
),
#f9ac67;
box-shadow: 0 0 0 3px #ffffff;
`;function Py({slides:i}){const e=S.useRef(null),{selectedFilters:t,selectedDateRange:s}=S.useContext(je);return S.useEffect(()=>{e.current?.slideTo(0)},[t,s]),C.jsx(C.Fragment,{children:C.jsx(nD,{children:C.jsxs(tm,{onInit:r=>{e.current=r},slidesPerView:4.5,slidesPerGroup:4,allowTouchMove:!1,simulateTouch:!1,spaceBetween:24,className:"thank-you-notes-swiper",navigation:!0,modules:[Kf,Xf,qf],mousewheel:{forceToAxis:!0},centeredSlides:!0,centeredSlidesBounds:!0,children:[i.map((r,o)=>C.jsx(Yu,{children:C.jsx(eD,{data:r,rank:o+1})},r.id)),i.length%4===0?C.jsx(Yu,{}):null]})})})}const nD=st.div.attrs({className:"relative"})`
// Next 2 directives are required to allow the hovered notes to overflow the
// space reserved for the slider on the y axis, but not on the x axis.
overflow-x: clip;
.swiper {
overflow: visible;
}
.thank-you-notes-swiper {
width: 100%;
}
.swiper-button-prev,
.swiper-button-next {
transition: all 300ms;
top: -20px;
margin-top: 0;
width: 220px;
height: calc(100% + 40px);
align-items: center;
&:after {
transition: all;
position: relative;
content: "";
width: 48px;
height: 48px;
}
&:hover:after {
filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.07));
}
&:active:after {
opacity: 0.5;
}
&.swiper-button-disabled {
opacity: 0;
}
}
.swiper-button-prev.swiper-button-disabled + .swiper-button-next {
width: 160px;
}
.swiper-button-prev {
left: 0;
background: linear-gradient(
270deg,
rgba(255, 255, 255, 0) 0%,
#ffffff 100%
);
justify-content: flex-start;
&:after {
left: 24px;
}
&:hover {
background: linear-gradient(
270deg,
rgba(255, 255, 255, 0) 0%,
#ffffff 90%
);
}
&:after {
background-image: url(${Ry});
}
}
.swiper-button-next {
right: 0;
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
justify-content: flex-end;
&:after {
right: 24px;
}
&:hover {
background: linear-gradient(
90deg,
rgba(255, 255, 255, 0) 0%,
#ffffff 90%
);
}
&:after {
background-image: url(${Dy});
}
}
#swiper-pagination-el {
margin: 1rem auto;
}
.swiper-slide {
height: auto;
}
`;function Ty({segment:i,loading:e,data:t,productsOrBrands:s}){const r=s==="products",o=S.useMemo(()=>{const a=rm(t,"giftCount");return a?a.giftCount:null},[t]),n=a=>o===null||o===0?0:Math.round(a/o*100);return C.jsx("div",{children:C.jsx(_s,{children:C.jsx(wt,{loading:e,dataPresent:!!t,children:C.jsx("div",{className:"p-5 pt-1",children:C.jsxs(aD,{children:[C.jsx("thead",{children:C.jsxs("tr",{children:[C.jsx(Cc,{children:r?"Product":"Brand"}),C.jsx(Cc,{children:"Gifts"}),C.jsx(Cc,{colSpan:2,children:"% of gifts"})]})}),C.jsx("tbody",{children:t&&t.map(a=>C.jsxs("tr",{className:"transition-colors hover:bg-gray-075",children:[C.jsx("td",{children:C.jsx("a",{href:a.url,target:"_blank",rel:"nofollow noopener noreferrer",className:"hover:text-primary-new-550 active:text-primary-new-700 transition-colors overflow-hidden text-ellipsis line-clamp-1",children:r?C.jsxs(C.Fragment,{children:[C.jsx("span",{children:a.brandName})," – ",a.name]}):C.jsx(C.Fragment,{children:a.brandName})})}),C.jsx("td",{children:a.giftCount}),C.jsx("td",{children:C.jsx(lD,{style:{width:`${n(a.giftCount)}%`}})}),C.jsxs("td",{children:[a.giftPercent,"%"]})]},a.id))})]})})})})})}const aD=st.table.attrs({className:"w-full"})`
td {
border-top: 1px solid var(--color-gray-150);
color: var(--color-gray-700);
span {
font-weight: 500;
}
a[href="#"] {
pointer-events: none;
}
}
th,
td {
padding: 0.75rem;
}
// Name
th:nth-of-type(1),
td:nth-of-type(1) {
text-align: left;
width: 65%;
}
// Gift count
th:nth-of-type(2),
td:nth-of-type(2) {
text-align: right;
width: 10%;
font-variant-numeric: tabular-nums;
}
// Bar
td:nth-of-type(3) {
width: 18%;
}
// Percent
td:nth-of-type(4) {
padding-left: 0;
width: 7%;
text-align: right;
font-variant-numeric: tabular-nums;
}
// Percent header row
th:last-of-type {
text-align: right;
width: 30%;
}
`,Cc=Dt.th`text-sm text-gray-500 font-medium`,lD=Dt.div`h-[4px] rounded bg-primary-new-300 transition-all`;function Bf({segment:i,displayFormat:e}){const{getGraphqlVariables:t,useRequestChartData:s}=S.useContext(je),[r,{data:o,loading:n}]=Jt(uD);s(()=>{r({variables:{params:t(),segment:i}})},[i]);const a=o?.reportChart?.topBrands?.data,l=It(a),u=Z0(l);return e==="table"?C.jsx(Ty,{segment:i,loading:n,data:u,productsOrBrands:"brands"}):C.jsx(wt,{loading:n,dataPresent:!!u,children:u&&C.jsx(Py,{slides:u})})}const uD=zt`
query ReportCharts_TopBrands(
$params: ReportParamsInput!
$segment: ReportChartsProductOrBrandSegment!
) {
reportChart(params: $params) {
topBrands(segment: $segment) {
data {
itemId
imageUrl
giftCount
giftPercent
brandName
brandSlug
giftOptionSlug
}
}
}
}
`;function Wf({segment:i,displayFormat:e}){const{getGraphqlVariables:t,useRequestChartData:s}=S.useContext(je),[r,{data:o,loading:n}]=Jt(hD);s(()=>{r({variables:{params:t(),segment:i}})},[i]);const a=o?.reportChart?.topProducts?.data,l=It(a),u=Q0(l);return e==="table"?C.jsx(Ty,{segment:i,loading:n,data:u,productsOrBrands:"products"}):C.jsx(wt,{loading:n,dataPresent:!!u,children:u&&C.jsx(Py,{slides:u})})}const hD=zt`
query ReportCharts_TopProducts(
$params: ReportParamsInput!
$segment: ReportChartsProductOrBrandSegment!
) {
reportChart(params: $params) {
topProducts(segment: $segment) {
data {
itemId
imageUrl
giftCount
giftPercent
productName
productSlug
brandName
brandSlug
}
}
}
}
`;function yc({segment:i}){const[e,t]=S.useState("products");return C.jsxs("div",{className:"pb-24 pt-12",children:[C.jsx(q0,{view:e,setView:t,segment:i}),C.jsx("div",{children:e==="products"?C.jsx(Wf,{segment:i}):e==="brands"?C.jsx(Bf,{segment:i}):e==="table"?C.jsxs("div",{className:"flex flex-row items-start gap-6 pt-8",children:[C.jsx("div",{className:"flex-1",children:C.jsx(Wf,{segment:i,displayFormat:"table"})}),C.jsx("div",{className:"flex-1",children:C.jsx(Bf,{segment:i,displayFormat:"table"})})]}):null})]})}const dD="/assets/paywall-bg-ClV0E4F1.png",cD=i=>S.createElement("svg",{width:20,height:21,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("path",{d:"M16.2399 9.92234L13.1531 8.63618C12.8209 8.48861 12.5238 8.27196 12.2818 8.00065C12.0398 7.72934 11.8584 7.40958 11.7496 7.06267L10.592 3.63268C10.5503 3.5086 10.4707 3.40075 10.3644 3.32435C10.2581 3.24794 10.1305 3.20684 9.99963 3.20684C9.86873 3.20684 9.74113 3.24794 9.63484 3.32435C9.52855 3.40075 9.44893 3.5086 9.40722 3.63268L8.24963 7.06267C8.14086 7.40958 7.95943 7.72934 7.71743 8.00065C7.47542 8.27196 7.1784 8.48861 6.84613 8.63618L3.75938 9.92234C3.64544 9.96978 3.54809 10.0499 3.47961 10.1526C3.41113 10.2553 3.37458 10.3759 3.37458 10.4993C3.37458 10.6228 3.41113 10.7434 3.47961 10.8461C3.54809 10.9488 3.64544 11.0289 3.75938 11.0763L6.84613 12.3625C7.1784 12.5101 7.47542 12.7267 7.71743 12.998C7.95943 13.2693 8.14086 13.5891 8.24963 13.936L9.40722 17.366C9.44893 17.4901 9.52855 17.5979 9.63484 17.6743C9.74113 17.7507 9.86873 17.7918 9.99963 17.7918C10.1305 17.7918 10.2581 17.7507 10.3644 17.6743C10.4707 17.5979 10.5503 17.4901 10.592 17.366L11.7496 13.936C11.8584 13.5891 12.0399 13.2693 12.282 12.998C12.524 12.7267 12.8211 12.51 13.1535 12.3625L16.2402 11.0763C16.3542 11.0289 16.4515 10.9488 16.52 10.8461C16.5885 10.7434 16.625 10.6228 16.625 10.4993C16.625 10.3759 16.5885 10.2553 16.52 10.1526C16.4515 10.0499 16.3542 9.96978 16.2402 9.92234H16.2399ZM12.6732 11.2086C12.1765 11.4244 11.7315 11.7436 11.3679 12.1451C11.0043 12.5465 10.7306 13.0208 10.5649 13.5364L9.99963 15.2108L9.43488 13.5364C9.26919 13.0208 8.99542 12.5465 8.63186 12.1451C8.26829 11.7436 7.82329 11.4244 7.32655 11.2086L5.62463 10.4993L7.3263 9.79009C7.82304 9.5743 8.26804 9.25505 8.63161 8.85363C8.99517 8.45222 9.26894 7.97787 9.43463 7.46226L9.99963 5.78784L10.5644 7.46226C10.7302 7.97783 11.004 8.45213 11.3675 8.85353C11.7311 9.25493 12.176 9.57422 12.6727 9.79009L14.3746 10.4993L12.6732 11.2086ZM5.87463 15.916C5.87474 15.9654 5.86018 16.0137 5.83279 16.0548C5.8054 16.0958 5.76642 16.1279 5.7208 16.1468L4.75647 16.5488C4.65971 16.5919 4.57325 16.6551 4.50285 16.7343C4.43244 16.8134 4.3797 16.9066 4.34813 17.0078L3.9868 18.0791C3.97005 18.1286 3.9382 18.1717 3.89571 18.2021C3.85323 18.2326 3.80226 18.249 3.74997 18.249C3.69768 18.249 3.6467 18.2326 3.60422 18.2021C3.56174 18.1717 3.52988 18.1286 3.51313 18.0791L3.15147 17.0077C3.1198 16.9067 3.06702 16.8136 2.99661 16.7346C2.92621 16.6556 2.83981 16.5924 2.74313 16.5493L1.7788 16.1473C1.73325 16.1284 1.69434 16.0963 1.66697 16.0552C1.6396 16.0142 1.625 15.9659 1.625 15.9166C1.625 15.8672 1.6396 15.819 1.66697 15.7779C1.69434 15.7369 1.73325 15.7048 1.7788 15.6858L2.74313 15.2838C2.83989 15.2407 2.92635 15.1775 2.99675 15.0983C3.06716 15.0192 3.1199 14.926 3.15147 14.8248L3.5128 13.7535C3.53345 13.708 3.56677 13.6694 3.60876 13.6424C3.65076 13.6153 3.69967 13.6009 3.74963 13.6009C3.7996 13.6009 3.8485 13.6153 3.8905 13.6424C3.9325 13.6694 3.96582 13.708 3.98647 13.7535L4.3478 14.8243C4.37947 14.9253 4.43225 15.0184 4.50265 15.0974C4.57305 15.1765 4.65946 15.2396 4.75613 15.2827L5.72047 15.6847C5.76624 15.7036 5.80535 15.7356 5.83281 15.7768C5.86027 15.818 5.87483 15.8665 5.87463 15.916ZM18.3746 5.08268C18.3747 5.13205 18.3602 5.18035 18.3328 5.22143C18.3054 5.26251 18.2664 5.29453 18.2208 5.31343L17.2565 5.71543C17.1597 5.75855 17.0733 5.82179 17.0028 5.90093C16.9324 5.98007 16.8797 6.07331 16.8481 6.17443L16.4868 7.24576C16.4701 7.29529 16.4382 7.33833 16.3957 7.36882C16.3532 7.3993 16.3023 7.4157 16.25 7.4157C16.1977 7.4157 16.1467 7.3993 16.1042 7.36882C16.0617 7.33833 16.0299 7.29529 16.0131 7.24576L15.6515 6.17434C15.6198 6.07336 15.567 5.98026 15.4966 5.90124C15.4262 5.82222 15.3398 5.75908 15.2431 5.71601L14.2788 5.31401C14.2333 5.29502 14.1943 5.26298 14.167 5.22191C14.1396 5.18085 14.125 5.13261 14.125 5.08326C14.125 5.03391 14.1396 4.98567 14.167 4.9446C14.1943 4.90354 14.2333 4.8715 14.2788 4.85251L15.2431 4.45051C15.3399 4.40739 15.4263 4.34415 15.4968 4.265C15.5672 4.18586 15.6199 4.09263 15.6515 3.99151L16.0128 2.92018C16.0334 2.87468 16.0668 2.83609 16.1088 2.80903C16.1508 2.78197 16.1997 2.76758 16.2496 2.76758C16.2996 2.76758 16.3485 2.78197 16.3905 2.80903C16.4325 2.83609 16.4658 2.87468 16.4865 2.92018L16.8478 3.99101C16.8795 4.09199 16.9323 4.18509 17.0027 4.26411C17.0731 4.34313 17.1595 4.40627 17.2561 4.44934L18.2205 4.85134C18.2662 4.87022 18.3054 4.90231 18.3328 4.94351C18.3603 4.98471 18.3748 5.03316 18.3746 5.08268Z",fill:"#B7BCC5"}));function cs({feature:i,subtitle:e,requiresTeam:t}){const{showUpsell:s}=S.useContext(je);return C.jsxs(pD,{onClick:()=>{s("chart_"+Qy(i),t||!1)},children:[C.jsxs("div",{children:[C.jsxs("div",{className:"flex flex-row items-center justify-start gap-2",children:[C.jsx("div",{className:"text-xl font-medium text-gray-700",children:i}),C.jsx(cD,{})]}),C.jsx("div",{className:"pt-4 text-lg text-gray-500 w-3/5 leading-snug",children:e})]}),C.jsx(qy,{className:"py-2 text-lg rounded-lg",children:"Learn more"})]})}const pD=st.button.attrs({className:`
p-8 text-left rounded-xl border border-gray-150 min-h-[380px] flex flex-col items-start justify-between transition-all
hover:border-gray-300 hover:cursor-pointer
active:scale-95
`})`
background-image: url(${dD});
background-position: bottom right;
background-repeat: no-repeat;
`;function gD(){const{planPrivilege:i}=S.useContext(je);return i==="none"?C.jsx("div",{className:"min-h-[80vh] pb-48",children:C.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[C.jsx(cs,{feature:"Top products & brands sent",subtitle:"Upgrade to Pro or Team to see the top products and brands sent in your organization."}),C.jsx(cs,{feature:"Top products & brands swapped to",subtitle:"Upgrade to Pro or Team to see the top products and brands your recipients are swapping to."}),C.jsx(cs,{feature:"Top products & brands accepted",subtitle:"Upgrade to Pro or Team to see the top products and brands your recipients are accepting."})]})}):C.jsxs("div",{className:"min-h-[80vh] pb-48",children:[C.jsx(yc,{segment:Lu.sent}),C.jsx(yc,{segment:Lu.accepted}),C.jsx(yc,{segment:Lu.swapped})]})}function Ay({percent:i,loading:e,caption:t}){return C.jsxs(fD,{children:[C.jsxs("svg",{viewBox:"0 0 36 36",className:"donut-chart",children:[C.jsx("path",{className:"bg",d:`M18 2.0845
a 15.9155 15.9155 0 0 1 0 31.831
a 15.9155 15.9155 0 0 1 0 -31.831`}),i?C.jsx("path",{className:"line-green",strokeDasharray:`${i||0}, 100`,d:`M18 2.0845
a 15.9155 15.9155 0 0 1 0 31.831
a 15.9155 15.9155 0 0 1 0 -31.831`}):null]}),C.jsx("div",{className:"absolute top-0 left-0 right-0 bottom-0 flex flex-row items-center justify-center",children:C.jsxs("div",{className:"font-medium text-[48px] text-[#10b983] text-center",children:[C.jsx("div",{className:"text-[48px] leading-snug",children:C.jsxs(wt,{loading:e,dataPresent:!qi(i),inline:!0,children:[i,"%"]})}),C.jsx("div",{className:"text-xl leading-snug",children:t})]})})]})}const fD=st.div.attrs({className:"flex flex-row justify-center relative"})`
.donut-chart {
max-width: 85%;
max-height: 250px;
display: block;
}
.bg {
fill: none;
stroke: #f5f5f5;
stroke-width: 2.5;
}
.line-green,
.line-yellow {
fill: none;
stroke-width: 2.5;
stroke-linecap: round;
}
.line-green {
stroke: #34d399;
//animation: progress 2s ease-out forwards;
}
.line-yellow {
stroke: #fcd34d;
//animation: progress 2.3s ease-out forwards;
}
// Not used for now, because there are too many animations and it causes lag,
// but might in the future
@keyframes progress {
0% {
stroke-dasharray: 0 100;
}
50% {
stroke-dasharray: 0 100;
}
}
`,rr=Dt.div`font-medium text-xl text-gray-700`;function mD(){const{getGraphqlVariables:i,useRequestChartData:e}=S.useContext(je),[t,{data:s,loading:r}]=Jt(vD);e(()=>{t({variables:{params:i()}})});const o=s?.reportChart?.pendingAndAcceptedSpend,n=It(o),a=n?.acceptedPercent;return C.jsxs(_s,{className:"flex-1",children:[C.jsx("div",{className:"p-8 flex flex-col justify-between",children:C.jsx("div",{className:"flex flex-row items-center gap-4",children:C.jsx(rr,{children:"Accepted vs. pending spend for gifts created in date range"})})}),C.jsx("div",{className:"pb-6",children:C.jsxs("div",{className:"flex flex-row items-center",children:[C.jsx("div",{className:"w-[350px]",children:C.jsx(Ay,{loading:r,percent:a,caption:"actual spend"})}),C.jsx("div",{className:"flex-1 pr-6",children:C.jsx(wt,{loading:r,dataPresent:!!n,children:n&&C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"text-[#10b981]",children:[C.jsxs("div",{children:[C.jsx("span",{className:"text-2xl font-medium pr-2",children:zu(n.acceptedAmount)})," ",C.jsxs("span",{className:"text-lg",children:[n.acceptedPercent,"%"]})]}),C.jsxs("div",{className:"pt-2 text-lg leading-snug",children:["Actual spend from ",n.acceptedGifts," accepted gifts created in this date range"]})]}),C.jsxs("div",{className:"text-gray-450 pt-6",children:[C.jsxs("div",{children:[C.jsx("span",{className:"text-2xl font-medium pr-2",children:zu(n.pendingAmount)})," ",C.jsxs("span",{className:"text-lg",children:[n.pendingPercent,"%"]})]}),C.jsxs("div",{className:"pt-2 text-lg leading-snug",children:["Pending spend from ",n.pendingGifts," pending gifts created in this date range"]})]})]})})})]})})]})}const vD=zt`
query ReportCharts_PendingAndAcceptedSpend($params: ReportParamsInput!) {
reportChart(params: $params) {
pendingAndAcceptedSpend {
pendingAmount
pendingPercent
pendingGifts
acceptedAmount
acceptedPercent
acceptedGifts
}
}
}
`;function CD(){const{getGraphqlVariables:i,useRequestChartData:e}=S.useContext(je),[t,{data:s,loading:r}]=Jt(yD);e(()=>{t({variables:{params:i()}})});const o=s?.reportChart?.swapRate,a=It(o)?.percentageSwapped;return C.jsxs(_s,{className:"flex-1",children:[C.jsx("div",{className:"p-8 flex flex-col justify-between",children:C.jsx("div",{className:"flex flex-row items-center gap-4",children:C.jsx(rr,{children:"Swap rate among accepted gifts"})})}),C.jsx("div",{className:"pb-6",children:C.jsx(Ay,{loading:r,percent:a,caption:"swapped"})})]})}const yD=zt`
query ReportCharts_SwapRate($params: ReportParamsInput!) {
reportChart(params: $params) {
swapRate {
percentageSwapped
}
}
}
`;function yg({selectedOption:i,options:e,onChange:t}){return C.jsx("div",{className:"rounded-full bg-gray-100 p-0.5 px-1 flex flex-row items-stretch text-sm font-medium",children:Object.entries(e).map(s=>C.jsx("button",{onClick:()=>t(s[1]),className:Ut("-mx-0.5 rounded-full px-3 py-1 font-medium transition-all text-gray-500 hover:text-gray-800 active:text-gray-500",s[1]===i&&"bg-white shadow text-gray-600 hover:text-gray-600 active:text-gray-600"),children:s[0]},s[0]))})}const wD={Days:dn.days,Hours:dn.hours};function Fy({granularity:i,setGranularity:e}){return C.jsx(yg,{selectedOption:i,options:wD,onChange:t=>e(t)})}function bd({label:i,stat:e,suffix:t}){return C.jsxs("div",{className:"flex flex-row items-center -mt-2.5 -mr-2.5 gap-4",children:[i&&C.jsx("div",{className:"text-gray-450 font-medium",children:i}),C.jsxs("div",{className:"px-5 py-2 rounded-full bg-primary-new-050 text-primary-new-500 text-2xl font-medium tabular-nums",children:[e,t?` ${t}`:""]})]})}function bD(){const{getGraphqlVariables:i,useRequestChartData:e}=S.useContext(je),[t,s]=S.useState(dn.days),[r,{data:o,loading:n}]=Jt(SD);e(()=>{r({variables:{params:i(),granularity:t}})},[t]);const a=o?.reportChart?.timeToAccept,l=It(a);return C.jsxs(_s,{className:"flex-1",children:[C.jsx("div",{className:"p-8 flex flex-col justify-between",children:C.jsxs("div",{className:"flex flex-row items-start justify-between",children:[C.jsxs("div",{className:"flex flex-row items-center gap-4",children:[C.jsx(rr,{children:"Time to accept"}),C.jsx(Fy,{granularity:t,setGranularity:s})]}),l?.median?C.jsx(bd,{stat:im(l.median),label:"Median",suffix:t}):null]})}),C.jsx("div",{className:"pr-3",children:C.jsx(wt,{loading:n,dataPresent:!!l,children:l&&C.jsx(xs,{data:l.data,chartType:"bar",tooltipSeriesName:"gifts",xType:"category",xKey:"bucket",xName:t,xHistogram:t===dn.days,rootPaddingTop:8,colorSetKey:"green"},t)})})]})}const SD=zt`
query ReportCharts_TimeToAccept(
$params: ReportParamsInput!
$granularity: ReportChartsTimeToActionGranularity!
) {
reportChart(params: $params) {
timeToAccept(granularity: $granularity) {
median
data {
bucket
gifts
}
}
}
}
`;function _D(){const{getGraphqlVariables:i,useRequestChartData:e}=S.useContext(je),[t,s]=S.useState(dn.days),[r,{data:o,loading:n}]=Jt(ED);e(()=>{r({variables:{params:i(),granularity:t}})},[t]);const a=o?.reportChart?.timeToOpen,l=It(a);return C.jsxs(_s,{className:"flex-1",children:[C.jsx("div",{className:"p-8 flex flex-col justify-between",children:C.jsxs("div",{className:"flex flex-row items-start justify-between",children:[C.jsxs("div",{className:"flex flex-row items-center gap-4",children:[C.jsx(rr,{children:"Time to open"}),C.jsx(Fy,{granularity:t,setGranularity:s})]}),l?.median?C.jsx(bd,{stat:im(l.median),label:"Median",suffix:t}):null]})}),C.jsx("div",{className:"pr-3",children:C.jsx(wt,{loading:n,dataPresent:!!l,children:l&&C.jsx(xs,{data:l.data,chartType:"bar",tooltipSeriesName:"gifts",xType:"category",xKey:"bucket",xName:t,xHistogram:t===dn.days,rootPaddingTop:8,colorSetKey:"blue"},t)})})]})}const ED=zt`
query ReportCharts_TimeToOpen(
$params: ReportParamsInput!
$granularity: ReportChartsTimeToActionGranularity!
) {
reportChart(params: $params) {
timeToOpen(granularity: $granularity) {
median
data {
bucket
gifts
}
}
}
}
`;function xD(){const{getGraphqlVariables:i,useRequestChartData:e}=S.useContext(je),[t,{data:s,loading:r}]=Jt(RD);e(()=>{t({variables:{params:i()}})});const o=s?.reportChart?.totalViews,n=It(o);return C.jsxs(_s,{className:"flex-1",children:[C.jsx("div",{className:"p-8 flex flex-col justify-between",children:C.jsxs("div",{className:"flex flex-row items-start justify-between",children:[C.jsx(rr,{children:"Total views"}),qi(n?.totalCount)?null:C.jsx(bd,{stat:n.totalCount,label:"Total"})]})}),C.jsx("div",{className:"pr-3",children:C.jsx(wt,{loading:r,dataPresent:!!n,children:n&&C.jsx(xs,{data:n.data,chartType:"line",tooltipSeriesName:"views",seriesKey:"views",rootPaddingTop:8})})})]})}const RD=zt`
query ReportCharts_TotalViews($params: ReportParamsInput!) {
reportChart(params: $params) {
totalViews {
totalCount
data {
date
views
}
}
}
}
`;function DD(){const{getGraphqlVariables:i,useRequestChartData:e}=S.useContext(je),[t,{data:s,loading:r}]=Jt(PD);e(()=>{t({variables:{params:i()}})});const o=s?.reportChart?.viewCountPerGift,n=It(o);return C.jsxs(_s,{className:"flex-1",children:[C.jsx("div",{className:"p-8 flex flex-col justify-between",children:C.jsxs("div",{className:"flex flex-row items-start justify-between",children:[C.jsx(rr,{children:"View count per opened gift"}),n?.median?C.jsx(bd,{stat:n.median,label:"Median"}):null]})}),C.jsx("div",{className:"pr-3",children:C.jsx(wt,{loading:r,dataPresent:!!n,children:n&&C.jsx(xs,{data:n.data,chartType:"bar",tooltipSeriesName:"gifts",xType:"category",xKey:"bucket",xName:"views",rootPaddingTop:8,xHistogram:!0})})})]})}const PD=zt`
query ReportCharts_ViewCountPerGift($params: ReportParamsInput!) {
reportChart(params: $params) {
viewCountPerGift {
median
data {
bucket
gifts
}
}
}
}
`;function TD(){const{planPrivilege:i}=S.useContext(je);return i==="none"||i==="pro"?C.jsx("div",{className:"min-h-[80vh] pb-48",children:C.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[C.jsx(cs,{feature:"View count per opened gift",subtitle:"Upgrade to Team to see how many times your recipients view your gift.",requiresTeam:!0}),C.jsx(cs,{feature:"Total views",subtitle:"Upgrade to Team to see your total number of impressions per day.",requiresTeam:!0}),C.jsx(cs,{feature:"Time to open",subtitle:"Upgrade to Team to see how quickly recipients open gifts.",requiresTeam:!0}),C.jsx(cs,{feature:"Time to accept",subtitle:"Upgrade to Team to see how quickly recipients accept gifts.",requiresTeam:!0}),C.jsx(cs,{feature:"Swap rate among accepted gifts",subtitle:"Upgrade to Team to see what percentage of recipients swap gifts.",requiresTeam:!0}),C.jsx(cs,{feature:"Accepted gift spend vs. pending spend",subtitle:"Upgrade to Team to see how much was spent in this period in accepted gifts, and how much is outstanding in gifts not yet accepted.",requiresTeam:!0})]})}):C.jsxs("div",{className:"min-h-[80vh] pb-48",children:[C.jsxs("div",{className:"flex flex-row items-stretch gap-6 pb-6",children:[C.jsx(DD,{}),C.jsx(xD,{})]}),C.jsxs("div",{className:"flex flex-row items-stretch gap-6 pb-6",children:[C.jsx(_D,{}),C.jsx(bD,{})]}),C.jsxs("div",{className:"flex flex-row items-stretch gap-6 pb-6",children:[C.jsx(CD,{}),C.jsx(mD,{})]})]})}function AD(){const{getGraphqlVariables:i,useRequestChartData:e}=S.useContext(je),[t,{data:s,loading:r}]=Jt(MD);e(()=>{t({variables:{params:i()}})});const o=s?.reportChart?.cards,n=It(o);return C.jsx(_s,{children:C.jsxs("div",{className:"p-8",children:[C.jsx(rr,{className:"pb-8",children:"Top cards"}),C.jsx(wt,{loading:r,dataPresent:!!n,children:n&&C.jsx("div",{className:"grid grid-cols-3 w-full gap-8",children:n.data.map(a=>C.jsxs("div",{className:"flex-1 flex flex-row items-center gap-6",children:[C.jsx(FD,{url:a.imageLargeUrl}),C.jsxs("div",{className:"flex-1",children:[C.jsxs("div",{className:"text-xl",children:[a.giftCount," gifts"]}),C.jsxs("div",{className:"text-gray-400 pt-1",children:[a.giftPercent,"%"]}),C.jsx("div",{className:"pt-6",children:C.jsx("table",{className:"border-separate",children:C.jsx("tbody",{children:a.senders.map((l,u)=>C.jsxs("tr",{children:[C.jsxs("td",{className:"px-1.5 text-sm text-gray-400 border border-gray-200 rounded text-right tabular-nums",children:[l.usageCount,"×"]}),C.jsx("td",{className:"text-sm text-gray-600 w-[90%] pl-1",children:l.name})]},`${l.name}-${u}`))})})})]})]},a.id))})})]})})}function FD({url:i}){return C.jsx(Zy,{scale:1.3,transitionSpeed:2500,tiltMaxAngleX:7,tiltMaxAngleY:12,className:"lg:w-[165px] lg:h-[232px] xl:w-[165px] xl:h-[232px] 2xl:w-[230px] 2xl:h-[324px] z-[5] hover:z-[8] hidden md:block",children:C.jsx("img",{src:i,className:"rounded-xl hover:shadow-xl transition-shadow",alt:""})})}const MD=zt`
query ReportCharts_Cards($params: ReportParamsInput!) {
reportChart(params: $params) {
cards {
data {
id
imageLargeUrl
giftCount
giftPercent
senders {
name
usageCount
}
}
}
}
}
`;function LD({senderUserID:i,cohorted:e}){const{getGraphqlVariables:t,useRequestChartData:s}=S.useContext(je),[r,{data:o,loading:n}]=Jt(ID,{variables:{params:t(),userID:i,cohorted:e}});s(()=>{r({variables:{params:t(),userID:i,cohorted:e}})},[i,e]);const a=It(o?.reportChart?.acceptedGiftsCost?.data);return C.jsx(wt,{loading:n,dataPresent:!!a,children:C.jsx(xs,{data:a||[],chartType:"line",seriesKey:"cost",tooltipSeriesName:"total",isCurrency:!0,colorSetKey:"green",rootPaddingTop:16})})}const ID=zt`
query ReportCharts_SenderDetailAcceptedGiftsCost(
$params: ReportParamsInput!
$userID: ID!
$cohorted: Boolean!
) {
reportChart(params: $params) {
acceptedGiftsCost(userId: $userID, cohorted: $cohorted) {
totalCost
totalGifts
data {
date
gifts
cost
}
}
}
}
`,OD={Sent:"giftsSent",Accepted:"giftsAccepted",Spent:"totalSpent"};function ND({selectedChart:i,setSelectedChart:e}){return C.jsx(yg,{selectedOption:i,options:OD,onChange:t=>e(t)})}function kD({senderUserID:i,cohorted:e}){const{getGraphqlVariables:t,useRequestChartData:s}=S.useContext(je),[r,{data:o,loading:n}]=Jt(GD,{variables:{params:t(),userID:i,cohorted:e}});s(()=>{r({variables:{params:t(),userID:i,cohorted:e}})},[i,e]);const a=It(o?.reportChart?.giftsAccepted?.data);return C.jsx(wt,{loading:n,dataPresent:!!a,children:C.jsx(xs,{data:a||[],chartType:"bar",tooltipSeriesName:"gifts accepted",colorSetKey:"green",rootPaddingTop:16})})}const GD=zt`
query ReportCharts_SenderDetailGiftsAccepted(
$params: ReportParamsInput!
$userID: ID!
$cohorted: Boolean!
) {
reportChart(params: $params) {
giftsAccepted(userId: $userID, cohorted: $cohorted) {
totalCount
data {
date
gifts
}
}
}
}
`;function VD({senderUserID:i}){const{getGraphqlVariables:e,useRequestChartData:t}=S.useContext(je),[s,{data:r,loading:o}]=Jt(HD,{variables:{params:e(),userID:i}});t(()=>{s({variables:{params:e(),userID:i}})},[i]);const n=It(r?.reportChart?.giftsSent?.data);return C.jsx(wt,{loading:o,dataPresent:!!n,children:C.jsx(xs,{data:n||[],chartType:"bar",tooltipSeriesName:"gifts sent",rootPaddingTop:16})})}const HD=zt`
query ReportCharts_SenderDetailGiftsSent(
$params: ReportParamsInput!
$userID: ID!
) {
reportChart(params: $params) {
giftsSent(userId: $userID) {
totalCount
data {
date
gifts
}
}
}
}
`;function BD({selectedSender:i,cohorted:e,sortColumn:t}){const[s,r]=S.useState("giftsSent");return S.useEffect(()=>{r(t)},[t]),i?C.jsxs("div",{children:[C.jsxs("div",{className:"flex flex-row items-start justify-between p-8 pb-4",children:[C.jsx(rr,{children:i.name}),C.jsx(ND,{selectedChart:s,setSelectedChart:r})]}),C.jsx("div",{className:"px-1.5",children:C.jsx("div",{className:"min-h-[400px]",children:s==="giftsSent"?C.jsx(VD,{senderUserID:i.id}):s==="giftsAccepted"?C.jsx(kD,{senderUserID:i.id,cohorted:e}):s==="totalSpent"?C.jsx(LD,{senderUserID:i.id,cohorted:e}):null})})]}):C.jsx("div",{className:"min-h-[200px] h-full flex flex-row items-center justify-center text-gray-400",children:"No sender selected"})}const WD={Actuals:!1,Cohorted:!0};function jD({cohorted:i,setCohorted:e}){return C.jsxs("div",{className:"flex flex-row items-center gap-3 -mr-3",children:[C.jsxs(Jy,{trigger:C.jsx("span",{children:C.jsx(ew,{})}),title:"Actuals vs. cohorted",placement:"auto",children:[C.jsxs("p",{children:[C.jsx("span",{className:"font-semibold",children:"Actuals"})," displays the actual gifts accepted during the current date range. If a gift was created before the current date range, but was accepted within this date range, it’s included in the count of accepted gifts and amount spent."]}),C.jsxs("p",{children:[C.jsx("span",{className:"font-semibold",children:"Cohorted"})," only includes gifts created within this date range (the cohort). If a gift was both created and accepted in this date range, it will be included in the count of accepted gifts. Conversely, if a gift was created before this date range and accepted during this date range, it won’t be counted in Cohorted mode."]}),C.jsx("p",{children:"Cohorted mode is useful if you want to compare the ratio of gifts accepted to created, or spent to created, since those counts will be limited to the same set of gifts created in this date range."})]}),C.jsx(yg,{selectedOption:i,options:WD,onChange:t=>e(t)})]})}const UD="_tableRow_qyywa_2",zD="_bar_qyywa_2",YD="_sortColumnOption_qyywa_2",qo={tableRow:UD,bar:zD,sortColumnOption:YD};function $D({sortedData:i,sortColumn:e,setSortColumn:t,selectedSender:s,setSelectedSender:r}){const o=S.useMemo(()=>{const u=rm(i,e);return u?u[e]:null},[i,e]),n=S.useMemo(()=>mw(i,e)||null,[i,e]),a=u=>o===null||o===0?0:Math.round(u/o*100),l=u=>n===null||n===0?0:Math.round(u/n*100);return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:qo.tableRow,"data-active":!1,children:[C.jsx("div",{children:"Name"}),C.jsx("div",{className:qo.sortColumnOption,"data-active":e==="giftsSent",onClick:()=>t("giftsSent"),children:"Sent"}),C.jsx("div",{className:qo.sortColumnOption,"data-active":e==="giftsAccepted",onClick:()=>t("giftsAccepted"),children:"Accepted"}),C.jsx("div",{className:qo.sortColumnOption,"data-active":e==="totalSpent",onClick:()=>t("totalSpent"),children:"Spent"}),C.jsx("div",{}),C.jsxs("div",{children:["% of ",KD(e)]})]}),i&&i.map(u=>C.jsxs("div",{className:qo.tableRow,onClick:()=>r({id:u.id,name:u.name}),"data-active":u.id===s?.id,children:[C.jsx("div",{children:u.name}),C.jsx("div",{children:u.giftsSent}),C.jsx("div",{children:u.giftsAccepted}),C.jsx("div",{children:zu(u.totalSpent,!0)}),C.jsx("div",{children:C.jsx("div",{className:qo.bar,style:{width:`${a(u[e])}%`}})}),C.jsxs("div",{children:[l(u[e]),"%"]})]},u.id))]})}function KD(i){switch(i){case"giftsAccepted":return"accepted";case"giftsSent":return"sent";case"totalSpent":return"spent"}}function XD(){const{getGraphqlVariables:i,useRequestChartData:e}=S.useContext(je),[t,s]=S.useState(!1),[r,{data:o,loading:n}]=Jt(QD);e(()=>{r({variables:{params:i(),cohorted:t}})},[t]),S.useEffect(()=>{r({variables:{params:i(),cohorted:t}})},[t]);const[a,l]=S.useState("giftsSent"),[u,h]=S.useState(null),d=o?.reportChart?.senders,c=It(d),p=S.useMemo(()=>qD(c?.data,a),[c?.data,a]);return S.useEffect(()=>{if(p&&p.length>0){if(u&&vw(p,{id:u.id}))return;h({id:p[0].id,name:p[0].name})}else u&&h(null)},[p]),C.jsx(_s,{children:C.jsxs("div",{className:"flex flex-row items-stretch",children:[C.jsx("div",{className:"flex-1 min-h-[400px] border-r border-gray-150",children:C.jsxs("div",{className:"p-8",children:[C.jsxs("div",{className:"flex flex-row items-start justify-between pb-4",children:[C.jsx(rr,{children:"Senders"}),C.jsx(jD,{cohorted:t,setCohorted:s})]}),C.jsx(wt,{loading:n,dataPresent:!!c,children:p&&C.jsx("div",{className:"-mx-3",children:C.jsx($D,{sortedData:p,sortColumn:a,setSortColumn:l,selectedSender:u,setSelectedSender:h})})})]})}),C.jsx("div",{className:"flex-1",children:C.jsx(BD,{selectedSender:u,cohorted:t,sortColumn:a})})]})})}function qD(i,e){if(i)return Cw(i,[e],["desc"])}const QD=zt`
query ReportCharts_Senders($params: ReportParamsInput!, $cohorted: Boolean!) {
reportChart(params: $params) {
senders(cohorted: $cohorted) {
totalCount
data {
id
name
giftsSent
giftsAccepted
totalSpent
}
}
}
}
`;function ZD(){const{planPrivilege:i}=S.useContext(je);return i==="none"?C.jsx("div",{className:"min-h-[80vh] pb-48",children:C.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[C.jsx(cs,{feature:"Senders & spend",subtitle:"Upgrade to Pro or Team to see reports on gifts sent, accepted, and amount spent by sender."}),C.jsx(cs,{feature:"Top cards",subtitle:"Upgrade to Pro or Team to the top cards being sent with gifts, and who's using them."})]})}):C.jsxs("div",{className:"min-h-[80vh] pb-48",children:[C.jsx(XD,{}),C.jsx("div",{className:"h-8"}),C.jsx(AD,{})]})}function JD(){const[i,e]=S.useState("senders_gifts");return C.jsxs(C.Fragment,{children:[C.jsx(Ec,{children:C.jsxs("div",{className:"px-6",children:[C.jsxs("div",{className:"flex flex-row items-stretch gap-8",children:[C.jsx("div",{className:"flex-[2.2]",children:C.jsx(G0,{})}),C.jsx(Dw,{})]}),C.jsx(j0,{})]})}),C.jsx($0,{page:i,setPage:e}),C.jsx(Ec,{children:C.jsx("div",{className:"px-6",children:i==="senders_gifts"?C.jsx(ZD,{}):i==="products_brands"?C.jsx(gD,{}):i==="recipients"?C.jsx(TD,{}):i==="gift_data"?C.jsx(Px,{}):null})})]})}function eP({visibleDateRange:i,onChange:e}){const t=S.useRef(null),s=S.useRef(e);return s.current=e,S.useEffect(()=>(t.current=tw("#flatpickr-datepicker",{allowInput:!1,inline:!0,mode:"range",dateFormat:"m/d/Y",onChange:r=>{s.current({start:r[0],end:r[1]})}}),()=>t.current?.destroy()),[]),S.useEffect(()=>{if(!t.current)return;const r=t.current.selectedDates,o=[i.start,i.end].filter(iP);(o[0]!==r[0]||o[1]!==r[1])&&t?.current?.setDate(o,!0)},[i]),C.jsx(iw,{children:C.jsx(tP,{id:"flatpickr-datepicker"})})}const tP=Dt.input`hidden`;function iP(i){return i!=null}const sP=i=>S.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("path",{d:"M4.16602 10H15.8327",stroke:"#9CA3AF",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M10 4.16602L15.8333 9.99935L10 15.8327",stroke:"#9CA3AF",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}));function rP(){const{selectedDateRange:i,setSelectedDateRangeFromDates:e}=S.useContext(je),[t,s]=S.useState({start:null,end:null}),[r,o]=S.useState({start:"",end:""}),n=(u,h)=>{const d=sw.parse(u),c=oP(t,h,d[0]?.date());d[0]&&!c?s({...t,[h]:d[0].date()}):(c&&window.alert(c),o({...r,[h]:wc(t[h])}))},a=(u,h)=>{u.relatedTarget&&u.relatedTarget.classList.contains("flatpickr-day")||n(u.target.value,h)},l=u=>{u.key==="Enter"&&u.currentTarget.blur()};return S.useEffect(()=>{s({start:i.start,end:i.end})},[i,s]),S.useEffect(()=>{o({start:wc(t.start),end:wc(t.end)})},[t,o]),S.useEffect(()=>{t.start&&t.end&&e({start:t.start,end:t.end})},[t]),C.jsxs("div",{children:[C.jsxs("div",{className:"flex flex-row items-center gap-2 pb-4",children:[C.jsx(jf,{value:r.start,onChange:u=>o({...r,start:u.target.value}),onKeyPress:l,onBlur:u=>a(u,"start")}),C.jsx(sP,{}),C.jsx(jf,{value:r.end,onChange:u=>o({...r,end:u.target.value}),onKeyPress:l,onBlur:u=>a(u,"end")})]}),C.jsx(eP,{visibleDateRange:t,onChange:u=>{s(u)}})]})}function wc(i){return i?i.toLocaleDateString("default",{month:"long",day:"numeric",year:"numeric"}):""}function oP(i,e,t){return t?e==="start"&&i.end&&i.end<t?"Start date cannot be after end date.":e==="end"&&i.start&&i.start>t?"End date cannot be before start date.":null:null}const jf=Dt.input`w-full border border-gray-250 p-2 flex-1 text-center rounded-lg transition-colors hover:border-gray-300 focus:border-gray-400 focus:outline-none`,Uf={Relative:["last_7_days","last_14_days","last_30_days","last_60_days"],Calendar:["this_week","last_week","this_month","last_month","this_quarter","last_quarter","this_year","last_year"]};function nP({open:i,onClose:e}){const{selectedDateRange:t,setDateRangePreset:s}=S.useContext(je);return C.jsx(Lh,{anchor:"right",open:i,onClose:e,children:C.jsxs("div",{className:"w-[424px] max-w-full h-full",children:[C.jsx("div",{className:"px-8 pt-8 pr-6",children:C.jsx(Sl,{preHeader:"Date range",name:Gg(t.rangeType),onClose:e})}),C.jsxs("div",{className:"p-8",children:[C.jsx(rP,{}),Object.keys(Uf).map(r=>{const o=Uf[r];return C.jsxs("div",{children:[C.jsx(aP,{children:r}),C.jsx("div",{className:"-mx-3",children:o.map(n=>C.jsx(lP,{onClick:()=>s(n),$active:t.rangeType===n,children:Gg(n)},n))})]},r)})]})]})})}const aP=Dt.div`text-gray-500 text-sm font-medium pt-9 pb-2`,lP=Dt.button`
text-gray-700 text-left inline-block w-1/2 px-3 py-2 border border-transparent rounded-lg transition-all hover:text-gray-800 hover:shadow-min hover:border-gray-150 active:bg-gray-050
${i=>i.$active&&"border-primary-new-200 text-primary-new-500 shadow-min hover:border-primary-new-200 hover:text-primary-new-500"}
`;function uP(){const{selectedDateRange:i,setSelectedDateRangeFromDates:e}=S.useContext(je),[t,{loading:s}]=rw(hP),r=async(a,l)=>{if(l==="gift_batch"){const u=await t({variables:{id:a}});return u?.data?.reportsValidateGiftBatchPublicId?.ok?(o(u.data.reportsValidateGiftBatchPublicId.firstGiftDate),!0):!1}return!1},o=a=>{if(a){const l=to(a);Rc(l)&&(bw(l,i.start)?window.confirm(`The gift send date for this batch is ${l.toLocaleDateString()}, which is before your current date range.
Do you want to update your date range to include the gift send date?`)&&e({start:l,end:i.end}):Sw(l,i.end)&&window.confirm(`The gift send date for this batch is ${l.toLocaleDateString()}, which is after your current date range.
Do you want to update your date range to include the gift send date plus two weeks?`)&&e({start:i.start,end:_w(l,2)}))}};return{validate:r,validationLoading:s}}const hP=zt`
mutation Reports_ValidateGiftBatchPublicIdMutation($id: String!) {
reportsValidateGiftBatchPublicId(giftBatchPublicId: $id) {
ok
firstGiftDate
}
}
`,dP=Dt.button`
inline-flex flex-row rounded-lg object-center items-center text-gray-500 bg-white hover:text-primary-500 focus:outline-none active:bg-primary-000
disabled:opacity-50 disabled:cursor-auto
shadow-[0_4px_4px_rgba(0,0,0,0.04),0_8px_37px_rgba(0,0,0,0.06)]
${({$hasProTag:i})=>i?"p-0.5 pl-3":"py-1 px-3"};
`,cP="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAbFBMVEUAAAD///+AgP+0w8O4uMa8vMm5uca0u8e2vMK4vsS2u8W2vMS2vMW3vMa3vcS4vMW2vMW4u8S4vcW2u8a3vMS3vMW3vMW3vMa2vMW4vMS3u8W3vMW3vMa3vMW3vMW3vMW3vMW3vMW3vMW3vMV/bAnZAAAAI3RSTlMAAQIREhMoKSorbX6FhoeIiY+Wl5iZm7Kzu7zLzM34+fr7/Px1hUwAAAABYktHRAH/Ai3eAAAAdklEQVQYGQXBAQKBMAAAwJMWUSOiUI3t/390BwAAtJd5jkcA1TVvnyXlWAGu5banHksPtPkOPPIBxK0GQurAvACsE5gXgHUCMdVA+HbgmEfg+WuAWB6B8CwvQNXntK7f37sMAId+mrpGLMMOABjKGQBwPgEA8Afbigb4RfJqLwAAAABJRU5ErkJggg==",My=i=>S.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("path",{d:"M2 4H14",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M12.6673 4V13.3333C12.6673 14 12.0007 14.6667 11.334 14.6667H4.66732C4.00065 14.6667 3.33398 14 3.33398 13.3333V4",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M5.33398 4.00065V2.66732C5.33398 2.00065 6.00065 1.33398 6.66732 1.33398H9.33398C10.0007 1.33398 10.6673 2.00065 10.6673 2.66732V4.00065",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}));function Ly({onClick:i}){return C.jsxs(ow,{onClick:i,className:"self-center",children:[C.jsx(nw,{className:"fill-current text-white"}),C.jsx("div",{className:"font-semibold text-white text-base",children:"Upgrade"})]})}function pP({onClose:i,filterClassID:e}){const{filterClasses:t,setFilterDrawerPage:s,toggleFilterOption:r,selectedFilterOptionsForClass:o,removeAllSelectionsForFilterClass:n,showUpsell:a}=S.useContext(je),l=e==="gift_batch",u=t?.find(O=>O.id===e),h=o(e),[d,c]=S.useState(""),[p,y]=S.useState(""),f=S.useMemo(()=>{if(l)return h.map(O=>CP(O));if(u?.options&&d.trim()!==""){const O=d.toLowerCase();return u.options.filter(N=>N.name?.toLowerCase()?.includes(O)||!1)}return u?.options||[]},[u?.options,d,h]),w=vP(u?.id,f),{planPrivilege:_}=S.useContext(je),P=_==="none",{validate:T,validationLoading:D}=uP(),M=async()=>{await T(p,e)?(r(e,p),y("")):alert("That is not a valid gift batch ID.")};return C.jsxs("div",{className:"p-9 pb-24",children:[C.jsx(Sl,{name:u?.name||"Unknown",onClose:i,onBack:()=>s("all_filters")}),P&&C.jsxs("button",{className:"border border-primary-new-200 shadow-min p-4 text-left rounded-lg mt-4 hover:border-primary-new-300 active:bg-primary-new-000 transition-colors",onClick:()=>a(`filter_${e}`,!1),children:[C.jsxs("div",{className:"font-medium text-primary-new-600 text-lg pb-4",children:["Upgrade to Pro or Team to filter on ",u?.name," and more filters"]}),P&&C.jsx(Ly,{onClick:()=>a(`filter-${e}`,!1)})]}),C.jsxs("div",{className:Ut("flex flex-row items-center h-10 gap-3 mt-8",P&&"opacity-60 pointer-events-none"),children:[l?C.jsx(Iy,{placeholder:"Enter a gift batch ID",value:p,onChange:O=>y(O.target.value),onKeyDown:O=>{O.key==="Enter"&&M()},disabled:D}):C.jsx(mP,{placeholder:"Search",value:d,onChange:O=>c(O.target.value)}),l?C.jsx("button",{className:"rounded-lg h-10 border border-gray-150 shadow-min px-3 gap-2 flex flex-row items-center text-gray-500 hover:border-gray-200 hover:text-gray-700 active:bg-gray-050 transition-colors disabled:opacity-75 disabled:cursor-default disabled:pointer-events-none",disabled:p.length===0||D,onClick:M,children:"Add"}):C.jsxs("button",{disabled:h.length===0,onClick:()=>n(e),className:"rounded-lg h-10 border border-gray-150 shadow-min px-3 gap-2 flex flex-row items-center text-gray-500 hover:border-gray-200 hover:text-gray-700 active:bg-gray-050 transition-colors disabled:opacity-75 disabled:cursor-default disabled:pointer-events-none group",children:[C.jsx(My,{className:"stroke-current text-gray-350 group-hover:text-gray-400 transition-colors"}),C.jsx("div",{className:"whitespace-nowrap",children:"Clear filter"})]})]}),u&&C.jsx("div",{className:Ut("flex w-full flex-col",P&&"opacity-60 pointer-events-none"),children:C.jsxs("div",{className:"-mx-3 pt-6",children:[l&&h.length===0?C.jsxs("div",{className:"text-gray-500 px-3 pb-6",children:[C.jsx("div",{className:"pb-3",children:"Enter IDs of gift batches you want to filter your data to above."}),C.jsxs("div",{children:["Or, go to the Track page, click a gift batch, and click"," ",C.jsx("span",{className:"font-medium",children:"Open in Reports"})," to add this filter automatically:"]}),C.jsxs("div",{className:"flex flex-col items-center justify-center p-4 py-6 bg-gray-075 rounded-lg mt-3 pointer-events-none gap-3",children:[C.jsxs(dP,{onClick:()=>{},$hasProTag:!1,children:[C.jsx(aw,{className:"self-center mr-3 stroke-current"}),"Open in Reports"]}),C.jsx("div",{className:"font-medium text-sm text-gray-400",children:"Look for this button on the Track page"})]})]}):null,w.map(O=>C.jsxs("div",{className:"pb-4",children:[O.name!==""?C.jsx("div",{className:"px-4 py-1 bg-gray-150 font-medium text-gray-600 rounded mb-[2px]",children:O.name}):C.jsx("div",{className:"z-[-10]",children:C.jsx(fP,{})}),C.jsx("div",{children:O.options.map(N=>C.jsxs(gP,{className:Ut("group",h.includes(N.key)&&"text-primary-new-700"),$active:h.includes(N.key),onClick:()=>r(e,N.key),children:[C.jsx(lw,{selected:h.includes(N.key),className:"mr-3"}),C.jsx("div",{className:"mr-auto",children:N.name}),N.inactive&&C.jsx("div",{className:"px-2 rounded-full border border-gray-200 text-gray-400 text-sm",children:"Inactive"})]},N.key))})]},O.name))]})})]})}const gP=Dt.button`
flex flex-row items-center w-full px-4 py-3 relative rounded transition-all -mt-px text-gray-600
hover:bg-gray-075
active:bg-gray-100
after:absolute after:bottom-0 after:left-3 after:right-3 after:border-b after:border-gray-200 after:content[""] after:z-[-10]
`,fP=Dt.div`relative flex after:absolute after:bottom-0 after:left-3 after:right-3 after:border-b after:border-gray-200 after:content[""]`,Iy=st.input.attrs(Po(`
w-full rounded-lg h-10 flex-1 border border-gray-150 px-3 hover:border-gray-200 bg-no-repeat
active:outline-none active:border-gray-300
focus:outline-none focus:border-gray-300
`))``,mP=st(Iy).attrs(Po("pl-8!"))`
background-image: url(${cP});
background-position: 11px 11px;
`;function vP(i,e){return i?i==="status"?[{name:"Accepted status",options:e.filter(t=>t.key.startsWith("all_"))},{name:"Gift stages",options:e.filter(t=>!t.key.startsWith("all_"))}]:[{name:"",options:e}]:[]}function CP(i){return{__typename:"ReportFilterOption",id:i,key:i,name:i,description:null,inactive:null}}const yP=i=>S.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("path",{d:"M10 18L16 12L10 6",stroke:"#B7BCC5",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}));function wP({onClose:i}){const{filterClasses:e,selectedFilterOptionsForClass:t,setFilterDrawerPage:s,removeAllFilters:r,planPrivilege:o}=S.useContext(je);return C.jsxs("div",{className:"p-9",children:[C.jsx(Sl,{name:"All filters",onClose:i}),C.jsxs("div",{className:"pt-8 -mx-5",children:[C.jsx(SP,{}),e?.map(n=>C.jsx(ie.Fragment,{children:C.jsxs(bP,{onClick:()=>s(n.id),children:[C.jsx("div",{children:n.name}),C.jsx("div",{children:t(n.id).length>0?C.jsx("div",{className:"w-8 h-8 flex flex-row items-center justify-center rounded-full bg-primary-new-050 text-primary-new-400 font-medium",children:t(n.id).length}):C.jsx("div",{className:"w-8 h-8 flex flex-row items-center justify-center",children:C.jsx(yP,{})})})]})},n.id)),C.jsx("div",{className:"pt-12",children:C.jsxs("button",{onClick:()=>r(),className:"mx-auto rounded-lg h-10 border border-gray-150 shadow-min px-3 gap-2 flex flex-row items-center text-gray-500 hover:border-gray-200 hover:text-gray-700 active:bg-gray-050 transition-colors disabled:opacity-75 disabled:cursor-default disabled:pointer-events-none group",children:[C.jsx(My,{className:"stroke-current text-gray-350 group-hover:text-gray-400 transition-colors"}),C.jsx("div",{className:"whitespace-nowrap",children:"Clear all filters"})]})})]})]})}const bP=Dt.button`
relative text-lg -mt-px -mb-px w-full flex flex-row items-center justify-between px-5 rounded-lg transition-all text-gray-700 h-[3.75rem]
hover:bg-gray-075 hover:text-gray-800
active:bg-gray-150
after:absolute after:bottom-0 after:left-3 after:right-3 after:border-b after:border-gray-200 after:content[""] after:z-[-10]
`,SP=Dt.div`
relative
after:absolute after:bottom-0 after:left-3 after:right-3 after:border-b after:border-gray-200 after:content[""] after:z-[-10]
`;function _P({open:i,onClose:e,page:t}){const s=t==="all_filters",[r,o]=S.useState(null);S.useEffect(()=>{t!=="all_filters"&&o(t)},[t]);const n=t==="all_filters"?r:t;return C.jsx(Lh,{anchor:"left",open:i,onClose:e,children:C.jsx("div",{className:"w-[424px] max-w-full h-full",children:C.jsxs("div",{className:"overflow-x-hidden h-full",children:[C.jsxs("div",{className:"relative",children:[C.jsx(zf,{$active:s,className:Ut("page-index",s?"translate-x-0 opacity-100 pointer-events-auto":"-translate-x-24 pointer-events-none"),children:C.jsx(wP,{onClose:e})}),C.jsx(zf,{$active:!s,className:Ut("page-detail bg-white z-10",s?"translate-x-24 pointer-events-none":"translate-x-0 opacity-100 pointer-events-auto"),children:n&&C.jsx(pP,{onClose:e,filterClassID:n})})]}),C.jsx("div",{className:"h-48"})]})})})}const zf=Dt.div`
absolute top-0 left-0 right-0 bottom-0 opacity-0 transition-all bg-white duration-300
`,EP=i=>S.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("path",{d:"M19 4H5C3.89543 4 3 4.89543 3 6V20C3 21.1046 3.89543 22 5 22H19C20.1046 22 21 21.1046 21 20V6C21 4.89543 20.1046 4 19 4Z",stroke:"#B7BCC5",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M16 2V6",stroke:"#B7BCC5",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M8 2V6",stroke:"#B7BCC5",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M3 10H21",stroke:"#B7BCC5",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Oy=i=>S.createElement("svg",{width:14,height:8,viewBox:"0 0 14 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("path",{d:"M1 1L7 7L13 1",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}));function xP(){const{selectedDateRange:i,setDateRangeDrawerOpen:e}=S.useContext(je);return C.jsxs("button",{className:"flex flex-row items-center justify-between gap-3 px-4 py-3 font-medium text-lg bg-gray-075 text-gray-500 rounded-full hover:bg-gray-100 active:bg-gray-150 transition-colors h-12 min-w-[256px]",onClick:()=>e(!0),children:[C.jsx(EP,{className:"-mt-px"}),C.jsx("div",{className:"flex-1 text-left",children:uw(i)}),C.jsx(Oy,{className:"stroke-current text-gray-350"})]})}const RP=i=>S.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("g",{clipPath:"url(#clip0_26_9118)"},S.createElement("path",{d:"M10.0013 18.3327C14.6037 18.3327 18.3346 14.6017 18.3346 9.99935C18.3346 5.39698 14.6037 1.66602 10.0013 1.66602C5.39893 1.66602 1.66797 5.39698 1.66797 9.99935C1.66797 14.6017 5.39893 18.3327 10.0013 18.3327Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M10 6.66602V13.3327",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M6.66797 10H13.3346",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),S.createElement("defs",null,S.createElement("clipPath",{id:"clip0_26_9118"},S.createElement("rect",{width:20,height:20,fill:"white"}))));function Yf({name:i,onClick:e,selectedOptionCount:t,isAllFilters:s}){const r=t>0;return C.jsxs("button",{onClick:e,className:Ut("flex flex-row items-center gap-3 px-4 py-3 font-medium bg-gray-075 text-gray-500 rounded-full hover:bg-gray-100 active:bg-gray-150 transition-colors h-12",r&&"bg-primary-new-550 hover:bg-primary-new-600 active:bg-primary-new-700 text-white"),children:[C.jsx("span",{children:i}),s?C.jsx(RP,{className:"stroke-current text-gray-350"}):C.jsx(C.Fragment,{children:r?C.jsx("div",{className:"-my-1 -mr-2 bg-primary-new-500 w-8 h-8 flex flex-row items-center justify-center text-white font-medium rounded-full",children:t}):C.jsx(Oy,{className:"stroke-current text-gray-350"})})]})}function DP(){const{filterClasses:i,selectedFilterOptionsForClass:e,openFilterDrawer:t,showUpsell:s}=S.useContext(je),{planPrivilege:r}=S.useContext(je),o=r==="none";return C.jsxs("div",{className:"flex flex-row items-start gap-4",children:[C.jsxs("div",{className:Ut("flex flex-row items-start gap-2 [&>button:nth-of-type(6)]:hidden [&>button:nth-of-type(6)]:2xl:flex",o&&"opacity-60"),children:[i&&i.map(n=>C.jsx(Yf,{name:n.name,onClick:()=>t(n.id),selectedOptionCount:e(n.id).length,isAllFilters:!1},n.name)),C.jsx(Yf,{name:"All filters",onClick:()=>t("all_filters"),selectedOptionCount:0,isAllFilters:!0})]}),o&&C.jsx(Ly,{onClick:()=>s("filters",!1)})]})}function PP(){return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"py-12 pb-8 text-center font-medium text-4xl",children:"Reports"}),C.jsx("div",{className:"sticky top-0 z-[9] bg-white",style:{backdropFilter:"blur(10px)",background:"rgba(255, 255, 255, 0.9)"},children:C.jsx(Ec,{children:C.jsx("div",{className:"px-6 py-5",children:C.jsxs("div",{className:"flex flex-row items-center justify-between",children:[C.jsx(DP,{}),C.jsx(xP,{})]})})})})]})}const TP=i=>S.createElement("svg",{width:48,height:48,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("rect",{width:48,height:48,rx:12,fill:"#4D83FA"}),S.createElement("rect",{width:48,height:48,rx:12,fill:"url(#paint0_radial_330_11972)",fillOpacity:.2}),S.createElement("path",{d:"M32.7362 23.1922L28.4148 21.3916C27.9496 21.185 27.5338 20.8817 27.195 20.5018C26.8562 20.122 26.6022 19.6743 26.4499 19.1887L24.8293 14.3867C24.7709 14.213 24.6594 14.062 24.5106 13.955C24.3618 13.848 24.1831 13.7905 23.9999 13.7905C23.8166 13.7905 23.638 13.848 23.4892 13.955C23.3404 14.062 23.2289 14.213 23.1705 14.3867L21.5499 19.1887C21.3976 19.6743 21.1436 20.122 20.8048 20.5018C20.466 20.8817 20.0502 21.185 19.585 21.3916L15.2635 23.1922C15.104 23.2586 14.9677 23.3708 14.8718 23.5145C14.776 23.6583 14.7248 23.8272 14.7248 24C14.7248 24.1728 14.776 24.3417 14.8718 24.4855C14.9677 24.6292 15.104 24.7414 15.2635 24.8078L19.585 26.6084C20.0502 26.815 20.466 27.1183 20.8048 27.4982C21.1436 27.878 21.3976 28.3257 21.5499 28.8113L23.1705 33.6133C23.2289 33.787 23.3404 33.938 23.4892 34.045C23.638 34.152 23.8166 34.2095 23.9999 34.2095C24.1831 34.2095 24.3618 34.152 24.5106 34.045C24.6594 33.938 24.7709 33.787 24.8293 33.6133L26.4499 28.8113C26.6022 28.3256 26.8563 27.8779 27.1952 27.4981C27.5341 27.1183 27.95 26.815 28.4152 26.6084L32.7367 24.8078C32.8962 24.7414 33.0325 24.6292 33.1284 24.4855C33.2243 24.3417 33.2754 24.1728 33.2754 24C33.2754 23.8272 33.2243 23.6583 33.1284 23.5145C33.0325 23.3708 32.8958 23.2586 32.7362 23.1922ZM27.7429 24.993C27.0475 25.2951 26.4245 25.742 25.9155 26.304C25.4065 26.866 25.0232 27.5301 24.7912 28.2519L23.9999 30.5961L23.2092 28.2519C22.9773 27.5301 22.594 26.866 22.085 26.304C21.576 25.742 20.953 25.2951 20.2576 24.993L17.8749 24L20.2572 23.0071C20.9526 22.705 21.5756 22.258 22.0846 21.696C22.5936 21.134 22.9769 20.47 23.2089 19.7481L23.9999 17.4039L24.7905 19.7481C25.0226 20.4699 25.406 21.1339 25.9149 21.6959C26.4239 22.2578 27.0468 22.7048 27.7422 23.0071L30.1249 24L27.7429 24.993ZM18.2249 31.5833C18.225 31.6525 18.2046 31.7201 18.1663 31.7776C18.1279 31.8351 18.0734 31.8799 18.0095 31.9064L16.6594 32.4692C16.524 32.5296 16.4029 32.6181 16.3044 32.7289C16.2058 32.8397 16.132 32.9702 16.0878 33.1118L15.5819 34.6117C15.5585 34.681 15.5139 34.7413 15.4544 34.7839C15.3949 34.8266 15.3235 34.8496 15.2503 34.8496C15.1771 34.8496 15.1058 34.8266 15.0463 34.7839C14.9868 34.7413 14.9422 34.681 14.9188 34.6117L14.4124 33.1117C14.3681 32.9703 14.2942 32.84 14.1957 32.7293C14.0971 32.6187 13.9761 32.5303 13.8408 32.47L12.4907 31.9072C12.4269 31.8806 12.3725 31.8358 12.3342 31.7783C12.2958 31.7208 12.2754 31.6532 12.2754 31.5842C12.2754 31.5151 12.2958 31.4475 12.3342 31.39C12.3725 31.3326 12.4269 31.2877 12.4907 31.2611L13.8408 30.6983C13.9762 30.6379 14.0973 30.5494 14.1958 30.4386C14.2944 30.3278 14.3683 30.1973 14.4124 30.0557L14.9183 28.5558C14.9472 28.4921 14.9939 28.4381 15.0527 28.4002C15.1115 28.3624 15.1799 28.3422 15.2499 28.3422C15.3198 28.3422 15.3883 28.3624 15.4471 28.4002C15.5059 28.4381 15.5525 28.4921 15.5814 28.5558L16.0873 30.055C16.1316 30.1964 16.2055 30.3267 16.3041 30.4373C16.4027 30.548 16.5236 30.6364 16.659 30.6967L18.009 31.2595C18.0731 31.2859 18.1279 31.3308 18.1663 31.3885C18.2048 31.4462 18.2252 31.514 18.2249 31.5833ZM35.7249 16.4167C35.725 16.4858 35.7046 16.5534 35.6663 16.6109C35.628 16.6684 35.5734 16.7133 35.5095 16.7397L34.1594 17.3025C34.024 17.3629 33.9029 17.4514 33.8044 17.5622C33.7058 17.673 33.632 17.8036 33.5878 17.9451L33.0819 19.445C33.0585 19.5143 33.0139 19.5746 32.9544 19.6173C32.8949 19.6599 32.8236 19.6829 32.7503 19.6829C32.6771 19.6829 32.6058 19.6599 32.5463 19.6173C32.4868 19.5746 32.4422 19.5143 32.4188 19.445L31.9124 17.945C31.8681 17.8036 31.7942 17.6733 31.6957 17.5627C31.5971 17.452 31.4761 17.3636 31.3408 17.3033L29.9907 16.7405C29.9269 16.714 29.8725 16.6691 29.8342 16.6116C29.7958 16.5541 29.7754 16.4866 29.7754 16.4175C29.7754 16.3484 29.7958 16.2809 29.8342 16.2234C29.8725 16.1659 29.9269 16.121 29.9907 16.0944L31.3408 15.5316C31.4762 15.4713 31.5973 15.3827 31.6958 15.2719C31.7944 15.1611 31.8683 15.0306 31.9124 14.889L32.4183 13.3892C32.4472 13.3255 32.4939 13.2715 32.5527 13.2336C32.6115 13.1957 32.6799 13.1755 32.7499 13.1755C32.8198 13.1755 32.8883 13.1957 32.9471 13.2336C33.0059 13.2715 33.0525 13.3255 33.0814 13.3892L33.5873 14.8883C33.6316 15.0297 33.7055 15.1601 33.8041 15.2707C33.9027 15.3813 34.0236 15.4697 34.159 15.53L35.509 16.0928C35.5731 16.1192 35.6279 16.1642 35.6663 16.2218C35.7048 16.2795 35.7252 16.3474 35.7249 16.4167Z",fill:"white"}),S.createElement("defs",null,S.createElement("radialGradient",{id:"paint0_radial_330_11972",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(42 -2.01166e-06) rotate(110.556) scale(51.264)"},S.createElement("stop",{stopColor:"white"}),S.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0})))),AP=i=>S.createElement("svg",{width:48,height:48,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},S.createElement("rect",{width:48,height:48,rx:12,fill:"#7F53FD"}),S.createElement("rect",{width:48,height:48,rx:12,fill:"url(#paint0_radial_330_11956)",fillOpacity:.2}),S.createElement("path",{d:"M19.9953 23.3761C22.0454 23.3761 23.7074 21.7141 23.7074 19.664C23.7074 17.6139 22.0454 15.9519 19.9953 15.9519C17.9452 15.9519 16.2832 17.6139 16.2832 19.664C16.2832 21.7141 17.9452 23.3761 19.9953 23.3761Z",stroke:"white",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M13.5 32.9216C13.5 27.7667 16.593 26.4937 20.7169 26.4937C24.3543 26.4937 27.1896 23.4737 27.808 19.9314C27.8866 19.5219 28.1066 19.153 28.4295 18.8892C28.7524 18.6253 29.1577 18.4833 29.5746 18.4878C29.8388 18.4882 30.0997 18.5462 30.3391 18.6579C30.5785 18.7696 30.7907 18.9322 30.9607 19.1343C31.1308 19.3365 31.2547 19.5733 31.3237 19.8283C31.3928 20.0833 31.4053 20.3503 31.3605 20.6107C30.9127 23.2615 29.5758 25.6809 27.5698 27.4707C27.3053 27.695 27.1244 28.0022 27.0565 28.3424C26.9886 28.6825 27.0377 29.0356 27.1958 29.3444C27.7281 30.4594 27.9813 31.6871 27.9338 32.9217",stroke:"white",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M34.5006 19.558C34.5011 19.0024 34.3921 18.4523 34.1797 17.9389C33.9674 17.4256 33.6559 16.9592 33.2631 16.5664C32.8703 16.1735 32.4038 15.8621 31.8905 15.6497C31.3772 15.4374 30.827 15.3283 30.2715 15.3289",stroke:"white",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("defs",null,S.createElement("radialGradient",{id:"paint0_radial_330_11956",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(42 -2.01166e-06) rotate(110.556) scale(51.264)"},S.createElement("stop",{stopColor:"white"}),S.createElement("stop",{offset:1,stopColor:"white",stopOpacity:0}))));function FP({upsellState:i,onClose:e}){const t=i.requiresTeam,{planPrivilege:s}=S.useContext(je),[r,o]=S.useState(!1),n=S.useRef(null);return S.useEffect(()=>(t&&!r?n.current=setTimeout(()=>{o(!0),n.current=null},500):!t&&r&&o(!1),()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[t]),C.jsx("div",{className:"modal-content modal-content-animated modal-content-wider overflow-y-auto max-h-[90vh]",children:C.jsxs(MP,{children:[C.jsx("div",{className:"absolute top-2 right-2",children:C.jsx(Jf,{onClick:e})}),C.jsx("div",{className:"p-6 text-center text-primary-new-550 font-medium text-xl",children:"Upgrade for more report features"}),C.jsxs("div",{className:"px-8 pb-8 flex flex-row items-stretch gap-8",children:[C.jsxs($f,{className:Ut(s==="pro"&&"pointer-events-none opacity-50"),$bordered:!1,children:[C.jsxs("div",{className:"text-center pb-8",children:[C.jsx(TP,{className:"mx-auto"}),C.jsx("div",{className:"pt-3 font-medium text-[1.375rem]",children:"Pro"})]}),C.jsx(Fu,{className:"text-[#4d83fa]",children:"Get more insights from reports"}),C.jsxs(Mu,{className:"text-lg pb-8",children:[C.jsx("li",{children:"Filter by workspace, user, and more"}),C.jsx("li",{children:"See top products and brands sent, accepted, and swapped for"}),C.jsx("li",{children:"Compare spend, gifts sent, and gifts accepted between users"})]}),C.jsx(Fu,{className:"text-[#4d83fa]",children:"Plus more features"}),C.jsxs(Mu,{children:[C.jsx("li",{children:"Add digital branding to gift notifications"}),C.jsx("li",{children:"Send gift cards"}),C.jsx("li",{children:"Send international gifts"}),C.jsx("li",{children:"Send from your own Gmail account"})]}),C.jsx("div",{className:"mt-auto"}),C.jsxs("div",{className:"flex flex-col items-center gap-3 pt-4",children:[C.jsx(LP,{to:tn("plus","/subscribe-pro"),children:"Upgrade"}),C.jsx(Sc,{to:tn("business","/pricing"),className:"text-gray-450 font-medium hover:text-gray-500 active:text-gray-600 transition-colors",children:"Starting at $20/month – learn more"})]})]}),C.jsxs($f,{$bordered:r,children:[C.jsxs("div",{className:"text-center pb-8",children:[C.jsx(AP,{className:"mx-auto"}),C.jsx("div",{className:"pt-3 font-medium text-[1.375rem]",children:"Team"})]}),C.jsx(Fu,{className:"text-primary-new-550",children:"Everything in Pro, plus:"}),C.jsxs(Mu,{className:"text-lg pb-8",children:[C.jsx("li",{children:"View counts per gift + total impressions per day"}),C.jsx("li",{children:"Time to open and time to accept"}),C.jsx("li",{children:"Swap rate and meetings scheduled"})]}),C.jsx(Fu,{className:"text-primary-new-550",children:"Plus more features"}),C.jsxs(Mu,{children:[C.jsx("li",{children:"Unlimited seats for your entire company"}),C.jsx("li",{children:"Set and manage budgets for your team"}),C.jsx("li",{children:"Build custom digital stores for gifts & swag"}),C.jsx("li",{children:"Automate employee gifts with HR integration"}),C.jsx("li",{children:"Integrate Salesforce and Calendly to gift from CRM and close meetings"})]}),C.jsx("div",{className:"mt-auto"}),C.jsxs("div",{className:"flex flex-col items-center gap-3 pt-4",children:[C.jsx(IP,{to:tn("business","/team-demo"),children:"Get a demo"}),C.jsx(Sc,{to:tn("business","/pricing"),className:"text-gray-450 font-medium hover:text-gray-500 active:text-gray-600 transition-colors",children:"Learn more"})]})]})]})]})})}const MP=st.div.attrs({className:"relative"})`
background: linear-gradient(
265deg,
rgba(205, 195, 247, 0.39) -112%,
rgba(255, 255, 255, 0.39) 152%
);
`,$f=st.div.attrs(Po("flex-1 bg-white pt-5 pb-8 px-6 rounded-lg flex flex-col items-stretch transition-all"))`
box-shadow: ${i=>i.$bordered?"0 4px 16px rgba(0, 0, 0, 0.05), 0 0 0 3px #b9a5f3":"0 4px 16px rgba(0, 0, 0, 0.05)"};
`,Fu=Dt.div`font-medium uppercase text-sm pb-4 text-center`,Mu=Dt.ul`list-disc pl-5 [&_li]:pb-4`,Ny=st(Sc).attrs(Po("rounded-full px-8 py-3 font-medium text-white hover:opacity-80 active:opacity-90 active:scale-95 transition-all text-center"))``,LP=st(Ny)`
background: radial-gradient(
100% 100% at 87.5% 0%,
rgba(255, 255, 255, 0.2) 0%,
rgba(255, 255, 255, 0) 100%
),
#4d83fa;
`,IP=st(Ny)`
background: radial-gradient(
100% 100% at 87.5% 0%,
rgba(255, 255, 255, 0.2) 0%,
rgba(255, 255, 255, 0) 100%
),
#7f53fd;
`;function OP(i,e){const t={};for(const r in i){const o=i[r];Object.keys(o).length>0&&(t[`filter_${r}`]=Object.keys(o).join(","))}return t.date_range=e.rangeType,e.rangeType==="custom"&&(t.date_start=e.start.toISOString().split("T")[0],t.date_end=e.end.toISOString().split("T")[0]),"#"+new URLSearchParams(t).toString()}function NP(i,e,t){const s=new URLSearchParams(e.replace(/^#/,""));return{selectedFilters:kP(s,i),selectedDateRange:GP(s,t)}}function kP(i,e){const t={};for(const s of Array.from(i.keys()))if(s.startsWith("filter_")){const r=s.replace(/^filter_/,""),o=e.find(n=>n.id===r);if(o){const n=o.options.map(u=>u.key),a=i.get(s).split(","),l=o.id==="gift_batch"?a:yw(n,a);t[r]=Object.fromEntries(l.map(u=>[u,!0]))}}return t}function GP(i,e){let t=i.get("date_range");if(t==="custom"){const s=i.get("date_start"),r=i.get("date_end"),o=to(s),n=to(r);if(Rc(o)&&Rc(n))return{rangeType:"custom",start:o,end:n}}return(!t||!hw.includes(t)||t==="custom")&&(t="last_14_days"),xc(t,e)}function VP(){const i=S.useRef(window.location.hash).current,e=S.useRef(!1),[t,s]=S.useState(!1),{data:r,loading:o}=dw(HP),n=r?.reportFilterClasses||null,[a]=cw("organization"),[l,u]=S.useState({}),[h,d]=S.useState(xc("last_14_days",a?.quarterStartMonth||1)),c=D=>l[D]?Object.keys(l[D]):[],p=(D,M)=>{const O=Vg(l);O[D]?O[D][M]?delete O[D][M]:O[D][M]=!0:(O[D]={},O[D][M]=!0),u(O)},y=D=>{const M=Vg(l);M[D]={},u(M)},f=()=>{u({})};S.useEffect(()=>{e.current&&(window.location.hash=OP(l,h))},[e.current,l,h]),S.useEffect(()=>{if(n&&!e.current){if(e.current=!0,i){const D=NP(n,i,a?.quarterStartMonth||1);u(D.selectedFilters),d(D.selectedDateRange)}s(!0)}},[i,e.current,n,u,d]);const w=D=>{d(xc(D,a?.quarterStartMonth||1))},_=D=>{(!Hg(D.start,h.start)||!Hg(D.end,h.end))&&d({...D,rangeType:"custom"})},P=()=>({dateStart:h.start.toISOString().split("T")[0],dateEnd:h.end.toISOString().split("T")[0],workspaces:Object.keys(l.workspaces||{}),users:Object.keys(l.users||{}),status:Object.keys(l.status||{}),balance:Object.keys(l.balance||{}),autogiftType:Object.keys(l.autogift_type||{}),giftBatch:Object.keys(l.gift_batch||{})});return{filterClasses:n,selectedFilters:l,selectedFilterOptionsForClass:c,toggleFilterOption:p,removeAllSelectionsForFilterClass:y,removeAllFilters:f,filtersLoading:o,selectedDateRange:h,setSelectedDateRange:d,setSelectedDateRangeFromDates:_,setDateRangePreset:w,getGraphqlVariables:P,ready:t,useRequestChartData:(D,M)=>S.useEffect(()=>{t&&D(P())},[t,h,l].concat(M||[]))}}const HP=zt`
query Reports_FilterClasses {
reportFilterClasses {
id
name
options {
id
key
name
description
inactive
}
}
}
`;function BP(){const[i,e]=S.useState({visible:!1,referringFeature:null,requiresTeam:!1});return sm(),{upsellVisible:i.visible,setUpsellVisible:o=>{e({...i,visible:o})},showUpsell:(o,n)=>{e({visible:!0,referringFeature:o,requiresTeam:n})},upsellState:i}}function uT(){const{filterClasses:i,selectedFilters:e,selectedFilterOptionsForClass:t,toggleFilterOption:s,removeAllSelectionsForFilterClass:r,removeAllFilters:o,selectedDateRange:n,setSelectedDateRange:a,setDateRangePreset:l,setSelectedDateRangeFromDates:u,getGraphqlVariables:h,ready:d,useRequestChartData:c}=VP(),{showUpsell:p,upsellVisible:y,setUpsellVisible:f,upsellState:w}=BP(),[_,P]=S.useState(!1),[T,D]=S.useState("all_filters"),{privilege:M}=sm(),[O,N]=S.useState(!1),z=Y=>{D(Y),P(!0)};return C.jsxs(je.Provider,{value:{filterClasses:i,selectedFilters:e,selectedFilterOptionsForClass:t,openFilterDrawer:z,setFilterDrawerPage:D,toggleFilterOption:s,removeAllSelectionsForFilterClass:r,removeAllFilters:o,selectedDateRange:n,setSelectedDateRange:a,setDateRangePreset:l,setSelectedDateRangeFromDates:u,setDateRangeDrawerOpen:N,getGraphqlVariables:h,ready:d,useRequestChartData:c,planPrivilege:M,showUpsell:p},children:[C.jsxs("div",{className:"border-t border-primary-100",children:[C.jsxs("div",{className:"min-h-[100vh]",children:[C.jsx(PP,{}),C.jsx(JD,{})]}),C.jsx(_P,{open:_,page:T,onClose:()=>{P(!1)}}),C.jsx(nP,{open:O,onClose:()=>{N(!1)}})]}),C.jsx(pw,{isOpen:y,style:gw,closeTimeoutMS:500,shouldCloseOnOverlayClick:!0,shouldCloseOnEsc:!0,onRequestClose:()=>f(!1),children:C.jsx(FP,{upsellState:w,onClose:()=>f(!1)})})]})}export{uT as default};